Braid's program out of the sandbox, osfd's git sandboxed, a model gate, the merge gate's proof, and a test that cannot hang (#532 #493 #492 #548 #561) #566

Merged
cmoriarty merged 12 commits from claude/ready-six into main 2026-11-20 01:24:31 -05:00
Owner

Five of the six tickets that had no blockers, as four OpenSpec changes. The sixth, braid#533, is research: its numbers and a proposal are on the issue for the owner's choice.

braid#532 and braid#493: the sandbox's edges (sandbox-edges-493-532)

  • Braid's program is in no sandbox. Every step sandbox hides Braid's folder; its spawner and the shell wrapper run on the image's own interpreter from copies outside it. No shell gets OSF_PYTHON.
  • The braid tool runs Braid's checks beside the sandbox, in the run's server: lint, check-report, plan-check, plan-check-replan, spec-length. The briefs name it; a shell command that runs $OSF_PYTHON is refused, naming the call that does the same. The lint writes the help of each rule it reports (braid#565's first finding).
  • Pages for agents: every run holds a read-only braid-docs/ (the lint's rules and the checks, generated from their own help; lanes, helpers, files, background commands), named in one line at the end of every agent brief.
  • osfd's git in a run's folder runs in a sandbox of its own: with sandboxes on, <state>/bin/git runs each git command that touches a run's repository in a one-off bubblewrap with no network. A hook, an fsmonitor or a filter an agent plants runs with the agent's reach.
  • The forge is reached from osfd's own copy: pushes, the base sync, the archive and git-flow run in a repository outside the run that borrows its objects, so the token never meets the run's configuration or hooks.
  • Braid's interpreter never imports from a worktree: OSF_PYTHON is a launcher with -P, and osfd's own module runs take -P.

braid#492: model keys stay with osfd (model-key-gate-492)

Every provider of a run's opencode.json names /gate/<run>/<provider> and a token minted for the run; the gate checks it, forwards to the provider with its key and an x-braid-gate mark, and streams the answer back. No configuration holds a {file:} reference, so the fence reads no key file. The look tool goes through the gate; the forgejo MCP server is refused with sandboxes on. Every simulated run now fails if its fake model saw a request that did not come through the gate.

braid#548, slice 2: the merge gate's proof (merge-gate-proof-548)

When the merge gate opens, Braid joins the last fix round's scenarios by part (a passing test, a look, left out with why, none), the lanes, the Visual check's screenshots and session, the code review's notes and the tasks, and judges six checks. The card leads with the verdict, looks first.

The merge gate's card, desktop and phone (a seeded test server)

The merge gate's proof on a desktop

The merge gate's proof on a phone

braid#561: a scheduler test that cannot hang (scheduler-test-cannot-hang-561)

Since Python 3.12 a gather of tasks that have all ended completes without yielding, so the drain spun while a finished attempt's own callback waited for a turn of the loop. On two Linux cores 9 to 14 runs in 1,500 hung; with one turn of the loop after each gather, 3,000 of 3,000 pass. Every wait in these tests now gives up after 10 s, naming what it waited for.

Verification

  • ./tools/test.sh passes in 49 s; ./tools/sim.sh --smoke passes 7 of 7.
  • In the image built from this branch, with the stack's sandbox options (step-unfenced; Docker Desktop has no Landlock): a step sandbox lists Braid's folder empty and cannot import osf while its shell and Playwright's browsers work; a planted post-commit hook and fsmonitor run inside osfd's git sandbox and cannot read a token file outside; braid-selfcheck passes with its 6 simulated runs. The git wrapper costs about 28 ms a command.

🤖 Generated with Claude Code

Five of the six tickets that had no blockers, as four OpenSpec changes. The sixth, braid#533, is research: its numbers and a proposal are on the issue for the owner's choice. ## braid#532 and braid#493: the sandbox's edges (`sandbox-edges-493-532`) - **Braid's program is in no sandbox.** Every step sandbox hides Braid's folder; its spawner and the shell wrapper run on the image's own interpreter from copies outside it. No shell gets `OSF_PYTHON`. - **The `braid` tool** runs Braid's checks beside the sandbox, in the run's server: `lint`, `check-report`, `plan-check`, `plan-check-replan`, `spec-length`. The briefs name it; a shell command that runs `$OSF_PYTHON` is refused, naming the call that does the same. The lint writes the help of each rule it reports (braid#565's first finding). - **Pages for agents**: every run holds a read-only `braid-docs/` (the lint's rules and the checks, generated from their own help; lanes, helpers, files, background commands), named in one line at the end of every agent brief. - **osfd's git in a run's folder runs in a sandbox of its own**: with sandboxes on, `<state>/bin/git` runs each git command that touches a run's repository in a one-off bubblewrap with no network. A hook, an fsmonitor or a filter an agent plants runs with the agent's reach. - **The forge is reached from osfd's own copy**: pushes, the base sync, the archive and git-flow run in a repository outside the run that borrows its objects, so the token never meets the run's configuration or hooks. - **Braid's interpreter never imports from a worktree**: `OSF_PYTHON` is a launcher with `-P`, and osfd's own module runs take `-P`. ## braid#492: model keys stay with osfd (`model-key-gate-492`) Every provider of a run's `opencode.json` names `/gate/<run>/<provider>` and a token minted for the run; the gate checks it, forwards to the provider with its key and an `x-braid-gate` mark, and streams the answer back. No configuration holds a `{file:}` reference, so the fence reads no key file. The `look` tool goes through the gate; the forgejo MCP server is refused with sandboxes on. Every simulated run now fails if its fake model saw a request that did not come through the gate. ## braid#548, slice 2: the merge gate's proof (`merge-gate-proof-548`) When the merge gate opens, Braid joins the last fix round's scenarios by part (a passing test, a look, left out with why, none), the lanes, the Visual check's screenshots and session, the code review's notes and the tasks, and judges six checks. The card leads with the verdict, looks first. <details><summary>The merge gate's card, desktop and phone (a seeded test server)</summary> ![The merge gate's proof on a desktop](/attachments/da5b9d18-ba53-49c1-8e67-b560652bca57) ![The merge gate's proof on a phone](/attachments/f93b93f0-6178-405a-9566-a2b0e643f263) </details> ## braid#561: a scheduler test that cannot hang (`scheduler-test-cannot-hang-561`) Since Python 3.12 a gather of tasks that have all ended completes without yielding, so the drain spun while a finished attempt's own callback waited for a turn of the loop. On two Linux cores 9 to 14 runs in 1,500 hung; with one turn of the loop after each gather, 3,000 of 3,000 pass. Every wait in these tests now gives up after 10 s, naming what it waited for. ## Verification - `./tools/test.sh` passes in 49 s; `./tools/sim.sh --smoke` passes 7 of 7. - In the image built from this branch, with the stack's sandbox options (`step-unfenced`; Docker Desktop has no Landlock): a step sandbox lists Braid's folder empty and cannot import `osf` while its shell and Playwright's browsers work; a planted `post-commit` hook and fsmonitor run inside osfd's git sandbox and cannot read a token file outside; `braid-selfcheck` passes with its 6 simulated runs. The git wrapper costs about 28 ms a command. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Since Python 3.12 a gather of tasks that have all ended completes without
yielding, so the drain spun while a finished attempt's done callback, the one
that takes it off _running, waited for a turn of the loop. On two Linux cores
9 to 14 runs in 1,500 hung; with one turn of the loop after each gather, 3,000
of 3,000 pass. Every wait in these tests now gives up after 10 s, naming what it
waited for and where each running task is stopped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Every sandbox hides Braid's folder; the spawner and the shell wrapper run on
  the image's interpreter from copies outside it, and no shell gets OSF_PYTHON.
- The braid tool runs Braid's checks (lint, check-report, plan-check,
  plan-check-replan, spec-length) in the run's server, beside the sandbox; the
  briefs name it, and the lint writes the help of each rule it reports.
- Every run holds read-only pages on how Braid works there, named at the end of
  every agent brief.
- With sandboxes on, osfd's git in a run's folder runs through <state>/bin/git
  in a one-off bubblewrap with no network; a forge address or token there is
  refused.
- Pushes, the base sync, the archive and git-flow reach the forge from osfd's
  own copy outside the run, which borrows the run's objects.
- OSF_PYTHON is a launcher with -P: nothing in a worktree is imported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found by the image's self-check: the probe ran osfd's interpreter, now hidden,
inside a sandbox; the git sandbox's credential filter took GIT_AUTHOR_NAME for
a secret. The confined-shell scenario now expects no OSF_PYTHON.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every provider of a run's opencode.json (the backend, planning, Repair's, a
Free run's router) names /gate/<run>/<provider> and a token minted for the run;
the gate checks the token, forwards to the provider with its key and the
x-braid-gate mark, and streams the answer back. No configuration holds a
{file:} reference, so the fence reads no key file. The look tool goes through
the gate too; the forgejo MCP server is refused with sandboxes on. Every
simulated run checks that the fake model's requests came through the gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a merge gate opens, Braid joins the last fix round's scenarios by part
(a passing test, a look, left out with why, none), the lanes, the Visual
check's screenshots and session, the code review's notes and the tasks, and
judges six checks: Scenarios with proof, Tests, Seen working, Code review,
Tasks and Same code, by each file's content as the check saw it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The verdict and the six checks, those asking for a look first; the Visual
check's screenshots with the criteria each stands for; its session; the
proof by part; the lanes and CI; the review notes left. A gate with no proof
record is drawn as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs(openspec): the four changes' verification is ticked: suite, simulated runs, the image
Some checks failed
test / suite (pull_request) Failing after 1m41s
837776757e
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(agent): the braid tool runs on the image's interpreter, which the run's fence reads (#532)
All checks were successful
test / suite (pull_request) Successful in 1m29s
1f15d59a23
The launcher $OSF_PYTHON names lives in osfd's state folder, outside the
fence; the tool sets PYTHONSAFEPATH itself, as -P would.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix(gate): the provider's request is closed however the answer's stream ends (#492)
All checks were successful
test / suite (pull_request) Successful in 1m35s
39e4f760b0
A step stopped mid-answer drops the server's request to the gate; the gate's
own request to the model goes with it, so nothing generates for nobody.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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
cmoriarty/braid!566
No description provided.