Skip to content

fix(bench): retain source ownership in unknown and mixed excerpts - #1240

Merged
navidemad merged 3 commits into
mainfrom
codex/1239-scorer-source-ownership
Oct 18, 2026
Merged

navidemad merged 3 commits into
mainfrom
codex/1239-scorer-source-ownership

Conversation

@navidemad

@navidemad navidemad commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1239

Summary

Retains source ownership for unresolved headers and explicitly numbered rows in mixed excerpts. This follows #1235/#1237 with measurement protocol v4; no retrieval or process-status behavior changes.

 parse_brief -> block_lines / header_of
- unknown source: retry its fence globally
- mixed rows below 60% numbered: renumber the fence sequentially
+ every syntactic source header owns/consumes its body, even when unresolved
+ any explicit numbered rows use their own bounded coordinates; ignore unnumbered rows in mixed bodies

Graph/text consumer audit: score_all, brief-check, probe-test, and probe-translate share the parser; their API is unchanged. The graph reports a lower bound with unresolved Python call sites; text search covers those imports.

Evidence

  • Before: on merged v3 20670993b0f2ed778cd7226955e4582df91c37e0, the new tests alone fail with six assertions: unknown docs receive src/app.py:7, mixed fences invent header line 2, and valid mixed bare numbered rows lose credit. Command: python3 -I scripts/bench/tool-census/score_brief.py --self-test SelfTest.test_unknown_source_owns_its_fence_without_global_matchback SelfTest.test_mixed_numbered_blocks_cannot_renumber_rows_into_the_header_range (tests added, production parser unchanged), exit 1.
  • After: the same command passes both methods, exit 0. Genuine headerless matchback remains a positive control; existing wholly unnumbered excerpt tests are retained. On code candidate 8c02189cc2d134d008b80ddc1672bd6d94e13f8a: 40 scorer tests, 16 brief-check tests, 24 probe-test tests and 4 probe-translate tests pass. SPDX and whitespace checks pass. The later evidence-only head 3612ad4f0fafb21df0e030c8693245ca1e6dfcda retains scorer SHA-256 95bf349407a86091b7627f0d7726697478408b743345b32d4ed919da36233106.
  • Independent baseline controls: 31/34 pass; the three failures cover these two defects; all 22 process-status controls pass. Replaying the transmitted script unchanged in a separate output directory gives 34/34, including 22/22 process controls. This implementer replay is distinct from the subsequent independent retest documented below.
  • Same frozen 56-brief v3/v4 replay: 0 changed questions, 0 changed categories, exits 0/0. Two full native bench(brief): freeze the probe home and pin score_brief.py runs so #906 packs compare like for like #1201 runs: 56/56 byte-identical briefs, all equal to the old frozen texts; no metric difference between repetitions or versus the v4 replay. Each report is complete/exit 0: 53 ok + 3 abstained, no errors/cuts/partial results. Unchanged binary/probes/questions/seven pins were hash-verified; all benchmarks held /tmp/pixel-benchmark.lock. Internal p95 latency 657 / 705 ms is descriptive. Common integrated v4 reference with per-question/category/native evidence and commands. These edge cases are absent from the 56-brief corpus; synthetic regressions demonstrate the fix. No retrieval gain.
  • Independent retest: the original auditor verified exact code SHA 8c02189cc2d134d008b80ddc1672bd6d94e13f8a: 34/34 controls (same frozen script/fixtures as v3), 3/3 minimal controls, 40 scorer self-tests and a native optional-probe timeout control pass. Its independent replay agrees on all 56 brief hashes, seven pins and zero v3/v4 score deltas. The public head contains the same scorer bytes; this audit is not a GitHub approval.
  • Previous-head CI: run 39172406559 and CodeQL 39172406499 completed successfully on exact published head bdee0c162569ec6a0bbf405c1d4312eb98033832: Test + Format, both install.sh checks and all three CodeQL language analyses pass; Rust-only lanes are scope-skipped. No Rust changes, local installation, real-agent or zero-call claim, or mutation campaign.
  • Exact replay source provenance: the before checkout is 3027ea60f4c2692905828860218617e1d70f7f46, whose whole tree is identical to merged baseline 20670993b0f2ed778cd7226955e4582df91c37e0 (45de73045f83b8491426461634c5f9f0a014c26d). The after checkout is code commit 8c02189c. The documentation-only supplement recording this equivalence and the external audit is signed and published at 3612ad4f0fafb21df0e030c8693245ca1e6dfcda. Only README.md and identity.json changed after the previous CI-validated head; scorer bytes are unchanged. Final-head CI: run 39173299066 and CodeQL 39173299057 are complete/success on exact head 3612ad4f0fafb21df0e030c8693245ca1e6dfcda. Test + Format, both install.sh checks, Record the green verdict and all three CodeQL language analyses pass; Rust-only lanes are scope-skipped. The signed publication is complete; the worktree is clean. Merged with --admin on explicit maintainer authorization as 7b178f5a7e584563d474e8a6056a4a9f7e5f891b. The merged tree equals the CI-validated head; scorer and questions hashes were reverified after merge.

Merge Danger

Door: two-way for tooling; newly emitted reports name protocol v4, historical reports remain untouched.

Blast radius: bench scoring and parser consumers. Unknown-source quotes cannot earn global code credit; mixed blocks can lose false sequential credit or regain their valid explicit coordinates.

Docs touched

SCORING_PROTOCOL.md records protocol v4, mixed-row semantics and headerless/unnumbered controls. No changelog fragment: measurement tooling ships nothing in the binary. ARCHITECTURE.md and agent prompts describe unchanged runtime behavior. The dated v3 common reference remains immutable; the v4 comparison is published separately under docs/bench/scorer-protocol-v4-2026-10-19/.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@navidemad
navidemad merged commit 7b178f5 into main Oct 18, 2026
16 checks passed
@navidemad
navidemad deleted the codex/1239-scorer-source-ownership branch October 18, 2026 23:01
LivioGama pushed a commit that referenced this pull request Nov 25, 2026
)

* fix(bench): retain source ownership in unknown and mixed excerpts

* docs(bench): publish scorer v4 fixed-input validation reference

* docs(bench): record independent v4 retest and exact replay provenance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(bench): retain source ownership for unknown and mixed excerpts

1 participant