Darwin round 2: compiled tool pins and a sticky taint
Astra round 2, finding 2. Unsandboxed code runs as the runner user and could replace srt, then ask for a probe. Now: - srt, Node and ripgrep are checked against pins compiled into the runner (Node's and ripgrep's programs as the pinned archives unpack them; the srt package tree npm ci makes from the shipped lockfile, the same with npm 11 and Node 22's npm 10), at their installed places, srt's link at its fixed target: before and after every probe run, before every sandboxed check, and by the installer. - Once a check runs outside the sandbox the runner is tainted for good and never labels a check sandboxed again. It is kept in the state dir and by the instance (migration 0055 runners.tainted_at, from a tainted hello or any worker check labelled none; a tainted runner's checks are labelled none whatever it reports; every welcome says so). The runners view and docs/mac-runner.md say it plainly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 files changed,
+936
−185
cmd/equipo-runner/install_mac.go+8 −2cmd/equipo-runner/install_mac_test.go+16 −0docs/mac-runner.md+6 −0docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+1 −0docs/superpowers/plans/DARWIN-PROGRESS.md+34 −0internal/equipo/chat/runner.go+32 −0internal/equipo/chat/stream.go+1 −1internal/equipo/chat/tasks.go+14 −2internal/equipo/copy.go+2 −0internal/equipo/mac_view_test.go+4 −2internal/equipo/migrations/0055_thin_checks_sandbox.sql+1 −0internal/equipo/migrations/schema.sql+2 −1internal/equipo/setup/runner_models.go+3 −0internal/equipo/templates/runners.html+1 −0internal/runner/mac/pins.go+114 −0internal/runner/mac/pins_test.go+142 −0internal/runner/thin/mac.go+79 −58internal/runner/thin/mac_test.go+71 −41internal/thintest/placement_contract_test.go+66 −0internal/wire/frames.go+3 −0internal/wire/runners.go+5 −1internal/wire/runners_test.go+1 −0internal/wire/wiretest/testdata/frames/welcome-tainted.json+1 −0scripts/runner-reference-allowlist.json+329 −77
CI passed — run details
Intent
diff --git a/cmd/equipo-runner/install_mac.go b/cmd/equipo-runner/install_mac.go| index 777b7e3e..548d1c23 100644 |
| --- a/cmd/equipo-runner/install_mac.go |
| +++ b/cmd/equipo-runner/install_mac.go |
| @@ -34,7 +34,10 @@ type macInstallHost struct { |
| tools []mac.Tool |
| fetch func(ctx context.Context, url string, limit int64) ([]byte, error) |
| npmCI func(ctx context.Context, npm, prefix string) error |
| - enrol func(ctx context.Context, cfg runner.Config, out io.Writer) error |
| + // verify checks what was installed under lib against the pins |
| + // compiled into this binary (mac.VerifyTools). |
| + verify func(lib string) error |
| + enrol func(ctx context.Context, cfg runner.Config, out io.Writer) error |
| // launchctl runs launchctl; firstLaunch runs xcodebuild -runFirstLaunch. |
| launchctl func(ctx context.Context, args ...string) error |
| // stopWait bounds the wait for a runner to stop (a minute). |
| @@ -52,6 +55,7 @@ func realMacInstallHost() macInstallHost { |
| out, err := exec.CommandContext(ctx, name, args...).Output() |
| return string(out), err |
| }, exposed: mac.Exposed, tools: mac.SRTTools, fetch: fetchTool, |
| + verify: func(lib string) error { return mac.VerifyTools(lib, mac.PinnedTools(lib)) }, |
| npmCI: func(ctx context.Context, npm, prefix string) error { |
| cmd := exec.CommandContext(ctx, npm, "ci", "--prefix", prefix, "--ignore-scripts", "--omit=dev", "--no-audit", "--no-fund") |
| cmd.Env = append(os.Environ(), "PATH="+filepath.Dir(npm)+":/usr/bin:/bin") |
| @@ -150,7 +154,9 @@ func installMac(ctx context.Context, args []string, h macInstallHost, out, errou |
| if os.MkdirAll(prefix, 0700) != nil || os.WriteFile(filepath.Join(prefix, "package.json"), pkg, 0600) != nil || os.WriteFile(filepath.Join(prefix, "package-lock.json"), lock, 0600) != nil { |
| return fail("runner.install.destination") |
| } |
| - if err := h.npmCI(ctx, filepath.Join(filepath.Dir(fetched[mac.Node.Name]), "npm"), prefix); err != nil { |
| + if err := h.npmCI(ctx, filepath.Join(filepath.Dir(fetched[mac.Node.Name]), "npm"), prefix); err != nil || h.verify(lib) != nil { |
| + // Not installed, or not exactly the pinned srt, Node and |
| + // ripgrep: the runner would never trust them anyway. |
| say("runner.mac.no_srt") |
| } else { |
| values["EQUIPO_SRT_PATH"] = filepath.Join(prefix, "node_modules", ".bin", "srt") |
diff --git a/cmd/equipo-runner/install_mac_test.go b/cmd/equipo-runner/install_mac_test.go| index d99a361b..516fb00f 100644 |
| --- a/cmd/equipo-runner/install_mac_test.go |
| +++ b/cmd/equipo-runner/install_mac_test.go |
| @@ -105,6 +105,7 @@ func newMacRig(t *testing.T) *macRig { |
| return nil |
| }, |
| stopWait: 300 * time.Millisecond, |
| + verify: func(string) error { return nil }, |
| firstLaunch: func(context.Context) { x.calls = append(x.calls, "firstLaunch") }, |
| } |
| // Stand-ins for the pinned Node and ripgrep archives, pinned the same |
| @@ -353,3 +354,18 @@ func TestInstallMacWhenTheRunnerWillNotStop(t *testing.T) { |
| } |
| } |
| } |
| + |
| +// What npm installed is checked against the pins compiled into the |
| +// runner: anything else is not the sandbox, said in one line, and no |
| +// srt path is written. |
| +func TestInstallMacVerifiesThePins(t *testing.T) { |
| + x := newMacRig(t) |
| + x.h.verify = func(string) error { return mac.ErrUnpinned } |
| + if code, _, errout := x.install(); code != 0 || !strings.Contains(errout, equipo.RunnerSetupCopy("runner.mac.no_srt")) { |
| + t.Fatalf("%d %q", code, errout) |
| + } |
| + values, _ := runnersetup.ReadEnvFile(filepath.Join(x.home, ".config/equipo-runner/runner.env")) |
| + if _, ok := values["EQUIPO_SRT_PATH"]; ok { |
| + t.Fatal("an unpinned srt configured") |
| + } |
| +} |
diff --git a/docs/mac-runner.md b/docs/mac-runner.md| index 344345fb..4773b586 100644 |
| --- a/docs/mac-runner.md |
| +++ b/docs/mac-runner.md |
| @@ -65,5 +65,11 @@ what it found in Equipo under Connections, Machines. |
| the checks could not run. |
| - Checks that ran outside the sandbox are labelled "ran outside the |
| sandbox" on the task. They are never shown as a plain pass. |
| +- Once any check has run outside the sandbox on this Mac, every later |
| + check is labelled that way too, even if the sandbox works again: |
| + code that ran outside it could have changed the sandbox itself. |
| + Equipo keeps that record, so it can't be cleared on the Mac. To start |
| + clean, install the runner again as a new Mac user. You can see it in |
| + Equipo under Connections, Machines. |
| - A second person on the same Mac repeats the four steps with their own |
| `equipo-<name>` user. |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index b08cc925..a0de5bb8 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -5815,6 +5815,7 @@ records remain unchanged. |
| | `runner.mac.user` | Run the installer as a Standard user named equipo-yourname, such as equipo-paul. | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `runner.mac.home` | This user can get into another person's home folder (%s). An administrator can close it with: sudo chmod 700 %s | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `runner.mac.homes_unknown` | Equipo could not check the other home folders on this Mac, so it stopped. Ask an administrator to check that /Users can be listed, then paste the command again. | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| +| `runner.tainted` | A check has run outside the sandbox on this Mac, so its checks are always labelled that way from now on. To start clean, install the runner again as a new Mac user. | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `runner.mac.still_running` | The runner already on this Mac did not stop, so nothing was changed. Log out of this user and back in, then paste the command again. | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `runner.needs_primary` | This Mac can only run checks for your main runner. Add your main runner first, then open this Mac's link again. | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
| | `runner.mac.no_srt` | The checks sandbox could not be downloaded and installed. Checks will run outside the sandbox and say so. Run the install command again to retry. | Mac runners (Darwin worker) | COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) | |
diff --git a/docs/superpowers/plans/DARWIN-PROGRESS.md b/docs/superpowers/plans/DARWIN-PROGRESS.md| index e65f5488..e89340d3 100644 |
| --- a/docs/superpowers/plans/DARWIN-PROGRESS.md |
| +++ b/docs/superpowers/plans/DARWIN-PROGRESS.md |
| @@ -162,6 +162,40 @@ anything but worker keeps nothing (`ErrEnrolledAsPrimary`) and the |
| installer says to add the main runner first (`TestEnrolKeepsTheRole`, |
| `TestInstallMacEnrolledAsPrimary`). |
| +## Astra round 2 (be0f1e3 and 9e407e2), fixed |
| + |
| +1. Forged approval: the tools srt runs on are checked against pins |
| + compiled into the runner, not a fingerprint taken at run time: |
| + ripgrep's and Node's programs as the pinned archives unpack them |
| + (`RGBinarySHA256`, `NodeBinarySHA256`) and the srt package tree |
| + `npm ci` makes from the shipped lockfile (`SRTTreeSHA256`; the same |
| + with npm 11.17 and Node 22.23.4's own npm 10.9.9), each at its |
| + installed place and srt's .bin link at its fixed target. Checked |
| + before and after every probe run and before every sandboxed check; |
| + the installer checks them too. A runner is tainted for good once any |
| + check runs outside the sandbox (labelled none): it never labels a |
| + check sandboxed again, whatever a later probe says. The taint is kept |
| + in the state dir and by the instance (`runners.tainted_at`, set from |
| + a tainted hello or any worker check labelled none, never cleared; the |
| + instance labels a tainted runner's checks none whatever it reports, |
| + and says tainted in every welcome). The runners view and |
| + docs/mac-runner.md say so. `TestVerifyToolsRefuses`, |
| + `TestVerifyToolsReal` (with the real archives and npm tree, run here: |
| + a one-byte counterfeit srt, a moved ripgrep and a re-pointed srt link |
| + all fail), `TestMacCounterfeitSRT`, `TestMacTaintIsSticky`, |
| + `TestContractWorkerTaintIsSticky`, `TestInstallMacVerifiesThePins`. |
| +2. Reinstall: an agent launchd has is booted out, and a refused bootout |
| + stops the installer at once; it then waits, bounded, until launchd |
| + no longer has it and the state lock is free, or changes nothing and |
| + says so. `TestInstallMacWhenTheRunnerWillNotStop`. |
| +3. Archive links: entries are created through an os.Root; no symbolic |
| + or hard link from an archive is ever made; Node's npm and npx links |
| + are made afterwards with fixed targets, corepack is left out. |
| + `TestFetchMakesNoLinksFromTheArchive` (the chained-link archive). |
| + |
| +Env-gated tests (the real archives and npm tree are not downloaded in |
| +CI) were run here and pass. |
| + |
| ## Decisions |
| - **P2 not denied:** checks still run (ruling 2), labelled none. If the |
diff --git a/internal/equipo/chat/runner.go b/internal/equipo/chat/runner.go| index 90a9d519..4d74f5bd 100644 |
| --- a/internal/equipo/chat/runner.go |
| +++ b/internal/equipo/chat/runner.go |
| @@ -19,6 +19,9 @@ type Lease struct { |
| Process string |
| Protocol int |
| Role string |
| + // Tainted: the instance holds that a check ran outside the sandbox |
| + // on this runner (told in every welcome). |
| + Tainted bool |
| } |
| // Connect grants a generation. A hello with generation 0 is a new runner |
| @@ -38,6 +41,16 @@ func (s *Store) Connect(ctx context.Context, p RunnerPrincipal, process string, |
| return rerr |
| } |
| lease.Role = role |
| + if hello.Capabilities != nil && hello.Capabilities.Tainted { |
| + if err := t.markTainted(p.RunnerID); err != nil { |
| + return err |
| + } |
| + } |
| + tainted, terr := t.tainted(p.RunnerID) |
| + if terr != nil { |
| + return terr |
| + } |
| + lease.Tainted = tainted |
| // A protocol 1 runner is always a primary: a worker that cannot say |
| // what it is never connects. |
| if role == wire.RoleWorker && lease.Protocol < wire.Protocol2 { |
| @@ -139,6 +152,11 @@ func (s *Store) Heartbeat(ctx context.Context, l Lease, hello wire.Hello) error |
| if !online { |
| r.Revision++ |
| } |
| + if hello.Capabilities != nil && hello.Capabilities.Tainted { |
| + if err := t.markTainted(r.RunnerID); err != nil { |
| + return err |
| + } |
| + } |
| if err = t.db.Model(&runnerSessionRecord{}).Where("runner_id = ?", r.RunnerID).Select("hello", "seen_at", "connected", "revision").Updates(&r).Error; err != nil { |
| return err |
| } |
| @@ -506,3 +524,17 @@ func (t *txn) sync(l Lease, v *wire.Sync) error { |
| } |
| return nil |
| } |
| + |
| +// markTainted records, for good, that a check ran outside the sandbox on |
| +// a runner. |
| +func (t *txn) markTainted(runnerID string) error { |
| + return t.db.Exec(`UPDATE runners SET tainted_at = ? WHERE id = ? AND tainted_at IS NULL`, t.now(), runnerID).Error |
| +} |
| + |
| +// tainted reports whether a check ever ran outside the sandbox on a |
| +// runner. |
| +func (t *txn) tainted(runnerID string) (bool, error) { |
| + var n int64 |
| + err := t.db.Raw(`SELECT count(*) FROM runners WHERE id = ? AND tainted_at IS NOT NULL`, runnerID).Scan(&n).Error |
| + return n > 0, err |
| +} |
diff --git a/internal/equipo/chat/stream.go b/internal/equipo/chat/stream.go| index 2ae28e98..66410f90 100644 |
| --- a/internal/equipo/chat/stream.go |
| +++ b/internal/equipo/chat/stream.go |
| @@ -124,7 +124,7 @@ func (rc *runnerConn) serve() { |
| rc.log("runner disconnect", err) |
| } |
| }() |
| - welcome, _ := wire.NewFrame("w"+newID(""), wire.FrameWelcome, wire.Welcome{Generation: rc.lease.Generation, RunnerID: rc.principal.RunnerID, Protocol: rc.lease.Protocol, Role: rc.lease.Role, Release: rastrillo.BuildVersion}) |
| + welcome, _ := wire.NewFrame("w"+newID(""), wire.FrameWelcome, wire.Welcome{Generation: rc.lease.Generation, RunnerID: rc.principal.RunnerID, Protocol: rc.lease.Protocol, Role: rc.lease.Role, Release: rastrillo.BuildVersion, Tainted: rc.lease.Tainted}) |
| if rc.send(ctx, welcome) != nil { |
| return |
| } |
diff --git a/internal/equipo/chat/tasks.go b/internal/equipo/chat/tasks.go| index 23e473b5..2d40a2e4 100644 |
| --- a/internal/equipo/chat/tasks.go |
| +++ b/internal/equipo/chat/tasks.go |
| @@ -1007,11 +1007,23 @@ func (t *txn) stepReport(l Lease, v *wire.StepReport) error { |
| s.Reason, s.Verdict, s.ReviewLabel, s.Checks, s.Gate, s.ExitCode = v.Reason, v.Verdict, v.ReviewLabel, v.Checks, v.Gate, v.ExitCode |
| if s.Specialist == wire.SpecialistChecks && role == wire.RoleWorker { |
| // A worker's word on how its checks were confined; |
| - // anything but seatbelt is outside the sandbox. |
| + // anything but seatbelt is outside the sandbox, and a |
| + // runner that once ran checks outside it never again |
| + // counts as sandboxed (the instance's record, which the |
| + // runner cannot clear). |
| + tainted, err := t.tainted(l.Runner.RunnerID) |
| + if err != nil { |
| + return err |
| + } |
| s.ChecksSandbox = wire.SandboxNone |
| - if v.ChecksSandbox == wire.SandboxSeatbelt { |
| + if v.ChecksSandbox == wire.SandboxSeatbelt && !tainted { |
| s.ChecksSandbox = wire.SandboxSeatbelt |
| } |
| + if s.ChecksSandbox == wire.SandboxNone { |
| + if err := t.markTainted(l.Runner.RunnerID); err != nil { |
| + return err |
| + } |
| + } |
| } |
| s.Output = clipText(v.Output, wire.MaxChecksOutput) |
| var pr projectRecord |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index 08bf331b..d5224056 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -1245,6 +1245,8 @@ var pageCopy = map[string]string{ |
| // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "runner.title": "Machines", |
| // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| + "runner.tainted": "A check has run outside the sandbox on this Mac, so its checks are always labelled that way from now on. To start clean, install the runner again as a new Mac user.", |
| + // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "runner.needs_primary": "This Mac can only run checks for your main runner. Add your main runner first, then open this Mac's link again.", |
| // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "runner.add_title": "Add %s to your team", |
diff --git a/internal/equipo/mac_view_test.go b/internal/equipo/mac_view_test.go| index 99fef20c..c2dcb627 100644 |
| --- a/internal/equipo/mac_view_test.go |
| +++ b/internal/equipo/mac_view_test.go |
| @@ -4,6 +4,7 @@ import ( |
| "bytes" |
| "strings" |
| "testing" |
| + "time" |
| "amadan.net/oficina/equipo/internal/equipo/setup" |
| "amadan.net/oficina/equipo/internal/wire" |
| @@ -40,14 +41,15 @@ func TestChecksOutsideTheSandboxAreLabelled(t *testing.T) { |
| // The Connections runner view shows what a Mac said of itself: its |
| // platform, where checks run, and each self-probe in words. |
| func TestRunnersViewShowsProbes(t *testing.T) { |
| - data := pageData{Runners: []Runner{{ID: "r1", Label: "Tito Studio", Report: &setup.RunnerReport{Platform: "darwin/arm64", Sandbox: wire.SandboxNone, |
| + tainted := time.Now() |
| + data := pageData{Runners: []Runner{{ID: "r1", Label: "Tito Studio", TaintedAt: &tainted, Report: &setup.RunnerReport{Platform: "darwin/arm64", Sandbox: wire.SandboxNone, |
| Probes: []setup.RunnerProbe{{ID: "P2", Verdict: wire.ProbeFailed, Detail: "allowed: test.keychain; xcodebuild ran in srt"}, {ID: "P7", Verdict: wire.ProbePassed, Detail: "srt 0.0.81"}}}}}} |
| var buf bytes.Buffer |
| if err := pages["runners"].ExecuteTemplate(&buf, "content", data); err != nil { |
| t.Fatal(err) |
| } |
| html := buf.String() |
| - for _, want := range []string{"darwin/arm64", "Outside the sandbox", "Self-checks", "Sandbox against a hostile build", "Failed", "allowed: test.keychain; xcodebuild ran in srt", "Sandbox tools", `data-probe="P2" data-verdict="failed"`} { |
| + for _, want := range []string{"A check has run outside the sandbox on this Mac", "darwin/arm64", "Outside the sandbox", "Self-checks", "Sandbox against a hostile build", "Failed", "allowed: test.keychain; xcodebuild ran in srt", "Sandbox tools", `data-probe="P2" data-verdict="failed"`} { |
| if !strings.Contains(html, want) { |
| t.Fatalf("%q missing:\n%s", want, html) |
| } |
diff --git a/internal/equipo/migrations/0055_thin_checks_sandbox.sql b/internal/equipo/migrations/0055_thin_checks_sandbox.sql| index d3a371a3..d3cd29e0 100644 |
| --- a/internal/equipo/migrations/0055_thin_checks_sandbox.sql |
| +++ b/internal/equipo/migrations/0055_thin_checks_sandbox.sql |
| @@ -1,2 +1,3 @@ |
| ALTER TABLE chat_steps ADD COLUMN checks_sandbox text; |
| ALTER TABLE runner_enrolments ADD COLUMN worker_only numeric; |
| +ALTER TABLE runners ADD COLUMN tainted_at datetime; |
diff --git a/internal/equipo/migrations/schema.sql b/internal/equipo/migrations/schema.sql| index db75f231..47baae33 100644 |
| --- a/internal/equipo/migrations/schema.sql |
| +++ b/internal/equipo/migrations/schema.sql |
| @@ -221,7 +221,8 @@ CREATE TABLE runners ( |
| revoked_at datetime, |
| instance_id text, |
| role text, |
| - removing_at datetime |
| + removing_at datetime, |
| + tainted_at datetime |
| ); |
| CREATE INDEX runner_person ON runners(person); |
| CREATE TABLE runner_enrolments ( |
diff --git a/internal/equipo/setup/runner_models.go b/internal/equipo/setup/runner_models.go| index 79b6750e..a687e615 100644 |
| --- a/internal/equipo/setup/runner_models.go |
| +++ b/internal/equipo/setup/runner_models.go |
| @@ -18,6 +18,9 @@ type Runner struct { |
| // Report is what the runner last said of itself: its platform, how |
| // it confines checks and a Mac's self-probes (nil until it has). |
| Report *RunnerReport `gorm:"-"` |
| + // TaintedAt: a check ran outside the sandbox on this runner (a Mac |
| + // worker). Never cleared: its checks are labelled that way for good. |
| + TaintedAt *time.Time |
| // RemovingAt: removal asked for while work it may have started was |
| // still running; it is revoked once that work's end is proven. |
| RemovingAt *time.Time |
diff --git a/internal/equipo/templates/runners.html b/internal/equipo/templates/runners.html| index f2062b07..cfad7dc6 100644 |
| --- a/internal/equipo/templates/runners.html |
| +++ b/internal/equipo/templates/runners.html |
| @@ -34,6 +34,7 @@ |
| <dt>{{copy "runner.fingerprint"}}</dt><dd>{{.MachineKeyHash}}</dd> |
| {{with .Report}}<dt>{{copy "runner.platform"}}</dt><dd>{{.Platform}}</dd>{{with .Sandbox}}<dt>{{copy "runner.checks_run"}}</dt><dd data-sandbox="{{.}}">{{copy (printf "runner.sandbox.%s" .)}}</dd>{{end}}{{end}} |
| </dl> |
| +{{if .TaintedAt}}<p data-tainted>{{copy "runner.tainted"}}</p>{{end}} |
| {{with .Report}}{{if .Probes}}<h4>{{copy "runner.probes"}}</h4> |
| <ul equipo-probes>{{range .Probes}}<li data-probe="{{.ID}}" data-verdict="{{.Verdict}}"><span>{{copy (printf "runner.probe.%s" .ID)}}</span> <span>{{copy (printf "runner.verdict.%s" .Verdict)}}</span>{{with .Detail}} <span equipo-quiet>{{.}}</span>{{end}}</li>{{end}}</ul>{{end}}{{end}} |
| {{if .TrialOwner}}<p>{{copy "trial.history"}}: {{.TrialOwner}} / {{.TrialAt}}</p><pre>{{.TrialVersions}}</pre>{{end}} |
diff --git a/internal/runner/mac/pins.go b/internal/runner/mac/pins.go| new file mode 100644 |
| index 00000000..108fc869 |
| --- /dev/null |
| +++ b/internal/runner/mac/pins.go |
| @@ -0,0 +1,114 @@ |
| +package mac |
| + |
| +import ( |
| + "crypto/sha256" |
| + "encoding/hex" |
| + "errors" |
| + "fmt" |
| + "io" |
| + "io/fs" |
| + "os" |
| + "path/filepath" |
| +) |
| + |
| +// What the sandbox runs on, pinned in this binary (Mac runners review |
| +// round 2): the Node and ripgrep programs as the pinned archives unpack |
| +// them, and the srt package tree `npm ci` makes from the shipped |
| +// lockfile. A gate that once ran outside the sandbox runs as this user |
| +// and could replace any of them; a probe or a sandboxed check trusts |
| +// them only while they match these, checked each time. |
| +const ( |
| + NodeBinarySHA256 = "2cc28a1880d0774616959f2210ee739bffa6ac695c887e8988a496a21271f6c0" |
| + RGBinarySHA256 = "a326a1fb48074202e9ad41e4cd1e389eeea372c8c6f7d7e80da81176d5d9430e" |
| + SRTTreeSHA256 = "6ef1352dcfa9c7c52a0545a2f40683ee9941e1ef93c01aa487f5deb19cc6b210" |
| +) |
| + |
| +// srtLink is the target npm gives node_modules/.bin/srt. |
| +const srtLink = "../@anthropic-ai/sandbox-runtime/dist/cli.js" |
| + |
| +// ErrUnpinned: a sandbox tool is not where the installer put it or does |
| +// not match its pin. |
| +var ErrUnpinned = errors.New("mac: sandbox tools do not match their pins") |
| + |
| +// PinnedTools are where the installer puts srt, Node and ripgrep under |
| +// installDir. |
| +func PinnedTools(installDir string) Tools { |
| + return Tools{ |
| + SRT: filepath.Join(installDir, "srt", "node_modules", ".bin", "srt"), |
| + Node: filepath.Join(installDir, "tools", Node.Root, filepath.FromSlash(Node.Binary)), |
| + RG: filepath.Join(installDir, "tools", Ripgrep.Root, filepath.FromSlash(Ripgrep.Binary)), |
| + } |
| +} |
| + |
| +// VerifyTools checks t against the pins: each at its installed place, |
| +// the srt link to its fixed target, every file of the srt package tree, |
| +// and the Node and ripgrep programs. |
| +func VerifyTools(installDir string, t Tools) error { |
| + want := PinnedTools(installDir) |
| + if t.SRT != want.SRT || t.Node != want.Node || t.RG != want.RG { |
| + return ErrUnpinned |
| + } |
| + if target, err := os.Readlink(t.SRT); err != nil || target != srtLink { |
| + return ErrUnpinned |
| + } |
| + for path, pin := range map[string]string{t.Node: NodeBinarySHA256, t.RG: RGBinarySHA256} { |
| + info, err := os.Lstat(path) |
| + if err != nil || !info.Mode().IsRegular() { |
| + return ErrUnpinned |
| + } |
| + if sum, err := fileSHA256(path); err != nil || sum != pin { |
| + return ErrUnpinned |
| + } |
| + } |
| + if sum, err := TreeSHA256(filepath.Join(installDir, "srt", "node_modules")); err != nil || sum != SRTTreeSHA256 { |
| + return ErrUnpinned |
| + } |
| + return nil |
| +} |
| + |
| +// TreeSHA256 names a node_modules tree by every regular file's path and |
| +// contents, in walk order, leaving out npm's own .bin links and |
| +// .package-lock.json. Any other link or special file is refused. |
| +func TreeSHA256(dir string) (string, error) { |
| + h := sha256.New() |
| + err := filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { |
| + if err != nil { |
| + return err |
| + } |
| + rel, _ := filepath.Rel(dir, path) |
| + switch { |
| + case rel == ".bin" && d.IsDir(), rel == ".package-lock.json": |
| + if d.IsDir() { |
| + return fs.SkipDir |
| + } |
| + return nil |
| + case d.IsDir(): |
| + return nil |
| + case !d.Type().IsRegular(): |
| + return ErrUnpinned |
| + } |
| + sum, err := fileSHA256(path) |
| + if err != nil { |
| + return err |
| + } |
| + fmt.Fprintf(h, "%s\x00%s\n", filepath.ToSlash(rel), sum) |
| + return nil |
| + }) |
| + if err != nil { |
| + return "", err |
| + } |
| + return hex.EncodeToString(h.Sum(nil)), nil |
| +} |
| + |
| +func fileSHA256(path string) (string, error) { |
| + f, err := os.Open(path) |
| + if err != nil { |
| + return "", err |
| + } |
| + defer f.Close() |
| + h := sha256.New() |
| + if _, err := io.Copy(h, f); err != nil { |
| + return "", err |
| + } |
| + return hex.EncodeToString(h.Sum(nil)), nil |
| +} |
diff --git a/internal/runner/mac/pins_test.go b/internal/runner/mac/pins_test.go| new file mode 100644 |
| index 00000000..7fa49ac6 |
| --- /dev/null |
| +++ b/internal/runner/mac/pins_test.go |
| @@ -0,0 +1,142 @@ |
| +package mac |
| + |
| +import ( |
| + "context" |
| + "errors" |
| + "os" |
| + "os/exec" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| +) |
| + |
| +// With a real `npm ci` of the shipped lockfile at hand |
| +// (EQUIPO_SRT_NODE_MODULES), the srt tree matches its pin. Skipped |
| +// otherwise: CI does not download packages. |
| +func TestSRTTreeRealInstall(t *testing.T) { |
| + dir := os.Getenv("EQUIPO_SRT_NODE_MODULES") |
| + if dir == "" { |
| + t.Skip("EQUIPO_SRT_NODE_MODULES not set") |
| + } |
| + sum, err := TreeSHA256(dir) |
| + if err != nil || sum != SRTTreeSHA256 { |
| + t.Fatalf("srt tree %s %v, pinned %s", sum, err, SRTTreeSHA256) |
| + } |
| +} |
| + |
| +// installedTools lays out an install dir as the installer leaves it, with |
| +// stand-in contents. |
| +func installedTools(t *testing.T) (string, Tools) { |
| + t.Helper() |
| + dir := t.TempDir() |
| + tools := PinnedTools(dir) |
| + pkg := filepath.Join(dir, "srt", "node_modules", "@anthropic-ai", "sandbox-runtime", "dist") |
| + for _, p := range []string{tools.Node, tools.RG, filepath.Join(pkg, "cli.js")} { |
| + if err := os.MkdirAll(filepath.Dir(p), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.WriteFile(p, []byte("stand-in"), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + if err := os.MkdirAll(filepath.Dir(tools.SRT), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.Symlink(srtLink, tools.SRT); err != nil { |
| + t.Fatal(err) |
| + } |
| + return dir, tools |
| +} |
| + |
| +// Tools that are not exactly the pinned ones are never verified: stand-in |
| +// contents, another place, srt's link pointing elsewhere, a link inside |
| +// the package tree. |
| +func TestVerifyToolsRefuses(t *testing.T) { |
| + dir, tools := installedTools(t) |
| + if !errors.Is(VerifyTools(dir, tools), ErrUnpinned) { |
| + t.Fatal("stand-in tools verified") |
| + } |
| + other := tools |
| + other.RG = "/opt/homebrew/bin/rg" |
| + if !errors.Is(VerifyTools(dir, other), ErrUnpinned) { |
| + t.Fatal("ripgrep elsewhere verified") |
| + } |
| + if err := os.Remove(tools.SRT); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.Symlink("/tmp/fake-srt", tools.SRT); err != nil { |
| + t.Fatal(err) |
| + } |
| + if !errors.Is(VerifyTools(dir, tools), ErrUnpinned) { |
| + t.Fatal("srt link elsewhere verified") |
| + } |
| + if err := os.Symlink("/etc", filepath.Join(dir, "srt", "node_modules", "zod")); err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := TreeSHA256(filepath.Join(dir, "srt", "node_modules")); !errors.Is(err, ErrUnpinned) { |
| + t.Fatalf("a link in the package tree: %v", err) |
| + } |
| +} |
| + |
| +// With the real archives and a real `npm ci` at hand, the installed |
| +// tools verify; a counterfeit srt (one byte of cli.js changed), Node or |
| +// ripgrep does not. |
| +func TestVerifyToolsReal(t *testing.T) { |
| + archives, modules := os.Getenv("EQUIPO_TOOL_ARCHIVES"), os.Getenv("EQUIPO_SRT_NODE_MODULES") |
| + if archives == "" || modules == "" { |
| + t.Skip("EQUIPO_TOOL_ARCHIVES and EQUIPO_SRT_NODE_MODULES not set") |
| + } |
| + dir := t.TempDir() |
| + for _, tool := range SRTTools { |
| + if _, err := Fetch(context.Background(), tool, filepath.Join(dir, "tools"), func(_ context.Context, url string, _ int64) ([]byte, error) { |
| + return os.ReadFile(filepath.Join(archives, url[strings.LastIndex(url, "/")+1:])) |
| + }); err != nil { |
| + t.Fatal(err) |
| + } |
| + } |
| + if err := os.MkdirAll(filepath.Join(dir, "srt"), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + if out, err := exec.Command("cp", "-a", modules, filepath.Join(dir, "srt", "node_modules")).CombinedOutput(); err != nil { |
| + t.Fatalf("%v %s", err, out) |
| + } |
| + tools := PinnedTools(dir) |
| + if err := VerifyTools(dir, tools); err != nil { |
| + t.Fatal(err) |
| + } |
| + // The same ripgrep somewhere else, srt's link to the same file by |
| + // another path: not the installed tools. |
| + elsewhere := filepath.Join(t.TempDir(), "rg") |
| + if out, err := exec.Command("cp", tools.RG, elsewhere).CombinedOutput(); err != nil { |
| + t.Fatalf("%v %s", err, out) |
| + } |
| + moved := tools |
| + moved.RG = elsewhere |
| + if !errors.Is(VerifyTools(dir, moved), ErrUnpinned) { |
| + t.Fatal("ripgrep elsewhere verified") |
| + } |
| + cli := filepath.Join(dir, "srt", "node_modules", "@anthropic-ai", "sandbox-runtime", "dist", "cli.js") |
| + if err := os.Remove(tools.SRT); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.Symlink(cli, tools.SRT); err != nil { |
| + t.Fatal(err) |
| + } |
| + if !errors.Is(VerifyTools(dir, tools), ErrUnpinned) { |
| + t.Fatal("srt linked another way verified") |
| + } |
| + if err := os.Remove(tools.SRT); err != nil { |
| + t.Fatal(err) |
| + } |
| + if err := os.Symlink(srtLink, tools.SRT); err != nil { |
| + t.Fatal(err) |
| + } |
| + raw, _ := os.ReadFile(cli) |
| + raw[len(raw)/2] ^= 1 |
| + if err := os.WriteFile(cli, raw, 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + if !errors.Is(VerifyTools(dir, tools), ErrUnpinned) { |
| + t.Fatal("a counterfeit srt verified") |
| + } |
| +} |
diff --git a/internal/runner/thin/mac.go b/internal/runner/thin/mac.go| index 535ec663..091f74f8 100644 |
| --- a/internal/runner/thin/mac.go |
| +++ b/internal/runner/thin/mac.go |
| @@ -7,7 +7,6 @@ import ( |
| "encoding/json" |
| "errors" |
| "io" |
| - "io/fs" |
| "net" |
| "net/http" |
| "os" |
| @@ -15,6 +14,7 @@ import ( |
| "path/filepath" |
| "strings" |
| "sync" |
| + "sync/atomic" |
| "time" |
| "amadan.net/oficina/equipo/internal/release" |
| @@ -44,9 +44,12 @@ func (m macGate) Verify(id string) bool { return m.g.Verify(id) } |
| // process made and still trusts (macProbes.trusted): srt and seatbelt |
| // when P2 denied; srt still, labelled none, when the fixture at least |
| // built under srt (the boundary is unproven, not absent); otherwise no |
| -// sandbox, labelled none. |
| +// sandbox, labelled none. Once any check has run labelled none the |
| +// runner is tainted for good (macTaint): it never labels a check |
| +// sandboxed again. |
| type macChecks struct { |
| probes *macProbes |
| + taint *macTaint |
| srt string |
| sandboxed, unproven, bare *mac.Gate |
| } |
| @@ -56,9 +59,9 @@ func (m *macChecks) pick() *mac.Gate { |
| switch { |
| case !ok || m.srt == "": |
| return m.bare |
| - case r.Sandboxed(): |
| + case r.Sandboxed() && !m.taint.Tainted(): |
| return m.sandboxed |
| - case r.SRTRanXcode: |
| + case r.Sandboxed() || r.SRTRanXcode: |
| return m.unproven |
| } |
| return m.bare |
| @@ -66,13 +69,50 @@ func (m *macChecks) pick() *mac.Gate { |
| func (m *macChecks) Sandbox() string { return m.pick().Sandbox } |
| +// Run taints the runner before a check runs outside the sandbox: what |
| +// it runs could change anything this user may. |
| func (m *macChecks) Run(ctx context.Context, attempt, dir string, argv []string, limit time.Duration, record func(string) error) gateResult { |
| - return macGate{m.pick()}.Run(ctx, attempt, dir, argv, limit, record) |
| + g := m.pick() |
| + if g.Sandbox != wire.SandboxSeatbelt { |
| + m.taint.Set() |
| + } |
| + return macGate{g}.Run(ctx, attempt, dir, argv, limit, record) |
| } |
| // Verify settles a recorded attempt the same way whatever confined it. |
| func (m *macChecks) Verify(id string) bool { return m.bare.Verify(id) } |
| +// macTaint is sticky: set once a check ran outside the sandbox, kept in |
| +// the state dir and by the instance (which says so in every welcome), so |
| +// deleting the file does not clear it. Only installing again as a new |
| +// Mac user starts clean. |
| +type macTaint struct { |
| + file string |
| + on atomic.Bool |
| + changed func() |
| +} |
| + |
| +func loadTaint(file string) *macTaint { |
| + t := &macTaint{file: file} |
| + if _, err := os.Lstat(file); err == nil { |
| + t.on.Store(true) |
| + } |
| + return t |
| +} |
| + |
| +func (t *macTaint) Tainted() bool { return t.on.Load() } |
| + |
| +// Set taints the runner (again is harmless). |
| +func (t *macTaint) Set() { |
| + if t.on.Swap(true) { |
| + return |
| + } |
| + _ = os.WriteFile(t.file, []byte(time.Now().UTC().Format(time.RFC3339)+"\n"), 0600) |
| + if t.changed != nil { |
| + t.changed() |
| + } |
| +} |
| + |
| // probeTrust is how long a probe report is trusted. |
| const probeTrust = 24 * time.Hour |
| @@ -81,16 +121,17 @@ const probeTrust = 24 * time.Hour |
| // outside the sandbox runs as this user and could write any file this |
| // process could. A report is trusted while it is this runner version's, |
| // for this checks profile, made with the srt, Node and ripgrep that are |
| -// on disk now (fingerprint), and less than a day old; otherwise checks |
| +// on disk now matching the pins compiled into this binary (verified), |
| +// and less than a day old; otherwise checks |
| // run as not verified and the probes run again. `equipo-runner probe` |
| // only asks for that (request): a forged request costs a probe run and |
| // never upgrades trust. |
| type macProbes struct { |
| - version string |
| - run func(context.Context) mac.Report |
| - fingerprint func() string |
| - request string |
| - now func() time.Time |
| + version string |
| + run func(context.Context) mac.Report |
| + verified func() bool |
| + request string |
| + now func() time.Time |
| mu sync.Mutex |
| last mac.Report |
| @@ -98,8 +139,8 @@ type macProbes struct { |
| again chan struct{} |
| } |
| -func newMacProbes(version, request string, run func(context.Context) mac.Report, fingerprint func() string) *macProbes { |
| - return &macProbes{version: version, request: request, run: run, fingerprint: fingerprint, now: time.Now, ready: make(chan struct{}), again: make(chan struct{}, 1)} |
| +func newMacProbes(version, request string, run func(context.Context) mac.Report, verified func() bool) *macProbes { |
| + return &macProbes{version: version, request: request, run: run, verified: verified, now: time.Now, ready: make(chan struct{}), again: make(chan struct{}, 1)} |
| } |
| // report is the newest report, for the instance to show. |
| @@ -112,7 +153,7 @@ func (p *macProbes) report() mac.Report { |
| // trusted is the newest report and whether it may decide a gate now. |
| func (p *macProbes) trusted() (mac.Report, bool) { |
| r := p.report() |
| - ok := r.Version == p.version && r.Profile == mac.ProfileDigest() && r.SRT != "" && r.SRT == p.fingerprint() && !r.At.IsZero() && p.now().Sub(r.At) < probeTrust && p.now().Sub(r.At) >= -time.Minute |
| + ok := r.Version == p.version && r.Profile == mac.ProfileDigest() && r.SRT == srtPinned && p.verified() && !r.At.IsZero() && p.now().Sub(r.At) < probeTrust && p.now().Sub(r.At) >= -time.Minute |
| if !ok && !r.At.IsZero() { |
| p.probeSoon() |
| } |
| @@ -133,12 +174,17 @@ func (p *macProbes) start(ctx context.Context, refresh func()) { |
| go func() { |
| first := true |
| for { |
| - srt := p.fingerprint() |
| + // The tools must match their pins before the probes and still |
| + // after them: a report made with anything else is never |
| + // trusted. |
| + before := p.verified() |
| r := p.run(ctx) |
| if ctx.Err() != nil { |
| return |
| } |
| - r.SRT = srt |
| + if before && p.verified() { |
| + r.SRT = srtPinned |
| + } |
| p.mu.Lock() |
| p.last = r |
| p.mu.Unlock() |
| @@ -186,46 +232,9 @@ func (p *macProbes) wait(ctx context.Context) error { |
| } |
| } |
| -// srtFingerprint names the sandbox's own files as they are on disk: the |
| -// srt package, Node and ripgrep. A gate that ran outside the sandbox |
| -// could have changed them; a report made with others is not trusted. |
| -func srtFingerprint(t mac.Tools) string { |
| - if t.SRT == "" { |
| - return "" |
| - } |
| - cli, err := filepath.EvalSymlinks(t.SRT) |
| - if err != nil { |
| - return "" |
| - } |
| - h := sha256.New() |
| - pkg := filepath.Dir(filepath.Dir(cli)) |
| - err = filepath.WalkDir(pkg, func(path string, d fs.DirEntry, err error) error { |
| - if err != nil || d.IsDir() { |
| - return err |
| - } |
| - return hashFile(h, path) |
| - }) |
| - for _, f := range []string{t.Node, t.RG} { |
| - if err == nil { |
| - err = hashFile(h, f) |
| - } |
| - } |
| - if err != nil { |
| - return "" |
| - } |
| - return hex.EncodeToString(h.Sum(nil)) |
| -} |
| - |
| -func hashFile(h io.Writer, path string) error { |
| - f, err := os.Open(path) |
| - if err != nil { |
| - return err |
| - } |
| - defer f.Close() |
| - _, _ = io.WriteString(h, path+"\x00") |
| - _, err = io.Copy(h, f) |
| - return err |
| -} |
| +// srtPinned marks a report made with srt, Node and ripgrep matching the |
| +// pins compiled into this binary. |
| +const srtPinned = "pinned" |
| // macUsers is where a Mac keeps its people's homes. |
| var macUsers = "/Users" |
| @@ -240,6 +249,7 @@ type macHost struct { |
| env []string |
| probes *macProbes |
| checks *macChecks |
| + taint *macTaint |
| caps func(context.Context) wire.Capabilities |
| } |
| @@ -247,10 +257,15 @@ type macHost struct { |
| // private srt first, then the usual places. |
| func macTools(installDir, home string, getenv func(string) string) mac.Tools { |
| dirs := []string{filepath.Join(installDir, "srt", "node_modules", ".bin"), filepath.Join(home, ".local", "bin"), "/opt/homebrew/bin", "/usr/local/bin", "/usr/bin"} |
| + pinned := mac.PinnedTools(installDir) |
| + at := map[string]string{"srt": pinned.SRT, "node": pinned.Node, "rg": pinned.RG} |
| find := func(env, name string) string { |
| if p := getenv(env); filepath.IsAbs(p) && executable(p) { |
| return p |
| } |
| + if p := at[name]; p != "" && executable(p) { |
| + return p |
| + } |
| for _, d := range dirs { |
| if p := filepath.Join(d, name); executable(p) { |
| return p |
| @@ -363,13 +378,15 @@ func newMacHost(c runner.Config, o Options) (*macHost, error) { |
| } |
| h.probes = newMacProbes(o.Version, ProbeRequest(c), func(ctx context.Context) mac.Report { |
| return mac.RunProbes(ctx, h.probeHost(o.Version, gate)) |
| - }, func() string { return srtFingerprint(h.tools) }) |
| - h.checks = &macChecks{probes: h.probes, srt: h.tools.SRT, sandboxed: gate(h.tools.SRT, wire.SandboxSeatbelt), unproven: gate(h.tools.SRT, wire.SandboxNone), bare: gate("", wire.SandboxNone)} |
| + }, func() bool { return mac.VerifyTools(h.paths.InstallDir, h.tools) == nil }) |
| + h.taint = loadTaint(filepath.Join(c.StateDir, "tainted")) |
| + h.checks = &macChecks{probes: h.probes, taint: h.taint, srt: h.tools.SRT, sandboxed: gate(h.tools.SRT, wire.SandboxSeatbelt), unproven: gate(h.tools.SRT, wire.SandboxNone), bare: gate("", wire.SandboxNone)} |
| h.caps = func(ctx context.Context) wire.Capabilities { |
| caps := mac.Capabilities(ctx, h.run, h.tools) |
| if probes := h.probes.report().Probes; len(probes) > 0 { |
| caps.Probes = probes |
| } |
| + caps.Tainted = h.taint.Tainted() |
| return caps |
| } |
| return h, nil |
| @@ -422,10 +439,14 @@ func runMac(ctx context.Context, c runner.Config, o Options) error { |
| up := &macUpdater{origin: c.Origin, version: o.Version, binary: c.Executable, fetch: fetchLimited} |
| return runWorker(ctx, c, o, hostPlatform(), workerSetup{probe: h.caps, gate: h.checks, find: h.find, ready: h.probes.wait, |
| started: func(ctx context.Context, refresh func()) { |
| + h.taint.changed = refresh |
| h.probes.start(ctx, refresh) |
| go h.probes.watch(ctx) |
| }, |
| welcomed: func(w wire.Welcome, worker *Worker, stop context.CancelCauseFunc) { |
| + if w.Tainted { |
| + h.taint.Set() |
| + } |
| up.offer(w, func() func() { worker.mu.Lock(); return worker.mu.Unlock }, func() { stop(ErrUpdated) }, o.Logger) |
| }}) |
| } |
diff --git a/internal/runner/thin/mac_test.go b/internal/runner/thin/mac_test.go| index 4ba06719..c3214a83 100644 |
| --- a/internal/runner/thin/mac_test.go |
| +++ b/internal/runner/thin/mac_test.go |
| @@ -51,16 +51,16 @@ type probeRig struct { |
| p *macProbes |
| runs atomic.Int32 |
| verdict string |
| - srt string |
| + pinned bool |
| now time.Time |
| } |
| func newProbeRig(t *testing.T) *probeRig { |
| - x := &probeRig{verdict: wire.ProbeDenied, srt: "fp1", now: time.Now()} |
| + x := &probeRig{verdict: wire.ProbeDenied, pinned: true, now: time.Now()} |
| x.p = newMacProbes("v1", filepath.Join(t.TempDir(), "probe-request"), func(context.Context) mac.Report { |
| x.runs.Add(1) |
| return mac.Report{Version: "v1", Profile: mac.ProfileDigest(), At: x.now, Probes: probesAll(x.verdict), SRTRanXcode: true} |
| - }, func() string { return x.srt }) |
| + }, func() bool { return x.pinned }) |
| x.p.now = func() time.Time { return x.now } |
| return x |
| } |
| @@ -81,7 +81,7 @@ func (x *probeRig) started(t *testing.T) { |
| // none. No srt, no sandbox, whatever the report says. |
| func TestMacChecksPick(t *testing.T) { |
| x := newProbeRig(t) |
| - m := &macChecks{probes: x.p, srt: "/x/srt", sandboxed: &mac.Gate{Sandbox: wire.SandboxSeatbelt}, unproven: &mac.Gate{SRT: "/x/srt", Sandbox: wire.SandboxNone}, bare: &mac.Gate{Sandbox: wire.SandboxNone}} |
| + m := &macChecks{probes: x.p, taint: loadTaint(filepath.Join(t.TempDir(), "tainted")), srt: "/x/srt", sandboxed: &mac.Gate{Sandbox: wire.SandboxSeatbelt}, unproven: &mac.Gate{SRT: "/x/srt", Sandbox: wire.SandboxNone}, bare: &mac.Gate{Sandbox: wire.SandboxNone}} |
| if m.pick() != m.bare { |
| t.Fatal("no report: not bare") |
| } |
| @@ -110,7 +110,7 @@ func TestMacChecksPick(t *testing.T) { |
| func TestMacProbesTrust(t *testing.T) { |
| x := newProbeRig(t) |
| state := filepath.Dir(x.p.request) |
| - forged, _ := json.Marshal(mac.Report{Version: "v1", Profile: mac.ProfileDigest(), At: time.Now(), Probes: probesAll(wire.ProbeDenied), SRT: "fp1"}) |
| + forged, _ := json.Marshal(mac.Report{Version: "v1", Profile: mac.ProfileDigest(), At: time.Now(), Probes: probesAll(wire.ProbeDenied), SRT: srtPinned}) |
| for _, name := range []string{"probes.json", "probe-request"} { |
| if err := os.WriteFile(filepath.Join(state, name), forged, 0600); err != nil { |
| t.Fatal(err) |
| @@ -123,11 +123,11 @@ func TestMacProbesTrust(t *testing.T) { |
| if r, ok := x.p.trusted(); !ok || !r.Sandboxed() { |
| t.Fatal("its own fresh report not trusted") |
| } |
| - x.srt = "fp2" |
| + x.pinned = false |
| if _, ok := x.p.trusted(); ok { |
| - t.Fatal("trusted after srt, Node or ripgrep changed on disk") |
| + t.Fatal("trusted after srt, Node or ripgrep stopped matching their pins") |
| } |
| - x.srt = "fp1" |
| + x.pinned = true |
| x.now = x.now.Add(probeTrust + time.Minute) |
| if _, ok := x.p.trusted(); ok { |
| t.Fatal("trusted a day later") |
| @@ -342,44 +342,74 @@ func (g *recordingGate) Run(ctx context.Context, a, dir string, argv []string, l |
| return g.stubGate.Run(ctx, a, dir, argv, l, record) |
| } |
| -// The fingerprint covers the srt package, Node and ripgrep as they are |
| -// on disk: changing any of them changes it; a missing one leaves none. |
| -func TestSRTFingerprint(t *testing.T) { |
| - root := t.TempDir() |
| - files := map[string]string{"srt/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.js": "cli", "srt/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos.js": "profile", "node": "node", "rg": "rg"} |
| - for p, body := range files { |
| - if err := os.MkdirAll(filepath.Dir(filepath.Join(root, p)), 0700); err != nil { |
| - t.Fatal(err) |
| - } |
| - if err := os.WriteFile(filepath.Join(root, p), []byte(body), 0700); err != nil { |
| - t.Fatal(err) |
| - } |
| +// A counterfeit srt (or Node, or ripgrep) is caught by the pins |
| +// compiled into the runner, before every probe run and every sandboxed |
| +// check: asking for a new probe after replacing it makes a report that |
| +// is never trusted, so checks run outside the sandbox and say so. |
| +func TestMacCounterfeitSRT(t *testing.T) { |
| + x := newProbeRig(t) |
| + x.pinned = false |
| + x.started(t) |
| + if _, ok := x.p.trusted(); ok { |
| + t.Fatal("a report made with counterfeit tools trusted") |
| } |
| - bin := filepath.Join(root, "srt/node_modules/.bin") |
| - if err := os.MkdirAll(bin, 0700); err != nil { |
| - t.Fatal(err) |
| + m := &macChecks{probes: x.p, taint: loadTaint(filepath.Join(t.TempDir(), "tainted")), srt: "/x/srt", sandboxed: &mac.Gate{Sandbox: wire.SandboxSeatbelt}, unproven: &mac.Gate{SRT: "/x/srt", Sandbox: wire.SandboxNone}, bare: &mac.Gate{Sandbox: wire.SandboxNone}} |
| + if m.pick() != m.bare { |
| + t.Fatal("counterfeit srt used") |
| + } |
| + // The tools match again and a probe is asked for: trusted again only |
| + // because nothing ran outside the sandbox meanwhile (see the taint). |
| + x.pinned = true |
| + x.p.probeSoon() |
| + deadline := time.Now().Add(5 * time.Second) |
| + for x.runs.Load() < 2 && time.Now().Before(deadline) { |
| + time.Sleep(20 * time.Millisecond) |
| } |
| - if err := os.Symlink("../@anthropic-ai/sandbox-runtime/dist/cli.js", filepath.Join(bin, "srt")); err != nil { |
| + time.Sleep(50 * time.Millisecond) |
| + if m.pick() != m.sandboxed { |
| + t.Fatal("a clean probe after the tools were restored") |
| + } |
| +} |
| + |
| +// The taint is sticky: once a check ran outside the sandbox, no probe |
| +// (asked for again, all denied) labels a check sandboxed; the file |
| +// keeps it across restarts, and the instance's word (welcome) puts it |
| +// back if the file is deleted. |
| +func TestMacTaintIsSticky(t *testing.T) { |
| + x := newProbeRig(t) |
| + file := filepath.Join(t.TempDir(), "tainted") |
| + m := &macChecks{probes: x.p, taint: loadTaint(file), srt: "/x/srt", sandboxed: &mac.Gate{Sandbox: wire.SandboxSeatbelt}, unproven: &mac.Gate{SRT: "/x/srt", Sandbox: wire.SandboxNone}, bare: &mac.Gate{Sandbox: wire.SandboxNone, Env: []string{"PATH=/usr/bin:/bin"}}} |
| + tree := filepath.Join(t.TempDir(), "tree") |
| + if err := os.MkdirAll(tree, 0700); err != nil { |
| t.Fatal(err) |
| } |
| - tools := mac.Tools{SRT: filepath.Join(bin, "srt"), Node: filepath.Join(root, "node"), RG: filepath.Join(root, "rg")} |
| - first := srtFingerprint(tools) |
| - if first == "" || srtFingerprint(tools) != first { |
| - t.Fatal("no stable fingerprint") |
| + // No report yet: the check runs outside the sandbox, which taints. |
| + if res := m.Run(context.Background(), "checks-t-1", tree, []string{"/bin/true"}, time.Minute, func(string) error { return nil }); res.sandbox != wire.SandboxNone || !m.taint.Tainted() { |
| + t.Fatalf("%+v tainted=%v", res, m.taint.Tainted()) |
| } |
| - for _, p := range []string{"srt/node_modules/@anthropic-ai/sandbox-runtime/dist/sandbox/macos.js", "node", "rg"} { |
| - if err := os.WriteFile(filepath.Join(root, p), []byte("changed"), 0700); err != nil { |
| - t.Fatal(err) |
| - } |
| - if srtFingerprint(tools) == first { |
| - t.Fatalf("%s changed, fingerprint did not", p) |
| - } |
| - if err := os.WriteFile(filepath.Join(root, p), []byte(files[p]), 0700); err != nil { |
| - t.Fatal(err) |
| - } |
| + if _, err := os.Stat(file); err != nil { |
| + t.Fatal("taint not kept on disk") |
| + } |
| + x.started(t) |
| + x.p.probeSoon() |
| + if r, ok := x.p.trusted(); !ok || !r.Sandboxed() { |
| + t.Fatal("rig: a fresh denied report") |
| + } |
| + if m.pick() == m.sandboxed || m.Sandbox() != wire.SandboxNone { |
| + t.Fatal("sandboxed again after a check ran outside it") |
| + } |
| + if !loadTaint(file).Tainted() { |
| + t.Fatal("taint lost on restart") |
| + } |
| + if err := os.Remove(file); err != nil { |
| + t.Fatal(err) |
| + } |
| + again := loadTaint(file) |
| + if again.Tainted() { |
| + t.Fatal("rig") |
| } |
| - tools.RG = filepath.Join(root, "missing") |
| - if srtFingerprint(tools) != "" { |
| - t.Fatal("fingerprint without ripgrep") |
| + again.Set() // the instance's welcome says tainted |
| + if !again.Tainted() { |
| + t.Fatal("the instance's taint not taken") |
| } |
| } |
diff --git a/internal/thintest/placement_contract_test.go b/internal/thintest/placement_contract_test.go| index 60521f8f..d14378b6 100644 |
| --- a/internal/thintest/placement_contract_test.go |
| +++ b/internal/thintest/placement_contract_test.go |
| @@ -513,3 +513,69 @@ func withLabel(h wire.Hello, label string) wire.Hello { |
| h.Label = label |
| return h |
| } |
| + |
| +// macChecks runs one task's checks on the worker to a passed report |
| +// labelled sandbox, and returns the task. |
| +func (r *runnersRig) macChecks(w *peer, title, sandbox string) wire.Task { |
| + r.t.Helper() |
| + task, sha := r.candidate(title, true) |
| + _, body := w.expect(wire.FrameDispatch) |
| + d := body.(*wire.DispatchCommand) |
| + r.relay(w, []byte("PACK "+title)) |
| + if !w.lease(d.StepID, 1) { |
| + r.t.Fatal("start refused") |
| + } |
| + pass := passed(task, d.StepID, 1, sha) |
| + pass.ChecksSandbox = sandbox |
| + w.send(wire.FrameStep, pass) |
| + r.expect(wire.FrameDispatch) // review on the primary |
| + k, err := r.client.Task(r.ctx, task) |
| + if err != nil { |
| + r.t.Fatal(err) |
| + } |
| + return k |
| +} |
| + |
| +// The taint is the instance's to keep: once a worker reports checks run |
| +// outside the sandbox, every later check of that runner is labelled so, |
| +// whatever it says; its welcome says it is tainted (so a runner whose |
| +// file was deleted takes it back); a hello saying tainted is enough too. |
| +func TestContractWorkerTaintIsSticky(t *testing.T) { |
| + r := newRunnersRig(t) |
| + w, token := r.newWorker("Tito Studio") |
| + if k := r.macChecks(w, "first", wire.SandboxSeatbelt); k.ChecksSandbox != wire.SandboxSeatbelt { |
| + t.Fatalf("a clean runner's sandboxed checks: %q", k.ChecksSandbox) |
| + } |
| + if w.fr.Welcome.Tainted { |
| + t.Fatal("a clean runner welcomed as tainted") |
| + } |
| + if k := r.macChecks(w, "second", wire.SandboxNone); k.ChecksSandbox != wire.SandboxNone { |
| + t.Fatalf("outside the sandbox: %q", k.ChecksSandbox) |
| + } |
| + if k := r.macChecks(w, "third", wire.SandboxSeatbelt); k.ChecksSandbox != wire.SandboxNone { |
| + t.Fatalf("a tainted runner's checks labelled %q", k.ChecksSandbox) |
| + } |
| + again := r.dialWorker(token, "Tito Studio", w.fr.Welcome.Generation) |
| + if !again.fr.Welcome.Tainted { |
| + t.Fatal("the welcome does not say tainted") |
| + } |
| + // A second Mac that says it is tainted is, from then on. |
| + other, _ := r.newWorker("Mac mini") |
| + h := WorkerHello(other.fr.Welcome.Generation) |
| + h.Label, h.Capabilities.Tainted = "Mac mini", true |
| + other.send(wire.FrameHello, h) |
| + deadline := time.Now().Add(5 * time.Second) |
| + for { |
| + var n int |
| + if err := r.inst.DB.Writer().QueryRow("SELECT count(*) FROM runners WHERE id = ? AND tainted_at IS NOT NULL", other.fr.Welcome.RunnerID).Scan(&n); err != nil { |
| + t.Fatal(err) |
| + } |
| + if n == 1 { |
| + break |
| + } |
| + if time.Now().After(deadline) { |
| + t.Fatal("a tainted hello not recorded") |
| + } |
| + time.Sleep(50 * time.Millisecond) |
| + } |
| +} |
diff --git a/internal/wire/frames.go b/internal/wire/frames.go| index c3588c62..3d43fbc1 100644 |
| --- a/internal/wire/frames.go |
| +++ b/internal/wire/frames.go |
| @@ -196,6 +196,9 @@ type Welcome struct { |
| Protocol int `json:"protocol,omitempty"` |
| Role string `json:"role,omitempty"` |
| Release string `json:"release,omitempty"` |
| + // Tainted: the instance holds that a check ran outside the sandbox on |
| + // this runner; it stays so whatever the runner's own files say. |
| + Tainted bool `json:"tainted,omitempty"` |
| } |
| // TailMessage is prior conversation, for a fresh coordinator session only. |
diff --git a/internal/wire/runners.go b/internal/wire/runners.go| index b297079c..cc4a5f46 100644 |
| --- a/internal/wire/runners.go |
| +++ b/internal/wire/runners.go |
| @@ -79,6 +79,9 @@ type Capabilities struct { |
| // Probes are a Mac worker's self-probes (P1 to P7), run after |
| // enrolment and on demand; absent on Linux. |
| Probes []Probe `json:"probes,omitempty"` |
| + // Tainted: a check has run outside the sandbox on this runner, so it |
| + // never labels one sandboxed again (a Mac worker; sticky). |
| + Tainted bool `json:"tainted,omitempty"` |
| } |
| // Probe is one self-probe's result: its ID (P1 to P7), a verdict and a |
| @@ -171,6 +174,7 @@ func checkStrings(v reflect.Value) error { |
| if len(s) > MaxCapabilityString || strings.ContainsAny(s, "/\\~\n\r\t\x00=") { |
| return ErrCapabilities |
| } |
| + case reflect.Bool: |
| case reflect.Struct: |
| for i := range v.NumField() { |
| if err := checkStrings(v.Field(i)); err != nil { |
| @@ -374,7 +378,7 @@ func downgrade(body any) bool { |
| v.Catalog[i].NeedsMacOS, v.Catalog[i].Simulator = false, false |
| } |
| case *Welcome: |
| - v.Protocol, v.Role, v.Release = 0, "", "" |
| + v.Protocol, v.Role, v.Release, v.Tainted = 0, "", "", false |
| case *DispatchCommand: |
| v.Needs, v.RunnerID = nil, "" |
| case *LeaseCheck: |
diff --git a/internal/wire/runners_test.go b/internal/wire/runners_test.go| index b4b97af2..d95cd782 100644 |
| --- a/internal/wire/runners_test.go |
| +++ b/internal/wire/runners_test.go |
| @@ -23,6 +23,7 @@ func TestEncodeProtocol1IsTheSlice4Wire(t *testing.T) { |
| "frames/step-process-group.json": "frames/step.json", |
| "frames/hello-mac-probes.json": "frames/hello.json", |
| "frames/step-mac-checks.json": "frames/step.json", |
| + "frames/welcome-tainted.json": "frames/welcome.json", |
| } { |
| f, _, err := wire.ParseFrame(wiretest.Fixture(v2)) |
| if err != nil { |
diff --git a/internal/wire/wiretest/testdata/frames/welcome-tainted.json b/internal/wire/wiretest/testdata/frames/welcome-tainted.json| new file mode 100644 |
| index 00000000..d3934c40 |
| --- /dev/null |
| +++ b/internal/wire/wiretest/testdata/frames/welcome-tainted.json |
| @@ -0,0 +1 @@ |
| +{"id":"w-welcome-tainted","type":"welcome","data":{"generation":4,"runner_id":"RUNNER2","protocol":2,"role":"worker","release":"98ce7a0","tainted":true}} |
| \ No newline at end of file |
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json| index f1457444..bd78ddba 100644 |
| --- a/scripts/runner-reference-allowlist.json |
| +++ b/scripts/runner-reference-allowlist.json |
| @@ -11843,20 +11843,6 @@ |
| "count": 1, |
| "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| }, |
| - { |
| - "path": "cmd/equipo-runner/install_mac.go", |
| - "line_sha256": "fd4a4bc468d9d6c6e5af3f1b2912a7c89a0ed732c24e0ff8bf761a7683360e64", |
| - "match": "Node", |
| - "count": 1, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| - { |
| - "path": "cmd/equipo-runner/install_mac.go", |
| - "line_sha256": "fd4a4bc468d9d6c6e5af3f1b2912a7c89a0ed732c24e0ff8bf761a7683360e64", |
| - "match": "npm", |
| - "count": 2, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| { |
| "path": "cmd/equipo-runner/install_mac_test.go", |
| "line_sha256": "15326d858a67aad95ec162c46388ab88c6a2105533e29abc2b5056e15b9414bb", |
| @@ -12130,13 +12116,6 @@ |
| "count": 1, |
| "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| }, |
| - { |
| - "path": "internal/runner/thin/mac.go", |
| - "line_sha256": "6e1f2ad42eddcc392ac08a4d4499da49bae235953761346c80b9f829a071a41d", |
| - "match": "Node", |
| - "count": 1, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| { |
| "path": "internal/runner/thin/mac.go", |
| "line_sha256": "c8b123cba7327ac08d7169929e5d843fbb08990a308102d00bbc78dd29da4c84", |
| @@ -12151,34 +12130,6 @@ |
| "count": 1, |
| "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| }, |
| - { |
| - "path": "internal/runner/thin/mac.go", |
| - "line_sha256": "dd635b2ac1346ce9a328771df08cf2c8b46c7dc4e2f5feed5b72bcbac39953dc", |
| - "match": "Node", |
| - "count": 1, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| - { |
| - "path": "internal/runner/thin/mac_test.go", |
| - "line_sha256": "14f701ffe4ec3b557605d18f8f51f9d2a219f13b540269c6f6692640074c458c", |
| - "match": "node", |
| - "count": 2, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| - { |
| - "path": "internal/runner/thin/mac_test.go", |
| - "line_sha256": "15ae00a7ae97948321cee091518894d26f5bae77907f4690dea8714d377d8056", |
| - "match": "Node", |
| - "count": 1, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| - { |
| - "path": "internal/runner/thin/mac_test.go", |
| - "line_sha256": "2f6274ddfc53bfac6a5e9e148cb6e8203c8d6f6ef0f2c042325c17c9bf1a90a9", |
| - "match": "Node", |
| - "count": 1, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| { |
| "path": "internal/runner/thin/mac_test.go", |
| "line_sha256": "64aaa2a2e81f4075b3486f9fe7db72f20c75f16cc3f5a6977ebe03bf75c87161", |
| @@ -12186,34 +12137,6 @@ |
| "count": 1, |
| "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| }, |
| - { |
| - "path": "internal/runner/thin/mac_test.go", |
| - "line_sha256": "762b3810b5621dddaf710df728e7d6fb91a200b703dfcbd42d7731eed2141d11", |
| - "match": "Node", |
| - "count": 1, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| - { |
| - "path": "internal/runner/thin/mac_test.go", |
| - "line_sha256": "762b3810b5621dddaf710df728e7d6fb91a200b703dfcbd42d7731eed2141d11", |
| - "match": "node", |
| - "count": 1, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| - { |
| - "path": "internal/runner/thin/mac_test.go", |
| - "line_sha256": "a994d7751033c8667425479de00effbab493a07658421582c102a79f2cd067aa", |
| - "match": "node", |
| - "count": 4, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| - { |
| - "path": "internal/runner/thin/mac_test.go", |
| - "line_sha256": "bb24e35d06c4290bea65c10924fa031ed2d7cb83297191d613fda71c6cf2efd4", |
| - "match": "node", |
| - "count": 1, |
| - "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| - }, |
| { |
| "path": "cmd/equipo-runner/install_mac_test.go", |
| "line_sha256": "074770425a8494e5f4a30a0626184c59e459aa86b691eeb664cad6eda8461888", |
| @@ -12430,5 +12353,334 @@ |
| "match": "npm", |
| "count": 1, |
| "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "cmd/equipo-runner/install_mac.go", |
| + "line_sha256": "3f8e54a48c6c3e67ae5d046c63fc690af49e11c3d3945695f402899139491959", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "cmd/equipo-runner/install_mac.go", |
| + "line_sha256": "af31f8f4ab7722984c66424314ec73084967c7a058354a5dc6798c3f7585db55", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "cmd/equipo-runner/install_mac.go", |
| + "line_sha256": "af31f8f4ab7722984c66424314ec73084967c7a058354a5dc6798c3f7585db55", |
| + "match": "npm", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "cmd/equipo-runner/install_mac_test.go", |
| + "line_sha256": "a39bb1643b1eb121e0ac0d6b4c859a06b71d6a95d3b63285ff5a0e71c175a76d", |
| + "match": "equipo-runner", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "cmd/equipo-runner/install_mac_test.go", |
| + "line_sha256": "b109fd95422cec355402a34627a39a29da94760e45a06ced0ddc2ac8692f51e7", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/DARWIN-PROGRESS.md", |
| + "line_sha256": "04484a6af36df7b7aef18b752ca0cd64a797284cf67450905e63a87d6a443a23", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/DARWIN-PROGRESS.md", |
| + "line_sha256": "04484a6af36df7b7aef18b752ca0cd64a797284cf67450905e63a87d6a443a23", |
| + "match": "npm", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/DARWIN-PROGRESS.md", |
| + "line_sha256": "70e52746fc4248ba38434cbe01b06c32d6178cbcef5b77b77070a61f9b0d95b3", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/DARWIN-PROGRESS.md", |
| + "line_sha256": "70e52746fc4248ba38434cbe01b06c32d6178cbcef5b77b77070a61f9b0d95b3", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/DARWIN-PROGRESS.md", |
| + "line_sha256": "75e8fe1d9ad5da30013a597b4828d611b581cb9b3930b0cde6c1e9438ca0a446", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/DARWIN-PROGRESS.md", |
| + "line_sha256": "8b12063329f226c3f4f035747013d570be1406edc9a1f31a3f3a821b87dddb82", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/DARWIN-PROGRESS.md", |
| + "line_sha256": "d1d09f1d450511b620c4f30528657ae3e16aeeb7490767dd895fe94bba767879", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/DARWIN-PROGRESS.md", |
| + "line_sha256": "df945d0c93b1a6257d36762b23af7068a5c79cabddc53620ade7301568a8c2e7", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "docs/superpowers/plans/DARWIN-PROGRESS.md", |
| + "line_sha256": "f20a64411a4d8878e1152e64950ce05a24010bb4a0df7f19b8f47dec88cb72e8", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "1483ef49ccf4e796829cb02eea445b0f1c898ae118b959f19e3e86dbf96d8e95", |
| + "match": "Node", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "211e9726998008fc3c1b8d58f01e3a92249a6d74f66b23a0612000c049245fdf", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "4c0af59e7326092c2e987a9bd86a4ad841ea1cdf4695e6e06b13ca0c2686c488", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "5b566c18ed3323075eff753fc768f26fc4f77edb4884c4858011531acf919bcd", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "7a757e6d68736f10f4b670a7e0647e4457b9735117b3a7f29cd322d312d8717b", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "7a757e6d68736f10f4b670a7e0647e4457b9735117b3a7f29cd322d312d8717b", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "853c6375a7b963e01dd8796315afd571a1d41763db19d337aa2a21a30d048b24", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "90b2ebe05707fdfe8c52a6ca7289476d5f68092ed7ed8155cbad75bc3267ba14", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "97aac322713e17184485f552536fdd31b1b1e2a6242c0f57c833600f8d3fe79a", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "9a39438e08d00955cb7669d2206182203fa629a751b2bcb863f6399f21a81faf", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "ab33775c4297ee8b5309971be38b9533ebdb7c778fb6f26bbbb3433220b6025e", |
| + "match": "Node", |
| + "count": 3, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "c64c84575b7da0e6c7a0bd706b45a718f94208c7acbe9e92a75e3c7699e85b2b", |
| + "match": "Node", |
| + "count": 2, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "e2980d205071b13fb80452f564235f4fa778e77c1b9299842cf3bf984d9e20cc", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins.go", |
| + "line_sha256": "fe5c2bda6d98f343e0690fa7ab499bbd8d8035c355a67c20bbbdad08ac1113ca", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "1c670faade9833515404fa9be3ac204c0d0ffeff4d8bc34ccc70ad6e109b8910", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "31dfc96aed772a5e00353f064b95f495c94f89edba5192db7c6417f5782b8ad8", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "3bc2b9f58bd39f846ad9e5f6dfa17c3728d0203408ba975c2f743c7a8cbabb50", |
| + "match": "npm", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "4b2be8876f5c55e8c8d56a953ee08d330c829d286386d2fee22beef4dc1c53bf", |
| + "match": "NODE", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "4dc0c10fd4cd4856d7fe990f133afd9876af4ff527d4ffc232d402ce5fcbdb4d", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "4dfd155d9d58dd1c7259f451bc341aa5dde44c689900b40622d769a214685ccd", |
| + "match": "NODE", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "6aaeed3b0cd1a502281e0a9b0a350d6971cc8be40168b056bd2f90015f6206fa", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "947b1016f0d7237dfbb6dc8aa238d6a411b581c0bf4f78de8d2d4d461400b28f", |
| + "match": "NODE", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "ad418eff41ac6622a2e42895075c8184c5d820e0c7f3d5fb8699b88a44e87a8f", |
| + "match": "NODE", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "ad974ace535d6db5547132d287ba93365102293b79fe4deac4b443ffc04cf9fa", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "b806cc383ba713221c63a60c7c4a11553a5bb4fa673567a7bac87d855cca6979", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "d00d0f8936a9065ebc70d9b14f905cca76c2fa59ca7bfeadacaf3de28dfe7e6d", |
| + "match": "NODE", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "f08178bb30f5b5bc354a8689cd92ad95a45818f6f042703b33b5e12ffec69587", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/mac/pins_test.go", |
| + "line_sha256": "f677b09c9c378395a842b5ea13a4e4871edd78e099bce8622a33dfceb9bad193", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/thin/mac.go", |
| + "line_sha256": "49b012c16c70db1b15a299817f80c52a230eea34576604c0a81c46c608701c51", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/thin/mac.go", |
| + "line_sha256": "49b012c16c70db1b15a299817f80c52a230eea34576604c0a81c46c608701c51", |
| + "match": "node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/thin/mac.go", |
| + "line_sha256": "8f7f07d5f22ac1f998cc4ec5828426a0631d3e938d009235a2c41bf1c51846a7", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/thin/mac_test.go", |
| + "line_sha256": "5a558567f7114f4011e082dd076425d77831372bba6ee3b78e8d9bbe4c55b080", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| + }, |
| + { |
| + "path": "internal/runner/thin/mac_test.go", |
| + "line_sha256": "aef24b1743dd15e694bd39f5846670b165c9dacd0e65d441e70890c688eeeb82", |
| + "match": "Node", |
| + "count": 1, |
| + "reason": "Mac runner (darwin worker): the runner executable, its launchd agent, install paths, the pinned srt package and Node it needs, and their tests and docs." |
| } |
| ] |