Repository navigation
Conversation
Hot checkpoints carried no HEAD, branch, dirty or untracked-file state, and captured command output carried no revision, so a session in another checkout or after the tree moved trusted results observed on other bytes. - Evidence captured at Stop, PreCompact and PostToolUse records the workspace's git state (one 'git status --porcelain=v2', 1.5 s timeout, no optional locks; untracked files hashed, at most 20, private names skipped). Command output is stamped with the commit it ran at. - Rendering compares with the reader's tree: one 'Workspace drift' line when HEAD, branch, uncommitted state or untracked files differ; file excerpts no longer on disk or changed are marked; command output run at another commit is marked. Same checkout: nothing. - Sources dropped to fit a bound keep their name and digest and are listed as not kept. - The field is optional inside the opaque evidence: older clients drop it, sync budget unchanged. Warning only; nothing is restored. Handoff capsules do not carry git state yet. Task Master 164.
… and latency From an independent review: - Only sources that plainly name a file (a path, or one cat/head/tail/sed read) are checked on disk; command-named reads were always 'missing'. - An untracked entry captured without a hash (symlink, large or unreadable file) is checked for presence only. - Synced untracked paths must be workspace-relative (no '..', absolute or NUL); reads lstat first, open with O_NOFOLLOW|O_NONBLOCK, require a regular file and check realpath containment, so a FIFO cannot block a hook and a symlink cannot read outside the workspace. - Metadata is bounded (10 untracked, 8 dropped names, 160-char paths) and is dropped before any excerpt when a checkpoint is over budget. - git status uses -unormal; drift and file checks are computed once per prompt; the drift line is capped at 320 characters. - The private-name filter covers more secret-like names.
# Conflicts: # src/runtime/host-adapter-base.ts
…and round-trip tests - Export records continuityIr.provenance.workspace (head, branch, dirty, filtered untracked names) for the exporting workspace. The field is optional and signed with the capsule; older importers ignore it. - Import attaches it as evidence on the imported checkpoint, so opening the handoff in a different tree shows the drift line. - Tests: export and import through the lifecycle engine, a git that hangs (null within the timeout), and a synced document with git state that the wire validator accepts unchanged.
From a fresh review: every capsule, including deal handoffs uploaded to a counterparty, carried branch, HEAD, dirty state and untracked file names with content hashes. - Only the Claude Code and Codex handoff export opts in; deal handoffs and other callers never carry it. - A capsule carries commit, branch and dirty state only: no untracked names or hashes leave the machine. Hot sync (own devices) is unchanged.
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.
Task Master 164. Stacked on #50; review the top two commits.
Problem. Hot checkpoints carried no HEAD, branch, dirty or untracked-file state, and captured command output had no revision. A session in another checkout, on another machine, or after the tree moved on trusted results observed on different bytes.
Changes
Capture. Evidence captured at Stop, PreCompact and PostToolUse records the workspace's git state:
git status --porcelain=v2 --branch -unormalcall, with a 1.5 s timeout and no optional locks;Command output is stamped with the commit it ran at.
Render. The saved state is compared with the reader's tree:
Workspace driftline (at most 320 characters) when HEAD, branch, uncommitted changes or untracked files differ;Dropped sources keep their name and digest and are listed as "not kept".
Compatibility. The new field is optional and travels inside the opaque
evidence, so older clients drop it. Metadata is bounded and is dropped before any excerpt when a checkpoint is over the 30,000-character sync budget.Warning only. Nothing is restored or rewritten.
Handoff capsules (070d3f4, narrowed in the next commit). The Claude Code and Codex handoff export records the exporting workspace's commit, branch and dirty state in
continuityIr.provenance.workspace. No untracked file names or hashes are included, and deal handoffs to another party never carry it. The field is optional and signed with the capsule, and older importers ignore it. Import attaches it to the imported checkpoint, so a handoff opened in a different tree shows the drift line. Further tests cover a hanging git (null within the timeout) and a synced document carrying git state passing the unchanged wire validator.Verification
vitest runon Node 22.23.4 passes: 81 files, 713 tests.tests/runtime/workspace-state.test.ts. They cover:sed-named sources;