287 Commits

Author SHA1 Message Date
Claude 41c71f54d6 feat(nightly): fail loudly on dream close-loop throughput stalls
The 2026-04-22 nightly-dream-cycle learning
(.agents/learnings/2026-04-22-close-loop-citation-gate-deadlock.md) lists
three corrective actions for the chicken-and-egg promotion deadlock that
silently zeroed throughput for weeks:

  1. Split admission gates by path                        — DONE (b69a00f)
  2. Parameterize shared helpers (requireCitations bool)  — DONE (b69a00f)
  3. Fail loudly if ingested > 0 && promoted == 0         — this commit

Prior to this commit, scripts/nightly-dream-cycle.sh reported both numbers
in the summary but never asserted their relationship, so the deadlock
surfaced only in downstream metrics (sigma=0, escape_velocity=false) —
exactly the "quietly posting another zero-throughput status issue" pattern
the learning warns against.

Changes:

- scripts/check-dream-throughput.sh (new): standalone gate consuming
  'ao flywheel close-loop --json'. Exits 1 on the deadlock pattern
  (added > 0 && promoted == 0), 0 on healthy / no-op, 2 on bad input.
  Uses the same pattern as the sibling check-compile-*.sh gates.
- scripts/nightly-dream-cycle.sh: invokes the gate after the summary
  artifacts are written (so uploads still succeed) and exits non-zero
  when a stall is detected. NIGHTLY_DREAM_STRICT=0 downgrades to warn
  for diagnostic runs. The summary.json grows a
  close_loop.throughput_stalled bool; the summary.md renders a banner
  above the stage table when the stall fires, so the auto-filed
  "Nightly dream cycle status" issue leads with it.
- tests/scripts/check-dream-throughput.bats (new): 8 cases covering
  healthy, empty-run, deadlock, missing input, no-arg, non-integer
  input, and missing keys.

Verified locally against all 8 cases via direct bash invocation
(bats is not available in this environment); shell syntax validated
with 'bash -n' on both scripts.
2026-04-22 11:43:15 +00:00
Bo a47d80b5d2 Merge pull request #129 from boshu2/nightly/2026-04-22
Nightly 2026-04-22 — 3 cycles, +21 fitness, 4 goals restored
2026-04-22 07:34:56 -04:00
Claude 20c7c47c32 fix(gates): self-heal gocyclo install in go-complexity-ceiling gate
check-go-absolute-complexity.sh exited 2 with a manual-install hint when
gocyclo was missing, which surfaced go-complexity-ceiling (weight=6) as a
FAIL on any machine whose PATH did not already have gocyclo even though
the repo's code was clean.

Auto-install gocyclo into GOBIN (or $GOPATH/bin) when 'go' is available,
then retry. Provide GOCYCLO_NO_AUTOINSTALL=1 as an opt-out for CI (which
already pre-installs gocyclo in validate.yml) and for offline runs.

Fitness (post-cycle2 -> post-cycle3):
  go-complexity-ceiling (w=6): fail -> pass

Verified:
  rm /root/go/bin/gocyclo; ao goals measure --goal go-complexity-ceiling
    -> auto-install + pass
  GOCYCLO_NO_AUTOINSTALL=1 bash scripts/check-go-absolute-complexity.sh
    -> exits 2 with install hint (CI-compatible)

https://claude.ai/code/session_015RK27PGX79MsGU5XUhBxkr
2026-04-22 06:40:46 +00:00
Claude c0de539c11 fix(gates): fall back to Dream defrag preview for compile-* gates
compile-freshness and compile-no-oscillation both require .agents/defrag/
latest.json, a local-only artifact that is .gitignored. On machines that
run Dream but not a manual `ao defrag`, both gates fail with "not found"
even though Dream has just written a fresh defrag preview at
.agents/overnight/<run>/defrag/latest.json with the same JSON shape.

- check-compile-health.sh: when the canonical path is missing and
  COMPILE_OUTPUT_DIR is unset, fall back to the freshest overnight
  preview. CI paths (which set COMPILE_OUTPUT_DIR) remain strict.
- scripts/check-compile-oscillation.sh: new helper that mirrors the
  freshness gate's fallback and runs the oscillating-goals jq filter.
- GOALS.md: replace the inline compile-no-oscillation bash with a call to
  the new script so the fallback applies there too.

Fitness (post-cycle1 -> post-cycle2):
  compile-freshness       (w=4): fail -> pass
  compile-no-oscillation  (w=4): fail -> pass

Verified:
  ao goals measure --goal compile-freshness       -> pass
  ao goals measure --goal compile-no-oscillation  -> pass
  ao goals validate                                -> valid: true
  heal.sh --strict                                 -> clean

https://claude.ai/code/session_015RK27PGX79MsGU5XUhBxkr
2026-04-22 06:38:16 +00:00
Claude a5fa4cfa8c chore(skills): backfill docs, validators, and lint; fix codex drift no-op
Close the skills/skills-codex ecosystem gaps surfaced by the recent audit:

- docs/SKILLS.md now lists all 69 skills. Added an "Additional Skills" table
  covering the 21 previously undocumented entries (autodev, bootstrap, compile,
  deps, design, discovery, goals, grafana-platform-dashboard, harvest, perf,
  push, readme, red-team, refactor, reverse-engineer-rpi, review, scaffold,
  scenario, security, security-suite, test). Removed stale `/knowledge` router
  alias and nonexistent `extract` internal-table row.

- Added `scripts/validate.sh` behavioral contracts to the 16 skills that lacked
  one (autodev, bootstrap, deps, design, discovery, dream, harvest, llm-wiki,
  perf, red-team, refactor, review, scaffold, scenario, test, validation).
  Each encodes skill-specific assertions beyond the frontmatter check. Coverage:
  53/69 -> 69/69.

- Fixed `scripts/check-codex-parity-drift.sh` which was a silent no-op: it
  passed a non-existent --check flag to audit-codex-parity.py, swallowed the
  argparse error via `|| true`, then grep'd for strings the audit never emits.
  Now uses the exit code + JSON output and correctly fails on drift.

- Added `scripts/check-skill-size.sh` (warn>500, fail>800 lines) to flag
  oversized SKILL.md files that should decompose into references/*.md. Current
  state: 6 warnings (crank/implement/post-mortem/release/swarm/vibe), 0 fails.

Hygiene sweep: heal.sh --strict clean, codex parity audit clean, 69/69
validators green, size-lint reports no failures.

https://claude.ai/code/session_014AgjT36REb94fjL7sxrnFf
2026-04-22 04:56:28 +00:00
Boden Fuller cc6750c4e8 feat(docs,skills): rebuild Pages site with MkDocs Material + harden RPI orchestrator delegation contract
## Docs site — boshu2.github.io/agentops

- Replace Jekyll minima with MkDocs Material (slate dark palette default)
- Landing hero scoped to .landing-hero (no gradient bleed on inner pages)
- Section landings (getting-started, architecture, reference, contracts, levels) with narrative ledes
- Generate skill catalog + per-skill pages from skills/*/SKILL.md at build
- Generate CLI reference from cli/docs/ at build (fails build on missing source)
- Fix every internal link via one-shot migration (scripts/migrations/2026-04-19-fix-docs-links.py)
- Wire mkdocs build --strict into pre-push gate (Check 25a)
- Replace .github/workflows/pages.yml with .github/workflows/docs.yml (actions/deploy-pages)
- README + docs/CONTRIBUTING updated with docs-build toolchain on-ramp
- tests/docs/validate-links.sh patched to understand mkdocs-generated paths

## RPI orchestrator strict-delegation contract

- Strict sub-skill delegation is now the default for /rpi, /discovery, /validation. No --full flag — always on.
- Canonical contract in skills/shared/references/strict-delegation-contract.md (plus Codex mirror)
- Forged learning with detection phrases + corrective actions (ao-inject-ready)
- Rename --no-lifecycle -> --no-scaffold in /discovery (Claude + Codex) with deprecation alias through v2.40.0
- Harden inline-work hotspots with orchestrator-owned markers in /crank STEPS 3a.3, 6.5, 8.7 + Inline Work Policy footer
- Flag consistency: --auto and --interactive scopes documented; --complexity syntax formalized
- CHANGELOG [Unreleased] documents + scaffolds; runtime hook enforcement explicitly deferred

## fix(hooks): go-test-precommit skips when no Go files staged

- Previously ran go vet + go build unconditionally, blocking non-Go commits when Go toolchain was missing or at a different version
- Now checks staged diff and exits cleanly if no *.go or go.{mod,sum,work} files are staged
- Applied to both hooks/ (source) and cli/embedded/hooks/ (synced)

Provenance: full RPI lifecycle with strict delegation at every phase boundary (Phase 1 Skill(discovery) -> Phase 2 Skill(crank) -> Phase 3 Skill(validation) -> Skill(vibe), Skill(post-mortem), Skill(retro)).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 10:37:58 -04:00
Bo e2e353e4f3 Merge pull request #114 from boshu2/nightly/2026-04-17
Nightly 2026-04-17 — 6 cycles, ASCII fast-path sweep + bootstrap-maturity JSONL fix
2026-04-17 08:12:42 -04:00
Claude 4269c66591 fix(scripts): extend GOALS.md migration skip to pillar-coverage and goal-quality
Same pattern as cycle 5 (check-goal-staleness.sh): these two scripts were
written against the legacy GOALS.yaml format and now error out (exit 1/2)
when GOALS.yaml is absent, which misleads local runs after the GOALS.md
migration.

- check-pillar-coverage.sh: skip with exit 0 when GOALS.yaml is missing
  and GOALS.md is present (pillar taxonomy lives in the narrative now,
  not as per-goal pillar: fields the script can machine-check).
- check-goal-quality.sh: skip with exit 0 in the same condition (anti-
  pattern detection runs against YAML check: fields that don't exist
  in the markdown format).

Both scripts preserve their existing error behavior when neither file
is present — that is still a genuine misconfiguration.

No downstream gate depends on either script today, so this is a
signal-noise fix, not a contract change.
2026-04-17 07:04:54 +00:00
Claude f8bc3f5b6f fix(scripts): goal-staleness skips cleanly after GOALS.yaml -> GOALS.md migration
check-goal-staleness.sh was written against the legacy GOALS.yaml
format with machine-readable `added:` and `check:` fields. After
the repo migrated to GOALS.md (see CLAUDE.md §Agent Goals) the script
errors with 'GOALS.yaml not found at GOALS.yaml' — which misleads
readers into thinking a real gate is broken.

When GOALS.yaml is absent AND GOALS.md is present, skip with exit 0
and a clear message that names the migration. Preserve the existing
error behavior when neither file exists (that is still a genuine
misconfiguration). Document the migration in the script header so
the skip path is discoverable.

No downstream gate depends on this script today, so this is a
correctness + signal-noise fix, not a contract change.
2026-04-17 07:01:48 +00:00
Claude 44a6e04c2f fix(scripts): bootstrap-maturity.sh preserves existing JSONL maturity + compact output
The JSONL branch of bootstrap-maturity.sh had two bugs:

1. Detection wrong: `jq -e '.maturity' <file>` only inspects the first
   object in a JSONL stream, so files where a later line is missing the
   field silently skipped.
2. Output wrong: default `jq` pretty-prints its output, producing
   multi-line objects that break JSONL consumers. The unconditional
   `. + {"maturity": "provisional"}` also overwrote existing maturity
   values (e.g. "stable" → "provisional").

Fix:

- Count missing lines with `jq -c 'select(has("maturity") | not)'`
  (per-line stream semantics).
- Transform with `jq -c 'if has("maturity") then . else . +
  {"maturity": "provisional"} end'` so existing values are preserved
  and output stays valid compact JSONL.
- Add bats coverage for preservation, compact output, and idempotency.
2026-04-17 02:54:22 +00:00
Boden Fuller 50cf99fed9 feat(validation): swarm evidence schema + validator + gate wiring
Defines a tracked contract for swarm worker result files living under
.agents/swarm/results/<task>.json. These files were implicitly shaped
but never validated — misshapen packets could silently break crank
result ingestion.

- schemas/swarm-evidence.schema.json: JSON Schema. Required: task,
  status, files_changed, notes. Optional: tests, gate, evidence,
  before/after counters. additionalProperties=true permits task-specific
  extensions.
- scripts/validate-swarm-evidence.sh: jq-based validator accepting a
  file or directory. ajv fallback when available. Exit 0 pass, 1 fail.
- docs/contracts/swarm-evidence.md: human-readable contract doc with
  example and schema link. Added to docs/INDEX.md catalog.
- scripts/pre-push-gate.sh: new section 26b ('swarm evidence schema')
  invokes the validator on every push.
- scripts/check-contract-compatibility.sh: extended ref resolution to
  also search schemas/ so docs/contracts/*.md can cite
  schemas/*.schema.json without tripping the cataloguing check.

Consumes ag-yhr 'Implement executable swarm evidence schema validation'.
2026-04-15 16:48:17 -04:00
Boden Fuller 6d9af8447b ci(cmd-ao): add ratchet coverage floor gate for cli/cmd/ao
Adds scripts/check-cmd-ao-coverage.sh: reads the existing coverage.out
profile (no second test run), aggregates statement coverage for
cli/cmd/ao/, compares against MIN_COVERAGE floor, exits non-zero on
shortfall. Reads threshold from --min, $MIN_COVERAGE env, or default.

Wires a new 'Enforce cmd/ao coverage floor' step into validate.yml
immediately after the existing go test step, invoking the script with
--profile cli/coverage.out.

Initial floor: 76%. Current measured: 76.8% against the full-suite
coverage.out (2026-04-15). Source epic evolve-cycle-6-coverage-85pct
is driving this to 85%. Ratchet convention: bump MIN_COVERAGE one
whole percent each time real coverage rises, so the floor never
silently regresses.

Consumes evolve-cycle-6-coverage-85pct 'Add 85% coverage gate to CI
validate.yml for cmd/ao' (as a ratchet floor, not a cliff).
2026-04-15 16:47:57 -04:00
Boden Fuller 912cbe866a fix(cherry-pick-wave): dry-run default + pattern hardening + --force-delete
scripts/cherry-pick-wave.sh previously removed worktrees unconditionally
in non-interactive contexts and accepted loose branch patterns. Now:

- destructive_consent gate wraps remove_worktrees. Removal fires only
  when --yes, --force-delete, or interactive tty detected. Otherwise
  prints '[dry-run] would remove worktree: <path>' with instructions.
- Pattern hardening: rejects empty pattern, patterns starting with
  wildcards (*, ?, [), and requires first char to match [A-Za-z0-9_-].
- --force-delete flag: explicit opt-in to destructive removal in
  non-tty contexts (for CI/automation).
- Help text updated for new flag and safety semantics.

Backward-compat preserved for callers passing --yes (existing test still
passes). New behavior only affects callers running non-interactively
without --yes or --force-delete — they now see dry-run instead of
silent destruction.

Existing test tests/scripts/test-cherry-pick-wave.sh still passes.
shellcheck clean.

Consumes v2.9.3..HEAD 'Harden scripts/cherry-pick-wave.sh pattern
handling and delete safety'.
2026-04-15 15:53:15 -04:00
Boden Fuller d03ff5620b chore(bd): default BEADS_DOLT_SERVER_PORT=3307 in hook helpers + bd scripts
lib/hook-helpers.sh exports BEADS_DOLT_SERVER_PORT with override via
${BEADS_DOLT_SERVER_PORT:-3307} so users can still override per shell.
All hooks that source hook-helpers.sh automatically inherit the port.

scripts/bd-audit.sh and scripts/bd-cluster.sh are standalone bd callers
that do not source hook-helpers.sh, so they get the same export inline.

cli/embedded/lib/hook-helpers.sh synced via make sync-hooks.

Consumes ag-co7 'Export BEADS_DOLT_SERVER_PORT=3307 in shell env'.
2026-04-15 15:53:15 -04:00
Boden Fuller 0cfb0c44c9 fix(gate): fallback retrieval ratchet manifest 2026-04-14 23:12:47 -04:00
Boden Fuller 7711009874 refactor: harden worktree cleanup and finding collection 2026-04-14 08:26:18 -04:00
Boden Fuller cf5069dad7 test(rpi): validate active next-work enums 2026-04-13 15:19:51 -04:00
Boden Fuller a783df3650 test(rpi): catch next-work aggregate status drift 2026-04-13 15:08:42 -04:00
Boden Fuller 1c78cbd813 fix(rpi): validate next-work lifecycle drift 2026-04-13 13:20:40 -04:00
Boden Fuller e36e73ffa1 fix: stabilize generated index footer 2026-04-13 10:50:44 -04:00
Boden Fuller da3f265825 fix: preserve annotated tags during retag 2026-04-13 10:38:41 -04:00
Boden Fuller 5975701551 fix(release): validate audit artifact manifests 2026-04-13 10:21:50 -04:00
Boden Fuller 5d689f4339 ci(windows): authenticate installer smoke requests 2026-04-12 23:40:17 -04:00
Boden Fuller 3ba0bc3fff feat(swarm): add bd-cluster advisory preflight 2026-04-12 22:25:55 -04:00
Boden Fuller 4971f36912 fix(release): validate audit artifact refs 2026-04-12 20:28:04 -04:00
Boden Fuller cdc780ad0d chore(gate): require preserved ref ownership 2026-04-12 20:18:20 -04:00
Boden Fuller 38a7cc52ee feat(wiki): formalize .agents/ as Karpathy-style knowledge wiki
Adds the three missing pieces that turn .agents/ into a proper
LLM wiki following the Karpathy pattern:

1. .agents/INDEX.md — canonical discovery surface cataloging all 202
   learnings, plans, research, council reports, and wiki pages with
   wikilinks. Auto-generated by scripts/generate-index.sh.

2. .agents/LOG.md — append-only chronological operation log. Entries
   formatted as: YYYY-MM-DD HH:MM | actor | VERB | subject | [[wikilink]]

3. .agents/wiki/ directory structure:
   - wiki/sources/ — tier 1 LLM session summaries (forge output)
   - wiki/synthesis/ — cross-session insights
   - wiki/concepts/ — promoted concept pages
   - wiki/entities/ — promoted entity pages

Integration:
  - ao search now scans wiki/sources/, wiki/synthesis/, wiki/concepts/
    (3 new appendKnowledgeMarkdownSearch calls in search.go)
  - ao forge --tier=1 writes to .agents/wiki/sources/ (was ao/sessions/)
  - Dream post-loop hook + evolve dream sub-cycle write to wiki/sources/
  - forge_tier1.go appends to LOG.md and INDEX.md after each session page
  - wiki_log.go: AppendToLog + AppendToIndex helpers for all ingest paths

Obsidian-ready: open .agents/ as vault, INDEX.md is the home page,
wikilinks resolve to page navigation, graph view shows connections.
2026-04-12 20:16:41 -04:00
Claude 0e74d77259 fix(toolchain): preserve lint findings from modules that pass version check
The golangci-lint version mismatch detection was doing an early return
that discarded all findings, even from modules that linted successfully.
In a mixed-version setup (e.g. tests/fixtures/proof-repo uses a different
Go version than cli/), real lint errors from passing modules were silently
dropped and the gate under-reported.

Now the version mismatch is recorded but findings are counted first —
only when zero real findings exist does the tool fall back to "skipped".

https://claude.ai/code/session_01YWC8ZyAyN7kZRXEpNLTN2n
2026-04-12 18:35:19 +00:00
Claude 5ad36c2c79 fix(nightly): resolve three causes of CI build failures
1. Skip TestRunHarvest_PersistsDiscoveryWarnings when running as root
   (root bypasses filesystem permission checks, making the chmod(0) trick
   ineffective — fixes CLI test failures in root-based CI environments)

2. Detect golangci-lint / Go version mismatch gracefully — when the linter
   is built with an older Go than the project targets, treat it as "skipped"
   instead of "findings" (fixes false security gate blocks)

3. Fix gosec severity counting in toolchain-validate.sh — previously ALL
   findings were added to SECURITY_HIGH_COUNT regardless of severity level,
   causing MEDIUM/LOW findings to incorrectly block the security gate. Now
   properly categorizes findings by HIGH/MEDIUM/LOW.

Fixes #91, #89, #83

https://claude.ai/code/session_01YWC8ZyAyN7kZRXEpNLTN2n
2026-04-12 18:28:16 +00:00
Boden Fuller 2d80a6f41e chore(gate): clarify dirty worktree disposition 2026-04-12 10:48:11 -04:00
Boden Fuller 2bb60a71b3 fix(evolve): require explicit idle cycle target 2026-04-12 10:24:10 -04:00
Boden Fuller 7b702fb7f4 chore(retrieval): add quality ratchet 2026-04-12 05:59:07 -04:00
Bo 19d6a50f69 fix(swarm): ignore local evidence in default gate (#105) 2026-04-12 01:51:53 -04:00
Boden Fuller c421fb3620 fix(evolve): migrate baselines to era directories
Refs na-uuy.15
2026-04-11 20:37:44 -04:00
Bo 659c983ecc Add Windows ao installer
Adds a Windows PowerShell installer for ao, documents the Windows install path, fixes Windows-specific ao/runtime test issues, and removes the CI ripgrep dependency from the Codex override coverage validator.
2026-04-11 19:04:18 -04:00
Boden Fuller 14375ee68c fix: add windows codex installer 2026-04-11 17:19:04 -04:00
Boden Fuller cc3259f262 fix(ci): pin golangci-lint v2 contract 2026-04-11 14:09:00 -04:00
Boden Fuller 4bfd0e0e01 fix(security): quiet fixture scanner blockers 2026-04-11 11:02:15 -04:00
Boden Fuller 679552ae1e fix(dream): burn down 4 runloop follow-up beads (na-jn9,na-khk,na-5dr,na-lij)
Single commit covering the tractable slice of the Dream RunLoop Correctness
wake-check follow-ups. na-h61 remains deferred per handoff (requires a
dedicated --complexity=full --mixed session).

ci(validate): fix content-hash gate snapshot wiring (na-lij)
  The M9 bracket captured to mktemp but the path was discarded, so the
  post-test diff step always hit "ERROR: diff requires a valid snapshot
  file path" and the warning fired unconditionally. This explains the M9
  "drift on first main run" signal at dbf6d02a. Thread HASH_GATE_SNAPSHOT
  through GITHUB_ENV so the diff step actually sees the pre-test path,
  and treat a missing snapshot as ::notice:: rather than warn. The gate
  now only fires on real drift; ratchet upgrade (warn->fail) is still
  gated on 1-2 clean main runs before flipping.

feat(hash-gate): add --ignore-untracked escape hatch (na-5dr)
  scripts/check-agents-hash-snapshot.sh: parse --ignore-untracked (no-op
  for the ~/.agents/ case since the hub is not a git repo; future-proofs
  against a repo'd hub and documents the flag).
  scripts/pre-push-gate.sh: honor HASH_GATE_IGNORE_UNTRACKED=1 by
  skipping the content-hash block entirely. CI is unchanged (strict
  behaviour preserved); operators with local scratch state get a
  documented way to push through transient hub drift.

test(overnight): add TestRunLoop_WarnOnlyBudgetExhausted (na-jn9)
  Covers the M6 L2 rescue-drain path. Uses an oscillating regression
  injector (good<->bad per iter) rather than a plateau injector because
  PlateauState.halted is sticky and can only consume one rescue per
  run. Regression detection is stateless, so N+1 bad iters drain the
  budget exactly. Asserts WarnOnlyBudgetRemaining==0, RegressionReason
  contains "warn-only budget exhausted", last iter status ==
  StatusHaltedOnRegressionPostCommit, and at least N warn-only rescue
  notes in prior iters.

na-khk (bushido env leak in rpi/toolchain_test.go): investigated; zero
"bushido" matches anywhere in cli/, toolchain_test.go has no Setenv/HOME
calls, ./internal/rpi test suite runs clean. Closed as not-reproducible
on HEAD post-M1 HOME isolation (394bfa51).
2026-04-11 07:17:41 -04:00
Boden Fuller ae4d84cae5 feat(scripts): add content-hash snapshot gate for ~/.agents mutation detection
The existing scripts/check-home-isolation.sh grep-checks test files for
t.Setenv("HOME", ...) patterns but cannot detect:
  - Tests that explicitly unset HOME after setup
  - Tests that write to ~/.agents and then use os.Chtimes to restore
    the mtime (the same API recovery_test.go:285 uses legitimately
    can hide test-side poisoning)

This adds a post-hoc content-hash gate that:
  1. Captures SHA-256 of ~/.agents/{learnings,patterns,findings,rpi/next-work.jsonl}
     BEFORE the test phase.
  2. Re-captures and diffs AFTER the test phase.
  3. Fails the gate on any content change — mtime restoration cannot
     hide it because the hash depends on file content, not stat metadata.

Wired into both local gates:
  - scripts/pre-push-gate.sh — capture right after check-home-isolation,
    diff as the final phase before the summary.
  - scripts/ci-local-release.sh — capture after check_required_cmds,
    diff as Phase 6 before Summary via the existing run_step helper.

The remote CI surface (.github/workflows/validate.yml) is deferred to a
follow-up micro-epic so the blast radius of this change stays local.

Script skips gracefully on minimal containers without shasum via an
explicit command-exists check at the top.

Verified via 6-judge pre-mortem council. Part of Micro-epic 1.
2026-04-10 20:39:48 -04:00
Boden Fuller 2821992965 feat(overnight): wave 1 of dream follow-ups — 9 parallel issues landed
Plan rev 2 post-mortem queued 10 follow-up issues; this commit lands
Wave 1 (9 independent issues, parallel workers, zero file conflicts).
Wave 2 (Issue 5 wiring INGEST to real entry points) follows in the
next commit.

Wave 1 issues:

Issue 1 — harvest.WalkOptions.SkipGlobalHub + 2 consumers:
- harvest/walker.go adds the flag, guards the ~/.agents/ auto-include
- corpus/fitness.go opts in so corpus.Compute is hermetic (V8 fix)
- overnight/ingest.go opts in for Dream's private-lane harvest
- 2 new tests: TestDiscoverRigs_SkipGlobalHub_OmitsHome,
  TestCompute_Hermetic_DespitePopulatedHome

Issue 2 — forge.RunMinePass in-process entry point:
- NEW cli/internal/forge/runmine.go (272 LOC): pure-extraction
  consumer-side entry (mines already-forged sessions, distinct from
  cobra's producer-side transcript path).
- cli/cmd/ao/forge.go: thin adapter (+18 LOC); cobra RunE untouched
- 6 new L1 tests in cli/internal/forge/runmine_test.go

Issue 3 — mine.Run in-process entry point:
- cli/internal/mine/mine.go: 134 → 587 LOC (pure extract of git,
  agents, code sources; Option B dependency-injection for events
  source which depends on cmd/ao internals)
- cli/cmd/ao/mine.go: 580 → 292 LOC (-288), becomes a thin adapter
  with type aliases preserving byte-identical cmd/ao shape
- 14 new L1 tests in cli/internal/mine/mine_test.go

Issue 4 — provenance.Audit in-process entry point:
- cli/internal/provenance/provenance.go: +146 LOC adding Audit,
  AuditReport, parseLearningFrontmatter, parseLearningDate
- cli/cmd/ao/rpi_phased_provenance.go: thin adapter (+12 LOC)
- 2 new L1 tests

Issue 6 — iterationID sanitization (V9/S1/S2):
- checkpoint.go: sanitizeIterationID helper rejecting /, \, .., empty,
  non-printable, whitespace. Called from NewCheckpoint.
- recovery.go: same check in RecoverFromCrash after TrimPrefix extract.
- findings_router.go: findingFilenameRe post-match validated via
  time.Parse("2006-01-02") so f-9999-99-99-001.md is rejected.
- 3 new L1 tests

Issue 7 — Stage-order recording hook + test (V6):
- reduce.go: package-level reduceStageRecorder var + call from each
  of the 7 REDUCE stages' run closures (nil by default in production).
- stages_test.go: TestRunReduce_FullStageOrder_Enforced asserts the
  exact seven-stage order via reflect.DeepEqual.

Issue 8 — Post-commit metadata re-verification (V7):
- checkpoint.go: VerifyMetadataRoundTripPostCommit walks cp.PrevDir
  (pre-REDUCE baseline) vs cp.LiveDir (post-Commit live tree),
  legitimately-deleted files skipped, strips flagged.
- loop.go: call added AFTER cp.Commit() succeeds, ratchet-forward
  (logs a finding, does not unwind). logPostCommitFinding helper
  writes to .agents/findings/f-<date>-postcommit-iter-<N>.md
  which intentionally does NOT match findingFilenameRe so the
  router skips it and it surfaces as a morning-report WARN only.
- overnight_e2e_test.go: TestRunLoop_PostCommitMetadataCheck_LogsFinding
  simulates a strip, asserts the finding file is written with the
  correct name.

Issue 9 — Package-level TestMain for HOME isolation:
- NEW cli/internal/overnight/overnight_testmain_test.go: TestMain
  runs for every test in the package, sets HOME to a temp dir,
  pre-creates .agents/learnings so harvest.Promote has a target.
  Belt-and-suspenders backup to per-test t.Setenv("HOME", ...) guards.

Issue 10 — check-home-isolation.sh CI gate + pre-push wiring:
- NEW scripts/check-home-isolation.sh: grep-based gate catching Go
  test files that reference harvest.*/RunIngest(/harvest.Promote
  without t.Setenv("HOME", ...) or a package-level TestMain guard.
  Kill switch: CHECK_HOME_ISOLATION_DISABLED=1.
- scripts/pre-push-gate.sh: new check 3b wired after the existing
  Go-file section, gated on needs_check go.
- Immediately caught cli/cmd/ao/flywheel_e2e_test.go — fixed inline
  with per-test t.Setenv("HOME", t.TempDir()) on all 5 TestFlywheelE2E_*
  functions. Defense-in-depth; the tests already used t.TempDir for
  promoteDir, so the fix is belt-and-suspenders not a latent bug fix.

Issue 11 — skills-codex parity pass (dream, harvest, evolve):
- skills-codex/dream/SKILL.md: added "Compounding Loop (v2)" section,
  3 new $dream start examples, iteration sub-summary output bullet,
  "Delineation vs $evolve" table — matching the parent-slice updates
  to skills/dream/SKILL.md.
- skills-codex/harvest/SKILL.md: added nightly-usage blockquote.
- skills-codex/evolve/SKILL.md: added "Delineation vs $dream" table
  before ## Flags.
- regen-codex-hashes.sh run post-edit to update .agentops-generated
  checksums.

Key finding (follow-up bead worth filing):
- scripts/audit-codex-parity.sh reports green even when entire
  sections are missing from skills-codex. It catches hash drift
  but not semantic content drift. Manual grep was needed to detect
  Wave 5 parent-slice updates missing from the codex copies. Tighten
  the audit to flag missing headings/sections that exist in
  skills/<name>/ but not skills-codex/<name>/.

Gates:
- go build ./...                         OK
- go vet ./...                           OK
- go test ./internal/overnight/... ./internal/corpus/... \
    ./internal/harvest/... ./internal/forge/... \
    ./internal/mine/... ./internal/provenance/...  OK
- go test ./cmd/ao/ (full suite, 183s)   OK
- scripts/check-home-isolation.sh         PASS
- heal.sh --strict                        clean
- scripts/regen-codex-hashes.sh           3 skills updated

Parent refs:
- .agents/plans/2026-04-09-dream-followups.md
- .agents/council/2026-04-09-pre-mortem-dream-followups.md
- .agents/plans/2026-04-09-dream-nightly-compounder.md (parent plan)
- .agents/rpi/phase-2-summary-2026-04-09-crank.md (follow-up source)
- .agents/rpi/phase-3-summary-2026-04-09-dream-nightly-compounder.md
2026-04-10 16:12:25 -04:00
Boden Fuller d584c8379f feat(flywheel): strengthen provenance and nightly proof 2026-04-09 18:33:12 -04:00
Boden Fuller 7a2e321d94 feat: ship dream-cycle and contribution proofs 2026-04-09 17:49:15 -04:00
Boden Fuller 1bb6665cd4 fix: codex native install slash refs 2026-04-09 17:33:04 -04:00
Boden Fuller f6e122b946 docs: package codex native hooks release 2026-04-09 16:54:53 -04:00
Boden Fuller 4747c797d3 fix(ci): eliminate 5 CI toil sources from v2.35.0 post-mortem
1. Add CHANGELOG sync check (check 36) to pre-push-gate.sh — fails if
   root CHANGELOG.md differs from docs/CHANGELOG.md
2. Add 250-line limit guard to edit-knowledge-surface.sh for SKILL.md
   files — warns at 240, errors at 250
3. Add TestMain to cli/cmd/ao/ that clears AGENTOPS_RPI_RUNTIME* env
   vars so per-test t.Setenv is unnecessary
4. Broaden CLI docs parity check (24b) to trigger on any cmd/ao/*.go
   change, not just go build changes
5. Wire --fast flag into .githooks/pre-push for faster push-time gates

Bonus: fix pre-existing pipefail bug in flywheel health check (35) that
silently killed all subsequent checks.
2026-04-07 18:43:26 -04:00
Boden Fuller 52d99f9ea3 feat(codex): add native Codex CLI hooks support
Codex CLI v0.115.0+ supports hooks (SessionStart, Stop,
UserPromptSubmit, PreToolUse, PostToolUse). Add codex-hooks.json
mapping 8 AgentOps hooks to the Codex hook format.

The install-codex-plugin.sh script now:
- Copies hook scripts to the plugin cache
- Installs/merges hooks.json to ~/.codex/hooks.json
- Enables codex_hooks feature in config.toml
- Upgrades hook_runtime from codex-hookless-fallback to codex-native-hooks

Hooks installed: session-start, ao-inject, flywheel-close,
prompt-nudge, quality-signals, go-test-precommit, commit-review,
ratchet-advance.
2026-04-07 09:37:35 -04:00
Boden Fuller 184ac88e10 fix(ci): fix secret scan false positives and regen codex hashes
- Exclude .gc/ dir and Getenv/DOLT_PASSWORD lines from secret pattern scan
- Regenerate codex hashes for forge, post-mortem, scenario after SKILL.md fixes
2026-04-06 22:09:00 -04:00
Boden Fuller 6ba1a76f52 fix(ci): fix skill schema, runtime format, and CLI snippet validation
- Add output_contract, cross-vendor, knowledge to valid schema keys/tiers
- Fix codex lint regex to exclude $-prefixed slash-commands
- Fix codex forge/post-mortem/scenario skills: /cmd → $/cmd prefix
- Fix scenario SKILL.md: replace non-existent --source/--scope flags
  with valid --status variants
2026-04-06 21:51:08 -04:00
Boden Fuller afb172bbe1 chore(ci): remove coverage percentage gates from CI
Remove coverage-ratchet job, cmd/ao coverage floor check, and all
associated scripts/tests/baseline. Coverage percentages are noisy
during test migrations and architectural refactors — they block CI
without catching real bugs.

Deleted: .coverage-baseline.json, scripts/check-cmdao-coverage-floor.sh,
scripts/coverage-ratchet.sh, tests/scripts/check-cmdao-coverage-floor.bats
Updated: validate.yml, pre-push-gate.sh, ci-local-release.sh, pre-push-gate.bats
2026-04-06 20:47:23 -04:00