Repository navigation
Conversation
…its and remote git #689 made a discard bring the discarded blocks' git index entries back to HEAD (`git reset -q HEAD -- <paths>`, `git rm --cached`, and `update-index` to undo a failed write), as the PO asked. DS-2's scan still read the local repository as strictly read-only and matched those calls, so it failed on main since c90fbe9. The docs claim behind DS-2 is that `deco serve` edits the working tree and does no hosted branch synchronization (no GitHub, no commits); it never said the index is untouched. The scan now encodes that: no remote or commit/ref/object/working-tree git command anywhere; index writes only inside `unstage`, where `rm` must be `--cached` and `reset` only `-q HEAD -- <paths>`. Mutation-checked: an index write outside unstage, `rm` without `--cached`, `reset --hard`, `reset HEAD~1` and a `commit` call each fail it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
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.
Why
DS-2indelivery.cli.test.tsfails onmainsince c90fbe9 (#689), deterministically (also run alone). #689 made a discard on the fs storage (deco serve) bring the discarded blocks' git index entries back toHEAD(PO: "deco serve should unstage git added blocks on discard"). It does that withgit reset -q HEAD -- <paths>,git rm --cached -f --quiet --ignore-unmatch -- <paths>and, to undo a failed write,git update-index. DS-2's scan treated local git as strictly read-only and matched"reset"/"update-index".Is the scan right or too broad?
Too broad, so this changes the test, not the code:
deco servekeeps editing the developer's working tree and does not perform hosted branch synchronization") forbids GitHub calls, commits and branch work. It never said the index stays untouched; "local git read-only" was the test's own wording.storage/fs/git.test.ts.What changed
DS-2 now encodes that claim and keeps guarding against regressions:
cli/serve/server.tsandprotocol/storage/fs/*: no GitHub, nosimple-git/isomorphic-git; onlygit.tsuseschild_process.git.ts: nevercommit,add,restore,checkout,switch,stash,push,fetch,pull,clone,remote,merge,rebase,write-tree,commit-tree,update-ref,tag,-w,--hard,--soft,--keep,--merge.reset,rm,update-index,read-tree,apply) only insideunstage. There,rmmust carry--cachedandresetmust be exactly-q HEADover named paths.Mutation-checked: each of these fails the test: an index write outside
unstage,rmwithout--cached,reset --hard,reset HEAD~1, and acommitcall.Docs site: no change is needed, since the claim already matches. It could optionally mention that a discard also unstages the discarded blocks.
Gates
bun run check0,bun run build0,skills:check+skills:readme:check0deco --help: 0bun run test(2 GB): 2077 passed, 2 failed, 95 skipped. The two failures areschema.test.ts5 s timeouts under load. That file passes alone (58/58).delivery.cli.test.tspasses 11/11.🤖 Generated with Claude Code
https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
Summary by cubic
Fixes the DS-2 conformance test so
deco servecan unstage discarded blocks while still banning commits, remote git calls, and working-tree rewrites.unstageoperation, matching the behavior added in fix(protocol): discard also unstages the discarded blocks #689.cli/serve/server.tsorprotocol/storage/fs/*.unstage,rmmust carry--cachedandresetmust be exactly-q HEADover named paths.unstage,rmwithout--cached,reset --hard,reset HEAD~1, and acommitcall each fail the test.Written for commit 1c22a0f. Summary will update on new commits.