Repository navigation
Queen actors night loop 2026-10-10: weak spots after the seven, continuous improvement (ledger) #1729
Copy link
Copy link
Open
Description
The owner's night loop, started 2026-10-10 20:07Z. The cron fires every 15 min with the owner's standing instruction (translated):
- find the weak spots of the actor-model work and study competitors;
- make a decomposed plan and implement all of it;
- end with a report and three options for cooperating on the next loop;
- keep improving continuously, update skills with what was learned, and never let a new tick break earlier work;
- be self-critical, look for anomalies and self-heal;
- extend tri CLI with new commands;
- track every task as an issue, push coverage to 100%, auto-fix, and merge when green.
Earlier epic: #1712. Its seven items are merged into actors-next; lane 5 (#1726) and the three-way decision replay (#1728, t27#8317) are in flight.
Tick protocol (so a tick never breaks earlier work)
- This issue is the ledger. Every tick appends one comment: what it checked, what it started, merged or healed, and what it found wrong.
- Ownership. One task, one issue, one branch, one worktree. A tick starts a task only if no open branch or PR for it exists (
gh pr list,git ls-remote). - Concurrency. At most 4 agents at once, because the host load reached 40 with 7 and timing tests then flaked. Load is checked first.
- Merge rule. Merge only green: the spec checks required on t27, and the full api suite equal to the recorded baseline on trios.
actors-nextgoes intoqueen(production) once, after lane 5 and the replay are in and the suite equals the baseline. All new behaviour stays behind flags that are off by default.
- Anomaly checks every tick: a red PR, a stale agent (no file change in 45 min),
actors-nextsuite drift, disk under 3 GB, load over 30, a cron that did not fire. - Healing: rebase, rerun, restart the lane from its worktree, or file an issue.
Decomposed plan (weak spots found by the seven lanes and the study)
- Ship. Merge
actors-nextintoqueen. Then turn flags on one at a time, by data:- telemetry first;
- then waits=rows and turn stop;
- adaptive concurrency only when the telemetry shows ≥5 free review lanes over 24 h.
- Deploy drain. Every deploy still freezes the swarm for 1800 s, and no lane shortened it. With durable jobs and waits and stoppable turns, a spec can bound the drain by in-flight turns and abort past a deadline.
- Reviews as process isolates. A step that ignores its abort still runs to its own end (lane 2 gap).
- A semaphore wait for review lanes. Adaptive concurrency loses with scarce lanes (lane 3: 3 lanes, 360 vs 429).
- Waits.
- a GitHub
workflow_runwebhook into/queen/waits/resolve, because detection is 83 s, worst case 240 s; - move the reviewer backoff and supervisor restart timers to rows;
- prune ended rows.
- a GitHub
- PgLink.
- piggyback the acknowledgement on the next read (6.2 back to ~4 SQL per round trip);
- rejoin after a fence without a process restart.
- Keyed.
- the claim holder is the actor pid (needed for a second dispatcher);
- supervise the admission actor;
- extend the call-cycle check beyond slots 0-63.
- Telemetry.
- an overhead number on a quiet host (the night window);
- fix the flaky "a process takes its messages in order" test (slice versus virtual clock);
- make the 200 000-turn flood test independent of load.
- Coverage to 100%.
- every queen spec with 0 vacuous tests, on both the reference and t27b;
- line coverage of the actor runtime modules (
queen-actors*.ts) measured and raised to 100%, or each uncovered line justified in a list.
- tri CLI. New commands, each with its decisions in a
.t27spec and only thin glue:tri actors(metrics from/queen/actors/metrics);tri lab receipt(t27b verdicts for a set of specs);tri lanes(worktrees, branches and PRs of a loop).
- Skills and memory. Write down the traps learned:
queen/…branches are impossible next toqueen;- the repo-local
.githooks; - SIGPIPE from
| headkills zig; Closesdoes not fire on a non-default base;- load-sensitive timing tests;
- shared
node_modulesthrough symlinks; - keep both lanes' PIN lines.
- Compiler defects found on the way, each its own t27 issue (see #5980):
- gen-c
1 << 32as a C int; - generic dividers for constants;
__mul_noopon narrow operands;- literal-bound loops;
- modules without data ports.
- gen-c
- FPGA hardware profile (
actors_hw.t27): in flight. - Closing. The queen(actors): a killed turn stops - AbortSignal into model and git calls, process groups killed whole #1713-feat(queen): actor telemetry per kind and a replayable decision log - telemetry.t27, GET /queen/actors/metrics (Closes #1718) #1725 issues stay open because
Closesonly fires onmain. Close each one by hand with its merge link onceactors-nextis inqueen. - Final report with three options for cooperating on the next loop.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
gHashTag commentedon Oct 9, 2026
Tick 1, 2026-10-10 20:07Z
actors_hw.t27, in t27;actors-nextagainst the baseline, then shipactors-nextintoqueen(item 1).gHashTag commentedon Oct 9, 2026
Tick 2, 2026-10-10 ~20:45Z
actors-next(test(queen): the actor runtime under a seeded deterministic simulation, as a CI gate - simulation.t27 (Closes #1721) #1726, a053d3e). The seeded gate catches every known bug put back, from a seed. It also found a real one: a turn could run after its process had stopped. That is fixed, with a regression test.actors-nextintoqueen, 22 commits. Every new behaviour sits behind an off flag. Auto-fix is on.queen: 1584 pass, 10 fail.actors-next: 1684 pass, 11 fail.Tests/*andActor simulationchecks green. Biome and Typecheck are judged againstqueen's own state, where they are red on existing debt.gHashTag commentedon Oct 9, 2026
Tick 3, 2026-10-10 ~21:20Z: self-healing on the ship PR
runner / Biome(36 against 29) andrunner / Typecheck(98 against 75 tsc errors) worse thanqueen.gen-jsoutput with no types (TS7016, with TS2305/2459 following from it), andbiome.jsonlists generated files one by one.actors-next.t27c gen-ts. Each one's names and values were checked identical to the old output.review_valvestays.gen.js, because its master spec has moved on.biome-ignorewith the reason.queen's 29, tsc 19 against 75, TS7016 3 against 23. Both checks stay red only on older debt, and the PR now removes debt.processWorkcaller, nocreatePgLinkcaller, every flag guarded, the migrations additive and idempotent, the dispatch commands untouched outside a turn.Actor simulationis green. AllTests/*checks are queued for runners. Merge queen(actors): ship the seven actor-runtime improvements of #1712, every new behaviour behind an off flag #1730 when they are green, judged againstqueen's own test failures.gen-ts, notgen-js;gen-jsoutput leaves tsc blind.gHashTag commentedon Oct 9, 2026
Tick 4, 2026-10-10 ~22:05Z
Finished since tick 3:
reference_disagree0. The replay specs now live inspecs/queen/replay/, so every master run of the t27b lab re-checks them.demonitorflush, andcall's timeout against an already-queued reply, both missed sampled letters. Red test first, then fixed.Changes to the protocol:
actors-nextis frozen as the ship PR queen(actors): ship the seven actor-runtime improvements of #1712, every new behaviour behind an off flag #1730 (head 55fb49f, CI re-running). The earlier CI failure was infrastructure: all 15 Tests jobs died at "Initialize containers" with "Docker pull failed"; I re-ran them.actors-next-2.Wave 2 started, 4 agents:
tri lab receipt,tri actors,tri lanes;The blog draft (trinity#1583) is waiting for the ship merge.
gHashTag commentedon Oct 10, 2026
Tick 5, 2026-10-10 ~13:00Z: anomalies and self-healing on the ship PR #1730
/queen/actors(telemetry counts and the logged card decisions) was mounted with no guard. The route-guard audit intests/api/routes/route-guard.test.tscaught it on CI. fix(queen): /queen/actors is guarded by the trusted-origin check, like needs-you #1735, merged intoactors-next(6a68c93), puts it behindrequireTrustedAppOrigin()like/queen/needs-youand re-measures the audit's pins: 62 mounts, 20 guarded sub-apps, 39/queenmounts with 13 wrapper-guarded.trios/tools, so the test errored at import. Now included.dmitrii-f-t27rewroteactors-nextandactors-next-2from 55fb49f to 281495d. The tree is identical (c7bedeebeca3); only the commit authors changed, to "Dmitriy Vasilev". Nothing was reverted. My fix branch was rebased onto the new history.queen-bee-actors-round, one inqueen-review-actors-startand one inqueen-actors-pg-beat-liveusejest.useFakeTimers()and hang or fail only on CI.Date.now()delta = 0; SIGTERM shutdown, Klavis, waitForReady) consistent with fake timers leaking after a timed-out test.queen-ci-linux-timersintoactors-next): injectedVirtualClocks instead of global fake timers, a dash-safe fixture, and a file-levelafterEachrestore.queen(20 against 29, and 19 against 75).triCLI lane waits for a free slot.spec(queen): review_lanes.t27 - a review with no lane free waits for …
spec(queen): drain.t27 - a draining Queen waits for her own bees, sto…
gHashTag commentedon Oct 10, 2026
Tick 6, 2026-10-10 13:40Z: SHIPPED. #1730 merged into
queenas 56c5df7 at 13:38:37Z. Railway is buildingtrios-agent-server, and the drain will hold up to 30 min. Every new behaviour is behind a flag that is off.Checks at merge: 18 pass, 2 fail.
queenbefore this PR and are now lower than there: 20 against 29, and 19 against 75.Tests/*check passed, as didActor simulation.How the CI-only failures were healed (#1741, issue #1738):
jest.useFakeTimers()tests stalled on ubuntu with bun 1.3.6. A timed-out test kept the fake clock installed for every later file, which caused the cascade. Those tests now drive an injectedVirtualClock, through new clock parameters that default to the real clock:startBeeDispatcher,startReviewerActors,nodeBeat.task-queue-service.test.tsrestored amock.module'd logger and pg with the mock itself. That is platform-independent and reproduced on macOS.chat-service.test.tsmocks four modules and never restores them. It breaks nothing today but is a latent hazard.Wave 2, merged into
actors-next-2(the next ship batch):Review-lane semaphore (feat(queen): a review with no lane free waits for one in a bounded queue - review_lanes.t27, behind TRIOS_QUEEN_REVIEW_LANES=semaphore (Closes #1737) #1739, t27#8582): adaptive plus the queue scores 473 against 429 for fixed 4 on 3 lanes, and equals adaptive on 47 lanes. Small memory is still memory-bound.
Bounded drain (feat(queen): a deploy drain bounded by what is in flight - drain.t27, behind TRIOS_QUEEN_DRAIN=bounded (Closes #1740) #1742, t27#8585). This does not shorten a busy deploy on today's settings. The real cut needs an owner action on Railway:
TRIOS_BEE_RUNNER_SECONDSontrios-agent-server, and givetrios-bee-runner-1/2TRIOS_BEE_RUNNER_SLOTS;TRIOS_QUEEN_DRAIN=bounded.The simulation then exits in about 2 s instead of 1156–1812 s, with no bee cut. Not applied: production config is the owner's.
In flight: cost regression plus flakes,
triCLI commands, keyed hardening.tri lanes: a loop's lanes, each judged; red, conflicting and stale la…
tri lanes: a loop's lanes, each judged; red, conflicting and stale la…
gHashTag commentedon Oct 10, 2026
Tick 7, 2026-10-10 14:05Z.
Deploy. 56c5df7 is still
DEPLOYINGontrios-agent-server(deployment 9fcef88d, started 13:38:40Z). This is the bee drain: the old container waits up to 1800 s for its runner's bees. A watch is armed for the outcome.Closed by hand, because
Closesfires only onmain:#1737 and #1740 stay open until
actors-next-2ships.New: item 16, actor events for the kanban (#1744). The event shape is agreed on the issue with the session that builds gHashTag/t27#8615 (
actor_view.t27):deliver: offer, result, cancel, and the exit or DOWN that ends a task. These are unsampled.deliver: aggregated per (from, to) pair per window into count, dropped, max_depth, first_seq and last_seq.GET /queen/public-actors?since=, behindTRIOS_QUEEN_ACTOR_EVENTS, which is off.A lane agent is on it, on
actors-next-2.Anomaly: the disk filled. At 13:47Z the Mac had 116 MB free, and every Bash call failed with ENOSPC. Healed from the terminal:
Free space is now about 4.2 GB. The cache cleaner the notes describe exists only on the old machine; this Mac has none. Installing one is a standing config change, so it waits for the owner. Running lanes were told to rerun anything that failed in that window.
Self-correction. My quiet-host telemetry comment on t27#7851 dated the run 2026-10-10. The run was on 2026-10-09; the comment is fixed.
Blog. trinity#1583 now says the batch merged into production behind off flags. It also gives the quiet-host telemetry figures: +3.3% CPU per message, and the base rose from 3.7 to 4.5 µs, which #1743 is chasing. Its "Website checks" are red on the Queen viewport contract, the kanban card-slot geometry. That check also fails on an unrelated PR today (fix/lanes-never-count), so it is not the post; re-running.
In flight (4): cost and flakes (#1743), tri CLI, keyed hardening, actor events (#1744).
spec(queen): keyed_guard.t27 - the claim holder is a process boot and…
gHashTag commentedon Oct 10, 2026
Tick 8, 2026-10-10 14:20Z.
The deploy is live. 9fcef88d / 56c5df7 reached SUCCESS. The new container served from 14:13:04Z. Its log reads
Queen reviewer starting as actors ... workers=4 turnStop=false telemetry=false, so every flag is off, as intended. It shows no new error class. 15 "could not read the diff of finished work" lines are fewer than the previous container's 47.Found in that log: an old defect, now fixed (#1747, #1748, merged into
actors-next-2). The Queen's t27 root checkout cannot reachorigin/master. About 60 untrackedspecs/port/*.t27blockcheckout -B, so the Queen serves a local commit,c925f20804. The entrypoint's comment claimed untracked files never block. The fix moves exactly the untracked paths that the target tracks into.git/entrypoint-set-aside/<time>/and retries. Nothing is deleted. A local reproduction failed before the fix and passes after it. The fix ships with the next batch.tri CLI lane: done. Three commands are merged into t27 master, each with its own spec and with negative controls:
tri lab receipt(#8601);tri actors(#8614);tri lanes(#8623).An orphan check that #8601 turned red was fixed in #8631. A compiler bug was filed as t27#8630: an item-level
usepulls in names that appear only in strings, and same-named items vanish.tri actorsgets 403 from production. The/queen/actors*routes are guarded byrequireTrustedAppOrigin()since fix(queen): /queen/actors is guarded by the trusted-origin check, like needs-you #1735, and the command reports that as "telemetry off or unreachable". This becomes item 18: give operators a real credential path and make the message name the HTTP status. Spoofing an Origin header is not a fix.specs/tools/tri/.Self-correction: my disk cleanup broke zig's cache. I deleted old
~/.cache/zig/oarchives and left their manifests inh/. After that,zig testfailed withfailed to parse archive: FileNotFounduntil the tri lane removed the stale manifests. Running lanes were told to rerun. The rule now reads: delete zig's cache whole or not at all.Disk, root cause. The disk was not the grower; swap was. Four agents on this 8 GB Mac swapped 4.4 GB, and swap shares the APFS container. The parallel-agent limit drops from 4 to 3, with at most one heavy job at a time (a cargo build or a full api run). 15 finished trios lane worktrees were removed after checking that their commits are on remote branches.
Item 17: trinity#1588, the kanban card overflows its slot on live data. The Queen viewport contract runs against the live backend, so every site PR is a coin flip. That includes the blog post trinity#1583. The lane starts when a slot frees.
In flight (3):
gHashTag commentedon Oct 10, 2026
Tick 9, 2026-10-10 14:40Z. Two lanes merged into
actors-next-2.Cost and flakes, #1746 (issue #1743): a message costs 1.55 µs, not 4.47.
slot_ofran three times a message for a slot already known at spawn.performance.nowis no longer replaced process-wide.Keyed hardening, #1749 (issue #1745, spec t27#8634): all three lane-7 gaps closed.
Not verified: pglive, for both lanes. This Mac has no Postgres. Docker Desktop has not answered since 07:19Z, and pglive runs in CI only on PRs into
queen. Both lanes' pglive tests therefore first run whenactors-next-2goes toqueen. That ship PR must show them green before merge.New issue: item 18 is t27#8651.
tri actorsturns a 403 into "telemetry off"; it should name the status. Operator access to/queen/actors*needs an owner choice: an operator token, or the lab/ssh path. Spoofing Origin is not an option.Blog trinity#1583 now carries the profile's answer. It also drops my wrong guess about lanes 2, 6 and 7.
Housekeeping. The tri lane's worktree was removed after its branches were checked on the remote; the new
triis saved to the scratchpad and is in use.tri lanes --base actors-next-2reports no red, conflicting or stale lane. Disk is at 2.6 GB, swap is stable, and the agent limit stays at 3.In flight (3):
gHashTag commentedon Oct 10, 2026
Tick 10, 2026-10-10 15:20Z.
Actor events, #1750 (#1744; specs t27#8642 and t27#8652): merged into
actors-next-2, behindTRIOS_QUEEN_ACTOR_EVENTS(off).actorsstream on the same log, so actor traffic does not wake every follower ofqueen.GET /queen/public-actors?since=has a test that no title, body, args or payload ever reaches it.?replay=mvpserves a 24-row stand-in for now. The #8648 lane addstrace_rowandtrace_lento specs/network/mvp.t27 in this shape.Self-heal: master's t27b ratchet was red because of us. #8634 added
specs/queen/keyed_guard.t27without its expectations row, which shows as UNLISTED. Fixed by t27#8665 (issue #8664), one row, with auto-merge on. The same run's MOVED entry forspecs/compiler/lexer.t27is not ours. The other actor specs (drain, review_lanes, actor_events, actor_view, actors_hw and the rest) all have rows.Host: disk 0.5 → 6.6 GB. The owner said "clean it yourself". The cleanup removed:
node_modulesin repos idle 2–5 weeks: 999-multibots-telegraf, trinity, trinity-wt-explorers and leela; they come back with one install;Personal data, VMs and Docker were left for the owner. The peer session also stopped its Mac-side nextpnr runs, which were part of the swap.
Ship 2 under way.
actors-next-2→queenconflicts with #1741 and #1735 in four files:queen-bee-actors-round.ts;queen-bee-actors.ts;queen-review-actors.ts;A ship lane merges
queenintoactors-next-2onqueen-ship-2, keeping both sides, and opens the ship PR. Its CI is the first-ever run of the keyed_guard and fence pglive tests, because this Mac has no Postgres. The coordinator merges intoqueenonly on green.Queued: item 20, #1751, the job runner for the t27b ledger steward card (t27#8656). It waits for the owner's word on credential scopes and token rights.
In flight (3):
gHashTag commentedon Oct 10, 2026
Tick 11, 2026-10-10 16:10Z. SHIP 2 is live.
#1754 merged into
queenas 3654fdd at 16:03Z. It mergesqueenintoactors-next-2first (#1753). The four conflicts from #1741 and #1735 were resolved by keeping both sides, and the route-guard counts were recomputed (63 mounts, 20 guarded sub-apps, 17 public-read).queen(20 and 19).queen, the 200k flood, is the one perf+test(queen): a message costs 1.6 us, not 4.5, and five load-dependent actor tests made load-independent (Closes #1743) #1746 fixed. None fails only on the merge.The deploy took about 1 minute instead of 30–34. The owner applied the drain recipe at 15:27Z:
TRIOS_BEE_RUNNER_SECONDSwas removed from trios-agent-server;TRIOS_BEE_RUNNER_SLOTSwas set on the runners. runner-1 logsslots=36; runner-2 is still redeploying.The new Queen container logs no
Bee runner starting, so it runs no bees and has nothing to drain.#1747 is verified in production. The new container logged:
d1a3280f3 is the current
origin/master, so the Queen no longer reads the stale local commit c925f20804.Flags, as logged:
turnStop=false laneQueue=false telemetry=false actorEvents=false. The log has 0[ERROR]lines. The 21 "committed-file diff failed" INFO lines are the old class (bee branches absent from the root checkout), not new.Closed by hand: #1737, #1740, #1743, #1744, #1745, #1747.
Anomaly healed: the Mac's process limit. Monitors and shells died with
fork failed: resource temporarily unavailable, because the user had 1342 processes against a per-user limit of 1333.FwUpdateManagerd, up 10 days.The 30-minute deploy monitor had died silently from this; its output file showed the fork errors.
New: disaster recovery, t27#8675. The owner reports that the Railway and GitHub accounts may be cut off, and chose an off-Railway bucket for backups.
ageunder the owner's passphrase. The file is 100 KB and its values were never seen by an agent.In flight:
Next: item 20, #1751. The owner approved it; it waits for the token scopes.
gHashTag commentedon Oct 10, 2026
Tick 12, 2026-10-10 18:30Z, after a session restart.
The restart. The previous Claude Code process exited. Its running agents died: the vault lane, plus a few wait loops. The session-only cron
6a1aefdcis gone with it.Anomaly: load 38, swap 7.3 GB. Three causes:
t27c-test-report-gf16_accel_tb/spec_testshad run 4 h 49 min andaxi4_tb2 h 52 min. Both were killed.gh ... --body "...t27c test-report..."executed the command, because backticks inside double quotes are command substitution in zsh. A whole-corpus run went on for an hour untilclock_domain_tbhung. The peer stopped it. Rule recorded: bodies only through--body-file - <<'EOF'.Shared host rules for every lane now live in the scratchpad's
HOST-RULES.md:mkdirlock;perl alarmtimeouts on every test run;Lanes now (3):
specs/vault/{policy,audit,merge}.t27, about 1400 lines) and its runtime glue (about 1160 lines). It adds the owner's migration: imports from Infisical and from the Railway age file, dedup by names only, and aliases.trios-host-v0.1.0in trios, with per-platformtrios-host,t27candt27band pins intoolchain.t27;sandbox-execon macOS,bwrapon Linux.network/mvp.t27, kept non-transferable, with signed Merkle epoch statements and settlement shut;Waiting: the blog post trinity#1583 is merged with the latest main. A watch merges it only when
checks,website gateandreportare green.gHashTag commentedon Oct 11, 2026
Tick, 2026-10-11 06:30Z. Self-heal chain closed; production is healthy.
Four defects found by CI under load, each fixed with a reproducing test and a negative control, and each in production:
X_NONE, and nothing re-asked, so a SIGTERM-deaf group survived. Fixed by fix(queen): a grace timer that comes back early asks the card again, so a deaf turn still loses its group (Closes #1766) #1809 (the other contributor, for turns) and fix(queen): an orderly stop whose timer fires early still kills at its timeout; the turn-stop bench waits for its kills, not a fixed 11 s #1811 (the orderly stop, anEarlyClockhelper, and the stopping benchmark's cleanup artefact removed).loaded, and the pglive suite then passed 20 runs in a row.threadWork'sstop(). Not reachable in production today: no production caller, and turn stop abandons thread turns. Fixed ahead of time by fix(queen): a thread turn's worker is ended only once it has loaded, so a stop at its start no longer crashes Bun 1.3.x (Closes #1865) #1866. On 1.3.6 the old code crashed 5 of 20 runs and the fix 0 of 20.Production (
queen219813f):/health200; telemetry and turn stop on; hosting on, with sybil rules and signed epochs; vault deployed but off; 0[ERROR].Host: disk was down to 144 MB free once. Removing the whole zig cache (3.4 GB, no zig running) brought it to 9.75 GB free. Swap is about 6 GB.
Owner pending: confirm the two TRINITY DEV proposals (die B, release order), and the vault keys.
spec(queen): the simulation gate plays keyed actors, two bee dispatch…
spec(queen): the simulation gate plays keyed actors, two bee dispatch…
test(queen): the simulation gate plays keyed actors, two bee dispatch…