Repository navigation
review-graph: validate coverage partitions before accepting worker payloads #68
Description
Problem
The review-graph worker publication preflight accepts a ReviewPayload whose optional coverage partitions fail the subsequent compiler's semantic checks. A fresh worker can successfully run review-worker-payload-write and persist-worker-payload, then spend its single retry fixing a condition the publication gate already had enough information to reject.
Observed during a live $repo-review against research-repo-tools issue #22 with the dotfiles runtime at 7acf42f2b01ea6d1ec39eb45fda832fed35109d1.
Reproduction shape
Use a materialized audit dispatch owning src/lib.py and a otherwise valid compact review payload with:
{
"files_inspected": ["src/lib.py"],
"nearby_contract_owners": ["AGENTS.md", "pyproject.toml"],
"coverage_units": [
{
"unit_id": "library",
"owned_paths": ["src/lib.py"],
"dependency_paths": ["pyproject.toml"],
"dependency_uncertainty": "",
"finding_indices": []
}
]
}Supply the other required ReviewPayload fields normally. The owned-path partition is complete, but AGENTS.md is absent from all unit dependency paths.
- Stream the bytes through
review-worker-payload-write: accepted with an approval identity. - Persist the identical bytes with that identity: accepted.
- Run
compile-nodewith matching before/after source captures: rejected withcoverage units must account for every inspected nearby dependency.
The live audit recovered by removing the optional coverage_units, reviewing and republishing corrected bytes at the unaccepted staging path, then compiling successfully. No source or Git changes were needed.
Expected behavior
- Share coverage-partition semantic validation between publication preflight and compilation. Preserve the compiler check as defense in depth.
- Preflight should reject an incomplete partition before issuing an approval identity or writing the worker payload.
- Name the missing dependency paths in the diagnostic; the current message only describes the invariant.
- The generated worker prompt currently suggests optional partitions, but omits the full rule from
references/state-transitions.md: partition every owned path and finding exactly once and account for every nearby dependency. Include this rule in the dispatch prompt/schema guidance so fresh workers do not need a mutation-only reference to discover it. - Add regressions covering preflight/compiler parity for missing dependencies, duplicate/missing owned paths, and finding indices, plus the supported correction/republication path.
Relevant implementation: review_graph_runtime.py invokes validate_coverage_units during compilation around lines 892–897; the publication review starts around line 3137. The dependency check lives in review_graph_coverage.py.
Activity