Repository navigation
feat(workspace): rill workspace state machine and distill record - #109
Merged
Merged
Conversation
Workspace status becomes active | distill-pending | completed. The new rill workspace subcommands are the only writers of status: close, reopen, requeue, complete, snooze, unsnooze. complete writes completed only after verify passes on workspace/<id>/_distill.md, an append-only event record that only the CLI writes (distill begin / analysis / outcome / end / show). verify checks the latest round: analysis-complete marker, analysis file list equal to the coverage set (each file with candidates or a note), exactly one outcome per candidate, created/updated notes exist and created notes carry a source in the workspace, valid skip labels and reasons, recounted totals, and _summary.md present. queue lists the distill queue (normal tier by close time, then backfill with no-summary boxes first); check is the vault-wide invariant check for unattended jobs. Writes are serialized with flock on a sidecar and replaced atomically; the run lock lives in .rill/state/distill/<id>.lock and a stale lock is recorded as an abandoned run before it is taken over. Legacy on-hold is accepted only as the source of close and reopen (migration path). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- created/updated/EVERGREEN_DUPLICATE paths must be notes in knowledge/notes/ - distill end requires --run and refuses a run that was taken over - USER_DECLINED is refused when the open run began with --mode unattended - frontmatter values drop YAML end-of-line comments - legacy _session.md / _project.md metadata resolves (never renamed) - distill outcome --amend supersedes an earlier outcome (duplicate merge) - distill summary creates _summary.md (mkfile would number it NNN-summary.md) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ueue order - analysis / outcome take --run (or RILL_DISTILL_RUN) and refuse a run that was taken over; they also require distill-pending, so a completed record cannot be amended - queue orders by parsed timestamps, not strings (mixed time zones) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 3 tasks
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
rill workspacecommand (lib/workspace/rill_workspace.py, python3 >= 3.9, stdlib only), resolved from the distribution likelib/book.statusvalues:active,distill-pending(closed, distillation not yet verified; the set of these is the distill queue),completed. Legacyon-holdis accepted only as the source ofclose/reopen.close,reopen,requeue [--backfill],complete,snooze,unsnooze. Everything else is refused.completewritescompletedonly afterverifypasses on the latest round ofworkspace/<id>/_distill.md, an append-only JSONL event record that only the CLI writes (distill begin | analysis | outcome | end | show).verify: analysis-complete marker; analysis file list equals the coverage set (each file has candidates or a note); exactly one outcome per candidate; created/updated/duplicate notes exist; created notes have asourceinside the workspace; valid skip labels with reasons (forbidden reasons refused;USER_DECLINEDrefused whenRILL_DISTILL_UNATTENDED=1); totals recounted;_summary.mdpresent.queue(normal tier by close time, then backfill with no-_summary.mdboxes first) andcheck(vault-wide invariant check for unattended jobs; exit 1 on violations).flockon a sidecar, files replaced atomically. Run lock in.rill/state/distill/<id>.lock; a stale lock (default 3h) is recorded as an abandoned run and taken over.Rules, SPEC lifecycle section and the
/closetwo-stage split follow in a separate PR so the rule text and the skill change land together.Test plan
bash test/cli/test-workspace-state.sh(71 assertions) on python3 3.13 and macOS/usr/bin/python33.9bash test/cli/test-cli-smoke.sh, CJK guard, PII regex guard🤖 Generated with Claude Code