feat(cli): cli-3.22.0 — charter close reconciles follow-ups + offers TDE promotion (#135 Tier 3)#236
Merged
Merged
Conversation
…TDE promotion (#135 Tier 3) Closes the loop between Charter close and the follow-ups registry — the last open tier of the follow-ups automation roadmap (#135), unblocked now that drift detection is reliable (cli-3.21.0, #229/#231). After an interactive `charter close`, the command runs the default `followups drift` scan (committed git range ∪ working tree) over the just-written AILOGs, extracts any §Follow-ups / R<N> (new) content not yet in the registry into `## Bucket: ready`, then offers per-entry TDE promotion against the four AGENT-RULES.md §3 criteria. Declining leaves the follow-up extracted (captured, not promoted); accepting runs the `followups promote` flow. No-op without a registry or when nothing is unextracted; skipped on the --from-template paths. The scan reuses the stabilized default drift, not `originating_ailogs` (that field is the ex-ante seed, not the execution AILOGs where follow-ups live). Refactors `followups drift` into reusable side-effect-free cores — detect_drift_candidates() and apply_candidates() (returns the created FU ids) — shared by `followups drift` and the close integration. drift output unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements RFC #135 Tier 3 — the last open tier of the follow-ups automation roadmap. After an interactive
charter close, the CLI reconciles the follow-ups registry against the just-closed work and offers to promote new entries to TDEs. Unblocked now that drift detection is reliable (cli-3.21.0, #229/#231 in #235).CLI-only release: cli-3.22.0 (no framework change).
Behavior
After an interactive
charter close(the--from-templatepaths are skipped — no prompt context):followups driftscan (committed git range ∪ working tree) over the recently-written AILOGs. No-op if the project has no follow-ups registry or nothing is unextracted.§Follow-ups/R<N> (new)content not yet in the registry into## Bucket: ready(same semantics asfollowups drift --apply, so nothing is lost).Promote FU-NNN — <desc> to a TDE? [y/N]against the four AGENT-RULES.md §3 criteria. Declining leaves it extracted (captured, not promoted); accepting runs thefollowups promoteflow (creates the TDE withpromoted_from_followuptraceability). Entries extracted assuspected-closedare flagged in the prompt (likely already resolved → rarely transversal debt).Design note — scan scope
The scan reuses the stabilized default drift (git range ∪ working tree), not
originating_ailogs. That field is the ex-ante seed of the Charter (the AILOGs that motivated it), not the execution AILOGs where follow-ups are written — and it is empty for greenfield (originating_spec) Charters. At close time the default scan captures exactly the just-written work, with no fragile attribution logic.Implementation
Refactored
followups driftinto two reusable, side-effect-free cores, shared byfollowups driftand the close integration (drift's own output is unchanged):detect_drift_candidates(project_root, registry, scan_all, range) -> Vec<…>— scan + per-follow-up content-hash dedup, no stdout/exit.apply_candidates(registry_path, registry, drifted, today) -> ApplyReport— writes the registry and returns the createdFU-NNNids (the handle the close hook needs for the promotion prompts).The close hook (
offer_followup_promotions) lives incharter/close.rs, guarded to the interactive flow (TTY already confirmed byrequire_interactive).Tests
tier3_detect_apply_dedup_roundtrip— end-to-end of the core without git/TTY: detect → apply → assert the returnedFU-001id +Source-hashwritten → re-detect is empty (dedup).followups driftintegration suite (21 tests) green — the refactor preserved behavior.Closes #135
🤖 Generated with Claude Code