Commit Graph

1 Commits

Author SHA1 Message Date
Bo 0f8dbee992 fix(nightly): ship 5 retrospective code fixes (truncate, standards gate, probed_stale_at, dream-probe, bd-install) (#156)
* fix(goals): preserve diagnostic tail in truncateOutput

Head-only truncation at 500 runes cut the operator hint off the end of
gate output. The 2026-04-26 nightly retrospective showed flywheel-
compounding's "sessions must use 'ao lookup --cite ...'" tail being lost
mid-word for verbose runs.

New shape: when input exceeds 500 runes, keep first 200 + truncation
marker + last 200 runes. Short inputs untouched. Verified against live
ao goals measure --json — six long-output gates (flywheel-proof,
hook-preflight, go-cli-tests, contract-compatibility, install-smoke,
flywheel-lifecycle) now expose both their failure label and their
trailing fix-it.

Source: 2026-04-26 nightly retro task 1.

* feat(ci): add standards-injector reference completeness gate

hooks/standards-injector.sh fails open when a mapped <lang> is missing
its reference file. That's how `.js` lost standards inject for weeks
until the 2026-04-26 nightly caught it. New gate parses the case
statement, asserts every mapped lang has skills/standards/references/
<lang>.md, and runs in pre-push and CI.

Wires:
- scripts/check-standards-injector-completeness.sh (new)
- scripts/pre-push-gate.sh (slot 27b under hook category)
- .github/workflows/validate.yml (parallel job + summary deps)
- tests/scripts/check-standards-injector-completeness.bats (6 cases:
  happy path, missing-named, |-alternation, parser-empty, real-repo)

Removing skills/standards/references/javascript.md temporarily makes
the gate FAIL with a clear message; restoring makes it PASS.

Source: 2026-04-26 nightly retro task 2.

* feat(rpi): add probed_stale_at + probed_by + ao rpi mark-probed

When a nightly probes a queue item and finds it stale, the knowledge
dies in the digest — tomorrow's run re-probes the same item. Adds
optional probed_stale_at (RFC3339) and probed_by fields to the v1.3
item schema, the Go round-trip type, the schema-rows acceptance test,
and a new `ao rpi mark-probed --id=... --by=...` subcommand for future
nightlies to write these without hand-editing JSON.

- docs/contracts/next-work.schema.md (Item table)
- cli/internal/rpi/types.go (NextWorkItem fields, omitempty)
- cli/internal/rpi/types_test.go (round-trip + omitempty)
- cli/cmd/ao/rpi_mark_probed.go (new subcommand)
- cli/cmd/ao/rpi_mark_probed_test.go (4 cases)
- cli/docs/COMMANDS.md (regenerated)
- tests/scripts/check-next-work-schema-rows.bats (acceptance case)

validate-next-work-contract-parity.sh stays green.

Source: 2026-04-26 nightly retro task 3.

* fix(overnight): probe Dream packets for staleness before emit

Three nightlies in a row emitted the same two stale packets ("philosophy
doc", "next-work schema v1.3") because no gate verified the cited
surface wasn't already shipped. Curator now runs a 5-second tractability
probe against each candidate's TargetFiles + scripts/ refs in the
morning command before writing it. Conclusively-stale packets are
suppressed; the suppression is recorded as a dream-curator-suppressed
entry on the run summary so operators see what was skipped instead of a
silent gap.

- cli/cmd/ao/overnight.go (overnightSummary.CuratorSuppressed)
- cli/cmd/ao/overnight_packets.go (probeDreamPacketStaleness,
  extractScriptsRef, suppression plumbed through
  buildDreamMorningPacketPlans return)
- cli/cmd/ao/overnight_packets_test.go (suppression-on-existing-target +
  emits-when-inconclusive integration tests)

Source: 2026-04-26 nightly retro task 4.

* chore(scripts): add install-bd.sh installer

bd has been "unavailable" in three consecutive nightly runs. Upstream
(steveyegge/beads) publishes signed cross-platform binaries for
darwin/linux on amd64/arm64. New installer detects the platform,
downloads the matching tarball, installs to ~/.local/bin/bd, and
verifies via `bd version`. Idempotent: short-circuits when the
requested version is already present (use --force to override).

- scripts/install-bd.sh (new, executable)
- tests/scripts/install-bd.bats (4 offline-safe cases)

Verified end-to-end on darwin/arm64: download + extract + verify all
green.

Source: 2026-04-26 nightly retro task 5.

* fix(ci): align bats stub and AGENTS table with new standards-injector gate

PR #156 introduced scripts/check-standards-injector-completeness.sh
without:
- adding a make_stub for it in tests/scripts/pre-push-gate.bats setup;
  three pre-push-gate bats tests (404, 414, 415) used a FAKE_REPO that
  lacked the new script and the gate fired "missing executable", so
  status came back non-zero
- listing it in the AGENTS.md CI table; validate-ci-policy-parity.sh
  diffs the table against validate.yml summary.needs and flagged 2
  drift groups

Both gates pass locally now.
2026-04-26 19:26:04 -04:00