Repository navigation
Scaffold, core contracts and run pipeline - #1
Conversation
Add the project skeleton (package, TypeScript strict ESM, vitest, CI on Linux, macOS and Windows, Apache-2.0 LICENSE and NOTICE, CLAUDE.md and AGENTS.md) and the frozen contracts the sandbox, host adapter, tool and benchmark parts build against. The run path is executable end to end with test fakes: MCP tools/call -> FakeSandbox -> Dispatcher (prepare, static rules, hooks, re-prepare on updated args, commit) -> StaticHostAdapter -> MemoryToolRuntime, with mutation ordering, cancellation, transactions with rollback, output caps with overflow files, and a command hook runner that kills the process group on timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Commit a dispatcher-owned deep-frozen copy of each prepared call; deep freeze now descends into objects that are already frozen. - Bound every await on adapter and runtime code by the run's abort signal or a grace: prepare, PostToolUse (which now receives the signal), loadPolicy (the run deadline starts before it), in-flight calls on stop, rollback and dispose. - Kill the command hook's whole process group on every completion path, so a backgrounded descendant cannot outlive the hook. - Send protocol and validation errors through the capped result formatter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Validate adapter decisions with a schema, reject non-string tool names and refresh the call summary after a hook rewrite. - Keep overflow output out of non-private state directories and off Windows. - Match path patterns across newlines and treat "..name" as inside a root. - Run a single deadline from the start of the run, counting policy loading, and give the sandbox the time left rounded up. - Roll back only after queued writes and edits end, report a pending rollback, and dispose the journal after the rollback has really finished. - Make the fake sandbox check its deadline before steps and calls, yield between steps, and tie its deadline and sleeps to one signal. - Describe the placeholder runtime the default server serves, with a runnable example. - Resolve in-memory paths against the session cwd and roots (Windows paths included), track file revisions for rollback, and run grep and glob in a stoppable worker thread. - Accept only a single --host option in serve. - Skip spawning a hook whose run was already cancelled and stop recording calls in the default runtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Fake runtime: cap concurrent search workers per runtime; extra searches wait in a cancelable queue and a slot is reused only after its worker exits. - Fake runtime: build the search job after a slot is held, send grep content only for files that pass the name filter, and reject a search that would copy more than the text limit. - Fake runtime: count edit occurrences and build the diff without per-match or per-line arrays. - Normalize Windows drive paths in the fake runtime and path patterns, and restore original revisions on rollback. - Run: check the deadline before opening a transaction and word the pending-rollback warning accurately. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
NEEDS_HUMAN for The third round requires design decisions on two recurring findings.
The review had one full round and two confirmation rounds. The two correction commits are 🔐 Protected paths ignore letter case on Mac and Windows
🔐 The project uses the Apache 2.0 license
The decision labels become actionable once the technical findings are resolved and the review reaches For later. Glob can stop scanning after the first extra match, and cancelled searches can skip preparation as soon as a worker slot opens. The review also recorded uncommon relative-name matching, Windows hook process cleanup and remaining coverage gaps. Verification scope. The CI and the CLI smoke test exercised the simulated server. The production sandbox and host adapters are future work. The edit memory finding comes from static inspection of the runtime. Other implementation choicesStatic permission checks run before hooks
Direct and rewritten protected-path errors have different transaction behavior
Codex script runs have a 55-second ceiling
Rollback covers recorded file changes
Extra fields cause a binding error
Oversized responses return a preview on Windows
Searches have an input limit in the simulated runtime
|
…untime Network-share (UNC) paths are not supported: POSIX resolution folds their leading `//` while protected-path patterns keep it, so a protected share could go unrecognized. The fixed root, seeded files, session cwd and roots, and call paths now refuse UNC paths before any call is prepared. Edit and write preparation now size the change from cheap counts first and refuse, before building the edited text or the diff, an edit with more than MAX_EDIT_REPLACEMENTS (50,000) replacements or a diff over MAX_DIFF_LINES (200,000) lines. Changes under the budget produce the same text and diff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The session roots are checked for network-share (UNC) paths even when a fixed root replaces them, so a UNC session root is refused, not ignored. - setFile and revision refuse UNC paths like every other path entry point. - The diff line budget counts the rows the diff actually has: a text that ends with a line break no longer counts one extra row. Edit preparation works out whether the edited text ends with one from where the replaced occurrences sit, still before building the text or the diff, so diffs of up to MAX_DIFF_LINES rows are prepared and only larger ones refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep POSIX paths with redundant leading slashes local. Return actionable guidance when an edit exceeds the replacement limit. Stop glob after its first extra match and skip setup for cancelled searches.
Match local protection patterns and resolved paths with the same leading-slash normalization. Use one resolved key for in-memory reads, writes and file revisions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
READY, awaiting three decisions for The incremental review took three confirmation rounds. The author's updates resolved the two findings that stopped the previous review. The review loop then fixed one major and five minor findings in From the start of this episode to the final head, added lines went from 3,849 to 3,853 in code and from 1,529 to 1,559 in tests. The documentation count was 56 lines at both heads. 🔐 File protection ignores case on macOS and Windows
🔐 The project uses the Apache 2.0 license
🔐 The simulated server refuses Windows network shares
To proceed with the merge, add For later. Exercise the network working directory and allowed folders independently in tests. Stop the replacement scan as soon as it reaches its limit. Verification scope. The checks cover the simulated server. The production sandbox and host adapters are follow-up work. Other implementation choiceLarge writes and edits have preparation limits
|
|
MERGED into The incremental episode took three confirmation rounds. Commits Added lines went from 3,849 to 3,853 in code and from 1,529 to 1,559 in tests. Documentation stayed at 56 added lines. The lockfile was outside the review diff. For later, the review noted POSIX filenames containing a colon, more direct tests for cancellation and network-share rejection, and one extra match lookup at the replacement limit. The production sandbox and host adapters were outside this scaffold review. No follow-up issues were required. |
Summary
Project skeleton plus the frozen contracts and run pipeline that the sandbox, host adapter, tools and benchmark parts build against. The whole
runpath already works with test fakes.Evidence
After:
npm run verifypasses: typecheck, 86 tests in 8 files, build. CI is green on all 5 jobs (ubuntu and macos × Node 22/24, windows typecheck + test).src/server/mcp.test.ts): SDK client → linked transport → server → FakeSandbox → Dispatcher → StaticHostAdapter → MemoryToolRuntime. Calls come back asc1 allowed, c2 denied (rule: rm is not allowed), c3 allowed, and the transaction variant rolls backout.txt.initializeandtools/callintonode dist/cli.js servereturned the run result with the deniedrmcall.Promise.allkeep write order (c5,c10,c15,c20,c25) with reads running concurrently. Also tested: a deny in a transaction rolls back earlier writes;updatedArgspointing outside the workspace are refused; nothing commits after a stop; a commit still running at stop is reported; a throwing hook becomes denyhook-error.Merge Danger
Door: two-way
Nothing exists yet that depends on this. Changing a contract later means reopening the parts built on it.
Blast Radius: contracts
Parts P1 to P5 build against
src/core/types.ts. A contract that turns out wrong costs one cross-part PR.Decisions
file_pathinstead ofpath) are rejected with a clear error. Unknown keys on theruninput itself are silently dropped.commitreceives the transaction explicitly, so concurrent runs do not share a journal. A binding call resolves to an ok/error reply and never throws. Results carry awarningslist, used for things like "bash effects are not rolled back" and commits that were running at stop.exact,line-trimmed,whitespace-normalizedandindentation-flexible. The tools part can extend the list.rm) until the integration part swaps in the real pieces.🤖 Generated with Claude Code