Skip to content

feat(close): two-stage close; completed only through rill workspace complete - #110

Merged
tarr1124 merged 5 commits into
mainfrom
feat/close-two-stage
Oct 20, 2026
Merged

tarr1124 merged 5 commits into
mainfrom
feat/close-two-stage

Conversation

@tarr1124

Copy link
Copy Markdown
Contributor

Summary

Builds on #109 (rill workspace).

  • /close Stage 1 (default, interactive, about a minute): close kind, conclusion, distill hint, open items to tasks, related task sync, then rill workspace close (status distill-pending). No handbook, no /promote chain.
  • /close --distill <id> Stage 2 (interactive, or --unattended for a distill job): analysis and distillation sub-agents run in the foreground and return one line; they record the analysis and every outcome through rill workspace distill, passing --run. Interactive runs own begin / complete / end; unattended runs leave them to the job wrapper. completed is written only by rill workspace complete after verify passes, so a failed or interrupted run leaves the workspace distill-pending and the next run resumes it.
  • Analysis reads the CLI coverage set (including _workspace.md, _log.md, subdirectories), creates _summary.md via distill summary (rill mkfile would number it), and records an analysis JSON in which every file has candidates or a note.
  • Distillation records its own outcome on every path, including skips decided during verification.
  • Rules, SPEC lifecycle, workspace/CLAUDE.md, architecture: status is active | distill-pending | completed, written only by rill workspace. /focus reopens via rill workspace reopen and offers snooze; /distill, /promote, /retrospective, /refresh-project, briefing context follow the new values.
  • CLI: distill show --json adds effective_outcomes (resume post-processing, merge amendments).

Test plan

  • bash test/cli/test-workspace-state.sh (88), skill preamble, CJK guard, CLI smoke
  • Codex review: 7 P2 fixed in this PR
  • Live: three workspaces through Stage 2 under claude -p (tracked separately; run from the user's terminal)

🤖 Generated with Claude Code

tarr1124 and others added 5 commits October 20, 2026 14:47
/close Stage 1 records how a workspace ended (kind, conclusion, distill
hint), turns open items into tasks, syncs related tasks, and moves it to
distill-pending with rill workspace close. Stage 2 (--distill <id>,
interactive or --unattended for a distill job) runs the analysis and
distillation sub-agents in the foreground; they record the analysis and
every outcome through rill workspace distill, and completed is written only
by rill workspace complete after verify passes. A failed or interrupted run
leaves the workspace distill-pending and the next run resumes it.

- analysis-agent: reads the CLI coverage set (incl. _workspace.md, _log.md,
  subdirectories), creates _summary.md via distill summary, emits the
  analysis JSON and records it, returns one line
- distillation-agent: source_path in the note, records its own outcome,
  returns one line
- handbook and /promote chain removed from /close (handbook on request)
- rules, SPEC lifecycle, workspace/CLAUDE.md, architecture: status is
  active | distill-pending | completed, written only by rill workspace
- /focus reopens via rill workspace reopen and offers snooze; skips
  _distill.md on resume; /distill, /promote, /retrospective,
  /refresh-project, briefing-context follow the new values

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- distillation-agent: every early stop (contradicted, invalidated,
  evergreen duplicate) records its skip through Step 7
- duplicate merge amends every outcome pointing at the deleted note
- post-processing takes created notes from the record (effective_outcomes
  in distill show --json), so a resumed run covers earlier runs
- the run number is passed into both sub-agent templates (--run)
- Stage 1 uses the resolved metadata file (legacy _session/_project)
- frontmatter completion is limited to NNN-*.md (HTML has none)
- test-close copies lib/ into the test vault

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rospective

- unattended Stage 2 takes {run} from RILL_DISTILL_RUN and stops when it is
  not the open run (never adopts open_run)
- duplicate merges also re-point MERGED_INTO_OTHER outcomes aimed at the loser
- /retrospective collects and weights distill-pending workspaces closed in
  the period
- test-close SC-04 checks the new self-check line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tarr1124
tarr1124 merged commit c9a97d6 into main Oct 20, 2026
4 checks passed
@tarr1124
tarr1124 deleted the feat/close-two-stage branch October 20, 2026 05:57
@tarr1124 tarr1124 mentioned this pull request Oct 20, 2026
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant