Public: anyone can read this; the crew can change it.

Nightly drill on the vxrail: the one-click path against production, loud on the step that broke #16843

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Every night a new maintenance duty, one-click-drill, runs the one-click path against production, removes what it made, and puts the result on the event outbox. Its 16 tests pass, tsc is clean, and gate --explain reads 32 rules with none failing. I did not run the suite.

Notes

opened this

Every night a new maintenance duty, one-click-drill, runs the one-click path against production, removes what it made, and puts the result on the event outbox. Its 16 tests pass, tsc is clean, and gate --explain reads 32 rules with none failing. I did not run the suite. I did not try the drill against a real forge end to end: the real spawn and cleanup are not exercised, only the account, the router and the drill key.

What changed

  • The walk (src/release/one_click_drill.ts) mirrors #2930's steps, each named: signup, make a forge (claimed in one call), forge live, included app, clean up. A failure reads step 3 (forge live) failed: …. It makes drillbot-<8hex> and drill-<8hex>, and removes both whether it passed or failed. Only names of that shape can be removed. A forge or account that won't go counts as step 5.
  • How it runs (src/release/one_click_hands.ts): it goes through the forge's own router in process, because the egress gate refuses the forge's own host. It reuses removeForge, removeAccount, the live watcher's forge.spawn.live event and the spawn's outside proofs.
  • Where the result goes (src/maintain/duties/one_click_drill.ts): the outbox event drill.one_click carries pass or the step and why, plus time to live. The newest result is kept in <data>/drill/one-click.json, beside the restore drill's files.
  • A failure opens one issue, "The nightly one-click drill failed", that names the step. While it is open, a later failure comments on it. The issue is filed on the forge repository (FORGE_SENTINEL_REPO, default trevato/forge), the same way the other duties file theirs.
  • Drill marking: spawnDoor now accepts a per-boot drill key (DRILL_HEADER, separate from the prober's). A request carrying it spends no stranger allowance, and the spawn's events carry drill: 1, which the boards already count as their own series. Before this, nothing set that flag.
  • Docs: docs/features/one-click-drill.md. The commit carries No door: because the duty already shows on /maintenance.

Left out

  • The drill does not fetch the child's own /health or use its claimed token. The egress gate refuses the children's hosts, so the spawn's outside proofs and the watcher's event stand in for them.
  • The included app is optional: set FORGE_DRILL_APP=owner/name to make step 4 require a proof for it. With it unset, the forge is made with no app.
  • drill.one_click is not classified in event_audience, so the outbox shows it to admins only.
  • The drill's own forge.spawn.live events are tagged drill: 1, so they are kept apart from real ones.

Try it

  • bun test test/one-click-drill.test.ts.
  • In production, wait for the nightly run, then open /maintenance, or read <data>/drill/one-click.json.

Closes #2931

4 earlier comments
commented

Every night a new maintenance duty, one-click-drill, runs the one-click path against production, removes what it made, and puts the result on the event outbox. Its 16 tests pass, tsc is clean, and gate --explain reads 32 rules with none failing. I did not run the suite. I did not try the drill against a real forge end to end: the real spawn and cleanup are not exercised, only the account, the router and the drill key.

What changed

  • The walk (src/release/one_click_drill.ts) mirrors #2930's steps, each named: signup, make a forge (claimed in one call), forge live, included app, clean up. A failure reads step 3 (forge live) failed: …. It makes drillbot-<8hex> and drill-<8hex>, and removes both whether it passed or failed. Only names of that shape can be removed. A forge or account that won't go counts as step 5.
  • How it runs (src/release/one_click_hands.ts): it goes through the forge's own router in process, because the egress gate refuses the forge's own host. It reuses removeForge, removeAccount, the live watcher's forge.spawn.live event and the spawn's outside proofs.
  • Where the result goes (src/maintain/duties/one_click_drill.ts): the outbox event drill.one_click carries pass or the step and why, plus time to live. The newest result is kept in <data>/drill/one-click.json, beside the restore drill's files.
  • A failure opens one issue, "The nightly one-click drill failed", that names the step. While it is open, a later failure comments on it. The issue is filed on the forge repository (FORGE_SENTINEL_REPO, default trevato/forge), the same way the other duties file theirs.
  • Drill marking: spawnDoor now accepts a per-boot drill key (DRILL_HEADER, separate from the prober's). A request carrying it spends no stranger allowance, and the spawn's events carry drill: 1, which the boards already count as their own series. Before this, nothing set that flag.
  • Docs: docs/features/one-click-drill.md. The commit carries No door: because the duty already shows on /maintenance.

Left out

  • The drill does not fetch the child's own /health or use its claimed token. The egress gate refuses the children's hosts, so the spawn's outside proofs and the watcher's event stand in for them.
  • The included app is optional: set FORGE_DRILL_APP=owner/name to make step 4 require a proof for it. With it unset, the forge is made with no app.
  • drill.one_click is not classified in event_audience, so the outbox shows it to admins only.
  • The drill's own forge.spawn.live events are tagged drill: 1, so they are kept apart from real ones.

Try it

  • bun test test/one-click-drill.test.ts.
  • In production, wait for the nightly run, then open /maintenance, or read <data>/drill/one-click.json.
commented

All six points are addressed and pushed. The drill, door and prober tests pass (29), tsc is clean, and the gate reports no violations.

  1. Door test. test/one-click-drill-door.test.ts POSTs anonymously to the real /api/v1/forges.
    • With the drill key, no allowance is spent and forge.spawn.started and forge.spawn.live carry drill: 1.
    • A wrong key, the prober's key in the drill header, and no key each spend the allowance and tag nothing.
    • The prober's own key spends nothing and is not tagged as a drill.
    • With the door change disabled, the drill-key test fails.
  2. Vacuous assertion. It now asserts the account lookup is undefined or removedAt is a string.
  3. Leftovers. I took the sweep option, not a longer timeout. runDrill first calls the new sweep, which removes forges and accounts left by an earlier run, using the same shape checks (drill-<8hex> and drillbot-<8hex>).
    • A leftover that cannot be removed fails step 5.
    • Tests: shape filtering and the failure path, and the real hands listing a leftover drillbot- account and sweeping it. I did not test a real forge as a leftover; that path is exercised with fake hands only.
    • I did not raise timeoutMs, because the step limits sum to more than any sensible timeout; the sweep covers a restart as well. docs/features/one-click-drill.md says so.
  4. Dead code. lastDrill is removed and the test reads drill/one-click.json directly. The empty catch in one_click_hands.ts now has a comment saying the text is kept as the body when it is not JSON.
  5. Real settled. A test appends forge.spawn.live and forge.spawn.failed events to the real outbox. Those with drill: 1 return their ms or reason, and those without it are ignored.
  6. Signature. It is now make?: typeof realHands.

One addition you did not ask for: the gate flagged isDrill as a copy of isProber, so both now call one constant-time carries helper in src/release/prober.ts. The existing prober tests still pass.

The gate flagged a fixed Bun.sleep in my new test, so it now yields to the event loop instead of waiting a fixed time.

The forge's check will run the full suite on this push.

commented

This pull adds a nightly one-click drill that walks #2930's path against production and is loud on the step that broke. The last check failed on two tests; I fixed one and left the other.

  • Fixed: test/one-click-drill-door.test.ts waited for the spawn events by counting 20,000 setImmediate ticks. That loop can run out before the events land when the machine is busy, as it was across 167 shards. The wait is now a 10-second deadline polling every 5 ms. The file passes alone (5 tests) and tsc is clean.
  • Left alone: "each first page answers under its median warm" in test/page-budget.test.ts is a timing test. It failed at 6.1 s in a run where the slowest shard took 78 s. Nothing in this pull touches a page, so I read it as load, not a regression. I did not run it here, and I did not loosen its budget. If it fails again on the next check, it needs a person to look at it.

Nothing else changed. Try it with bun test test/one-click-drill-door.test.ts.

commented

This pull adds a nightly one-click drill. It makes a throwaway account and forge on production, follows the signup, make-a-forge, forge-live, included-app and clean-up steps, and files one issue naming the step that broke. The latest push fixes the two gate refusals; bun scripts/gate.ts is clean on the committed diff and tsc is clean.

  • Test wait: test/one-click-drill-door.test.ts no longer polls or sleeps. It subscribes to the bus before the request and awaits the next forge.spawn.live. This replaces both the old tick-counting loop and the timer poll I swapped in last time. The file passes alone (5 tests).
  • Duplicate write: I removed keep() and the drill/one-click.json file it wrote, which nothing read. The drill.one_click outbox event already records the result, and the test now asserts only the outbox. The 25 drill tests passed before the last test edit; after it I re-ran only the door file.
  • Duplicate compare: carries() in src/release/prober.ts no longer repeats the hook's compare. It HMACs both values to a fixed length and compares those in constant time.
  • Not done: the page-budget timing test that failed earlier is untouched. This pull changes no page.

To try it, run bun test test/one-click-drill.test.ts test/one-click-drill-door.test.ts.

commented

This pull adds a nightly maintenance duty, one-click-drill, that walks #2930's one-click path against production. It makes a drillbot- account and a drill- forge, then removes both. The result goes on the outbox as drill.one_click. A failure opens one issue naming the step that broke, and later failures comment on that issue while it stays open.

This last change fixes the docs and comments only. The how-to (docs/features/one-click-drill.md) and the header comments of src/maintain/duties/one_click_drill.ts and src/release/one_click_drill.ts no longer mention <data>/drill/one-click.json, which an earlier commit stopped writing. They now say the drill.one_click outbox event is the only record.

On /maintenance I wrote only that the duty's row shows when it last ran. I could not confirm that the page shows the event's own contents (the step and time to live), so the docs don't claim it.

The gate and tsc pass; no tests were re-run, since no code changed. The gate's duplicate scan hit its 8-second limit and only compared against part of the tree, so it is not a full pass.

Left out: step 4 does not fetch the forge's own /health; it relies on the proofs the spawn makes from outside. The how-to says so.

To try it, read docs/features/one-click-drill.md, or run bun test test/one-click-drill.test.ts test/one-click-drill-door.test.ts.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs