Skip to content

feat(opencode): add head-matched gold corpus tooling - #831

Draft
seonghobae wants to merge 6 commits into
feat/opencode-review-quality-gatefrom
feat/opencode-review-gold-corpus
Draft

feat(opencode): add head-matched gold corpus tooling#831
seonghobae wants to merge 6 commits into
feat/opencode-review-quality-gatefrom
feat/opencode-review-gold-corpus

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Purpose

Implement Task 4 of the OpenCode review-quality program: deterministic exact-head sampling and blinded two-expert-plus-adjudicator freezing for a real expert-gold corpus.

Exact stacked identity

  • stacked base branch: feat/opencode-review-quality-gate (PR feat(opencode): add empirical review-quality gate #829);
  • exact stacked base SHA: 523e883b9088d1ac7edad3f3f60eb6ebdb0948a7;
  • branch: feat/opencode-review-gold-corpus;
  • initial test-only RED head: ad71f1fddefbbca5be3d94d90434a6c172188d96;
  • exact current GREEN head: 2d3100b27d1d979e6e2f3ead2fc278b08a840b44;
  • state: Draft, mechanically mergeable, not eligible to merge before its stacked base integrates.

No check, review, approval, or comment from PR #829 authorizes this stacked head. If #829 moves or merges, this branch must be reconciled once onto the integrated protected base and every exact-head evidence surface regenerated.

Test-first evidence

The initial exact RED run 31257290890 checked out ad71f1fddefbbca5be3d94d90434a6c172188d96 and failed during test collection because the two production modules intentionally did not exist. That result proves the permanent contracts preceded implementation; it is not acceptance evidence for the current head.

The implementation then added strict offline corpus tooling, split the adjudication boundary into focused modules, and added only coverage regressions required by the permanent 100% gate. No test was deleted, weakened, skipped, or converted into an expected failure.

Implemented sampling contract

  • deterministic seeded selection from a strict UTF-8 JSON inventory;
  • duplicate JSON member and non-finite number rejection;
  • exact repository, PR, base/head, diff, and repository-context identity validation;
  • duplicate exact-head case rejection;
  • explicit same-head review, full-context, and independent-expert eligibility;
  • hard minimum language coverage;
  • required small/medium/large diff-size coverage;
  • required risk and defect-class coverage;
  • deterministic seed-bound tie breaking and stratum rotation;
  • source inventory, selected sample, and selection SHA-256 receipts;
  • stable distinction between malformed inventory and valid-but-insufficient inventory;
  • atomic output with no live GitHub, network, credential, or code-execution authority.

Implemented blinded gold contract

  • two distinct pseudonymous experts and one distinct pseudonymous adjudicator;
  • identical immutable case identity across both annotations and adjudication;
  • explicit proof that automated reviewer outputs were hidden;
  • explicit proof that complete repository context was reviewed;
  • exhaustive-annotation confirmation;
  • every expert finding adjudicated exactly once;
  • accepted gold requiring path, positive line, defect class, severity, trigger, impact, root cause, fix direction, and regression target;
  • rejected reports prohibited from minting gold or carrying accepted-source fields;
  • duplicate expert reports merged into one canonical finding;
  • deterministic expert, adjudication, and freeze SHA-256 receipts;
  • stable strict-JSON and atomic CLI behavior.

The tools do not create expert judgments. Live acquisition, expert review, and reviewer-output capture remain separately authorized human/trusted-collector boundaries. The committed head_matched_v1 directory explicitly remains EMPTY_PENDING_REAL_COLLECTION; no fabricated case or parity claim is included.

Exact-current-head verification

OpenCode Review Corpus Quality CI run 31259176993 checked out exact head 2d3100b27d1d979e6e2f3ead2fc278b08a840b44 and completed successfully:

  • 55 passed;
  • total production statements: 487/487;
  • total production branches: 170/170;
  • production statement and branch coverage: 100%;
  • compileall: success;
  • clean-tree verification: success.

Per-module evidence:

  • opencode_review_sample.py: 212 statements, 68 branches, 100%;
  • opencode_review_adjudicate.py: 91 statements, 26 branches, 100%;
  • adjudication primitives: 85 statements, 28 branches, 100%;
  • annotation validator: 40 statements, 16 branches, 100%;
  • adjudication decision validator: 59 statements, 32 branches, 100%.

The doctoring protocol records blinding, role separation, exact-head collection, sampling, adjudication, partition leakage prevention, reviewer capture after gold freeze, privacy/security, quality controls, limitations, and APA 7th research traceability. CHANGELOG.md records the bounded capability.

Safety and acceptance

  • no production dispatch, reviewer credential, model policy, branch protection, merge path, or provider secret changes;
  • no COPILOT_GITHUB_TOKEN use;
  • no fabricated expert annotations, automated-human substitution, or parity claim;
  • no temporary, one-shot, self-modifying, or write-capable workflow;
  • exact-head checkout uses immutable action pins with persisted credentials disabled;
  • the workflow token remains read-only.

Keep Draft and do not merge until PR #829 reaches protected main, this branch is reconciled onto that exact protected base, the complete organization CI/security/review suite reruns on the resulting exact head, no valid unresolved finding remains, and a qualifying independent non-author formal approval exists. Pending, skipped-required, status-only, author-only, stale-head, predecessor-head, synthetic-merge, rate-limited, or absent evidence is not acceptance.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d60a0a01-815b-4895-be27-72a79a077b55

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Contributor Author

@opencode-agent @cwl-noema-review

Review-only request for exact stacked head 2d3100b27d1d979e6e2f3ead2fc278b08a840b44 against exact stacked base 523e883b9088d1ac7edad3f3f60eb6ebdb0948a7 (feat/opencode-review-quality-gate, PR #829).

Inspect the complete 13-file diff, deterministic sampling algorithm, strict JSON boundaries, blinding and independence contracts, exhaustive finding coverage, accepted/rejected decision separation, immutable receipts, CLI failure classes, exact-head CI, APA 7th doctoring, and the explicit empty-real-corpus/parity claim boundary. Distinguish substantive source defects from the intentional absence of fabricated annotations and from stacked-base merge readiness.

Do not modify the branch, update or retarget the base, create expert judgments, reveal automated reviewer outputs to the gold process, approve on behalf of an author, merge, release, weaken tests, alter reviewer credentials/model policy, or reuse predecessor-head evidence.

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.

1 participant