feat: add canonical state handoff ledger (Closes #494) #498

Merged
sysadmin merged 2 commits from feat/issue-494-state-handoff-ledger into master 2026-07-08 22:07:48 -05:00
Owner

Summary

Closes #494

Adds templates, helpers, validators, and documentation so discussions, issues, and PRs carry canonical state comments and final reports include next-action handoff fields (current status, next actor, next action, next prompt).

Changes

  • state_handoff_ledger.py — render/parse state comment templates; assess next-action handoff and contradictory state claims
  • final_report_validator.py — wire shared state-handoff rules across all task kinds
  • docs/state-handoff-ledger.md — lifecycle, queue-controller priority, discussion rules
  • docs/llm-workflow-runbooks.md — link to state handoff ledger
  • tests/test_state_handoff_ledger.py — template, validation, and contradiction coverage
  • tests/test_final_report_validator.py — update fixtures with required next-action fields

Validation

venv/bin/python -m pytest tests/test_state_handoff_ledger.py tests/test_final_report_validator.py -q
# 50 passed, 3 subtests passed

Worktree

  • Implementation: branches/issue-494-state-handoff-ledger @ d50328a
  • Lock base: branches/issue-494-lock-base
## Summary Closes #494 Adds templates, helpers, validators, and documentation so discussions, issues, and PRs carry canonical state comments and final reports include next-action handoff fields (current status, next actor, next action, next prompt). ## Changes - `state_handoff_ledger.py` — render/parse state comment templates; assess next-action handoff and contradictory state claims - `final_report_validator.py` — wire shared state-handoff rules across all task kinds - `docs/state-handoff-ledger.md` — lifecycle, queue-controller priority, discussion rules - `docs/llm-workflow-runbooks.md` — link to state handoff ledger - `tests/test_state_handoff_ledger.py` — template, validation, and contradiction coverage - `tests/test_final_report_validator.py` — update fixtures with required next-action fields ## Validation ```bash venv/bin/python -m pytest tests/test_state_handoff_ledger.py tests/test_final_report_validator.py -q # 50 passed, 3 subtests passed ``` ## Worktree - Implementation: `branches/issue-494-state-handoff-ledger` @ `d50328a` - Lock base: `branches/issue-494-lock-base`
jcwalker3 added 1 commit 2026-07-08 02:14:55 -05:00
Add templates, validators, and documentation for discussion/issue/PR state
comments and final-report next-action handoff fields. Wire enforcement into
assess_final_report_validator across all workflow task kinds.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #498
issue: #494
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 94309-9c7af56b8b79
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr498
phase: claimed
candidate_head: d50328aea4
target_branch: master
target_branch_sha: none
last_activity: 2026-07-09T02:30:25Z
expires_at: 2026-07-09T04:30:25Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #498 issue: #494 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 94309-9c7af56b8b79 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr498 phase: claimed candidate_head: d50328aea45369d9e26ba1fc2a992a6e1f634c68 target_branch: master target_branch_sha: none last_activity: 2026-07-09T02:30:25Z expires_at: 2026-07-09T04:30:25Z blocker: none
sysadmin added 1 commit 2026-07-08 21:52:37 -05:00
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #498
issue: #494
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 94309-9c7af56b8b79
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr498
phase: claimed
candidate_head: e0c583db75
target_branch: master
target_branch_sha: 719de6fb7a
last_activity: 2026-07-09T03:04:41Z
expires_at: 2026-07-09T05:04:41Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #498 issue: #494 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 94309-9c7af56b8b79 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr498 phase: claimed candidate_head: e0c583db75820cb22f89d31b94332cf62544da54 target_branch: master target_branch_sha: 719de6fb7ad316321eb367b8f5a05e931a2c4f32 last_activity: 2026-07-09T03:04:41Z expires_at: 2026-07-09T05:04:41Z blocker: none
sysadmin approved these changes 2026-07-08 22:05:56 -05:00
sysadmin left a comment
Owner

Reviewer verdict: APPROVE

Reviewed at head e0c583d (merge of master into feat/issue-494-state-handoff-ledger).

Scope — clean, matches issue #494 exactly. 6 files, +764/-0:

  • state_handoff_ledger.py (new) — render/parse canonical state comments; next-action handoff + contradiction assessors
  • final_report_validator.py — additive _rule_shared_state_handoff_next_action wired across task kinds (no regression to existing gates)
  • docs/state-handoff-ledger.md, docs/llm-workflow-runbooks.md
  • tests/test_state_handoff_ledger.py, tests/test_final_report_validator.py

No unrelated files, no secrets, pure functions (no network/side effects).

Validation — ran the two test files at this head with the repo venv: 56 passed, 3 subtests passed.

Notes (non-blocking) — missing trailing newline in state_handoff_ledger.py; _handoff_field_map consumes all key: value lines after the ## Controller Handoff heading (lenient); a few contradiction heuristics could false-positive on reconcile reports. All covered by tests; fine to address in follow-up.

Approving — ready to merge.

## Reviewer verdict: APPROVE Reviewed at head `e0c583d` (merge of master into `feat/issue-494-state-handoff-ledger`). **Scope** — clean, matches issue #494 exactly. 6 files, +764/-0: - `state_handoff_ledger.py` (new) — render/parse canonical state comments; next-action handoff + contradiction assessors - `final_report_validator.py` — additive `_rule_shared_state_handoff_next_action` wired across task kinds (no regression to existing gates) - `docs/state-handoff-ledger.md`, `docs/llm-workflow-runbooks.md` - `tests/test_state_handoff_ledger.py`, `tests/test_final_report_validator.py` No unrelated files, no secrets, pure functions (no network/side effects). **Validation** — ran the two test files at this head with the repo venv: **56 passed, 3 subtests passed**. **Notes (non-blocking)** — missing trailing newline in `state_handoff_ledger.py`; `_handoff_field_map` consumes all `key: value` lines after the `## Controller Handoff` heading (lenient); a few contradiction heuristics could false-positive on reconcile reports. All covered by tests; fine to address in follow-up. Approving — ready to merge.
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #498
issue: #494
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 94309-9c7af56b8b79
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr498
phase: approved
candidate_head: e0c583db75
target_branch: master
target_branch_sha: 719de6fb7a
last_activity: 2026-07-09T03:06:39Z
expires_at: 2026-07-09T05:06:39Z
blocker: none

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #498 issue: #494 reviewer_identity: sysadmin profile: prgs-reviewer session_id: 94309-9c7af56b8b79 worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr498 phase: approved candidate_head: e0c583db75820cb22f89d31b94332cf62544da54 target_branch: master target_branch_sha: 719de6fb7ad316321eb367b8f5a05e931a2c4f32 last_activity: 2026-07-09T03:06:39Z expires_at: 2026-07-09T05:06:39Z blocker: none
Owner

adopted_at: 2026-07-09T03:07:38Z
adopted_by_identity: sysadmin
adopted_by_profile: prgs-merger
adopted_from_session_id: 94309-9c7af56b8b79
adopted_from_profile: prgs-reviewer
adopted_from_reviewer_identity: sysadmin
adopted_from_comment_id: 7622
adoption_reason: merger-handoff-approved-head

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #498
issue: #494
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 12053-dddd5e489b8b
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr498
phase: adopted
candidate_head: e0c583db75
target_branch: master
target_branch_sha: 719de6fb7a
last_activity: 2026-07-09T03:07:38Z
expires_at: 2026-07-09T05:07:38Z
blocker: none

<!-- mcp-review-lease-adoption:v1 --> adopted_at: 2026-07-09T03:07:38Z adopted_by_identity: sysadmin adopted_by_profile: prgs-merger adopted_from_session_id: 94309-9c7af56b8b79 adopted_from_profile: prgs-reviewer adopted_from_reviewer_identity: sysadmin adopted_from_comment_id: 7622 adoption_reason: merger-handoff-approved-head <!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #498 issue: #494 reviewer_identity: sysadmin profile: prgs-merger session_id: 12053-dddd5e489b8b worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr498 phase: adopted candidate_head: e0c583db75820cb22f89d31b94332cf62544da54 target_branch: master target_branch_sha: 719de6fb7ad316321eb367b8f5a05e931a2c4f32 last_activity: 2026-07-09T03:07:38Z expires_at: 2026-07-09T05:07:38Z blocker: none
sysadmin merged commit 631620d264 into master 2026-07-08 22:07:48 -05:00
Owner

repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #498
issue: #494
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 12053-dddd5e489b8b
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr498
phase: released
candidate_head: e0c583db75
target_branch: master
target_branch_sha: 719de6fb7a
last_activity: 2026-07-09T03:14:36Z
expires_at: 2026-07-09T05:14:36Z
blocker: post-merge-moot

<!-- mcp-review-lease:v1 --> repo: Scaled-Tech-Consulting/Gitea-Tools pr: #498 issue: #494 reviewer_identity: sysadmin profile: prgs-merger session_id: 12053-dddd5e489b8b worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/merge-pr498 phase: released candidate_head: e0c583db75820cb22f89d31b94332cf62544da54 target_branch: master target_branch_sha: 719de6fb7ad316321eb367b8f5a05e931a2c4f32 last_activity: 2026-07-09T03:14:36Z expires_at: 2026-07-09T05:14:36Z blocker: post-merge-moot
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#498