Controller handoff validator must reject stale fields after already-landed PR gate #299

Closed
opened 2026-07-07 00:38:03 -05:00 by jcwalker3 · 1 comment
Owner

Reviewer workflows now correctly stop when an already-landed PR is detected, but controller handoffs still allow stale legacy fields that contradict the narrative report.

Observed behavior:

The narrative report correctly classified PR #278 as:

  • Eligibility class: ALREADY_LANDED_RECONCILE_REQUIRED
  • Candidate head SHA: 2a544...
  • Reviewed head SHA: none
  • Review worktree used: false
  • Git ref mutations: git fetch prgs master

However, the controller handoff still included stale fields:

  • Mutations: None
  • Workspace mutations: None
  • Pinned reviewed head: 2a544...
  • Scratch worktree used: False

Problem:

The human-readable report and controller handoff can disagree. This allows stale review/merge language to survive even when the workflow correctly stops before validation, approval, or merge.

Required behavior:

  1. Controller handoff validation must use the same canonical schema as the final report.

  2. If the already-landed gate fires, the handoff must use:

    • Eligibility class: ALREADY_LANDED_RECONCILE_REQUIRED
    • Candidate head SHA
    • Reviewed head SHA: none
    • Review worktree used: false
  3. The following fields must be rejected:

    • Pinned reviewed head
    • Scratch worktree used
    • Workspace mutations: None
    • Mutations: None when any git ref, MCP, Gitea, review, merge, cleanup, or external-state mutation occurred
  4. git fetch must be reported as a Git ref mutation in both the final report and controller handoff.

  5. The final report and controller handoff must not disagree on mutation state, reviewed SHA, worktree usage, or eligibility class.

Acceptance criteria:

  • Already-landed controller handoffs fail if they say Pinned reviewed head.
  • Already-landed controller handoffs fail if they include Scratch worktree used.
  • Controller handoffs fail if git fetch occurred but mutations are reported as None.
  • Narrative report and controller handoff are checked for consistency.
  • Tests cover already-landed, normal approved, request-changes, merge-blocked, and infra-stop handoffs.
Reviewer workflows now correctly stop when an already-landed PR is detected, but controller handoffs still allow stale legacy fields that contradict the narrative report. Observed behavior: The narrative report correctly classified PR #278 as: * `Eligibility class: ALREADY_LANDED_RECONCILE_REQUIRED` * `Candidate head SHA: 2a544...` * `Reviewed head SHA: none` * `Review worktree used: false` * `Git ref mutations: git fetch prgs master` However, the controller handoff still included stale fields: * `Mutations: None` * `Workspace mutations: None` * `Pinned reviewed head: 2a544...` * `Scratch worktree used: False` Problem: The human-readable report and controller handoff can disagree. This allows stale review/merge language to survive even when the workflow correctly stops before validation, approval, or merge. Required behavior: 1. Controller handoff validation must use the same canonical schema as the final report. 2. If the already-landed gate fires, the handoff must use: * `Eligibility class: ALREADY_LANDED_RECONCILE_REQUIRED` * `Candidate head SHA` * `Reviewed head SHA: none` * `Review worktree used: false` 3. The following fields must be rejected: * `Pinned reviewed head` * `Scratch worktree used` * `Workspace mutations: None` * `Mutations: None` when any git ref, MCP, Gitea, review, merge, cleanup, or external-state mutation occurred 4. `git fetch` must be reported as a Git ref mutation in both the final report and controller handoff. 5. The final report and controller handoff must not disagree on mutation state, reviewed SHA, worktree usage, or eligibility class. Acceptance criteria: * Already-landed controller handoffs fail if they say `Pinned reviewed head`. * Already-landed controller handoffs fail if they include `Scratch worktree used`. * Controller handoffs fail if `git fetch` occurred but mutations are reported as `None`. * Narrative report and controller handoff are checked for consistency. * Tests cover already-landed, normal approved, request-changes, merge-blocked, and infra-stop handoffs.
jcwalker3 added the status:in-progress label 2026-07-07 04:42:22 -05:00
Author
Owner

Implementation ready for review in PR #371.

Adds assess_already_landed_handoff_report() to reject stale Pinned reviewed head / Scratch worktree / Mutations None fields and narrative-handoff drift after the already-landed gate fires.

Implementation ready for review in PR #371. Adds `assess_already_landed_handoff_report()` to reject stale Pinned reviewed head / Scratch worktree / Mutations None fields and narrative-handoff drift after the already-landed gate fires.
sysadmin removed the status:in-progress label 2026-07-07 09:00:09 -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#299