Credit only the complexity a candidate stated

Merged
CH
7d ago
+98-15

A report credited a candidate with "O(log n) time and O(1) space" after they had stated only the time complexity. The brief gives the report model the reference approach, which for search-insert-position reads "O(log n) time, O(1) space" (src/agent/problem_rubrics.rs), and no rule told it that a property of the solution is not reasoning the candidate showed.

This adds one grounding rule to the report system instruction: the optimal approach and pitfalls in the brief describe the reference solution, and the code (or the board, on a whiteboard surface) itself shows what was built, so neither is reasoning the candidate stated. A complexity is credited as stated only when the transcript shows the candidate saying it, a rolling-assessment note records them saying or writing it, or they wrote it out in the code or on the board; never when it is inferred from the code itself, because interim_system_instruction grounds notes in what the candidate "said, wrote, or ran". A written complexity counts because the live interviewer asks a candidate whose speech was not recognized to type it as a code comment or write it on the board; it is credited as written, not said, and with zero candidate turns it stays coding evidence only, as the zero-turn brief from #423 requires. When the brief records candidate turns, a part of a technical question the candidate clearly left unanswered is a gap, not a strength, but an answer lost to recognition is not, since the transcription policy says a recognition gap is never the candidate's weakness, and a declined behavioral probe stays unassessed under the existing DECLINED_PROBE rules. With zero candidate turns the transcript shows a question and no answer, and that silence is neither positive nor negative, as the zero-turn brief says, so the clause does not apply. The code and the board stay evidence of what was built. The evidence ledger and report schema are unchanged.

Contract: report prompt 24 -> 25 and bundle 43 -> 44, as docs/interview-contract-versions.md requires for a prompt-only change. The prompt golden and its digest, ACTIVE_CONTRACT in web/lib.js, the bundle number pinned in the report-card word set, and the version table move with it; SCORABLE_SCHEMAS is untouched because report schema 4 is unchanged.

What the test shows: reference_complexity_is_not_credited_as_candidate_reasoning builds the brief for a candidate who states only the time complexity and checks that the reference space complexity reaches the model, then checks that the coding and whiteboard rules both carry each clause of the new rule. Removing any one clause (the reference-solution clause, the code-shows-what-was-built clause, the credit rule, the written-out source, the inferred-from-the-code exclusion, credited as written, the zero-turn limit, the technical-question limit, the candidate-turns limit, the recognition exception) makes it fail. What it does not show: that the model heeds the rule. A prompt rule lowers the chance of unsupported credit and cannot guarantee it, and no live report was generated for this change.

Validation: cargo test --test agent passes (303), and so do tests/browser/replay-render.test.js, tests/browser/lib.test.js and tests/browser/start-language.test.js. The earlier gates (browser 2/2) failure was the start-language.test.js timeout that #520 fixed; under the same local load it timed out on main before #520 as often as on this branch. Locally the full gate still fails lanes this change does not touch, for tools this Ubuntu 20.04 machine lacks or has too old: g++ 9 (no -std=c++20), git 2.25 (no git init -b), mawk 1.3.4 (the Refs last-line rule), and no gh, ruff, shfmt or Java.

Close #482