Mac slice F wb fix 2 #5: ready only with P2 denied; counted params
Whole-branch review round 2, finding 5. Every candidate's object scan runs gitleaks under the checks profile P2 proves, so fprobe.Status now takes the trusted P2 verdict: ready only with P2 denied; probes_pending naming P2 while none is trusted, probes_failed naming P2 otherwise. No claude tag, so no Engineering is placed. The Machines page adds runner.engineering.needs_p2 (pending) when the reason names P2. Luna's parameter check: pipe_open and still_running now carry counts, never the descriptors or process names (a forged record or a process name could carry anything); the other flagged parameters carry fixed codes or user short names. Copy JSON notes updated; two new entries (work.step.waiting_publish, runner.engineering.needs_p2) pending (Luna). Budget records raised to their measured sizes. Regressions: TestEngineeringStatusOrder (P2 cases), TestMacEngineeringNeedsP2, TestMachinesSayP2Decides, TestF3AnySourceFails (forged pipes), TestNewProcessesCounted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 files changed,
+158
−32
.rastrillo/budgets.txt+4 −4docs/superpowers/plans/2026-11-28-mac-slice-f-copy.json+14 −2docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+2 −0internal/equipo/copy.go+2 −0internal/equipo/runners.go+5 −0internal/runner/mac/fprobe/fprobe.go+13 −1internal/runner/mac/fprobe/launch_a.go+2 −1internal/runner/mac/fprobe/probe_engineering_test.go+17 −8internal/runner/mac/probe.go+9 −12internal/runner/mac/wbfix2_test.go+11 −0internal/runner/thin/mac_fprobe.go+5 −1internal/runner/thin/mac_fprobe_test.go+8 −3internal/runner/thin/wbfix2_ready_test.go+66 −0
CI failed — run details
CI log
=== prepare ===
ci-box: machine: aarch64, 32 CPUs, 62 GiB memory, kernel 7.0.0-1017-aws
ci-box: python 3.12.3; Docker version 29.1.3, build 29.1.3-0ubuntu3~24.04.2
ci-box: user namespaces allowed: 233151
ci-box: cgroup: cgroup2fs
ci-box: disk /home/ci/work/repos/oficina__equipo/wt/mac-slice-f: Type Size Avail | ext4 96G 84G
ci-box: disk /home/ci/.cache/equipo-ci-box: Type Size Avail | ext4 96G 84G
ci-box: bwrap: fetched and verified in 0.4s
ci-box: image pulled in 9.9s
ci-box: claude: fetched and verified in 13.4s
ci-box: codex: fetched and verified in 4.2s
ci-box: codex-code-mode-host: fetched and verified in 1.7s
ci-box: libwrap: fetched and verified in 0.4s
ci-box: socat: fetched and verified in 0.4s
npm warn deprecated node-domexception@1.0.0: Use your platform's native DOMException instead
ci-box: pi: installed and verified in 7.0s
ci-box: opencode: installed and verified in 2.3s
ci-box: chromium 156.0.8078.79-1~deb13u1: 76 packages fetched, verified and unpacked in 8.8s
ci-box: clone deepened in 7.4s
ci-box: file times set from content: 3524 files, 224 directories
ci-box: ready in 30.6s
=== copy ===
EQUIPO_RELEASE_COPY_CHECK=1 CGO_ENABLED=0 go test ./internal/equipotest -run '^TestReleaseCopyReviewed$' -count=1
--- FAIL: TestReleaseCopyReviewed (0.09s)
task_pages_test.go:236: COPY REVIEW REQUIRED: copy-status.py verify found copy pending review or stale bookkeeping
FAIL
rastrillo-budget/v1 ran 90ms
FAIL amadan.net/oficina/equipo/internal/equipotest 0.247s
FAIL
make: *** [Makefile:260: copy-release-check] Error 1
amadan: step copy failed: exit status 2
amadan: job failed at step copy — its output is above, not at the tail of this log
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index 74c617e7..e0a548e0 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -14,7 +14,7 @@ perf GET /* skip Unknown private paths render 404; this fallback contains no scr |
| time internal/equipo/team 60s Plan 3 loaded CI measured 45.985s; niced serial reruns measured 18.079s and 22.031s. Keep migration, recovery, accounting and concurrency assertions; 60s leaves 30 percent headroom above loaded CI. |
| time internal/equipotest 300s Final fix package rerun measured 187.035s (review 172.4s); 300s gives 60 percent headroom for HTTP, sandbox, authority and final regression coverage. |
| -size internal/equipo 24597 - Preview, retry, merges, kept work, check-db, notifications, places, GitHub routes, installer, abilities, lookups, Mac waits, slice F codes, D1, probe details; measured 24597. |
| +size internal/equipo 24608 - Preview, retry, merges, kept work, check-db, notifications, places, GitHub routes, installer, abilities, lookups, Mac waits, slice F codes, D1, probe details; measured 24608. |
| size internal/wire 9214 - Protocols 31 to 35 (facts, diffs, evidence, CI units, files, places), abilities, 36 lookups, 37 Mac Engineering, unproven and probe detail codes; measured 9214. |
| size internal/equipotest - 12683 GitHub connect value search, lifecycle and sweep-log contracts; Task 21 migration fixtures and Rastrillo asset contract; measured 0/12683 source/test lines. |
| time internal/runner/checks 90s CI worker measured 44.553s (44.6s rounded); |
| @@ -38,7 +38,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; |
| -size internal/runner/thin 34711 31857 Protocols 31 to 35, merge credential, publication guards, kept work, scans, 36 lookups; Mac pin, Engineering, asks, F probes, D1, pack bound; 34711/31857. |
| +size internal/runner/thin 34715 31928 Protocols 31 to 35, merge credential, publication guards, kept work, scans, 36 lookups; Mac pin, Engineering, asks, F probes, D1, pack bound, P2 readiness; 34715/31928. |
| time internal/thintest 240s Thin contract and page tests, the Assistant's and the models' included, share one harness. Measured 202s on a shared 16 CPU box (2026-11-13); CI runs two lanes. |
| time internal/runner/mac 45s Real processes killed and proven gone: groups, sessions, the runner-user sweep, turns, restarts; probes end to end. Measured 29.3s locally. |
| 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). |
| @@ -57,7 +57,7 @@ perf GET /api/v1/assistant/snapshot skip Assistant person API: bearer-only JSON |
| perf GET /api/v1/assistant/messages skip Assistant person API: bearer-only JSON for Base's chat, not a browser screen. |
| perf GET /api/v1/assistant/events skip Assistant event stream (Server-Sent Events), bearer-only and long-lived; not a screen. |
| perf GET /api/v1/assistant/abilities skip Assistant person API: bearer-only JSON for Base's Settings line, not a browser screen. |
| -size internal/equipo/chat 42927 14841 File facts/diffs, previews, merges, unfinished work, CI, receipts, Assistant files, places, abilities, lookups, go-aheads, Mac work, D1, replaced primaries; 42927/14841. |
| +size internal/equipo/chat 42988 14841 File facts/diffs, previews, merges, unfinished work, CI, receipts, Assistant files, places, abilities, lookups, go-aheads, Mac work, D1, replaced primaries, unpublished commits; 42988/14841. |
| perf GET /api/v1/questions/{id} skip Thin v1 person API: bearer-only JSON for devices; the browser reads questions on /tasks/{id}. |
| perf GET /api/v1/steps/{id}/log skip Thin v1 person API: bearer-only JSON for devices; the browser shows the log tail on /tasks/{id}. |
| perf GET /api/v1/connections/preference skip Connections slice 1 person API: bearer-only JSON for devices; the browser shows the preference on /conversation/connections. |
| @@ -72,7 +72,7 @@ perf GET /tasks/{id}/files/{file} skip Research kept images: the bytes of one im |
| perf GET /api/v1/runners skip Mac runners person API: bearer-only JSON for devices; the browser shows runners in the Team section. |
| time cmd/equipo-runner 60s TestReleaseRunnerHasNoFakeWorker builds the release runner and the thin package under testbuild (about 12s locally). |
| size internal/headless - 13400 Grant scenarios (#48); sign-in email at 1280 and 390; Assistant files; restart wait; live site waits; card answer; scenario 7; Mac M9, mixed versions; 13400. |
| -size internal/thintest - 41821 Protocol 31 contracts, 35 diffs, stuck tasks, merges, retries, unfinished work, previews, places, abilities, lookups, go-aheads, Mac Engineering, conns, D1, held reports; 41821. |
| +size internal/thintest - 41926 Protocol 31 contracts, 35 diffs, stuck tasks, merges, retries, unfinished work, previews, places, abilities, lookups, go-aheads, Mac Engineering, conns, D1, held reports, commits between primaries; 41926. |
| perf GET /api/v1/projects/{id}/merge-policy skip Merge authority person API: bearer-only JSON for devices; the browser reads the policy on /projects/{id}. |
| perf GET /api/v1/usage skip Thin v1 person API: bearer-only JSON for devices; the browser reads usage through /usage. |
diff --git a/docs/superpowers/plans/2026-11-28-mac-slice-f-copy.json b/docs/superpowers/plans/2026-11-28-mac-slice-f-copy.json| index 5c8f3dc0..af2a2e91 100644 |
| --- a/docs/superpowers/plans/2026-11-28-mac-slice-f-copy.json |
| +++ b/docs/superpowers/plans/2026-11-28-mac-slice-f-copy.json |
| @@ -649,7 +649,7 @@ |
| }, |
| { |
| "key": "runner.probe_detail.pipe_open", |
| - "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code pipe_open). F3: descriptors open in Bash; %s lists their numbers.", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code pipe_open). F3: descriptors open in Bash; %s is how many (a count, never the descriptors).", |
| "draft": "A pipe was open in commands Claude ran: %s.", |
| "reviewed": "pending (Luna)" |
| }, |
| @@ -979,7 +979,7 @@ |
| }, |
| { |
| "key": "runner.probe_detail.still_running", |
| - "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code still_running). P6: new process names; %s lists them.", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code still_running). P6: %s is how many processes appeared (a count, never their names).", |
| "draft": "Still running: %s.", |
| "reviewed": "pending (Luna)" |
| }, |
| @@ -1024,5 +1024,17 @@ |
| "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code srt_cannot_run). P7: srt failed to run /usr/bin/true.", |
| "draft": "srt could not run a command.", |
| "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "work.step.waiting_publish", |
| + "where": "Task page, an Engineering step's line after \"Made on <Mac>\": the Mac's commit arrived while there was no main runner (primary) to publish it; the step waits (waiting_runner) until one connects, which then publishes it.", |
| + "draft": "Waiting for your main runner to publish it", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.engineering.needs_p2", |
| + "where": "Machines page, a Mac's \"Makes changes\" line, added after runner.engineering.probes_failed or probes_pending when the reason names P2: every change Claude makes on the Mac is scanned for secrets under the checks sandbox P2 proves, so Engineering waits for P2 denied.", |
| + "draft": "Changes made here are scanned for secrets in its checks sandbox, so that self-check (P2) must pass first.", |
| + "reviewed": "pending (Luna)" |
| } |
| ] |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index 17259cb0..8cd718c9 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -7190,6 +7190,8 @@ records remain unchanged. |
| | `runner.probe_detail.tool_version` | %s %s. | Copy specialist | COPY REVIEW PENDING | |
| | `runner.probe_detail.node_old` | Node is older than 22.12. | Copy specialist | COPY REVIEW PENDING | |
| | `runner.probe_detail.srt_cannot_run` | srt could not run a command. | Copy specialist | COPY REVIEW PENDING | |
| +| `work.step.waiting_publish` | Waiting for your main runner to publish it | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.engineering.needs_p2` | Changes made here are scanned for secrets in its checks sandbox, so that self-check (P2) must pass first. | Copy specialist | COPY REVIEW PENDING | |
| ## Task 21 |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index 85a0e760..65a61b6e 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -2689,8 +2689,10 @@ var pageCopy = map[string]string{ |
| // Mac Engineering (slice F, plan task 15): D1 and the views. |
| "work.step.made_on": "Made on %s", // COPY REVIEW PENDING |
| "work.step.no_xcode": "Built and tested by the Mac's checks, not while making the change", // COPY REVIEW PENDING |
| + "work.step.waiting_publish": "Waiting for your main runner to publish it", // COPY REVIEW PENDING |
| "work.step.waiting_base": "Getting the project ready to send to %s", // COPY REVIEW PENDING |
| "runner.engineering": "Makes changes", // COPY REVIEW PENDING |
| + "runner.engineering.needs_p2": "Changes made here are scanned for secrets in its checks sandbox, so that self-check (P2) must pass first.", // COPY REVIEW PENDING |
| "runner.engineering.ready": "Yes", // COPY REVIEW PENDING |
| "runner.engineering.no_connection": "Not yet: it has no Claude connection", // COPY REVIEW PENDING |
| "runner.engineering.signed_out": "Not now: Claude is signed out on this Mac", // COPY REVIEW PENDING |
diff --git a/internal/equipo/runners.go b/internal/equipo/runners.go| index 6f9670b3..e461c2d6 100644 |
| --- a/internal/equipo/runners.go |
| +++ b/internal/equipo/runners.go |
| @@ -7,6 +7,7 @@ import ( |
| "encoding/json" |
| "errors" |
| "fmt" |
| + "slices" |
| "strings" |
| "time" |
| @@ -384,6 +385,10 @@ func macGuards(r *setup.RunnerReport, c wire.Capabilities) { |
| return |
| } |
| r.Engineering, r.EngineeringState = copyText("runner.engineering."+e.State), e.State |
| + if (e.State == wire.EngineeringProbesFailed || e.State == wire.EngineeringProbesPending) && slices.Contains(strings.Fields(e.Reason), "P2") { |
| + // Every change is scanned for secrets in P2's sandbox. |
| + r.Engineering += " " + copyText("runner.engineering.needs_p2") |
| + } |
| if c.RunnerUser == "" { |
| return |
| } |
diff --git a/internal/runner/mac/fprobe/fprobe.go b/internal/runner/mac/fprobe/fprobe.go| index 284aab79..67c68713 100644 |
| --- a/internal/runner/mac/fprobe/fprobe.go |
| +++ b/internal/runner/mac/fprobe/fprobe.go |
| @@ -290,11 +290,15 @@ type State struct { |
| // Conn is "" while a Claude connection is usable, else the |
| // connection state that says why not (ConnState). |
| Conn, ConnReason string |
| + // P2 is the trusted P2 verdict ("" while none is trusted): the |
| + // object scan's gitleaks runs under the checks profile P2 proves. |
| + P2 string |
| } |
| // Status is Engineering's status on this Mac: ready when the guards |
| // pass, the pinned CLI verifies, F1 to F4, F6 and F7 reached their |
| -// success verdicts for the current inputs and a Claude connection is |
| +// success verdicts for the current inputs, P2 is denied (the object |
| +// scan's sandbox; P2 named otherwise) and a Claude connection is |
| // usable; otherwise the first thing missing, in this order: the guards |
| // (they last), the CLI, a probe that failed (no connection fixes it), the |
| // connection (the probes need one), the probes not yet proven. |
| @@ -315,6 +319,14 @@ func Status(s State) wire.EngineeringStatus { |
| pending = append(pending, id) |
| } |
| } |
| + // The object scan's sandbox: P2 denied, or nothing leaves the Mac. |
| + switch s.P2 { |
| + case wire.ProbeDenied: |
| + case "": |
| + pending = append(pending, "P2") |
| + default: |
| + failed = append(failed, "P2") |
| + } |
| switch { |
| case len(failed) > 0: |
| return wire.EngineeringStatus{State: wire.EngineeringProbesFailed, Reason: strings.Join(failed, " ")} |
diff --git a/internal/runner/mac/fprobe/launch_a.go b/internal/runner/mac/fprobe/launch_a.go| index fbddb687..03d2e193 100644 |
| --- a/internal/runner/mac/fprobe/launch_a.go |
| +++ b/internal/runner/mac/fprobe/launch_a.go |
| @@ -788,7 +788,8 @@ func (a *aRun) f3(found map[string][]string, whole bool, forms [][]byte, secretE |
| case len(f) != 3 || f[0] != "denied" || !strings.HasPrefix(f[2], "pipes=") || status("fds") != "0": |
| unshown = append(unshown, "fds") |
| case f[2] != "pipes=-": |
| - problems = append(problems, wire.ProbeDetail("pipe_open", strings.TrimPrefix(f[2], "pipes="))) |
| + // How many, never the record's values. |
| + problems = append(problems, wire.ProbeDetail("pipe_open", strconv.Itoa(len(strings.Split(strings.TrimPrefix(f[2], "pipes="), ","))))) |
| } |
| var scratch, inTree []string |
| for _, k := range []string{"secret", "token-shape"} { |
diff --git a/internal/runner/mac/fprobe/probe_engineering_test.go b/internal/runner/mac/fprobe/probe_engineering_test.go| index 7f93b721..ed6081ee 100644 |
| --- a/internal/runner/mac/fprobe/probe_engineering_test.go |
| +++ b/internal/runner/mac/fprobe/probe_engineering_test.go |
| @@ -711,7 +711,9 @@ func TestF3AnySourceFails(t *testing.T) { |
| }{ |
| {"backstop: a token in the scratch", cli{sh: shell{rec: rec, files: map[string]string{"out/x": "x=" + base64.StdEncoding.EncodeToString([]byte(fakeToken)) + "\n"}}, out: ok}, nil, "token_reached_scratch:x"}, |
| {"backstop: a token shape", cli{sh: shell{rec: rec, files: map[string]string{"out/y": "sk-ant-oat01-someone-elses\n"}}, out: ok}, nil, "token_reached_scratch:y"}, |
| - {"pipe descriptor", cli{sh: shell{rec: rec, f3: map[string]string{"fds": "fds denied n=4 pipes=3"}}, out: ok}, nil, "pipe_open:3"}, |
| + // Whole-branch fix 2 (Luna's check): a count, never the values. |
| + {"pipe descriptor", cli{sh: shell{rec: rec, f3: map[string]string{"fds": "fds denied n=4 pipes=3"}}, out: ok}, nil, "pipe_open:1"}, |
| + {"pipe descriptors forged", cli{sh: shell{rec: rec, f3: map[string]string{"fds": "fds denied n=4 pipes=3,sk-ant-forged"}}, out: ok}, nil, "pipe_open:2"}, |
| {"descriptors cut short", cli{sh: shell{rec: rec, f3: map[string]string{"fds": "fds denied"}}, out: ok}, nil, "not_shown_tried:fds"}, |
| {"reader did not run", cli{sh: shell{rec: rec, f3: map[string]string{"cli": "", "cli.rc": "cli.rc 126"}}, out: ok}, nil, "procargs_not_sandboxed"}, |
| {"reader cut short", cli{sh: shell{rec: rec, f3: map[string]string{"cli": "cli denied", "cli.rc": "cli.rc 0"}}, out: ok}, nil, "procargs_incomplete"}, |
| @@ -1296,7 +1298,9 @@ func allPassed(in Inputs, at time.Time) []Result { |
| return out |
| } |
| -func readyState(probes []wire.Probe) State { return State{CLI: true, Probes: probes} } |
| +func readyState(probes []wire.Probe) State { |
| + return State{CLI: true, Probes: probes, P2: wire.ProbeDenied} |
| +} |
| // Each launch's result counts only for the inputs it ran under and for |
| // under a day: a stale launch A beside a fresh launch C is not ready. |
| @@ -1450,17 +1454,22 @@ func TestEngineeringStatusOrder(t *testing.T) { |
| s State |
| want wire.EngineeringStatus |
| }{ |
| - {"ready", State{CLI: true, Probes: passed}, wire.EngineeringStatus{State: wire.EngineeringReady}}, |
| - {"F5 does not decide", State{CLI: true, Probes: noF5}, wire.EngineeringStatus{State: wire.EngineeringReady}}, |
| + {"ready", State{CLI: true, Probes: passed, P2: wire.ProbeDenied}, wire.EngineeringStatus{State: wire.EngineeringReady}}, |
| + {"F5 does not decide", State{CLI: true, Probes: noF5, P2: wire.ProbeDenied}, wire.EngineeringStatus{State: wire.EngineeringReady}}, |
| + // Whole-branch fix 2, #5: the scanner's sandbox is P2's. |
| + {"P2 not run", State{CLI: true, Probes: passed}, wire.EngineeringStatus{State: wire.EngineeringProbesPending, Reason: "P2"}}, |
| + {"P2 not denied", State{CLI: true, Probes: passed, P2: wire.ProbeFailed}, wire.EngineeringStatus{State: wire.EngineeringProbesFailed, Reason: "P2"}}, |
| + {"P2 unavailable", State{CLI: true, Probes: passed, P2: wire.ProbeUnavailable}, wire.EngineeringStatus{State: wire.EngineeringProbesFailed, Reason: "P2"}}, |
| + {"F2 and P2", State{CLI: true, Probes: failedF2, P2: wire.ProbeFailed}, wire.EngineeringStatus{State: wire.EngineeringProbesFailed, Reason: "F2 P2"}}, |
| {"tainted first", State{Guards: tainted, Probes: failedF2, Conn: wire.EngineeringNoConnection}, *tainted}, |
| {"home open", State{Guards: home, Probes: failedF2}, *home}, |
| {"cli", State{Probes: failedF2, Conn: wire.EngineeringNoConnection}, wire.EngineeringStatus{State: wire.EngineeringCLIUnpinned}}, |
| {"failed before the connection", State{CLI: true, Probes: failedF2, Conn: wire.EngineeringNoConnection}, wire.EngineeringStatus{State: wire.EngineeringProbesFailed, Reason: "F2"}}, |
| - {"no connection", State{CLI: true, Probes: passed, Conn: wire.EngineeringNoConnection}, wire.EngineeringStatus{State: wire.EngineeringNoConnection}}, |
| + {"no connection", State{CLI: true, Probes: passed, Conn: wire.EngineeringNoConnection, P2: wire.ProbeDenied}, wire.EngineeringStatus{State: wire.EngineeringNoConnection}}, |
| {"connection before pending", State{CLI: true, Probes: pendingF4, Conn: wire.EngineeringLimited}, wire.EngineeringStatus{State: wire.EngineeringLimited}}, |
| - {"signed out", State{CLI: true, Probes: passed, Conn: wire.EngineeringSignedOut}, wire.EngineeringStatus{State: wire.EngineeringSignedOut}}, |
| - {"pending", State{CLI: true, Probes: pendingF4}, wire.EngineeringStatus{State: wire.EngineeringProbesPending, Reason: "F4"}}, |
| - {"nothing run", State{CLI: true}, wire.EngineeringStatus{State: wire.EngineeringProbesPending, Reason: "F1 F2 F3 F4 F6 F7"}}, |
| + {"signed out", State{CLI: true, Probes: passed, Conn: wire.EngineeringSignedOut, P2: wire.ProbeDenied}, wire.EngineeringStatus{State: wire.EngineeringSignedOut}}, |
| + {"pending", State{CLI: true, Probes: pendingF4, P2: wire.ProbeDenied}, wire.EngineeringStatus{State: wire.EngineeringProbesPending, Reason: "F4"}}, |
| + {"nothing run", State{CLI: true}, wire.EngineeringStatus{State: wire.EngineeringProbesPending, Reason: "F1 F2 F3 F4 F6 F7 P2"}}, |
| } { |
| if got := Status(c.s); got != c.want { |
| t.Fatalf("%s: %+v, want %+v", c.name, got, c.want) |
diff --git a/internal/runner/mac/probe.go b/internal/runner/mac/probe.go| index 8cf29498..aa5a67f6 100644 |
| --- a/internal/runner/mac/probe.go |
| +++ b/internal/runner/mac/probe.go |
| @@ -686,8 +686,9 @@ func probeP6(ctx context.Context, h ProbeHost, caps wire.Capabilities, srtRan bo |
| parts = append(parts, wire.ProbeDetail("group_unproven")) |
| } |
| parts = append(parts, wire.ProbeDetail("marked_left", strconv.Itoa(len(left)))) |
| - if n := newNames(before, after); len(n) > 0 { |
| - parts = append(parts, wire.ProbeDetail("still_running", strings.Join(n, " "))) |
| + if n := newNames(before, after); n > 0 { |
| + // How many, never their names (a path, or what a process chose). |
| + parts = append(parts, wire.ProbeDetail("still_running", strconv.Itoa(n))) |
| } |
| parts = append(parts, wire.ProbeDetail("simulators_shut", strconv.Itoa(int(shut.Load())))) |
| parts = append(parts, wire.ProbeDetail(map[bool]string{true: "tree_removed", false: "tree_not_removable"}[removed])) |
| @@ -722,18 +723,14 @@ func processNames(ctx context.Context, x Exec) map[string]int { |
| return names |
| } |
| -func newNames(before, after map[string]int) []string { |
| - var out []string |
| - for n, c := range after { |
| - if c > before[n] { |
| - out = append(out, n) |
| +// newNames is how many process names are new or more numerous after. |
| +func newNames(before, after map[string]int) (n int) { |
| + for name, c := range after { |
| + if c > before[name] { |
| + n++ |
| } |
| } |
| - sort.Strings(out) |
| - if len(out) > 8 { |
| - out = append(out[:8], "and more") |
| - } |
| - return out |
| + return n |
| } |
| func probeP7(ctx context.Context, h ProbeHost) wire.Probe { |
diff --git a/internal/runner/mac/wbfix2_test.go b/internal/runner/mac/wbfix2_test.go| index c7c925d0..3ca59021 100644 |
| --- a/internal/runner/mac/wbfix2_test.go |
| +++ b/internal/runner/mac/wbfix2_test.go |
| @@ -126,3 +126,14 @@ func TestFailedCleanupClearsAfterAReboot(t *testing.T) { |
| t.Fatal("the reboot's completion was not kept for the next consumer") |
| } |
| } |
| + |
| +// Whole-branch fix 2 (Luna's check of the detail parameters): P6 says |
| +// how many processes appeared, never their names (a name can be a path |
| +// or anything a process chose). |
| +func TestNewProcessesCounted(t *testing.T) { |
| + before := map[string]int{"launchd": 1, "Finder": 1} |
| + after := map[string]int{"launchd": 1, "Finder": 2, "sk-ant-oat01-forged": 1, "xcodebuild": 1} |
| + if n := newNames(before, after); n != 3 { |
| + t.Fatalf("%d new", n) |
| + } |
| +} |
diff --git a/internal/runner/thin/mac_fprobe.go b/internal/runner/thin/mac_fprobe.go| index d13899eb..7cf5520f 100644 |
| --- a/internal/runner/thin/mac_fprobe.go |
| +++ b/internal/runner/thin/mac_fprobe.go |
| @@ -171,7 +171,11 @@ func (e *macEngineering) decide(caps *wire.Capabilities) (wire.EngineeringStatus |
| verified := caps.Harness.Claude != "" |
| probes := e.store.Probes(fprobe.NewInputs(e.h.version, verified, caps.Xcode, caps.Simulators), e.clock(), e.p2()) |
| conn, why := e.conn(caps) |
| - return fprobe.Status(fprobe.State{Guards: caps.Engineering, CLI: verified, Probes: probes, Conn: conn, ConnReason: why}), probes |
| + p2 := "" |
| + if r, ok := e.h.probes.trusted(); ok { |
| + p2 = r.Probe("P2").Verdict |
| + } |
| + return fprobe.Status(fprobe.State{Guards: caps.Engineering, CLI: verified, Probes: probes, Conn: conn, ConnReason: why, P2: p2}), probes |
| } |
| // xcode: F5 is denied as the newest capability report says it. |
diff --git a/internal/runner/thin/mac_fprobe_test.go b/internal/runner/thin/mac_fprobe_test.go| index 4d83bf3e..3118da73 100644 |
| --- a/internal/runner/thin/mac_fprobe_test.go |
| +++ b/internal/runner/thin/mac_fprobe_test.go |
| @@ -218,13 +218,17 @@ func TestMacEngineeringStatusInCaps(t *testing.T) { |
| t.Fatalf("probes %+v", c.Probes) |
| } |
| h.eng.bind(x.w, x.conns, nil) |
| - c = report(nil) |
| - if *c.Engineering != (wire.EngineeringStatus{State: wire.EngineeringReady}) || !slices.Contains(c.Tags, wire.TagClaude) { |
| - t.Fatalf("ready: %+v %v", c.Engineering, c.Tags) |
| + if c = report(nil); *c.Engineering != (wire.EngineeringStatus{State: wire.EngineeringProbesPending, Reason: "P2"}) { |
| + t.Fatalf("no trusted P2: %+v", c.Engineering) |
| } |
| if h.eng.xcode() { |
| t.Fatal("Xcode access without P2 denied: F5 is skipped") |
| } |
| + h.probes.last = mac.Report{Version: "v-test", Profile: mac.ProfileDigest(), At: time.Now(), SRT: srtPinned, Probes: []wire.Probe{{ID: "P2", Verdict: wire.ProbeDenied}}} |
| + c = report(nil) |
| + if *c.Engineering != (wire.EngineeringStatus{State: wire.EngineeringReady}) || !slices.Contains(c.Tags, wire.TagClaude) { |
| + t.Fatalf("ready: %+v %v", c.Engineering, c.Tags) |
| + } |
| for _, cs := range []struct { |
| name string |
| mut func(*wire.Capabilities) |
| @@ -322,6 +326,7 @@ func TestMacEngineeringRevalidates(t *testing.T) { |
| } |
| h.eng.bind(x.w, x.conns, nil) |
| ctx := context.Background() |
| + h.probes.last = mac.Report{Version: "v-test", Profile: mac.ProfileDigest(), At: now, SRT: srtPinned, Probes: []wire.Probe{{ID: "P2", Verdict: wire.ProbeDenied}}} |
| if st := h.eng.statusNow(ctx); st == nil || st.State != wire.EngineeringReady { |
| t.Fatalf("ready now: %+v", st) |
| } |
diff --git a/internal/runner/thin/wbfix2_ready_test.go b/internal/runner/thin/wbfix2_ready_test.go| new file mode 100644 |
| index 00000000..29acbe96 |
| --- /dev/null |
| +++ b/internal/runner/thin/wbfix2_ready_test.go |
| @@ -0,0 +1,66 @@ |
| +//go:build testbuild |
| + |
| +package thin |
| + |
| +import ( |
| + "context" |
| + "slices" |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/runner/mac" |
| + "amadan.net/oficina/equipo/internal/runner/mac/fprobe" |
| + "amadan.net/oficina/equipo/internal/runner/provider" |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// Whole-branch fix 2, #5: every candidate's object scan runs gitleaks |
| +// under the checks profile P2 proves, so a Mac is ready for Engineering |
| +// only with P2 denied: with F1 to F7 passed and P2 not run or not |
| +// denied it says so (P2 named) and carries no claude tag, so the |
| +// instance places no Engineering there. |
| +func TestMacEngineeringNeedsP2(t *testing.T) { |
| + x := newEngRig(t) |
| + h := &macHost{version: "v-test", probes: newMacProbes("v-test", "", nil, func() bool { return true }), creds: x.m, taint: x.m.taint, turns: x.m.turns} |
| + h.eng = newMacEngineering(h) |
| + sims := []wire.Simulator{{Name: "iPhone 17 Pro", Runtime: "iOS 27.2", UDID: "ABCDEF01-2345-6789-ABCD-EF0123456789", State: "Shutdown"}} |
| + xcode := wire.Xcode{Version: "27.2", Build: "27B52"} |
| + now := time.Now() |
| + h.eng.now = func() time.Time { return now } |
| + in := fprobe.NewInputs("v-test", true, xcode, sims) |
| + for _, l := range fprobe.Launches { |
| + r := fprobe.Result{Launch: l, Inputs: in, At: now} |
| + for _, id := range wire.EngineeringProbeIDs { |
| + if fprobe.LaunchOf(id) == l { |
| + r.Probes = append(r.Probes, wire.Probe{ID: id, Verdict: wire.EngineeringProbeSuccess(id), Detail: wire.ProbeDetail("f1_denied")}) |
| + } |
| + } |
| + h.eng.store.Put(r) |
| + } |
| + h.eng.bind(x.w, x.conns, nil) |
| + live := wire.Capabilities{Tags: []string{wire.TagMacOS, wire.TagXcode}, Simulators: sims, Xcode: xcode, Harness: wire.Harness{Claude: provider.ClaudeVersion}} |
| + h.eng.live = func(context.Context) wire.Capabilities { return live } |
| + compose := func() wire.Capabilities { |
| + c := live |
| + c.Tags = slices.Clone(live.Tags) |
| + h.eng.compose(&c) |
| + if err := wire.ValidCapabilities(c); err != nil { |
| + t.Fatal(err) |
| + } |
| + return c |
| + } |
| + if c := compose(); *c.Engineering != (wire.EngineeringStatus{State: wire.EngineeringProbesPending, Reason: "P2"}) || slices.Contains(c.Tags, wire.TagClaude) { |
| + t.Fatalf("P2 not run: %+v %v", c.Engineering, c.Tags) |
| + } |
| + h.probes.last = mac.Report{Version: "v-test", Profile: mac.ProfileDigest(), At: now, SRT: srtPinned, Probes: []wire.Probe{{ID: "P2", Verdict: wire.ProbeFailed}}} |
| + if c := compose(); *c.Engineering != (wire.EngineeringStatus{State: wire.EngineeringProbesFailed, Reason: "P2"}) || slices.Contains(c.Tags, wire.TagClaude) { |
| + t.Fatalf("P2 not denied: %+v %v", c.Engineering, c.Tags) |
| + } |
| + if st := h.eng.statusNow(context.Background()); st.State == wire.EngineeringReady { |
| + t.Fatalf("ready at use with P2 not denied: %+v", st) |
| + } |
| + h.probes.last.Probes[0].Verdict = wire.ProbeDenied |
| + if c := compose(); *c.Engineering != (wire.EngineeringStatus{State: wire.EngineeringReady}) || !slices.Contains(c.Tags, wire.TagClaude) { |
| + t.Fatalf("P2 denied: %+v %v", c.Engineering, c.Tags) |
| + } |
| +} |