Record the handoff session and per-session dir in seeded state records (#51)#52
Merged
Merged
Conversation
cdd-state seed previously wrote sessions: [], so the /cdd-next-step
handoff session (which seeds the record on the main worktree) was never
recorded and could not be resumed; only the implementation session's
first `set` landed an id. Seed now records the current session as the
first {id, stage: scoped, dir} entry when CLAUDE_CODE_SESSION_ID is set
(empty list otherwise — older Claude Code, don't guess), and every
session entry in both seed and set carries a `dir` = the worktree root
(git rev-parse --show-toplevel), the natural cd target for
`claude --resume`.
`dir` is additive and optional: no CDD_STATE_SCHEMA_VERSION bump, so old
and new records interoperate (readers ignore unknown fields; the reader
half is cdd-dash PR #10, which falls back to the row's worktree path when
dir is absent). Closes the writer half of issue #51.
Docs updated to match: the helper header block, process doc §2.13
(schema example, append-only paragraph, scoped table row), and a checked
Phase 13 roadmap item. install-smoke-assert.sh gains a jq-guarded
assertion that seed records the handoff session with its dir, and omits
the entry when no session id is set.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rs.md Merge with origin/main (#50) relocated the state-record schema and stage-to-writer table from process-doc §2.13 into doc/architecture/shell-helpers.md. The §2.13 conflict was resolved by taking #50's condensed version; this ports the issue #51 semantics into their new home: the `dir` field on session entries, the schema note that `dir` is additive/optional, that seeding records the handoff session as the first entry, and the updated `scoped` writer row. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
#50 relocated the state-record schema out of process doc §2.13 into doc/architecture/shell-helpers.md. Update the two completed roadmap items (#51 writer half, and the earlier per-task-record item) so their file trails point at where the schema actually lives. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Writer half of issue #51: make the
/cdd-next-stephandoff session resumable and give every session entry a working directory.cdd-state seednow records the handoff session (/cdd-next-step, on the main worktree) as the firstsessions[]entry{id, stage: scoped, dir}— guarded onCLAUDE_CODE_SESSION_IDexactly likeset's append (empty list when no id; no guessing).seedandset) now carriesdir, the worktree root (git rev-parse --show-toplevel) — the naturalcdtarget beforeclaude --resume.schema_versionbump, so old and new records interoperate; a consumer that findsdirabsent falls back to the branch's known worktree path.The reader half is cdd-dash PR #10.
Docs & tests
doc/architecture/shell-helpers.md: schema example, prose, and thescopedwriter row updated to reflectdirand the handoff-session entry.scripts/install-smoke-assert.sh: two new jq-guarded assertions — seed records{id, scoped, dir}, and seed omits the entry when no session id is set.shell-helpers.md(where Restore process doc to workflow altitude; relocate tooling mechanics (#47) #50 relocated the schema) instead of the process doc §2.13.Verification
All CI gates pass locally:
bash -n, shellcheck, command-set drift, prompt-seam, install-smoke (incl. the new seed assertions), worktree-resume, template smoke, and demo seed-overlay.Closes #51
🤖 Generated with Claude Code