oficina / equipo Public

Mac slice F task 17: fix what make ci found (lint, leaks, budgets, API)

All four caused by slice F; each passes at 8bd40ed1.
- staticcheck: drop the unused jsonEqual and settleRecord test
  helpers, call Verify twice into named results (SA4000; the double
  proof is the point), drop the unused restartMac result (SA4006).
- gitleaks: the protocol 37 hello fixture's seal key, the text
  0123456789abcdef0123456789abcdef and its base64, allowed by exact
  value in .gitleaks.toml. Mutation: one character off, 1 leak found.
- TestBudgetRecordsAreShort: the thin and headless size reasons cut
  under 200 bytes; numbers unchanged.
- TestPersonAPIDeviceContract: docs/api/equipo-v1.openapi.json gains
  Capabilities unproven_count and runner_user and Step sandbox_choice,
  waiting_for, made_on and xcode_access, as generated from
  internal/wire. Mutation: without runner_user the test fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 5e7b19aecc580934bb1ece479e6a113e5a6b50ca parent ca4dd30
7 files changed, +29 −21
  • .gitleaks.toml +5 −0
  • .rastrillo/budgets.txt +2 −2
  • docs/api/equipo-v1.openapi.json +19 −0
  • internal/headless/mac_mixed_test.go +0 −11
  • internal/runner/mac/fix9f3_test.go +0 −6
  • internal/runner/mac/fix9f_test.go +2 −1
  • internal/thintest/mac_publication_contract_test.go +1 −1
diff --git a/.gitleaks.toml b/.gitleaks.toml
index 73742c5a..93510242 100644
--- a/.gitleaks.toml
+++ b/.gitleaks.toml
@@ -27,3 +27,8 @@ regexes = ['''^sk-go-equipo-test-key-0123456789$''']
description = "Native push tests compare the fake device bearers the native fixtures have always used (equipo.person.v1.TOKENFIXTURE, equipo.person.v1.OTHER); they are not credentials."
regexTarget = "line"
regexes = ['''\["equipo\.person\.v1\.TOKENFIXTURE", "equipo\.person\.v1\.OTHER"\]''']
+
+[[allowlists]]
+description = "The protocol 37 worker hello fixture (wiretest frames/hello-worker-conns.json) uses the seal key 0123456789abcdef0123456789abcdef, as text and as base64; it is not a credential."
+regexTarget = "secret"
+regexes = ['''^0123456789abcdef0123456789abcdef$''', '''^MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY=$''']
diff --git a/.rastrillo/budgets.txt b/.rastrillo/budgets.txt
index cb5939ba..3d0e0a2f 100644
--- a/.rastrillo/budgets.txt
+++ b/.rastrillo/budgets.txt
@@ -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 34495 31528 Protocols 31 to 35, merge credential, publication guards, kept work, scans, Mac pin, paths, bases, endpoint, Mac turns, Mac credentials, worker conns, Engineering, asks, F probes, D1, the fake Mac worker that makes changes, reboot acknowledgements, the rollback hold of Engineering reports, cancels classified on dispatch; 34495/31528.
+size internal/runner/thin 34495 31528 Protocols 31 to 35, merge credential, publication guards, kept work, scans; Mac pin, turns, credentials, Engineering, asks, F probes, D1, fake worker; 34495/31528.
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).
@@ -70,7 +70,7 @@ perf GET /api/v1/tasks/{id}/files/{file} skip Research kept images: bearer-only
perf GET /tasks/{id}/files/{file} skip Research kept images: the bytes of one image, shown on the task page; a file, not a screen.
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 - 13340 Grant scenarios (#48); sign-in email at 1280 and 390; Assistant files end to end; the restart wait; the live site waits for a place; a card answer settles at the bottom; Mac Engineering M9 and mixed versions; measured 13340 test lines.
+size internal/headless - 13340 Grant scenarios (#48); sign-in email at 1280 and 390; Assistant files; restart wait; live site waits; card answer; Mac M9 and mixed versions; measured 13340 test lines.
size internal/thintest - 40338 Protocol 31 contracts, 35 diffs, stuck tasks, no-access merges, held retries, unfinished work, free rounds, previews, Assistant files, places, Mac waits, Mac Engineering, conns, asks, D1; 40338.
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}.
diff --git a/docs/api/equipo-v1.openapi.json b/docs/api/equipo-v1.openapi.json
index b58146eb..d551966d 100644
--- a/docs/api/equipo-v1.openapi.json
+++ b/docs/api/equipo-v1.openapi.json
@@ -19160,6 +19160,10 @@
"unproven": {
"type": "string"
},
+ "unproven_count": {
+ "type": "integer",
+ "format": "int64"
+ },
"model_hold": {
"type": "boolean"
},
@@ -19168,6 +19172,9 @@
"items": {
"type": "string"
}
+ },
+ "runner_user": {
+ "type": "string"
}
},
"required": [
@@ -22695,6 +22702,18 @@
"engineering_status": {
"$ref": "#/components/schemas/EngineeringStatus"
},
+ "sandbox_choice": {
+ "type": "string"
+ },
+ "waiting_for": {
+ "type": "string"
+ },
+ "made_on": {
+ "type": "string"
+ },
+ "xcode_access": {
+ "type": "string"
+ },
"needs": {
"type": [
"array",
diff --git a/internal/headless/mac_mixed_test.go b/internal/headless/mac_mixed_test.go
index f4b873b5..e2b42301 100644
--- a/internal/headless/mac_mixed_test.go
+++ b/internal/headless/mac_mixed_test.go
@@ -501,14 +501,3 @@ func workerRefs(t *testing.T, worker *localRunner) []string {
slices.Sort(out)
return out
}
-
-// jsonEqual compares two JSON documents by value.
-func jsonEqual(a, b []byte) bool {
- var x, y any
- if json.Unmarshal(a, &x) != nil || json.Unmarshal(b, &y) != nil {
- return false
- }
- ax, _ := json.Marshal(x)
- by, _ := json.Marshal(y)
- return bytes.Equal(ax, by)
-}
diff --git a/internal/runner/mac/fix9f3_test.go b/internal/runner/mac/fix9f3_test.go
index 76f03ebb..ab8c4f85 100644
--- a/internal/runner/mac/fix9f3_test.go
+++ b/internal/runner/mac/fix9f3_test.go
@@ -3,7 +3,6 @@ package mac
import (
"os"
"testing"
- "time"
"amadan.net/oficina/equipo/internal/runner/mac/proc"
)
@@ -82,8 +81,3 @@ func TestRebootEvidencePerMarker(t *testing.T) {
// parseRecord is proc.ParseRecord (tests).
func parseRecord(id string) (int, string, bool) { return proc.ParseRecord(id) }
-
-// settleRecord is proc.SettleMarked on x's table (tests).
-func (x *Executor) settleRecord(pgid int, attempt string, deadline time.Time) bool {
- return proc.SettleMarked(x.procs(), x.own(), pgid, attempt, deadline)
-}
diff --git a/internal/runner/mac/fix9f_test.go b/internal/runner/mac/fix9f_test.go
index e3ece7d2..ee1830ab 100644
--- a/internal/runner/mac/fix9f_test.go
+++ b/internal/runner/mac/fix9f_test.go
@@ -192,7 +192,8 @@ func TestRebootIgnoresTheOldBootsGroups(t *testing.T) {
again := NewTurns(turns.lock).Sweep(tb)
again.own, again.Settle, again.boot = turns.own, turns.Settle, turns.boot
y := &Executor{Turns: again, Settle: x.Settle}
- if !y.Verify(RecordID(99400, "attempt-c")) || !y.Verify(RecordID(99400, "attempt-c")) {
+ first, second := y.Verify(RecordID(99400, "attempt-c")), y.Verify(RecordID(99400, "attempt-c"))
+ if !first || !second {
t.Fatalf("record %v: a later proof of the same record failed", viaRecord)
}
y.Acknowledge(RecordID(99400, "attempt-c"), ConsumerStep)
diff --git a/internal/thintest/mac_publication_contract_test.go b/internal/thintest/mac_publication_contract_test.go
index 1238b75a..92416516 100644
--- a/internal/thintest/mac_publication_contract_test.go
+++ b/internal/thintest/mac_publication_contract_test.go
@@ -432,7 +432,7 @@ func TestContractPublishedFilesSurviveDone(t *testing.T) {
w.send(wire.FrameStep, done)
}
r.shown(task, base, cand, swipeDiff)
- w = r.restartMac(w)
+ r.restartMac(w)
r.shown(task, base, cand, swipeDiff)
})
}