Harden the close protocol: idempotent close, Resolution.missing_parts, mechanical merge-subsumes-review gate #261
Labels
No labels
P0
P1
P2
P3
bug
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#261
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Follow-up to #257 (close protocol), from the 2026-08-04 review. Spec: #250. Three findings in the shipped close CLI / tracker lib (
plugins/os-backlog/bin/os-backlog,lib/backlog/resolution.rb,lib/backlog/issues.rb):os-backlog closecomments then closes with no existing-comment check; a retry after partial failure double-comments. The lifecycle design requires every multi-step tracker mutation to be comment-first and idempotent on re-run.Resolution.missing_partsis dead API. Nothing calls it — either wire it into close-time validation or delete it (repo precedent8938d15treats dead branches as defects).hooks/session_start.py:38-46; the design says merge-subsumes-review is recognized mechanically by a PR/branch link. Move the gate into the close CLI: a close on a ticket that was NOTready-for-agentrequires a PR/branch link in the resolution evidence — link present, close proceeds; link absent, the CLI refuses the close, applies thereviewlabel, and prints why.Not
ready-for-agentyet: label to be applied after this ticket passes the template validator once #253 lands.Resolution
Done: Hardened the close protocol per all three findings: close is now idempotent on retry (checks the last '## Resolution' comment via Resolution.last_section/missing_parts, skips re-posting when valid, appends a corrected comment when malformed); Resolution.missing_parts is wired into close-time validation instead of being dead API; the merge-subsumes-review gate is mechanical in the close CLI (non-ready-for-agent close without a PR/branch link in --evidence is refused, review label applied, reason printed).
Evidence: Merged to main in merge commit
3a2e4b0(branch: sdlc/261, commit5b603cb). Suite green post-merge: 142 runs, 324 assertions, 0 failures; rubocop 0 offenses. Reviewer round 2 verdict: APPROVE. New black-box CLI contract tests in plugins/os-backlog/tests/close_protocol_test.rb.Follow-ups: #308 (P1): route test-file lint offenses to the test-writer, not the lint-fixer. #309 (P2): shard-plan misses code files for tests exercising a CLI as a subprocess.