Repository navigation
hold-work: --hold-work needs --base-dir; one marker read per boot (#439) - #497
Merged
Merged
Conversation
Owner
Author
|
lens: state+safety verdict: SAFE (head ae13523) Read-only review, Opus 5.5. The items in #439 are done, and the bypasses I found are minor. Nothing blocks the merge or go-live. Run myself (clone, Findings
Each probe is in State
Safety
|
- `t3 serve --hold-work` is refused without --base-dir, with a blank one, and on the default home (~/.t3, any spelling or a symlink to it), before anything starts or is written: a held boot marks its home, and on the live home that holds T3 Connect at every later boot. The refusals move to the fork file cli/forkHoldWork.ts, so cli/server.ts keeps 20 fewer fork lines (pending ceiling 37 -> 17, lost 4 -> 3). - The held-copy marker is read once per boot: one ConnectHoldDecision layer value, shared by the CloudLink and agent activity wrappers, so the two can never disagree. Unit test counts the reads (2 on the old code) and covers a marker deleted during boot; the boot test asserts one heldCopyMarker span per boot. - A comment says the marker check fails closed on purpose. - Docs: --base-dir rule, one shared read, and a userdata-only copy of a marked copy is not protected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… parents (#439) Fix round 1 for the default-home refusal of `serve --hold-work`: - also refuse `.t3` under the passwd home (os.userInfo), so a scratch $HOME does not let `--base-dir <real home>/.t3` through; - when both folders exist, compare dev+ino as well as paths, for case-insensitive disks and second mounts; - a target not made yet resolves its deepest existing parent, so a symlinked parent cannot reach the default home. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scuttletoby
force-pushed
the
w439-hold-work-followups
branch
from
November 18, 2026 16:06
ae13523 to
efee083
Compare
scuttletoby
added a commit
that referenced
this pull request
Nov 18, 2026
…) (#497) * hold-work: --hold-work needs --base-dir; one marker read per boot (#439) - `t3 serve --hold-work` is refused without --base-dir, with a blank one, and on the default home (~/.t3, any spelling or a symlink to it), before anything starts or is written: a held boot marks its home, and on the live home that holds T3 Connect at every later boot. The refusals move to the fork file cli/forkHoldWork.ts, so cli/server.ts keeps 20 fewer fork lines (pending ceiling 37 -> 17, lost 4 -> 3). - The held-copy marker is read once per boot: one ConnectHoldDecision layer value, shared by the CloudLink and agent activity wrappers, so the two can never disagree. Unit test counts the reads (2 on the old code) and covers a marker deleted during boot; the boot test asserts one heldCopyMarker span per boot. - A comment says the marker check fails closed on purpose. - Docs: --base-dir rule, one shared read, and a userdata-only copy of a marked copy is not protected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * hold-work: refuse the account's home, same-folder identity, symlinked parents (#439) Fix round 1 for the default-home refusal of `serve --hold-work`: - also refuse `.t3` under the passwd home (os.userInfo), so a scratch $HOME does not let `--base-dir <real home>/.t3` through; - when both folders exist, compare dev+ino as well as paths, for case-insensitive disks and second mounts; - a target not made yet resolves its deepest existing parent, so a symlinked parent cannot reach the default home. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
scuttletoby
added a commit
that referenced
this pull request
Nov 18, 2026
…) (#497) * hold-work: --hold-work needs --base-dir; one marker read per boot (#439) - `t3 serve --hold-work` is refused without --base-dir, with a blank one, and on the default home (~/.t3, any spelling or a symlink to it), before anything starts or is written: a held boot marks its home, and on the live home that holds T3 Connect at every later boot. The refusals move to the fork file cli/forkHoldWork.ts, so cli/server.ts keeps 20 fewer fork lines (pending ceiling 37 -> 17, lost 4 -> 3). - The held-copy marker is read once per boot: one ConnectHoldDecision layer value, shared by the CloudLink and agent activity wrappers, so the two can never disagree. Unit test counts the reads (2 on the old code) and covers a marker deleted during boot; the boot test asserts one heldCopyMarker span per boot. - A comment says the marker check fails closed on purpose. - Docs: --base-dir rule, one shared read, and a userdata-only copy of a marked copy is not protected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * hold-work: refuse the account's home, same-folder identity, symlinked parents (#439) Fix round 1 for the default-home refusal of `serve --hold-work`: - also refuse `.t3` under the passwd home (os.userInfo), so a scratch $HOME does not let `--base-dir <real home>/.t3` through; - when both folders exist, compare dev+ino as well as paths, for case-insensitive disks and second mounts; - a target not made yet resolves its deepest existing parent, so a symlinked parent cannot reach the default home. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <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.
Fixes #439
Follow-ups from the round-2 lenses on #398. Item 1 is needed before go-live.
What changes
t3 serve --hold-workneeds--base-dir, and never the default home. It is refused without--base-dir, with a blank one, and when the path resolves to the default home (~/.t3, also through a symlink,~/.t3, a trailing/orx/..). The check runs before config resolution, so nothing is started or written, and the message explains why.T3CODE_HOMEon its own is not enough: it is set in a shell, not written on the command. The go-live kit's rehearsal already passes--base-dir <clone>/home, so it is not affected.--hold-workrefusals moved to a new fork file,apps/server/src/cli/forkHoldWork.ts.cli/server.ts(apendingfile) now holds 20 fewer fork lines, and upstream's one-lineserviceLauncherClientimport is back. Thependingceiling goes from 37 to 17 and thelostcounts from 4 to 3, because--from-upstreamasks for that.userdata/of a marked copy (as the kit'scopystep does) is not protected. It is now listed next to the copies from older builds (docs/fork/updates.md).ConnectHoldDecisionlayer value is provided by both the CloudLink wrapper and the agent-activity wrapper. A server builds a given layer value once, so both parts use the same answer and cannot disagree. The docs now say so.holdWorkConnect.ts, atorElseSucceed(() => true)).Tests
server.holdWork.test.ts:serve --hold-workwith no--base-dir(fake user home)~/.t3not createdserver.holdWork.test.ts: no or blank flag; default home in 5 spellings, symlink included; named copies allowedholdWorkConnect.test.ts: both layers built together count marker checks (marked home, marker deleted by hand while CloudLink builds, unmarked home)holdWork.boot.test.ts: oneHoldWorkConnect.heldCopyMarkerspan on the marked boot and on the unmarked boot (realt3 serve)expected 2 to be 1Run locally, with
heavyand the user home pointed at a scratch folder:holdWorkConnect,server.holdWork,connect.holdWork,config,connect,up.connectandholdWork.boot: 70/70.typecheckforapps/server: green.fork-seam-check.test.cjs: green. Golivecontract.test.py: green.node .github/scripts/fork-seam-check.cjs origin/main HEAD: pass.--from-upstream <upstream merge-base> HEAD: pass, after lowering the ceiling.State question
wx). Every boot reads it once and holds Connect and agent activity together. The--base-dirrefusal has no state of its own, so it gives the same answer each time.--base-dirhome is allowed and created later, as before. A missing default home is still refused by path. Copies with no marker (never held, held only on older builds, oruserdata/-only) are not protected, as the docs say.Fix round 1 (lens SAFE: 2 minors + 1 nit)
All three are fixed in
apps/server/src/cli/forkHoldWork.ts. The check still runs before anything starts or writes. Each one has a test inserver.holdWork.test.tsthat was red on the old code.$HOMEpointed elsewhere..t3under the account's passwd home (os.userInfo().homedir, which ignores$HOME) is refused as well. Tests: refuses the account's own T3 home when $HOME points somewhere else (the real passwd home with a scratchHOME) and refuses the account home's .t3, made or not, and nothing beside it (hermetic).statdev+inoare compared too. The path checks are kept. Test: refuses the same folder under another spelling the path check cannot see. It uses a file system that folds.T3to.t3and whose realPath keeps the spelling, as the JS realpath does on APFS.Rebased onto the new fork main (
2284c4cf).fork-seam-check.cjs origin/main HEADpasses. The three PR test files give 36/36 and theapps/servertypecheck is green.General vs project
General. Everything is in the fork's own
t3 serve --hold-workand the T3 Connect hold, with nothing tied to one machine or project. The default home comes fromHostProcess.HomeDirectory(~/.t3), as upstream resolves it, and from the account's passwd home.🤖 Generated with Claude Code