Skip to content

[plugin-standard] Implement opt-in, consented install-time spec.build for source-built plugins - #3166

Merged
orbit-agent-01 merged 1 commit into
agent-mainfrom
orbit/ORB-13887-96835179
Oct 4, 2026
Merged

orbit-agent-01 merged 1 commit into
agent-mainfrom
orbit/ORB-13887-96835179

Conversation

@orbit-agent-01

Copy link
Copy Markdown
Contributor

Task

ORB-13887 — [plugin-standard] Implement opt-in, consented install-time spec.build for source-built plugins

Description

Outcome

Implement spec.build: {command} for Orbit plugins exactly as decided by the threat model delivered in ORB-12878 (read it first under docs/design/plugins/; it is the contract — where this description and the model disagree, the model wins). Requested by Daniel for the 2026-10-04 on-call (ORB-13886).

RESUME FROM THE PRESERVED CANDIDATE — do not re-implement

A complete implementation already exists: candidate b63c9d701 on branch orbit/ORB-13887-ddb04571 (closed PR #3140). All six earlier attempts stopped on infrastructure problems, not on this code: reviewer clock, no rework loop, exhausted review lineage (now reset), a Claude 401 on the Mac, and the box validation PATH bug.

  1. Fetch orbit/ORB-13887-ddb04571 and bring its changes onto the current base (rebase or merge onto agent-main HEAD). Resolve conflicts minimally.
  2. Fix the one known code defect. On macOS, build_sandbox::tests::macos::an_offline_phase_reaches_only_its_build_directory fails on this candidate. Make it pass without weakening the offline-phase guarantee. If the test's expectation is wrong for macOS sandbox-exec semantics, explain why in the execution summary.
  3. Run make ci-fast, make ci-lint and make goldens, and the build_sandbox tests on this platform. Keep the existing scope; add nothing new.

GitHub CI on the old candidate failed only on two tests that were red on agent-main at the time (fixed at 8861d0c).

Scope

  • plugin.yaml schema: optional spec.build.command (argv array, not a shell string) plus any timeout/output caps the model requires; validation rejects unknown fields.
  • orbit plugin add / upgrade from a git+ (or local path) source with spec.build: refuses unless the operator passes the explicit consent flag the model names; runs the build once under the decided sandbox profile, environment allowlist and write scope; enforces timeout and kills the process group; digests the produced artifact and records source, command, consent and digest in the install record.
  • Pin files / plugin sync: a pin alone never triggers a build; a digest mismatch fails closed with a clear error.
  • orbit doctor reports each source-built plugin's build command, consent record, artifact digest and profile.
  • Managed workers, routines and auto-tasks cannot trigger a build (refused with a typed error).
  • Docs: plugin authoring docs and CONFIG/CLI reference updated.

Validation

Boundary tests: build refused without consent; build succeeds with consent in a fixture plugin (Linux; macOS where the test harness supports it); timeout kills the process group; pin-only sync does not build; digest mismatch fails closed; doctor output golden. make ci-fast, make ci-lint, make goldens.

Acceptance Criteria

  • A plugin with spec.build installs from source only with the explicit per-install consent flag; without it the install is refused with a typed error
  • The build runs under the threat model's sandbox profile, environment allowlist, write scope, timeout and process-group kill, and the produced artifact digest is recorded
  • A committed pin file alone never triggers a build; a digest mismatch fails closed
  • orbit doctor reports source-built plugins with command, consent, digest and profile
  • Managed workers, routines and auto-tasks cannot trigger a build
  • Boundary tests cover the above; make ci-fast, make ci-lint and make goldens pass

Execution Summary

Click to expand

Outcome: success, but the macOS fix is unverified on macOS. This run landed on a Linux host (jrun-20261004-2105-c38), not the Mac pull drain. The macOS kernel test could not run here. The macOS Platform workflow on this task's PR is the check that decides it.

Resume: applied the preserved candidate b63c9d7 (orbit/ORB-13887-ddb04571; base 3cf41ef) onto the current agent-main HEAD 5f4f171 as an unstaged working-tree diff. None of the 75 candidate paths had changed between the two bases, so the diff applied cleanly with no conflicts. The candidate was not re-implemented, and no scope was added.

macOS defect (build_sandbox::tests::macos::an_offline_phase_reaches_only_its_build_directory):

  • Evidence limits: the CI log was unreachable from this lane (gh unauthenticated, API rate-limited). The ORB-13971 sweep excerpt shows only that the test FAILED about 58 ms after start, with no assertion text. Under that timing, a launch failure is more likely than a leak or a hang.
  • Diagnosis by comparison: the agent profile (compile_macos_sandbox_profile) is also (deny default). The same CI job proves it runs /bin/sh + cat. Its non-file allowances include two provenance-related MAC syscalls: vnguard and Sandbox fix: Fix CodeQL cleartext-logging alerts (rust/cleartext-logging) [T2… #67. Their in-repo rationale (da7ec2d, policy-sandbox decisions) is that without them current macOS fails process startup with a bare "Operation not permitted". The build profile lacked both. It also lacked the same-sandbox process-info allowance that the Codex/Chromium deny-default baselines carry. The test's expectations (writable build dir; no read or write beside it; no loopback TCP; exit 0) all match sandbox-exec semantics, so the test was not changed.
  • Fix: crates/orbit-exec/src/build_sandbox/macos.rs adds (allow process-info* (target same-sandbox)) and the two system-mac-syscall allows. None of them grants a file read, a file write or the network, so the offline-phase guarantee is unchanged: reads stay limited to the runtime, consented programs, toolchains and build dir; writes to the build dir; (deny network*) and the credential denies stay last. The sandbox golden macos/plugin_build_offline.sbpl was regenerated; its diff is exactly the three new lines. docs/design/plugins/3_install_time_build.md §3.2 now names the profile's non-file allowances.
  • Residual risk: if the root cause is something else (for example a startup read outside the runtime table), the macOS CI leg will fail this test again and print its output in the assertion message.

Acceptance criteria (implementation from the candidate; previously evidenced in the prior run's attached validation-report):

  1. Consent flag required, typed refusal: unchanged from the candidate; covered by its boundary tests (ci-fast green).
  2. Sandbox profile, env allowlist, write scope, timeout and process-group kill, digest: unchanged on Linux. macOS profile repaired as above. build_sandbox supervise tests passed here.
  3. Pin-only sync never builds; digest mismatch fails closed: unchanged from the candidate.
  4. Doctor reports command, consent, digest, profile: unchanged; output golden passes in make goldens.
  5. Managed contexts refused: unchanged from the candidate.
  6. Gates: see below.

Validation (logs attached under jrun-20261004-2105-c38/):

  • PASSED: make ci-fast (exit 0).
  • PASSED: make ci-lint (exit 0). The distributed_drain clippy failure seen on the earlier base no longer reproduces on the current base.
  • PASSED: make goldens (exit 0). make goldens UPDATE=1 (exit 0) changed only macos/plugin_build_offline.sbpl relative to the candidate.
  • PASSED: ./scripts/build-budget.py -- cargo test -p orbit-exec --lib build_sandbox -- --nocapture (8 passed, Linux).
  • NOT RUN: the macOS sandbox-exec tests. This is a Linux host with no macOS target installed and no Mac access from this lane. Verification falls to the macOS Platform workflow on the PR (cargo test -p orbit-exec with ORBIT_REQUIRE_SANDBOX_EXEC=1).
  • NOT RUN: live Linux bwrap build fixtures. This runner denies nested user namespaces (the ci-fast namespace probe skipped for the same reason).
  • NOT RUN: make ci (reserved for PR CI).
  • PASSED: git diff --check.

Reconciliation: 75 status entries (the candidate's 59 modified plus 16 new files; my three edits fall within them). Every untracked path has an exact file: selector and every tracked path is covered by a file: or dir: selector, so no selector changes were needed. Nothing staged, deleted or renamed. HEAD is unchanged at 5f4f171. Scratch and logs are under .orbit/tmp only. One stray scratch listing was written to /tmp/x by mistake; that path is inside this run's private bwrap tmpfs, so it never reached the host. Changes are left uncommitted for the pipeline.

Validation

  • Not reported

Branch Freshness

  • Base ref: origin/agent-main
  • Head ref: orbit/ORB-13887-96835179
  • Behind base: 0
  • Ahead of base: 1

Orchestrated-By: opus

….b… [ORB-13887]

[plugin-standard] Implement opt-in, consented install-time spec.build for source-built plugins

Planned-By: claude
Orchestrated-By: opus
@orbit-agent-01
orbit-agent-01 merged commit 1a4a7a4 into agent-main Oct 4, 2026
8 of 9 checks passed
@orbit-agent-01
orbit-agent-01 deleted the orbit/ORB-13887-96835179 branch October 4, 2026 21:50
danieljhkim added a commit that referenced this pull request Oct 4, 2026
…n macOS 26 [ORB-13998] (#3173)

On macOS 26, process startup reads the root directory itself. The
deny-default `macos-sandbox-build-v1` profile refused it
(`deny(1) file-read-data /`), so every exec under it, even
/usr/bin/true, aborted with SIGABRT before main. That broke
build_sandbox::tests::macos::an_offline_phase_reaches_only_its_build_directory
on the macOS Sandbox CI leg (Signaled(6) != Exited(0)).

Allow file-read-data on `(literal "/")` only: the root's entry names,
never a path below it. The test's secret-read, outside-write and
loopback-network denials still hold. Golden regenerated.

Regression from ORB-13887 (#3166), which introduced the profile.


Task: ORB-13886

Co-authored-by: Claude Opus 5.5 <[email protected]>
danieljhkim added a commit that referenced this pull request Nov 14, 2026
…4554] (#9366)

Fixes: 1a4a7a4 ("feat: [plugin-standard] Implement opt-in, consented install-time spec.b… [ORB-13887] (#3166)")
Regression-From: ORB-13887
Orchestrated-By: fable

Co-authored-by: orbit[muse-spark-1.3-contributor] <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant