feat: verify linked-issue consistency for the selected PR (Closes #314) #360

Merged
sysadmin merged 2 commits from feat/issue-314-linked-issue-consistency into master 2026-07-07 04:45:11 -05:00
Owner

Summary

Implements #314: reviewer reports must verify linked issue consistency for the selected PR.

Adds assess_linked_issue_consistency(report_text, *, selected_pr=None, linked_issues=None) to review_proofs.py:

  • Live-proof gatelinked_issues carries the issue numbers the selected PR was live-verified to link this session. When it is None (no live verification), any populated Linked issue status claim fails; the only passing wording is Linked issue status: not verified in this session (required behavior #3 of the issue).
  • Consistency gate — with live proof, the Linked issue status field must name every linked issue; a missing linked issue fails, and any issue number in the field outside the verified set fails.
  • Stale-leak gate — any Issue #N mention anywhere in the report that is not a live-verified linked issue fails as stale leakage (the PR #280 report mentioning Issue #260 instead of Issue #275, the incident that filed this issue). PR #N mentions are not confused with issue mentions.
  • Missing Linked issue status field fails closed. Returns {complete, downgraded, reasons} matching sibling verifiers.

Tests

  • New tests/test_linked_issue_consistency.py: 9 tests covering correct linked issue, stale previous issue in the status field, stale issue in read-only diagnostics, missing live proof, passing unverified wording, missing field, multiple linked issues (all reported / one missing), and PR-number mentions (acceptance criteria of #314).
  • TDD: tests written first, verified failing on import before implementation; 9/9 pass after.
  • Full suite in the branch worktree: 1161 passed, 6 skipped, 20 subtests passed, 1 failed — the failure tests/test_agent_temp_artifacts.py::TestIssueLockArtifactWarning::test_lock_success_includes_artifact_warning is pre-existing on clean master baseline (stale mock missing newer base-equivalence lock-gate fields), not introduced by this branch.

Closes #314

🤖 Generated with Claude Code

## Summary Implements #314: reviewer reports must verify linked issue consistency for the selected PR. Adds `assess_linked_issue_consistency(report_text, *, selected_pr=None, linked_issues=None)` to `review_proofs.py`: - **Live-proof gate** — `linked_issues` carries the issue numbers the selected PR was live-verified to link this session. When it is `None` (no live verification), any populated `Linked issue status` claim fails; the only passing wording is `Linked issue status: not verified in this session` (required behavior #3 of the issue). - **Consistency gate** — with live proof, the `Linked issue status` field must name every linked issue; a missing linked issue fails, and any issue number in the field outside the verified set fails. - **Stale-leak gate** — any `Issue #N` mention anywhere in the report that is not a live-verified linked issue fails as stale leakage (the PR #280 report mentioning Issue #260 instead of Issue #275, the incident that filed this issue). `PR #N` mentions are not confused with issue mentions. - Missing `Linked issue status` field fails closed. Returns `{complete, downgraded, reasons}` matching sibling verifiers. ## Tests - New `tests/test_linked_issue_consistency.py`: 9 tests covering correct linked issue, stale previous issue in the status field, stale issue in read-only diagnostics, missing live proof, passing unverified wording, missing field, multiple linked issues (all reported / one missing), and PR-number mentions (acceptance criteria of #314). - TDD: tests written first, verified failing on import before implementation; 9/9 pass after. - Full suite in the branch worktree: `1161 passed, 6 skipped, 20 subtests passed, 1 failed` — the failure `tests/test_agent_temp_artifacts.py::TestIssueLockArtifactWarning::test_lock_success_includes_artifact_warning` is pre-existing on clean `master` baseline (stale mock missing newer base-equivalence lock-gate fields), not introduced by this branch. Closes #314 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jcwalker3 added 1 commit 2026-07-07 04:24:22 -05:00
Add assess_linked_issue_consistency to review_proofs: reviewer final
reports must report a "Linked issue status" that matches the issue(s)
the selected PR was live-verified to link this session. Without live
proof the field may only say "not verified in this session"; with
proof, every linked issue must be named, and any other "Issue #N"
mention anywhere in the report fails as stale leakage from a previous
PR (the PR #280 / Issue #260-vs-#275 incident). Missing field fails
closed. Tests cover correct linked issue, stale previous issue in both
the status field and diagnostics, missing proof, unverified wording,
multiple linked issues, and PR-number mentions not being mistaken for
issue mentions.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
jcwalker3 added 1 commit 2026-07-07 04:35:20 -05:00
sysadmin approved these changes 2026-07-07 04:45:00 -05:00
sysadmin left a comment
Owner

All tests pass successfully. Reviewed the implementation of assess_linked_issue_consistency in review_proofs.py and the test coverage in tests/test_linked_issue_consistency.py. It correctly verifies that the linked issue status field matches the selected PR and that no stale issue numbers leak into the final report. Verified that the test failures are pre-existing on master.

All tests pass successfully. Reviewed the implementation of `assess_linked_issue_consistency` in `review_proofs.py` and the test coverage in `tests/test_linked_issue_consistency.py`. It correctly verifies that the linked issue status field matches the selected PR and that no stale issue numbers leak into the final report. Verified that the test failures are pre-existing on master.
sysadmin merged commit 5e023dcc97 into master 2026-07-07 04:45:11 -05:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

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