residents: private /tmp per identity; harness hardening from the deploy review #13

Merged
founder merged 1 commit from harness-hardening into main 2026-09-06 21:33:32 +00:00
Owner

Incident 2026-09-06 (attribution). Every resident process is a child of the supervisor unit and shares its PrivateTmp. During the first-work wave the manager and billing threads both wrote /tmp/mcp-call.sh; the manager's later calls ran billing's version (billing's hub session, Redmine key and Zulip account), so Redmine #12 + children, the resident DMs and the #office status carry billing's attribution while the manager reported the work as its own. Codex and Claude processes now start through unshare --mount --propagation private with <identity home>/tmp bound over /tmp (validated inside the supervisor's mount namespace on the forge); the harness binds a per-identity tmp and home.

Harness hardening (the deploy review's must-fix list, dispatch PR #11 follow-up):

  • steers drained after every completion and answered in the same turn; leftovers ride into the next turn ahead of the prompt (TestRunTurnAnswersSteerThatArrivesDuringFinalCompletion, TestRunTurnInjectsLeftoverSteersAtStart);
  • dangling tool calls from a crash get synthetic results on load (TestLoadSessionRepairsDanglingToolCalls);
  • finish_reason: one continuation nudge on length, error/content_filter fail the turn (TestRunTurnHandlesFinishReasons);
  • compaction: 16k budget, low effort, mechanical fallback instead of wedging (TestCompactionFallsBackToMechanicalSummary);
  • provider routing: require_parameters with tools, first-party pin for z-ai/*/moonshotai/*, xhigh/max pass through, max_tokens from the org; openrouter tiers must set reasoning_effort, context_window, max_tokens;
  • file tools canonicalise symlinks and share the sandbox deny list (TestFileScopeResistsSymlinkEscape);
  • sandbox: preflight at construction, identity credential files + .ssh re-exposed (git commit/push), /run read-only after the exposed files, per-identity Home/Tmp required, 402 requeues.

Still open (documented follow-ups): SSE streaming for multi-minute thinking completions; an on-forge integration run of a router identity (commit + push) once the OpenRouter key exists.

go test ./... green.

**Incident 2026-09-06 (attribution).** Every resident process is a child of the supervisor unit and shares its `PrivateTmp`. During the first-work wave the manager and billing threads both wrote `/tmp/mcp-call.sh`; the manager's later calls ran billing's version (billing's hub session, Redmine key and Zulip account), so Redmine #12 + children, the resident DMs and the `#office` status carry billing's attribution while the manager reported the work as its own. Codex and Claude processes now start through `unshare --mount --propagation private` with `<identity home>/tmp` bound over `/tmp` (validated inside the supervisor's mount namespace on the forge); the harness binds a per-identity tmp and home. **Harness hardening** (the deploy review's must-fix list, dispatch PR #11 follow-up): - steers drained after every completion and answered in the same turn; leftovers ride into the next turn ahead of the prompt (`TestRunTurnAnswersSteerThatArrivesDuringFinalCompletion`, `TestRunTurnInjectsLeftoverSteersAtStart`); - dangling tool calls from a crash get synthetic results on load (`TestLoadSessionRepairsDanglingToolCalls`); - `finish_reason`: one continuation nudge on `length`, `error`/`content_filter` fail the turn (`TestRunTurnHandlesFinishReasons`); - compaction: 16k budget, low effort, mechanical fallback instead of wedging (`TestCompactionFallsBackToMechanicalSummary`); - provider routing: `require_parameters` with tools, first-party pin for `z-ai/*`/`moonshotai/*`, xhigh/max pass through, `max_tokens` from the org; openrouter tiers must set `reasoning_effort`, `context_window`, `max_tokens`; - file tools canonicalise symlinks and share the sandbox deny list (`TestFileScopeResistsSymlinkEscape`); - sandbox: preflight at construction, identity credential files + `.ssh` re-exposed (git commit/push), `/run` read-only after the exposed files, per-identity `Home`/`Tmp` required, 402 requeues. Still open (documented follow-ups): SSE streaming for multi-minute thinking completions; an on-forge integration run of a router identity (commit + push) once the OpenRouter key exists. `go test ./...` green.
Incident 2026-09-06: every resident process is a child of the supervisor
unit and shares its PrivateTmp. The manager and billing threads both wrote
/tmp/mcp-call.sh during the first-work wave; the manager's later calls ran
billing's version (billing's hub session, Redmine key and Zulip account),
so the wave's Redmine parent/children, resident DMs and #office status all
carry billing's attribution. Codex and Claude processes now start through
unshare --mount with <identity home>/tmp bound over /tmp; the harness binds
a per-identity tmp and home as well.

Harness (must-fix list of the deploy review):
- steers are drained after every completion, answered in the same turn,
  and leftovers ride into the next turn ahead of the prompt;
- dangling tool calls left by a crash are answered with synthetic results
  on load (thinking providers reject the transcript otherwise);
- finish_reason: one continuation nudge on length, error/content_filter
  fail the turn; compaction gets a 16k budget, low effort and a mechanical
  fallback instead of wedging the thread;
- provider routing: require_parameters with tools, first-party pin for
  z-ai/* and moonshotai/*, xhigh/max pass through, max_tokens from the org
  (openrouter tiers must set effort, context_window and max_tokens);
- file tools canonicalise symlinks and share the sandbox's deny list;
- sandbox: preflight at construction (fail the identity fast), the
  identity's credential files and .ssh re-exposed so git commit/push work,
  /run remounted read-only after the exposed files, 402 requeues.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
founder deleted branch harness-hardening 2026-09-06 21:33:32 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
key-store/dispatch!13
No description provided.