Repository navigation
fix: #363's leftovers: pin ensure_exec_listener's newline, and correct the MI1 citations - #838
Conversation
…d correct the MI1 citations - setup-vm.test.sh: a pre-MI1 migration fixture whose relay.env has no final newline, so deleting ensure_exec_listener's end_with_newline call now fails the suite. - MI1 spec: the amendment and the R3 row name the converge leaf (realProduceVerdict) and say the prompt leaf runs its R3 check itself (R4 still through executeTurn); the relay cites are main.ts:501-538 and :113-142. - deploy/vm/README.md: the restarts are step 8 and the paragraph after it, not step 3. Closes rossoctl#363 Assisted-By: Claude Code Signed-off-by: Rong Chang <[email protected]>
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Summary
Closes #363's leftovers. The new no-final-newline fixture pins ensure_exec_listener's end_with_newline "$relay" (setup-vm.sh:665): it asserts SH_RELAY_TOKEN=keep survives and MOCA_RELAY_EXEC_ADDR=127.0.0.1:9444 lands on its own line, mirroring the ensure_exec_token case. I checked the corrected cites against this head: makeExecTokenValidator is main.ts:113-142, makeDefaultValidateToken is :501-538 with its doc comment from :490, runPromptLeaf calls assertServerSandbox itself, the cited prompt-leaf test exists at run-leaf.test.ts:700, and the README's restarts are step 8 plus the "A re-run restarts what it owns" paragraph. One nit about wording.
Author: webchang (MEMBER, maintainer)
Areas reviewed: Shell (tests), Docs
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: passing (16/16)
| | R2 | `applyModelGateway` seeds `ANTHROPIC_API_KEY` only with the constant sentinel, never a caller's token. A shared `prepareServerProcess()` runs in `startServer()`, the P6 worker and the async-run job (`leaf-job.ts`); under `multi` it deletes every provider credential pi can read from the environment (any `*_API_KEY`, `*_AUTH_TOKEN` or `*_OAUTH_TOKEN`, `HF_TOKEN`, `COPILOT_GITHUB_TOKEN`, Bedrock's `AWS_*` sources and `GOOGLE_APPLICATION_CREDENTIALS`), leaving the sentinel, and refuses `SH_LOCAL_TOOLS=1`, `SH_REQUIRE_AUTH` not `true`, `SH_MODEL_HEADERS` and a Vertex ADC file. `single` retains an operator's key | a token-less call after an authenticated one sees only the sentinel, and a caller credential on a non-Anthropic model throws — `harness/test/model-gateway.test.ts`; the multi scrub deletes the OAuth token, which outranks the sentinel, `single` keeps an operator key, and `multi` refuses all four — `packages/server/test/server-process.test.ts`; all three entry points call `prepareServerProcess` — `test/worker-boot.test.ts` | | ||
| | R3 | In server and worker mode, a turn with **no resolvable sandbox fails** rather than running tools in the worker. Local tools remain only in the CLI (`harness/src/cli.ts`), or behind an explicit `SH_LOCAL_TOOLS=1` that `multi` refuses | no sandbox → the turn fails before an agent session (and so any tool) is built — `harness/test/turn-require-sandbox.test.ts`; the guard, `assertServerSandbox`, in `test/select-sandbox.test.ts`; the solve and verdict leaves in `test/run-leaf.test.ts`; every server turn marked `serverMode`, `packages/server/test/server-process.test.ts` | | ||
| | R3 | In server and worker mode, a turn with **no resolvable sandbox fails** rather than running tools in the worker. Local tools remain only in the CLI (`harness/src/cli.ts`), or behind an explicit `SH_LOCAL_TOOLS=1` that `multi` refuses | no sandbox → the turn fails before an agent session (and so any tool) is built — `harness/test/turn-require-sandbox.test.ts`; the guard, `assertServerSandbox`, in `test/select-sandbox.test.ts`; the solve and converge leaves (`realProduceSolve`, `realProduceVerdict`) and the prompt leaf, which runs the guard itself, in `test/run-leaf.test.ts`; every server turn marked `serverMode`, `packages/server/test/server-process.test.ts` | | ||
| | R4 | In server and worker mode: `noExtensions: true`, `noContextFiles: true`, `noSkills: true`, `noPromptTemplates: true`, `noThemes: true` (a promoted bundle still delivers its skills and prompt templates through its own paths), the project untrusted (`projectTrusted: false`, so no project settings, `SYSTEM.md` or `APPEND_SYSTEM.md`), and `PI_CODING_AGENT_DIR` pointed at a fresh private per-process directory | planted project `SYSTEM.md`, `APPEND_SYSTEM.md`, `AGENTS.md`, extension file, `$HOME/.agents/skills` skill and agent-directory prompt template are not loaded by the real Pi loader, and are loaded outside server mode; a promoted bundle's skills still load — `harness/test/loader-lockdown.test.ts`; the same options on the solve and verdict leaves, `test/run-leaf.test.ts`; the private 0700 `PI_CODING_AGENT_DIR`, `packages/server/test/server-process.test.ts` | |
There was a problem hiding this comment.
nit: The R3 row and the amendment now say "converge leaf (realProduceVerdict)", but R4's test column on this row still says "the same options on the solve and verdict leaves". You could rename it to "solve and converge leaves" here as well, so the two rows read the same.
clawgenti
left a comment
There was a problem hiding this comment.
Review: #363's leftovers — newline pin and MI1 citation fixes
Small, well-scoped cleanup. I verified the claims on head rather than taking the body's word for it:
- Citations:
makeExecTokenValidatoratpackages/sandbox-relay/src/main.ts:113(through:142),makeDefaultValidateTokenat:501with its doc comment from:490— all match.deploy/vm/README.md's "step 8 below, and the paragraph after it" correctly targets step 8 ("Enables and restartssh-relay.service…") and the "A re-run restarts what it owns" paragraph. - R3 spec row vs code:
runPromptLeafdoes callassertServerSandboxitself (harness/src/run-leaf.ts:596), so the amended wording matches the code. - The new test:
bash deploy/vm/tests/setup-vm.test.shpasses on head, including the new "ensure_exec_listener appends on its own line to a relay.env with no final newline" case.
No findings. The already-resolved-on-main list checks out (no claimName in packages/server/src, no run-turn.ts line cites in the spec).
Author: webchang (MEMBER — maintainer)
Areas reviewed: Shell (test), Docs (spec, README)
Agent/IDE config (.claude/.vscode): none
Commits: 1, signed off: yes
CI status: all checks passing
Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).
clawgenti
left a comment
There was a problem hiding this comment.
Generated by RepoMan github-pr-review@235a7f7 (https://github.com/rossoctl/agent-skills/blob/235a7f7620139ee3e4ab0872b8439591fe52e8c1/skills/github-pr-review/SKILL.md).
Takes upstream main at 1a7f41e (19 merges since 032c8f6): the sandbox idle lifetime across docs, control plane, clients and deploy (rossoctl#820, rossoctl#837, rossoctl#842, rossoctl#843), grant redemption (rossoctl#822), the lease-check log line (rossoctl#824), egress fixes (rossoctl#829, rossoctl#834), the mock wait (rossoctl#828), the deadline timer (rossoctl#835), the create rollback (rossoctl#832), multi refusals and the rossoctl#363 leftovers (rossoctl#833, rossoctl#838), the identity near-miss check (rossoctl#827), mocactl login errors (rossoctl#836), the ghostunnel probes (rossoctl#830), refusal-burst deferral (rossoctl#831), a sandbox-worker change (rossoctl#841) and the v0.11 doc truth (rossoctl#821). Conflicts (one): - deploy/sbx/README.md, the "Optional inputs" table. Upstream (rossoctl#843) rewrote the SBX_LIFETIME_DAYS row (the default idle lifetime, at most SBX_MAX_LIFETIME_DAYS) and added the SBX_MAX_LIFETIME_DAYS and SBX_LOWER_WORKSPACE_IDLE rows, which widened the table; the fork had added an SBX_GATE_RECORD_SCHEMA row at its end. Resolved by taking upstream's table whole and appending the fork's SBX_GATE_RECORD_SCHEMA row after SBX_PROFILE, then re-padding the table with prettier. The fork's env-file example line for SBX_GATE_RECORD_SCHEMA merged cleanly. Merged without markers, checked: setup.sh keeps the fork's SBX_GATE_RECORD_SCHEMA validation and its sbx-settings write (so it stays in the settings hash) beside upstream's SH_SANDBOX_MAX_LIFETIME_SECONDS; both ocp-sbx and ocp-combined patch-control-plane.yaml keep the optional SH_GATE_RECORD_SCHEMA from sbx-settings beside the new optional SH_SANDBOX_MAX_LIFETIME_SECONDS; setup.test.sh keeps the fork's cases beside upstream's. The fork's RUNBOOK, README and template-onboarding docs say nothing about sandbox lifetime, refusal bursts, login errors or the create rollback, so none needed a correction; GUIDE.md is unchanged and GUIDE.pdf is not regenerated. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Rong Chang <[email protected]>
Closes #363
#833 took this issue's two multi-tenant boot refusals. This PR does the rest, so every box can be ticked.
What changed and why
ensure_exec_listener'send_with_newlinecall (deploy/vm/setup-vm.sh, now at:665).setup-vm.test.shgains a pre-MI1 migration fixture whoserelay.envends withSH_RELAY_TOKEN=keepand no final newline. The test checks two things after the migration:SH_RELAY_TOKENis still exactlykeep, andMOCA_RELAY_EXEC_ADDR=127.0.0.1:9444is on its own line. This mirrors the existingensure_exec_tokenno-newline case.docs/specs/2026-09-28-moca-multi-user-isolation-design.md):realProduceVerdict);runPromptLeafcallsassertServerSandbox) with its R4 lockdown still throughexecuteTurn;harness/test/run-leaf.test.ts("refuses a server-mode prompt leaf with no sandbox itself, even with executeTurn injected").makeDefaultValidateTokenis nowpackages/sandbox-relay/src/main.ts:501-538(its doc comment from:490), andmakeExecTokenValidatoris:113-142.deploy/vm/README.md: "(step 3 below)" now points at step 8 and the paragraph after it ("A re-run restarts what it owns"). The issue said step 7. The steps were renumbered since it was filed, and the restarts are now step 8.Already resolved on main (no change here)
/workloads: ticked in the issue; GET no longer writes back.claimName's|| multiterm:claimNameis no longer inpackages/server/src(git grep -n claimName -- packages/server/srcfinds nothing), so the term and its test are gone.handleCreateWorkload's "wherever callers are told apart": that wording is no longer inpackages/server/src.:94'srun-turn.ts:836-848cite: the spec no longer citesrun-turn.tsline numbers.Validation
deploy/vm/tests/setup-vm.test.shpasses under bash 5 and under macOS's/bin/bash3.2. It showsok - ensure_exec_listener appends on its own line to a relay.env with no final newline.end_with_newline "$relay"line atsetup-vm.sh:665deleted, the suite fails withFAIL: migrating a relay.env with no final newline changed SH_RELAY_TOKEN. Before this PR, deleting that line left the suite green.shellcheck -S warning(shellcheck-py 0.10.0.1) is clean on the test. Prettier andcheck-doc-links.py(0 broken links) pass, and so does pre-commit.Every commit is signed off (DCO).
Assisted-By: Claude Code