From session claude-82, 2026-09-28. Source: an audit of every ts-rust transcript from 2026-09-24 to 2026-09-28 (2 main sessions, 1,220 subagents, 82,711 tool calls). The fixes from that audit landed in 8f64c20ea. You already recorded the carry-forward rule, accepted R125, archived the closed-batch rule entries and pushed main. This file holds what is left.
Theo, 2026-09-28: "I trust all your judgment here. I will give full context so the other agent can decide what it wants to do itself." Each item says what I recommend and why. You decide how, when, and whether to change an item. Record each decision with scripts/state record note.
Work through them in order of your queue. Each item ends on a done when line.
Recommend: a standing rule in the AGENTS.md "Dev loop" section: push main (fast-forward only) after each accepted revision and after each commit that other hosts or agents must test, and push each goport-* branch that another host or agent tests. Force pushes stay forbidden. Theo once had to ask "are all the latest things pushed?" before he could send other agents to test.
Done when: AGENTS.md has the rule, and git rev-list --count origin/main..main is 0 after each accepted revision.
Recommend: run scripts/goport/prune-worktrees.py (a dry run). Check that no listed worktree belongs to a running workflow or a queued item. Then run it with --apply. At 08:30 UTC the dry run listed 254 worktrees and 218 merged branches. Every one is clean, merged into main, and idle for 3 days. The script keeps the other 2,597: they have unmerged or dirty work, mostly July agent branches. Keep those, because they may hold unported work.
Done when: a new dry run lists 0 stale worktrees.
ts_goport is one crate of 605k lines in 677 files. Sep 24 to 28: 475 release builds (20.4 h, median 81 s, p90 8 min) and 272 fat-LTO goport builds (36.7 h, median 7 min). Every edit rebuilds the whole crate.
Recommend, cheapest first:
- Measure a baseline on a quiet host with zbook's CPU (dbook-lan): a clean release build of
ts_goport, and a rebuild after you touch one checker file. - Try the nightly parallel frontend:
RUSTFLAGS=-Zthreads=8withcargo +nightly. Theo accepts experimental Rust. Keep it if the build is faster and the gate still passes. - After int12 part 2 lands in
main(few open lanes then), split the crate (the queue item "Split thets_goportcrate"). Mapuse crate::edges first. Move only parts with no edge back into the rest: start withlsp/lsproto/lsp_generated/. Measure after each part. Stop splitting when a part gains less than 10% on the touch rebuild.
Done when: the before and after build times are in docs/goport-next.md (or a linked doc), the gate passes on the result, and every open lane has rebased.
The first 2 hours after 8f64c20ea (43 subagents) show two gaps:
- Agents called raw
ssh53 times andremote.sh run31 times. Recommend: workflow prompts usescripts/goport/remote.sh run autofor every remote job. Rawsshis only for a quick look. - The median subagent made 52 calls before its first edit (baseline 43). Recommend: check that each new workflow prompt starts with the text of
docs/goport-agent-brief.md. If it does and the number stays high, list the files agents read before their first edit, and add the facts they keep looking up to the brief.
Done when: in scripts/audit/metrics.py, remoteShRun is higher than rawSsh, and medianCallsBeforeFirstEdit is at or below the baseline.
The gate's editor stage now fails on the known long-session leaks. Treat those failing sessions as known only until the lsmem2 and lsmem3 fixes are in main. A new session that fails, or a known one that gets worse, is a regression now. After those fixes, every editor FAIL is a regression.
Done when: docs/goport-next.md has this end condition, and the gate editor stage passes on main.
Recommend: add a queue item for 2026-09-30. Then run:
scripts/audit/metrics.py --since 2026-09-28T08:10:00Z
Compare the result with the baseline below. Targets:
| metric | baseline (Sep 24 to 28) | target |
|---|---|---|
| shortPollsPerSubagentHour | 9.18 | under 1 |
| askUserQuestions (askBlockedHours) | 3 (4.3 h) | 0 |
| formatOnlyRevisions | 1 of 13 (R125; R105 and R114 were also rejected only for rustfmt, but their follow-ups are not labeled format only) | 0 |
| carryForwardRevisions | 0 | every goport-only revision after R125 |
| builds.goport hours | 36.7 | only timing and release builds |
| journalParses / wfstatus | 106 / 0 | wfstatus only |
| rawSsh / remoteShRun | 842 / 546 | rawSsh near 0 (quick looks use remote.sh look) |
| medianCallsBeforeFirstEdit | 43 | lower |
formatOnlyRevisions also counts a revision that was opened before the window but recorded again inside it. R125 shows up in the first post-change window this way.
For each missed target, find the cause in the transcripts and fix the tool, the brief or the rule. Add one line per finding to this file.
Done when: each target is met or has a recorded fix, and scripts/audit/metrics.py is committed.
- Gate stages in parallel across hosts. 111 full gates: median 11 min, p90 23 min. Gates now go to free hosts (
remote.sh run auto). Do this only if integrations wait more than 15 minutes on a gate. - More cargo concurrency on zbook. Since Sep 25 the cargo lock wait has a median of 0 s (0.3 h in total over 227 builds).
- A Go-to-Rust symbol index. The 16,728
// Go: file.go:line Namemarkers already make one grep enough. - Smaller subagent contexts. Median 101k tokens per turn. Turn latency grows only a little with size (median 2.8 s at under 100k, 4.0 s at 600k), and Theo said usage does not matter.
Short polls went from 9.18 to 0.31 per subagent-hour. Most subagent waits now use timeout 590 in one call. Agents called wfstatus 10 times and parsed journals 2 times. They called candidate.sh 9 times. No agent asked a question. The two gaps are in item 4.
- Push rule: done. AGENTS.md "Dev loop" has "Push";
origin/main..mainwas 0 after R125. - Prune worktrees: done. The dry run listed 254 worktrees and 218 branches, none
goport-*and none used by a script. Applied: 0 stale worktrees left, 1,968 kept. State notedevloop-rec-2-prune-2026-09-28. - Build speed: workflow
devloop-build-speedmeasures a stable baseline and nightly-Zthreadson dbook, checks output identity, adopts nightly for dev builds only if it is more than 15% faster, and maps the crate split. The split starts after int12 part 2 is inmain. - Adoption gaps: workflow
devloop-agent-onboardingfinds why agents use raw ssh and what they look up before the first edit, then fixes the brief,remote.shand adds a helper if it pays off. The brief now also states the accepted Go pin and the host lock rule. - Editor-stage end condition: done, in
docs/goport-next.md. - Re-audit: queued in
docs/goport-next.mdfor 2026-09-30, with a session reminder.scripts/audit/metrics.pyis committed. Early run (since 08:10Z): shortPollsPerSubagentHour 0.3, askUserQuestions 0, rawSsh 53 against remoteShRun 33, medianCallsBeforeFirstEdit 53.
- Also added: AGENTS.md "Workflow changes" (do not resume a workflow after changing a later phase; a resume on 2026-09-28 re-ran 9 finished port lanes), "Pin" (main-based work sets GOPORT_PIN until the default pin switch) and "Host locks" (a subagent ran a job over raw ssh on a locked host during a host move).
- Not done: gate stages across hosts, more cargo concurrency, a symbol index, smaller contexts (as recommended).
- Item 4 follow-up (root): the onboarding workflow (
4c3530ea2) found thatrun autonever held its lock (ssh closed the fd) and that 0 of 41 new agents usedrun auto, mostly because root prompts named hosts and paraphrased the brief. Fixed: remote.shlook,job,push,sync-pin,status;run <host>locks itself;scripts/goport/facts; AGENTS.md now says to paste the brief word for word and name hosts only for timing. Target changed to rawSsh near 0.
scripts/audit/metrics.py --since 2026-09-28T08:10:00Z: 868 subagents, 68,466 tool calls, 428 subagent-hours, 25 revisions (R125 to R149; 21 accepted, 0 lost tests in each).
| metric | baseline | now | target |
|---|---|---|---|
| shortPollsPerSubagentHour | 9.18 | 0.02 | met |
| askUserQuestions | 3 (4.3 h) | 0 | met |
| formatOnlyRevisions | 1 | 0 real (the old regex also counted R127, "rustfmt and clippy clean") | met |
| builds.goport hours | 36.7 | 3.2 | met |
| rawSsh | 842 | 77 (3 after 2026-09-29 08:00) | met |
| journalParses / wfstatus | 106 / 0 | 53 / 191 | missed |
| medianCallsBeforeFirstEdit | 43 | 45 | missed |
Findings and fixes (one line each):
- Revision gate waits: the gate takes 11 minutes, but R148 and R149 waited 104 and 45 minutes for the dbook lock behind skeptic timing jobs. Fix: remote.sh keeps dbook-lan for revision evidence (
autoskips it;runandjobneedREMOTE_USE_RESERVED=1, which candidate.sh sets); timing moves to mini-abf9 and mini-743d. - Journal parses: root parsed
journal.jsonlto save workflow results to a file. Fix:wfstatus <run> --save FILE. - Ghost runs: two workflows from the 2026-09-29 session crash showed as running for 38 hours. Fix: wfstatus shows
stalewhen no agent wrote for 2 hours and does not count it. - Calls before the first edit: agents read the headers of candidate.sh (629 times), remote.sh (381) and run-cargo-capped.sh (208) to learn their usage; none had
--help. Fix:helpon each, and the brief lists them. - Lib blobs: 97 commits touched the two blobs, with 38 binary merge conflicts and 96 failing stale-blob tests (59 agents). Fix:
scripts/goport/lib-blobs.sh(stalewithout a build,write,check),candidate.sh checkrunsstale, and.gitattributeswithmerge.lib-blob.driver truekeeps our blob in a merge. The static check matched every "write the lib blobs again" commit and had 0 false positives on 40 main commits. - Context size: 22.4 B context tokens. The 37 lane agents used 15% (some reached 999k and compacted); the reused R113 auditor and reviewer used 1.0 B at up to 997k. Fix: AGENTS.md starts a new auditor and reviewer when a batch opens, and sizes lanes under 500k.
- Small retries (1.3% of calls fail): 74
sleep N; cmdblocks, 16 blocked report Writes (92 agents then wrote with a heredoc), 13rm -rf "$VAR"safety blocks. Fix: one line each in the brief. - Not measured: whether the 190 skeptic and verify agents (about 12% of tokens) find problems that the auditor and reviewer would miss.
Window 2026-10-01T02:44Z (the 09-30 fixes) to 2026-10-03T05:20Z, against 2026-09-28T08:10Z to 10-01T02:44Z. scripts/audit/metrics.py now also prints hostWaits, pollShare and acceptedRevisions.
| metric | before | after |
|---|---|---|
| revision open to accept | 60 to 150 min | 35 to 67 min |
| lib blob merge conflicts | 65 | 0 |
| tool source reads per day | 532 | 138 |
| agents over 500k context | 29 | 13 |
| time with under 3 workflows running | 22% | 1% |
| lanes landed per day | 15.2 | 16.1 |
| accepted revisions per day | 7.6 | 4.3 (2 to 5 lanes each, 0 unaccepted) |
| context tokens per day | 8.9 B | 5.8 B |
| pollShare (subagent time in wait loops) | 0.25 | 0.60 |
| hostWaits per day | about 180 | about 860 |
Findings and fixes (one line each):
- Integration was 74% of each revision cycle (3.4 h average: merge 28 min, checks 111, skeptic 62). Its checks ran the oracles and np-suite by hand before
sideran them again, and since int27 each integration also timed two PGO+BOLT builds per side on both minis (+40 min); int31's one flagged cost did not repeat. Fix: AGENTS.md "Integration" (checks startcandidate.sh side int<N> --checkout; timing only for perf lanes or hot-path changes).candidate.sh sidenow compares a reused tests or gate run again when the base changed, and keeps the old compare astests-base-<sha>.jsonorgate-compare-base-<label>.json(before, a reused compare could name an older base). - Host queue: all 4 shared hosts held by one workflow with 3 jobs waiting while dbook idled; dbook ran only about 30 minutes of revision evidence per revision. Fix: integration side runs use dbook (above).
- Cargo: one Cargo at a time across all worktrees (a June rule) made builds wait 1.9 min on average (p90 6.4) behind 20-minute PGO builds. No Cargo scope peaked above 11.6 GB. Fix:
TS_CARGO_SLOTS(2 on zbook) in run-cargo-capped.sh, with a per-slot sccache socket; the brief puts build-release.sh undertarget/locks/build-release.lock. - After each accept, the reviewer follow-up lane waited for the extra LSP batteries (72 to 101 min), and the next integration waited for lanes that started after the accept: int31 and int32 started 3 and 4.3 h after their base was accepted. Fix: AGENTS.md "After an accept".
- tscbpar1 ran 6 rounds (about 26 workflow hours) and loaderorder1 2, both not taken: the skeptic found a design that does not follow Go only after a full round. Fix: AGENTS.md "Rounds" (a Go model note checked before code; root decides again after 3 rounds).
- Not changed: the findings ledger (the three open S1 items were fixed in R151 and R152, but followups9b found another SIGPIPE bug); lane agents over 500k (13, most of their time in waits).