feat: add dedicated reconciliation controller-handoff schema (Closes #303) #373

Merged
sysadmin merged 2 commits from feat/issue-303-reconciliation-handoff into master 2026-07-07 08:42:41 -05:00
Owner

Summary

Implements #303: controller handoff schema must support already-landed PR reconciliation.

Adds assess_reconciliation_handoff(report_text, observed_commands=None) to review_proofs.py, plus the RECONCILIATION_HANDOFF_FIELDS schema and RECONCILIATION_FORBIDDEN_FIELDS list:

  • Dedicated schema — the Controller Handoff section must carry every reconciliation field from the issue: Task, Repo, Role/profile, Identity, Selected PR, PR live state, Candidate head SHA, Target branch (+ SHA), Ancestor proof, Linked issue (+ live status), Eligibility class: ALREADY_LANDED_RECONCILE_REQUIRED, Capabilities proven / Missing capabilities, PR/Issue comments posted, PRs/Issues closed, Git ref / Worktree / MCP-Gitea / External-state mutations, Read-only diagnostics, Blocker, Safe next action, No review/merge confirmation. Any missing field fails.
  • Stale-field rejectionPR number opened, Pinned reviewed head, Scratch worktree used, Workspace mutations, Issue lock proof, Claim/comment status each fail validation (the exact stale fields observed in the issue).
  • Fetch reporting — an observed git fetch/pull in the command log must appear under Git ref mutations; claiming none fails (acceptance criterion 3).
  • Wrong eligibility class fails; missing Controller Handoff section fails closed. Returns {complete, downgraded, reasons} matching sibling verifiers.

Tests

  • New tests/test_reconciliation_handoff.py: 13 tests — blocked reconciliation, successful PR close, comment-only reconciliation, no-op already-closed state, missing linked-issue proof, wrong eligibility class, missing handoff section, each stale field (five cases), and observed-fetch-claimed-none (acceptance criteria of #303).
  • TDD: tests verified failing on import first; 13/13 pass after.
  • Full suite in the branch worktree: 1237 passed, 6 skipped, 20 subtests, 2 failed — both failures are the known pre-existing master breakages, proven earlier on clean fa0cb12 (this branch's exact base): TestIssueLockArtifactWarning (#359, fix pending in PR #364) and test_final_report_validator::test_clean_reviewer_report_passes (#320/#327 fixture interaction, reported in the PR #367 handoff). Neither is introduced by this branch.

Closes #303

🤖 Generated with Claude Code

## Summary Implements #303: controller handoff schema must support already-landed PR reconciliation. Adds `assess_reconciliation_handoff(report_text, observed_commands=None)` to `review_proofs.py`, plus the `RECONCILIATION_HANDOFF_FIELDS` schema and `RECONCILIATION_FORBIDDEN_FIELDS` list: - **Dedicated schema** — the Controller Handoff section must carry every reconciliation field from the issue: Task, Repo, Role/profile, Identity, Selected PR, PR live state, Candidate head SHA, Target branch (+ SHA), Ancestor proof, Linked issue (+ live status), `Eligibility class: ALREADY_LANDED_RECONCILE_REQUIRED`, Capabilities proven / Missing capabilities, PR/Issue comments posted, PRs/Issues closed, Git ref / Worktree / MCP-Gitea / External-state mutations, Read-only diagnostics, Blocker, Safe next action, No review/merge confirmation. Any missing field fails. - **Stale-field rejection** — `PR number opened`, `Pinned reviewed head`, `Scratch worktree used`, `Workspace mutations`, `Issue lock proof`, `Claim/comment status` each fail validation (the exact stale fields observed in the issue). - **Fetch reporting** — an observed `git fetch`/`pull` in the command log must appear under `Git ref mutations`; claiming `none` fails (acceptance criterion 3). - Wrong eligibility class fails; missing Controller Handoff section fails closed. Returns `{complete, downgraded, reasons}` matching sibling verifiers. ## Tests - New `tests/test_reconciliation_handoff.py`: 13 tests — blocked reconciliation, successful PR close, comment-only reconciliation, no-op already-closed state, missing linked-issue proof, wrong eligibility class, missing handoff section, each stale field (five cases), and observed-fetch-claimed-none (acceptance criteria of #303). - TDD: tests verified failing on import first; 13/13 pass after. - Full suite in the branch worktree: `1237 passed, 6 skipped, 20 subtests, 2 failed` — both failures are the known pre-existing master breakages, proven earlier on clean fa0cb12 (this branch's exact base): `TestIssueLockArtifactWarning` (#359, fix pending in PR #364) and `test_final_report_validator::test_clean_reviewer_report_passes` (#320/#327 fixture interaction, reported in the PR #367 handoff). Neither is introduced by this branch. Closes #303 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jcwalker3 added 1 commit 2026-07-07 04:46:29 -05:00
Add assess_reconciliation_handoff to review_proofs: already-landed PR
reconciliation runs must emit a dedicated handoff schema (selected PR,
live state, candidate head SHA, target branch + SHA, ancestor proof,
linked issue + live status, eligibility class
ALREADY_LANDED_RECONCILE_REQUIRED, capability proofs, per-category
mutation ledger, blocker, safe next action, no-review/merge
confirmation) instead of author or reviewer fields. Stale fields (PR
number opened, Pinned reviewed head, Scratch worktree used, Workspace
mutations, Issue lock proof, Claim/comment status) fail validation, a
wrong eligibility class fails, and an observed git fetch/pull must be
reported under Git ref mutations rather than claimed none. Fails
closed on a missing Controller Handoff section. Tests cover blocked
reconciliation, successful PR close, comment-only, no-op
already-closed, missing linked-issue proof, wrong eligibility class,
each stale field, and unreported observed fetch.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
jcwalker3 added 1 commit 2026-07-07 08:37:25 -05:00
sysadmin approved these changes 2026-07-07 08:42:29 -05:00
sysadmin left a comment
Owner

All tests pass successfully after merging master (1359 passed, 1 failed [pre-existing]). Reviewed the implementation of assess_reconciliation_handoff in review_proofs.py and the test coverage in tests/test_reconciliation_handoff.py. It correctly introduces a dedicated handoff schema for already-landed PR reconciliation, enforcing presence of necessary fields and rejection of stale reviewer/author fields. Verified that the remaining failure is pre-existing on master.

All tests pass successfully after merging master (1359 passed, 1 failed [pre-existing]). Reviewed the implementation of `assess_reconciliation_handoff` in `review_proofs.py` and the test coverage in `tests/test_reconciliation_handoff.py`. It correctly introduces a dedicated handoff schema for already-landed PR reconciliation, enforcing presence of necessary fields and rejection of stale reviewer/author fields. Verified that the remaining failure is pre-existing on master.
sysadmin merged commit b6cf32c845 into master 2026-07-07 08:42:41 -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#373