Commit Graph

535 Commits

Author SHA1 Message Date
Bo e67e41cb89 docs(agent-mail): clarify side-channel role (#807)
## Summary
- clarify that BR/beads is the durable coordination bus while Agent Mail
is the side channel for leases, lane notifications, acknowledgements,
and handoffs
- update Agent Mail bead workflow references to keep evidence and
closure in BR
- refresh Codex agent-mail artifacts and sync the AGY bundled copy

## Validation
- bash scripts/refresh-codex-artifacts.sh --scope worktree
- bash scripts/validate-agy-plugin.sh
- bash scripts/validate-codex-generated-artifacts.sh --scope worktree
- bash scripts/regen-all.sh --check
- bash scripts/validate-manifests.sh
- git diff --check
- PRE_PUSH_SKIP_MKDOCS=1 bash scripts/pre-push-gate.sh --fast

Note: fast pre-push gate still reports existing warn-only
executable-spec drift for scenarios --lint and trace --orphans.
2026-06-07 01:00:51 -04:00
Bo f62dcda748 docs(ntm): document Codex spawn fallback (#806)
## Summary
- Document that NTM `--cod` panes must be observed before use because a
local launcher can create a bare shell instead of an active Codex
runtime.
- Add the reliable `codex exec -s danger-full-access
--skip-git-repo-check -C <gitdir>` fallback to the NTM source skill,
spawn reference, troubleshooting guide, Codex wrapper, and AGY bundled
copy.
- Refresh Codex generated metadata for `ntm`.

## Validation
- bash scripts/refresh-codex-artifacts.sh --scope worktree
- bash scripts/validate-agy-plugin.sh
- bash scripts/validate-codex-generated-artifacts.sh --scope worktree
- bash scripts/regen-all.sh --check
- git diff --check
- PRE_PUSH_SKIP_MKDOCS=1 bash scripts/pre-push-gate.sh --fast (passes;
existing warn-only executable-spec drift remains: scenarios --lint,
trace --orphans)

BR: cp-ou6
2026-06-07 00:42:13 -04:00
Bo f4162649b8 fix(agentops): remove api-print worker paths (#804)
## Summary
- replace AgentOps headless Claude print worker paths with Codex exec or
non-CLI providers
- switch compile auto-detect/default headless CLI runtime from
claude-cli to codex-cli
- fix two shellcheck blockers from the merged skill corpus and refresh
generated docs/hash metadata

## Validation
- bash /Users/bo/acfs/skill-pipeline/scripts/no-api-print-scan.sh
/Users/bo/dev/agentops/skills /Users/bo/dev/agentops/scripts
/Users/bo/dev/agentops/hooks
- shellcheck --severity=error skills/compile/scripts/compile.sh
scripts/eval-agent-harness.sh scripts/run-rpi-phases.sh
skills/agy-rules-workflows/scripts/close-guard.sh
skills/rch/scripts/mine_rch_history.sh
- cd cli && go test ./cmd/ao -run
'TestResolveCompileRuntime|TestPreflightCompileRuntime|TestCompileScriptOptionsPassesBatchFlags|TestRunCompile_EndToEnd_FixtureCorpus'
-count=1
- bash scripts/regen-all.sh --check
- PRE_PUSH_SKIP_MKDOCS=1 bash scripts/pre-push-gate.sh --fast

Note: unscoped
/Users/bo/acfs/skill-pipeline/scripts/no-api-print-scan.sh still flags
ACFS conformance-selftest fixture strings outside this repo; AgentOps
scoped roots are clean.
2026-06-07 00:08:59 -04:00
Bo 6d5d111faf feat(skills): land four-vendor skill corpus (#803)
## Summary
- Lands the AgentOps skill corpus across source and Codex wrappers,
including Gemini image targets.
- Integrates the skill branch onto current origin/main and refreshes
generated manifests/catalogs.
- Normalizes local next-work queue enum drift and fixes shellcheck in
alias-collision validation.

## Validation
- bash scripts/regen-all.sh --check
- bash scripts/validate-skill-schema.sh
- bash tests/skills/test-token-budgets.sh
- bash tests/skills/run-all.sh
- bash scripts/audit-codex-parity.sh && bash
scripts/validate-codex-override-coverage.sh && bash
scripts/validate-codex-generated-artifacts.sh --scope worktree && bash
scripts/validate-codex-api-conformance.sh && bash
scripts/validate-codex-runtime-sections.sh && bash
scripts/lint-codex-native.sh
- bash skills/heal-skill/scripts/heal.sh --strict
- PRE_PUSH_SKIP_MKDOCS=1 bash scripts/pre-push-gate.sh --fast

MkDocs strict remains skipped locally via the documented
PRE_PUSH_SKIP_MKDOCS=1 override because the repo currently emits
repo-wide strict-link warnings unrelated to this landing; CI remains
authoritative.
2026-06-06 23:44:42 -04:00
Bo bdd62816ea docs(skills): add trigger markers to judgment-tier skills (ag-okfu #judgment-wave) (#767)
## What

Wave 1 of **ag-okfu** — adds an explicit `Use when:` discovery trigger
clause to the 8 **judgment-tier** skills: `council`, `design`,
`post-mortem`, `pre-mortem`, `red-team`, `review`, `validate`, `vibe`.

`scan_descriptions.py` flagged 73/81 skills with no trigger marker — a
silent skill-selection risk since runtime discovery is pure LLM
reasoning over the `description` field. The judgment tier ships first
because mis-selection there (e.g. grabbing `review` when you needed
`validate`) is the most costly.

## Why this slice

The bead says *"wave by metadata.tier."* This is one coherent wave = one
PR with a single rollback semantic. Remaining tiers (execution 22,
knowledge 8, meta 8, session 6, background 5, product 5, contribute 4,
cross-vendor 3, library 3, orchestration 1) ship as follow-on waves.

## Evidence

- Corpus missing-trigger count: **73 → 65** (the 8 judgment skills now
pass).
- `python3 skills/skill-builder/scripts/scan_descriptions.py skills
--strict` — all 8 judgment skills report `has_trigger=True`.
- `bash scripts/generate-registry.sh --check` → `OK: registry.json is up
to date` (regenerated, descriptions embedded).
- `markdownlint` clean on all 8 changed SKILL.md files.

## Notes

- Does **not** close ag-okfu — the `--strict` gate stays red until all
tiers are done. Advances the bead; unblocks nothing yet (ag-cx7d ratchet
waits on full corpus clean).

Bounded-context: BC1-Corpus
Evidence: skill-domain-map golden gate
2026-06-06 11:33:18 -04:00
Bo b84dcf3ca2 docs(hookless): close cold-start orientation drift (soc-qh2g1 #cold-start-orientation-coherence) (#795)
## Summary

Close the hookless cold-start orientation gap for `soc-qh2g1` by making
the live startup docs and skills point at explicit `ao session
bootstrap` plus pulled context (`ao inject` / `ao lookup`) instead of
hidden SessionStart behavior.

## Changes

- Reframes live docs that still implied automatic startup/handoff
injection to the hookless explicit-command path.
- Updates source and Codex skill mirrors for `quickstart`, `inject`,
`using-agentops`, `recover`, `bug-hunt`, and `session-bootstrap`.
- Expands the cold-start and docs drift gates so `SessionStart hook`,
`startup hooks`, and `auto-inject ... hook` promises fail unless
explicitly hedged as opt-in, removed, or historical.
- Refreshes scoped Codex skill hashes for the touched mirrors.

## Test plan

- [x] `bash scripts/check-hookless-cold-start.sh`
- [x] `bash scripts/check-doc-hooks-drift.sh`
- [x] `bats tests/scripts/check-hookless-cold-start.bats
tests/scripts/check-doc-hooks-drift.bats`
- [x] `shellcheck scripts/check-hookless-cold-start.sh
scripts/check-doc-hooks-drift.sh`
- [x] `bash scripts/regen-codex-hashes.sh --check --only
session-bootstrap,quickstart,inject,using-agentops,recover,bug-hunt`
- [x] `bash scripts/validate-codex-generated-artifacts.sh`
- [x] `bash scripts/validate-codex-lifecycle-guards.sh`
- [x] `bash scripts/validate-agents-split.sh`
- [x] `git diff --check`
- [x] `bash scripts/validate-skill-runtime-parity.sh`
- [x] `bash scripts/lint-codex-native.sh`

Closes-scenario: soc-qh2g1#cold-start-orientation-coherence
Bounded-context: BC1-Corpus
Evidence: scripts/check-hookless-cold-start.sh
2026-06-06 11:23:56 -04:00
Bo 2dbc575ea3 docs(agent-native): add Claude + Codex/NTM runtime reference recipes (ag-ok755 #agent-native-runtime-refs) (#789)
## What

Completes ag-ok755's remaining acceptance: the `agent-native` skill
shipped doctrine-only, missing the two runtime how-to references the
bead requires (linked from SKILL.md per the heal `--strict` rule).

- `references/managed-agents-runtime.md` — **Claude path**: Anthropic
Managed Agents + Agent SDK + self-hosted sandbox. Carries the
three-phase recipe (bundle → expose `ao` → CI-gate), the
planned-mechanism status for `ao agent bundle` (ag-jspr) / `ao mcp
serve` (ag-higd), and the ZDR / no-fork / CI-is-the-gate boundaries.
- `references/codex-ntm-runtime.md` — **Codex/NTM path**: tmux pane
swarms + agent-mail + direct `ao` shell calls (no Managed Agents API),
with the Claude→Codex primitive substitution table.
- Both linked from `SKILL.md` (runtime-recipes pointer + See Also).
- Regenerated derived artifacts: skills-codex source-hash
manifest/marker (source tree changed) and `registry.json`
reference_count (1→3).

## Scope decision

Catalog treatment for `agent-native` stays **`parity_only`** — the codex
artifact is manual-maintained and already tailored (it has a dedicated
Codex/NTM section), and the bespoke override-dir flip is a deliberate
operator TODO in `skills-codex-overrides/catalog.json`. Not
auto-flipping that here (operator judgment).

## Gates run (all green, in-worktree)

- `heal.sh --strict skills/agent-native` — all references linked
- All 7 codex-parity checks: parity audit, generated-artifacts (`--scope
head`), backbone-prompts, override-coverage, runtime-sections,
lifecycle-guards, parity-drift
- `generate-registry.sh --check` — up to date
- `markdownlint-cli2` on all changed/new files — 0 errors

Closes-scenario: ag-ok755#agent-native-runtime-refs
Bounded-context: BC5-Runtime
Evidence: skills/agent-native/SKILL.md
2026-06-06 10:45:10 -04:00
Bo 0dfac4a9bd chore(standards): guard-test fixtures must use the real persisted shape (ag-jwtx #test-standard-names-real-shape-requirement) (#776)
## What

Encodes a test standard from **ag-jwtx**:
skip/dedup/consumed/idempotency/regression **guard tests must build
fixtures from the real persisted data shape** — round-trip a real sample
(production writer → reader) or assert against a checked-in real example
— never a hand-built in-memory constructor that sets a marker at a
granularity the on-disk format never emits.

## Why

`ag-mjlg` (PR #652) shipped a next-work materialize over-creation bug
(44 vs 16) green because `TestNextWorkMaterialize_SkipsConsumed` set
`consumed` at the **per-item** level while real `next-work.jsonl` marks
it at the **batch** level. The guard exercised a shape production never
produces → false green. This converts that one-off into a durable
standard + a pre-mortem flag (catch→encode→never-repeat).

## Changes (docs/standards only)

- `skills/standards/references/test-pyramid.md` — new **Fixture
Fidelity** section (the standard + how-to-comply + the pre-mortem flag).
- `skills/standards/references/go.md` + `.claude/rules/go.md` —
Test-Conventions bullet (kept in parity).
- `skills/pre-mortem/references/mandatory-checks.md` — two flags added
to the **Test Pyramid Coverage Check (Mandatory)** table.

## Verification

- `markdownlint --config .markdownlint.json` on all four files: clean.
- `scripts/generate-registry.sh --check`: registry up to date (no new
reference files; existing files edited).
- Docs-only; no code paths touched.

## Scenario

> Given the AI-native test-shape standard doc, when an agent writes a
skip/dedup/consumed guard test, then the standard requires the fixture
to come from a round-tripped real persisted sample, and a
pre-mortem/checklist item flags item-level-only fixtures for batch-level
state.

Closes-scenario: ag-jwtx#test-standard-names-real-shape-requirement
Bounded-context: BC1-Corpus
Evidence: skills/standards/references/test-pyramid.md
2026-06-06 10:17:30 -04:00
Bo 1601467387 chore(docs): gut dead-mechanism context poison from agent-facing docs (ag-sjz8 #gut-poison) (#764)
## What

Gut **context poison** — agent-facing docs that route a working agent at
DEAD mechanisms. This poisoned a live fleet-operating session (the bo
driver building the go-dark supervisor) into proposing `ao rpi` as a
continuity-loop worker. Found via a 5-way parallel poison fan-out.

**Scope: operational-surgical** (Bo's explicit call). Gut the
agent-facing *operational* guidance + *factual* errors; **LEAVE** the
README/`docs/3.0.md` product narrative (Gas-City-as-reference-substrate
is coherent, ADR-backed product design — a different altitude from Bo's
live fleet).

## Changes (10 files, surgical)

**Tier A — operational guidance (the poison that bit me):**
- `CLAUDE.md` Session Constraints: "route multi-phase work through `ao
rpi`" → the live substrate (NTM + MCP Agent Mail + `continuity-loop`);
`gc` reframed as optional-out-of-session, **not** the live substrate.
Kept the accurate "bridge REMOVED" + "load-bearing legacy" lines.
- `AGENTS.md`: dropped the deleted "scheduling daemon" (ADR-0009).
- `AGENTS-RUNTIME.md`: `ao rpi serve --help` → the real `ao` command
surface.

**Tier B — hookless-factual** (3.0 installs no hooks by default):
hookless banners on `ARCHITECTURE.md` + `reference.md` (surgical vs.
rewriting diagram internals); corrected SessionStart-hook prose in
`context-packet.md` + `vs-claude-flow.md`.

**Tier C — retired `/dream` shown as live:** marked retired in
`evolve`/`harvest`/`using-agentops` (compounding moved to Gas City).
`curate` **intentionally left** — its `--mode=dream` is the forward
replacement, not poison.

## Guardrails
- Does **not** claim `ao rpi` was deleted — the command still compiles
(`loop`/`phased`/`serve` exist); only its role as the *live workflow* is
corrected.
- registry.json unaffected (skill **bodies** only; `generate-registry.sh
--check` = OK).

## Evidence
`bash scripts/generate-registry.sh --check` → OK. Diff is 20 insertions
/ 16 deletions across 10 files.

Bounded-context: BC1-Corpus (agent-facing context docs)
Evidence: this PR diff + the parallel fan-out inventory
Closes: ag-sjz8

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-06 09:44:45 -04:00
Bo 242fc1695a docs(skills): match agy (Antigravity) panes in swarm-cleanup greps (ag-ni1b #agy-swarm-cleanup-grep) (#788)
## What

ntm now maps its `gemini` agent slot to `agy
--dangerously-skip-permissions` (Antigravity), so the gemini-family pane
runs as an `agy` process. The `system-tuning` swarm-cleanup reference
discovered and counted swarm agents with `grep -E 'claude|codex|gemini'`
in two places:

- the **confused-long-horizon-agent** finder (`ps ... | grep -E ...`)
- the **post-cleanup verification count** (`pgrep -af ... | wc -l`)

Both silently miss `agy` panes post-migration → confused-agent cleanup
skips them and the agent count under-reports.

## Change

Add `agy|antigravity` to both matchers and a one-line note explaining
the slot mapping. Keep `gemini` for older sessions that still launch it.

## Scope

In-repo slice of **ag-ni1b** (gemini-cli → Antigravity migration). This
advances the bead but does **not** close it — the bulk
(external/user-global skills, both-host verification,
dueling-idea-wizards + code-review-swarm end-to-end agy node) remains.

## Verification

`scripts/pre-push-gate.sh --fast` → passed (the 2 WARNs are
pre-existing, unrelated: unknown-flag noise in executable-spec
link-integrity).

Closes-scenario: ag-ni1b#agy-swarm-cleanup-grep
Bounded-context: BC5-Runtime
Evidence: skills/system-tuning/references/agent-swarm-cleanup.md
2026-06-06 08:56:07 -04:00
Bo b008e22f9b feat(domain): name silent-contract-violation + verdict.v1 finding taxonomy (ag-twl8 #verdict-category-taxonomy) (#759)
## What

First slice of the RubricRefine integration epic (**ag-5elx**). Moves
the paper's sharpest idea into the verification membrane — and it's the
dependency that **blocks the flagship** pre-execution gate (ag-rjvf).

- **`skills/domain/references/silent-contract-violation.md`** — new
draft anti-pattern entry. Names the failure class the whole membrane
exists to catch: tool-use code that **runs clean, raises no exception,
and is still wrong** (wrong routing, mismatched output shape, broken
argument provenance). Full Signature / Cost / Cause / Refusal + `bd`
incident citation, indexed in `INDEX.md` under a new "Verification
membrane concepts" section.
- **`schemas/verdict.v1.schema.json`** — adds RubricRefine's 4-category
contract-check taxonomy as an **optional** `category` enum on findings:
`tool-choice | output-contract | call-signature | data-provenance`.
Backward compatible — existing uncategorized findings stay valid
(`additionalProperties:false` preserved), an unknown category is
rejected so the taxonomy can't drift.
- **`tests/scripts/check-verdict-category-taxonomy.bats`** — behavioral
schema tests via python `jsonschema` (valid accepted · all four accepted
· omit valid · unknown rejected · enum exact). Written test-first:
confirmed failing against the unmodified schema, then green.
- **`registry.json`** — regenerated (domain `reference_count` 18→19;
scope-only diff).

## Why

RubricRefine (Anduril, arxiv 2605.09730v3) formalizes the failure
AgentOps' no-self-grade membrane targets, but AgentOps had no name for
it and no shared bucket vocabulary for findings. This slice supplies
both, so every downstream gate (and the pre-execution gate ag-rjvf) can
categorize and ablate contract violations.

## Verification

- `bats tests/scripts/check-verdict-category-taxonomy.bats` → 5/5 (CI
runs it via the bats job; surfaces changed: schemas/skills/docs/bats).
- `scripts/generate-registry.sh --check` → up to date.
- `scripts/check-bead-scenario-coverage.sh --run` → PASS (1/1 scenario
covered & passing).
- Full `pre-push-gate.sh --fast`: green except `corpus-freshness`
(env-local snapshot 8d old; CI sets `AGENTOPS_CORPUS_FRESHNESS_SKIP=1` —
not a PR blocker).

Closes-scenario: ag-twl8#verdict-category-taxonomy
Bounded-context: BC1-Corpus
Evidence: schemas/verdict.v1.schema.json
2026-06-06 08:33:38 -04:00
Bo df3cc9803b fix(memory): reconcile W6 cutover commands
Reconcile W6 memory cutover surfaces so runnable/doc commands match the real CLI. Cross-model ACKs: WindyCastle Agent Mail #225, RubyMoose Agent Mail #226. Required checks green; Cursor Bugbot non-required pending under recorded exception.
2026-06-05 04:50:49 -04:00
Bo 57ec8f3290 docs(memory): remove legacy bd-memory guidance
Implements ag-i788 W4.3. Cross-model ACKs recorded in Agent Mail: RubyMoose #214 and WindyCastle #213. Required checks green; merge proceeds under the recorded Cursor Bugbot non-required instability exception.
2026-06-05 04:06:57 -04:00
Bo 015bb52286 ci(ci): wire scan_descriptions --probe as I0-informational receipt lane (ag-iyu4 #probe-i0) (#738)
Wires `scripts/skill-probe-i0.sh` — the deterministic lexical trigger
ranker (`scan_descriptions.py --probe`, ag-7led) — as an
**I0-INFORMATIONAL** step inside the `skill-eval` job.

## What it does
- Runs the probe over every `trigger_probes:` phrase in the corpus,
writes a per-skill JSON receipt to `.agents/ao/skill-eval/<id>.json`,
and uploads it as the `skill-retrieval-probe-receipts` workflow
artifact.
- Asserts byte-stable **determinism** across two runs; a
non-deterministic probe is surfaced as a `::warning::` only.
- **Not a PR check:** `continue-on-error: true` lives INSIDE the
existing `skill-eval` job, so no new GitHub check is created and the
step can never block (or even advisory-fail) a merge. I0 =
informational.
- No-ops cleanly (exit 0, no receipts) until a skill opts in with
`trigger_probes:`.

## Acceptance
- Probe emits the JSON-receipt artifact AND no new PR check appears
(verify absent from `gh pr checks`).
- A deliberately non-deterministic probe input is caught by the
determinism assertion before it could become a gate —
`tests/scripts/skill-probe-i0.bats` (3 specs, all green).

## 2-week stability baseline
Documented in three places (validate.yml comment,
`docs/contracts/ci-jobs.yaml` skill-eval entry,
`skills/skill-builder/SKILL.md` trigger_probes note): keep `--probe`
I0-only until the receipt lane runs green + byte-stable across the
corpus for a 2-week baseline of merges before any blocking-gate
promotion.

Closes-scenario: ag-iyu4#probe-i0
Bounded-context: BC1-Corpus
Evidence: scripts/skill-probe-i0.sh
2026-06-05 01:00:52 -04:00
Bo 0e5ace2eda docs(evolve): backport pre-push fail-fast lever + ao-command surfaces (ag-ro1i #evolve-backport) (#735)
## Summary

Backports two deltas validated on the LIVE plugin-cache evolve skill
(`~/.claude/plugins/cache/agentops-marketplace/agentops/3.0.1/skills/evolve/SKILL.md`)
into the repo source `skills/evolve/`, so they survive a plugin
reinstall. Based on current `origin/main` (post-#724), preserving the
`ao loop` refs — this PR only ADDs the missing lever/surface guidance.

**1. Pre-push fail-fast lever.** Pre-release checklist step 2 →
`PRE_PUSH_FAIL_FAST=false bash scripts/pre-push-gate.sh`, with
rationale: default fail-fast stops at a PRE-EXISTING failure (e.g.
corpus-freshness) and masks the loop's own regressions by ending the run
early. The full no-fail-fast gate surfaces every red.

**2. AO-command surfaces.** Pre-release checklist step 1 →
`scripts/regen-all.sh` and names the two surfaces `regen-all` only WARNS
about when ADDING an `ao` command: cobra `expectedCmds` (x2 lists in
`cobra_commands_test.go`) + the `cli-command-surface` heading counts
(smoke fixture + `matrix.json`). New reference
`references/ao-command-landing.md` documents the full command-landing
procedure, parallel to `new-skill-landing.md` (the skills axis).

## Regen / scope

- `registry.json` reference_count 26→27 (new reference file) +
`skills-codex/*` source_hash for the SKILL.md prose edit — genuine
consequences of the skill touch.
- Pre-existing `docs/cli-surface.*` drift (unrelated `ao loop` coverage
recategorization) was REVERTED — out of scope.
- `regen-all.sh --check` clean across all skill/codex/registry drift
validators.

## Note (install-lag)

The live v3.0.1 plugin-cache evolve skill was ALSO stale vs repo
(pre-#724 `ao evolve` refs, missing the "six derived surfaces" note) —
flagging the install-lag per the bead.

Closes-scenario: ag-ro1i#evolve-backport
Bounded-context: BC4-Factory
Evidence: skills/evolve/SKILL.md
2026-06-04 22:40:57 -04:00
Bo 8ad6747913 chore(ao): delete the ao evolve CLI surface (ag-llni slice 1) (#724)
**Slice 1 of ag-llni** — retire `ao rpi`/`ao evolve` (orchestration is
no longer an in-CLI engine). This PR removes the **`ao evolve`** half;
the `rpi*.go` + phased web is slice 2.

**Architecture (operator-confirmed 2026-06-04):** orchestration is
two-tier — *inner loop* (one session) = skills/CLIs/native-subagents +
**Workflows** (`.claude/workflows/operating-loop.js` + `bead-crank.js` —
the Claude encoding of inner-orchestration that was mis-shaped as
`rpi`/`evolve`); *outer loop* (many sessions) = **NTM +
mcp-agent-mail**. Codex inner-loop = NTM + agent-mail for now. Leaf CLIs
(`corpus`/`goals`/flywheel/knowledge loops = BC1 corpus), NTM, and
agent-mail all stay.

### Changes
- Deleted `ao evolve` + 4 subcommands (`config`, `next-work`, `blocked`,
`write-stop-marker`) — 10 files.
- Relocated the one non-evolve coupling, `countCronHistoryRows`, into
its sole consumer `cron_self_adjust.go`.
- Removed `evolve` from the `cobra_commands_test.go` golden
`expectedCmds` list (2 sites).
- Regenerated `cli/docs/COMMANDS.md` (−125 lines) +
`docs/cli-skills-map.md`.

### Verification
- `go build ./...` green · `go vet ./cmd/ao` clean · **`go test
./cmd/ao` = 9251 pass**.
- Net: 13 files, −2192 LOC.

Bounded-context: BC5-Runtime
Closes-scenario: ag-llni#delete-evolve-cli
Evidence: cli/cmd/ao/cron_self_adjust.go
Test-Removal-Reason: ao evolve CLI surface retired (ag-llni) —
orchestration moved to .claude/workflows + NTM; the 5 deleted
evolve_*_test.go covered now-deleted command code, not kept behavior.

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-06-05 00:21:53 +00:00
Bo 6c8cb223ea feat(corpus): add reach blast-radius tier {bead|pull|always} (ag-bsf6 #reach-field) (#721)
W2.1 of epic ag-lhu0 (memory-system re-architecture). Adds the **reach**
blast-radius axis, orthogonal to maturity, per the locked duel
architecture.

- `reach {bead|pull|always}` on FrontMatter + Learning; `reach:`
frontmatter round-trips.
- `SanitizeReach` normalizes + defaults absent/invalid → `pull`, and
**never** promotes to `always` (the computed-not-authored invariant —
`always` is derived from maturity==established ∩ canon in ag-oqha).
- `learning.v1.schema.json`: reach enum + default pull; domain vocab
`skills/domain/references/reach.md`.
- Tests: SanitizeReach + frontmatter round-trip/default (88 search-pkg
tests green).

Closes-scenario: ag-bsf6#reach-field
Bounded-context: BC1-Corpus
Evidence: cli/internal/search/learnings.go
2026-06-04 16:52:33 -04:00
Bo 7e8197ba93 ci(skills): consolidate live skill gates into one required skill-gates job (ag-87sv #skill-gates-job) (#723)
Consolidates the live skill-authoring CI gates into one named, required
`skill-gates` job (pure regroup of already-live gates — no behavior
change). Replaces the phantom `scenario-hash-stability` reference in
`CLAUDE.md` with the real `check-scenario-test-linkage` gate now grouped
under `skill-gates`. Adds the `skill-gates` row to the CI-policy-parity
manifest (`docs/contracts/ci-jobs.yaml` + `AGENTS-CI.md`) and the
`gate:skill-gates` SKU to `registry.json` (11→12 gates). New
`tests/scripts/skill-gates.bats` (12 tests) locks the job's structure,
required-check wiring, and drift-sweep behavior.

Part of epic ag-czzf.

Closes-scenario: ag-87sv#skill-gates-job
Bounded-context: BC2-Validation
Evidence: .github/workflows/validate.yml

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-06-04 16:16:04 -04:00
Bo 0c635274e4 docs(skills): reframe /evolve + domain/rpi dispatch as skill-not-CLI (ag-wb6k #skills-dispatch-narration) (#700)
## What
**iowf Wave 1** (ag-wb6k): bring the CLAUDE skills in line with the
codex stance the `validate-codex-rpi-contract.sh` gate already enforces
— `ao evolve`/`ao rpi` are terminal **wrappers**, not the runtime
default; the loop runs as the skill.

- **skills/evolve/SKILL.md** — the "V2 command surface" para framed `ao
evolve` as *the* entry. Reframed: the loop runs as the `/evolve` skill
(chaining `/rpi --auto` cycles); `ao evolve` / `ao rpi loop
--supervisor` are terminal-native wrapper commands for humans/non-skill
runtimes (being retired — ag-iowf).
- **skills/domain/references/rpi.md** — "a substrate dispatches `ao rpi`
as one unit" → "dispatches the `/rpi` loop (an agent running the skill)
as one unit" (matches the ag-88y5 doctrine reframe).

**Left as-is (legitimate, not misframings):** autodev's skill-first "use
`/evolve` or `ao evolve`" listing; ralph-loop-contract's accurate `ao
rpi phased` backend references.

## Verification
Six derived surfaces regenerated. Gates green: **codex-rpi-contract**
(the coupled gate — the codex side already had the correct stance, so no
twin edit needed), regen-all --check, embedded-sync, heal --strict,
registry-drift, body-refs.

## Scope
This is Wave 1 (docs/skills narration) of ag-iowf. The actual `ao
evolve`/`ao rpi` CLI removal is W2–W4 (ag-kbh0/ayst/zoa1, blocked on
soc-1gbpz + live-automation migration).

Closes-scenario: ag-wb6k#skills-dispatch-narration
Bounded-context: BC3-Loop
Evidence: skills/evolve/SKILL.md
2026-06-03 16:09:50 +00:00
Bo 6072dceac5 docs(substrate): reconcile doctrine — skill-dispatch + drop Gas City reference (ag-88y5 #docs-skills-dispatch-reframe) (#696)
## What
Two bounded doctrine-reconciliation slices (one coherent arc):

**ag-88y5** — the out-of-session dispatch unit is the `/rpi`·`/evolve`
**skill**, not the `ao rpi`/`ao evolve` CLI. Per the 3.0
skills-are-the-runtime thesis (using-ntm #693 already frames it this
way), re-narrate the **live** doctrine surfaces so the substrate spawns
an agent that *runs the /rpi skill* over a bead:
- docs/3.0.md, docs/architecture/canonical-loop-model.md,
docs/runbooks/nightly-evolution.md
- skills/using-agentops, skills/agent-native,
skills/domain/references/factory.md

Historical surfaces (MIGRATION-3.0, ADR-0009, release notes) +
CLI-reference left as-is; the actual `ao rpi`/`ao evolve` CLI removal is
the **ag-iowf** epic (live automation callers — overnight-evolve,
release-smoke — must migrate first).

**ag-ogp5** — drop the 4 docs still asserting Gas City as THE reference
substrate → NTM+MCP+managed-agents:
- docs/ARCHITECTURE.md, docs/SCHEMAS.md,
docs/contracts/agents-write-surfaces.md,
docs/patterns/completion-notifications.md (Pattern C)

The ~37 historical/illustrative GC refs are intentionally retained (per
ag-ogp5 scope).

## Verification
regen-all --check, embedded-sync, heal --strict, registry-drift,
codex-rpi-contract, codex-artifacts --scope head — all green.

Closes-scenario: ag-88y5#docs-skills-dispatch-reframe
Bounded-context: BC4-Factory
Evidence: docs/3.0.md
2026-06-03 12:11:23 +00:00
Bo 59b2391b6d feat(skills): add AgentOps-owned using-ntm substrate-orchestration skill (ag-zaoj #using-ntm-skill) (#693)
## What

Adds an **AgentOps-owned, shippable `using-ntm` skill** — the missing
NTM leg of the `NTM + MCP + managed-agents` substrate doctrine
(**ag-zaoj**). Until now `automation-shape-routing` pointed **by name**
at the *proprietary* `ntm`/`vibing-with-ntm` skills, which AgentOps
can't ship — a dangling pointer for standalone users. This is original
content modeled on (not copied from) those.

## The seam: skills are the runtime, not the CLI

The skill teaches driving the open `ntm` CLI as the out-of-session
substrate: **NTM spawns Claude/Codex panes that run the `/rpi` and
`/evolve` *skills*** over a bead queue. It explicitly does **not** use
`ao rpi`/`ao evolve` CLI subprocesses — those terminal wrappers are
retired; the substrate dispatches the whole loop as one invocable skill.

## What lands (15 files, +~440)

- `skills/using-ntm/SKILL.md` + `skills-codex/using-ntm/SKILL.md` (twin)
— the new skill.
- `automation-shape-routing` (+ codex twin) — dangling
`ntm`/`vibing-with-ntm` pointers now route to the owned `/using-ntm`;
`ntm` stays as the CLI tool.
- Six derived surfaces regenerated: `registry.json`, skill-domain-map,
SKU catalog, codex hashes/manifest, context-map; + skill-disposition row
and skill-count bumps (80 → 81) in PRODUCT / ARCHITECTURE / SKILLS /
domain-map / BDD-Gherkin.

## E2E verification (against the real `ntm` CLI)

Per the directive (no `ao rpi`/`ao evolve`): verified every `ntm`
subcommand the skill cites exists
(`spawn/send/activity/attach/doctor/deps/kill/health`) and **fixed the
documented flag to the real `--pane=N` syntax** (it had `--pane N`).
`ntm doctor` runs (bv ✓ / bd ✓ / am ⚠). `docs/cli-surface.*` drift
excluded (pre-existing, unrelated).

## Follow-up (not in this PR)

`ao rpi`/`ao evolve` CLI are slated for retirement; `docs/3.0.md` + the
recent Gas City-prune PRs still reference `ao rpi <bead>` as the
dispatch unit and need a skills-not-CLI reconciliation pass.

## Verification

- `regen-all.sh --check` ALL GREEN · registry-drift PASS · codex parity
PASS · skill-isolation/size PASS · markdownlint 0.

Closes-scenario: ag-zaoj#using-ntm-skill
Bounded-context: BC4-Factory
Evidence: skills/using-ntm/SKILL.md

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-06-03 00:19:22 +00:00
Bo 6685eac0c9 feat(skills): bd-first memory migration — Phase 2 migrate (ag-5u50 #phase2-migrate) (#692)
## Phase 2 — migrate salvaged memory onto bd (epic `ag-5u50`)

**Stacked on #691 (Phase 1).** Review/merge that first; this PR's diff
is Phase-2-only.

Second arc of the **bd-first-memory-migration** skill: take the Gate-A
keepers and stand up bd as the single source of truth — typed memories
with provenance, decay-ranked recall, a generated MEMORY.md cache, and
one unified write path.

### What's in it (beads ag-5u50.10–.14)
- **`.11` `mem.py`** — typed wrapper over bd keys (fenced `<!--mem-->`
header), injectable `BdStore`/`FakeStore` adapter, `parse`/`render` +
**decay-rank** per DATA-MODEL.
- **`.12` `recall.py`** — decay-ranked, token-budgeted recall; bumps
`access_count` (the read signal feeding utility/promotion).
- **`.14` `gen_memory_md.py`** — regenerate the thin, read-only
MEMORY.md cache from bd (permanently fixes the bloat mode).
- **`.13` `remember.py`** — unified write entrypoint (all harnesses →
bd).
- **`.10` `import_memories.py`** — idempotent salvage import with
provenance + import-ledger, **write-paced** (bd auto-commit OOM guard),
`--dry-run`.

### Verification
- **11 hermetic L2 tests** (`tests/test_phase2_migrate.py`), no
`bd`/`ao` dependency — round-trip, decay ordering, supersede exclusion,
episodic-vs-feedback decay, access bump, idempotent import, dry-run,
write-path provenance — all green (17 total with Phase 1).
- **7 Gherkin scenarios** (`references/migrate.feature`).
- Scripts 100-col clean; codex twin hashes refreshed; full local gate
sweep green (skill-lint, codex artifacts/coverage, registry,
context-map, counts, three-gap).

> **CI note:** opened on **local-green** — GitHub Actions stopped
dispatching workflow runs repo-wide ~20:20 (a GitHub-side outage/quota
issue, not this code). All gates verified locally; cloud CI will run
once dispatch recovers.

### Scope guardrails
Writes to bd only — no Phase-3 GC/retire here (that's gated behind the
rollback test). The destructive dogfood on the live box stays
human-gated (Gate C).

Closes-scenario: ag-5u50#phase2-migrate
Bounded-context: BC1-Corpus
Evidence: skills/bd-first-memory-migration/tests/test_phase2_migrate.py

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-06-02 19:07:05 -04:00
Bo b830d163c4 feat(skills): bd-first memory migration — Phase 1 audit (ag-5u50 #phase1-audit) (#691)
## Phase 1 — read-only memory-layer audit (the first arc of epic
`ag-5u50`)

First slice of the **bd-first-memory-migration** skill: a generic,
3-phase AgentOps skill that consolidates fragmented agent-memory layers
(Claude `MEMORY.md`, ao/flywheel, `.agents/*`, openclaw) onto **bd** as
the single source of truth, then GC/retires the rest. This PR ships the
**read-only audit half** — it cannot mutate anything; it produces the
Gate A manifest a human approves before any later migration.

### What's in it (beads ag-5u50.5–.9)
- **`.5` scaffold** — `SKILL.md` (trigger-matched) + references +
`scripts/`.
- **`.6` data model** — `references/DATA-MODEL.md`: type taxonomy
(fact/feedback/project/episodic/procedural), per-memory fields,
decay/utility formula, maturity ladder **wired to eviction** (the fix
for ao's 99%-provisional stall).
- **`.7` scanner** — `scripts/audit_scan.py`: read-only inventory of
every layer (counts, bytes, dup-rate, maturity), `--json`/`--human`.
- **`.8` classifier** — `scripts/classify.py`: keep/drop manifest
(authored=keep, `-pend-`/dups=drop, bloated `MEMORY.md`=drop), dry-run.
- **`.9` Gate A report** — `scripts/audit_report.py`: current-state
table + manifest summary + **reversibility plan naming every later
destructive action and its rollback**.

### Verification
- **6 hermetic L2 tests** (`tests/test_phase1_audit.py`), no `bd`/`ao`
CLI dependency — all green.
- **5 Gherkin scenarios** (`references/audit.feature`).
- Scripts are 100-col clean and `py_compile`-verified.
- **Live-validated** against a real fragmented box: the scanner
auto-found 2 bloated `MEMORY.md` indexes + the 62k-file /
99%-provisional / dup-pile signals.
- Context-map regenerated; drift gate green.

### Scope guardrails
Read-only only. No Phase-2/3 (migrate / GC / retire) code here — those
are gated behind Gate A and ship in later PRs. The destructive dogfood
on the live box stays human-gated (Gate C).

Closes-scenario: ag-5u50#phase1-audit
Bounded-context: BC1-Corpus
Evidence: skills/bd-first-memory-migration/tests/test_phase1_audit.py
2026-06-02 17:10:17 -04:00
Bo d4b3b38422 docs(skills): re-narrate residual live Gas City framing in skills/ (ag-r6g1 #skills-slice) (#686)
## What

Round-3 Gas City doctrine sweep — **skills/ slice** (**ag-r6g1**). Five
skill surfaces still framed Gas City as THE live out-of-session
substrate; re-narrated to **NTM + MCP + managed-agents** per
[`docs/3.0.md`](docs/3.0.md).

## Surfaces (5 source + 6 regenerated derived, +20 −20)

- `skills/compile/SKILL.md` + `skills-codex/compile` twin — "run it on
Gas City" → the out-of-session substrate (NTM + MCP + managed-agents).
- `skills/discovery/references/best-practices.md` +
`skills/validation/references/best-practices.md` — magic-compounding
anti-pattern row's "Gas City for out-of-session" → "the out-of-session
substrate: NTM + MCP + managed-agents".
- `skills/swarm/references/shared-checkout-discipline.md` — "`ao evolve`
via Gas City" → "`ao evolve` on the substrate".
- Regenerated: `registry.json` + codex `.agentops-generated.json`
hashes/manifest for the 4 edited skills.

## Scope

Triaged each ref — only **present-tense live-substrate** framing was
changed; already-correct historical/reference mentions were left alone.
**ag-r6g1 stays OPEN**: the docs/ narrative slice (~30 refs) is deferred
to a later tick. `docs/cli-surface.*` drift excluded (pre-existing,
unrelated to this change).

## Verification (full gate, pre-push)

- `generate-registry.sh --check` OK · codex parity audit passed ·
`regen-all.sh --check` ALL GREEN · markdownlint 0 errors ·
skill-isolation/size clean.

Closes-scenario: ag-r6g1#skills-slice
Bounded-context: BC1-Corpus
Evidence: skills/compile/SKILL.md
2026-06-02 15:16:32 -04:00
Bo 0d82c6e20c docs(skills): re-narrate live Gas City substrate framing to NTM+MCP+managed-agents (ag-94vu #live-substrate-renarration) (#684)
## What

Round-2 Gas City doctrine sweep (**ag-94vu**). Re-narrates the **5 named
skill surfaces** that still framed Gas City as THE live reference
substrate (present-tense operator instructions) to the canonical
substrate trio — **NTM (tmux swarm) + MCP (`ao mcp serve`) +
managed-agents (`ao agent`)** — matching [`docs/3.0.md`](docs/3.0.md).
Driver: post-mortem checkpoint #6 Judge-3 FAIL ("the repo does not yet
speak one doctrine").

## Surfaces (9 insertions / 9 deletions, 5 files)

- `skills/domain/references/factory.md` — "Gas City is the reference
substrate" → the NTM/MCP/managed-agents trio; "Mayor-driven / `gc
sling`" → **swarm-driven** dispatch.
- `skills/scope/SKILL.md` — cron-cadence orchestration reference.
- `skills/session-bootstrap/SKILL.md` — substrate submit reference.
- `skills/SKILL-TIERS.md` — dream retired-pointer note.
- `skills-codex/using-agentops/SKILL.md` — **codex-twin parity**:
dropped the stale `gc` runtime-mode row for the canonical `substrate`
row (the Claude twin was already correct; this one slipped in #679).

## Bounded by design

This PR is the coherent **"live skill operator-instructions speak one
doctrine"** slice. A repo-wide grep shows ~35 more refs across other
skills + `docs/` narrative; bundling them would reproduce the #682
mega-PR that was rejected for sprawl. Deferred to tracked follow-ups:

- **ag-r6g1** — round-3 narrative sweep (remaining skills/ + docs/ ~35
refs; many docs already frame GC correctly as "the reference" — triage
required).
- **ag-82pv** — remove orphaned
`GasCityPhaseEvidence*`/`GasCityTranscript*` dead types in
`cli/internal/rpi/artifacts.go`.

## Verification (local, green)

- codex-parity-drift: PASS · registry-drift: PASS (80) ·
skill-catalog-drift: up-to-date · skill-isolation: PASS · skill-size:
0/0 · markdownlint: 0 errors.
- Residual live-substrate grep over the 5 surfaces: clean.

Closes-scenario: ag-94vu#live-substrate-renarration
Bounded-context: BC1-Corpus
Evidence: skills/domain/references/factory.md
2026-06-02 14:41:43 -04:00
Bo 7455382416 refactor(gc): strip Gas City coupling; adopt NTM+MCP+managed-agents (ag-124p) (#679)
## What

Operator-authorized (Bo, 2026-06-02). Strips the remaining **Gas City**
(`gastown`) coupling from AgentOps and reconciles the **split-doctrine
state** on `main` that the #672–#676 post-mortem flagged: canonical docs
(#676) said NTM+MCP+managed-agents while user-facing docs still
described Gas City as the reference substrate.

The out-of-session substrate is now uniformly **NTM** (local tmux swarm)
+ **MCP** (`ao mcp serve`, shipped) + **managed-agents** (`ao agent`).
AgentOps adopts a substrate; it owns none. Closes **ag-124p** (and
resolves **ag-h93p** — the claude.json gc-hook decouple).

## Deleted (load-bearing surfaces, per the bead's verified scope)

- `packs/agentops/` (the reference City) + root `city.toml`
- `skills/using-gc` + `skills-codex/using-gc` (+
`tests/scripts/using-gc-skill.bats`)
- `gc prime/nudge/mail/hook` wiring in `cli/hooks/claude.json` → now
hookless, matching 3.0 doctrine

## Doc sweep (the split-doctrine fix the post-mortem required)

- **README.md, docs/MIGRATION-3.0.md, docs/dependencies.md,
docs/activation-profiles.md** re-narrated to the substrate trio (the
four files the verdict named)
- AGENTS.md / CLAUDE.md substrate bullets; `dream` skill (+codex twin)
retirement pointer; `shared` / `agent-native` / `using-agentops`
cross-refs; skill-dispositions, context-map, sku-catalog, google-sre
convergence map

## Regenerated derived surfaces

Skill counts (81→80), `registry.json`, `skills/catalog.json`,
context-map, skill-domain-map, codex hashes (14) + manifest, SKILL-TIERS
— all via the generators, validated drift-free.

## Scope boundaries / follow-ups

- **`cli/internal/doctor/fix_bridges.go`** still carries a gc-bridge
detector/fixer subsystem. Out of the bead's verified scope; degrades
gracefully (stat-checks, returns empty when `gc`/`city.toml` absent);
removing it is a test-backed Go change → **follow-up bead**.
- **CLAUDE.md "Gas City bridge — REMOVED"** note kept intentionally:
it's an anti-re-coupling record, not substrate-framing.
- The local-only **bd-closeout** pre-push check (not in CI) is a
pre-existing gap on `main` (its AGENTS.md has no `bd dolt push` line) —
untouched here.
- `thesis-stability` gate FAIL, if present, is the pre-existing
README/PRODUCT/GOALS tagline drift, unrelated to this PR (my
README/PRODUCT edits are the dependency table + skill-count numbers, not
the tagline).

## Verification

`go build ./...` + `go vet` green · skill schema (80/80) + integrity
(heal --strict clean) + lint suite (0 fail) + codex parity green ·
sku-catalog & context-map drift gates green · zero broken markdown links
to deleted paths.

Closes-scenario: ag-124p#gc-coupling-strip
Bounded-context: BC5-Runtime
Evidence: docs/MIGRATION-3.0.md
2026-06-02 09:06:41 -04:00
Bo eba83ad11b feat(ci): committed reconcile-pr + no-epic-close-with-open-child gate (ag-9gac #reconcile-helper-epic-gate) (#669)
Promotes the ephemeral `/tmp` bead-crank reconcile engine (ran ~20x this
session) to committed, **tested, enforced** scripts. Turns S3's advisory
prose into executable gates.

## What lands
- **`scripts/reconcile-pr.sh <pr> <bead> [--epic <epic>]`** — polls
checks until terminal, reruns the lone `correctness (ubuntu-latest)`
tar-cache flake **once**, treats only substantive non-`claude-review`
fails as blocking, `gh pr merge --squash --admin` when clean, confirms
`gh pr view --json state == MERGED`, then `bd update <bead> --status
closed` (bd close has a dolt blocker-query glitch). `--epic` mode calls
the gate before closing the epic.
- **`scripts/check-epic-children-closed.sh <epic>`** — the
**no-epic-close-with-open-child** gate: exit 1 naming any
open/in_progress child, exit 0 when all closed.
- **15 hermetic bats** (`gh`+`bd` stubbed via PATH shims) — prove
merge+close on green, BLOCK (exit 2) on a substantive fail,
rerun-once-then-merge on the lone flake, no-close when state != MERGED,
gate rejects+names an open child, passes when all closed. shellcheck -S
warning clean.
- **crank/evolve SKILL.md** prose now points to the committed scripts
(tiny edits).

## Exit-code contract (asserted in tests)
`0` merged+closed · `1` epic-gate fail (open child) · `2` blocked
(substantive fail) · `3` merge attempted but state != MERGED · `4`
usage/dep error.

## Gates
- shellcheck -S warning: CLEAN (both scripts)
- `bats tests/scripts/{reconcile-pr,check-epic-children-closed}.bats`:
15/15 pass
- `scripts/regen-all.sh --check --skills crank,evolve`: ALL GATES GREEN
- Diff scope-only: 2 scripts + 2 bats + 2 skill pointers + 3 codex hash
files (source_hash bumps). Pre-existing `docs/cli-surface.*` main drift
reverted, not swept in.

Orchestrator helpers (not necessarily CI jobs) — wired as enforcement
for the crank/evolve close discipline.

Closes-scenario: ag-9gac#reconcile-helper-epic-gate
Bounded-context: BC3-Loop
Evidence: scripts/check-epic-children-closed.sh
2026-05-31 17:31:08 -04:00
Bo 915fb4876b feat(skills): encode orchestrator-merge + sequential-chain + stale-guard + worktree-reap + epic-close gate (ag-7gmv #encode-crank-wins) (#668)
## What

Encode the 2026-05-31 bead-crank post-mortem's durable wins (§5 #5-8, §7
#4) into the orchestration skills so the next session doesn't relearn
them.

- **swarm**: coupled-chain rule (two slices that both regenerate a
shared *derived* surface —
`cli-command-surface`/`registry.json`/`context-map`/codex manifest —
collide even with disjoint sources → sequential, each link off the
freshly-MERGED prior link; parallel only for disjoint, cap 4-6) +
worktree-reaping teardown after confirmed MERGED.
- **crank**: coupled-chain clause in wave-validity + new `##
Orchestrator-Merge + Reconcile Loop` section (poll `gh pr checks`; block
only on substantive non-`claude-review` fails; fix-forward transient
reds — tar-cache flake rerun-once, derived drift `make regen-all` —
never revert green; `gh pr merge --squash --admin` when green; `bd
close` only on confirmed `MERGED`; never close a parent epic before
every child PR is confirmed merged).
- **evolve**: Step 0 stale-checkout survey guard (`git fetch && git
status -sb`, `git reset --hard origin/main` on throwaway diverged trees,
ban `git pull --rebase` on the survey path) +
confirmed-MERGED-before-`bd close` gate incl. all-children gate for
epics.

## Scope

3 SKILL.md edits + their codex generated-hash twins + manifest (scoped
`--skills swarm,crank,evolve`, no pre-existing drift sweep).
registry.json/cli-surface reverted (timestamp-only / pre-existing
drift).

## Gates

- `regen-all.sh --check --skills swarm,crank,evolve`: ALL GATES GREEN
- `tests/skills/run-all.sh`: 87/87 PASS, token budgets within limits
- `audit-codex-parity.sh --skill {swarm,crank,evolve}`: all passed

Closes-scenario: ag-7gmv#encode-crank-wins
Bounded-context: BC3-Loop
Evidence: skills/crank/SKILL.md
2026-05-31 16:48:42 -04:00
Bo c80849b92b chore(rules): gosec+semgrep crypto-suppression convention (ag-v7tk #security-lint-suppressions) (#667)
Document the security-lint suppression convention discovered the
expensive way (3 pushes on #646).

## What
Add a `## Security-Lint Suppressions (gosec + semgrep)` section to both
`.claude/rules/go.md` (tight) and `skills/standards/references/go.md`
(full table + example), capturing:

- **gosec** ignores `//nolint:gosec` — use `// #nosec G<NN>` (e.g. `//
#nosec G401 G505`).
- **semgrep** is suppressed only by a **bare** `// nosemgrep`; a
qualified `nosemgrep: <rule-id>` does NOT suppress.
- The comment must sit on **both** the import line and the usage/call
site (flagged independently).
- Canonical example: `cli/internal/drrebuild/drrebuild.go`.

## Derived surfaces
Ran `scripts/regen-all.sh --skills standards` (the #664 scoping) +
scoped `regen-codex-hashes --check --only standards` (PASS). Regenerated
the embedded twin (`cli/embedded/skills/standards/references/go.md`) and
the standards codex hash manifests. The 9 unrelated codex-hash drifts
the no-scope `--check` reports (deps, post-mortem, provenance, red-team,
release, scenario, ship-loop, skill-builder, trace) are pre-existing on
main and out of scope.

Closes-scenario: ag-v7tk#security-lint-suppressions
Bounded-context: BC2-Validation
Evidence: .claude/rules/go.md
2026-05-31 16:38:35 -04:00
Bo d81ebe3e7d feat(skills): blind sub-agent judge in /vibe + /validation (ag-9jle.5 #blind-judge) (#662)
## What

Adds the concrete **blind sub-agent judge** spawn mechanism in `/vibe`
and `/validation`, building on ag-lmdx.4 (#658) which added the
author!=validator refusal contract + `ao turn verify --allow-self`.

Per operator mechanism (Bo 2026-05-30): validation MAY run in the
authoring session, but the JUDGE must be a fresh-context sub-agent
acting as if it has no authoring context. lmdx.4 supplied the
invariant/refusal + the CLI guard; this bead supplies the actual spawn
instruction.

## Changes

- **`skills/vibe/SKILL.md` Step 4.5** — adds the MANDATORY blind
sub-agent judge spawn: when validating in the authoring session, spawn
the acceptance judge via Agent/Task tool, hand it ONLY the diff/artifact
+ acceptance scenarios + verdict contract (never the authoring
conversation), use its verdict, record `judge_id` != `author_id`. Keeps
lmdx.4's refusal + `--allow-self` escape + `ao turn verify` enforcement.
- **`skills/validation/SKILL.md`** — new "Blind Sub-Agent Judge" section
+ **`references/dag.md` STEP 1** guard that refuses to certify
acceptance (`<promise>DONE</promise>`) when `judge_id == author_id`.
- **`vibe.feature` + `validation.feature`** — testable scenarios
matching the bead acceptance (self-validation still gets an independent
judge; missing blind judge is refused).
- **Codex twins** mirrored verbatim (no symlinks); manifest hashes
spliced to vibe+validation only (8 pre-existing codex drifts left
untouched).

## Gates

- `tests/skills/run-all.sh`: PASS (87/0/0)
- `scripts/audit-codex-parity.sh --skill {vibe,validation}`: PASS
- `scripts/check-codex-parity-drift.sh`: PASS
- `scripts/validate-codex-generated-manifest.sh`: OK (81 skills)
- `scripts/check-scenario-test-linkage.sh`: PASS (both .feature files
allowlisted doc-only)
- No Go touched.

Closes-scenario: ag-9jle.5#blind-judge
Bounded-context: BC2-Validation
Evidence: skills/vibe/SKILL.md
2026-05-31 15:55:18 -04:00
Bo 0dcbae450c fix(loop): re-enforce session-PR-scope hooklessly + fix stale hook refs (ag-o5xp #session-pr-scope) (#661)
## Problem

The session-PR-scope guardrail shipped as a PreToolUse hook
(`hooks/session-pr-counter.sh`, PR #362), but **PR #511 (the 3.0
hookless teardown) deleted all hooks**. Six workflow-discipline surfaces
were never updated — they still advertise the hook as a live, shipping
mechanism. That's a **stale active-surface promise + a lost reliability
guardrail** (surfaced by the ag-4hf7 Google-SRE audit:
"explainability/trust" turned inward).

## Hookless re-enforcement (the decision)

- **The mandatory layer already survives**: the `/evolve` post-mortem
checkpoint #6 (council-gated, cannot be bypassed) enforces session-scope
for autonomous loops — the actual failure mode. It only lacked a
canonical count source.
- **New `scripts/session-pr-scope.sh`** — the reusable hookless count +
verdict (`OK`/`WARN`/`BLOCK`), fail-open, robot-friendly
(`--json`/`--count`). It is now:
  - the checkpoint's `$session_pr_count` source, and
- the one-liner an **opt-in** hook wraps (re-author via the
hooks-authoring skill — AgentOps ships none).
- 8 bats cases (thresholds, block-mode exit code, fail-open); shellcheck
clean.

## Stale-doc truth (6 surfaces, all hedged)

CLAUDE.md · AGENTS-WORKFLOW.md · skills/ship-loop/SKILL.md · the evolve
postmortem-checkpoint (skills/, skills-codex/, packs overlay — kept in
parity; codex hashes regenerated for **evolve + ship-loop only**, the 7
pre-existing drifts left untouched).

## Ratchet (knowledge → a constraint)

Extend `check-hookless-cold-start.sh` to cover these workflow-discipline
surfaces — reversing the now-stale CLAUDE.md carve-out — so this exact
drift class **cannot recur**. Gate scope 5 → 10 surfaces; its bats test
stays green. (This is the "knowledge becomes a constraint" invariant the
whole ag-4hf7 thread identified as our edge — applied to the very gap
that thread surfaced.)

## Verification

- `bats tests/scripts/session-pr-scope.bats` → 8/8
- `bash scripts/check-hookless-cold-start.sh` → PASS (10 surfaces)
- `check-hookless-cold-start.bats` → 5/5 ·
`validate-codex-generated-artifacts.sh --scope head` → pass ·
wiring-closure → pass · shellcheck clean · overlay ≡ source

Closes-scenario: ag-o5xp#session-pr-scope
Bounded-context: BC3-Loop
Evidence: scripts/session-pr-scope.sh
2026-05-31 19:51:07 +00:00
Bo 554eb8c306 feat(turn): enforce author!=validator no-self-grading invariant (ag-lmdx.4 #author-validator-guard) (#658)
## What

Enforce the no-self-grading invariant (`ag-lmdx.4`): a Turn graded by
its own author is autocorrelated, so an Evidenced Turn is not done
unless an independent judge context produced the acceptance verdict.

- **`cli/internal/evidencedturn`** — new `author_neq_validator`
predicate + `AuthorID`/`JudgeID`/`AllowSelf` fields on `Input`. The
predicate FAILS when `judge_id == author_id` (self-graded) or when no
judge identity was recorded (independence that was never recorded cannot
be asserted); the documented, default-OFF `--allow-self` waives it for
the inline fallback. This fills the `TODO(ag-lmdx.4)` extension point
the #657 author left.
- **`cli/cmd/ao/turn verify`** — `--allow-self` flag +
`author_id`/`judge_id` on the turn-input file, wired into the DoD
predicate so a self-graded verdict fails the `validated->closed` guard.
- **`/pre-mortem` + `/vibe` SKILL.md** (and `skills-codex` twins) —
refuse a self-graded PASS verdict; require the judge to be a blind,
context-isolated sub-agent (`judge_id != author_id`); document
`--allow-self` as the default-OFF escape and point at `ao turn verify`
as the enforcement predicate.

## Tests (TDD-first)

`evidencedturn`: self-graded refused / independent accepted /
`--allow-self` waives / missing-judge refused. `cmd/ao`: `turn verify`
self-graded exits non-zero, `--allow-self` passes.

## Gates

`go build ./...` + `go vet` + `go test ./...` green (11845 pass). gosec:
0 new findings in touched files. Codex parity audit +
generated-manifest/artifacts validators pass. `tests/skills/run-all.sh`:
87/87. COMMANDS.md regenerated (the one `--allow-self` line); codex
manifest spliced to pre-mortem+vibe only (no drift-sweep).

## Dedup note (ag-9jle.5)

This bead is the **invariant/guard** (data shape + predicate + skill
refusal). The skill text states the blind-sub-agent requirement, but the
actual blind-judge SPAWNING MECHANISM in `/vibe` + `/validation`
(ag-9jle.5) is NOT implemented here. Partial overlap on the skill
contract; the runtime mechanism remains for ag-9jle.5.

Closes-scenario: ag-lmdx.4#author-validator-guard
Bounded-context: BC2-Validation
Evidence: cli/internal/evidencedturn/evidencedturn.go
2026-05-31 15:05:06 -04:00
Bo 03e365bb92 feat(validate): generate+check tests-from-scenarios coverage (ag-9jle.4 #tests-from-scenarios) (#648)
## What

Adds the C2 "tests-from-scenarios" leaf gate (ag-9jle.4): a per-bead,
forward-from-Gherkin scenario→test coverage check, plus wiring into the
leaf validators `/vibe` and `/test`.

`scripts/check-bead-scenario-coverage.sh` parses a bead's `## Scenarios`
block (via `--bead <id>`), a `.feature` file, or stdin, and **FAILS if
any scenario lacks a `@covered-by:<test-path>` link**. With `--run` it
also executes each covering test and requires it to PASS — not merely
exist. This is the distinction the bead calls out: "tests exist" or a
coverage percentage is not sufficient.

This is the **per-slice sibling** of the existing corpus-wide
`scripts/check-scenario-test-linkage.sh` (which sweeps every `.feature`
under `skills/*/references/` in CI). They share the `@covered-by:`
convention so a scenario authored once carries linkage to both. No new
`ao` subcommand (avoids cli-command-surface churn); no symlinks (codex
twins copied).

## Why

Audit ag-9jle.1 found C2 weak: vibe/validate check test-pyramid
*presence*, `test` checks coverage %, review uses a checkbox; only
`/validation` enforced scenario→passing-test mapping and only at the
bypassable roll-up. This makes the check mechanical and moves it to the
leaf (vibe Step 2g.1, test Step 0a), working forward from behavior.

## How it's tested

`tests/scripts/check-bead-scenario-coverage.bats` — 19 hermetic cases:
M>=N gate, bead-body + `.feature` inputs, `--run` pass vs fail, dangling
`@covered-by`, `::Name` resolution, threshold override, `--json`, stdin,
`## Scenarios`-block scoping, misuse exits. The gate is dogfooded: it
passes on its own bead ag-9jle.4 (`--run` executes this very bats file).

## Gates

- `bats tests/scripts/check-bead-scenario-coverage.bats` — 19/19 pass
- `shellcheck scripts/check-bead-scenario-coverage.sh` — clean
- `bash scripts/check-codex-parity-drift.sh` — no drift (codex twins
mirrored)
- `bash tests/skills/run-all.sh` — 87/0 pass

Closes-scenario: ag-9jle.4#tests-from-scenarios
Bounded-context: BC2-Validation
Evidence: scripts/check-bead-scenario-coverage.sh
2026-05-31 13:00:06 -04:00
Bo 7d9b4978e2 feat(skills): discovery+plan emit Gherkin scenarios by default (ag-9jle.2 #scenarios-by-default) (#639)
## What

Makes `/discovery` and `/plan` emit an embedded `## Scenarios`
(Given/When/Then) Gherkin block per bead **by default** — the operator
never hand-specifies BDD. Free-text-only acceptance is a contract
violation; planning promotes it to scenarios automatically before
creating the bead.

Implements `ag-9jle.2`, a child of the BDD-Gherkin-wave core-loop epic
`ag-9jle`.

## Changes

- **`skills/plan/SKILL.md`** — new "Gherkin Scenarios Contract
(mandatory, default)": every bead carries a `## Scenarios` block above
the `acceptance_criteria` YAML; Gherkin is the behavior layer, YAML the
machine-checkable layer (complementary, not substitutes).
- **`skills/discovery/references/dag.md`** STEP 4 + Acceptance Criteria
Contract — every bead `/plan` returns MUST carry `## Scenarios`;
discovery sends free-text-only beads back to `/plan` before compiling
the execution packet.
- **`skills/plan/references/decomposition.md`** — new "Free-text-only
acceptance" anti-pattern (FAIL gate) in the decomposition pre-flight
table.
- **`discovery.feature` + `plan.feature`** — scenarios-by-default
executable specs (documentation-only, allowlisted).
- Mirrored to the **skills-codex** twins (dag.md, SKILL.md,
decomposition.md); regenerated discovery + plan codex hashes (manifest +
per-skill markers).

## Gates

- `tests/skills/run-all.sh` — 87/87 PASS
- `scripts/audit-codex-parity.py --skill discovery --skill plan` —
passed
- `tests/skills/lint-skills.sh` — discovery + plan PASS (81 skills, 0
failed)
- `scripts/validate-codex-generated-artifacts.sh` — passed
- `scripts/check-scenario-test-linkage.sh` — PASS

Diff scope is limited to `skills/{discovery,plan}`, their `skills-codex`
twins, and the codex hash manifest. Pre-existing codex hash drift in 7
unrelated skills was left untouched.

Closes-scenario: ag-9jle.2#scenarios-by-default
Bounded-context: BC3-Loop
Evidence: skills/plan/SKILL.md
2026-05-31 12:35:16 -04:00
Bo d10975314d docs(agent-native): optional SDK PreToolUse/Stop hook adapter reference (ag-50m3 #sdk-adapter) (#620)
## What

**5th and final epic deliverable of ag-7s9fo.** New
`skills/agent-native/references/sdk-hook-adapter.md` — a
clearly-**OPTIONAL** Agent SDK `PreToolUse`/`Stop` adapter (TypeScript +
Python samples) that shells `ao validate --gate` for teams wanting
*in-loop* interception.

The framing is hammered throughout (header + boundaries section):
- **CI (`agent-output-validate.yml`, ag-mptr) is the authoritative
gate.** This adapter is convenience, **not** a dependency, **not** a
hook revival, wired into **no runtime by default**.
- Advisory-only — never hard-block on it; CI is the merge boundary.
- Never inline holdout/eval corpus (Managed Agents are NOT ZDR).

Linked from SKILL.md's existing "Optional: SDK hook adapter" section
(heal --strict ref-linked).

## Acceptance (doc-shaped bead — gates are the verification)

- ✅ Adapter documented as OPTIONAL with explicit "CI is the default, not
this" framing.
- ✅ Shells to `ao validate` / the `standards` checklist.
- ✅ No claim that hooks are required; no always-on hook registered.
- ✅ Example adapter (TS + Py).

## Skill-modification regen (surgical)

Editing the skill shifts its content hash, so: `registry.json`
content-hash + `skills-codex/agent-native` source_hash + the manifest's
agent-native entry. The 6 pre-existing-main codex drifts
(deps/provenance/red-team/release/scenario/trace) were **reverted to
origin/main** (not swept in). Evidence: heal --strict exit 0 ·
codex-artifacts `--scope worktree` PASS · registry-drift PASS · parity
PASS · skill audit WARN(exit 0). Scope-only diff (5 files).

Closes-scenario: ag-50m3#sdk-adapter
Bounded-context: BC5-Runtime
Evidence: skills/agent-native/references/sdk-hook-adapter.md
2026-05-30 02:05:34 -04:00
Bo 03d2aaa8d7 feat(skills): add /agent-native — make out-of-session agents AgentOps-native, hooklessly (ag-2wln #agent-native) (#616)
## What

First child of **ag-7s9fo** (Make Managed/SDK agents AgentOps-native).
Adds the **/agent-native** dual-runtime skill documenting the **hookless
reframe** of the retired "port the ~50 hooks" idea.

An out-of-session Claude (Managed Agent / Agent SDK loop / self-hosted
sandbox) becomes AgentOps-native via three things — **never hooks**:
1. **Bundle AgentOps skills** into the Agent definition (same `skills/`
files, no fork).
2. **Expose the `ao` CLI as a callable tool** (MCP/shell-tool) so the
loop self-bootstraps + self-validates.
3. **Gate outputs through the SAME CI** as interactive work.

Extends `standards` + `converter`. The SDK hooks become an *optional
thin adapter*, never the enforcement boundary. Managed Agents are NOT
ZDR → no holdout/PII in the agent definition.

## How

Built through the hardened scaffold (ag-cw2y → ag-ekyq → ag-j4l1) — all
6 derived surfaces regenerated in one shot (registry, domain-map,
context-map, counts, codex twin+manifest+marker, dispositions
BC5-Runtime, SKILL-TIERS, using-agentops catalog, embedded sync).
Reverted the swept-in pre-existing drift (6 codex hashes + cli-surface)
per the changed-files-scoped triage.

Caught + fixed an `INVALID_AO_CMD` heal finding: `ao standards` isn't a
command — `standards` is a loaded checklist enforced via `ao validate` +
CI (corrected the references).

## Scope note

The skill documents the *intended* `ao agent bundle` / `ao mcp serve` /
`agent-output-validate.yml` surfaces — those are the sibling child beads
(ag-jspr, ag-higd, ag-mptr). This PR is the skill-doc slice only.

## Evidence

- `heal.sh --strict skills/agent-native` → clean
- `audit-codex-parity.sh --skill agent-native` → pass
- `validate-codex-generated-artifacts.sh --scope worktree` → pass
- `generate-{registry,skill-domain-map}.sh --check` → clean;
`check-registry-drift.sh` → no drift

Closes-scenario: ag-2wln#agent-native
Bounded-context: BC5-Runtime
Evidence: skills/agent-native/SKILL.md
2026-05-29 23:28:11 -04:00
Bo 8a4e78f01c docs(evolve): bake fix-and-repush discipline into the /evolve skill (ag-j4l1 #evolve-discipline-references) (#615)
## What

Promotes this session's hard-won fix-and-repush discipline — which lived
only in the **session-only cron prompt** (expires in 7 days) — into the
**durable `/evolve` skill**, so every future autonomous run inherits it.

## How

- **NEW** `skills/evolve/references/new-skill-landing.md` — the **six
derived surfaces** a new/modified skill must regenerate in one shot
(registry.json being the most-missed; it trips `contracts-sync` +
`correctness(ubuntu)` together), with the `regen-all.sh` shortcut and
the manual codex-twin / `SKILL-TIERS.md` steps.
- `gate-hygiene.md` **+2 subsections**: pre-push **diff-scope check**
(catches half-staged commits like #612 + conflict-resolution collateral
deletions like #600) and **pre-existing-vs-mine red triage**
(mkdocs-strict + the 7 codex `.agentops-generated.json` drifts).
- `SKILL.md` links both from Step 4.5 + the References list.

## Dog-fooding

Built one-shot through its own documented discipline: codex twin hash
refreshed for `evolve`, the 7 pre-existing codex drifts reverted,
manifest surgically rebuilt to the `evolve` delta only. No
inventory/count files touched (correct — adds references, not a skill).

## Evidence

- `tests/scripts/evolve-discipline-references.bats` → **4/4** (locks
both reference links + the two new gate-hygiene subsections)
- `heal.sh --strict skills/evolve` → clean
- `validate-codex-generated-artifacts.sh --scope worktree` → pass

(Companion: ag-cw2y wired the skill-builder *scaffold*; ag-ekyq added
the registry surface; this bakes the operator-side *runtime guidance*
into /evolve.)

Closes-scenario: ag-j4l1#evolve-discipline-references
Bounded-context: BC2-Validation
Evidence: skills/evolve/references/new-skill-landing.md
2026-05-29 22:29:31 -04:00
Bo b0a7f4e958 fix(skill-builder): scaffold regenerates registry.json — the 5th one-shot-green surface (ag-ekyq #scaffold-registry-regen) (#614)
## What

skill-builder's `init.sh` new-skill plumbing (ag-cw2y) wired **4 of 5**
derived surfaces — dispositions, narrative counts, codex
override-catalog — but **not** the `registry.json` SKU catalog. A stale
`registry.json` trips `contracts-sync` ("registry.json is stale") AND
`correctness(ubuntu)` ("SKU_CATALOG: DRIFT") together.

This was the **most-missed surface** this session: it cost `/burndown`
#600 a 2nd fix-and-repush (`22a0af2f`) and was a manual
`generate-registry.sh` step for `/eval-outcomes` (#613).

## How

Adds `generate-registry.sh` as plumbing **step 4** in `init.sh`,
positioned **last** (it scans the whole `skills/` tree, so the skeleton
+ the other 3 surfaces must exist on disk first), guarded with a `WARN`
fallback like its siblings. A new skill is now one-shot-green across all
5 surfaces with zero manual regen.

## TDD

`tests/scripts/scaffold-registry-regen.bats` (4/4 green) locks the
wiring + ordering contract: init.sh invokes the canonical generator,
guarded, after the override-catalog step and before the final skeleton
echo. `generate-registry.sh` is not repo-root-injectable (it reads
hooks/types.go/schedule across the tree), so the contract is the
wiring+ordering; the end-to-end behavior was empirically validated this
session running `generate-registry.sh` on the freshly-scaffolded
`/eval-outcomes` (#613, registry included the new skill).

## Scope

Reverted the 7 pre-existing-main codex `.agentops-generated.json` drifts
that `regen-codex-hashes` swept in; surgically rebuilt the manifest to
skill-builder's hash delta only (changing init.sh refreshes
skill-builder's codex twin hash — a real consequence of this diff).

Closes-scenario: ag-ekyq#scaffold-registry-regen
Bounded-context: BC4-Factory
Evidence: tests/scripts/scaffold-registry-regen.bats
2026-05-29 21:50:30 -04:00
Bo 79a4558902 feat(skills): add /eval-outcomes — Outcomes as a holdout-safe projection of the locked eval substrate (ag-hdqu0.8 #eval-outcomes-skill) (#613)
## What

Adds the **/eval-outcomes** dual-runtime skill — the user-facing
documentation wrapper for the already-merged `ao eval outcomes
compile/ingest` capability (the Outcomes epic ag-hdqu0, capability beads
.1/.2/.4/.5/.6/.7/.9 all merged). This is the final ag-hdqu0 child.

eval-outcomes documents Outcomes as a **grading transport** that EXTENDS
`validation` + `ratchet` — a *projection* of the locked eval substrate
(`SCHEMA.md`), never an alternate bar. Holdout `target`/`ground_truth`
never leaves the boundary (Managed Agents are not ZDR).

## How

Built through the ag-cw2y scaffold + the 6-surface new-skill discipline
in one shot:
- `skills/eval-outcomes/SKILL.md` + `skills-codex/eval-outcomes/`
(parity_only twin + prompt.md)
- override catalog + manifest/marker (`register-new-codex-skill.sh`)
- dispositions row (BC2 Validation) + SKILL-TIERS row + using-agentops
catalog
- registry.json SKU catalog + domain-map + context-map + narrative
counts + embedded sync

Reverted pre-existing-main drift swept in by generators (6 unrelated
codex artifact hashes, cli-surface.*) per the changed-files-scoped
triage.

## Evidence

- `audit-codex-parity.sh --skill eval-outcomes` → pass
- `heal.sh --strict skills/eval-outcomes` → clean
- `validate-codex-override-coverage.sh` → 80 skills pass
- `validate-codex-generated-artifacts.sh --scope worktree` → pass
- `generate-{registry,skill-domain-map,context-map}.sh --check` → clean;
`check-registry-drift.sh` → no drift

(Local fast pre-push gate references a missing
`scripts/audit-codex-hooks.sh` — pre-existing gate-infra drift absent on
main, not this PR; CI is the authoritative gate.)

Closes-scenario: ag-hdqu0.8#eval-outcomes-skill
Bounded-context: BC2-Validation
Evidence: skills/eval-outcomes/SKILL.md
2026-05-29 21:35:17 -04:00
Bo 606ae03b84 feat(skills): add /burndown — bounded epic-completion loop (ag-3yl8 #burndown-skill) (#600)
## What
Adds **`/burndown`** — the bounded, finite-end counterpart to open-ended
`/evolve`. Drives a finite target (epic / set of epics / explicit bead
list) to *every in-scope bead merged on main* via bounded `/rpi` cycles,
then **STOPS**.

## Why (the gap it fills)
| Command | Shape |
|---|---|
| `/evolve` | open-ended compounding loop — goes dormant, never
*completes* |
| `/crank` | parallel-**wave** one-shot fan-out |
| `/autodev` | contract layer only (not a loop) |
| **`/burndown`** | **serial, resumable, finite-end drive-to-merge
loop** |

## Per-cycle (idempotent — cron / ScheduleWakeup / in-session)
reconcile one outstanding tick-PR (CI-green→merge, pending→skip,
red→fix) → completion-check (all in-scope merged → DONE/STOP) → pick ONE
in-scope ready bead → drive in a worktree → PR with trailers → loop.
Finite stops: target merged · `--max-cycles=N` · operator
STOP/`--hold-merges` · genuine blocker.

This is the generalized, named form of the cron loop we validated
landing PR #599.

## Dual-runtime + gates
- `skills/burndown/SKILL.md` (canonical) +
`skills-codex/burndown/SKILL.md` (Codex-native).
- `audit-codex-parity.sh --skill burndown` **PASS**; `heal.sh --strict`
**PASS**.
- Skill counts synced 76→77 (SKILL-TIERS, PRODUCT, docs/SKILLS,
docs/ARCHITECTURE, using-agentops catalog); `context-map.md`
regenerated; embedded skills synced; `go build ./...` success.

Closes-scenario: ag-3yl8#burndown-skill
Bounded-context: BC5-Runtime
Evidence: skills/burndown/SKILL.md
2026-05-29 21:06:19 -04:00
Bo 0023aa5acf feat(skills): skill-builder scaffolds codex override-catalog entry (ag-cw2y item 4) (#611)
## What
**ag-cw2y item 4** — the 4th and last new-skill gate that cost
`/burndown` #600 a CI round. A new skill previously tripped
`validate-codex-override-coverage` ("source skill missing from Codex
catalog"). skill-builder now adds the catalog entry automatically.

## How
- **`scripts/append-codex-override-entry.sh`** — idempotent, JSON-aware:
appends a `parity_only` entry
(`name`/`treatment`/`wave=catalog-parity`/`reason`) to
`skills-codex-overrides/catalog.json` if the skill is absent.
`parity_only` is correct for skill-builder's canonical-derived codex
form; author flips to `bespoke` + scaffolds the override dir only if a
Codex-only divergence is needed. Repo-root-injectable.
- **`init.sh`** — calls it in the new-skill plumbing block alongside the
dispositions row (#609/#610) and `--fix-counts` (#610). All three gates
now pre-empted at scaffold time.

## Tests (TDD, red→green)
`tests/scripts/append-codex-override-entry.bats` — appends parity_only /
stays valid JSON / idempotent / no-dup-on-existing. 4/4 green.
shellcheck clean.

## Codex artifact
Refreshed **only skill-builder's** hash (6 unrelated pre-existing `main`
drifts untouched). PR-scope codex validation passes.

## ag-cw2y status after this
Item 1 (#609 check + #610 scaffold) ✅ · Item 2 (#610) ✅ · **Item 4
(here)** ✅ · **Item 3** (codex desc token budget / `ag-vzbt`) is the
only remaining piece. Once item 3 lands, a new skill — and therefore
`ag-hdqu0.8` + `/burndown` #600 — is fully one-shot-green.

Closes-scenario: ag-cw2y#override-catalog-scaffold
Bounded-context: BC4-factory
Evidence: tests/scripts/append-codex-override-entry.bats
2026-05-29 20:03:37 -04:00
Bo 5918fd559f feat(skills): skill-builder scaffolds dispositions row + narrative counts (ag-cw2y items 1-scaffold + 2) (#610)
## What

Completes **ag-cw2y item 1's scaffold-half + item 2**. A
newly-scaffolded skill is now one-shot-green against the two gates that
silently tripped `/burndown` #600:
1. missing `skill-dispositions.yaml` row → `heal.sh` Check 12
(`MISSING_DISPOSITION`, shipped #609)
2. stale `"N checked-in skills"` narrative counts →
`check-registry-drift`

## How
- **`scripts/append-skill-disposition.sh`** — idempotent helper that
appends a dispositions row (valid `BC4 Factory` placeholder + TODO
rationale, so `check-bounded-contexts-drift` passes; author refines
during content fill). Repo-root-injectable → fixture-testable.
- **`init.sh`** — after scaffolding, calls the helper *and* runs
`check-registry-drift.sh --fix-counts` to bump the narrative skill-count
tokens. Both calls are guarded + WARN-on-failure so they never break the
scaffold.

## Discovery (scope-narrowing)
Item 2's **check + `--fix-counts` already existed** and were wired into
both the fast pre-push gate (line 1330) and CI (line 803). The only gap
was that **skill-builder never invoked them** — so the fix is wiring,
not a new check.

## Tests (TDD, red→green)
`tests/scripts/append-skill-disposition.bats` — appends row / valid BC +
TODO / idempotent / no-dup-on-existing. 4/4 green. shellcheck clean.

## Codex artifact
Refreshed **only skill-builder's** source/generated hash (6 unrelated
pre-existing `main` drifts left untouched). PR-scope
`validate-codex-generated-artifacts --scope head` passes.

## ag-cw2y remaining
Item 1 (check #609 + scaffold here) ✅ · Item 2 (here) ✅ · **Item 3**
(codex desc budget / `ag-vzbt`) and **Item 4** (override-catalog
scaffold + `test-codex-override-coverage`) remain — then `ag-hdqu0.8`
and `/burndown` #600 are fully one-shot-green.

Closes-scenario: ag-cw2y#skillbuilder-scaffold-dispositions-counts
Bounded-context: BC4-factory
Evidence: tests/scripts/append-skill-disposition.bats
2026-05-29 19:49:20 -04:00
Bo 3711106671 feat(skills): heal --strict checks skill-dispositions coverage (ag-cw2y item 1) (#609)
## What

First slice of **`ag-cw2y`** (make adding a skill one-shot-green).
Adding `/burndown` (ag-3yl8 #600) cost a CI round because a new
user-invocable skill with **no row in
`docs/contracts/skill-dispositions.yaml`** passed every local check
(`audit-codex-parity --skill`, `heal --strict`, `sync-skill-counts`)
silently — the miss only surfaced in CI.

This adds the local catch: **`heal.sh` Check 12 — dispositions
coverage.** Every user-invocable `skills/<n>` must have a dispositions
row, else `MISSING_DISPOSITION` (exit 1 under `--strict`). Same
internal/non-invocable exemptions as the existing catalog check (Check
10).

## How
- `heal.sh`: new Check 12 (global), plus a `HEAL_REPO_ROOT` env override
so the check is fixture-testable; production still derives `REPO_ROOT`
from script location.
- Verified **no `MISSING_DISPOSITION` on the real repo** — all current
skills are covered, so this is a pure tightening with zero false
positives.

## Tests (TDD, red→green)
`tests/scripts/heal-dispositions.bats` — fixture skill missing a row →
flagged; with a row → clean; `--strict` exits 1 and names the miss. All
3 green.

## Codex artifact note
Editing `skills/heal-skill/` requires a paired
`skills-codex/heal-skill/` update (the source-hash). I refreshed **only
heal-skill's** `.agentops-generated.json` + its manifest entry. The 6
unrelated pre-existing codex-hash drifts on `main`
(deps/trace/scenario/provenance/red-team/release) are **left untouched**
— out of this PR's scope. PR-diff-scoped
`validate-codex-generated-artifacts.sh --scope head` passes.

## Remaining ag-cw2y items (follow-on)
Item 1 (dispositions) is the check half done here. Items 2 (domain-map
narrative counts), 3 (codex desc budget / ag-vzbt), 4 (codex
override-catalog scaffold) + the skill-builder *scaffold* halves remain
— they fully unblock `ag-hdqu0.8` and `/burndown` #600 one-shot-green.

Closes-scenario: ag-cw2y#dispositions-coverage-check
Bounded-context: BC2-validation
Evidence: tests/scripts/heal-dispositions.bats
2026-05-29 19:33:06 -04:00
Bo e4e32a3374 feat(orchestration): dual-runtime OrchestrationPort foundation (ag-nk67 #orchestration-foundation) (#598)
## What

The **dual-runtime OrchestrationPort foundation** — the seam that gates
the
`[EPIC] AgentOps × Claude Managed Agents integration (dual-runtime)`
application epics.
Implements the 3-category model (Claude Workflow / NTM swarm / plain
skill) behind a
single `OrchestrationPort` with safe degradation **NTM → Claude-native →
beads floor**
and a global `AGENTOPS_ORCHESTRATION=off` opt-out.

Derived from a live 3-legged spike (`~/dev/agentops-3cat-spike/`): safe
degradation is
solvable at the selection layer; parallel buys quality/independence not
wall-clock at
small N; NTM is a multi-vendor control plane that runs Claude/Codex as
panes.

## What's in it (10 slices, agent-team driven)

- **Port + adapters** — `cli/internal/ports/orchestration.go` (idiomatic
to existing ports pattern) + new `cli/internal/orchestration/` pkg:
`Selector`, `ntm_probe` (capability detection via `ntm
--robot-capabilities`, not `command -v`), `beads_floor` +
`OrchestrationResult` parity type, degradation-conformance test.
- **Live CLI** — `ao orchestrate select` (`--pin`/`--opt-out`/`--json`);
COMMANDS.md regenerated.
- **Contracts** — `schemas/orchestration-{backend,result}.v1` + paired
`docs/contracts/` docs (structural-floor gated: 41 contracts).
- **Prose** — swarm/shared/crank rewritten NTM>native>beads; **gc
demoted** (soc-2rtm0); `rpi_phased_stream.go` doc-comment fixed.
- **Skills** — `automation-shape-routing` (the 3-category router) +
`workflow-builder` + meta-skill authoring chain wired (`context_rel`);
skill counts synced.
- `lib/orchestrate-select.sh` selector seam.

## Verification (local)

`go build ./...` clean · `go vet` clean · **56 Go tests pass**
(orchestration 31, ports 10, cmd/ao orchestrate 15) · structural-floor
PASS (41) · `lib/orchestrate-select.sh --self-test` 6/6 · live command:
`--json`→claude (NTM absent), `--opt-out`→beads, `--pin claude`→claude.

## Notes

- Bundles the foundation + the routing/authoring skills as one coherent
dual-runtime arc.
- NTM/Claude executors are stubs (the parity contract is real); concrete
executors land in the application epics this gates.
- Two-ladders distinction preserved (spawn-backend ladder A vs CLI
phase-executor ladder B) — see `docs/contracts/orchestration-ports.md`.

Closes-scenario: ag-nk67#orchestration-foundation
Bounded-context: BC5-Runtime
Evidence: cli/internal/orchestration/conformance_test.go
2026-05-29 18:42:45 +00:00
Bo de0699a493 feat(skills): operating-loop-workflow skill ships the workflow to plugin users (agentops-7m7a #plugin-deliver-operating-loop) (#595)
## What
Adds a `operating-loop-workflow` skill that delivers the
`operating-loop` Workflow-tool script to **installed plugin users** and
invokes it.

## Why
Claude Code plugins do **not** load `.claude/workflows/*.js` (recognized
components are `skills/`, `commands/`, `agents/`, `hooks/`, …). PR #594
force-added the script so it *ships in the plugin cache*, but an
installed user still wouldn't see `/operating-loop`. This skill is the
delivery vehicle.

## How
On `/operating-loop-workflow`, the skill:
1. Idempotently copies
`${CLAUDE_PLUGIN_ROOT}/.claude/workflows/operating-loop.js` →
`~/.claude/workflows/operating-loop.js` (copy-if-newer; never clobbers
user edits).
2. Invokes `Workflow({name:'operating-loop', args})` (supports
`{mode:'plan'}` for the plan-only half).

Named `operating-loop-workflow` (not `operating-loop`) to avoid
colliding with the workflow's own auto-surfaced `/operating-loop` in the
dev repo.

## Registries updated
- `skills/SKILL-TIERS.md` row + `sync-skill-counts.sh` (→ 76 total, 66
user-facing)
- `docs/contracts/skill-dispositions.yaml` + regenerated
`docs/reference/agentops-skill-domain-map.md` (76/76)
- `docs/contracts/context-map.md`,
`docs/reference/agentops-domain-evolution-bdd.md` count

## Validation
- `scripts/pre-push-gate.sh --fast` passed (registry-drift,
skill-domain-map golden gate, domain-evolution plan all green)
- `generate-skill-domain-map.sh`: 76 skills, 76 dispositions, clean

Closes-scenario: agentops-7m7a#plugin-deliver-operating-loop
Bounded-context: BC3-Loop
Evidence: docs/reference/agentops-skill-domain-map.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-05-29 02:30:09 +00:00
Bo 450f06f62f docs(skills): autodev reads as config not loop (soc-ozoqh #autodev-config) (#572)
## Summary

Reposition the `/autodev` skill so it reads as **config, not a loop**,
per the canonical vocabulary rule
`skills/domain/references/autodev.md:9,13` — autodev is the
config/intent layer the loop reads each tick, and its description must
never lead with "bounded autonomous dev loops".

- `skills/autodev/SKILL.md`: new `description:` leads with managing the
PROGRAM.md/AUTODEV.md contract and names autodev as the config layer
Evolve and Factory read; "Loop position" prose reframed so the drivers
run the loop, autodev does not.
- `skills-codex/autodev/SKILL.md`: codex mirror description synced.
- Regenerated derived artifacts: `skills/catalog.json`, `registry.json`,
`docs/contracts/context-map.md`, codex hash manifest/marker (autodev
only).
- No command logic changes. Scenario 2 (factory-noun de-collision)
re-sliced to `ag-0qz` (premise drifted — no `ao factory` command
exists).

## Test plan

- [x] `bats tests/scripts/autodev-skill-positioning.bats` (new gate, 6/6
— pins the description + body + derived catalogs + codex mirror to the
config-not-loop rule; written failing-first)
- [x] `scripts/validate-codex-generated-artifacts.sh --scope head`
(parity + manifest)
- [x] `scripts/validate-context-map-drift.sh`,
`scripts/check-skill-catalog-drift.sh`,
`scripts/check-registry-drift.sh`
- [x] `skills/heal-skill/scripts/heal.sh --strict` (autodev clean)

Closes-scenario: soc-ozoqh#autodev-reads-as-config-not-loop
Bounded-context: BC1-Corpus
Evidence: bats tests/scripts/autodev-skill-positioning.bats;
skills/domain/references/autodev.md:13
2026-05-28 06:34:13 -04:00
Bo b39feb843d docs(corpus): cold-start orientation coherence after hook removal (soc-qh2g1 #hookless-cold-start) (#566)
## Summary

Hookless AgentOps 3.0 ships no SessionStart/Stop hooks, but several
cold-start surfaces still named hook scripts as live context-injectors —
misleading a fresh agent into expecting auto-injection. This is a pure
doc/skill reconciliation pass (BC1 Corpus); **no command logic
changed**.

- **Scenario 1 (orientation reachable without a hook):** `CLAUDE.md` +
`AGENTS.md` Zero-Context startup now name the explicit orientation
command — `ao session bootstrap` → `ao inject` / `ao corpus inject
--query "<topic>"`. `AGENTS.md` drops the stale "when soc-vuu6.25 lands
/ until then" hedge: bootstrap shipped in PR #390 (soc-vuu6.25 is
closed).
- **Scenario 2 (no doc/skill promises hook-provided context):**
`docs/architecture/primitive-chains.md` Chain 6,
`skills/session-bootstrap/SKILL.md` (+ codex twin), and
`docs/newcomer-guide.md` no longer present hook scripts as active
surfaces; remaining hook mentions are reframed opt-in (author via the
`hooks-authoring` skill). New `scripts/check-hookless-cold-start.sh` +
bats lock the regression.
- **Scenario 3 (each removed hook accounted for):** a disposition table
in `primitive-chains.md` maps each removed hook *behavior* (context
injection, end-of-session curation, standards surfacing, validation
reminders) → an explicit replacement or "confirmed noise".

## Design notes

- The new gate rides the existing `bats tests/scripts/*.bats` CI lane
(no new `validate.yml` job, per plan). It scans a **fixed** list of
cold-start surfaces and flags any `hooks/<name>.sh` path presented
without an opt-in/historical hedge — deliberately *not* a broad
`docs/`+`skills/` grep (release notes / `hooks-authoring` / scope guards
legitimately name hook paths).
- `CLAUDE.md` is **hand-maintained**: `build-claude.py` is vestigial
(its `--check` reports STALE on clean `main` and it's absent from CI),
so `CLAUDE.md` was edited directly rather than regenerated — running the
generator would have clobbered it.
- Scenario-3's disposition was folded into the `primitive-chains.md`
Chain 6 reframe rather than a new doc (co-located, no catalogue-gate or
mkdocs-nav churn).
- Scope held tight: broader hook-taxonomy drift in `primitive-chains.md`
(Terminology Ledger / Audit Snapshot "7 hook event sections") and the
out-of-scope `CLAUDE.md:145` `session-pr-counter.sh`
(workflow-discipline, soc-waxr) are left for follow-up beads.

## Test plan

- [x] `bash scripts/check-hookless-cold-start.sh` → PASS (5 surfaces)
- [x] `bats tests/scripts/check-hookless-cold-start.bats` → 5/5
- [x] `shellcheck scripts/check-hookless-cold-start.sh` → clean
- [x] `bash scripts/audit-codex-parity.sh --skill session-bootstrap` →
passed
- [x] `bash skills/heal-skill/scripts/heal.sh --strict` → clean
- [x] `cd cli && make sync-hooks` → no embedded drift
- [x] `bash scripts/validate-agents-split.sh` → PASS (99 lines)
- [x] `markdownlint --config .markdownlint.json` on changed files →
clean
- [x] No Go changes (build/test unaffected)

Closes-scenario: soc-qh2g1#hookless-cold-start
Bounded-context: BC1-Corpus
Evidence: bash scripts/check-hookless-cold-start.sh; bats
tests/scripts/check-hookless-cold-start.bats
2026-05-28 02:39:04 -04:00
Bo 3a829779c6 fix(ci): restore validate parity gates
Restore CI policy parity generation and related skill/registry drift so Validate can run green on main.
2026-05-26 11:41:38 -04:00
Bo ff6f8569c7 feat(release): tiered release-notes + coverage gate — end the release churn (ag-nc9) (#544)
Makes release-notes scope mechanical per tier so a release can never
again under-scope its notes and burn the re-mining churn (root cause of
the v3.0.x rewrites).

- **Scope rule + tiers** in the standard (+ codex twin): notes = git
range since the previous release (a major = the whole major), with a
major/minor/hotfix table.
- **Coverage gate** in validate-release-notes.sh: maps the diff to
product areas, FAILS if a heavily-touched area (>=3 files) is
undocumented. Wired into release.yml via --since. It immediately caught
a real gap (v3.0.1 missing the Codex area — fixed here).
- **scaffold-release-notes.sh**: mines the range into a tier-correct
draft so notes start comprehensive.
- 6 new bats (14 total), shellcheck clean, codex parity green. v3.0.1
notes verified to PASS coverage over the real v2.41.1..v3.0.1 diff.

Closes-scenario: ag-nc9#tiers-coverage-gate
Bounded-context: BC5-Runtime
Evidence: scripts/validate-release-notes.sh
2026-05-25 11:23:43 -04:00
Bo 7d0d90fbd3 feat(release): enforce release-notes standard + major variant (ag-d0f) (#541)
Fixes two compounding misses on the v3.0.x release notes and makes the
failure mechanically impossible.

**Root cause:** extract-release-notes.sh silently fell back to dumping
the raw CHANGELOG when no curated docs/releases/*-notes.md existed — so
3.0.0/3.0.1 shipped raw dumps, and the curated notes I then wrote did
not follow skills/release/references/release-notes.md (invented
headings, bold-lead-in bullets instead of action labels). The template
also had no major-release variant.

**Standard (template + codex twin):** add a major-release (X.0.0)
variant — required ## Breaking Changes section + migration link;
document the hard gate.

**Conform:** rewrite both 3.0.x curated notes to the standard (major
shape for 3.0.0 w/ Breaking Changes + canonical taxonomy + action
labels; patch shape for 3.0.1).

**Enforce:** scripts/validate-release-notes.sh (existence + sections +
taxonomy + action labels + Breaking-Changes-for-major) + 8 bats cases;
wired as a hard gate in release.yml before notes extraction;
extract-release-notes.sh now fails instead of silently dumping raw
CHANGELOG.

Local: both notes PASS the validator, 8/8 bats, shellcheck clean, codex
parity passes.

Closes-scenario: ag-d0f#release-notes-standard
Bounded-context: BC5-Runtime
Evidence: scripts/validate-release-notes.sh
2026-05-25 09:14:58 -04:00