Repository navigation
Plugin sandbox: let an exact-file write grant cover a repo-root file such as AGENTS.md in a managed run - #9752
Merged
Merged
Conversation
Plugin sandbox: let an exact-file write grant cover a repo-root file such as AGENTS.md in a managed run
Design choice (recorded in docs/design/plugins/1_scope.md, Exact-file write admission, *Workspace root files*): extend the exact-file grant rather than add a `{{workspace}}` directory grant minus .git/.orbit, because the directory form would also open every other root file and anything created at the root later.
Orbit-Task: ORB-25145
Manifest verified: attempt rvw-f02c127590df-1, HEAD e5471a0 equals candidate.commit, base cdfa703 is an ancestor of HEAD, and required_validation_commands is present and empty. The implementation meets the four acceptance criteria on this Linux host: the conformance scenario passes with {{workspace}}/AGENTS.md created in the scratch workspace; the Landlock test rewrites a group-writable AGENTS.md and an AGENTS.md -> CLAUDE.md link under the real sandbox; refusals for .git, .orbit, another root file, links leaving the worktree, links into metadata, missing link targets, and spawn-time retargeting are covered; plugins.md documents the grant and its limits. Code review found no correctness defect. Three documentation defects were repaired: a stray task citation and a misjoined paragraph in docs/design/plugins/1_scope.md; a plugins.md statement that Orbit never creates the grant file, which contradicts orbit plugin test creating it, plus an entry rule missing the workspace-link exception (source and synced copy); and the STD-05@1 §R7 deviation, which the repository rules require to be recorded in a 4_decisions.md entry, was unrecorded, so docs/design/plugins/4_decisions.md was added. Not run: a macOS Seatbelt run of the link-target grant (no macOS host; the Landlock test is Linux-gated). Observation, not changed: a manifest path spelled under .git that is a symlink to an allowed in-worktree file is granted that file; this follows the physical-path rule (STD-05 §R6) and is recorded in the new decision entry's cost. Repaired findings: F1, F2, F3. Changed paths: crates/orbit-core/assets/skills/orbit-setup/references/plugins.md, docs/design/plugins/1_scope.md, docs/design/plugins/4_decisions.md, plugin/skills/orbit-setup/references/plugins.md. Orbit-Task: ORB-25145 Orbit-Review-Attempt: rvw-f02c127590df-1 Orbit-Review-Crew: haiku@xhigh
Friction F2026-11-327; Daniel authorized the assertion update (session f09993e5, 2026-11-16). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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.
Task
ORB-25145 — Plugin sandbox: let an exact-file write grant cover a repo-root file such as AGENTS.md in a managed run
Description
The constellation
standardsplugin'sstandards.sync(built in ORB-25088 to ORB-25091, ws_constellation) re-vendorsdocs/standards/and rewrites the managed block in the repository'sAGENTS.md. No grant Orbit admits lets it write that one file in a managed run, so every sync task refusesmanaged_block_not_writableand the drift routine cannot be switched on. Measured with Orbit 0.50.0 (umbrelladocs/design/standards-plugin/1_scope.md, Risks):fs.write: ["{{workspace}}"]is refused atorbit plugin validate, because the root contains.git.fs.write_files: ["{{workspace}}/AGENTS.md"]passes validate but:orbit plugin test, because the conformance workspace is empty and an exact-file grant refuses a missing file;AGENTS.mdis an in-repository symlink, which is Orbit's own layout (AGENTS.md→CLAUDE.md).Goal: a mutating plugin can be granted one named file at the workspace root, and in a managed run that grant reaches the task worktree's file, including a symlink whose target stays inside the worktree. Which of these is the fix is the implementer's call; record it in the plugin design docs:
{{workspace}}grant that excludes.gitand.orbit.The fix must not widen the grant to
.git,.orbitor paths outside the worktree, and must not grant a symlink whose target leaves the worktree (STD-05).sandbox: noneis not an acceptable answer for a mutating tool.Acceptance Criteria
{{workspace}}/AGENTS.mdpassesorbit plugin validateandorbit plugin test, where the conformance fixture creates that file.AGENTS.mdwhen it is group-writable and when it is a symlink toCLAUDE.mdin the same worktree; tests hold both cases..git/,.orbit/, any other root file, and a symlink whose target is outside the worktree; tests hold each refusal.plugins.mdin the orbit-setup skill documents the grant and its limits.Execution Summary
Click to expand
Design choice (recorded in docs/design/plugins/1_scope.md, Exact-file write admission, Workspace root files): extend the exact-file grant rather than add a
{{workspace}}directory grant minus .git/.orbit, because the directory form would also open every other root file and anything created at the root later.Changes:
validatebecameresolve(path, workspace_root). Accepts a group-writable leaf (still refuses other-write), and group-writable ancestors the user owns (other-writable still needs sticky; non-user group-writable needs sticky). The leaf only may be a symlink when the call has a workspace: link inside it, canonical target a safe regular file inside the same workspace, no.git/.orbitcomponent; the target is what is granted. Links without workspace, to outside, missing, or into metadata are refused.PluginBackendSpec::rendered_manifest_write_files.fs.write_filesentry rendering inside the scratch workspace (not via .., not in .git/.orbit, never over an existing entry) as an empty 0600 file before admission.{{workspace}}to caller.worktree (brokered.rssandbox_profile(Some(&caller.worktree))), so the grant reaches the task worktree's file; brokered filtering now compares the granted file. No change to orbit-exec boundary.rs (it receives the canonical target, a regular file).Criteria:
{{workspace}}/AGENTS.md: PASS — new scenario rowa_workspace_exact_file_grant_passes_conformance_on_a_created_file(fails without the runner change, verified by disabling it); manual QA via candidateorbit plugin validate(exit 0) andorbit plugin test(1/1 passed) under a disposable HOME/ORBIT_ROOT.a_workspace_agents_md_grant_writes_that_file_only_under_landlock(linux, real run_process).a_workspace_agents_md_link_leaving_the_worktree_or_into_metadata_is_refusedcovers links to an absolute outside file, ../outside.md, .git/config, .orbit/config.toml, .git dir, missing target, link without workspace, and spawn-time retarget. PASS.Validation:
Risks/deviations: relaxing group-write is a deliberate widening per the task. Manual QA note: the scratch QA workspace was under .orbit/tmp inside the live checkout, so workspace discovery found the live checkout's .orbit; its one write attempt (catalog refresh) was refused by the read-only sandbox, so nothing was changed there. Backends must rewrite the file in place; rename-replace needs a directory grant (documented).
Reconciliation: 9 modified tracked files, all deliverable; no untracked files outside .orbit/tmp; baseline was clean at 604bec2.
Validation
Branch Freshness
refs/remotes/origin/agent-mainorbit/ORB-25145-0e23595c