Skip to content

Agent scaffolding from the d119-step3 battery rounds: battery --survey, multi-target build driver, census --diff, stack_status, with-battery skill - #2375

Merged
ehartford merged 6 commits into
mainfrom
agent-scaffolding
Oct 13, 2026
Merged

ehartford merged 6 commits into
mainfrom
agent-scaffolding

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Addresses the retrospective list from the d119-step3 session (2026-10-12), one commit per item:

  • .agents/skills/with-battery — the operational checklist for stack work (validated).
  • AGENTS.md/CLAUDE.md — two iterate-tier rules: absolute paths in staging worktrees; migrator-spelling sweep + :c-migrator-basic-tests + ceremony --diff before the battery.
  • tools/ceremony_census.w --diff REV — lexical ceremony counts scoped to files changed vs REV; verified both directions (clean diff passes, injected move fails; it also caught a ceremony in its own follow-up code, since removed).
  • tools/battery.w --survey — phases continue past a red gate/UAT so independent failures are reported by one battery; verdict rules unchanged. Also documents that no caller-side caffeinate wrapper is needed (per-phase holds already exist).
  • Build driver — every :target selector names a root. Previously the first was taken and the rest silently discarded, so a four-promote invocation promoted one corpus and exited 0 (carried as a one-promote-per-invocation ritual). Verified: one invocation ran :lexer-tests and :parser-tests to green; unknown targets fail loudly.
  • tools/stack_status.w — generated stack facts (branch, commits ahead, dirtiness, PR, battery status) replacing the hand-copied half of a handoff.

Outside this PR: verdict.w --detail fixed in ~/.claude/hooks (collapses [compile] lines, reaches the first error); AGENTS.md tiering proposed in #2374 (editorial call, not performed here).

Verification so far: with check src/main.w ok; census --diff origin/main clean; skill validates; multi-target build green. Battery (this PR, in --survey mode): pending, posted here when terminal.

Eric Hartford added 6 commits October 12, 2026 17:24
…ill, census --diff, two iterate-tier rules

- .agents/skills/with-battery: the operational checklist for stack work
  (worktree discipline, persistent battery monitor, phase timings,
  red triage, promote cycle, reseed), distilled from AGENTS.md and
  PR #2364's five battery rounds. Validated (muse skills validate).
- tools/ceremony_census.w --diff REV: lexical ceremony counts of the
  files changed vs REV, worktree against REV, so a new ceremony is
  caught at the iterate tier instead of 13 minutes into a battery
  gate (run 5: one redundant move, 847 -> 848). Verified both ways:
  clean diff passes, an injected move fails.
- AGENTS.md/CLAUDE.md (identical copies): absolute paths in staging
  worktrees (relative tool paths resolve to the main checkout), and
  after a migrator spelling change sweep every expectation of the old
  spelling plus run :c-migrator-basic-tests before the battery (a
  head-truncated grep hid flat_pairs and cost run 3).
…itself awake

The phase barrier (a red gate stops the battery) made independent
failures serialize across batteries ~35 minutes apart: on d119-step3
the Emit-C collector bug sat in battery-checks invisible behind two
gate failures. --survey keeps phase order and the final verdict rules
(RED if any phase was red) but runs UAT (when the gate left a release
compiler; otherwise the skip is recorded) and battery-checks (whose
own survey skips dependents of failed build targets) after a red
phase, so one battery reports independent reds across phases.

The battery also caffeinates itself for its whole run (caffeinate
-i -s -w <own pid> on macOS): callers no longer wrap the invocation
or hold a keep-awake lease, and a forgotten wrapper can no longer
leave the driver asleep between phases. The per-phase child holds
remain.
driver_build_target_arg returned the first :target and the rest were
silently discarded, so `build :zlib-promote :pcre2-promote
:c-algorithms-promote :tommyds-promote` promoted zlib, said nothing,
and exited 0 — carried as a one-promote-per-invocation ritual in the
handoff instead of a driver bug. Now every selector is a root:
DriverOptions collects selected_targets in order (duplicates dropped,
selected_target remains the first for pseudo-target dispatch and
labels), BuildGraphModel selects the union closure
(build_graph_filter_targets; build_graph_filter_single_targets for
--no-deps), and an undeclared name is a loud error. The install-user
fast path and the effects pseudo-target still require a lone selector.

Verified: --dry-run selects both roots, and one invocation ran both
:lexer-tests (7 files) and :parser-tests (9 files) to green.
Prints what git, gh, and the battery already know about the current
stack — branch and HEAD, commits ahead of origin/main, tracked
dirtiness, the branch's PR, the battery status file, the newest run
log's verdict line — fresh at read time instead of copied by hand into
a handoff that goes stale within hours (the d119-step3 handoff
described a promote chain and a main that had already moved).
Judgment (what to do next, which reds are pre-existing) stays the
human-written part of a handoff; this replaces only its facts.
…r wakefulness

The --survey commit added a spawn_os caffeinate -w self-hold on top of
the per-phase holds the battery already had. ceremony_census --diff
flagged its let _ = spawn as new ceremony, and on inspection the hold
was redundant: every phase runs under caffeinate and the driver
between phases only merges times and writes status for seconds. What
remains is the documented rule in both places: no caller-side
caffeinate wrapper or keep-awake lease — the ritual, not a missing
hold, was the defect.
…remony-census ref-at-ref-param 1852 -> 1856 in the survey battery's gate; the parameters are references, so the places auto-ref)
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on 74eb560 (seed-driven, with run tools/battery.w, 2026-10-12; the first run was in --survey mode and reported the gate's ceremony-census red while UAT and the full checks survey still ran green — the survey behavior working as designed; the census rise was then removed and this clean rerun followed):

74eb56062 /Users/eric/.local/with-staging/agent-scaffolding
gate rc=0 wall=1838s
uat rc=0 wall=29s
battery-checks rc=0 wall=548s
GREEN
battery: GREEN (74eb56062); logs in out/battery/

@ehartford
ehartford marked this pull request as ready for review October 13, 2026 02:58
@ehartford
ehartford merged commit 811a777 into main Oct 13, 2026
@ehartford
ehartford deleted the agent-scaffolding branch October 13, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant