Merge branch 'runner-startup-logs' into main
Merge runner-startup-logs: startup logs, hang and probe fixes The runner logs each startup phase at info through hello and welcome. macHost.run kills a timed-out command's whole process group with a 5 s WaitDelay, so a grandchild holding stdout cannot stall the hello. An untrusted probe report reruns only on change or hourly with backoff. Hosted CI passed on 313995f.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
14 files changed,
+910
−41
.rastrillo/budgets.txt+1 −1cmd/equipo-runner/main.go+21 −0cmd/equipo-runner/main_test.go+37 −0internal/runner/thin/capabilities.go+20 −3internal/runner/thin/contract_test.go+2 −2internal/runner/thin/link.go+37 −6internal/runner/thin/mac.go+246 −13internal/runner/thin/probe_storm_test.go+77 −0internal/runner/thin/procgroup_other.go+12 −0internal/runner/thin/procgroup_unix.go+29 −0internal/runner/thin/procgroup_unix_test.go+112 −0internal/runner/thin/run.go+69 −15internal/runner/thin/startup_logs_test.go+204 −0scripts/runner-reference-allowlist.json+43 −1
CI passed — run details
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 735d6625..760bc054 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -34,7 +34,7 @@ time internal/runner/provider 15s Plan 3 CI repair measured 10.346s for the full |
| perf GET /releases/* skip Verified runner release file downloads, not browser GET screens. |
| perf GET /install.sh skip Mac runners: the one-line bootstrap a terminal pipes to sh, not a browser screen. |
| time internal/runner/containment 15s Plan 3 loaded CI measured 10.817s; niced serial reruns measured 5.773s and 5.750s. The added coordinator mount check has no repeated launches to remove; 15s leaves 38 percent headroom for namespace, process-exit and recovery assertions. |
| -size internal/runner/thin 16250 - Merge authority thin v1 adds the review's measured change facts (facts.go: raw and numstat listings, modes, signing lines, the revert tree check, about 230 lines), the merge_request confirmation and the merge's provenance; measured 16196 with spend-1 merged. Spend 1 resumes a fix round in Engineering's kept session on its healthy connection (fixSession, fixPlan, fixPrompt, keptCommit, about 90 lines); measured 15873. Claude's sign-in by a link's review round 1 contains its setup-token in a recorded namespace (the contained terminal, its proven stop and the start's recovery before a home goes, about 130 lines); measured 15787. Claude's sign-in by a link adds the runner's own setup-token attempt, the code's sealed delivery with its crash boundaries and the shared token commit (signin.go, about 300 lines, less the removed terminal watcher); measured 15655. Claude setup tokens add sealed delivery, the token check, Check again and recovery (token.go, tokencheck.go, about 700 lines) beside the composer and Mac lines; measured 15239. Astra round 2 moves the attachment quota to admission: arriving files counted by declared size, admissions protecting a file until its message names it, room made from the oldest unprotected files, refusal as runner_storage_full, and a sweep that stops when protection cannot be read (about 150 lines); measured 12191. Mac runners slices A and B add protocol negotiation (link.go), the capability report, the start authorization, the pack relay (relay.go), the primary's publication, the worker executor (worker.go) and the test-build fake worker, about 2700 lines on the same step engine. Composer attachments add the chunked receipt with exactly-once writes, the read-only desk delivery and its checks (files.go, about 230 lines), image blocks and localImage inputs, the attachment read through read_file; measured 11736. Connections slice 1 Astra round 1 adds the Codex step path (codexstep.go: Engineering and Review on the pinned app-server in the implement and inspect containment, about 300 lines); measured 11345. Connections slice 1 (after Astra round 1) also keeps a durable ledger of each turn's write tools so a later attempt never repeats one (effects.go), the waiting state between attempts and usage rows per attempt, about 500 lines more; measured 10590 before gate 1d. Connections slice 1 adds the Codex coordinator beside the Claude one (codex.go: the pinned app-server over JSON-RPC in the converse containment, sharing the coordinator base, desk, tool socket and session table), the connection registry over the bindings with health and provider limits (conns.go), in-app sign-in attempts (connector.go) and turn failover and holding (failover.go), about 1500 lines; the pure parts (the choice function, limit parsing, the app-server client, the sign-in flows) live in internal/runner/connect. Measured 10097. Thin v1 UX1 adds step activity lines from the specialist's stream, the repository head and checks gate in the index and project-tagged notes (about 120 lines); measured 8615 with slice 4c's review fixes. Thin v1 slice 4c adds the merge step (mergestep.go, about 190 lines) and the rebase round beside the slice 4b ask fixes. Thin v1 slice 3 adds Engineering steps beside the coordinator: the durable step state and engine (step.go) and the executor that checks out the task tree, runs the CLI in the implement containment, commits and pushes (engineer.go), about 800 lines sharing the coordinator's launch, tool socket and account selection. Measured 5686 source lines. Splitting would export the launch internals; revisit at the slice 7 sweep. Slice 4 adds checks and review on a candidate (judge.go) and the merge watch (merge.go), about 800 lines, sharing the Engineer launch path; measured 6808, 7035 after review round 1 (branch head watch, deadlines, streamed outputs). Slice 4b keeps Engineering and Review sessions and answers the creator's questions from them (ask.go: kept-session and ask state, read-only git tools, the answer stream), about 700 lines on the same launch path. |
| +size internal/runner/thin 16572 - The leftover helper's debug line adds 3 lines: measured 16572. The Mac host's hang fix and probe pacing add the process group and its kill (procgroup_unix.go, procgroup_other.go), the bounded wait for a command's output, and the untrusted report's rerun decision with its tool fingerprint (about 165 lines); measured 16569. Runner startup logs add the info lines a silent start is pinned to a phase by (startup phases, the Mac host's xcode-select and capability commands, slow-command warnings, the probes, and the link's connecting, hello and welcome lines: startPhase, openRunner, watchSlow and logged, about 155 lines); measured 16405. Merge authority thin v1 adds the review's measured change facts (facts.go: raw and numstat listings, modes, signing lines, the revert tree check, about 230 lines), the merge_request confirmation and the merge's provenance; measured 16196 with spend-1 merged. Spend 1 resumes a fix round in Engineering's kept session on its healthy connection (fixSession, fixPlan, fixPrompt, keptCommit, about 90 lines); measured 15873. Claude's sign-in by a link's review round 1 contains its setup-token in a recorded namespace (the contained terminal, its proven stop and the start's recovery before a home goes, about 130 lines); measured 15787. Claude's sign-in by a link adds the runner's own setup-token attempt, the code's sealed delivery with its crash boundaries and the shared token commit (signin.go, about 300 lines, less the removed terminal watcher); measured 15655. Claude setup tokens add sealed delivery, the token check, Check again and recovery (token.go, tokencheck.go, about 700 lines) beside the composer and Mac lines; measured 15239. Astra round 2 moves the attachment quota to admission: arriving files counted by declared size, admissions protecting a file until its message names it, room made from the oldest unprotected files, refusal as runner_storage_full, and a sweep that stops when protection cannot be read (about 150 lines); measured 12191. Mac runners slices A and B add protocol negotiation (link.go), the capability report, the start authorization, the pack relay (relay.go), the primary's publication, the worker executor (worker.go) and the test-build fake worker, about 2700 lines on the same step engine. Composer attachments add the chunked receipt with exactly-once writes, the read-only desk delivery and its checks (files.go, about 230 lines), image blocks and localImage inputs, the attachment read through read_file; measured 11736. Connections slice 1 Astra round 1 adds the Codex step path (codexstep.go: Engineering and Review on the pinned app-server in the implement and inspect containment, about 300 lines); measured 11345. Connections slice 1 (after Astra round 1) also keeps a durable ledger of each turn's write tools so a later attempt never repeats one (effects.go), the waiting state between attempts and usage rows per attempt, about 500 lines more; measured 10590 before gate 1d. Connections slice 1 adds the Codex coordinator beside the Claude one (codex.go: the pinned app-server over JSON-RPC in the converse containment, sharing the coordinator base, desk, tool socket and session table), the connection registry over the bindings with health and provider limits (conns.go), in-app sign-in attempts (connector.go) and turn failover and holding (failover.go), about 1500 lines; the pure parts (the choice function, limit parsing, the app-server client, the sign-in flows) live in internal/runner/connect. Measured 10097. Thin v1 UX1 adds step activity lines from the specialist's stream, the repository head and checks gate in the index and project-tagged notes (about 120 lines); measured 8615 with slice 4c's review fixes. Thin v1 slice 4c adds the merge step (mergestep.go, about 190 lines) and the rebase round beside the slice 4b ask fixes. Thin v1 slice 3 adds Engineering steps beside the coordinator: the durable step state and engine (step.go) and the executor that checks out the task tree, runs the CLI in the implement containment, commits and pushes (engineer.go), about 800 lines sharing the coordinator's launch, tool socket and account selection. Measured 5686 source lines. Splitting would export the launch internals; revisit at the slice 7 sweep. Slice 4 adds checks and review on a candidate (judge.go) and the merge watch (merge.go), about 800 lines, sharing the Engineer launch path; measured 6808, 7035 after review round 1 (branch head watch, deadlines, streamed outputs). Slice 4b keeps Engineering and Review sessions and answers the creator's questions from them (ask.go: kept-session and ask state, read-only git tools, the answer stream), about 700 lines on the same launch path. |
| time internal/thintest 180s Mac runners slices A and B add role, scoping, migration, placement, withdrawal, transfer and publication contracts, and Astra round 1 eight transition contracts (about 15s; the package measured 126s locally under load). Housekeeping slice 1 adds six contract tests (combine, Undo round trips and the race, Pause, auto-disable, quiet hours, restart while claimed; about 6s); the package measured 67.7s beside other packages locally, so 75s. Thin v1 slice 4c adds the merge, adoption, cancel and retention contract tests (CI measured 35.7s). Thin v1 contract tests: a real instance and a scripted runner per test, fixtures replayed against every request, frame and event. Slice 3 adds the task, step-sync and grant contracts; CI measured 14.805s. 30s keeps room for the slice 4 review contracts. UX1 adds step activity, task source and duplicates, coordinator merging and project facts (four contracts, about 6s); the package measured 34s locally under load, so 40s. UX1's inner screens gallery (two owners, seven tasks, every page) adds about 3s; measured 40.9s locally under load, so 60s. |
| time internal/runner/mac 30s Mac runners (Darwin worker): real process groups killed after a grace and proven gone (SIGTERM, SIGKILL, the marker sweep), and the probes run end to end with fake srt and xcodebuild, P6 killing a waiting test two seconds after it starts. About 6s alone; loaded CI measured 12.5s. |
| time internal/runner/thin 45s Thin v1 slice 4 review: real git repositories for the merge and squash checks, a stalled fetch, and a 16 MiB candidate streamed through the review diff and the checks pack (about 5s). Measured 17.8s locally under load. Slice 4b review adds a 16 MiB git output bound, an injected index-pack failure and stall (3s deadline) and held-answer tests; measured 30.3s locally under load. 45s keeps 33 percent headroom. |
diff --git a/cmd/equipo-runner/main.go b/cmd/equipo-runner/main.go| index ea79a86f..fc06f911 100644 |
| --- a/cmd/equipo-runner/main.go |
| +++ b/cmd/equipo-runner/main.go |
| @@ -7,6 +7,7 @@ import ( |
| "fmt" |
| "io" |
| "log/slog" |
| + "net/url" |
| "os" |
| "os/signal" |
| "syscall" |
| @@ -17,6 +18,7 @@ import ( |
| "amadan.net/oficina/equipo/internal/runner/mac" |
| runnersetup "amadan.net/oficina/equipo/internal/runner/setup" |
| "amadan.net/oficina/equipo/internal/runner/thin" |
| + "amadan.net/oficina/equipo/internal/wire" |
| "amadan.net/rastrillo/rastrillo" |
| ) |
| @@ -109,6 +111,7 @@ func run(ctx context.Context, args []string, input io.Reader, output, errorOutpu |
| case "run": |
| opts := thin.OptionsFromEnv(getenv) |
| opts.Version, opts.Logger = rastrillo.BuildVersion, slog.New(slog.NewTextHandler(errorOutput, nil)) |
| + logStart(opts.Logger, cfg, opts.Version, envFile) |
| err = thin.Run(ctx, cfg, opts) |
| if errors.Is(err, thin.ErrSuperseded) { |
| _, _ = fmt.Fprintf(errorOutput, equipo.CopyRunnerDiagnostic, "runner.superseded", "-") |
| @@ -158,6 +161,24 @@ func main() { |
| os.Exit(code) |
| } |
| +// logStart is the runner's first line: what starts, where it connects |
| +// (the origin's host only) and from which env file. No credential. |
| +func logStart(log *slog.Logger, cfg runner.Config, version, envFile string) { |
| + role := wire.RolePrimary |
| + if cfg.WorkerOnly || runner.ReadRole(cfg.StateDir) == wire.RoleWorker { |
| + role = wire.RoleWorker |
| + } |
| + host := "" |
| + if u, err := url.Parse(cfg.Origin); err == nil { |
| + host = u.Host |
| + } |
| + attrs := []any{"version", version, "os", goos(), "arch", goarch(), "role", role, "origin", host, "label", cfg.MachineLabel} |
| + if envFile != "" { |
| + attrs = append(attrs, "env_file", envFile) |
| + } |
| + log.Info("runner starting", attrs...) |
| +} |
| + |
| // supersededExit: systemd must not restart a runner that lost its lease |
| // (RestartPreventExitStatus=3); launchd restarts any non-zero exit |
| // (KeepAlive SuccessfulExit false), so on a Mac it is 0. |
diff --git a/cmd/equipo-runner/main_test.go b/cmd/equipo-runner/main_test.go| index 2fbcd25d..7b914f3c 100644 |
| --- a/cmd/equipo-runner/main_test.go |
| +++ b/cmd/equipo-runner/main_test.go |
| @@ -3,6 +3,8 @@ package main |
| import ( |
| "bytes" |
| "context" |
| + "os" |
| + "path/filepath" |
| "strings" |
| "testing" |
| ) |
| @@ -36,3 +38,38 @@ func TestRunnerDiagnosticIsCredentialFree(t *testing.T) { |
| t.Fatal("missing or unsafe diagnostic", log.String()) |
| } |
| } |
| + |
| +// run's first line says what starts and where it connects: the version, |
| +// the platform, the role, the origin's host alone, the machine's label |
| +// and the env file it read. It comes before anything that could hang. |
| +func TestRunLogsItsStart(t *testing.T) { |
| + root, err := filepath.EvalSymlinks(t.TempDir()) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + vars := map[string]string{"EQUIPO_ORIGIN": "https://equipo.example.com", "EQUIPO_INSTANCE_ID": "i1", "EQUIPO_FAKE_PLATFORM": "darwin/arm64", "EQUIPO_MACHINE_LABEL": `"Test Mac"`, "EQUIPO_AMADAN_PATH": "/bin/sh"} |
| + for _, v := range []string{"BWRAP_PATH", "CLAUDE_PATH", "CODEX_CODE_MODE_HOST_PATH", "RUNNER_STATE_DIR", "AMADAN_CREDENTIAL_PATH", "ACCOUNT_BINDINGS_PATH", "CODEX_PATH", "GO_ROOT", "GO_BINARY", "WORKSPACE_ROOT", "SCRATCH_ROOT", "GIT_PATH"} { |
| + vars["EQUIPO_"+v] = filepath.Join(root, strings.ToLower(v)) |
| + } |
| + var lines []string |
| + for k, v := range vars { |
| + lines = append(lines, k+"="+v) |
| + } |
| + envFile := filepath.Join(root, "runner.env") |
| + if err := os.WriteFile(envFile, []byte(strings.Join(lines, "\n")+"\n"), 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + var out, log bytes.Buffer |
| + // No credential in the state directory: the run ends at once, after |
| + // its first line. |
| + run(context.Background(), []string{"run", "--env-file", envFile}, strings.NewReader(""), &out, &log, func(string) string { return "" }) |
| + first, _, _ := strings.Cut(log.String(), "\n") |
| + for _, want := range []string{`level=INFO msg="runner starting" version=`, " os=" + goos() + " arch=" + goarch() + " role=worker origin=equipo.example.com", `label="Test Mac"`, "env_file=" + envFile} { |
| + if !strings.Contains(first, want) { |
| + t.Fatalf("start line lacks %q:\n%s", want, log.String()) |
| + } |
| + } |
| + if strings.Contains(first, "https://") { |
| + t.Fatalf("start line names more than the origin's host: %s", first) |
| + } |
| +} |
diff --git a/internal/runner/thin/capabilities.go b/internal/runner/thin/capabilities.go| index ebd6e6b4..be2b130b 100644 |
| --- a/internal/runner/thin/capabilities.go |
| +++ b/internal/runner/thin/capabilities.go |
| @@ -2,9 +2,11 @@ package thin |
| import ( |
| "context" |
| + "log/slog" |
| "os/exec" |
| "regexp" |
| "runtime" |
| + "strings" |
| "sync" |
| "time" |
| @@ -21,10 +23,14 @@ const capabilityEvery = time.Hour |
| // runner had to refuse), sent with every heartbeat. |
| type Capabilities struct { |
| Probe func(context.Context) wire.Capabilities |
| + // Logger hears each gathering: the first (the one the first hello |
| + // waits on) at info, later ones at debug. |
| + Logger *slog.Logger |
| - mu sync.Mutex |
| - last wire.Capabilities |
| - at time.Time |
| + mu sync.Mutex |
| + last wire.Capabilities |
| + at time.Time |
| + logged bool |
| } |
| // Get is the newest report, probing when it is older than an hour. |
| @@ -32,7 +38,18 @@ func (c *Capabilities) Get(ctx context.Context) wire.Capabilities { |
| c.mu.Lock() |
| defer c.mu.Unlock() |
| if c.at.IsZero() || time.Since(c.at) > capabilityEvery { |
| + level := slog.LevelDebug |
| + if !c.logged { |
| + level, c.logged = slog.LevelInfo, true |
| + } |
| + start := time.Now() |
| + if c.Logger != nil { |
| + c.Logger.Log(ctx, level, "capabilities gathering") |
| + } |
| next := c.Probe(ctx) |
| + if c.Logger != nil { |
| + c.Logger.Log(ctx, level, "capabilities gathered", "took", took(start), "tags", strings.Join(next.Tags, ",")) |
| + } |
| if wire.ValidCapabilities(next) != nil { |
| // Out of bounds: say only the tags, which are always valid. |
| next = wire.Capabilities{Tags: next.Tags} |
diff --git a/internal/runner/thin/contract_test.go b/internal/runner/thin/contract_test.go| index c7fa7378..ea029b6d 100644 |
| --- a/internal/runner/thin/contract_test.go |
| +++ b/internal/runner/thin/contract_test.go |
| @@ -516,7 +516,7 @@ func TestStartupRefusesSharedRootsBeforeRecovery(t *testing.T) { |
| first := runner.Config{ScratchRoot: filepath.Join(root, "scratch"), WorkspaceRoot: filepath.Join(root, "work"), StateDir: filepath.Join(root, "state-a")} |
| second := first |
| second.StateDir = filepath.Join(root, "state-b") |
| - release, err := startup(context.Background(), first, func(context.Context) error { return nil }) |
| + release, err := startup(context.Background(), first, nil, func(context.Context) error { return nil }) |
| if err != nil { |
| t.Fatal(err) |
| } |
| @@ -528,7 +528,7 @@ func TestStartupRefusesSharedRootsBeforeRecovery(t *testing.T) { |
| record := filepath.Join(first.ScratchRoot, "0123456789abcdef0123456789abcdef.json") |
| os.WriteFile(record, []byte("{}"), 0600) |
| recovered := false |
| - if _, err = startup(context.Background(), second, func(context.Context) error { recovered = true; return nil }); err != ErrRootShared { |
| + if _, err = startup(context.Background(), second, nil, func(context.Context) error { recovered = true; return nil }); err != ErrRootShared { |
| t.Fatalf("second runner on shared roots: %v", err) |
| } |
| if recovered { |
diff --git a/internal/runner/thin/link.go b/internal/runner/thin/link.go| index b99ed0b2..9f282014 100644 |
| --- a/internal/runner/thin/link.go |
| +++ b/internal/runner/thin/link.go |
| @@ -7,6 +7,7 @@ import ( |
| "log/slog" |
| "math/rand/v2" |
| "net/http" |
| + "net/url" |
| "strings" |
| "sync" |
| "time" |
| @@ -369,13 +370,9 @@ func (l *Link) Run(ctx context.Context) error { |
| } |
| return err |
| } |
| - if errors.Is(err, ErrInstanceTooOld) || errors.Is(err, ErrRoleMismatch) { |
| + older := errors.Is(err, ErrInstanceTooOld) || errors.Is(err, ErrRoleMismatch) |
| + if older { |
| retry = olderRetry |
| - if l.Logger != nil { |
| - l.Logger.Error("runner refused: this runner is a worker and the instance is an older release", "origin", l.Origin, "err", err) |
| - } |
| - } else if err != nil && l.Logger != nil { |
| - l.Logger.Warn("runner stream", "err", err) |
| } |
| wait := backoff |
| if retry > 0 { |
| @@ -384,6 +381,18 @@ func (l *Link) Run(ctx context.Context) error { |
| backoff *= 2 |
| } |
| wait += time.Duration(rand.Int64N(int64(wait / 4))) |
| + // Every ending is logged with the wait before the next try, the |
| + // first included: a runner that never connects says why. |
| + if l.Logger != nil { |
| + switch { |
| + case older: |
| + l.Logger.Error("runner refused: this runner is a worker and the instance is an older release", "origin", l.Origin, "err", err, "retry_in", wait.Round(time.Millisecond)) |
| + case err != nil: |
| + l.Logger.Warn("runner stream", "err", err, "retry_in", wait.Round(time.Millisecond)) |
| + default: |
| + l.Logger.Info("runner stream ended", "retry_in", wait.Round(time.Millisecond)) |
| + } |
| + } |
| select { |
| case <-ctx.Done(): |
| return ctx.Err() |
| @@ -448,6 +457,9 @@ func (l *Link) session(ctx context.Context) (time.Duration, error) { |
| // handshake dials, says hello at offer and reads the welcome. |
| func (l *Link) handshake(ctx context.Context, offer int) (*websocket.Conn, *wire.Welcome, error) { |
| url := "ws" + strings.TrimPrefix(l.Origin, "http") + wire.StreamPath |
| + host := originHost(l.Origin) |
| + l.info("connecting", "host", host, "protocol", offer) |
| + start := time.Now() |
| dctx, cancel := context.WithTimeout(ctx, 20*time.Second) |
| c, res, err := websocket.Dial(dctx, url, &websocket.DialOptions{HTTPHeader: http.Header{"Authorization": {"Bearer " + l.Token}}, CompressionMode: websocket.CompressionDisabled}) |
| cancel() |
| @@ -457,6 +469,7 @@ func (l *Link) handshake(ctx context.Context, offer int) (*websocket.Conn, *wire |
| } |
| return nil, nil, err |
| } |
| + l.info("connected", "host", host, "took", took(start)) |
| c.SetReadLimit(wire.MaxFrameBytes) |
| hello := l.Hello() |
| l.mu.Lock() |
| @@ -467,6 +480,7 @@ func (l *Link) handshake(ctx context.Context, offer int) (*websocket.Conn, *wire |
| c.CloseNow() |
| return nil, nil, err |
| } |
| + l.info("hello sent", "protocol", offer) |
| rctx, rcancel := context.WithTimeout(ctx, 15*time.Second) |
| _, raw, err := c.Read(rctx) |
| rcancel() |
| @@ -507,9 +521,26 @@ func (l *Link) handshake(ctx context.Context, offer int) (*websocket.Conn, *wire |
| l.mu.Lock() |
| l.proto, l.role = min(spoken, offer), role |
| l.mu.Unlock() |
| + l.info("welcome", "protocol", min(spoken, offer), "role", role, "generation", welcome.Generation) |
| return c, welcome, nil |
| } |
| +// info logs one line of a connection's start (a few per reconnect). |
| +func (l *Link) info(msg string, args ...any) { |
| + if l.Logger != nil { |
| + l.Logger.Info(msg, args...) |
| + } |
| +} |
| + |
| +// originHost is the origin's host and port alone, for a log line. |
| +func originHost(origin string) string { |
| + u, err := url.Parse(origin) |
| + if err != nil { |
| + return "" |
| + } |
| + return u.Host |
| +} |
| + |
| // serve runs one connection after its welcome. |
| func (l *Link) serve(ctx context.Context, c *websocket.Conn, welcome *wire.Welcome) (time.Duration, error) { |
| defer c.CloseNow() |
diff --git a/internal/runner/thin/mac.go b/internal/runner/thin/mac.go| index 091f74f8..4e6cf78a 100644 |
| --- a/internal/runner/thin/mac.go |
| +++ b/internal/runner/thin/mac.go |
| @@ -7,11 +7,13 @@ import ( |
| "encoding/json" |
| "errors" |
| "io" |
| + "log/slog" |
| "net" |
| "net/http" |
| "os" |
| "os/exec" |
| "path/filepath" |
| + "strconv" |
| "strings" |
| "sync" |
| "sync/atomic" |
| @@ -123,24 +125,53 @@ const probeTrust = 24 * time.Hour |
| // for this checks profile, made with the srt, Node and ripgrep that are |
| // 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. |
| +// run as not verified. The probes run again only when that can change |
| +// the answer (see untrusted), not on every look. `equipo-runner probe` |
| +// asks for a run at once (request): a forged request costs a probe run |
| +// and never upgrades trust. |
| type macProbes struct { |
| version string |
| run func(context.Context) mac.Report |
| verified func() bool |
| - request string |
| - now func() time.Time |
| + // fingerprint names the tools on disk a report depends on (cheaply: |
| + // paths, link targets, sizes and times); nil is "". |
| + fingerprint func() string |
| + request string |
| + now func() time.Time |
| + // log hears each run start and finish, with the verdicts, and why a |
| + // report is not trusted. |
| + log *slog.Logger |
| mu sync.Mutex |
| last mac.Report |
| ready chan struct{} |
| again chan struct{} |
| + // What the last run was made with and when it started; whether a |
| + // run asked for by untrusted has yet to report; the wait before the |
| + // next run of an unchanged untrusted report; the last reason warned. |
| + ranWith string |
| + ranAt time.Time |
| + pending bool |
| + backoff time.Duration |
| + warned string |
| } |
| +// probeRetry is the first wait before an untrusted report whose inputs |
| +// have not changed is probed again; it doubles up to probeTrust. |
| +const probeRetry = time.Hour |
| + |
| 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)} |
| + return &macProbes{version: version, request: request, run: run, verified: verified, now: time.Now, ready: make(chan struct{}), again: make(chan struct{}, 1), backoff: probeRetry} |
| +} |
| + |
| +// inputs is what a report depends on: this binary's version, the tools' |
| +// fingerprint and whether they match their pins. |
| +func (p *macProbes) inputs(verified bool) string { |
| + fp := "" |
| + if p.fingerprint != nil { |
| + fp = p.fingerprint() |
| + } |
| + return p.version + "|" + strconv.FormatBool(verified) + "|" + fp |
| } |
| // report is the newest report, for the instance to show. |
| @@ -153,13 +184,68 @@ 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 == srtPinned && p.verified() && !r.At.IsZero() && p.now().Sub(r.At) < probeTrust && p.now().Sub(r.At) >= -time.Minute |
| + verified, now := p.verified(), p.now() |
| + ok := r.Version == p.version && r.Profile == mac.ProfileDigest() && r.SRT == srtPinned && verified && !r.At.IsZero() && now.Sub(r.At) < probeTrust && now.Sub(r.At) >= -time.Minute |
| if !ok && !r.At.IsZero() { |
| - p.probeSoon() |
| + p.untrusted(r, verified, now) |
| } |
| return r, ok |
| } |
| +// untrusted decides whether an untrusted report is probed again. Every |
| +// hello and every check looks, so asking each time would run the whole |
| +// suite on every heartbeat. A run is asked for when the report expired, |
| +// or what it was made with changed (the version, the tools' fingerprint, |
| +// whether they match their pins), or else once probeRetry has passed |
| +// since the last run, the wait doubling each time up to a day. One run |
| +// at a time: none is asked for while one asked for has yet to report. |
| +// Each reason, and each run it asks for, is warned once. |
| +func (p *macProbes) untrusted(r mac.Report, verified bool, now time.Time) { |
| + reason := "" |
| + switch { |
| + case r.Version != p.version || r.Profile != mac.ProfileDigest(): |
| + reason = "the report is another runner version's or checks profile's" |
| + case !verified: |
| + reason = "srt or its tools on disk do not match their pins" |
| + case r.SRT != srtPinned: |
| + reason = "the report was made with tools that did not match their pins" |
| + case now.Sub(r.At) < -time.Minute: |
| + reason = "the report is dated in the future" |
| + default: |
| + reason = "the report is more than a day old" |
| + } |
| + expired := now.Sub(r.At) >= probeTrust || now.Sub(r.At) < -time.Minute |
| + inputs := p.inputs(verified) |
| + p.mu.Lock() |
| + again, why := false, "" |
| + switch { |
| + case p.pending: |
| + case expired: |
| + again, why = true, "expired" |
| + case inputs != p.ranWith: |
| + again, why, p.backoff = true, "its inputs changed", probeRetry |
| + case now.Sub(p.ranAt) >= p.backoff: |
| + again, why = true, "retry after "+p.backoff.String() |
| + p.backoff = min(2*p.backoff, probeTrust) |
| + } |
| + if again { |
| + p.pending = true |
| + } |
| + warn := again || reason != p.warned |
| + p.warned = reason |
| + p.mu.Unlock() |
| + if warn && p.log != nil { |
| + attrs := []any{"reason", reason, "probe_again", again} |
| + if again { |
| + attrs = append(attrs, "because", why) |
| + } |
| + p.log.Warn("probe report not trusted", attrs...) |
| + } |
| + if again { |
| + p.probeSoon() |
| + } |
| +} |
| + |
| func (p *macProbes) probeSoon() { |
| select { |
| case p.again <- struct{}{}: |
| @@ -173,20 +259,42 @@ func (p *macProbes) probeSoon() { |
| func (p *macProbes) start(ctx context.Context, refresh func()) { |
| go func() { |
| first := true |
| + said := "" |
| for { |
| // 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() |
| + inputs := p.inputs(before) |
| + p.mu.Lock() |
| + p.ranWith, p.ranAt = inputs, p.now() |
| + p.mu.Unlock() |
| + // The first run at info; later ones (a day on, asked for, or |
| + // an untrusted report's retry) at debug unless their verdicts |
| + // changed. |
| + start, level := time.Now(), slog.LevelDebug |
| + if first { |
| + level = slog.LevelInfo |
| + } |
| + if p.log != nil { |
| + p.log.Log(ctx, level, "probes started") |
| + } |
| r := p.run(ctx) |
| if ctx.Err() != nil { |
| return |
| } |
| + if v := verdicts(r.Probes); p.log != nil { |
| + if v != said { |
| + level = slog.LevelInfo |
| + } |
| + p.log.Log(ctx, level, "probes finished", "took", took(start), "verdicts", v) |
| + said = v |
| + } |
| if before && p.verified() { |
| r.SRT = srtPinned |
| } |
| p.mu.Lock() |
| - p.last = r |
| + p.last, p.pending = r, false |
| p.mu.Unlock() |
| if first { |
| close(p.ready) |
| @@ -223,6 +331,16 @@ func (p *macProbes) watch(ctx context.Context) { |
| } |
| } |
| +// verdicts is each probe's name and verdict ("P1=passed P2=denied"), |
| +// never its detail. |
| +func verdicts(probes []wire.Probe) string { |
| + out := make([]string, 0, len(probes)) |
| + for _, p := range probes { |
| + out = append(out, p.ID+"="+p.Verdict) |
| + } |
| + return strings.Join(out, " ") |
| +} |
| + |
| func (p *macProbes) wait(ctx context.Context) error { |
| select { |
| case <-p.ready: |
| @@ -232,6 +350,24 @@ func (p *macProbes) wait(ctx context.Context) error { |
| } |
| } |
| +// toolFingerprint names the tools a probe report depends on without |
| +// reading them (verified hashes them): each one's path, link target, |
| +// size, mode and modification time, and the srt package tree's. |
| +func toolFingerprint(installDir string, t mac.Tools) string { |
| + var b strings.Builder |
| + for _, path := range []string{t.SRT, t.Node, t.RG, filepath.Join(installDir, "srt", "node_modules")} { |
| + b.WriteString(path) |
| + if target, err := os.Readlink(path); err == nil { |
| + b.WriteString(" -> " + target) |
| + } |
| + if info, err := os.Stat(path); err == nil { |
| + b.WriteString(" " + strconv.FormatInt(info.Size(), 10) + " " + info.Mode().String() + " " + strconv.FormatInt(info.ModTime().UnixNano(), 10)) |
| + } |
| + b.WriteByte('\n') |
| + } |
| + return b.String() |
| +} |
| + |
| // srtPinned marks a report made with srt, Node and ripgrep matching the |
| // pins compiled into this binary. |
| const srtPinned = "pinned" |
| @@ -251,8 +387,21 @@ type macHost struct { |
| checks *macChecks |
| taint *macTaint |
| caps func(context.Context) wire.Capabilities |
| + // log hears slow commands, and each command of the first capability |
| + // gathering (capsLogged) and of xcode-select at start. |
| + log *slog.Logger |
| + capsLogged atomic.Bool |
| } |
| +// slowCommand is how long a command the Mac worker runs may take before |
| +// it is logged as slow: while it still runs, so a hung child shows. |
| +var slowCommand = 10 * time.Second |
| + |
| +// commandWaitDelay bounds how long run waits for a command's output once |
| +// it has exited or been killed: a grandchild still holding the pipe |
| +// cannot hold the runner. |
| +var commandWaitDelay = 5 * time.Second |
| + |
| // Mac tool discovery (spec §3.3): EQUIPO_SRT_PATH and the installer's |
| // private srt first, then the usual places. |
| func macTools(installDir, home string, getenv func(string) string) mac.Tools { |
| @@ -289,10 +438,79 @@ func executable(p string) bool { |
| func (h *macHost) run(ctx context.Context, name string, args ...string) (string, error) { |
| cmd := exec.CommandContext(ctx, name, args...) |
| cmd.Env = withPath(os.Environ(), gatePath(h.tools)) |
| + // Its own process group, killed whole at the timeout, and a bounded |
| + // wait for its output: a grandchild holding the pipe (xcrun, swift |
| + // or claude starting a helper) cannot block run past its timeout. |
| + ownGroup(cmd) |
| + cmd.WaitDelay = commandWaitDelay |
| + done := h.watchSlow(name, args) |
| out, err := cmd.Output() |
| + if errors.Is(err, exec.ErrWaitDelay) { |
| + // The command itself exited successfully; only something it left |
| + // behind in its group still held the pipe. That goes, and what |
| + // the command printed is its answer. |
| + _ = killGroup(cmd) |
| + err = nil |
| + if h.log != nil { |
| + h.log.Debug("command left a helper holding its output; helper killed", "cmd", name, "args", logArgs(args)) |
| + } |
| + } |
| + done(err) |
| return string(out), err |
| } |
| +// watchSlow warns when a command is still running after slowCommand, |
| +// and again with its time and error when such a command ends. |
| +func (h *macHost) watchSlow(name string, args []string) func(error) { |
| + if h.log == nil { |
| + return func(error) {} |
| + } |
| + start, limit := time.Now(), slowCommand |
| + t := time.AfterFunc(limit, func() { |
| + h.log.Warn("command still running", "cmd", name, "args", logArgs(args), "after", limit) |
| + }) |
| + return func(err error) { |
| + if t.Stop() { |
| + return |
| + } |
| + attrs := []any{"cmd", name, "args", logArgs(args), "took", took(start)} |
| + if err != nil { |
| + attrs = append(attrs, "err", err.Error()) |
| + } |
| + h.log.Warn("slow command finished", attrs...) |
| + } |
| +} |
| + |
| +// logged runs a command through run and logs it at level with its time |
| +// and, when it failed, its exit status. |
| +func (h *macHost) logged(level slog.Level) mac.Exec { |
| + return func(ctx context.Context, name string, args ...string) (string, error) { |
| + start := time.Now() |
| + out, err := h.run(ctx, name, args...) |
| + if h.log != nil { |
| + attrs := []any{"cmd", name, "args", logArgs(args), "took", took(start)} |
| + if err != nil { |
| + attrs = append(attrs, "err", err.Error()) |
| + } |
| + h.log.Log(ctx, level, "command", attrs...) |
| + } |
| + return out, err |
| + } |
| +} |
| + |
| +// logArgs is a command's arguments for a log line, a password argument's |
| +// value (security -w) withheld. |
| +func logArgs(args []string) string { |
| + out := make([]string, len(args)) |
| + for i, a := range args { |
| + if i > 0 && args[i-1] == "-w" { |
| + a = "[withheld]" |
| + } |
| + out[i] = a |
| + } |
| + return strings.Join(out, " ") |
| +} |
| + |
| func withPath(env []string, path string) []string { |
| out := []string{"PATH=" + path} |
| for _, kv := range env { |
| @@ -326,7 +544,9 @@ func contains(list []string, s string) bool { |
| return false |
| } |
| -func newMacHost(c runner.Config, o Options) (*macHost, error) { |
| +func newMacHost(c runner.Config, o Options) (h *macHost, err error) { |
| + done := startPhase(o.Logger, "mac_host") |
| + defer func() { done(err) }() |
| getenv := o.Getenv |
| if getenv == nil { |
| getenv = os.Getenv |
| @@ -339,13 +559,13 @@ func newMacHost(c runner.Config, o Options) (*macHost, error) { |
| if accounts == "" { |
| accounts = DefaultAccountsRoot() |
| } |
| - h := &macHost{scratch: c.ScratchRoot} |
| + h = &macHost{scratch: c.ScratchRoot, log: o.Logger} |
| others, err := mac.OtherHomes(macUsers, home) |
| h.paths = mac.Paths{Home: home, StateDir: c.StateDir, AccountsRoot: accounts, SessionRoot: SessionRoot(c), InstallDir: filepath.Dir(c.Executable), OtherHomes: others, HomesUnknown: err != nil} |
| h.tools = macTools(h.paths.InstallDir, home, getenv) |
| h.env = []string{"HOME=" + home, "PATH=" + gatePath(h.tools), "CI=1", "LANG=en_US.UTF-8"} |
| ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) |
| - if out, err := h.run(ctx, "/usr/bin/xcode-select", "-p"); err == nil && filepath.IsAbs(strings.TrimSpace(out)) { |
| + if out, err := h.logged(slog.LevelInfo)(ctx, "/usr/bin/xcode-select", "-p"); err == nil && filepath.IsAbs(strings.TrimSpace(out)) { |
| h.env = append(h.env, "DEVELOPER_DIR="+strings.TrimSpace(out)) |
| } |
| cancel() |
| @@ -379,10 +599,18 @@ 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() bool { return mac.VerifyTools(h.paths.InstallDir, h.tools) == nil }) |
| + h.probes.log = o.Logger |
| + h.probes.fingerprint = func() string { return toolFingerprint(h.paths.InstallDir, h.tools) } |
| 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) |
| + // The first gathering is the one the first hello waits on: each |
| + // command at info. Later ones (hourly, each check's gate) at debug. |
| + level := slog.LevelDebug |
| + if h.capsLogged.CompareAndSwap(false, true) { |
| + level = slog.LevelInfo |
| + } |
| + caps := mac.Capabilities(ctx, h.logged(level), h.tools) |
| if probes := h.probes.report().Probes; len(probes) > 0 { |
| caps.Probes = probes |
| } |
| @@ -433,6 +661,11 @@ func runMac(ctx context.Context, c runner.Config, o Options) error { |
| if err != nil { |
| return err |
| } |
| + return serveMac(ctx, c, o, h) |
| +} |
| + |
| +// serveMac serves the instance as the Mac worker h sets up. |
| +func serveMac(ctx context.Context, c runner.Config, o Options, h *macHost) error { |
| if o.Logger != nil && h.tools.SRT == "" { |
| o.Logger.Warn("srt is not installed: checks run outside the sandbox and say so") |
| } |
diff --git a/internal/runner/thin/probe_storm_test.go b/internal/runner/thin/probe_storm_test.go| new file mode 100644 |
| index 00000000..30e49236 |
| --- /dev/null |
| +++ b/internal/runner/thin/probe_storm_test.go |
| @@ -0,0 +1,77 @@ |
| +package thin |
| + |
| +import ( |
| + "log/slog" |
| + "strings" |
| + "sync/atomic" |
| + "testing" |
| + "time" |
| +) |
| + |
| +// An untrusted report is not probed again on every look (every hello |
| +// and check looks): only when what it was made with changes, or an hour |
| +// on with the wait doubling, and each decision is warned once. A request |
| +// (equipo-runner probe) still runs the probes at once. |
| +func TestMacProbesUntrustedDoNotStorm(t *testing.T) { |
| + x := newProbeRig(t) |
| + x.pinned = false |
| + var fp atomic.Value |
| + fp.Store("tools-a") |
| + x.p.fingerprint = func() string { return fp.Load().(string) } |
| + logs := &syncBuffer{} |
| + x.p.log = slog.New(slog.NewTextHandler(logs, nil)) |
| + x.started(t) |
| + look := func() { |
| + t.Helper() |
| + for range 50 { |
| + if _, ok := x.p.trusted(); ok { |
| + t.Fatal("a report made with tools off their pins trusted") |
| + } |
| + } |
| + } |
| + runs := func(want int32) { |
| + t.Helper() |
| + look() |
| + deadline := time.Now().Add(5 * time.Second) |
| + for { |
| + x.p.mu.Lock() |
| + pending := x.p.pending |
| + x.p.mu.Unlock() |
| + if x.runs.Load() >= want && !pending { |
| + break |
| + } |
| + if time.Now().After(deadline) { |
| + t.Fatalf("%d probe runs, want %d (pending %v):\n%s", x.runs.Load(), want, pending, logs) |
| + } |
| + time.Sleep(10 * time.Millisecond) |
| + } |
| + look() |
| + time.Sleep(100 * time.Millisecond) |
| + if n := x.runs.Load(); n != want { |
| + t.Fatalf("%d probe runs, want %d:\n%s", n, want, logs) |
| + } |
| + } |
| + warned := func() int { return strings.Count(logs.String(), `level=WARN msg="probe report not trusted"`) } |
| + |
| + runs(1) |
| + if n := warned(); n != 1 || !strings.Contains(logs.String(), "probe_again=false") { |
| + t.Fatalf("an unchanged untrusted report warned %d times:\n%s", n, logs) |
| + } |
| + fp.Store("tools-b") |
| + runs(2) |
| + if !strings.Contains(logs.String(), `because="its inputs changed"`) { |
| + t.Fatalf("no warning for the rerun:\n%s", logs) |
| + } |
| + x.now = x.now.Add(probeRetry) |
| + runs(3) |
| + // The next retry waits two hours: one more hour is not enough. |
| + x.now = x.now.Add(probeRetry) |
| + runs(3) |
| + x.now = x.now.Add(probeRetry) |
| + runs(4) |
| + if n := warned(); n != 4 { |
| + t.Fatalf("%d warnings for 3 reruns and the first look:\n%s", n, logs) |
| + } |
| + x.p.probeSoon() |
| + runs(5) |
| +} |
diff --git a/internal/runner/thin/procgroup_other.go b/internal/runner/thin/procgroup_other.go| new file mode 100644 |
| index 00000000..78eca926 |
| --- /dev/null |
| +++ b/internal/runner/thin/procgroup_other.go |
| @@ -0,0 +1,12 @@ |
| +//go:build !unix |
| + |
| +package thin |
| + |
| +import "os/exec" |
| + |
| +// ownGroup leaves cmd as it is where there are no Unix process groups: |
| +// its context kills cmd alone, and WaitDelay still bounds the wait. |
| +func ownGroup(*exec.Cmd) {} |
| + |
| +// killGroup has no group to kill here. |
| +func killGroup(*exec.Cmd) error { return nil } |
diff --git a/internal/runner/thin/procgroup_unix.go b/internal/runner/thin/procgroup_unix.go| new file mode 100644 |
| index 00000000..96b560c7 |
| --- /dev/null |
| +++ b/internal/runner/thin/procgroup_unix.go |
| @@ -0,0 +1,29 @@ |
| +//go:build unix |
| + |
| +package thin |
| + |
| +import ( |
| + "errors" |
| + "os/exec" |
| + "syscall" |
| +) |
| + |
| +// ownGroup starts cmd in a process group of its own and makes the end of |
| +// its context kill that whole group, not only cmd: a grandchild that |
| +// ignores SIGTERM and holds cmd's output dies with it. |
| +func ownGroup(cmd *exec.Cmd) { |
| + cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} |
| + cmd.Cancel = func() error { return killGroup(cmd) } |
| +} |
| + |
| +// killGroup sends SIGKILL to cmd's process group (-pgid); a group that |
| +// is already gone is not an error. |
| +func killGroup(cmd *exec.Cmd) error { |
| + if cmd.Process == nil { |
| + return nil |
| + } |
| + if err := syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL); err != nil && !errors.Is(err, syscall.ESRCH) { |
| + return err |
| + } |
| + return nil |
| +} |
diff --git a/internal/runner/thin/procgroup_unix_test.go b/internal/runner/thin/procgroup_unix_test.go| new file mode 100644 |
| index 00000000..da225753 |
| --- /dev/null |
| +++ b/internal/runner/thin/procgroup_unix_test.go |
| @@ -0,0 +1,112 @@ |
| +//go:build unix |
| + |
| +package thin |
| + |
| +import ( |
| + "bytes" |
| + "context" |
| + "log/slog" |
| + "os" |
| + "path/filepath" |
| + "strconv" |
| + "strings" |
| + "syscall" |
| + "testing" |
| + "time" |
| +) |
| + |
| +// A command whose grandchild ignores SIGTERM and holds its output open |
| +// cannot hold run past its timeout: the whole process group is killed |
| +// when the context ends, and WaitDelay bounds the wait for the pipes. |
| +// The grandchild is gone afterwards. |
| +func TestMacRunEndsAHungGrandchild(t *testing.T) { |
| + pidFile := filepath.Join(t.TempDir(), "grandchild") |
| + pid := 0 |
| + t.Cleanup(func() { |
| + // Only the grandchild this test started, by pid, if it is still |
| + // that sleep. |
| + if pid > 0 && grandchildAlive(pid) { |
| + _ = syscall.Kill(pid, syscall.SIGKILL) |
| + } |
| + }) |
| + const timeout = 300 * time.Millisecond |
| + script := `sh -c 'trap "" TERM; echo $$ > "$1"; exec sleep 15' grandchild "$1" & wait` |
| + ctx, cancel := context.WithTimeout(context.Background(), timeout) |
| + defer cancel() |
| + start := time.Now() |
| + _, err := (&macHost{}).run(ctx, "/bin/sh", "-c", script, "child", pidFile) |
| + took := time.Since(start) |
| + if raw, rerr := os.ReadFile(pidFile); rerr == nil { |
| + pid, _ = strconv.Atoi(strings.TrimSpace(string(raw))) |
| + } |
| + if limit := timeout + commandWaitDelay + 2*time.Second; took > limit { |
| + t.Fatalf("run took %s, past its timeout and WaitDelay (%s): err %v", took.Round(time.Millisecond), limit, err) |
| + } |
| + if err == nil { |
| + t.Fatal("a command killed at its timeout succeeded") |
| + } |
| + if pid <= 0 { |
| + t.Fatal("the grandchild never started") |
| + } |
| + for deadline := time.Now().Add(2 * time.Second); grandchildAlive(pid); time.Sleep(20 * time.Millisecond) { |
| + if time.Now().After(deadline) { |
| + t.Fatalf("the grandchild %d outlived run", pid) |
| + } |
| + } |
| +} |
| + |
| +// A command that exits at once but leaves a helper holding its output |
| +// answers within WaitDelay with what it printed, and the helper, left in |
| +// the command's own group, is gone. |
| +func TestMacRunAnswersPastALingeringHelper(t *testing.T) { |
| + was := commandWaitDelay |
| + commandWaitDelay = 200 * time.Millisecond |
| + defer func() { commandWaitDelay = was }() |
| + pidFile := filepath.Join(t.TempDir(), "helper") |
| + pid := 0 |
| + t.Cleanup(func() { |
| + if pid > 0 && grandchildAlive(pid) { |
| + _ = syscall.Kill(pid, syscall.SIGKILL) |
| + } |
| + }) |
| + script := `echo 1.2.3; sh -c 'echo $$ > "$1"; exec sleep 15' helper "$1" & while [ ! -s "$1" ]; do sleep 0.01; done` |
| + start := time.Now() |
| + var logs bytes.Buffer |
| + host := &macHost{log: slog.New(slog.NewTextHandler(&logs, &slog.HandlerOptions{Level: slog.LevelDebug}))} |
| + out, err := host.run(context.Background(), "/bin/sh", "-c", script, "child", pidFile) |
| + took := time.Since(start) |
| + if raw, rerr := os.ReadFile(pidFile); rerr == nil { |
| + pid, _ = strconv.Atoi(strings.TrimSpace(string(raw))) |
| + } |
| + if pid <= 0 { |
| + t.Fatal("the helper never started") |
| + } |
| + if err != nil || out != "1.2.3\n" || took > 3*time.Second { |
| + t.Fatalf("run answered %q %v after %s", out, err, took.Round(time.Millisecond)) |
| + } |
| + // The leftover is said once, at debug only: it is not a failure. |
| + if l := logs.String(); !strings.Contains(l, "level=DEBUG msg=\"command left a helper holding its output; helper killed\"") || strings.Contains(l, "level=WARN") || strings.Contains(l, "level=ERROR") { |
| + t.Fatalf("the leftover helper was not logged at debug only: %q", l) |
| + } |
| + for deadline := time.Now().Add(2 * time.Second); pid > 0 && grandchildAlive(pid); time.Sleep(20 * time.Millisecond) { |
| + if time.Now().After(deadline) { |
| + t.Fatalf("the helper %d outlived run", pid) |
| + } |
| + } |
| +} |
| + |
| +// grandchildAlive: pid is a live process (not a zombie) running sleep. |
| +func grandchildAlive(pid int) bool { |
| + if syscall.Kill(pid, 0) != nil { |
| + return false |
| + } |
| + if stat, err := os.ReadFile("/proc/" + strconv.Itoa(pid) + "/stat"); err == nil { |
| + if i := strings.LastIndexByte(string(stat), ')'); i > 0 && i+2 < len(stat) && stat[i+2] == 'Z' { |
| + return false |
| + } |
| + } |
| + if cmdline, err := os.ReadFile("/proc/" + strconv.Itoa(pid) + "/cmdline"); err == nil { |
| + return strings.Contains(string(cmdline), "sleep") |
| + } |
| + return true |
| +} |
diff --git a/internal/runner/thin/run.go b/internal/runner/thin/run.go| index abcb88eb..7413aa8c 100644 |
| --- a/internal/runner/thin/run.go |
| +++ b/internal/runner/thin/run.go |
| @@ -5,6 +5,8 @@ import ( |
| "crypto/sha256" |
| "encoding/hex" |
| "errors" |
| + "fmt" |
| + "io/fs" |
| "log/slog" |
| "os" |
| "path/filepath" |
| @@ -21,6 +23,7 @@ import ( |
| "amadan.net/oficina/equipo/internal/runner/containment" |
| "amadan.net/oficina/equipo/internal/runner/mac" |
| "amadan.net/oficina/equipo/internal/runner/provider" |
| + "amadan.net/oficina/equipo/internal/runnerproto" |
| "amadan.net/oficina/equipo/internal/sealbox" |
| "amadan.net/oficina/equipo/internal/wire" |
| ) |
| @@ -114,7 +117,7 @@ func Run(ctx context.Context, c runner.Config, o Options) error { |
| // Ownership first: the state lock, then the scratch and workspace |
| // roots. Only then may recovery touch namespaces or scratch. |
| var manager *containment.Manager |
| - release, err := startup(ctx, c, func(ctx context.Context) error { |
| + release, err := startup(ctx, c, o.Logger, func(ctx context.Context) error { |
| var err error |
| manager, err = containment.New(containment.Config{Binary: c.Bwrap(), RunnerBinary: c.Executable, ScratchRoot: c.ScratchRoot, ProviderNetworks: []provider.NetworkContract{{Provider: "claude"}, {Provider: "codex"}}}) |
| if err != nil { |
| @@ -133,11 +136,7 @@ func Run(ctx context.Context, c runner.Config, o Options) error { |
| return err |
| } |
| defer release() |
| - creds, err := runner.ReadCredentials(filepath.Join(c.StateDir, "credentials.json")) |
| - if err != nil { |
| - return err |
| - } |
| - state, err := OpenState(ctx, c.StateDir) |
| + creds, state, err := openRunner(ctx, c, o.Logger) |
| if err != nil { |
| return err |
| } |
| @@ -154,7 +153,7 @@ func Run(ctx context.Context, c runner.Config, o Options) error { |
| ctx, cancel := context.WithCancel(ctx) |
| defer cancel() |
| platform := hostPlatform() |
| - caps := &Capabilities{Probe: linuxCapabilities(c)} |
| + caps := &Capabilities{Probe: linuxCapabilities(c), Logger: o.Logger} |
| link := &Link{Origin: c.Origin, Token: creds.Bearer.Token, State: state, Logger: o.Logger, Connected: o.Connected, Protocol: o.Protocol, WorkerOnly: platform.OS == "darwin", Role: enrolledRole(c, creds.Bearer.Role)} |
| link.Files = &Files{State: state, SessionRoot: o.Claude.SessionRoot, Logger: o.Logger} |
| // Attachments stay bounded whether or not anything arrives. |
| @@ -368,20 +367,26 @@ const ownerFile = ".equipo-root-owner" |
| // ownership of its scratch and workspace roots, then recovery of what its |
| // own dead processes left (namespaces, then credential copies and other |
| // scratch). A runner refused its roots recovers and deletes nothing. |
| -func startup(ctx context.Context, c runner.Config, recover func(context.Context) error) (func(), error) { |
| +func startup(ctx context.Context, c runner.Config, log *slog.Logger, recover func(context.Context) error) (func(), error) { |
| + done := startPhase(log, "state_lock") |
| lock, err := runner.LockState(c.StateDir) |
| + done(err) |
| if err != nil { |
| return nil, err |
| } |
| + done = startPhase(log, "claim_roots") |
| roots, err := claimRoots(c) |
| + done(err) |
| if err != nil { |
| lock.Close() |
| return nil, err |
| } |
| release := func() { roots(); lock.Close() } |
| + done = startPhase(log, "sweep") |
| if err = recover(ctx); err == nil { |
| err = sweepOrphans(c) |
| } |
| + done(err) |
| if err != nil { |
| release() |
| return nil, err |
| @@ -389,6 +394,59 @@ func startup(ctx context.Context, c runner.Config, recover func(context.Context) |
| return release, nil |
| } |
| +// openRunner reads the runner's credential and opens its state, each a |
| +// logged startup phase. Nothing of the credential is logged. |
| +func openRunner(ctx context.Context, c runner.Config, log *slog.Logger) (runnerproto.CredentialRotation, *State, error) { |
| + done := startPhase(log, "credentials") |
| + creds, err := runner.ReadCredentials(filepath.Join(c.StateDir, "credentials.json")) |
| + done(credentialLogError(err)) |
| + if err != nil { |
| + return creds, nil, err |
| + } |
| + done = startPhase(log, "open_state") |
| + state, err := OpenState(ctx, c.StateDir) |
| + done(err) |
| + return creds, state, err |
| +} |
| + |
| +// credentialLogError is a credential read failure as it may be logged: a |
| +// path, policy or identity error as it is; anything the decoder said |
| +// about the file's content only by its type. |
| +func credentialLogError(err error) error { |
| + var path *fs.PathError |
| + if err == nil || errors.As(err, &path) || errors.Is(err, provider.ErrPolicy) || errors.Is(err, provider.ErrIdentity) { |
| + return err |
| + } |
| + return fmt.Errorf("unreadable credential file (%T)", err) |
| +} |
| + |
| +// startPhase logs a startup phase's start; the function it returns logs |
| +// its end, how long it took and its error. A silent hang at start is |
| +// pinned to the phase that started and never ended. |
| +func startPhase(log *slog.Logger, phase string) func(error) { |
| + if log == nil { |
| + return func(error) {} |
| + } |
| + start := time.Now() |
| + log.Info("startup phase", "phase", phase) |
| + return func(err error) { |
| + if err != nil { |
| + log.Warn("startup phase failed", "phase", phase, "took", took(start), "err", err.Error()) |
| + return |
| + } |
| + log.Info("startup phase done", "phase", phase, "took", took(start)) |
| + } |
| +} |
| + |
| +// took is the time since start, rounded for a log line. |
| +func took(start time.Time) time.Duration { |
| + d := time.Since(start) |
| + if d >= time.Second { |
| + return d.Round(time.Millisecond) |
| + } |
| + return d.Round(time.Microsecond) |
| +} |
| + |
| // prepareRoots claims the roots and sweeps orphans. |
| func prepareRoots(c runner.Config) (func(), error) { |
| release, err := claimRoots(c) |
| @@ -545,23 +603,19 @@ var ErrUpdated = errors.New("runner updated to the instance's release") |
| // runWorker serves the instance as a worker: it runs the steps placed on |
| // it and nothing else (no coordinator, no clone, no forge credential). |
| func runWorker(ctx context.Context, c runner.Config, o Options, platform wire.Platform, w workerSetup) error { |
| - release, err := startup(ctx, c, func(context.Context) error { return nil }) |
| + release, err := startup(ctx, c, o.Logger, func(context.Context) error { return nil }) |
| if err != nil { |
| return err |
| } |
| defer release() |
| - creds, err := runner.ReadCredentials(filepath.Join(c.StateDir, "credentials.json")) |
| - if err != nil { |
| - return err |
| - } |
| - state, err := OpenState(ctx, c.StateDir) |
| + creds, state, err := openRunner(ctx, c, o.Logger) |
| if err != nil { |
| return err |
| } |
| defer state.Close() |
| ctx, cancel := context.WithCancelCause(ctx) |
| defer cancel(nil) |
| - caps := &Capabilities{Probe: w.probe} |
| + caps := &Capabilities{Probe: w.probe, Logger: o.Logger} |
| link := &Link{Origin: c.Origin, Token: creds.Bearer.Token, State: state, Logger: o.Logger, Connected: o.Connected, Protocol: o.Protocol, WorkerOnly: true, Role: enrolledRole(c, creds.Bearer.Role)} |
| link.Hello = func() wire.Hello { |
| report := caps.Get(ctx) |
diff --git a/internal/runner/thin/startup_logs_test.go b/internal/runner/thin/startup_logs_test.go| new file mode 100644 |
| index 00000000..f1bfae02 |
| --- /dev/null |
| +++ b/internal/runner/thin/startup_logs_test.go |
| @@ -0,0 +1,204 @@ |
| +package thin |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "log/slog" |
| + "net" |
| + "net/http" |
| + "os" |
| + "path/filepath" |
| + "strings" |
| + "sync/atomic" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/runner" |
| + "amadan.net/oficina/equipo/internal/runner/mac" |
| + "amadan.net/oficina/equipo/internal/runnerproto" |
| + "amadan.net/oficina/equipo/internal/wire" |
| + "github.com/coder/websocket" |
| +) |
| + |
| +// A Mac worker's start logs each phase at info, in order, through its |
| +// hello and the welcome: a hang shows as a phase that started and never |
| +// ended. The instance's first refusal is logged with its error and the |
| +// wait before the next try, and no line holds the bearer. |
| +func TestWorkerStartupLogs(t *testing.T) { |
| + root := t.TempDir() |
| + c := runner.Config{StateDir: filepath.Join(root, "state"), ScratchRoot: filepath.Join(root, "scratch"), WorkspaceRoot: filepath.Join(root, "work"), Executable: filepath.Join(root, "lib", "equipo-runner")} |
| + if err := os.Mkdir(c.StateDir, 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + const bearer = "bearer-5f2c9a71d04e-never-logged" |
| + credential, _ := json.Marshal(runnerproto.CredentialRotation{Bearer: runnerproto.RunnerCredential{Token: bearer, Role: wire.RoleWorker}}) |
| + if err := os.WriteFile(filepath.Join(c.StateDir, "credentials.json"), credential, 0600); err != nil { |
| + t.Fatal(err) |
| + } |
| + // The Mac's tools, as scripts that print a version; xcodebuild and |
| + // swift (fixed /usr/bin paths) are missing here, so they fail. |
| + bin := filepath.Join(root, "bin") |
| + if err := os.Mkdir(bin, 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + env := map[string]string{} |
| + for name, version := range map[string]string{"node": "v22.12.0", "srt": "0.0.81", "rg": "14.1.1", "claude": "2.1.312", "codex": "0.1.0"} { |
| + p := filepath.Join(bin, name) |
| + if err := os.WriteFile(p, []byte("#!/bin/sh\necho "+version+"\n"), 0700); err != nil { |
| + t.Fatal(err) |
| + } |
| + env["EQUIPO_"+strings.ToUpper(name)+"_PATH"] = p |
| + } |
| + was := macUsers |
| + macUsers = filepath.Join(root, "Users") |
| + defer func() { macUsers = was }() |
| + |
| + var dials atomic.Int32 |
| + conns := make(chan *websocket.Conn, 2) |
| + l, err := net.Listen("tcp", "127.0.0.1:0") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + srv := &http.Server{Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| + if dials.Add(1) == 1 { |
| + http.Error(w, "starting", http.StatusServiceUnavailable) |
| + return |
| + } |
| + if r.URL.Path != wire.StreamPath || r.Header.Get("Authorization") != "Bearer "+bearer { |
| + http.Error(w, "forbidden", http.StatusForbidden) |
| + return |
| + } |
| + ws, err := websocket.Accept(w, r, nil) |
| + if err != nil { |
| + return |
| + } |
| + conns <- ws |
| + <-r.Context().Done() |
| + })} |
| + go srv.Serve(l) |
| + defer srv.Close() |
| + c.Origin = "http://" + l.Addr().String() |
| + |
| + logs := &syncBuffer{} |
| + o := OptionsFromEnv(func(k string) string { return env[k] }) |
| + o.Version, o.Logger = "v-test", slog.New(slog.NewTextHandler(logs, nil)) |
| + h, err := newMacHost(c, o) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + // The probes' verdicts, without running the Mac's probes here. |
| + h.probes.run = func(context.Context) mac.Report { |
| + return mac.Report{Version: "v-test", Profile: mac.ProfileDigest(), At: time.Now(), Probes: probesAll(wire.ProbeDenied)} |
| + } |
| + ctx, cancel := context.WithCancel(context.Background()) |
| + defer cancel() |
| + done := make(chan error, 1) |
| + go func() { done <- serveMac(ctx, c, o, h) }() |
| + |
| + var ws *websocket.Conn |
| + select { |
| + case ws = <-conns: |
| + case <-time.After(15 * time.Second): |
| + t.Fatalf("never connected:\n%s", logs) |
| + } |
| + rctx, rcancel := context.WithTimeout(context.Background(), 10*time.Second) |
| + _, raw, err := ws.Read(rctx) |
| + rcancel() |
| + if f, _, perr := wire.ParseFrame(raw); err != nil || perr != nil || f.Type != wire.FrameHello { |
| + t.Fatalf("no hello: %v %s", err, raw) |
| + } |
| + welcome, _ := wire.NewFrame("i-welcome-1", wire.FrameWelcome, wire.Welcome{Generation: 1, RunnerID: "R1", Protocol: wire.Protocol2, Role: wire.RoleWorker}) |
| + raw, _ = json.Marshal(welcome) |
| + write(t, ws, raw) |
| + // Answer the runner's goodbye at once. |
| + ws.CloseRead(context.Background()) |
| + for deadline := time.Now().Add(10 * time.Second); !strings.Contains(logs.String(), "msg=welcome") || !strings.Contains(logs.String(), `msg="probes finished"`); { |
| + if time.Now().After(deadline) { |
| + t.Fatalf("no welcome or probes line:\n%s", logs) |
| + } |
| + time.Sleep(20 * time.Millisecond) |
| + } |
| + cancel() |
| + if err := <-done; err != nil { |
| + t.Fatalf("worker ended: %v", err) |
| + } |
| + out := logs.String() |
| + t.Logf("a Mac worker's start:\n%s", out) |
| + |
| + host := l.Addr().String() |
| + order := []string{ |
| + `level=INFO msg="startup phase" phase=mac_host`, |
| + `level=INFO msg=command cmd=/usr/bin/xcode-select args=-p took=`, |
| + `level=INFO msg="startup phase done" phase=mac_host took=`, |
| + `level=INFO msg="startup phase" phase=state_lock`, |
| + `level=INFO msg="startup phase done" phase=state_lock took=`, |
| + `level=INFO msg="startup phase" phase=claim_roots`, |
| + `level=INFO msg="startup phase done" phase=claim_roots took=`, |
| + `level=INFO msg="startup phase" phase=sweep`, |
| + `level=INFO msg="startup phase done" phase=sweep took=`, |
| + `level=INFO msg="startup phase" phase=credentials`, |
| + `level=INFO msg="startup phase done" phase=credentials took=`, |
| + `level=INFO msg="startup phase" phase=open_state`, |
| + `level=INFO msg="startup phase done" phase=open_state took=`, |
| + `level=INFO msg=connecting host=` + host + ` protocol=` + itoa(int64(wire.ProtocolCurrent)), |
| + `level=WARN msg="runner stream" err=`, |
| + `level=INFO msg=connecting host=` + host, |
| + `level=INFO msg=connected host=` + host + ` took=`, |
| + `level=INFO msg="capabilities gathering"`, |
| + `level=INFO msg=command cmd=/usr/bin/xcodebuild args=-version took=`, |
| + `level=INFO msg=command cmd=` + env["EQUIPO_NODE_PATH"] + ` args=--version took=`, |
| + `level=INFO msg=command cmd=` + env["EQUIPO_CLAUDE_PATH"] + ` args=--version took=`, |
| + `level=INFO msg="capabilities gathered" took=`, |
| + `level=INFO msg="hello sent" protocol=`, |
| + `level=INFO msg=welcome protocol=2 role=worker generation=1`, |
| + } |
| + if n := strings.Count(out, `level=INFO msg="probes started"`); n != 1 { |
| + t.Fatalf("probes started at info %d times: a run asked for again, verdicts the same, is debug:\n%s", n, out) |
| + } |
| + lines, at := strings.Split(out, "\n"), 0 |
| + for _, want := range order { |
| + for at < len(lines) && !strings.Contains(lines[at], want) { |
| + at++ |
| + } |
| + if at == len(lines) { |
| + t.Fatalf("missing or out of order: %s\n%s", want, out) |
| + } |
| + at++ |
| + } |
| + // The dial failure: the error and the wait before the next try. |
| + if !strings.Contains(out, "503") || !strings.Contains(out, "retry_in=") { |
| + t.Fatalf("the dial failure says neither why nor when:\n%s", out) |
| + } |
| + // A failed command says how; the probes say names and verdicts only. |
| + if !strings.Contains(out, `cmd=/usr/bin/xcodebuild args=-version`) || !strings.Contains(out, `msg="probes started"`) || !strings.Contains(out, `verdicts="P1=passed P2=denied`) { |
| + t.Fatalf("command or probes lines:\n%s", out) |
| + } |
| + if strings.Contains(out, bearer) { |
| + t.Fatalf("a line holds the bearer:\n%s", out) |
| + } |
| +} |
| + |
| +// A command still running after slowCommand is logged while it runs, |
| +// with its arguments (a password's value withheld), and again when it |
| +// ends with how long it took. |
| +func TestMacSlowCommandLogged(t *testing.T) { |
| + was := slowCommand |
| + slowCommand = 50 * time.Millisecond |
| + defer func() { slowCommand = was }() |
| + logs := &syncBuffer{} |
| + h := &macHost{log: slog.New(slog.NewTextHandler(logs, nil))} |
| + if _, err := h.run(context.Background(), "/bin/sh", "-c", "sleep 0.3", "sh", "-w", "hunter2"); err != nil { |
| + t.Fatal(err) |
| + } |
| + out := logs.String() |
| + still, finished := strings.Index(out, `level=WARN msg="command still running" cmd=/bin/sh`), strings.Index(out, `level=WARN msg="slow command finished" cmd=/bin/sh`) |
| + if still < 0 || finished < still || !strings.Contains(out, `args="-c sleep 0.3 sh -w [withheld]"`) || strings.Contains(out, "hunter2") { |
| + t.Fatalf("slow command lines:\n%s", out) |
| + } |
| + // A quick command says nothing. |
| + quiet := &syncBuffer{} |
| + h.log = slog.New(slog.NewTextHandler(quiet, nil)) |
| + if _, err := h.run(context.Background(), "/bin/sh", "-c", "true"); err != nil || quiet.String() != "" { |
| + t.Fatalf("a quick command logged: %v %q", err, quiet.String()) |
| + } |
| +} |
diff --git a/scripts/runner-reference-allowlist.json b/scripts/runner-reference-allowlist.json| index 08a1c17e..ed8eb16c 100644 |
| --- a/scripts/runner-reference-allowlist.json |
| +++ b/scripts/runner-reference-allowlist.json |
| @@ -10354,7 +10354,7 @@ |
| }, |
| { |
| "path": "internal/runner/thin/mac.go", |
| - "line_sha256": "cf8018bd71b2fac45dcea98e9f738fc5b20ae35a34133b27198635cd160a72c4", |
| + "line_sha256": "b26743611f2f5ce41538d4cd3dd9cc0215ce18b9410a5307b973ba30ab7b8bf4", |
| "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." |
| @@ -11037,5 +11037,47 @@ |
| "match": "Node", |
| "count": 1, |
| "reason": "Markdown syntax tree node traversal in the Go renderer; no external runtime." |
| + }, |
| + { |
| + "path": "internal/runner/thin/startup_logs_test.go", |
| + "line_sha256": "704a7f04f7c0889ea6ddcc56fbf48a12285d55adfbd56278f506e3d8c5373685", |
| + "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": "internal/runner/thin/startup_logs_test.go", |
| + "line_sha256": "eefda536b0faad0515e585db2b6dfd12f883f294e75ac964bf608e0de760bc23", |
| + "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/startup_logs_test.go", |
| + "line_sha256": "f2c292ad45f220fb68204b44ed49c974f19dca0ccc9f770eab347ac717833eb1", |
| + "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": "aeb7fbbdabfa876ff3091fb2e4961286eb2c2913fdc59d680bcf81d52e8a17d5", |
| + "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": "aeb7fbbdabfa876ff3091fb2e4961286eb2c2913fdc59d680bcf81d52e8a17d5", |
| + "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/probe_storm_test.go", |
| + "line_sha256": "e9d2fc83d5d2c09493fac24dd1085f051109661785e322c7bd78d24fbedb8a8f", |
| + "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." |
| } |
| ] |