Require PR inventory trust gate to be enforced in the live reviewer queue path #196

Closed
opened 2026-07-05 15:08:33 -05:00 by jcwalker3 · 1 comment
Owner

Problem

Issue #194 / PR #195 added a pr_inventory_trust_gate helper and unit tests, but the run transcript does not prove that the helper is wired into the actual reviewer PR inventory workflow. A helper that is not called by the empty-queue decision path does not prevent future agents from repeating the original failure.

Observed risk

The implementation report says pr_inventory_trust_gate was added to review_proofs.py with tests in tests/test_review_proofs.py. However, it does not prove that the actual reviewer queue path, gitea_list_prs(state=open) handling, or assess_inventory_completeness logic invokes the gate before reporting "no open PRs."

Required wall

No reviewer workflow may report "no open PRs," "queue empty," or stop cleanly on an empty PR list unless the live reviewer queue path has passed through pr_inventory_trust_gate and received trusted_empty.

Required behavior

When gitea_list_prs(state=open) returns an empty list:

  • The actual reviewer queue workflow must call pr_inventory_trust_gate.
  • trusted_empty is the only status that allows a clean empty-queue report.
  • untrusted_empty or inventory_error must stop with a blocker.
  • The final report must include the gate status, reasons, and corroboration source.
  • The workflow must not allow agents to bypass the gate by directly interpreting [] as "no open PRs."

Acceptance criteria

  • Add an integration test for the real reviewer queue/inventory path where gitea_list_prs(state=open) returns [] and no corroboration/finality proof exists; expected result: untrusted_empty, not "no open PRs."
  • Add an integration test where gitea_list_prs(state=open) returns [] but repository metadata or another approved independent read path confirms zero open PRs; expected result: trusted_empty.
  • Add an integration test proving the final report includes the trust-gate result before any empty-queue stop.
  • Add a regression test for the exact prior failure: the tool returns [] while context indicates open PRs exist; expected result: fail-closed blocker.
  • Ensure assess_inventory_completeness or the canonical reviewer queue selector cannot return an empty-queue success without the gate.
  • Update workflow documentation/templates so reviewer agents are required to report pr_inventory_trust_gate.status.

Suggested implementation

Wire pr_inventory_trust_gate into the canonical PR inventory completeness function, not just standalone tests. Any code path that turns PR inventory into a reviewer decision must consume the gate result.

Related

  • Follow-up to #194 (false-empty PR queue investigation) and PR #195 (pr_inventory_trust_gate helper + unit tests; head feat/issue-194-fail-closed-pr-inventory-wall).
  • Composes with #179 (reviewer A-bar proofs) and the #173 reviewer proof lineage in review_proofs.py.
### Problem Issue #194 / PR #195 added a `pr_inventory_trust_gate` helper and unit tests, but the run transcript does not prove that the helper is wired into the actual reviewer PR inventory workflow. A helper that is not called by the empty-queue decision path does not prevent future agents from repeating the original failure. ### Observed risk The implementation report says `pr_inventory_trust_gate` was added to `review_proofs.py` with tests in `tests/test_review_proofs.py`. However, it does not prove that the actual reviewer queue path, `gitea_list_prs(state=open)` handling, or `assess_inventory_completeness` logic invokes the gate before reporting "no open PRs." ### Required wall No reviewer workflow may report "no open PRs," "queue empty," or stop cleanly on an empty PR list unless the live reviewer queue path has passed through `pr_inventory_trust_gate` and received `trusted_empty`. ### Required behavior When `gitea_list_prs(state=open)` returns an empty list: * The actual reviewer queue workflow must call `pr_inventory_trust_gate`. * `trusted_empty` is the only status that allows a clean empty-queue report. * `untrusted_empty` or `inventory_error` must stop with a blocker. * The final report must include the gate status, reasons, and corroboration source. * The workflow must not allow agents to bypass the gate by directly interpreting `[]` as "no open PRs." ### Acceptance criteria * Add an integration test for the real reviewer queue/inventory path where `gitea_list_prs(state=open)` returns `[]` and no corroboration/finality proof exists; expected result: `untrusted_empty`, not "no open PRs." * Add an integration test where `gitea_list_prs(state=open)` returns `[]` but repository metadata or another approved independent read path confirms zero open PRs; expected result: `trusted_empty`. * Add an integration test proving the final report includes the trust-gate result before any empty-queue stop. * Add a regression test for the exact prior failure: the tool returns `[]` while context indicates open PRs exist; expected result: fail-closed blocker. * Ensure `assess_inventory_completeness` or the canonical reviewer queue selector cannot return an empty-queue success without the gate. * Update workflow documentation/templates so reviewer agents are required to report `pr_inventory_trust_gate.status`. ### Suggested implementation Wire `pr_inventory_trust_gate` into the canonical PR inventory completeness function, not just standalone tests. Any code path that turns PR inventory into a reviewer decision must consume the gate result. ### Related * Follow-up to #194 (false-empty PR queue investigation) and PR #195 (`pr_inventory_trust_gate` helper + unit tests; head `feat/issue-194-fail-closed-pr-inventory-wall`). * Composes with #179 (reviewer A-bar proofs) and the #173 reviewer proof lineage in `review_proofs.py`.
jcwalker3 added the status:in-progress label 2026-07-06 01:07:30 -05:00
Author
Owner

Implementation started on branch feat/issue-196-pr-inventory-trust-gate-live-path.

  • Wired pr_inventory_trust_gate into live gitea_review_pr empty-inventory path
  • Added assess_reviewer_queue_inventory + format_pr_inventory_trust_gate_report
  • Updated review-pr.md template
  • Tests: TestAssessReviewerQueueInventory + MCP inventory integration tests (147 passed)

Opening PR next.

Implementation started on branch `feat/issue-196-pr-inventory-trust-gate-live-path`. - Wired `pr_inventory_trust_gate` into live `gitea_review_pr` empty-inventory path - Added `assess_reviewer_queue_inventory` + `format_pr_inventory_trust_gate_report` - Updated `review-pr.md` template - Tests: `TestAssessReviewerQueueInventory` + MCP inventory integration tests (147 passed) Opening PR next.
sysadmin removed the status:in-progress label 2026-07-06 10:14:24 -05:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Scaled-Tech-Consulting/Gitea-Tools#196