Mac slice F wb fix 1 #6: probe details as codes, worded from copy.go
Whole-branch review round 1, finding 6. A probe's detail is now structured (wire.ProbeDetail): parts of a code from wire.ProbeDetailCodes and its parameters (names, counts, versions), never words. fprobe (F1 to F7: store states, launch outcomes, every finding and pass summary) and probe.go (P1 to P7) send only codes; P2's failed srt run names its steps, and the xcodebuild output goes only to the runner log. The instance words each part from a new runner.probe_detail.<code> key in copy.go and shows nothing a runner sent as free text. The 110 keys are marked pending and listed in the slice F copy JSON as pending (Luna). Budgets: mac back under 5000 (clean() and the said/gone helpers compacted); the equipo, wire, thin, chat and thintest records raised to their measured sizes for this wave. Tests: TestProbeDetailCoded (wire), TestProbeDetailCodes (instance, every code worded with one %s per parameter, pending, listed), TestStoreDetailsAreCoded and coded() in fprobe's runA and want, TestProbeDetailsCoded (P probes); old prose expectations moved to codes. Mutations: free text shown again, an F or P detail back to words, arity ignored, separators kept in a parameter; each fails a named test. Process note: the wire helpers came before their test (recorded in the report), each guard backed by a mutation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 files changed,
+1,532
−372
.rastrillo/budgets.txt+5 −5docs/superpowers/plans/2026-11-28-mac-slice-f-copy.json+660 −0docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md+110 −0internal/equipo/copy.go+120 −10internal/equipo/mac_view_test.go+50 −4internal/equipo/runners.go+15 −6internal/runner/mac/fprobe/fprobe.go+10 −10internal/runner/mac/fprobe/launch_a.go+47 −47internal/runner/mac/fprobe/launch_bc.go+30 −28internal/runner/mac/fprobe/probe_engineering_test.go+112 −98internal/runner/mac/fprobe/run.go+17 −26internal/runner/mac/fprobe/wbfix1_test.go+51 −0internal/runner/mac/p2token_test.go+3 −3internal/runner/mac/p2why_test.go+11 −11internal/runner/mac/probe.go+68 −102internal/runner/mac/probe_test.go+11 −11internal/runner/mac/usertemp_test.go+1 −1internal/runner/mac/wbfix1_probe_test.go+42 −0internal/runner/thin/fakeworker_testbuild.go+3 −3internal/runner/thin/mac_fprobe_test.go+4 −4internal/runner/thin/mac_stall_test.go+2 −2internal/thintest/fakerunner.go+1 −1internal/wire/probe_detail.go+115 −0internal/wire/probe_detail_test.go+44 −0
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt| index bb6478c9..74c617e7 100644 |
| --- a/.rastrillo/budgets.txt |
| +++ b/.rastrillo/budgets.txt |
| @@ -14,8 +14,8 @@ 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 24478 - Preview, retry, merges, kept work, check-db, notifications, places, GitHub routes, installer, abilities, lookups, Mac waits, slice F codes, D1; measured 24478. |
| -size internal/wire 9099 - Protocols 31 to 35 (facts, diffs, evidence, CI units, files, places), abilities, 36 lookups, 37 Mac Engineering, unproven codes; measured 9099. |
| +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/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); |
| time internal/runner 330s Plan 3 CI repair measured 292.120s for the full package (controller CI 472.184s). |
| @@ -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 34680 31675 Protocols 31 to 35, merge credential, publication guards, kept work, scans, 36 lookups; Mac pin, Engineering, asks, F probes, D1; 34680/31675. |
| +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. |
| 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 42812 14841 File facts/diffs, previews, merges, unfinished work, CI, receipts, Assistant files, places, abilities, lookups, go-aheads, Mac work, D1; 42812/14841. |
| +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. |
| 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 - 41546 Protocol 31 contracts, 35 diffs, stuck tasks, merges, retries, unfinished work, previews, places, abilities, lookups, go-aheads, Mac Engineering, conns, D1; 41546. |
| +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. |
| 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 65a2dbcf..1f332b48 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 |
| @@ -364,5 +364,665 @@ |
| "where": "Machines page, a Mac's card: an idle check found processes of the runner user no record accounts for, so an earlier step stays unfinished (wire.UnprovenProcessesLeft); %d is their count, never names, pids or paths. A restart of the Mac clears it.", |
| "draft": "The Mac found %d processes from an earlier step still running. Restart the Mac to clear this.", |
| "reviewed": "Luna, delegated (Paul 2026-10-25), 2026-11-29" |
| + }, |
| + { |
| + "key": "runner.probe_detail.probe_limit", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code probe_limit). P1 to P7 not finished when the probe run's limit passed; %s is the limit, for example 50m0s.", |
| + "draft": "Not proven: the self-checks reached their time limit of %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.not_run", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code not_run). F1 to F7 with no result yet.", |
| + "draft": "Not checked yet.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.f5_skipped", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code f5_skipped). F5 skipped because P2 is not denied.", |
| + "draft": "Not needed: Xcode runs only in the Mac's checks here.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.inputs_changed", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code inputs_changed). F1 to F7: the runner, settings, Claude Code, Xcode or simulator runtimes changed during the launch.", |
| + "draft": "Not proven: something this check depends on changed while it ran.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.stale_runner", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code stale_runner). F1 to F7: the result is from another runner version.", |
| + "draft": "Not proven: the runner changed since this ran.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.stale_settings", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code stale_settings). F1 to F7: the result is from other Engineering settings.", |
| + "draft": "Not proven: Claude's settings changed since this ran.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.stale_cli", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code stale_cli). F1 to F7: the result is from another Claude Code build.", |
| + "draft": "Not proven: Claude Code changed since this ran.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.stale_xcode", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code stale_xcode). F1 to F7: the result is from another Xcode.", |
| + "draft": "Not proven: Xcode changed since this ran.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.stale_runtimes", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code stale_runtimes). F1 to F7: the result is from other simulator runtimes.", |
| + "draft": "Not proven: the simulator runtimes changed since this ran.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.future", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code future). F1 to F7: the result's time is ahead of the Mac's clock.", |
| + "draft": "Not proven: the result is dated in the future.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.expired", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code expired). F1 to F7: the result is over a day old.", |
| + "draft": "Not proven: this ran more than a day ago.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.launch_not_started", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code launch_not_started). F1 to F7: the probe launch did not start; %s is a reason code such as account_unavailable, or unknown.", |
| + "draft": "The check could not start Claude (%s).", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.launch_unproven", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code launch_unproven). F1 to F7: the probe launch's end was not proven.", |
| + "draft": "The Mac could not confirm that the check's Claude stopped.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.script_not_run", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code script_not_run). F1 to F7: the one allowed Bash command never ran.", |
| + "draft": "The check's script was not seen to run.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.other_command", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code other_command). F1 to F7: another Bash command was allowed during the probe.", |
| + "draft": "Claude ran a command other than the check's script.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.records_foreign", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code records_foreign). F1 to F7: the script's records lack this run's nonce.", |
| + "draft": "The check's records were not from this run.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.tree_unmade", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code tree_unmade). F1 to F7: the probe's scratch tree could not be created.", |
| + "draft": "The check's folder could not be made.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.not_prepared", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code not_prepared). F1 to F7: planting the test files or protecting the inputs failed.", |
| + "draft": "The check could not be prepared.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.no_loopback", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code no_loopback). F1, F5: no loopback listener could be opened.", |
| + "draft": "No local port was free for the check.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.script_unwritten", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code script_unwritten). F1 to F7: the hashed probe script could not be written.", |
| + "draft": "The check's script could not be written.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.no_xcode", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code no_xcode). P1, P2, P6, F5, F7: no Xcode on the Mac.", |
| + "draft": "Xcode was not found.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.no_simulator", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code no_simulator). P2, F5: no iOS simulator to test on.", |
| + "draft": "No iOS simulator was found.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.xcode_unavailable", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code xcode_unavailable). P1, P2, P6: xcodebuild did not answer; %s is the query limit, for example 30s.", |
| + "draft": "Xcode did not answer within %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.simulator_unavailable", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code simulator_unavailable). P1, P2, P6: simctl did not answer; %s is the query limit, for example 30s.", |
| + "draft": "The simulator tools did not answer within %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.fixture_uncopied", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code fixture_uncopied). P2, P6, F5: the hostile fixture could not be copied.", |
| + "draft": "The test project could not be copied.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.fixture_unprepared", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code fixture_unprepared). P2, F5: the fixture's targets could not be written.", |
| + "draft": "The test project could not be prepared.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.no_sentinel", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code no_sentinel). F5: no sentinel in the state folder.", |
| + "draft": "The test file in the runner's folder could not be made.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.allowed", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code allowed). P2, F1 to F7: attempts that got through; %s lists attempt names such as test.state tcp.", |
| + "draft": "Allowed: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.not_shown_denied", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code not_shown_denied). P2, F1 to F7: attempts with no denial on record; %s lists attempt names.", |
| + "draft": "Not shown blocked: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.not_collected", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code not_collected). P2: token sources whose collector failed; %s lists attempt names.", |
| + "draft": "Could not be tried: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.unix_only", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code unix_only). P2: other-home attempts the OS refused before the sandbox; %s lists attempt names.", |
| + "draft": "Closed by Unix permissions only: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.reached_scratch", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code reached_scratch). F2, F5: what reached the scratch; %s lists places or secret kinds.", |
| + "draft": "Reached Claude's scratch folder: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.reached_tree", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code reached_tree). F2, F5: what reached the worktree; %s lists places or secret kinds.", |
| + "draft": "Reached the work folder: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.not_set_up", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code not_set_up). F2, F6: test places that could not be planted; %s lists their names.", |
| + "draft": "Could not be set up: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.incomplete", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code incomplete). F5: build or test steps that did not finish; %s lists step names.", |
| + "draft": "Did not finish: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.tree_unsearched", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code tree_unsearched). F2, F3, F5: the tree search did not finish.", |
| + "draft": "The work folder could not be searched in full.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.secrets_unreadable", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code secrets_unreadable). F3, F5: the known secrets could not be read.", |
| + "draft": "The runner's secrets could not be read to search for them.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.not_all_denied", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code not_all_denied). F5: the hostile build's attempts were not all denied.", |
| + "draft": "Not every attempt was shown blocked.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.loopback_hits", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code loopback_hits). F1: connections the loopback listener received; %s is a count.", |
| + "draft": "The local listener saw %s connections.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.dns_control_failed", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code dns_control_failed). F1: the DNS control failed outside.", |
| + "draft": "The name lookup also failed outside the sandbox, so this proves nothing.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.control_failed", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code control_failed). F7: controls that failed outside; %s lists tool names.", |
| + "draft": "Also failed outside the sandbox, so this proves nothing: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.no_token_file", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code no_token_file). F3: no token file to aim at.", |
| + "draft": "There was no token file to try.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.no_procargs_reader", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code no_procargs_reader). F3: no runner binary to read process details.", |
| + "draft": "The runner's process reader was missing.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.ps_control_failed", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code ps_control_failed). F3: the outside ps control failed.", |
| + "draft": "The process list check failed outside the sandbox.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.procargs_not_sandboxed", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code procargs_not_sandboxed). F3: the reader ran without the sandbox.", |
| + "draft": "The process reader did not run in the sandbox.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.procargs_incomplete", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code procargs_incomplete). F3: the reader did not complete.", |
| + "draft": "The process reader did not finish.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.process_list_unreadable", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code process_list_unreadable). F3: the sandboxed process list failed.", |
| + "draft": "The process list could not be read.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "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.", |
| + "draft": "A pipe was open in commands Claude ran: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.token_reached_scratch", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code token_reached_scratch). F3: sources whose token reached the scratch; %s lists source names.", |
| + "draft": "The token reached Claude's scratch folder from: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.token_reached_tree", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code token_reached_tree). F3: sources whose token reached the tree; %s lists source names.", |
| + "draft": "The token reached the work folder from: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.token_reached", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code token_reached). F3: sources that gave the token; %s lists source names such as env.", |
| + "draft": "The token was reached through: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.not_shown_tried", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code not_shown_tried). F3: sources with no record; %s lists source names.", |
| + "draft": "Not shown tried: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.env_unreadable", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code env_unreadable). F3: the outside reader could not see the CLI's environment.", |
| + "draft": "The outside check could not read Claude's environment.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.token_in_env", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code token_in_env). F3: the token was found in the CLI's environment.", |
| + "draft": "The token is in Claude's environment.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.control_read_missing", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code control_read_missing). F6: the allowed control read never came.", |
| + "draft": "The control read did not arrive.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.reached_model", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code reached_model). F6: a denied file or secret reached the model.", |
| + "draft": "A protected file or a secret reached Claude.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.not_shown_made", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code not_shown_made). F6: tool calls with no event; %s lists call names such as S50.", |
| + "draft": "Not shown made: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.not_prescribed", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code not_prescribed). F6: tool calls with other arguments; %s lists call names.", |
| + "draft": "Not made as the check asked: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.unobserved", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code unobserved). F6: calls with no refusal and no benign result; %s lists call names.", |
| + "draft": "Neither refused nor seen: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.write_denied_place", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code write_denied_place). F6: a Write landed outside the tree.", |
| + "draft": "A write reached a protected place.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.write_through_link", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code write_through_link). F6: %s is the protected place's name.", |
| + "draft": "A write reached %s through a link.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.hard_linked", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code hard_linked). F6: hard links the shell made; %s lists their names.", |
| + "draft": "A command made hard links: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.link_not_refused", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code link_not_refused). F6: hard-link attempts with no refusal; %s lists their names.", |
| + "draft": "Hard links not shown refused: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.child_not_started", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code child_not_started). F4: the child never showed.", |
| + "draft": "The test process was not seen to start.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.child_not_own_session", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code child_not_own_session). F4: the child shared a session.", |
| + "draft": "The test process was not in a session of its own.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.child_outlived", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code child_outlived). F4: the child outlived the stop.", |
| + "draft": "The test process kept running after Claude stopped.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.child_not_gone", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code child_not_gone). F4: the child could not be shown gone.", |
| + "draft": "The Mac could not confirm that the test process stopped.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.f1_denied", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code f1_denied). F1 denied.", |
| + "draft": "Internet, local and name lookups were blocked, and the listener saw nothing.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.f2_denied", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code f2_denied). F2 denied; %s is the number of places.", |
| + "draft": "Reads, copies and hard links were blocked in %s places.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.other_home_os", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code other_home_os). F2 denied, with the other home closed by the OS.", |
| + "draft": "macOS itself closes another person's home folder.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.f3_denied", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code f3_denied). F3 denied.", |
| + "draft": "No token was reached through the token file, environments, process details, launchd or open files.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.f4_passed", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code f4_passed). F4 passed.", |
| + "draft": "A process Claude started in its own session stopped with Claude.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.f5_denied", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code f5_denied). F5 denied.", |
| + "draft": "Every hostile attempt and every token source was blocked, and the build and tests finished.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.unix_home", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code unix_home). F5 denied, with another home closed by the OS.", |
| + "draft": "Another home folder is also closed by Unix permissions.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.f6_denied", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code f6_denied). F6 denied; %s is the number of calls.", |
| + "draft": "%s file tool calls were refused, including through a swapped link and a late name.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.f7_denied", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code f7_denied). F7 denied.", |
| + "draft": "Xcode, simctl and the simulator service were blocked, and each works outside.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.xcode", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code xcode). P1: the Xcode version, then its build.", |
| + "draft": "Xcode %s (%s).", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.ios_simulators", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code ios_simulators). P1: %s is a count.", |
| + "draft": "%s iOS simulators.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.computer", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code computer). P1: %s is the Mac's name.", |
| + "draft": "On %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.srt_missing", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code srt_missing). P2: no sandbox runtime.", |
| + "draft": "srt is not installed.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.user_temp_refused", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code user_temp_refused). P2: DARWIN_USER_TEMP_DIR refused (the runner log says why).", |
| + "draft": "The runner user's temporary folder could not be used.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.all_denied", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code all_denied). P2: %s is the number of attempts.", |
| + "draft": "All %s attempts were blocked.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.end_unproven", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code end_unproven). P2: the run's end was not proven.", |
| + "draft": "The Mac could not confirm that the check stopped.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.srt_ran_xcode", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code srt_ran_xcode). P2: the hostile build and test ran under srt.", |
| + "draft": "Xcode ran in the sandbox.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.srt_failed", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code srt_failed). P2: %s names the failed steps, such as test build exit 65; the output goes only to the runner log.", |
| + "draft": "Xcode did not run in the sandbox: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.srt_not_run", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code srt_not_run). P2: srt did not run the build.", |
| + "draft": "Xcode did not run in the sandbox.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.p3_keychain_denied", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code p3_keychain_denied). P3 skipped; the P2 Keychain attempts were denied.", |
| + "draft": "Signing in needs a person. The sandbox could not reach the Keychain.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.p3_keychain_unshown", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code p3_keychain_unshown). P3 skipped; a P2 Keychain attempt was not shown denied.", |
| + "draft": "Signing in needs a person. The sandbox was not shown blocked from the Keychain.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.p3_keychain_unprobed", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code p3_keychain_unprobed). P3 skipped; P2 did not run.", |
| + "draft": "Signing in needs a person. The Keychain was not checked from the sandbox.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.p5_parked", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code p5_parked). P5 skipped.", |
| + "draft": "Codex on the Mac is not offered yet.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.homes_unchecked", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code homes_unchecked). P4: the list of homes is unknown.", |
| + "draft": "Other home folders could not be checked.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.homes_readable", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code homes_readable). P4: %s lists user names.", |
| + "draft": "Readable home folders: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.homes_closed", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code homes_closed). P4 passed part.", |
| + "draft": "No other home folder is readable.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.agent_loaded", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code agent_loaded). P4: the launchd agent is loaded.", |
| + "draft": "The runner's agent is loaded.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.agent_not_loaded", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code agent_not_loaded). P4: the launchd agent is not loaded.", |
| + "draft": "The runner's agent is not loaded.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.sleep_unknown", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code sleep_unknown). P4: pmset could not be read.", |
| + "draft": "The sleep setting is unknown.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.sleep_off", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code sleep_off). P4: no sleep on AC power.", |
| + "draft": "Sleep is off on power.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.sleep_after", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code sleep_after). P4: %s is minutes.", |
| + "draft": "Sleeps after %s minutes on power.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.test_not_started", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code test_not_started). P6: %s is a gate reason code or exit N.", |
| + "draft": "The waiting test did not start (%s).", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.group_gone", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code group_gone). P6: %s is a duration such as 2s.", |
| + "draft": "The check's processes stopped in %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.group_unproven", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code group_unproven). P6: the group's end was not proven.", |
| + "draft": "The Mac could not confirm that the check's processes stopped.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.marked_left", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code marked_left). P6: %s is a count.", |
| + "draft": "%s marked processes were left.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "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.", |
| + "draft": "Still running: %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.simulators_shut", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code simulators_shut). P6: %s is a count.", |
| + "draft": "%s simulators were shut down.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.tree_removed", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code tree_removed). P6 passed part.", |
| + "draft": "The check's folder was removed.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.tree_not_removable", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code tree_not_removable). P6: the fixture tree stayed.", |
| + "draft": "The check's folder could not be removed.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.tool_missing", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code tool_missing). P7: %s is a tool name (srt, node, rg).", |
| + "draft": "%s is missing.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.tool_version", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code tool_version). P7: a tool name, then its version.", |
| + "draft": "%s %s.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.node_old", |
| + "where": "Machines page, a Mac's self-checks: a part of the detail beside a probe's verdict (wire probe detail code node_old). P7: node too old for srt.", |
| + "draft": "Node is older than 22.12.", |
| + "reviewed": "pending (Luna)" |
| + }, |
| + { |
| + "key": "runner.probe_detail.srt_cannot_run", |
| + "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)" |
| } |
| ] |
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md| index fb50af13..17259cb0 100644 |
| --- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| +++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md |
| @@ -7080,6 +7080,116 @@ records remain unchanged. |
| | `runner.mac.holds_claude` | This Mac holds a Claude connection, or something one left, so its checks run only in its sandbox. | Copy specialist | COPY REVIEW PENDING | |
| | `runner.tainted_held` | A check ran outside the sandbox on this Mac, so Equipo no longer trusts its sandbox. This Mac also holds a Claude connection or something left by one. Its checks cannot run outside the sandbox, so they wait. To start clean, install the runner again under a new Mac user. | Copy specialist | COPY REVIEW PENDING | |
| | `runner.unproven.processes_left` | The Mac found %d processes from an earlier step still running. Restart the Mac to clear this. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.probe_limit` | Not proven: the self-checks reached their time limit of %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.not_run` | Not checked yet. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.f5_skipped` | Not needed: Xcode runs only in the Mac's checks here. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.inputs_changed` | Not proven: something this check depends on changed while it ran. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.stale_runner` | Not proven: the runner changed since this ran. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.stale_settings` | Not proven: Claude's settings changed since this ran. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.stale_cli` | Not proven: Claude Code changed since this ran. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.stale_xcode` | Not proven: Xcode changed since this ran. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.stale_runtimes` | Not proven: the simulator runtimes changed since this ran. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.future` | Not proven: the result is dated in the future. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.expired` | Not proven: this ran more than a day ago. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.launch_not_started` | The check could not start Claude (%s). | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.launch_unproven` | The Mac could not confirm that the check's Claude stopped. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.script_not_run` | The check's script was not seen to run. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.other_command` | Claude ran a command other than the check's script. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.records_foreign` | The check's records were not from this run. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.tree_unmade` | The check's folder could not be made. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.not_prepared` | The check could not be prepared. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.no_loopback` | No local port was free for the check. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.script_unwritten` | The check's script could not be written. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.no_xcode` | Xcode was not found. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.no_simulator` | No iOS simulator was found. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.xcode_unavailable` | Xcode did not answer within %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.simulator_unavailable` | The simulator tools did not answer within %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.fixture_uncopied` | The test project could not be copied. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.fixture_unprepared` | The test project could not be prepared. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.no_sentinel` | The test file in the runner's folder could not be made. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.allowed` | Allowed: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.not_shown_denied` | Not shown blocked: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.not_collected` | Could not be tried: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.unix_only` | Closed by Unix permissions only: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.reached_scratch` | Reached Claude's scratch folder: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.reached_tree` | Reached the work folder: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.not_set_up` | Could not be set up: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.incomplete` | Did not finish: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.tree_unsearched` | The work folder could not be searched in full. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.secrets_unreadable` | The runner's secrets could not be read to search for them. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.not_all_denied` | Not every attempt was shown blocked. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.loopback_hits` | The local listener saw %s connections. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.dns_control_failed` | The name lookup also failed outside the sandbox, so this proves nothing. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.control_failed` | Also failed outside the sandbox, so this proves nothing: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.no_token_file` | There was no token file to try. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.no_procargs_reader` | The runner's process reader was missing. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.ps_control_failed` | The process list check failed outside the sandbox. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.procargs_not_sandboxed` | The process reader did not run in the sandbox. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.procargs_incomplete` | The process reader did not finish. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.process_list_unreadable` | The process list could not be read. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.pipe_open` | A pipe was open in commands Claude ran: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.token_reached_scratch` | The token reached Claude's scratch folder from: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.token_reached_tree` | The token reached the work folder from: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.token_reached` | The token was reached through: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.not_shown_tried` | Not shown tried: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.env_unreadable` | The outside check could not read Claude's environment. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.token_in_env` | The token is in Claude's environment. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.control_read_missing` | The control read did not arrive. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.reached_model` | A protected file or a secret reached Claude. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.not_shown_made` | Not shown made: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.not_prescribed` | Not made as the check asked: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.unobserved` | Neither refused nor seen: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.write_denied_place` | A write reached a protected place. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.write_through_link` | A write reached %s through a link. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.hard_linked` | A command made hard links: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.link_not_refused` | Hard links not shown refused: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.child_not_started` | The test process was not seen to start. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.child_not_own_session` | The test process was not in a session of its own. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.child_outlived` | The test process kept running after Claude stopped. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.child_not_gone` | The Mac could not confirm that the test process stopped. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.f1_denied` | Internet, local and name lookups were blocked, and the listener saw nothing. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.f2_denied` | Reads, copies and hard links were blocked in %s places. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.other_home_os` | macOS itself closes another person's home folder. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.f3_denied` | No token was reached through the token file, environments, process details, launchd or open files. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.f4_passed` | A process Claude started in its own session stopped with Claude. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.f5_denied` | Every hostile attempt and every token source was blocked, and the build and tests finished. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.unix_home` | Another home folder is also closed by Unix permissions. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.f6_denied` | %s file tool calls were refused, including through a swapped link and a late name. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.f7_denied` | Xcode, simctl and the simulator service were blocked, and each works outside. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.xcode` | Xcode %s (%s). | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.ios_simulators` | %s iOS simulators. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.computer` | On %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.srt_missing` | srt is not installed. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.user_temp_refused` | The runner user's temporary folder could not be used. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.all_denied` | All %s attempts were blocked. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.end_unproven` | The Mac could not confirm that the check stopped. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.srt_ran_xcode` | Xcode ran in the sandbox. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.srt_failed` | Xcode did not run in the sandbox: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.srt_not_run` | Xcode did not run in the sandbox. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.p3_keychain_denied` | Signing in needs a person. The sandbox could not reach the Keychain. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.p3_keychain_unshown` | Signing in needs a person. The sandbox was not shown blocked from the Keychain. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.p3_keychain_unprobed` | Signing in needs a person. The Keychain was not checked from the sandbox. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.p5_parked` | Codex on the Mac is not offered yet. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.homes_unchecked` | Other home folders could not be checked. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.homes_readable` | Readable home folders: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.homes_closed` | No other home folder is readable. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.agent_loaded` | The runner's agent is loaded. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.agent_not_loaded` | The runner's agent is not loaded. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.sleep_unknown` | The sleep setting is unknown. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.sleep_off` | Sleep is off on power. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.sleep_after` | Sleeps after %s minutes on power. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.test_not_started` | The waiting test did not start (%s). | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.group_gone` | The check's processes stopped in %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.group_unproven` | The Mac could not confirm that the check's processes stopped. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.marked_left` | %s marked processes were left. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.still_running` | Still running: %s. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.simulators_shut` | %s simulators were shut down. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.tree_removed` | The check's folder was removed. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.tree_not_removable` | The check's folder could not be removed. | Copy specialist | COPY REVIEW PENDING | |
| +| `runner.probe_detail.tool_missing` | %s is missing. | Copy specialist | COPY REVIEW PENDING | |
| +| `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 | |
| ## Task 21 |
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go| index 36bc0e68..85a0e760 100644 |
| --- a/internal/equipo/copy.go |
| +++ b/internal/equipo/copy.go |
| @@ -2121,16 +2121,126 @@ var pageCopy = map[string]string{ |
| // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "runner.verdict.skipped": "Not run", |
| // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| - "runner.verdict.unavailable": "Unavailable", |
| - "runner.unproven.record_incomplete": "Equipo could not confirm that an earlier step on this Mac stopped completely, so the step stays unfinished. Wait for the Mac's idle check, or restart it to clear this.", // COPY REVIEW PENDING |
| - "runner.unproven.processes_left": "The Mac found %d processes from an earlier step still running. Restart the Mac to clear this.", // COPY REVIEW PENDING |
| - "runner.probe_detail.turn_busy": "The Mac was busy with other work, so this was not checked.", // COPY REVIEW PENDING |
| - "runner.mac.home_open": "Other people can open %[1]s's home folder on this Mac, so Equipo will not keep Claude there. As %[1]s, run chmod 700 ~, then try again.", // COPY REVIEW PENDING |
| - "runner.mac.home_open_folder": "Other people can reach a folder where %[1]s keeps Claude on this Mac, so Equipo will not keep Claude there. The runner log names the folder and what to change.", // COPY REVIEW PENDING |
| - "runner.unproven.credential_unproven": "This Mac could not prove that an earlier Claude sign-in or check ended, so it keeps its Claude connections closed. Restart the Mac to clear it.", // COPY REVIEW PENDING |
| - "runner.mac.keychain_item": "This Mac's Keychain has an item named %[1]s, so Equipo will not keep Claude there. As %[2]s, remove it in Keychain Access, then try again.", // COPY REVIEW PENDING |
| - "chat.connections.add_to": "Add Claude to %s", // COPY REVIEW PENDING |
| - "chat.connections.reason.mac_claude_only": "Only Claude can be added to a Mac for now.", // COPY REVIEW PENDING |
| + "runner.verdict.unavailable": "Unavailable", |
| + "runner.unproven.record_incomplete": "Equipo could not confirm that an earlier step on this Mac stopped completely, so the step stays unfinished. Wait for the Mac's idle check, or restart it to clear this.", // COPY REVIEW PENDING |
| + "runner.unproven.processes_left": "The Mac found %d processes from an earlier step still running. Restart the Mac to clear this.", // COPY REVIEW PENDING |
| + "runner.probe_detail.turn_busy": "The Mac was busy with other work, so this was not checked.", // COPY REVIEW PENDING |
| + "runner.probe_detail.probe_limit": "Not proven: the self-checks reached their time limit of %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.not_run": "Not checked yet.", // COPY REVIEW PENDING |
| + "runner.probe_detail.f5_skipped": "Not needed: Xcode runs only in the Mac's checks here.", // COPY REVIEW PENDING |
| + "runner.probe_detail.inputs_changed": "Not proven: something this check depends on changed while it ran.", // COPY REVIEW PENDING |
| + "runner.probe_detail.stale_runner": "Not proven: the runner changed since this ran.", // COPY REVIEW PENDING |
| + "runner.probe_detail.stale_settings": "Not proven: Claude's settings changed since this ran.", // COPY REVIEW PENDING |
| + "runner.probe_detail.stale_cli": "Not proven: Claude Code changed since this ran.", // COPY REVIEW PENDING |
| + "runner.probe_detail.stale_xcode": "Not proven: Xcode changed since this ran.", // COPY REVIEW PENDING |
| + "runner.probe_detail.stale_runtimes": "Not proven: the simulator runtimes changed since this ran.", // COPY REVIEW PENDING |
| + "runner.probe_detail.future": "Not proven: the result is dated in the future.", // COPY REVIEW PENDING |
| + "runner.probe_detail.expired": "Not proven: this ran more than a day ago.", // COPY REVIEW PENDING |
| + "runner.probe_detail.launch_not_started": "The check could not start Claude (%s).", // COPY REVIEW PENDING |
| + "runner.probe_detail.launch_unproven": "The Mac could not confirm that the check's Claude stopped.", // COPY REVIEW PENDING |
| + "runner.probe_detail.script_not_run": "The check's script was not seen to run.", // COPY REVIEW PENDING |
| + "runner.probe_detail.other_command": "Claude ran a command other than the check's script.", // COPY REVIEW PENDING |
| + "runner.probe_detail.records_foreign": "The check's records were not from this run.", // COPY REVIEW PENDING |
| + "runner.probe_detail.tree_unmade": "The check's folder could not be made.", // COPY REVIEW PENDING |
| + "runner.probe_detail.not_prepared": "The check could not be prepared.", // COPY REVIEW PENDING |
| + "runner.probe_detail.no_loopback": "No local port was free for the check.", // COPY REVIEW PENDING |
| + "runner.probe_detail.script_unwritten": "The check's script could not be written.", // COPY REVIEW PENDING |
| + "runner.probe_detail.no_xcode": "Xcode was not found.", // COPY REVIEW PENDING |
| + "runner.probe_detail.no_simulator": "No iOS simulator was found.", // COPY REVIEW PENDING |
| + "runner.probe_detail.xcode_unavailable": "Xcode did not answer within %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.simulator_unavailable": "The simulator tools did not answer within %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.fixture_uncopied": "The test project could not be copied.", // COPY REVIEW PENDING |
| + "runner.probe_detail.fixture_unprepared": "The test project could not be prepared.", // COPY REVIEW PENDING |
| + "runner.probe_detail.no_sentinel": "The test file in the runner's folder could not be made.", // COPY REVIEW PENDING |
| + "runner.probe_detail.allowed": "Allowed: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.not_shown_denied": "Not shown blocked: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.not_collected": "Could not be tried: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.unix_only": "Closed by Unix permissions only: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.reached_scratch": "Reached Claude's scratch folder: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.reached_tree": "Reached the work folder: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.not_set_up": "Could not be set up: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.incomplete": "Did not finish: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.tree_unsearched": "The work folder could not be searched in full.", // COPY REVIEW PENDING |
| + "runner.probe_detail.secrets_unreadable": "The runner's secrets could not be read to search for them.", // COPY REVIEW PENDING |
| + "runner.probe_detail.not_all_denied": "Not every attempt was shown blocked.", // COPY REVIEW PENDING |
| + "runner.probe_detail.loopback_hits": "The local listener saw %s connections.", // COPY REVIEW PENDING |
| + "runner.probe_detail.dns_control_failed": "The name lookup also failed outside the sandbox, so this proves nothing.", // COPY REVIEW PENDING |
| + "runner.probe_detail.control_failed": "Also failed outside the sandbox, so this proves nothing: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.no_token_file": "There was no token file to try.", // COPY REVIEW PENDING |
| + "runner.probe_detail.no_procargs_reader": "The runner's process reader was missing.", // COPY REVIEW PENDING |
| + "runner.probe_detail.ps_control_failed": "The process list check failed outside the sandbox.", // COPY REVIEW PENDING |
| + "runner.probe_detail.procargs_not_sandboxed": "The process reader did not run in the sandbox.", // COPY REVIEW PENDING |
| + "runner.probe_detail.procargs_incomplete": "The process reader did not finish.", // COPY REVIEW PENDING |
| + "runner.probe_detail.process_list_unreadable": "The process list could not be read.", // COPY REVIEW PENDING |
| + "runner.probe_detail.pipe_open": "A pipe was open in commands Claude ran: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.token_reached_scratch": "The token reached Claude's scratch folder from: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.token_reached_tree": "The token reached the work folder from: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.token_reached": "The token was reached through: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.not_shown_tried": "Not shown tried: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.env_unreadable": "The outside check could not read Claude's environment.", // COPY REVIEW PENDING |
| + "runner.probe_detail.token_in_env": "The token is in Claude's environment.", // COPY REVIEW PENDING |
| + "runner.probe_detail.control_read_missing": "The control read did not arrive.", // COPY REVIEW PENDING |
| + "runner.probe_detail.reached_model": "A protected file or a secret reached Claude.", // COPY REVIEW PENDING |
| + "runner.probe_detail.not_shown_made": "Not shown made: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.not_prescribed": "Not made as the check asked: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.unobserved": "Neither refused nor seen: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.write_denied_place": "A write reached a protected place.", // COPY REVIEW PENDING |
| + "runner.probe_detail.write_through_link": "A write reached %s through a link.", // COPY REVIEW PENDING |
| + "runner.probe_detail.hard_linked": "A command made hard links: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.link_not_refused": "Hard links not shown refused: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.child_not_started": "The test process was not seen to start.", // COPY REVIEW PENDING |
| + "runner.probe_detail.child_not_own_session": "The test process was not in a session of its own.", // COPY REVIEW PENDING |
| + "runner.probe_detail.child_outlived": "The test process kept running after Claude stopped.", // COPY REVIEW PENDING |
| + "runner.probe_detail.child_not_gone": "The Mac could not confirm that the test process stopped.", // COPY REVIEW PENDING |
| + "runner.probe_detail.f1_denied": "Internet, local and name lookups were blocked, and the listener saw nothing.", // COPY REVIEW PENDING |
| + "runner.probe_detail.f2_denied": "Reads, copies and hard links were blocked in %s places.", // COPY REVIEW PENDING |
| + "runner.probe_detail.other_home_os": "macOS itself closes another person's home folder.", // COPY REVIEW PENDING |
| + "runner.probe_detail.f3_denied": "No token was reached through the token file, environments, process details, launchd or open files.", // COPY REVIEW PENDING |
| + "runner.probe_detail.f4_passed": "A process Claude started in its own session stopped with Claude.", // COPY REVIEW PENDING |
| + "runner.probe_detail.f5_denied": "Every hostile attempt and every token source was blocked, and the build and tests finished.", // COPY REVIEW PENDING |
| + "runner.probe_detail.unix_home": "Another home folder is also closed by Unix permissions.", // COPY REVIEW PENDING |
| + "runner.probe_detail.f6_denied": "%s file tool calls were refused, including through a swapped link and a late name.", // COPY REVIEW PENDING |
| + "runner.probe_detail.f7_denied": "Xcode, simctl and the simulator service were blocked, and each works outside.", // COPY REVIEW PENDING |
| + "runner.probe_detail.xcode": "Xcode %s (%s).", // COPY REVIEW PENDING |
| + "runner.probe_detail.ios_simulators": "%s iOS simulators.", // COPY REVIEW PENDING |
| + "runner.probe_detail.computer": "On %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.srt_missing": "srt is not installed.", // COPY REVIEW PENDING |
| + "runner.probe_detail.user_temp_refused": "The runner user's temporary folder could not be used.", // COPY REVIEW PENDING |
| + "runner.probe_detail.all_denied": "All %s attempts were blocked.", // COPY REVIEW PENDING |
| + "runner.probe_detail.end_unproven": "The Mac could not confirm that the check stopped.", // COPY REVIEW PENDING |
| + "runner.probe_detail.srt_ran_xcode": "Xcode ran in the sandbox.", // COPY REVIEW PENDING |
| + "runner.probe_detail.srt_failed": "Xcode did not run in the sandbox: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.srt_not_run": "Xcode did not run in the sandbox.", // COPY REVIEW PENDING |
| + "runner.probe_detail.p3_keychain_denied": "Signing in needs a person. The sandbox could not reach the Keychain.", // COPY REVIEW PENDING |
| + "runner.probe_detail.p3_keychain_unshown": "Signing in needs a person. The sandbox was not shown blocked from the Keychain.", // COPY REVIEW PENDING |
| + "runner.probe_detail.p3_keychain_unprobed": "Signing in needs a person. The Keychain was not checked from the sandbox.", // COPY REVIEW PENDING |
| + "runner.probe_detail.p5_parked": "Codex on the Mac is not offered yet.", // COPY REVIEW PENDING |
| + "runner.probe_detail.homes_unchecked": "Other home folders could not be checked.", // COPY REVIEW PENDING |
| + "runner.probe_detail.homes_readable": "Readable home folders: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.homes_closed": "No other home folder is readable.", // COPY REVIEW PENDING |
| + "runner.probe_detail.agent_loaded": "The runner's agent is loaded.", // COPY REVIEW PENDING |
| + "runner.probe_detail.agent_not_loaded": "The runner's agent is not loaded.", // COPY REVIEW PENDING |
| + "runner.probe_detail.sleep_unknown": "The sleep setting is unknown.", // COPY REVIEW PENDING |
| + "runner.probe_detail.sleep_off": "Sleep is off on power.", // COPY REVIEW PENDING |
| + "runner.probe_detail.sleep_after": "Sleeps after %s minutes on power.", // COPY REVIEW PENDING |
| + "runner.probe_detail.test_not_started": "The waiting test did not start (%s).", // COPY REVIEW PENDING |
| + "runner.probe_detail.group_gone": "The check's processes stopped in %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.group_unproven": "The Mac could not confirm that the check's processes stopped.", // COPY REVIEW PENDING |
| + "runner.probe_detail.marked_left": "%s marked processes were left.", // COPY REVIEW PENDING |
| + "runner.probe_detail.still_running": "Still running: %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.simulators_shut": "%s simulators were shut down.", // COPY REVIEW PENDING |
| + "runner.probe_detail.tree_removed": "The check's folder was removed.", // COPY REVIEW PENDING |
| + "runner.probe_detail.tree_not_removable": "The check's folder could not be removed.", // COPY REVIEW PENDING |
| + "runner.probe_detail.tool_missing": "%s is missing.", // COPY REVIEW PENDING |
| + "runner.probe_detail.tool_version": "%s %s.", // COPY REVIEW PENDING |
| + "runner.probe_detail.node_old": "Node is older than 22.12.", // COPY REVIEW PENDING |
| + "runner.probe_detail.srt_cannot_run": "srt could not run a command.", // COPY REVIEW PENDING |
| + "runner.mac.home_open": "Other people can open %[1]s's home folder on this Mac, so Equipo will not keep Claude there. As %[1]s, run chmod 700 ~, then try again.", // COPY REVIEW PENDING |
| + "runner.mac.home_open_folder": "Other people can reach a folder where %[1]s keeps Claude on this Mac, so Equipo will not keep Claude there. The runner log names the folder and what to change.", // COPY REVIEW PENDING |
| + "runner.unproven.credential_unproven": "This Mac could not prove that an earlier Claude sign-in or check ended, so it keeps its Claude connections closed. Restart the Mac to clear it.", // COPY REVIEW PENDING |
| + "runner.mac.keychain_item": "This Mac's Keychain has an item named %[1]s, so Equipo will not keep Claude there. As %[2]s, remove it in Keychain Access, then try again.", // COPY REVIEW PENDING |
| + "chat.connections.add_to": "Add Claude to %s", // COPY REVIEW PENDING |
| + "chat.connections.reason.mac_claude_only": "Only Claude can be added to a Mac for now.", // COPY REVIEW PENDING |
| // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
| "runner.origin": "Equipo address:", |
| // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context) |
diff --git a/internal/equipo/mac_view_test.go b/internal/equipo/mac_view_test.go| index 544f3a33..1ed939b7 100644 |
| --- a/internal/equipo/mac_view_test.go |
| +++ b/internal/equipo/mac_view_test.go |
| @@ -2,6 +2,10 @@ package equipo |
| import ( |
| "bytes" |
| + "encoding/json" |
| + "fmt" |
| + "os" |
| + "regexp" |
| "strings" |
| "testing" |
| "time" |
| @@ -73,14 +77,56 @@ func TestInstallScript(t *testing.T) { |
| } |
| } |
| -// A probe detail that is a code is worded here (copy.go); any other |
| -// detail is the runner's own diagnostic, shown as it came. |
| +// A probe detail is codes with parameters (wire.ProbeDetail), worded |
| +// here from copy.go; free text from a runner is never shown |
| +// (whole-branch fix 1, #6). Every code has its wording, with one %s per |
| +// parameter, pending review and listed for it. |
| func TestProbeDetailCodes(t *testing.T) { |
| if got := probeDetail(wire.ProbeDetailTurnBusy); got == wire.ProbeDetailTurnBusy || got != copyText("runner.probe_detail.turn_busy") || got == "" { |
| t.Fatalf("turn_busy shown as %q", got) |
| } |
| - if got := probeDetail("srt 0.0.81"); got != "srt 0.0.81" { |
| - t.Fatalf("a diagnostic changed: %q", got) |
| + for _, free := range []string{"srt 0.0.81", "not run yet", "not proven: the runner changed since it ran", "allowed: home.cat"} { |
| + if got := probeDetail(free); got != "" { |
| + t.Fatalf("free text %q shown as %q", free, got) |
| + } |
| + } |
| + d := wire.ProbeDetails(wire.ProbeDetail("allowed", "home.cat tcp"), wire.ProbeDetail("not_run")) |
| + if got, want := probeDetail(d), fmt.Sprintf(copyText("runner.probe_detail.allowed"), "home.cat tcp")+" "+copyText("runner.probe_detail.not_run"); got != want || strings.Contains(got, "%") { |
| + t.Fatalf("%q shown as %q, want %q", d, got, want) |
| + } |
| + // A part that does not decode is left out; the rest is shown. |
| + if got := probeDetail(wire.ProbeDetail("not_run") + ";words here"); got != copyText("runner.probe_detail.not_run") { |
| + t.Fatalf("mixed shown as %q", got) |
| + } |
| + src, err := os.ReadFile("copy.go") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + raw, err := os.ReadFile("../../docs/superpowers/plans/2026-11-28-mac-slice-f-copy.json") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + var listed []struct{ Key, Draft, Reviewed string } |
| + if err := json.Unmarshal(raw, &listed); err != nil { |
| + t.Fatal(err) |
| + } |
| + drafts := map[string]string{} |
| + for _, e := range listed { |
| + drafts[e.Key] = e.Draft |
| + } |
| + for code, n := range wire.ProbeDetailCodes { |
| + key := "runner.probe_detail." + code |
| + text := copyText(key) |
| + if text == "" || strings.Count(text, "%s") != n || strings.Count(text, "%") != n || strings.ContainsAny(text, "—!") { |
| + t.Errorf("%s: %q for %d parameters", key, text, n) |
| + } |
| + line := regexp.MustCompile(`(?m)^\s*"` + regexp.QuoteMeta(key) + `":.*$`).Find(src) |
| + if !strings.Contains(string(line), "COPY REVIEW PENDING") { |
| + t.Errorf("%s is not marked pending", key) |
| + } |
| + if drafts[key] != text { |
| + t.Errorf("%s: listed for review as %q", key, drafts[key]) |
| + } |
| } |
| } |
diff --git a/internal/equipo/runners.go b/internal/equipo/runners.go| index 6c9a718e..6f9670b3 100644 |
| --- a/internal/equipo/runners.go |
| +++ b/internal/equipo/runners.go |
| @@ -7,6 +7,7 @@ import ( |
| "encoding/json" |
| "errors" |
| "fmt" |
| + "strings" |
| "time" |
| "amadan.net/oficina/equipo/internal/equipo/setup" |
| @@ -398,14 +399,22 @@ func macGuards(r *setup.RunnerReport, c wire.Capabilities) { |
| } |
| } |
| -// probeDetail is a probe's detail as the Machines page shows it: a |
| -// code the runner sends instead of words (wire.ProbeDetailTurnBusy) is |
| -// worded here; any other detail is the runner's diagnostic, as it came. |
| +// probeDetail is a probe's detail as the Machines page shows it: each |
| +// coded part (wire.ProbeDetail) worded here with its parameters; words |
| +// a runner sent instead are never shown. |
| func probeDetail(d string) string { |
| - if d == wire.ProbeDetailTurnBusy { |
| - return copyText("runner.probe_detail.turn_busy") |
| + parts, _ := wire.ParseProbeDetail(d) |
| + var out []string |
| + for _, p := range parts { |
| + if text := copyText("runner.probe_detail." + p.Code); text != "" { |
| + args := make([]any, len(p.Params)) |
| + for i, v := range p.Params { |
| + args[i] = v |
| + } |
| + out = append(out, fmt.Sprintf(text, args...)) |
| + } |
| } |
| - return d |
| + return strings.Join(out, " ") |
| } |
| // unprovenText words a runner's Unproven code; "" for none or one it |
diff --git a/internal/runner/mac/fprobe/fprobe.go b/internal/runner/mac/fprobe/fprobe.go| index 67de5c9e..284aab79 100644 |
| --- a/internal/runner/mac/fprobe/fprobe.go |
| +++ b/internal/runner/mac/fprobe/fprobe.go |
| @@ -120,15 +120,15 @@ func (i Inputs) runnable() bool { return i.Runner != "" && i.Settings != "" && i |
| func (i Inputs) changed(was Inputs) string { |
| switch { |
| case i.Runner != was.Runner: |
| - return "the runner changed" |
| + return "stale_runner" |
| case i.Settings != was.Settings: |
| - return "the Engineering settings changed" |
| + return "stale_settings" |
| case i.CLI != was.CLI: |
| - return "Claude Code changed" |
| + return "stale_cli" |
| case i.Xcode != was.Xcode: |
| - return "Xcode changed" |
| + return "stale_xcode" |
| case i.Runtimes != was.Runtimes: |
| - return "the simulator runtimes changed" |
| + return "stale_runtimes" |
| } |
| return "" |
| } |
| @@ -228,15 +228,15 @@ func (s *Store) Probes(cur Inputs, now time.Time, p2Denied bool) []wire.Probe { |
| p := wire.Probe{ID: id, Verdict: wire.ProbeUnavailable} |
| switch why := cur.changed(r.Inputs); { |
| case id == "F5" && !p2Denied: |
| - p.Verdict, p.Detail = wire.ProbeSkipped, "P2 is not denied, so Xcode runs only in checks" |
| + p.Verdict, p.Detail = wire.ProbeSkipped, wire.ProbeDetail("f5_skipped") |
| case !ok: |
| - p.Detail = "not run yet" |
| + p.Detail = wire.ProbeDetail("not_run") |
| case why != "": |
| - p.Detail = "not proven: " + why + " since it ran" |
| + p.Detail = wire.ProbeDetail(why) |
| case !fresh && d < 0: |
| - p.Detail = "not proven: the result is dated in the future" |
| + p.Detail = wire.ProbeDetail("future") |
| case !fresh: |
| - p.Detail = "not proven: it ran more than a day ago" |
| + p.Detail = wire.ProbeDetail("expired") |
| default: |
| for _, q := range r.Probes { |
| if q.ID == id { |
diff --git a/internal/runner/mac/fprobe/launch_a.go b/internal/runner/mac/fprobe/launch_a.go| index 954c3f2a..fbddb687 100644 |
| --- a/internal/runner/mac/fprobe/launch_a.go |
| +++ b/internal/runner/mac/fprobe/launch_a.go |
| @@ -94,7 +94,7 @@ type aRun struct { |
| func launchA(ctx context.Context, h Host) []wire.Probe { |
| d, err := newLaunchDir(h.Scratch) |
| if err != nil { |
| - return all(LaunchA, wire.ProbeUnavailable, "the probe tree could not be made") |
| + return all(LaunchA, wire.ProbeUnavailable, wire.ProbeDetail("tree_unmade")) |
| } |
| defer d.remove() |
| a := &aRun{h: h, d: d, control6: nonce(), setup: map[string]bool{}} |
| @@ -104,23 +104,23 @@ func launchA(ctx context.Context, h Host) []wire.Probe { |
| a.forms, a.formsErr = h.Secrets(ctx) |
| } |
| if err := a.plant(); err != nil { |
| - return all(LaunchA, wire.ProbeUnavailable, "the probe could not be prepared: "+err.Error()) |
| + return all(LaunchA, wire.ProbeUnavailable, wire.ProbeDetail("not_prepared")) |
| } |
| l, err := listen(h) |
| if err != nil { |
| - return all(LaunchA, wire.ProbeUnavailable, "no loopback port") |
| + return all(LaunchA, wire.ProbeUnavailable, wire.ProbeDetail("no_loopback")) |
| } |
| a.port = l.port() |
| if a.spec, err = d.spec(LaunchA, a.script(), false); err != nil { |
| l.close() |
| - return all(LaunchA, wire.ProbeUnavailable, "the probe script could not be written") |
| + return all(LaunchA, wire.ProbeUnavailable, wire.ProbeDetail("script_unwritten")) |
| } |
| a.spec.Prompt, a.spec.Limit = a.prompt(), h.limit(LaunchA) |
| if a.proj != "" { |
| // F7's project is an input the script reads: protected whole. |
| if err := d.protect(&a.spec, filepath.Dir(filepath.Dir(a.proj))); err != nil { |
| l.close() |
| - return all(LaunchA, wire.ProbeUnavailable, "the probe could not be prepared") |
| + return all(LaunchA, wire.ProbeUnavailable, wire.ProbeDetail("not_prepared")) |
| } |
| } |
| obs := a.ev.observer() |
| @@ -250,7 +250,7 @@ func (a *aRun) volumes() { |
| // or read there; homes that could not be listed leave F2 unproven. |
| func (a *aRun) homes() { |
| if a.h.Paths.HomesUnknown { |
| - a.unset = append(a.unset, "other homes") |
| + a.unset = append(a.unset, "other_homes") |
| return |
| } |
| list := slices.Clone(a.h.Paths.OtherHomes) |
| @@ -271,7 +271,7 @@ func (a *aRun) homes() { |
| if f, want := readable(home); f != "" { |
| a.places = append(a.places, target{name: name, path: f, want: want}) |
| } else { |
| - a.unset = append(a.unset, "other homes") |
| + a.unset = append(a.unset, "other_homes") |
| } |
| } |
| } |
| @@ -575,9 +575,9 @@ func (a *aRun) judge(ctx context.Context, hits int64) []wire.Probe { |
| // what was. |
| func verdict(id string, problems []string, denied string) wire.Probe { |
| if len(problems) == 0 { |
| - return wire.Probe{ID: id, Verdict: wire.ProbeDenied, Detail: clean(denied)} |
| + return wire.Probe{ID: id, Verdict: wire.ProbeDenied, Detail: denied} |
| } |
| - return wire.Probe{ID: id, Verdict: wire.ProbeFailed, Detail: clean(strings.Join(problems, "; "))} |
| + return wire.Probe{ID: id, Verdict: wire.ProbeFailed, Detail: wire.ProbeDetails(problems...)} |
| } |
| // expect checks that each named record is there and not 0 (the attempt |
| @@ -624,7 +624,7 @@ func outcomes(raw string) map[string][]string { |
| func said(problems []string, label string, names []string) []string { |
| if len(names) > 0 { |
| - problems = append(problems, label+": "+strings.Join(names, " ")) |
| + problems = append(problems, wire.ProbeDetail(label, strings.Join(names, " "))) |
| } |
| return problems |
| } |
| @@ -634,14 +634,14 @@ func said(problems []string, label string, names []string) []string { |
| func (a *aRun) f1(hits int64) wire.Probe { |
| var problems []string |
| if hits > 0 { |
| - problems = append(problems, fmt.Sprintf("the loopback listener saw %d connections", hits)) |
| + problems = append(problems, wire.ProbeDetail("loopback_hits", strconv.FormatInt(int64(hits), 10))) |
| } |
| allowed, unshown := expect(records(a.d.read("f1")), "tcp", "https", "https_local", "dns") |
| - problems = said(said(problems, "allowed", allowed), "not shown denied", unshown) |
| + problems = said(said(problems, "allowed", allowed), "not_shown_denied", unshown) |
| if !a.h.Resolve(context.Background(), dnsName) { |
| - problems = append(problems, "the DNS control failed outside the sandbox") |
| + problems = append(problems, wire.ProbeDetail("dns_control_failed")) |
| } |
| - return verdict("F1", problems, "tcp, https, loopback https and dns denied; the listener saw nothing") |
| + return verdict("F1", problems, wire.ProbeDetail("f1_denied")) |
| } |
| // f2: no place's file reached the scratch or the tree, and every read, |
| @@ -650,7 +650,7 @@ func (a *aRun) f1(hits int64) wire.Probe { |
| func (a *aRun) f2(places []target, found map[string][]string, whole bool) wire.Probe { |
| var problems, names, scratch, inTree []string |
| if !whole { |
| - problems = append(problems, "the tree could not be searched whole") |
| + problems = append(problems, wire.ProbeDetail("tree_unsearched")) |
| } |
| for _, tg := range places { |
| names = append(names, tg.name+".cat", tg.name+".cp", tg.name+".ln") |
| @@ -663,7 +663,7 @@ func (a *aRun) f2(places []target, found map[string][]string, whole bool) wire.P |
| } |
| } |
| allowed, unshown := expectWords(records(a.d.read("f2")), names...) |
| - problems = said(said(said(said(problems, "reached the scratch", scratch), "reached the tree", inTree), "allowed", allowed), "not shown denied", unshown) |
| + problems = said(said(said(said(problems, "reached_scratch", scratch), "reached_tree", inTree), "allowed", allowed), "not_shown_denied", unshown) |
| a.mu.Lock() |
| unset := slices.Clone(a.unset) |
| if !a.copied { |
| @@ -671,13 +671,13 @@ func (a *aRun) f2(places []target, found map[string][]string, whole bool) wire.P |
| } |
| a.mu.Unlock() |
| if len(problems) == 0 && len(unset) > 0 { |
| - return wire.Probe{ID: "F2", Verdict: wire.ProbeUnavailable, Detail: clean("not set up: " + strings.Join(slices.Compact(unset), ", "))} |
| + return wire.Probe{ID: "F2", Verdict: wire.ProbeUnavailable, Detail: wire.ProbeDetail("not_set_up", strings.Join(slices.Compact(unset), " "))} |
| } |
| - detail := fmt.Sprintf("%d places denied to reads, copies and hard links", len(places)) |
| + detail := wire.ProbeDetail("f2_denied", strconv.Itoa(len(places))) |
| if a.unix { |
| // The controller's exception (task 14 brief): a home closed to |
| // the runner user by the OS is not the sandbox's to deny. |
| - detail += "; another home: not applicable, protected by the OS" |
| + detail = wire.ProbeDetails(detail, wire.ProbeDetail("other_home_os")) |
| } |
| return verdict("F2", problems, detail) |
| } |
| @@ -692,13 +692,13 @@ func (a *aRun) f3(found map[string][]string, whole bool, forms [][]byte, secretE |
| var problems []string |
| switch { |
| case !whole: |
| - problems = append(problems, "the tree could not be searched whole") |
| + problems = append(problems, wire.ProbeDetail("tree_unsearched")) |
| case secretErr != nil || a.h.Secrets == nil: |
| - problems = append(problems, "the known secrets could not be read") |
| + problems = append(problems, wire.ProbeDetail("secrets_unreadable")) |
| case len(a.tokens) == 0: |
| - problems = append(problems, "no token file to try") |
| + problems = append(problems, wire.ProbeDetail("no_token_file")) |
| case a.h.Runner == "": |
| - problems = append(problems, "no procargs reader") |
| + problems = append(problems, wire.ProbeDetail("no_procargs_reader")) |
| } |
| rec := outcomes(a.d.read("f3")) |
| word := func(name string) string { |
| @@ -749,7 +749,7 @@ func (a *aRun) f3(found map[string][]string, whole bool, forms [][]byte, secretE |
| } |
| } |
| if psControl && !psOK { |
| - problems = append(problems, "the outside ps control failed") |
| + problems = append(problems, wire.ProbeDetail("ps_control_failed")) |
| } |
| for i := range a.tokens { |
| n := "file" + strconv.Itoa(i) |
| @@ -770,15 +770,15 @@ func (a *aRun) f3(found map[string][]string, whole bool, forms [][]byte, secretE |
| case word("cli") == "allowed": |
| reached = append(reached, "cli") |
| case !ran || pid == 0 || len(f) >= 2 && f[1] != strconv.Itoa(pid): |
| - problems = append(problems, "the procargs reader did not run in the sandbox") |
| + problems = append(problems, wire.ProbeDetail("procargs_not_sandboxed")) |
| case !whole2("cli"): |
| - problems = append(problems, "the procargs reader did not complete") |
| + problems = append(problems, wire.ProbeDetail("procargs_incomplete")) |
| } |
| switch f := rec["procs"]; { |
| case word("procs") == "allowed": |
| reached = append(reached, "procs") |
| case word("procs") == "failed" || len(f) == 3 && f[2] != "self=yes": |
| - problems = append(problems, "the process list could not be read") |
| + problems = append(problems, wire.ProbeDetail("process_list_unreadable")) |
| case len(f) != 3 || status("procs") != "0": |
| unshown = append(unshown, "procs") |
| } |
| @@ -788,22 +788,22 @@ 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, "a pipe is open in Bash: "+strings.TrimPrefix(f[2], "pipes=")) |
| + problems = append(problems, wire.ProbeDetail("pipe_open", strings.TrimPrefix(f[2], "pipes="))) |
| } |
| var scratch, inTree []string |
| for _, k := range []string{"secret", "token-shape"} { |
| s, t := where(found[k]) |
| scratch, inTree = append(scratch, s...), append(inTree, t...) |
| } |
| - problems = said(said(problems, "a token reached the scratch from", slices.Compact(sorted(scratch))), "a token reached the tree from", slices.Compact(sorted(inTree))) |
| - problems = said(said(problems, "a token reached", reached), "not shown tried", unshown) |
| + problems = said(said(problems, "token_reached_scratch", slices.Compact(sorted(scratch))), "token_reached_tree", slices.Compact(sorted(inTree))) |
| + problems = said(said(problems, "token_reached", reached), "not_shown_tried", unshown) |
| switch { |
| case outErr != nil || !bytes.Contains(outside, []byte(claude.DarwinMarkerEnv+"=")): |
| - problems = append(problems, "the outside reader could not see the CLI's environment") |
| + problems = append(problems, wire.ProbeDetail("env_unreadable")) |
| case slices.ContainsFunc(forms, func(f []byte) bool { return len(f) > 0 && bytes.Contains(outside, f) }): |
| - problems = append(problems, "the token is in the CLI's environment") |
| + problems = append(problems, wire.ProbeDetail("token_in_env")) |
| } |
| - return verdict("F3", problems, "no token from the token file, the environments, KERN_PROCARGS2, launchd or descriptors") |
| + return verdict("F3", problems, wire.ProbeDetail("f3_denied")) |
| } |
| // permissionDenied is the CLI's word that it refused a tool by |
| @@ -867,7 +867,7 @@ func (a *aRun) f6(places []target, forms [][]byte) wire.Probe { |
| } |
| } |
| if !control { |
| - problems = append(problems, "the control read did not arrive") |
| + problems = append(problems, wire.ProbeDetail("control_read_missing")) |
| } |
| var leaks [][]byte |
| for _, tg := range places { |
| @@ -914,9 +914,9 @@ func (a *aRun) f6(places []target, forms [][]byte) wire.Probe { |
| } |
| } |
| if reached { |
| - problems = append(problems, "a denied file or a secret reached the model") |
| + problems = append(problems, wire.ProbeDetail("reached_model")) |
| } |
| - problems = said(said(said(said(problems, "allowed", allowed), "not shown made", unshown), "not as prescribed", unprescribed), "neither refused nor observed", unobserved) |
| + problems = said(said(said(said(problems, "allowed", allowed), "not_shown_made", unshown), "not_prescribed", unprescribed), "unobserved", unobserved) |
| a.mu.Lock() |
| var unset []string |
| for k, ok := range a.setup { |
| @@ -925,24 +925,24 @@ func (a *aRun) f6(places []target, forms [][]byte) wire.Probe { |
| } |
| } |
| if a.flips[0] == 0 || a.flips[1] == 0 { |
| - unset = append(unset, "the swap did not alternate") |
| + unset = append(unset, "swap") |
| } |
| if !a.late { |
| - unset = append(unset, "the late name") |
| + unset = append(unset, "late_name") |
| } |
| a.mu.Unlock() |
| - problems = said(problems, "not set up", sorted(unset)) |
| + problems = said(problems, "not_set_up", sorted(unset)) |
| for _, c := range a.calls { |
| if c.tool == "Write" && !strings.HasPrefix(c.path, a.d.t.root+"/") { |
| if _, err := os.Lstat(c.path); err == nil { |
| - problems = append(problems, "a write reached a denied place") |
| + problems = append(problems, wire.ProbeDetail("write_denied_place")) |
| break |
| } |
| } |
| } |
| for _, tg := range places { |
| if b, _ := readFile(tg.path, 1<<10); tg.planted && !bytes.HasPrefix(b, tg.want) { |
| - problems = append(problems, "a write reached "+tg.name+" through a link") |
| + problems = append(problems, wire.ProbeDetail("write_through_link", tg.name)) |
| } |
| } |
| var ln, linked []string |
| @@ -953,15 +953,15 @@ func (a *aRun) f6(places []target, forms [][]byte) wire.Probe { |
| } |
| } |
| _, unshownLn := expect(records(a.d.read("f6")), ln...) |
| - problems = said(said(problems, "the shell hard-linked", linked), "hard link not shown refused", unshownLn) |
| - return verdict("F6", problems, fmt.Sprintf("%d native calls refused, the swapped link 50 times, the late name", len(a.calls))) |
| + problems = said(said(problems, "hard_linked", linked), "link_not_refused", unshownLn) |
| + return verdict("F6", problems, wire.ProbeDetail("f6_denied", strconv.Itoa(len(a.calls)))) |
| } |
| // f7: inside the sandbox xcodebuild, simctl and the CoreSimulator lookup |
| // each failed; outside, the same each worked (the control). |
| func (a *aRun) f7(ctx context.Context) wire.Probe { |
| if a.proj == "" || a.h.Tools.Xcrun == "" { |
| - return wire.Probe{ID: "F7", Verdict: wire.ProbeUnavailable, Detail: "no Xcode, so this cannot be shown"} |
| + return wire.Probe{ID: "F7", Verdict: wire.ProbeUnavailable, Detail: wire.ProbeDetail("no_xcode")} |
| } |
| var problems []string |
| rec := records(a.d.read("f7")) |
| @@ -971,7 +971,7 @@ func (a *aRun) f7(ctx context.Context) wire.Probe { |
| } else if strings.TrimSpace(a.d.read("f7.mach")) == "port" { |
| allowed = append(allowed, "mach") |
| } |
| - problems = said(said(problems, "allowed", allowed), "not shown denied", unshown) |
| + problems = said(said(problems, "allowed", allowed), "not_shown_denied", unshown) |
| q := func(name string, args ...string) (string, bool) { |
| c, cancel := context.WithTimeout(ctx, 2*time.Minute) |
| defer cancel() |
| @@ -988,6 +988,6 @@ func (a *aRun) f7(ctx context.Context) wire.Probe { |
| if out, ok := q("/usr/bin/osascript", "-l", "JavaScript", "-e", machJXA); !ok || strings.TrimSpace(out) != "port" { |
| outside = append(outside, "mach") |
| } |
| - problems = said(problems, "the control failed outside the sandbox", outside) |
| - return verdict("F7", problems, "xcodebuild, simctl and the CoreSimulator lookup denied; each works outside") |
| + problems = said(problems, "control_failed", outside) |
| + return verdict("F7", problems, wire.ProbeDetail("f7_denied")) |
| } |
diff --git a/internal/runner/mac/fprobe/launch_bc.go b/internal/runner/mac/fprobe/launch_bc.go| index c35b76cd..46aa0976 100644 |
| --- a/internal/runner/mac/fprobe/launch_bc.go |
| +++ b/internal/runner/mac/fprobe/launch_bc.go |
| @@ -28,15 +28,15 @@ func launchB(ctx context.Context, h Host) []wire.Probe { |
| sim, ok := mac.NewestIPhone(h.Simulators) |
| switch { |
| case !h.P2Denied: |
| - return all(LaunchB, wire.ProbeSkipped, "P2 is not denied, so Xcode runs only in checks") |
| + return all(LaunchB, wire.ProbeSkipped, wire.ProbeDetail("f5_skipped")) |
| case h.Tools.Xcodebuild == "" || h.Tools.Xcrun == "": |
| - return all(LaunchB, wire.ProbeUnavailable, "no Xcode") |
| + return all(LaunchB, wire.ProbeUnavailable, wire.ProbeDetail("no_xcode")) |
| case !ok: |
| - return all(LaunchB, wire.ProbeUnavailable, "no iOS simulator") |
| + return all(LaunchB, wire.ProbeUnavailable, wire.ProbeDetail("no_simulator")) |
| } |
| d, err := newLaunchDir(h.Scratch) |
| if err != nil { |
| - return all(LaunchB, wire.ProbeUnavailable, "the probe tree could not be made") |
| + return all(LaunchB, wire.ProbeUnavailable, wire.ProbeDetail("tree_unmade")) |
| } |
| defer d.remove() |
| // The whole fixture, and the targets it reads, beside the script in |
| @@ -44,13 +44,13 @@ func launchB(ctx context.Context, h Host) []wire.Probe { |
| // go to the scratch ($TMPDIR), as P2's script puts them. |
| root, err := mac.CopyFixture(filepath.Join(d.bin, "f5")) |
| if err != nil { |
| - return all(LaunchB, wire.ProbeUnavailable, "the fixture could not be copied") |
| + return all(LaunchB, wire.ProbeUnavailable, wire.ProbeDetail("fixture_uncopied")) |
| } |
| facts := mac.P2Facts{Accepted: map[string]bool{}} |
| secret := strings.TrimPrefix(nonce(), "EQUIPO-NONCE-") |
| sentinel := filepath.Join(h.Paths.StateDir, "equipo-fprobe-f5-"+secret[:8]) |
| if !filepath.IsAbs(sentinel) || os.WriteFile(sentinel, []byte(secret), 0o600) != nil { |
| - return all(LaunchB, wire.ProbeUnavailable, "no sentinel in the state dir") |
| + return all(LaunchB, wire.ProbeUnavailable, wire.ProbeDetail("no_sentinel")) |
| } |
| defer os.Remove(sentinel) |
| token := "sk-ant-oat01-probe-" + hex.EncodeToString([]byte(secret[:8])) + secret |
| @@ -69,7 +69,7 @@ func launchB(ctx context.Context, h Host) []wire.Probe { |
| for _, place := range []string{"script", "plugin", "test"} { |
| l, err := listen(h) |
| if err != nil { |
| - return all(LaunchB, wire.ProbeUnavailable, "no loopback port") |
| + return all(LaunchB, wire.ProbeUnavailable, wire.ProbeDetail("no_loopback")) |
| } |
| ports = append(ports, l) |
| defer l.close() |
| @@ -87,7 +87,7 @@ func launchB(ctx context.Context, h Host) []wire.Probe { |
| } |
| targets = append(targets, "keychain="+service) |
| if err := os.WriteFile(filepath.Join(root, "equipo-targets.txt"), []byte(strings.Join(targets, "\n")+"\n"), 0o600); err != nil { |
| - return all(LaunchB, wire.ProbeUnavailable, "the fixture could not be prepared") |
| + return all(LaunchB, wire.ProbeUnavailable, wire.ProbeDetail("fixture_unprepared")) |
| } |
| o := quote(filepath.Join(d.run, "out")) |
| script := "#!/bin/bash\n# Equipo's probe F5: P2's hostile fixture under Claude's sandbox.\nn=\"$1\"\nmkdir -p " + o + " || exit 0\nprintf 'begin %s\\n' \"$n\" > " + o + "/begin\n" + |
| @@ -97,7 +97,7 @@ func launchB(ctx context.Context, h Host) []wire.Probe { |
| err = d.protect(&spec, root) |
| } |
| if err != nil { |
| - return all(LaunchB, wire.ProbeUnavailable, "the probe script could not be written") |
| + return all(LaunchB, wire.ProbeUnavailable, wire.ProbeDetail("script_unwritten")) |
| } |
| spec.Limit = h.limit(LaunchB) |
| spec.Prompt = "[Equipo: engineering] This is a check of this Mac's sandbox, not a task: there is nothing to change. Do exactly this and nothing else.\n\n" + |
| @@ -115,7 +115,7 @@ func launchB(ctx context.Context, h Host) []wire.Probe { |
| log := d.read("f5.log") |
| judge, groups := mac.JudgeP2(mac.ParseAttempts(log), facts) |
| var problems []string |
| - for _, g := range []struct{ key, label string }{{"allowed", "allowed"}, {"unknown", "not shown denied"}} { |
| + for _, g := range []struct{ key, label string }{{"allowed", "allowed"}, {"unknown", "not_shown_denied"}} { |
| problems = said(problems, g.label, groups[g.key]) |
| } |
| var unfinished []string |
| @@ -124,34 +124,36 @@ func launchB(ctx context.Context, h Host) []wire.Probe { |
| unfinished = append(unfinished, phase) |
| } |
| } |
| - problems = said(problems, "did not complete", unfinished) |
| + problems = said(problems, "incomplete", unfinished) |
| needles := map[string][][]byte{"state": {[]byte(secret)}, "token": {[]byte(token)}, "token-shape": {[]byte("sk-ant-oat01-")}} |
| if h.Secrets == nil { |
| - problems = append(problems, "the known secrets could not be read") |
| + problems = append(problems, wire.ProbeDetail("secrets_unreadable")) |
| } else if forms, err := h.Secrets(ctx); err != nil { |
| - problems = append(problems, "the known secrets could not be read") |
| + problems = append(problems, wire.ProbeDetail("secrets_unreadable")) |
| } else { |
| needles["secret"] = forms |
| } |
| found, whole := d.find(needles) |
| - for _, k := range []struct{ key, label string }{{"state", "the state sentinel"}, {"token", "the sentinel token"}, {"secret", "a secret"}, {"token-shape", "a token"}} { |
| - scratch, inTree := where(found[k.key]) |
| + var toScratch, toTree []string |
| + for _, k := range []string{"state", "token", "secret", "token-shape"} { |
| + scratch, inTree := where(found[k]) |
| if len(scratch) > 0 { |
| - problems = append(problems, k.label+" reached the scratch") |
| + toScratch = append(toScratch, k) |
| } |
| if len(inTree) > 0 { |
| - problems = append(problems, k.label+" reached the tree") |
| + toTree = append(toTree, k) |
| } |
| } |
| + problems = said(said(problems, "reached_scratch", toScratch), "reached_tree", toTree) |
| if !whole { |
| - problems = append(problems, "the tree could not be searched whole") |
| + problems = append(problems, wire.ProbeDetail("tree_unsearched")) |
| } |
| if judge != wire.ProbeDenied && len(problems) == 0 { |
| - problems = append(problems, "not every attempt was shown denied") |
| + problems = append(problems, wire.ProbeDetail("not_all_denied")) |
| } |
| - detail := "every hostile attempt denied, every token source too; the build and test completed" |
| + detail := wire.ProbeDetail("f5_denied") |
| if len(groups["unix"]) > 0 { |
| - detail += "; another home closed by Unix permissions too" |
| + detail = wire.ProbeDetails(detail, wire.ProbeDetail("unix_home")) |
| } |
| return ev.judged([]wire.Probe{verdict("F5", problems, detail)}, spec, d) |
| } |
| @@ -179,7 +181,7 @@ const childPoll = 250 * time.Millisecond |
| func launchC(ctx context.Context, h Host) []wire.Probe { |
| d, err := newLaunchDir(h.Scratch) |
| if err != nil { |
| - return all(LaunchC, wire.ProbeUnavailable, "the probe tree could not be made") |
| + return all(LaunchC, wire.ProbeUnavailable, wire.ProbeDetail("tree_unmade")) |
| } |
| defer d.remove() |
| o := quote(filepath.Join(d.run, "out")) |
| @@ -190,7 +192,7 @@ func launchC(ctx context.Context, h Host) []wire.Probe { |
| "echo \"$!\" > " + o + "/f4.pid\n/bin/sleep 600\n" |
| spec, err := d.spec(LaunchC, script, false) |
| if err != nil { |
| - return all(LaunchC, wire.ProbeUnavailable, "the probe script could not be written") |
| + return all(LaunchC, wire.ProbeUnavailable, wire.ProbeDetail("script_unwritten")) |
| } |
| spec.Limit = h.limit(LaunchC) |
| spec.Prompt = "[Equipo: engineering] This is a check of this Mac's sandbox, not a task: there is nothing to change. Do exactly this and nothing else.\n\n" + |
| @@ -225,17 +227,17 @@ func launchC(ctx context.Context, h Host) []wire.Probe { |
| if p := launched(LaunchC, out); p != nil { |
| return p |
| } |
| - f4 := wire.Probe{ID: "F4", Verdict: wire.ProbePassed, Detail: "the child, in a session of its own, ended with the launch; its end proven"} |
| + f4 := wire.Probe{ID: "F4", Verdict: wire.ProbePassed, Detail: wire.ProbeDetail("f4_passed")} |
| alive, known := h.alive(child.ID) |
| switch { |
| case child.PID == 0: |
| - f4 = wire.Probe{ID: "F4", Verdict: wire.ProbeFailed, Detail: "the child was not shown started"} |
| + f4 = wire.Probe{ID: "F4", Verdict: wire.ProbeFailed, Detail: wire.ProbeDetail("child_not_started")} |
| case child.SID != child.PID: |
| - f4 = wire.Probe{ID: "F4", Verdict: wire.ProbeFailed, Detail: "the child was not in a session of its own"} |
| + f4 = wire.Probe{ID: "F4", Verdict: wire.ProbeFailed, Detail: wire.ProbeDetail("child_not_own_session")} |
| case alive: |
| - f4 = wire.Probe{ID: "F4", Verdict: wire.ProbeFailed, Detail: "the child outlived the launch's stop"} |
| + f4 = wire.Probe{ID: "F4", Verdict: wire.ProbeFailed, Detail: wire.ProbeDetail("child_outlived")} |
| case !known: |
| - f4 = wire.Probe{ID: "F4", Verdict: wire.ProbeFailed, Detail: "the child could not be shown gone"} |
| + f4 = wire.Probe{ID: "F4", Verdict: wire.ProbeFailed, Detail: wire.ProbeDetail("child_not_gone")} |
| } |
| return ev.judgedEnd([]wire.Probe{f4}, spec, d, false) |
| } |
diff --git a/internal/runner/mac/fprobe/probe_engineering_test.go b/internal/runner/mac/fprobe/probe_engineering_test.go| index 0e41d345..7f93b721 100644 |
| --- a/internal/runner/mac/fprobe/probe_engineering_test.go |
| +++ b/internal/runner/mac/fprobe/probe_engineering_test.go |
| @@ -490,11 +490,24 @@ func (m *fakeMac) runA(t *testing.T) []wire.Probe { |
| if strings.Contains(string(raw), m.dir) || strings.Contains(string(raw), "EQUIPO-NONCE") || strings.Contains(string(raw), fakeToken) { |
| t.Fatalf("a path, nonce or secret in a detail: %s", raw) |
| } |
| + coded(t, ps) |
| return ps |
| } |
| +// coded: every detail is codes with parameters (wire.ProbeDetail), none |
| +// empty, never words (whole-branch fix 1, #6). |
| +func coded(t *testing.T, ps []wire.Probe) { |
| + t.Helper() |
| + for _, p := range ps { |
| + if parts, ok := wire.ParseProbeDetail(p.Detail); !ok || len(parts) == 0 { |
| + t.Fatalf("%s: detail %q is not coded", p.ID, p.Detail) |
| + } |
| + } |
| +} |
| + |
| func want(t *testing.T, ps []wire.Probe, id, verdict, detail string) { |
| t.Helper() |
| + coded(t, ps) |
| p := byID(ps, id) |
| if p.Verdict != verdict || !strings.Contains(p.Detail, detail) { |
| t.Fatalf("%s: want %s with %q, got %+v", id, verdict, detail, p) |
| @@ -591,11 +604,11 @@ func TestF1RequiresControlAndListener(t *testing.T) { |
| resolv bool |
| detail string |
| }{ |
| - {"listener", shell{rec: rec, connect: true}, true, "the loopback listener saw 1 connections"}, |
| - {"missing line", shell{rec: rec, drop: map[string]bool{"dns": true}}, true, "not shown denied: dns"}, |
| - {"allowed", shell{rec: rec, codes: map[string]string{"https": "0"}}, true, "allowed: https"}, |
| - {"dns control", shell{rec: rec}, false, "the DNS control failed outside the sandbox"}, |
| - {"no control", shell{rec: rec, nonce: "EQUIPO-NONCE-1"}, true, "not this run's"}, |
| + {"listener", shell{rec: rec, connect: true}, true, "loopback_hits:1"}, |
| + {"missing line", shell{rec: rec, drop: map[string]bool{"dns": true}}, true, "not_shown_denied:dns"}, |
| + {"allowed", shell{rec: rec, codes: map[string]string{"https": "0"}}, true, "allowed:https"}, |
| + {"dns control", shell{rec: rec}, false, "dns_control_failed"}, |
| + {"no control", shell{rec: rec, nonce: "EQUIPO-NONCE-1"}, true, "records_foreign"}, |
| } { |
| t.Run(c.name, func(t *testing.T) { |
| m := newFakeMac(t) |
| @@ -619,13 +632,13 @@ func TestF2NoncesDecide(t *testing.T) { |
| c cli |
| verdict string |
| }{ |
| - {"copied though denied", "reached the scratch: state", cli{sh: shell{rec: rec, leak: "state"}, out: ok}, wire.ProbeFailed}, |
| - {"the runtime copy", "reached the scratch: copy", cli{sh: shell{rec: rec, leak: "copy"}, out: ok}, wire.ProbeFailed}, |
| - {"through /Volumes", "reached the scratch: volumes", cli{sh: shell{rec: rec, leak: "volumes"}, out: ok}, wire.ProbeFailed}, |
| - {"hard link", "reached the tree: state accounts runtime keychains", cli{sh: shell{rec: rec, link: true}, out: ok}, wire.ProbeFailed}, |
| - {"missing line", "not shown denied: keychains.ln", cli{sh: shell{rec: rec, drop: map[string]bool{"keychains.ln": true}}, out: ok}, wire.ProbeFailed}, |
| - {"read allowed", "allowed: copy.cat", cli{sh: shell{rec: rec, codes: map[string]string{"copy.cat": "allowed"}}, out: ok}, wire.ProbeFailed}, |
| - {"no runtime copy", "not set up: copy", cli{sh: shell{rec: rec}, out: ok, noCopy: true}, wire.ProbeUnavailable}, |
| + {"copied though denied", "reached_scratch:state", cli{sh: shell{rec: rec, leak: "state"}, out: ok}, wire.ProbeFailed}, |
| + {"the runtime copy", "reached_scratch:copy", cli{sh: shell{rec: rec, leak: "copy"}, out: ok}, wire.ProbeFailed}, |
| + {"through /Volumes", "reached_scratch:volumes", cli{sh: shell{rec: rec, leak: "volumes"}, out: ok}, wire.ProbeFailed}, |
| + {"hard link", "reached_tree:state accounts runtime keychains", cli{sh: shell{rec: rec, link: true}, out: ok}, wire.ProbeFailed}, |
| + {"missing line", "not_shown_denied:keychains.ln", cli{sh: shell{rec: rec, drop: map[string]bool{"keychains.ln": true}}, out: ok}, wire.ProbeFailed}, |
| + {"read allowed", "allowed:copy.cat", cli{sh: shell{rec: rec, codes: map[string]string{"copy.cat": "allowed"}}, out: ok}, wire.ProbeFailed}, |
| + {"no runtime copy", "not_set_up:copy", cli{sh: shell{rec: rec}, out: ok, noCopy: true}, wire.ProbeUnavailable}, |
| } { |
| t.Run(c.name, func(t *testing.T) { |
| m := newFakeMac(t) |
| @@ -637,13 +650,13 @@ func TestF2NoncesDecide(t *testing.T) { |
| m := newFakeMac(t) |
| os.Remove(filepath.Join(volumesDir, "Macintosh HD")) |
| m.launchWith(t, holding(t)) |
| - want(t, m.runA(t), "F2", wire.ProbeUnavailable, "not set up: volumes") |
| + want(t, m.runA(t), "F2", wire.ProbeUnavailable, "not_set_up:volumes") |
| }) |
| t.Run("homes unknown", func(t *testing.T) { |
| m := newFakeMac(t) |
| m.h.Paths.HomesUnknown = true |
| m.launchWith(t, holding(t)) |
| - want(t, m.runA(t), "F2", wire.ProbeUnavailable, "not set up: other homes") |
| + want(t, m.runA(t), "F2", wire.ProbeUnavailable, "not_set_up:other_homes") |
| }) |
| t.Run("a readable other home", func(t *testing.T) { |
| m := newFakeMac(t) |
| @@ -652,7 +665,7 @@ func TestF2NoncesDecide(t *testing.T) { |
| m.h.Paths.OtherHomes = []string{other} |
| m.h.Exposed = func(h string) bool { return h == other } |
| m.launchWith(t, cli{sh: shell{rec: rec, leak: "home"}, out: ok}) |
| - want(t, m.runA(t), "F2", wire.ProbeFailed, "reached the scratch: home") |
| + want(t, m.runA(t), "F2", wire.ProbeFailed, "reached_scratch:home") |
| m.launchWith(t, holding(t)) |
| want(t, m.runA(t), "F2", wire.ProbeDenied, "") |
| }) |
| @@ -660,13 +673,13 @@ func TestF2NoncesDecide(t *testing.T) { |
| m := newFakeMac(t) |
| m.h.Paths.OtherHomes = []string{"/Users/Shared", "/Users/paul"} |
| m.launchWith(t, holding(t)) |
| - want(t, m.runA(t), "F2", wire.ProbeDenied, "another home: not applicable, protected by the OS") |
| + want(t, m.runA(t), "F2", wire.ProbeDenied, "other_home_os") |
| }) |
| t.Run("a sentinel that cannot be planted", func(t *testing.T) { |
| m := newFakeMac(t) |
| m.h.RuntimeRoot = "relative" |
| m.launchWith(t, holding(t)) |
| - want(t, m.runA(t), "F2", wire.ProbeUnavailable, "not set up: runtime") |
| + want(t, m.runA(t), "F2", wire.ProbeUnavailable, "not_set_up:runtime") |
| }) |
| } |
| @@ -687,7 +700,7 @@ func TestF3AnySourceFails(t *testing.T) { |
| sh.f3[source+".rc"] = source + ".rc 0" |
| } |
| m.launchWith(t, cli{sh: sh, out: ok}) |
| - want(t, m.runA(t), "F3", wire.ProbeFailed, "a token reached: "+source) |
| + want(t, m.runA(t), "F3", wire.ProbeFailed, "token_reached:"+source) |
| }) |
| } |
| cases := []struct { |
| @@ -696,48 +709,48 @@ func TestF3AnySourceFails(t *testing.T) { |
| mut func(*Host) |
| detail string |
| }{ |
| - {"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, "a token reached the scratch from: 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, "a token reached the scratch from: y"}, |
| - {"pipe descriptor", cli{sh: shell{rec: rec, f3: map[string]string{"fds": "fds denied n=4 pipes=3"}}, out: ok}, nil, "a pipe is open in Bash: 3"}, |
| - {"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, "the procargs reader did not run in the sandbox"}, |
| - {"reader cut short", cli{sh: shell{rec: rec, f3: map[string]string{"cli": "cli denied", "cli.rc": "cli.rc 0"}}, out: ok}, nil, "the procargs reader did not complete"}, |
| - {"reader at another pid", cli{sh: shell{rec: rec, f3: map[string]string{"cli": "cli denied 1 ok", "cli.rc": "cli.rc 0"}}, out: ok}, nil, "the procargs reader did not run in the sandbox"}, |
| - {"reader's status does not match", cli{sh: shell{rec: rec, f3: map[string]string{"cli": "cli denied PID ok", "cli.rc": "cli.rc 1"}}, out: ok}, nil, "the procargs reader did not complete"}, |
| - {"reader crashed", cli{sh: shell{rec: rec, f3: map[string]string{"cli": "", "cli.rc": "cli.rc 139"}}, out: ok}, nil, "the procargs reader did not run in the sandbox"}, |
| - {"process list failed", cli{sh: shell{rec: rec, f3: map[string]string{"procs": "procs failed", "procs.rc": "procs.rc 1"}}, out: ok}, nil, "the process list could not be read"}, |
| - {"process list without the shell", cli{sh: shell{rec: rec, f3: map[string]string{"procs": "procs failed n=3 self=no", "procs.rc": "procs.rc 1"}}, out: ok}, nil, "the process list could not be read"}, |
| - {"a denial from a list without the shell", cli{sh: shell{rec: rec, f3: map[string]string{"procs": "procs denied n=3 self=no", "procs.rc": "procs.rc 0"}}, out: ok}, nil, "the process list could not be read"}, |
| + {"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"}, |
| + {"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"}, |
| + {"reader at another pid", cli{sh: shell{rec: rec, f3: map[string]string{"cli": "cli denied 1 ok", "cli.rc": "cli.rc 0"}}, out: ok}, nil, "procargs_not_sandboxed"}, |
| + {"reader's status does not match", cli{sh: shell{rec: rec, f3: map[string]string{"cli": "cli denied PID ok", "cli.rc": "cli.rc 1"}}, out: ok}, nil, "procargs_incomplete"}, |
| + {"reader crashed", cli{sh: shell{rec: rec, f3: map[string]string{"cli": "", "cli.rc": "cli.rc 139"}}, out: ok}, nil, "procargs_not_sandboxed"}, |
| + {"process list failed", cli{sh: shell{rec: rec, f3: map[string]string{"procs": "procs failed", "procs.rc": "procs.rc 1"}}, out: ok}, nil, "process_list_unreadable"}, |
| + {"process list without the shell", cli{sh: shell{rec: rec, f3: map[string]string{"procs": "procs failed n=3 self=no", "procs.rc": "procs.rc 1"}}, out: ok}, nil, "process_list_unreadable"}, |
| + {"a denial from a list without the shell", cli{sh: shell{rec: rec, f3: map[string]string{"procs": "procs denied n=3 self=no", "procs.rc": "procs.rc 0"}}, out: ok}, nil, "process_list_unreadable"}, |
| {"outside control fails", holding(t), func(h *Host) { |
| h.ProcArgs = func(int) ([]byte, error) { return nil, errors.New("no") } |
| - }, "the outside reader could not see the CLI's environment"}, |
| + }, "env_unreadable"}, |
| {"outside control misses the marker", holding(t), func(h *Host) { |
| h.ProcArgs = func(int) ([]byte, error) { return []byte("PATH=/usr/bin"), nil } |
| - }, "the outside reader could not see the CLI's environment"}, |
| + }, "env_unreadable"}, |
| {"token in the CLI's environment", holding(t), func(h *Host) { |
| h.ProcArgs = func(int) ([]byte, error) { |
| return []byte("EQUIPO_ATTEMPT=fprobe-x\x00CLAUDE_CODE_OAUTH_TOKEN=" + fakeToken), nil |
| } |
| - }, "the token is in the CLI's environment"}, |
| - {"no reader", holding(t), func(h *Host) { h.Runner = "" }, "no procargs reader"}, |
| - {"no outside ps control", holding(t), nil, "the outside ps control failed"}, |
| - {"not tried", cli{sh: shell{rec: rec, f3: map[string]string{"launchctl": ""}}, out: ok}, nil, "not shown tried: launchctl"}, |
| - {"a scan that failed", cli{sh: shell{rec: rec, f3: map[string]string{"env": "env failed"}}, out: ok}, nil, "not shown tried: env"}, |
| + }, "token_in_env"}, |
| + {"no reader", holding(t), func(h *Host) { h.Runner = "" }, "no_procargs_reader"}, |
| + {"no outside ps control", holding(t), nil, "ps_control_failed"}, |
| + {"not tried", cli{sh: shell{rec: rec, f3: map[string]string{"launchctl": ""}}, out: ok}, nil, "not_shown_tried:launchctl"}, |
| + {"a scan that failed", cli{sh: shell{rec: rec, f3: map[string]string{"env": "env failed"}}, out: ok}, nil, "not_shown_tried:env"}, |
| // #2 (final review): env's producer and its control marker. |
| - {"env did not run", cli{sh: shell{rec: rec, f3: map[string]string{"env.rc": "env.rc 127"}}, out: ok}, nil, "not shown tried: env"}, |
| - {"env gave nothing", cli{sh: shell{rec: rec, f3: map[string]string{"env": "env failed", "env.scan": "env.scan 1"}}, out: ok}, nil, "not shown tried: env"}, |
| - {"env's scan failed", cli{sh: shell{rec: rec, f3: map[string]string{"env": "env denied", "env.scan": "env.scan 1"}}, out: ok}, nil, "not shown tried: env"}, |
| + {"env did not run", cli{sh: shell{rec: rec, f3: map[string]string{"env.rc": "env.rc 127"}}, out: ok}, nil, "not_shown_tried:env"}, |
| + {"env gave nothing", cli{sh: shell{rec: rec, f3: map[string]string{"env": "env failed", "env.scan": "env.scan 1"}}, out: ok}, nil, "not_shown_tried:env"}, |
| + {"env's scan failed", cli{sh: shell{rec: rec, f3: map[string]string{"env": "env denied", "env.scan": "env.scan 1"}}, out: ok}, nil, "not_shown_tried:env"}, |
| // #3: both ps -E attempts, each its own observation; a refused |
| // exec is a denial only with the outside control. |
| - {"ps of the parent gave the token", cli{sh: shell{rec: rec, f3: map[string]string{"psppid": "psppid allowed", "psppid.rc": "psppid.rc 0", "psppid.scan": "psppid.scan 0"}}, out: ok}, nil, "a token reached: psppid"}, |
| - {"ps of own processes gave the token", cli{sh: shell{rec: rec, f3: map[string]string{"psown": "psown allowed", "psown.rc": "psown.rc 0", "psown.scan": "psown.scan 0"}}, out: ok}, nil, "a token reached: psown"}, |
| - {"ps ran and gave nothing", cli{sh: shell{rec: rec, f3: map[string]string{"psown": "psown failed", "psown.rc": "psown.rc 0", "psown.scan": "psown.scan 1"}}, out: ok}, nil, "not shown tried: psown"}, |
| - {"ps failed otherwise", cli{sh: shell{rec: rec, f3: map[string]string{"psppid.rc": "psppid.rc 1"}}, out: ok}, nil, "not shown tried: psppid"}, |
| - {"ps not tried", cli{sh: shell{rec: rec, f3: map[string]string{"psown": "", "psown.rc": "", "psown.scan": ""}}, out: ok}, nil, "not shown tried: psown"}, |
| - {"no token file", holding(t), func(h *Host) { h.TokenFiles = nil }, "no token file to try"}, |
| + {"ps of the parent gave the token", cli{sh: shell{rec: rec, f3: map[string]string{"psppid": "psppid allowed", "psppid.rc": "psppid.rc 0", "psppid.scan": "psppid.scan 0"}}, out: ok}, nil, "token_reached:psppid"}, |
| + {"ps of own processes gave the token", cli{sh: shell{rec: rec, f3: map[string]string{"psown": "psown allowed", "psown.rc": "psown.rc 0", "psown.scan": "psown.scan 0"}}, out: ok}, nil, "token_reached:psown"}, |
| + {"ps ran and gave nothing", cli{sh: shell{rec: rec, f3: map[string]string{"psown": "psown failed", "psown.rc": "psown.rc 0", "psown.scan": "psown.scan 1"}}, out: ok}, nil, "not_shown_tried:psown"}, |
| + {"ps failed otherwise", cli{sh: shell{rec: rec, f3: map[string]string{"psppid.rc": "psppid.rc 1"}}, out: ok}, nil, "not_shown_tried:psppid"}, |
| + {"ps not tried", cli{sh: shell{rec: rec, f3: map[string]string{"psown": "", "psown.rc": "", "psown.scan": ""}}, out: ok}, nil, "not_shown_tried:psown"}, |
| + {"no token file", holding(t), func(h *Host) { h.TokenFiles = nil }, "no_token_file"}, |
| {"secrets unreadable", holding(t), func(h *Host) { |
| h.Secrets = func(context.Context) ([][]byte, error) { return nil, errors.New("no") } |
| - }, "the known secrets could not be read"}, |
| + }, "secrets_unreadable"}, |
| } |
| for _, c := range cases { |
| t.Run(c.name, func(t *testing.T) { |
| @@ -947,12 +960,12 @@ func TestF4SweepProof(t *testing.T) { |
| unknown bool |
| verdict, want string |
| }{ |
| - {"swept", true, true, true, true, false, wire.ProbePassed, "session of its own"}, |
| - {"outlived", false, true, true, true, false, wire.ProbeFailed, "the child outlived the launch's stop"}, |
| - {"not proven", true, false, true, true, false, wire.ProbeFailed, "the probe launch's end was not proven"}, |
| - {"never started", true, true, true, false, false, wire.ProbeFailed, "the child was not shown started"}, |
| - {"same session", true, true, false, true, false, wire.ProbeFailed, "the child was not in a session of its own"}, |
| - {"unreadable", true, true, true, true, true, wire.ProbeFailed, "the child could not be shown gone"}, |
| + {"swept", true, true, true, true, false, wire.ProbePassed, "f4_passed"}, |
| + {"outlived", false, true, true, true, false, wire.ProbeFailed, "child_outlived"}, |
| + {"not proven", true, false, true, true, false, wire.ProbeFailed, "launch_unproven"}, |
| + {"never started", true, true, true, false, false, wire.ProbeFailed, "child_not_started"}, |
| + {"same session", true, true, false, true, false, wire.ProbeFailed, "child_not_own_session"}, |
| + {"unreadable", true, true, true, true, true, wire.ProbeFailed, "child_not_gone"}, |
| } { |
| t.Run(c.name, func(t *testing.T) { |
| m := newFakeMac(t) |
| @@ -1116,16 +1129,17 @@ func TestF5OnlyAfterP2AndNeedsTheBuild(t *testing.T) { |
| name, log, detail string |
| extra map[string]string |
| }{ |
| - {"failed build", strings.Replace(string(recorded), "EQUIPO-PHASE test-run 0", "EQUIPO-PHASE test-run 65", 1), "did not complete: test-run", nil}, |
| - {"token", strings.Replace(string(recorded), "EQUIPO-PROBE test tokenfile denied", "EQUIPO-PROBE test tokenfile allowed", 1), "allowed: test.tokenfile", nil}, |
| - {"a token source not collected", strings.Replace(string(recorded), "EQUIPO-PROBE test tokenfd denied\n", "", 1), "not shown denied: test.tokenfd", nil}, |
| - {"missing line", strings.Replace(string(recorded), "warning: EQUIPO-PROBE plugin keychain denied\n", "", 1), "not shown denied: plugin.keychain", nil}, |
| - {"no lines", "", "not shown denied", nil}, |
| - {"a real token", string(recorded), "a secret reached the scratch", map[string]string{"DerivedData/x.log": "token " + base64.StdEncoding.EncodeToString([]byte(fakeToken)) + "\n"}}, |
| - {"a token shape", string(recorded), "a token reached the scratch", map[string]string{"DerivedData/y.log": "sk-ant-oat01-somebody\n"}}, |
| + {"failed build", strings.Replace(string(recorded), "EQUIPO-PHASE test-run 0", "EQUIPO-PHASE test-run 65", 1), "incomplete:test-run", nil}, |
| + {"token", strings.Replace(string(recorded), "EQUIPO-PROBE test tokenfile denied", "EQUIPO-PROBE test tokenfile allowed", 1), "allowed:test.tokenfile", nil}, |
| + {"a token source not collected", strings.Replace(string(recorded), "EQUIPO-PROBE test tokenfd denied\n", "", 1), "not_shown_denied:test.tokenfd", nil}, |
| + {"missing line", strings.Replace(string(recorded), "warning: EQUIPO-PROBE plugin keychain denied\n", "", 1), "not_shown_denied:plugin.keychain", nil}, |
| + {"no lines", "", "not_shown_denied:", nil}, |
| + {"a real token", string(recorded), "reached_scratch:secret", map[string]string{"DerivedData/x.log": "token " + base64.StdEncoding.EncodeToString([]byte(fakeToken)) + "\n"}}, |
| + {"a token shape", string(recorded), "reached_scratch:token-shape", map[string]string{"DerivedData/y.log": "sk-ant-oat01-somebody\n"}}, |
| } { |
| t.Run(c.name, func(t *testing.T) { |
| _, results := run(t, true, c.log, c.extra) |
| + coded(t, results[1].Probes) |
| if f5 := byID(results[1].Probes, "F5"); f5.Verdict != wire.ProbeFailed || !strings.Contains(f5.Detail, c.detail) { |
| t.Fatalf("%+v", f5) |
| } |
| @@ -1151,7 +1165,7 @@ func TestF6SwapRace(t *testing.T) { |
| } |
| } |
| m.launchWith(t, c) |
| - want(t, m.runA(t), "F6", wire.ProbeDenied, "native calls refused") |
| + want(t, m.runA(t), "F6", wire.ProbeDenied, "f6_denied:") |
| if len(seen) != 2 { |
| t.Fatalf("the link was not swapped while the launch ran: %v", seen) |
| } |
| @@ -1161,25 +1175,25 @@ func TestF6SwapRace(t *testing.T) { |
| verdict string |
| }{ |
| {"refused by the CLI", "", model{noAsk: true}, wire.ProbeDenied}, |
| - {"notes only", "not shown made", model{notes: true}, wire.ProbeFailed}, |
| - {"no events", "not shown made", model{noUse: true}, wire.ProbeFailed}, |
| - {"race won", "reached the model", model{race: true}, wire.ProbeFailed}, |
| - {"late name", "reached the model", model{late: true}, wire.ProbeFailed}, |
| - {"forty-nine", "not shown made: S50", model{skip: map[string]bool{"S50": true}}, wire.ProbeFailed}, |
| - {"allowed", "allowed: C5", model{allow: map[string]bool{"C5": true}}, wire.ProbeFailed}, |
| - {"allowed by the CLI", "allowed: C5", model{noAsk: true, leak: map[string]bool{"C5": true}}, wire.ProbeFailed}, |
| - {"no control", "the control read did not arrive", model{noCtl: true}, wire.ProbeFailed}, |
| - {"a control the model made up", "the control read did not arrive", model{ctlText: "EQUIPO-NONCE-0123"}, wire.ProbeFailed}, |
| - {"not a whole-file read", "not as prescribed: C1", model{offset: map[string]bool{"C1": true}}, wire.ProbeFailed}, |
| - {"a swap read past the start", "not as prescribed: S7", model{offset: map[string]bool{"S7": true}}, wire.ProbeFailed}, |
| - {"another grep pattern", "not as prescribed: C2", model{pattern: map[string]string{"C2": "nothing"}}, wire.ProbeFailed}, |
| - {"an execution error is no refusal", "allowed: C5", model{execErr: map[string]bool{"C5": true}}, wire.ProbeFailed}, |
| + {"notes only", "not_shown_made:", model{notes: true}, wire.ProbeFailed}, |
| + {"no events", "not_shown_made:", model{noUse: true}, wire.ProbeFailed}, |
| + {"race won", "reached_model", model{race: true}, wire.ProbeFailed}, |
| + {"late name", "reached_model", model{late: true}, wire.ProbeFailed}, |
| + {"forty-nine", "not_shown_made:S50", model{skip: map[string]bool{"S50": true}}, wire.ProbeFailed}, |
| + {"allowed", "allowed:C5", model{allow: map[string]bool{"C5": true}}, wire.ProbeFailed}, |
| + {"allowed by the CLI", "allowed:C5", model{noAsk: true, leak: map[string]bool{"C5": true}}, wire.ProbeFailed}, |
| + {"no control", "control_read_missing", model{noCtl: true}, wire.ProbeFailed}, |
| + {"a control the model made up", "control_read_missing", model{ctlText: "EQUIPO-NONCE-0123"}, wire.ProbeFailed}, |
| + {"not a whole-file read", "not_prescribed:C1", model{offset: map[string]bool{"C1": true}}, wire.ProbeFailed}, |
| + {"a swap read past the start", "not_prescribed:S7", model{offset: map[string]bool{"S7": true}}, wire.ProbeFailed}, |
| + {"another grep pattern", "not_prescribed:C2", model{pattern: map[string]string{"C2": "nothing"}}, wire.ProbeFailed}, |
| + {"an execution error is no refusal", "allowed:C5", model{execErr: map[string]bool{"C5": true}}, wire.ProbeFailed}, |
| // #1 (final review): a swap read or the late Grep needs a refusal |
| // or a benign observation, never an execution error. |
| - {"an execution error on a swap read", "neither refused nor observed: S7", model{execErr: map[string]bool{"S7": true}}, wire.ProbeFailed}, |
| - {"an execution error on the late Grep", "neither refused nor observed: L1", model{execErr: map[string]bool{"L1": true}}, wire.ProbeFailed}, |
| + {"an execution error on a swap read", "unobserved:S7", model{execErr: map[string]bool{"S7": true}}, wire.ProbeFailed}, |
| + {"an execution error on the late Grep", "unobserved:L1", model{execErr: map[string]bool{"L1": true}}, wire.ProbeFailed}, |
| {"benign swap reads observed", "", model{benign: true}, wire.ProbeDenied}, |
| - {"a swap read that showed nothing", "neither refused nor observed: S", model{benign: true, blank: true}, wire.ProbeFailed}, |
| + {"a swap read that showed nothing", "unobserved:S", model{benign: true, blank: true}, wire.ProbeFailed}, |
| } { |
| t.Run(cs.name, func(t *testing.T) { |
| m := newFakeMac(t) |
| @@ -1190,7 +1204,7 @@ func TestF6SwapRace(t *testing.T) { |
| t.Run("shell hard link", func(t *testing.T) { |
| m := newFakeMac(t) |
| m.launchWith(t, cli{sh: shell{rec: rec, link: true}, out: ok}) |
| - want(t, m.runA(t), "F6", wire.ProbeFailed, "the shell hard-linked") |
| + want(t, m.runA(t), "F6", wire.ProbeFailed, "hard_linked:") |
| }) |
| for name, c := range map[string]struct { |
| seam func() |
| @@ -1198,8 +1212,8 @@ func TestF6SwapRace(t *testing.T) { |
| }{ |
| "a link": {func() { symlink = func(string, string) error { return errors.New("no") } }, "link-0"}, |
| "a hard link": {func() { hardlink = func(string, string) error { return errors.New("no") } }, "hardlink-0"}, |
| - "the swap": {func() { rename = func(string, string) error { return errors.New("no") } }, "the swap did not alternate"}, |
| - "the late name": {func() { |
| + "the swap": {func() { rename = func(string, string) error { return errors.New("no") } }, "swap"}, |
| + "late_name": {func() { |
| was := symlink |
| symlink = func(o, n string) error { |
| if strings.HasSuffix(n, "/late/x") { |
| @@ -1207,7 +1221,7 @@ func TestF6SwapRace(t *testing.T) { |
| } |
| return was(o, n) |
| } |
| - }, "the late name"}, |
| + }, "late_name"}, |
| } { |
| t.Run("setup: "+name, func(t *testing.T) { |
| s1, h1, r1 := symlink, hardlink, rename |
| @@ -1215,7 +1229,7 @@ func TestF6SwapRace(t *testing.T) { |
| m := newFakeMac(t) |
| c.seam() |
| m.launchWith(t, cli{sh: shell{rec: rec}, out: ok}) |
| - if p := byID(m.runA(t), "F6"); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "not set up: ") || !strings.Contains(p.Detail, c.want) { |
| + if p := byID(m.runA(t), "F6"); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "not_set_up:") || !strings.Contains(p.Detail, c.want) { |
| t.Fatalf("%s: %+v", name, p) |
| } |
| }) |
| @@ -1231,10 +1245,10 @@ func TestF7NeedsTheOutsideControl(t *testing.T) { |
| name, outside, detail string |
| sh shell |
| }{ |
| - {"control", "xcodebuild -list", "the control failed outside the sandbox: xcodebuild", shell{rec: rec}}, |
| - {"simctl", "", "allowed: simctl", shell{rec: rec, codes: map[string]string{"simctl": "0"}}}, |
| - {"lookup", "", "allowed: mach", shell{rec: rec, files: map[string]string{"out/f7.mach": "port\n"}}}, |
| - {"missing", "", "not shown denied: xcodebuild", shell{rec: rec, drop: map[string]bool{"xcodebuild": true}}}, |
| + {"control", "xcodebuild -list", "control_failed:xcodebuild", shell{rec: rec}}, |
| + {"simctl", "", "allowed:simctl", shell{rec: rec, codes: map[string]string{"simctl": "0"}}}, |
| + {"lookup", "", "allowed:mach", shell{rec: rec, files: map[string]string{"out/f7.mach": "port\n"}}}, |
| + {"missing", "", "not_shown_denied:xcodebuild", shell{rec: rec, drop: map[string]bool{"xcodebuild": true}}}, |
| } { |
| t.Run(c.name, func(t *testing.T) { |
| m := newFakeMac(t) |
| @@ -1248,7 +1262,7 @@ func TestF7NeedsTheOutsideControl(t *testing.T) { |
| m := newFakeMac(t) |
| m.h.Tools = mac.Tools{} |
| m.launchWith(t, holding(t)) |
| - want(t, m.runA(t), "F7", wire.ProbeUnavailable, "no Xcode") |
| + want(t, m.runA(t), "F7", wire.ProbeUnavailable, "no_xcode") |
| } |
| // The launch's own end decides first: one that never started says |
| @@ -1257,7 +1271,7 @@ func TestProbeLaunchOutcome(t *testing.T) { |
| m := newFakeMac(t) |
| m.launchWith(t, cli{sh: shell{rec: loadRecording(t)}, out: Outcome{Reason: "account_unavailable"}}) |
| for _, p := range m.runA(t) { |
| - if p.Verdict != wire.ProbeUnavailable || !strings.Contains(p.Detail, "did not start: account_unavailable") { |
| + if p.Verdict != wire.ProbeUnavailable || !strings.Contains(p.Detail, "launch_not_started:account_unavailable") { |
| t.Fatalf("%+v", p) |
| } |
| } |
| @@ -1275,7 +1289,7 @@ func allPassed(in Inputs, at time.Time) []Result { |
| for _, l := range Launches { |
| r := Result{Launch: l, Inputs: in, At: at} |
| for _, id := range launchProbes[l] { |
| - r.Probes = append(r.Probes, wire.Probe{ID: id, Verdict: wire.EngineeringProbeSuccess(id), Detail: "ok"}) |
| + r.Probes = append(r.Probes, wire.Probe{ID: id, Verdict: wire.EngineeringProbeSuccess(id), Detail: wire.ProbeDetail("f1_denied")}) |
| } |
| out = append(out, r) |
| } |
| @@ -1304,14 +1318,14 @@ func TestProbeLaunchesAggregate(t *testing.T) { |
| if p := byID(ps, "F4"); p.Verdict != wire.ProbePassed { |
| t.Fatalf("C is fresh: %+v", p) |
| } |
| - if p := byID(ps, "F1"); p.Verdict != wire.ProbeUnavailable || p.Detail != "not proven: it ran more than a day ago" { |
| + if p := byID(ps, "F1"); p.Verdict != wire.ProbeUnavailable || p.Detail != "expired" { |
| t.Fatalf("A is stale: %+v", p) |
| } |
| if due := s.Due(in, now, true); !slices.Equal(due, []string{LaunchA}) { |
| t.Fatalf("due %v", due) |
| } |
| s.Put(allPassed(in, now.Add(time.Hour))[0]) |
| - if p := byID(s.Probes(in, now, true), "F1"); p.Verdict != wire.ProbeUnavailable || !strings.Contains(p.Detail, "future") { |
| + if p := byID(s.Probes(in, now, true), "F1"); p.Verdict != wire.ProbeUnavailable || p.Detail != "future" { |
| t.Fatalf("future: %+v", p) |
| } |
| var u Store |
| @@ -1356,11 +1370,11 @@ func TestProbeInputsInvalidate(t *testing.T) { |
| next Inputs |
| why string |
| }{ |
| - {"xcode build", NewInputs("v1.0.0", true, wire.Xcode{Version: "27.2", Build: "27B53"}, []wire.Simulator{{Runtime: "iOS 27.2"}, {Runtime: "iOS 27.0"}}), "Xcode changed"}, |
| - {"runtime", NewInputs("v1.0.0", true, wire.Xcode{Version: "27.2", Build: "27B52"}, []wire.Simulator{{Runtime: "iOS 27.2"}, {Runtime: "iOS 27.0"}, {Runtime: "iOS 27.3"}}), "the simulator runtimes changed"}, |
| - {"cli digest", Inputs{Runner: in.Runner, Settings: in.Settings, CLI: strings.Repeat("0", 64), Xcode: in.Xcode, Runtimes: in.Runtimes}, "Claude Code changed"}, |
| - {"runner", Inputs{Runner: "v1.0.1", Settings: in.Settings, CLI: in.CLI, Xcode: in.Xcode, Runtimes: in.Runtimes}, "the runner changed"}, |
| - {"settings", Inputs{Runner: in.Runner, Settings: "0000", CLI: in.CLI, Xcode: in.Xcode, Runtimes: in.Runtimes}, "the Engineering settings changed"}, |
| + {"xcode build", NewInputs("v1.0.0", true, wire.Xcode{Version: "27.2", Build: "27B53"}, []wire.Simulator{{Runtime: "iOS 27.2"}, {Runtime: "iOS 27.0"}}), "stale_xcode"}, |
| + {"runtime", NewInputs("v1.0.0", true, wire.Xcode{Version: "27.2", Build: "27B52"}, []wire.Simulator{{Runtime: "iOS 27.2"}, {Runtime: "iOS 27.0"}, {Runtime: "iOS 27.3"}}), "stale_runtimes"}, |
| + {"cli digest", Inputs{Runner: in.Runner, Settings: in.Settings, CLI: strings.Repeat("0", 64), Xcode: in.Xcode, Runtimes: in.Runtimes}, "stale_cli"}, |
| + {"runner", Inputs{Runner: "v1.0.1", Settings: in.Settings, CLI: in.CLI, Xcode: in.Xcode, Runtimes: in.Runtimes}, "stale_runner"}, |
| + {"settings", Inputs{Runner: in.Runner, Settings: "0000", CLI: in.CLI, Xcode: in.Xcode, Runtimes: in.Runtimes}, "stale_settings"}, |
| } { |
| t.Run(c.name, func(t *testing.T) { |
| var s Store |
| @@ -1369,7 +1383,7 @@ func TestProbeInputsInvalidate(t *testing.T) { |
| } |
| ps := s.Probes(c.next, now, true) |
| for _, id := range wire.EngineeringProbeIDs { |
| - if p := byID(ps, id); p.Verdict != wire.ProbeUnavailable || p.Detail != "not proven: "+c.why+" since it ran" { |
| + if p := byID(ps, id); p.Verdict != wire.ProbeUnavailable || p.Detail != c.why { |
| t.Fatalf("%s %+v", id, p) |
| } |
| } |
| @@ -1406,7 +1420,7 @@ func TestProbeInputsInvalidate(t *testing.T) { |
| t.Fatalf("results %+v", results) |
| } |
| for _, p := range results[0].Probes { |
| - if p.Verdict != wire.ProbeUnavailable || !strings.Contains(p.Detail, "the inputs changed while it ran") { |
| + if p.Verdict != wire.ProbeUnavailable || !strings.Contains(p.Detail, "inputs_changed") { |
| t.Fatalf("%+v", p) |
| } |
| } |
diff --git a/internal/runner/mac/fprobe/run.go b/internal/runner/mac/fprobe/run.go| index 1d1d8539..22bc3d50 100644 |
| --- a/internal/runner/mac/fprobe/run.go |
| +++ b/internal/runner/mac/fprobe/run.go |
| @@ -258,7 +258,7 @@ func (s *Store) Run(ctx context.Context, h Host) []Result { |
| } |
| r := Result{Launch: l, Inputs: h.Inputs, At: at, Probes: probes} |
| if h.live(context.WithoutCancel(ctx)).changed(h.Inputs) != "" { |
| - r.Probes = undecided(l, h, "the inputs changed while it ran").Probes |
| + r.Probes = undecided(l, h, "inputs_changed").Probes |
| } |
| s.Put(r) |
| out = append(out, r) |
| @@ -282,20 +282,29 @@ func undecided(l string, h Host, why string) Result { |
| func all(l, verdict, detail string) []wire.Probe { |
| var out []wire.Probe |
| for _, id := range launchProbes[l] { |
| - out = append(out, wire.Probe{ID: id, Verdict: verdict, Detail: clean(detail)}) |
| + out = append(out, wire.Probe{ID: id, Verdict: verdict, Detail: detail}) |
| } |
| return out |
| } |
| +// reasonCode is a launch's reason as a detail parameter: a code, never |
| +// words ("unknown" otherwise). |
| +func reasonCode(r string) string { |
| + if r == "" || len(r) > 40 || strings.Trim(r, "abcdefghijklmnopqrstuvwxyz0123456789_") != "" { |
| + return "unknown" |
| + } |
| + return r |
| +} |
| + |
| // launched is what a launch's outcome says for its probes before any |
| // observation: unavailable when the CLI never started, failed when its |
| // end is not proven (nothing it did can be trusted), nil to go on. |
| func launched(l string, o Outcome) []wire.Probe { |
| switch { |
| case !o.Started: |
| - return all(l, wire.ProbeUnavailable, "the probe launch did not start: "+firstNonEmpty(o.Reason, "unknown")) |
| + return all(l, wire.ProbeUnavailable, wire.ProbeDetail("launch_not_started", reasonCode(o.Reason))) |
| case !o.Proven: |
| - return all(l, wire.ProbeFailed, "the probe launch's end was not proven") |
| + return all(l, wire.ProbeFailed, wire.ProbeDetail("launch_unproven")) |
| } |
| return nil |
| } |
| @@ -545,11 +554,11 @@ func (e *evidence) judgedEnd(probes []wire.Probe, s Spec, d *launchDir, end bool |
| e.mu.Unlock() |
| switch { |
| case !ran: |
| - return notRun(probes, "the probe script was not shown run") |
| + return notRun(probes, wire.ProbeDetail("script_not_run")) |
| case other: |
| - return notRun(probes, "a Bash command other than the probe script was allowed") |
| + return notRun(probes, wire.ProbeDetail("other_command")) |
| case strings.TrimSpace(d.read("begin")) != "begin "+s.Nonce || end && strings.TrimSpace(d.read("end")) != "end "+s.Nonce: |
| - return notRun(probes, "the script's records are not this run's") |
| + return notRun(probes, wire.ProbeDetail("records_foreign")) |
| } |
| return probes |
| } |
| @@ -562,7 +571,7 @@ func notRun(probes []wire.Probe, why string) []wire.Probe { |
| case wire.EngineeringProbeSuccess(p.ID): |
| probes[i].Verdict, probes[i].Detail = wire.ProbeFailed, why |
| case wire.ProbeFailed: |
| - probes[i].Detail = clean(why + "; " + p.Detail) |
| + probes[i].Detail = wire.ProbeDetails(why, p.Detail) |
| } |
| } |
| return probes |
| @@ -716,24 +725,6 @@ func tag() string { return strings.TrimPrefix(nonce(), "EQUIPO-NONCE-")[:12] } |
| // quote is s as one shell word. |
| func quote(s string) string { return "'" + strings.ReplaceAll(s, "'", `'\''`) + "'" } |
| -// clean keeps a detail inside the capability string rules: one line, no |
| -// path separator, tilde or equals sign, at most 300 bytes. |
| -func clean(s string) string { |
| - s = strings.Map(func(r rune) rune { |
| - if strings.ContainsRune("/\\~\n\r\t\x00=", r) { |
| - return ' ' |
| - } |
| - return r |
| - }, s) |
| - for len(s) > wire.MaxCapabilityString { |
| - s = s[:len(s)-1] |
| - for len(s) > 0 && s[len(s)-1]&0xC0 == 0x80 { |
| - s = s[:len(s)-1] |
| - } |
| - } |
| - return s |
| -} |
| - |
| func firstNonEmpty(s ...string) string { |
| for _, x := range s { |
| if x != "" { |
diff --git a/internal/runner/mac/fprobe/wbfix1_test.go b/internal/runner/mac/fprobe/wbfix1_test.go| new file mode 100644 |
| index 00000000..d373b908 |
| --- /dev/null |
| +++ b/internal/runner/mac/fprobe/wbfix1_test.go |
| @@ -0,0 +1,51 @@ |
| +package fprobe |
| + |
| +import ( |
| + "testing" |
| + "time" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// Whole-branch fix 1, #6: what the store says of a probe that has no |
| +// current result is a code, each reason its own. |
| +func TestStoreDetailsAreCoded(t *testing.T) { |
| + now := time.Date(2026, 11, 29, 12, 0, 0, 0, time.UTC) |
| + in := NewInputs("v1.0.0", true, wire.Xcode{Version: "27.2", Build: "27B52"}, []wire.Simulator{{Runtime: "iOS 27.2"}}) |
| + var s Store |
| + seen := map[string]bool{} |
| + note := func(ps []wire.Probe, id, code string) { |
| + t.Helper() |
| + coded(t, ps) |
| + p := byID(ps, id) |
| + if parts, _ := wire.ParseProbeDetail(p.Detail); len(parts) != 1 || parts[0].Code != code { |
| + t.Fatalf("%s: %q, want %s", id, p.Detail, code) |
| + } |
| + seen[code] = true |
| + } |
| + note(s.Probes(in, now, true), "F1", "not_run") |
| + note(s.Probes(in, now, false), "F5", "f5_skipped") |
| + s.Put(allPassed(in, now.Add(-25*time.Hour))[0]) |
| + note(s.Probes(in, now, true), "F1", "expired") |
| + s.Put(allPassed(in, now.Add(time.Hour))[0]) |
| + note(s.Probes(in, now, true), "F1", "future") |
| + for code, other := range map[string]Inputs{ |
| + "stale_runner": NewInputs("v1.0.1", true, wire.Xcode{Version: "27.2", Build: "27B52"}, []wire.Simulator{{Runtime: "iOS 27.2"}}), |
| + "stale_xcode": NewInputs("v1.0.0", true, wire.Xcode{Version: "27.3", Build: "27C1"}, []wire.Simulator{{Runtime: "iOS 27.2"}}), |
| + "stale_runtimes": NewInputs("v1.0.0", true, wire.Xcode{Version: "27.2", Build: "27B52"}, []wire.Simulator{{Runtime: "iOS 27.3"}}), |
| + } { |
| + var u Store |
| + u.Put(allPassed(in, now)[0]) |
| + note(u.Probes(other, now, true), "F1", code) |
| + } |
| + for _, ps := range [][]wire.Probe{ |
| + launched(LaunchA, Outcome{Reason: "account_unavailable"}), |
| + launched(LaunchA, Outcome{Reason: "a sentence, with words"}), |
| + launched(LaunchC, Outcome{Started: true}), |
| + undecided(LaunchA, Host{}, "inputs_changed").Probes, |
| + notRun(all(LaunchA, wire.ProbeDenied, wire.ProbeDetail("f1_denied")), "script_not_run"), |
| + notRun(all(LaunchA, wire.ProbeFailed, wire.ProbeDetail("allowed", "tcp")), "other_command"), |
| + } { |
| + coded(t, ps) |
| + } |
| +} |
diff --git a/internal/runner/mac/p2token_test.go b/internal/runner/mac/p2token_test.go| index 6d1c0252..6305c77d 100644 |
| --- a/internal/runner/mac/p2token_test.go |
| +++ b/internal/runner/mac/p2token_test.go |
| @@ -35,7 +35,7 @@ func TestP2TriesTheToken(t *testing.T) { |
| // A collector that ran and could not collect (fix round 2, #4) says |
| // failed, which is never a denial, and P2's detail says so. |
| got["plugin.tokenargs"] = "failed" |
| - if v, g := JudgeP2(got, facts); v != wire.ProbeFailed || len(g["failed"]) != 1 || !strings.Contains(p2Detail(g, 33, true, true, ""), "not collected: plugin.tokenargs") { |
| + if v, g := JudgeP2(got, facts); v != wire.ProbeFailed || len(g["failed"]) != 1 || !strings.Contains(p2Detail(g, 33, true, true, ""), "not_collected:plugin.tokenargs") { |
| t.Fatalf("a failed collection: %s %v", v, g) |
| } |
| if ParseAttempts("EQUIPO-PROBE test tokenargs failed\n")["test.tokenargs"] != "failed" { |
| @@ -54,7 +54,7 @@ func TestP2TriesTheToken(t *testing.T) { |
| // the accounts root (outside any sandbox here) and says so. |
| f := newProbeFixture(t, allLines("denied"), "FAKE_READ_TOKEN=1") |
| caps := Capabilities(context.Background(), f.h.Exec, f.h.Tools) |
| - if p, _, _ := probeP2(context.Background(), f.h, caps); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "allowed: test.tokenfile") { |
| + if p, _, _ := probeP2(context.Background(), f.h, caps); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "allowed:test.tokenfile") { |
| t.Fatalf("token read: %+v", p) |
| } |
| if left, _ := filepath.Glob(filepath.Join(f.h.Paths.AccountsRoot, "*")); len(left) != 0 { |
| @@ -62,7 +62,7 @@ func TestP2TriesTheToken(t *testing.T) { |
| } |
| f = newProbeFixture(t, allLines("denied")) |
| f.h.Paths.AccountsRoot = "" |
| - if p, _, _ := probeP2(context.Background(), f.h, caps); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "not shown denied") { |
| + if p, _, _ := probeP2(context.Background(), f.h, caps); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "not_shown_denied:") { |
| t.Fatalf("no accounts root: %+v", p) |
| } |
| // The targets name the runner's binary, the direct reader. |
diff --git a/internal/runner/mac/p2why_test.go b/internal/runner/mac/p2why_test.go| index 4a47d46b..0ffd7810 100644 |
| --- a/internal/runner/mac/p2why_test.go |
| +++ b/internal/runner/mac/p2why_test.go |
| @@ -53,19 +53,19 @@ func TestP2ReadsTheWholeOutput(t *testing.T) { |
| // excerpt; P2 is never denied for it. |
| func TestP2SaysWhichStepFailed(t *testing.T) { |
| for _, c := range []struct{ env, phase, detail string }{ |
| - {"FAKE_BUILD_FAIL=1", "script build", "xcodebuild did not run in srt: script build exit 65: Sandbox: deny(1) mach-lookup com.apple.dt.example"}, |
| - {"FAKE_RESOLVE_FAIL=1", "package resolve", "xcodebuild did not run in srt: package resolve exit 74: xcodebuild: error: Could not resolve package dependencies:"}, |
| - {"FAKE_TEST_BUILD_FAIL=error: no such module 'XCTest'", "test build", "xcodebuild did not run in srt: test build exit 65: error: no such module 'XCTest'"}, |
| - {"FAKE_BOOT_FAIL=1", "simulator boot", "xcodebuild did not run in srt: simulator boot exit 149: Unable to boot device: error: launchd_sim failed"}, |
| - {"FAKE_RUN_FAIL=1", "test run", "xcodebuild did not run in srt: test run exit 65: xcodebuild: error: Failed to establish communication with the test runner."}, |
| + {"FAKE_BUILD_FAIL=1", "script build", "srt_failed:script build exit 65"}, |
| + {"FAKE_RESOLVE_FAIL=1", "package resolve", "srt_failed:package resolve exit 74"}, |
| + {"FAKE_TEST_BUILD_FAIL=error: no such module 'XCTest'", "test build", "srt_failed:test build exit 65"}, |
| + {"FAKE_BOOT_FAIL=1", "simulator boot", "srt_failed:simulator boot exit 149"}, |
| + {"FAKE_RUN_FAIL=1", "test run", "srt_failed:test run exit 65"}, |
| } { |
| f := newProbeFixture(t, allLines("denied"), c.env) |
| var w warned |
| f.h.Warn = w.warn |
| p, ran, _ := probeP2(context.Background(), f.h, Capabilities(context.Background(), f.h.Exec, f.h.Tools)) |
| - // The phase, its exit and the excerpt's start: with the token |
| - // attempts (slice F) a long list of unshown places may cut the rest. |
| - if ran || p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, c.detail[:min(len(c.detail), 70)]) { |
| + // The phase and its exit, never the output (whole-branch fix 1, |
| + // #6: the excerpt goes only to the runner's log). |
| + if ran || p.Verdict != wire.ProbeFailed || !strings.HasSuffix(p.Detail, c.detail) { |
| t.Fatalf("%s: %+v ran=%v", c.phase, p, ran) |
| } |
| if err := wire.ValidCapabilities(wire.Capabilities{Probes: []wire.Probe{p}}); err != nil { |
| @@ -83,7 +83,7 @@ func TestP2SaysWhichStepFailed(t *testing.T) { |
| var w warned |
| f.h.Warn = w.warn |
| p, _, _ := probeP2(context.Background(), f.h, Capabilities(context.Background(), f.h.Exec, f.h.Tools)) |
| - if p.Detail != "not shown denied: all 33 attempts; xcodebuild did not run in srt: srt start exit 1: Error: Refusing to run with the built-in defaults" || w.attr(0, "phase") != "srt start" { |
| + if p.Detail != "not_shown_denied:script.* plugin.* test.*;srt_failed:srt start exit 1" || w.attr(0, "phase") != "srt start" { |
| t.Fatalf("srt did not start: %+v %v", p, w.calls) |
| } |
| } |
| @@ -183,10 +183,10 @@ func TestP2FailureFromGateOutput(t *testing.T) { |
| func TestP2DetailKeepsTheEnd(t *testing.T) { |
| unknown := []string{"script.state", "script.tcp", "script.dns", "script.keychain", "plugin.state", "plugin.tcp", "plugin.dns", "plugin.keychain", "test.state", "test.tcp", "test.dns", "test.keychain"} |
| d := p2Detail(map[string][]string{"unknown": unknown[:11], "allowed": unknown[11:]}, 12, false, false, "test build exit 65: "+strings.Repeat("error: x ", 60)) |
| - if !strings.Contains(d, "end not proven; xcodebuild did not run in srt: test build exit 65: error") || len(d) > wire.MaxCapabilityString { |
| + if parts, ok := wire.ParseProbeDetail(d); !ok || !strings.Contains(d, ";end_unproven") || len(d) > wire.MaxCapabilityString || len(parts) < 3 { |
| t.Fatalf("detail %q", d) |
| } |
| - if d := p2Detail(map[string][]string{"unknown": unknown}, 12, false, true, ""); d != "not shown denied: all 12 attempts; xcodebuild did not run in srt" { |
| + if d := p2Detail(map[string][]string{"unknown": unknown}, 12, false, true, ""); d != wire.ProbeDetail("not_shown_denied", strings.Join(unknown, " "))+";srt_not_run" { |
| t.Fatalf("detail %q", d) |
| } |
| } |
diff --git a/internal/runner/mac/probe.go b/internal/runner/mac/probe.go| index 0f470452..8cf29498 100644 |
| --- a/internal/runner/mac/probe.go |
| +++ b/internal/runner/mac/probe.go |
| @@ -184,9 +184,9 @@ func RunProbes(ctx context.Context, h ProbeHost) Report { |
| put(probeP1(run, h, caps)) |
| p2, ran, keychain := probeP2(run, h, caps) |
| put(p2, ran) |
| - put(wire.Probe{ID: "P3", Verdict: wire.ProbeSkipped, Detail: clean("sign-in needs a person (slice F); Keychain from the sandbox: " + keychain)}) |
| + put(wire.Probe{ID: "P3", Verdict: wire.ProbeSkipped, Detail: wire.ProbeDetail(keychain)}) |
| put(probeP4(run, h)) |
| - put(wire.Probe{ID: "P5", Verdict: wire.ProbeSkipped, Detail: "Codex on the Mac is parked (slice G)"}) |
| + put(wire.Probe{ID: "P5", Verdict: wire.ProbeSkipped, Detail: wire.ProbeDetail("p5_parked")}) |
| put(probeP6(run, h, caps, ran)) |
| put(probeP7(run, h)) |
| }() |
| @@ -206,7 +206,7 @@ func RunProbes(ctx context.Context, h ProbeHost) Report { |
| for _, id := range wire.ProbeIDs { |
| p, ok := got[id] |
| if !ok { |
| - p = wire.Probe{ID: id, Verdict: wire.ProbeUnavailable, Detail: clean("not proven: the probe run reached its limit of " + limit.String())} |
| + p = wire.Probe{ID: id, Verdict: wire.ProbeUnavailable, Detail: wire.ProbeDetail("probe_limit", limit.String())} |
| r.Unfinished = append(r.Unfinished, id) |
| } |
| r.Probes = append(r.Probes, p) |
| @@ -242,33 +242,23 @@ func queryKey(name string, args []string) string { |
| return path.Base(name) |
| } |
| -// said is why a tool cannot be relied on when a query to it did not |
| -// answer ("simctl did not answer in 30s"), else "". |
| -func (h ProbeHost) said(tool string) string { |
| - if h.late == nil { |
| - return "" |
| - } |
| - h.late.mu.Lock() |
| - defer h.late.mu.Unlock() |
| - if h.late.late[tool] { |
| - return tool + " did not answer in " + QueryLimit.String() |
| - } |
| - return "" |
| +// noXcode and noSimulator are the detail of a probe that needs Xcode or |
| +// a simulator and cannot run: a query that did not answer in time |
| +// (QueryLimit), or none found ("" for a simulator that answered). |
| +func (h ProbeHost) noXcode() string { |
| + return h.gone("xcodebuild", "xcode_unavailable", wire.ProbeDetail("no_xcode")) |
| } |
| +func (h ProbeHost) noSimulator() string { return h.gone("simctl", "simulator_unavailable", "") } |
| -// noXcode and noSimulator say why a probe that needs Xcode or a |
| -// simulator cannot run: a query that did not answer, or none found. |
| -func (h ProbeHost) noXcode() string { return firstNonEmpty(h.gone("Xcode", "xcodebuild"), "no Xcode") } |
| -func (h ProbeHost) noSimulator() string { return h.gone("simulator", "simctl") } |
| - |
| -// gone is "<what> unavailable: <why>" when tool did not answer. |
| -func (h ProbeHost) gone(what, tool string) string { |
| - if why := h.said(tool); why != "" { |
| - return what + " unavailable: " + why |
| +func (h ProbeHost) gone(tool, code, otherwise string) string { |
| + if h.late != nil && h.late.was(tool) { |
| + return wire.ProbeDetail(code, QueryLimit.String()) |
| } |
| - return "" |
| + return otherwise |
| } |
| +func (q *queries) was(tool string) bool { q.mu.Lock(); defer q.mu.Unlock(); return q.late[tool] } |
| + |
| // query runs one probe command bounded by limit. |
| func (h ProbeHost) query(ctx context.Context, limit time.Duration, name string, args ...string) (string, error) { |
| c, cancel := context.WithTimeout(ctx, limit) |
| @@ -284,17 +274,16 @@ func probeP1(ctx context.Context, h ProbeHost, caps wire.Capabilities) wire.Prob |
| ios++ |
| } |
| } |
| + computer := map[bool]string{true: wire.ProbeDetail("computer", name)}[name != ""] |
| if caps.Xcode.Version == "" { |
| - return wire.Probe{ID: "P1", Verdict: wire.ProbeFailed, Detail: clean(h.noXcode() + "; " + name)} |
| - } |
| - detail := fmt.Sprintf("Xcode %s (%s); %d iOS simulators; %s", caps.Xcode.Version, caps.Xcode.Build, ios, name) |
| - if why := h.noSimulator(); why != "" { |
| - detail = fmt.Sprintf("Xcode %s (%s); %s; %s", caps.Xcode.Version, caps.Xcode.Build, why, name) |
| + return wire.Probe{ID: "P1", Verdict: wire.ProbeFailed, Detail: wire.ProbeDetails(h.noXcode(), computer)} |
| } |
| + sims := firstNonEmpty(h.noSimulator(), wire.ProbeDetail("ios_simulators", strconv.Itoa(ios))) |
| + detail := wire.ProbeDetails(wire.ProbeDetail("xcode", caps.Xcode.Version, caps.Xcode.Build), sims, computer) |
| if ios == 0 { |
| - return wire.Probe{ID: "P1", Verdict: wire.ProbeFailed, Detail: clean(detail)} |
| + return wire.Probe{ID: "P1", Verdict: wire.ProbeFailed, Detail: detail} |
| } |
| - return wire.Probe{ID: "P1", Verdict: wire.ProbePassed, Detail: clean(detail)} |
| + return wire.Probe{ID: "P1", Verdict: wire.ProbePassed, Detail: detail} |
| } |
| // ComputerName is the Mac's name as people see it ("Tito Studio"). |
| @@ -375,38 +364,35 @@ func JudgeP2(got map[string]string, f P2Facts) (verdict string, groups map[strin |
| } |
| // p2Detail says what P2 found (a place all of whose attempts are alike as |
| -// place.*) and whether the run's end was proven; why, a failed srt run's |
| -// short form, is last, so the capability string's limit cuts it first. |
| +// place.*) and whether the run's end was proven; why, the steps of a |
| +// failed srt run, is last, so the capability string's limit cuts it |
| +// first. |
| func p2Detail(groups map[string][]string, total int, srtRan, ended bool, why string) string { |
| var parts []string |
| - for _, g := range []struct{ key, label string }{{"allowed", "allowed"}, {"failed", "not collected"}, {"unknown", "not shown denied"}, {"unix", "Unix permissions only"}} { |
| - switch n := len(groups[g.key]); { |
| - case n > 0 && n == total && n > len(probePlaces): |
| - // Every attempt alike: the count, which leaves room for why. |
| - parts = append(parts, fmt.Sprintf("%s: all %d attempts", g.label, n)) |
| - case n > 0: |
| + for _, g := range []struct{ key, code string }{{"allowed", "allowed"}, {"failed", "not_collected"}, {"unknown", "not_shown_denied"}, {"unix", "unix_only"}} { |
| + if len(groups[g.key]) > 0 { |
| list := " " + strings.Join(groups[g.key], " ") + " " |
| for _, p := range probePlaces { |
| list = strings.Replace(list, " "+p+"."+strings.Join(probeAttempts, " "+p+".")+" ", " "+p+".* ", 1) |
| } |
| - parts = append(parts, g.label+":"+strings.TrimRight(list, " ")) |
| + parts = append(parts, wire.ProbeDetail(g.code, strings.TrimSpace(list))) |
| } |
| } |
| if len(parts) == 0 { |
| - parts = append(parts, fmt.Sprintf("all %d attempts denied", total)) |
| + parts = append(parts, wire.ProbeDetail("all_denied", strconv.Itoa(total))) |
| } |
| if !ended { |
| - parts = append(parts, "end not proven") |
| + parts = append(parts, wire.ProbeDetail("end_unproven")) |
| } |
| switch { |
| case srtRan: |
| - parts = append(parts, "xcodebuild ran in srt") |
| + parts = append(parts, wire.ProbeDetail("srt_ran_xcode")) |
| case why != "": |
| - parts = append(parts, "xcodebuild did not run in srt: "+why) |
| + parts = append(parts, wire.ProbeDetail("srt_failed", why)) |
| default: |
| - parts = append(parts, "xcodebuild did not run in srt") |
| + parts = append(parts, wire.ProbeDetail("srt_not_run")) |
| } |
| - return clean(strings.Join(parts, "; ")) |
| + return wire.ProbeDetails(parts...) |
| } |
| // P2Script is P2's run under srt, one step at a time, each reporting |
| @@ -438,31 +424,31 @@ b=$? |
| // probeP2 runs the hostile fixture under the checks profile. |
| func probeP2(ctx context.Context, h ProbeHost, caps wire.Capabilities) (wire.Probe, bool, string) { |
| fail := func(verdict, why string) (wire.Probe, bool, string) { |
| - return wire.Probe{ID: "P2", Verdict: verdict, Detail: why}, false, "not probed" |
| + return wire.Probe{ID: "P2", Verdict: verdict, Detail: why}, false, "p3_keychain_unprobed" |
| } |
| if h.Tools.SRT == "" { |
| - return fail(wire.ProbeUnavailable, "srt is not installed") |
| + return fail(wire.ProbeUnavailable, wire.ProbeDetail("srt_missing")) |
| } |
| // No checks profile without the user's T (ChecksSettings refuses): |
| // say why, and checks wait for the sandbox. |
| if h.Paths.UserTemp == "" { |
| - return fail(wire.ProbeUnavailable, clean("user temp folder refused: "+firstNonEmpty(h.Paths.UserTempWhy, "not resolved"))) |
| + return fail(wire.ProbeUnavailable, wire.ProbeDetail("user_temp_refused")) |
| } |
| if caps.Xcode.Version == "" { |
| - return fail(wire.ProbeUnavailable, clean(h.noXcode())) |
| + return fail(wire.ProbeUnavailable, h.noXcode()) |
| } |
| if why := h.noSimulator(); why != "" { |
| - return fail(wire.ProbeUnavailable, clean(why)) |
| + return fail(wire.ProbeUnavailable, why) |
| } |
| // The hostile test runs where production checks run: on an iOS |
| // simulator, through CoreSimulator and the test services. |
| sim, ok := NewestIPhone(caps.Simulators) |
| if !ok { |
| - return fail(wire.ProbeUnavailable, "no iOS simulator") |
| + return fail(wire.ProbeUnavailable, wire.ProbeDetail("no_simulator")) |
| } |
| root, err := CopyFixture(h.Scratch) |
| if err != nil { |
| - return fail(wire.ProbeUnavailable, "the fixture could not be copied") |
| + return fail(wire.ProbeUnavailable, wire.ProbeDetail("fixture_uncopied")) |
| } |
| defer os.RemoveAll(filepath.Dir(root)) |
| facts := P2Facts{Accepted: map[string]bool{}} |
| @@ -521,7 +507,7 @@ func probeP2(ctx context.Context, h ProbeHost, caps wire.Capabilities) (wire.Pro |
| // there tries the runner user's login keychain file instead. |
| targets = append(targets, "keychain="+service, "keychain_file="+filepath.Join(h.Paths.Home, "Library", "Keychains", "login.keychain-db")) |
| if err := os.WriteFile(filepath.Join(root, "equipo-targets.txt"), []byte(strings.Join(targets, "\n")+"\n"), 0600); err != nil { |
| - return fail(wire.ProbeUnavailable, "the fixture could not be prepared") |
| + return fail(wire.ProbeUnavailable, wire.ProbeDetail("fixture_unprepared")) |
| } |
| script := P2Script(quote(h.Tools.Xcodebuild), quote(h.Tools.Xcrun), sim.UDID) |
| g, watch := h.Gate(true), newP2Watch() |
| @@ -542,7 +528,7 @@ func probeP2(ctx context.Context, h ProbeHost, caps wire.Capabilities) (wire.Pro |
| } |
| red := newRedactor(secrets, append([]string{h.Paths.Home, h.Paths.StateDir, h.Scratch}, h.Paths.OtherHomes...)) |
| f := watch.failure(res, red) |
| - why = f.short() |
| + why, _, _ = strings.Cut(f.short(), ": ") |
| if h.Warn != nil { |
| h.Warn("p2 srt run failed", "phase", f.Phase, "failed", strings.Join(f.Failed, ", "), "unfinished", f.Unfinished, "exit", f.Exit, "timed_out", f.TimedOut, "gate_reason", res.Reason, "excerpt", f.Excerpt) |
| } |
| @@ -553,10 +539,10 @@ func probeP2(ctx context.Context, h ProbeHost, caps wire.Capabilities) (wire.Pro |
| if !srtRan || !res.Terminated { |
| verdict = wire.ProbeFailed |
| } |
| - keychain := "denied" |
| + keychain := "p3_keychain_denied" |
| for _, list := range groups { |
| if strings.Contains(" "+strings.Join(list, " ")+" ", ".keychain ") { |
| - keychain = "not shown denied" |
| + keychain = "p3_keychain_unshown" |
| } |
| } |
| total := len(probePlaces) * len(probeAttempts) |
| @@ -591,26 +577,26 @@ func probeP4(ctx context.Context, h ProbeHost) wire.Probe { |
| var parts []string |
| switch { |
| case h.Paths.HomesUnknown: |
| - parts = append(parts, "other homes could not be checked") |
| + parts = append(parts, wire.ProbeDetail("homes_unchecked")) |
| case len(readable) > 0: |
| - parts = append(parts, "readable homes: "+strings.Join(readable, " ")) |
| + parts = append(parts, wire.ProbeDetail("homes_readable", strings.Join(readable, " "))) |
| default: |
| - parts = append(parts, "no other home readable") |
| + parts = append(parts, wire.ProbeDetail("homes_closed")) |
| } |
| - parts = append(parts, map[bool]string{true: "agent loaded", false: "agent not loaded"}[loaded]) |
| + parts = append(parts, wire.ProbeDetail(map[bool]string{true: "agent_loaded", false: "agent_not_loaded"}[loaded])) |
| switch { |
| case !known: |
| - parts = append(parts, "sleep unknown") |
| + parts = append(parts, wire.ProbeDetail("sleep_unknown")) |
| case sleep == 0: |
| - parts = append(parts, "sleep off on power") |
| + parts = append(parts, wire.ProbeDetail("sleep_off")) |
| default: |
| - parts = append(parts, fmt.Sprintf("sleeps after %d minutes on power", sleep)) |
| + parts = append(parts, wire.ProbeDetail("sleep_after", strconv.Itoa(sleep))) |
| } |
| verdict := wire.ProbePassed |
| if h.Paths.HomesUnknown || len(readable) > 0 || !loaded || !known || sleep != 0 { |
| verdict = wire.ProbeFailed |
| } |
| - return wire.Probe{ID: "P4", Verdict: verdict, Detail: clean(strings.Join(parts, "; "))} |
| + return wire.Probe{ID: "P4", Verdict: verdict, Detail: wire.ProbeDetails(parts...)} |
| } |
| // ACSleep reads `pmset -g custom`: the system sleep minutes under "AC |
| @@ -637,17 +623,17 @@ func ACSleep(out string) (int, bool) { |
| // the end takes to prove, what is left, and whether the tree goes. |
| func probeP6(ctx context.Context, h ProbeHost, caps wire.Capabilities, srtRan bool) wire.Probe { |
| if caps.Xcode.Version == "" { |
| - return wire.Probe{ID: "P6", Verdict: wire.ProbeUnavailable, Detail: clean(h.noXcode())} |
| + return wire.Probe{ID: "P6", Verdict: wire.ProbeUnavailable, Detail: h.noXcode()} |
| } |
| // A simctl that does not answer means CoreSimulator is stuck, and |
| // xcodebuild test asks it for destinations even for macOS: the probe |
| // would only wait out its whole limit. |
| if why := h.noSimulator(); why != "" { |
| - return wire.Probe{ID: "P6", Verdict: wire.ProbeUnavailable, Detail: clean(why)} |
| + return wire.Probe{ID: "P6", Verdict: wire.ProbeUnavailable, Detail: why} |
| } |
| root, err := CopyFixture(h.Scratch) |
| if err != nil { |
| - return wire.Probe{ID: "P6", Verdict: wire.ProbeUnavailable, Detail: "the fixture could not be copied"} |
| + return wire.Probe{ID: "P6", Verdict: wire.ProbeUnavailable, Detail: wire.ProbeDetail("fixture_uncopied")} |
| } |
| defer os.RemoveAll(filepath.Dir(root)) |
| destination := "platform=macOS" |
| @@ -691,25 +677,25 @@ func probeP6(ctx context.Context, h ProbeHost, caps wire.Capabilities, srtRan bo |
| after := processNames(context.WithoutCancel(ctx), h.Exec) |
| removed := os.RemoveAll(root) == nil |
| if stopped.IsZero() { |
| - return wire.Probe{ID: "P6", Verdict: wire.ProbeFailed, Detail: clean("the waiting test did not start (" + firstNonEmpty(res.Reason, "exit "+strconv.Itoa(res.Code)) + ")")} |
| + return wire.Probe{ID: "P6", Verdict: wire.ProbeFailed, Detail: wire.ProbeDetail("test_not_started", firstNonEmpty(res.Reason, "exit "+strconv.Itoa(res.Code)))} |
| } |
| var parts []string |
| if res.Terminated { |
| - parts = append(parts, fmt.Sprintf("group gone in %s", took)) |
| + parts = append(parts, wire.ProbeDetail("group_gone", took.String())) |
| } else { |
| - parts = append(parts, "group end not proven") |
| + parts = append(parts, wire.ProbeDetail("group_unproven")) |
| } |
| - parts = append(parts, fmt.Sprintf("%d marked left", len(left))) |
| + parts = append(parts, wire.ProbeDetail("marked_left", strconv.Itoa(len(left)))) |
| if n := newNames(before, after); len(n) > 0 { |
| - parts = append(parts, "still running: "+strings.Join(n, " ")) |
| + parts = append(parts, wire.ProbeDetail("still_running", strings.Join(n, " "))) |
| } |
| - parts = append(parts, fmt.Sprintf("%d simulators shut down", shut.Load())) |
| - parts = append(parts, map[bool]string{true: "tree removed", false: "tree not removable"}[removed]) |
| + 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])) |
| verdict := wire.ProbePassed |
| if !res.Terminated || len(left) > 0 || !removed { |
| verdict = wire.ProbeFailed |
| } |
| - return wire.Probe{ID: "P6", Verdict: verdict, Detail: clean(strings.Join(parts, "; "))} |
| + return wire.Probe{ID: "P6", Verdict: verdict, Detail: wire.ProbeDetails(parts...)} |
| } |
| // p6Script starts the fixture's waiting test, its writes in the |
| @@ -768,13 +754,13 @@ func probeP7(ctx context.Context, h ProbeHost) wire.Probe { |
| ok := true |
| for _, t := range []struct{ name, version string }{{"srt", srt}, {"node", node}, {"rg", rg}} { |
| if t.version == "" { |
| - parts, ok = append(parts, t.name+" missing"), false |
| + parts, ok = append(parts, wire.ProbeDetail("tool_missing", t.name)), false |
| } else { |
| - parts = append(parts, t.name+" "+t.version) |
| + parts = append(parts, wire.ProbeDetail("tool_version", t.name, t.version)) |
| } |
| } |
| if node != "" && !NodeSupported(node) { |
| - parts, ok = append(parts, "node older than 22.12"), false |
| + parts, ok = append(parts, wire.ProbeDetail("node_old")), false |
| } |
| if ok { |
| // srt itself: the smallest profile around /usr/bin/true. |
| @@ -786,7 +772,7 @@ func probeP7(ctx context.Context, h ProbeHost) wire.Probe { |
| defer os.Remove(file) |
| // srt starts its own runtime before the command: a minute, not a query's 30 s. |
| if _, err := h.query(ctx, time.Minute, h.Tools.SRT, "--settings", file, "--", "/usr/bin/true"); err != nil { |
| - parts, ok = append(parts, "srt could not run a command"), false |
| + parts, ok = append(parts, wire.ProbeDetail("srt_cannot_run")), false |
| } |
| } |
| } |
| @@ -794,7 +780,7 @@ func probeP7(ctx context.Context, h ProbeHost) wire.Probe { |
| if !ok { |
| verdict = wire.ProbeFailed |
| } |
| - return wire.Probe{ID: "P7", Verdict: verdict, Detail: clean(strings.Join(parts, "; "))} |
| + return wire.Probe{ID: "P7", Verdict: verdict, Detail: wire.ProbeDetails(parts...)} |
| } |
| // NodeSupported: srt needs Node 22.12 or later. |
| @@ -842,26 +828,6 @@ func CopyFixture(scratch string) (string, error) { |
| return root, nil |
| } |
| -// clean keeps a probe detail inside the capability string rules: one |
| -// line, no path separator, tilde or equals sign, at most 300 bytes. |
| -func clean(s string) string { |
| - s = strings.Map(func(r rune) rune { |
| - if strings.ContainsRune("/\\~\n\r\t\x00=", r) { |
| - return ' ' |
| - } |
| - return r |
| - }, s) |
| - for len(s) > wire.MaxCapabilityString { |
| - s = s[:len(s)-1] |
| - for len(s) > 0 && !utf8Start(s[len(s)-1]) { |
| - s = s[:len(s)-1] |
| - } |
| - } |
| - return s |
| -} |
| - |
| -func utf8Start(b byte) bool { return b&0xC0 != 0x80 } |
| - |
| func token() string { |
| b := make([]byte, 16) |
| _, _ = rand.Read(b) |
diff --git a/internal/runner/mac/probe_test.go b/internal/runner/mac/probe_test.go| index 9c07e7d9..a90ab0c8 100644 |
| --- a/internal/runner/mac/probe_test.go |
| +++ b/internal/runner/mac/probe_test.go |
| @@ -174,7 +174,7 @@ func TestRunProbesAllDenied(t *testing.T) { |
| if !r.Sandboxed() || !r.SRTRanXcode || r.Version != "abc1234" || r.Profile != ProfileDigest() { |
| t.Fatalf("P2 %+v srt=%v", r.Probe("P2"), r.SRTRanXcode) |
| } |
| - if p := r.Probe("P2"); p.Detail != "Unix permissions only: script.home plugin.home test.home; xcodebuild ran in srt" { |
| + if p := r.Probe("P2"); p.Detail != "unix_only:script.home plugin.home test.home;srt_ran_xcode" { |
| t.Fatalf("P2 detail %q", p.Detail) |
| } |
| for id, want := range map[string]string{"P1": wire.ProbePassed, "P3": wire.ProbeSkipped, "P4": wire.ProbePassed, "P5": wire.ProbeSkipped, "P6": wire.ProbePassed, "P7": wire.ProbePassed} { |
| @@ -182,7 +182,7 @@ func TestRunProbesAllDenied(t *testing.T) { |
| t.Fatalf("%s %+v", id, p) |
| } |
| } |
| - if !strings.HasPrefix(r.Probe("P1").Detail, "Xcode 16.2 (16C5032a); 5 iOS simulators; Tito Studio") || !strings.Contains(r.Probe("P6").Detail, "0 marked left") || !strings.Contains(r.Probe("P6").Detail, "tree removed") { |
| + if r.Probe("P1").Detail != "xcode:16.2,16C5032a;ios_simulators:5;computer:Tito Studio" || !strings.Contains(r.Probe("P6").Detail, "marked_left:0") || !strings.Contains(r.Probe("P6").Detail, "tree_removed") { |
| t.Fatalf("details %+v", r.Probes) |
| } |
| // The sentinel and the Keychain item are gone, the copies too. |
| @@ -212,17 +212,17 @@ func TestRunProbesAllDenied(t *testing.T) { |
| // DNS control that failed outside, a fixture that did not build. |
| func TestP2IsDeniedOnlyWhenEverythingIs(t *testing.T) { |
| f := newProbeFixture(t, allLines("denied"), "FAKE_READ_STATE=1") |
| - if p, _, _ := probeP2(context.Background(), f.h, Capabilities(context.Background(), f.h.Exec, f.h.Tools)); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "allowed: test.state") { |
| + if p, _, _ := probeP2(context.Background(), f.h, Capabilities(context.Background(), f.h.Exec, f.h.Tools)); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "allowed:test.state") { |
| t.Fatalf("sentinel read: %+v", p) |
| } |
| f = newProbeFixture(t, allLines("denied"), "FAKE_CONNECT=1") |
| - if p, _, _ := probeP2(context.Background(), f.h, Capabilities(context.Background(), f.h.Exec, f.h.Tools)); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "allowed: test.tcp") { |
| + if p, _, _ := probeP2(context.Background(), f.h, Capabilities(context.Background(), f.h.Exec, f.h.Tools)); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "allowed:test.tcp") { |
| t.Fatalf("connection behind a denied line: %+v", p) |
| } |
| lines := allLines("denied") |
| lines["plugin"] = strings.Replace(lines["plugin"], "warning: EQUIPO-PROBE plugin keychain denied\n", "", 1) |
| f = newProbeFixture(t, lines) |
| - if p, _, _ := probeP2(context.Background(), f.h, Capabilities(context.Background(), f.h.Exec, f.h.Tools)); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "not shown denied: plugin.keychain") { |
| + if p, _, _ := probeP2(context.Background(), f.h, Capabilities(context.Background(), f.h.Exec, f.h.Tools)); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "not_shown_denied:plugin.keychain") { |
| t.Fatalf("missing line: %+v", p) |
| } |
| f = newProbeFixture(t, allLines("denied")) |
| @@ -231,7 +231,7 @@ func TestP2IsDeniedOnlyWhenEverythingIs(t *testing.T) { |
| t.Fatalf("DNS control failed outside: %+v", p) |
| } |
| f = newProbeFixture(t, allLines("denied"), "FAKE_BUILD_FAIL=1") |
| - if p, ran, _ := probeP2(context.Background(), f.h, Capabilities(context.Background(), f.h.Exec, f.h.Tools)); ran || p.Verdict != wire.ProbeFailed || !strings.HasSuffix(p.Detail, "xcodebuild did not run in srt: script build exit 65: Sandbox: deny(1) mach-lookup com.apple.dt.example") { |
| + if p, ran, _ := probeP2(context.Background(), f.h, Capabilities(context.Background(), f.h.Exec, f.h.Tools)); ran || p.Verdict != wire.ProbeFailed || !strings.HasSuffix(p.Detail, "srt_failed:script build exit 65") { |
| t.Fatalf("the fixture did not build under srt: %+v ran=%v", p, ran) |
| } |
| f = newProbeFixture(t, allLines("denied")) |
| @@ -286,11 +286,11 @@ func TestP4(t *testing.T) { |
| f := newProbeFixture(t, nil) |
| f.h.Exposed = func(p string) bool { return p == "/Users/paul" } |
| p := probeP4(context.Background(), f.h) |
| - if p.Verdict != wire.ProbeFailed || p.Detail != "readable homes: paul; agent loaded; sleep off on power" { |
| + if p.Verdict != wire.ProbeFailed || p.Detail != "homes_readable:paul;agent_loaded;sleep_off" { |
| t.Fatalf("%+v", p) |
| } |
| f.h.Paths.HomesUnknown = true |
| - if p := probeP4(context.Background(), f.h); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "other homes could not be checked") { |
| + if p := probeP4(context.Background(), f.h); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "homes_unchecked") { |
| t.Fatalf("unknown homes: %+v", p) |
| } |
| } |
| @@ -346,7 +346,7 @@ func TestP2NeedsTheSimulatorAndAProvenEnd(t *testing.T) { |
| g.procs = withPhantom() |
| return g |
| } |
| - if p, _, _ := probeP2(context.Background(), f.h, caps); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "end not proven") { |
| + if p, _, _ := probeP2(context.Background(), f.h, caps); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "end_unproven") { |
| t.Fatalf("end not proven: %+v", p) |
| } |
| f.h.Gate = gate |
| @@ -357,7 +357,7 @@ func TestP2NeedsTheSimulatorAndAProvenEnd(t *testing.T) { |
| t.Fatalf("incomplete run: %+v", p) |
| } |
| caps.Simulators = nil |
| - if p, _, _ := probeP2(context.Background(), f.h, caps); p.Verdict != wire.ProbeUnavailable || p.Detail != "no iOS simulator" { |
| + if p, _, _ := probeP2(context.Background(), f.h, caps); p.Verdict != wire.ProbeUnavailable || p.Detail != "no_simulator" { |
| t.Fatalf("no simulator: %+v", p) |
| } |
| } |
| @@ -387,7 +387,7 @@ func TestRunProbesLimit(t *testing.T) { |
| t.Fatalf("unfinished %v %+v", r.Unfinished, r.Probes) |
| } |
| for _, id := range r.Unfinished { |
| - if p := r.Probe(id); p.Verdict != wire.ProbeUnavailable || p.Detail != "not proven: the probe run reached its limit of 300ms" { |
| + if p := r.Probe(id); p.Verdict != wire.ProbeUnavailable || p.Detail != "probe_limit:300ms" { |
| t.Fatalf("%s %+v", id, p) |
| } |
| } |
diff --git a/internal/runner/mac/usertemp_test.go b/internal/runner/mac/usertemp_test.go| index 6259fb00..2f929fcd 100644 |
| --- a/internal/runner/mac/usertemp_test.go |
| +++ b/internal/runner/mac/usertemp_test.go |
| @@ -266,7 +266,7 @@ func TestP2NeedsTheUserTemp(t *testing.T) { |
| f := newProbeFixture(t, allLines("denied")) |
| f.h.Paths.UserTemp, f.h.Paths.UserTempWhy = "", "its mode is not 0700" |
| p, ran, _ := probeP2(context.Background(), f.h, Capabilities(context.Background(), f.h.Exec, f.h.Tools)) |
| - if ran || p.Verdict != wire.ProbeUnavailable || p.Detail != "user temp folder refused: its mode is not 0700" { |
| + if ran || p.Verdict != wire.ProbeUnavailable || p.Detail != "user_temp_refused" { |
| t.Fatalf("%+v", p) |
| } |
| } |
diff --git a/internal/runner/mac/wbfix1_probe_test.go b/internal/runner/mac/wbfix1_probe_test.go| new file mode 100644 |
| index 00000000..15fb6c4b |
| --- /dev/null |
| +++ b/internal/runner/mac/wbfix1_probe_test.go |
| @@ -0,0 +1,42 @@ |
| +package mac |
| + |
| +import ( |
| + "context" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// codedProbes: every P probe's detail is codes with parameters, never |
| +// words (whole-branch fix 1, #6). |
| +func codedProbes(t *testing.T, ps ...wire.Probe) { |
| + t.Helper() |
| + for _, p := range ps { |
| + if parts, ok := wire.ParseProbeDetail(p.Detail); !ok || len(parts) == 0 { |
| + t.Errorf("%s: detail %q is not coded", p.ID, p.Detail) |
| + } |
| + } |
| +} |
| + |
| +func TestProbeDetailsCoded(t *testing.T) { |
| + f := newProbeFixture(t, allLines("denied")) |
| + codedProbes(t, RunProbes(context.Background(), f.h).Probes...) |
| + for _, env := range []string{"FAKE_READ_STATE=1", "FAKE_BUILD_FAIL=1", "FAKE_LINES_THEN_FAIL=1"} { |
| + f := newProbeFixture(t, allLines("denied"), env) |
| + p, _, _ := probeP2(context.Background(), f.h, Capabilities(context.Background(), f.h.Exec, f.h.Tools)) |
| + codedProbes(t, p) |
| + } |
| + f = newProbeFixture(t, allLines("denied")) |
| + caps := Capabilities(context.Background(), f.h.Exec, f.h.Tools) |
| + caps.Simulators = nil |
| + p, _, _ := probeP2(context.Background(), f.h, caps) |
| + codedProbes(t, p) |
| + f.h.Tools.SRT = "" |
| + p, _, _ = probeP2(context.Background(), f.h, caps) |
| + codedProbes(t, p) |
| + f = newProbeFixture(t, nil) |
| + f.h.Exposed = func(p string) bool { return p == "/Users/paul" } |
| + codedProbes(t, probeP4(context.Background(), f.h)) |
| + f.h.Paths.HomesUnknown = true |
| + codedProbes(t, probeP4(context.Background(), f.h)) |
| +} |
diff --git a/internal/runner/thin/fakeworker_testbuild.go b/internal/runner/thin/fakeworker_testbuild.go| index 8618bfce..c83d2dcd 100644 |
| --- a/internal/runner/thin/fakeworker_testbuild.go |
| +++ b/internal/runner/thin/fakeworker_testbuild.go |
| @@ -58,7 +58,7 @@ func (fakeWorker) platform(spec string) (wire.Platform, bool) { |
| } |
| // fakeProbeDetail is the detail of every probe the fixture reports. |
| -const fakeProbeDetail = "synthetic" |
| +const fakeProbeDetail = "all_denied:33" |
| // probe is the fixture report of a Mac with Xcode and one iPhone |
| // simulator, whose probes all came out as a Mac that can make changes |
| @@ -67,11 +67,11 @@ const fakeProbeDetail = "synthetic" |
| // while P2 is not denied), and its Engineering status ready. |
| func (fakeWorker) probe(sandbox string) func(context.Context) wire.Capabilities { |
| return func(context.Context) wire.Capabilities { |
| - p2, f5, f5Detail := wire.ProbeFailed, wire.ProbeSkipped, "P2 is not denied, so Xcode runs only in checks" |
| + p2, f5, f5Detail := wire.ProbeFailed, wire.ProbeSkipped, "f5_skipped" |
| if sandbox == wire.SandboxSeatbelt { |
| p2, f5, f5Detail = wire.ProbeDenied, wire.ProbeDenied, fakeProbeDetail |
| } |
| - probes := []wire.Probe{{ID: "P1", Verdict: wire.ProbePassed, Detail: "Xcode 16.2 (16C5032a); 1 iOS simulators; Tito Studio"}, {ID: "P2", Verdict: p2, Detail: fakeProbeDetail}, {ID: "P3", Verdict: wire.ProbeSkipped}, {ID: "P4", Verdict: wire.ProbePassed}, {ID: "P5", Verdict: wire.ProbeSkipped}, {ID: "P6", Verdict: wire.ProbePassed}, {ID: "P7", Verdict: wire.ProbePassed}} |
| + probes := []wire.Probe{{ID: "P1", Verdict: wire.ProbePassed, Detail: "xcode:16.2,16C5032a;ios_simulators:1;computer:Tito Studio"}, {ID: "P2", Verdict: p2, Detail: fakeProbeDetail}, {ID: "P3", Verdict: wire.ProbeSkipped}, {ID: "P4", Verdict: wire.ProbePassed}, {ID: "P5", Verdict: wire.ProbeSkipped}, {ID: "P6", Verdict: wire.ProbePassed}, {ID: "P7", Verdict: wire.ProbePassed}} |
| for _, id := range wire.EngineeringProbeIDs { |
| p := wire.Probe{ID: id, Verdict: wire.EngineeringProbeSuccess(id), Detail: fakeProbeDetail} |
| if id == "F5" { |
diff --git a/internal/runner/thin/mac_fprobe_test.go b/internal/runner/thin/mac_fprobe_test.go| index d9f8e9f5..4d83bf3e 100644 |
| --- a/internal/runner/thin/mac_fprobe_test.go |
| +++ b/internal/runner/thin/mac_fprobe_test.go |
| @@ -124,14 +124,14 @@ func TestProbeTurnVerdictIgnoresModelText(t *testing.T) { |
| } |
| return wire.Probe{} |
| } |
| - if p := byID("F2"); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "reached the tree: state") { |
| + if p := byID("F2"); p.Verdict != wire.ProbeFailed || !strings.Contains(p.Detail, "reached_tree:state") { |
| t.Fatalf("F2: %+v", p) |
| } |
| - if p := byID("F1"); p.Verdict != wire.ProbeFailed || !strings.HasPrefix(p.Detail, "the probe script was not shown run") || !strings.Contains(p.Detail, "not shown denied: tcp https https_local dns") { |
| + if p := byID("F1"); p.Verdict != wire.ProbeFailed || !strings.HasPrefix(p.Detail, "script_not_run;") || !strings.Contains(p.Detail, "not_shown_denied:tcp https https_local dns") { |
| t.Fatalf("F1 (the forged records in the tree are not the script's): %+v", p) |
| } |
| // The fake CLI runs no Bash: the runner's tool never saw a script run. |
| - if p := byID("F4"); p.Verdict != wire.ProbeFailed || p.Detail != "the probe script was not shown run; the child was not shown started" { |
| + if p := byID("F4"); p.Verdict != wire.ProbeFailed || p.Detail != "script_not_run;child_not_started" { |
| t.Fatalf("F4: %+v", p) |
| } |
| if p := byID("F7"); p.Verdict != wire.ProbeUnavailable { |
| @@ -193,7 +193,7 @@ func TestMacEngineeringStatusInCaps(t *testing.T) { |
| r := fprobe.Result{Launch: l, Inputs: in, At: time.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: "ok"}) |
| + r.Probes = append(r.Probes, wire.Probe{ID: id, Verdict: wire.EngineeringProbeSuccess(id), Detail: wire.ProbeDetail("f1_denied")}) |
| } |
| } |
| h.eng.store.Put(r) |
diff --git a/internal/runner/thin/mac_stall_test.go b/internal/runner/thin/mac_stall_test.go| index 6c7a4014..13a9c473 100644 |
| --- a/internal/runner/thin/mac_stall_test.go |
| +++ b/internal/runner/thin/mac_stall_test.go |
| @@ -137,11 +137,11 @@ func TestMacProbesFinishWhenSimctlHangs(t *testing.T) { |
| } |
| p1, p6 := r.Probe("P1"), r.Probe("P6") |
| if all { |
| - why := "simulator unavailable: simctl did not answer in 300ms" |
| + why := "simulator_unavailable:300ms" |
| if p1.Verdict != wire.ProbeFailed || !strings.Contains(p1.Detail, why) || p6.Verdict != wire.ProbeUnavailable || p6.Detail != why { |
| t.Fatalf("P1 %+v P6 %+v", p1, p6) |
| } |
| - } else if p6.Verdict != wire.ProbeFailed || !strings.Contains(p6.Detail, "did not start") { |
| + } else if p6.Verdict != wire.ProbeFailed || !strings.Contains(p6.Detail, "test_not_started:") { |
| // The fake xcodebuild runs no test: P6 ran its gate (which |
| // asked the booted list twice) and says so. |
| t.Fatalf("P6 %+v", p6) |
diff --git a/internal/thintest/fakerunner.go b/internal/thintest/fakerunner.go| index 5dc0d007..c933fd40 100644 |
| --- a/internal/thintest/fakerunner.go |
| +++ b/internal/thintest/fakerunner.go |
| @@ -32,7 +32,7 @@ func DialRunner(ctx context.Context, origin, token string, generation int64) (*F |
| func WorkerHello(generation int64) wire.Hello { |
| return wire.Hello{Generation: generation, Repos: []string{}, CreateIn: []string{}, Catalog: []wire.RepoInfo{}, Connections: []wire.HeldConnection{}, Versions: map[string]string{"runner": "test"}, Protocol: wire.Protocol2, Platform: &wire.Platform{OS: "darwin", Arch: "arm64"}, Label: "Tito Studio", Sandbox: wire.SandboxSeatbelt, |
| Capabilities: &wire.Capabilities{Xcode: wire.Xcode{Version: "16.2", Build: "16C5032a"}, Simulators: []wire.Simulator{{Name: "iPhone 16 Pro", Runtime: "iOS 18.2", UDID: "5C0A1E2B-3D4F-4A5B-9C6D-7E8F90A1B2C3", State: "Shutdown"}}, Tags: []string{wire.TagMacOS, wire.TagXcode, wire.TagIOSSimulator}, |
| - Probes: []wire.Probe{{ID: "P1", Verdict: wire.ProbePassed, Detail: "Xcode 16.2 (16C5032a); 1 iOS simulators; Tito Studio"}, {ID: "P2", Verdict: wire.ProbeFailed, Detail: "allowed: test.keychain; xcodebuild ran in srt"}, {ID: "P3", Verdict: wire.ProbeSkipped}, {ID: "P4", Verdict: wire.ProbePassed}, {ID: "P5", Verdict: wire.ProbeSkipped}, {ID: "P6", Verdict: wire.ProbePassed}, {ID: "P7", Verdict: wire.ProbePassed}}}} |
| + Probes: []wire.Probe{{ID: "P1", Verdict: wire.ProbePassed, Detail: "xcode:16.2,16C5032a;ios_simulators:1;computer:Tito Studio"}, {ID: "P2", Verdict: wire.ProbeFailed, Detail: "allowed:test.keychain;srt_ran_xcode"}, {ID: "P3", Verdict: wire.ProbeSkipped}, {ID: "P4", Verdict: wire.ProbePassed}, {ID: "P5", Verdict: wire.ProbeSkipped}, {ID: "P6", Verdict: wire.ProbePassed}, {ID: "P7", Verdict: wire.ProbePassed}}}} |
| } |
| // DialRunnerHello connects and says hello. |
diff --git a/internal/wire/probe_detail.go b/internal/wire/probe_detail.go| new file mode 100644 |
| index 00000000..85dfc7a8 |
| --- /dev/null |
| +++ b/internal/wire/probe_detail.go |
| @@ -0,0 +1,115 @@ |
| +package wire |
| + |
| +import ( |
| + "slices" |
| + "strings" |
| +) |
| + |
| +// A probe's Detail is structured: never words, only codes the instance |
| +// words (copy.go, runner.probe_detail.<code>) and what a probe found |
| +// (names, counts, versions) as their parameters. Encoded as parts joined |
| +// by ";", each its code, then ":" and its parameters joined by ",". |
| + |
| +// ProbeDetailCodes is every detail code a runner sends, with how many |
| +// parameters it takes (each a %s in its wording). |
| +var ProbeDetailCodes = map[string]int{ |
| + ProbeDetailTurnBusy: 0, "probe_limit": 1, "not_run": 0, "f5_skipped": 0, "inputs_changed": 0, |
| + "stale_runner": 0, "stale_settings": 0, "stale_cli": 0, "stale_xcode": 0, "stale_runtimes": 0, "future": 0, "expired": 0, |
| + "launch_not_started": 1, "launch_unproven": 0, "script_not_run": 0, "other_command": 0, "records_foreign": 0, |
| + "tree_unmade": 0, "not_prepared": 0, "no_loopback": 0, "script_unwritten": 0, "no_xcode": 0, "no_simulator": 0, |
| + "xcode_unavailable": 1, "simulator_unavailable": 1, "fixture_uncopied": 0, "fixture_unprepared": 0, "no_sentinel": 0, |
| + "allowed": 1, "not_shown_denied": 1, "not_collected": 1, "unix_only": 1, "reached_scratch": 1, "reached_tree": 1, |
| + "not_set_up": 1, "incomplete": 1, "tree_unsearched": 0, "secrets_unreadable": 0, "not_all_denied": 0, |
| + "loopback_hits": 1, "dns_control_failed": 0, "control_failed": 1, |
| + "no_token_file": 0, "no_procargs_reader": 0, "ps_control_failed": 0, "procargs_not_sandboxed": 0, "procargs_incomplete": 0, |
| + "process_list_unreadable": 0, "pipe_open": 1, "token_reached_scratch": 1, "token_reached_tree": 1, "token_reached": 1, |
| + "not_shown_tried": 1, "env_unreadable": 0, "token_in_env": 0, |
| + "control_read_missing": 0, "reached_model": 0, "not_shown_made": 1, "not_prescribed": 1, "unobserved": 1, |
| + "write_denied_place": 0, "write_through_link": 1, "hard_linked": 1, "link_not_refused": 1, |
| + "child_not_started": 0, "child_not_own_session": 0, "child_outlived": 0, "child_not_gone": 0, |
| + "f1_denied": 0, "f2_denied": 1, "other_home_os": 0, "f3_denied": 0, "f4_passed": 0, "f5_denied": 0, "unix_home": 0, |
| + "f6_denied": 1, "f7_denied": 0, |
| + "xcode": 2, "ios_simulators": 1, "computer": 1, "srt_missing": 0, "user_temp_refused": 0, "all_denied": 1, |
| + "end_unproven": 0, "srt_ran_xcode": 0, "srt_failed": 1, "srt_not_run": 0, |
| + "p3_keychain_denied": 0, "p3_keychain_unshown": 0, "p3_keychain_unprobed": 0, "p5_parked": 0, |
| + "homes_unchecked": 0, "homes_readable": 1, "homes_closed": 0, "agent_loaded": 0, "agent_not_loaded": 0, |
| + "sleep_unknown": 0, "sleep_off": 0, "sleep_after": 1, |
| + "test_not_started": 1, "group_gone": 1, "group_unproven": 0, "marked_left": 1, "still_running": 1, |
| + "simulators_shut": 1, "tree_removed": 0, "tree_not_removable": 0, |
| + "tool_missing": 1, "tool_version": 2, "node_old": 0, "srt_cannot_run": 0, |
| +} |
| + |
| +// maxDetailParam bounds one parameter. |
| +const maxDetailParam = 120 |
| + |
| +// ProbeDetail is one part: code and its parameters, each kept to the |
| +// capability string rules and stripped of the separators. |
| +func ProbeDetail(code string, params ...string) string { |
| + if len(params) == 0 { |
| + return code |
| + } |
| + clean := make([]string, len(params)) |
| + for i, p := range params { |
| + p = strings.Map(func(r rune) rune { |
| + if strings.ContainsRune(";,:/\\~\n\r\t\x00=", r) { |
| + return ' ' |
| + } |
| + return r |
| + }, p) |
| + for len(p) > maxDetailParam { |
| + p = p[:len(p)-1] |
| + for len(p) > 0 && p[len(p)-1]&0xC0 == 0x80 { |
| + p = p[:len(p)-1] |
| + } |
| + } |
| + clean[i] = strings.TrimSpace(p) |
| + } |
| + return code + ":" + strings.Join(clean, ",") |
| +} |
| + |
| +// ProbeDetails joins parts (empty ones left out), keeping whole parts |
| +// while they fit MaxCapabilityString. |
| +func ProbeDetails(parts ...string) string { |
| + var b strings.Builder |
| + for _, p := range parts { |
| + if p == "" { |
| + continue |
| + } |
| + if n := b.Len() + len(p); b.Len() > 0 && n+1 > MaxCapabilityString || n > MaxCapabilityString { |
| + break |
| + } |
| + if b.Len() > 0 { |
| + b.WriteByte(';') |
| + } |
| + b.WriteString(p) |
| + } |
| + return b.String() |
| +} |
| + |
| +// ProbeDetailPart is one decoded part. |
| +type ProbeDetailPart struct { |
| + Code string |
| + Params []string |
| +} |
| + |
| +// ParseProbeDetail decodes d: only parts with a known code and its |
| +// number of parameters; ok when every part was one. |
| +func ParseProbeDetail(d string) (parts []ProbeDetailPart, ok bool) { |
| + if d == "" { |
| + return nil, true |
| + } |
| + ok = true |
| + for _, raw := range strings.Split(d, ";") { |
| + code, rest, has := strings.Cut(raw, ":") |
| + var params []string |
| + if has { |
| + params = strings.Split(rest, ",") |
| + } |
| + if n, known := ProbeDetailCodes[code]; !known || n != len(params) || slices.ContainsFunc(params, func(p string) bool { return p == "" || p != strings.TrimSpace(p) }) { |
| + ok = false |
| + continue |
| + } |
| + parts = append(parts, ProbeDetailPart{Code: code, Params: params}) |
| + } |
| + return parts, ok |
| +} |
diff --git a/internal/wire/probe_detail_test.go b/internal/wire/probe_detail_test.go| new file mode 100644 |
| index 00000000..3ebe51c5 |
| --- /dev/null |
| +++ b/internal/wire/probe_detail_test.go |
| @@ -0,0 +1,44 @@ |
| +package wire_test |
| + |
| +import ( |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/oficina/equipo/internal/wire" |
| +) |
| + |
| +// Whole-branch fix 1, #6: a probe's detail is codes with parameters, |
| +// never words; what the instance cannot decode is not shown. |
| +func TestProbeDetailCoded(t *testing.T) { |
| + d := wire.ProbeDetails(wire.ProbeDetail("allowed", "home.cat tcp"), "", wire.ProbeDetail("not_run"), wire.ProbeDetail("xcode", "26.2", "17C52")) |
| + parts, ok := wire.ParseProbeDetail(d) |
| + if !ok || len(parts) != 3 || parts[0].Code != "allowed" || parts[0].Params[0] != "home.cat tcp" || parts[1].Code != "not_run" || len(parts[1].Params) != 0 || parts[2].Params[1] != "17C52" { |
| + t.Fatalf("%q: %+v %v", d, parts, ok) |
| + } |
| + // Separators and the capability string's forbidden characters never |
| + // survive in a parameter. |
| + p := wire.ProbeDetail("still_running", "a;b,c:d/e=f\ng") |
| + if parts, ok := wire.ParseProbeDetail(p); !ok || len(parts) != 1 || strings.ContainsAny(parts[0].Params[0], ";,:/=\n") { |
| + t.Fatalf("%q: %+v %v", p, parts, ok) |
| + } |
| + if err := wire.ValidCapabilities(wire.Capabilities{Probes: []wire.Probe{{ID: "P6", Verdict: wire.ProbeFailed, Detail: p}}}); err != nil { |
| + t.Fatalf("a coded detail refused: %v", err) |
| + } |
| + // Words, an unknown code or the wrong number of parameters: not a |
| + // part. |
| + for _, bad := range []string{"not run yet", "nope", "allowed", "allowed:a,b", "not_run:x", "allowed: home.cat", "allowed:"} { |
| + if parts, ok := wire.ParseProbeDetail(bad); ok || len(parts) != 0 { |
| + t.Errorf("%q decoded: %+v", bad, parts) |
| + } |
| + } |
| + // Whole parts only, within the capability string bound. |
| + long := wire.ProbeDetails(wire.ProbeDetail("allowed", strings.Repeat("x", 200)), wire.ProbeDetail("not_shown_denied", strings.Repeat("y", 200)), wire.ProbeDetail("not_collected", strings.Repeat("z", 200))) |
| + if parts, ok := wire.ParseProbeDetail(long); !ok || len(parts) != 2 || len(long) > wire.MaxCapabilityString { |
| + t.Fatalf("%d bytes: %+v %v", len(long), parts, ok) |
| + } |
| + for code := range wire.ProbeDetailCodes { |
| + if code == "" || strings.ContainsAny(code, ";,: ") { |
| + t.Errorf("code %q", code) |
| + } |
| + } |
| +} |