Commit Graph

238 Commits

Author SHA1 Message Date
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 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 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 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 3d99d4bf69 fix(corpus): unify secret redaction + compile/CI git-safety (ag-sz3h ag-zi90 ag-y2xy #w1-git-safety) (#720)
Completes the **W1 git-safety arc** of epic ag-lhu0 (memory-system
re-architecture) — three beads, one coherent surface, after #719 wired
scrub-on-write into corpus_fs.

- **ag-zi90 (dedup):** `redactContent` (`ao context assemble`) now runs
canonical `llm.Redact` first — a single source of truth for credential
patterns (AWS / GitHub / GitLab / Slack / GCP / PEM, previously
uncovered in this path) — then keeps the supplements `llm.Redact` does
*not* cover: 2-segment app JWTs, sensitive env-var assignments,
high-entropy strings.
- **ag-sz3h (compile chokepoint):** new `ao redact` (stdin→stdout
canonical scrub) bridges the shell compile path; `compile.sh` pipes
every rendered article through it before `os.WriteFile` (loud fallback
if `ao` absent).
- **ag-y2xy (CI backstop):** `check-corpus-secret-scan.sh` scans
**git-tracked** (committed/allowlisted) `.agents` corpus + canon only —
repo-root `.agents` is local-only by policy, so scrub-on-write (#719 +
`ao redact`) is the primary defense and this is the backstop. Wired into
`validate.yml`; bats covers clean / leak-with-file:line /
untracked-not-scanned.

Scrub-on-write is primary; CI is the backstop. Verified: go
build/vet/test (incl. `TestRunRedact`, JWT-dedup regression test green),
bats 3/3, shellcheck clean, conformance regenerated.

Closes-scenario: ag-sz3h#compile-render-scrub
Closes-scenario: ag-zi90#dedup-redactor
Closes-scenario: ag-y2xy#ci-secret-scan
Bounded-context: BC1-Corpus
Evidence: scripts/check-corpus-secret-scan.sh

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-06-04 14:11:55 -04: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 d9c9321c97 ci: remove claude-review workflow + merge gate (ag-7x7u #remove-claude-gate) (#694)
Removes the claude-review merge gate per operator decision (2026-06-02).

## Why
The Cursor agent (bot author) pushing to PR branches made the required
`claude-review` check abort on *non-human actor: cursor*, deadlocking
merges (blocked #692 ~2h, churned #693). Cursor Bugbot already provides
review.

## What
- Removed `claude-review` from main branch-protection required checks
(now `[summary]`) — done via API.
- Deletes `.github/workflows/claude-code-review.yml` so the failing
check stops appearing entirely.

Supersedes the earlier allowed_bots:cursor approach on this branch.

Closes-scenario: ag-7x7u#remove-claude-gate
Bounded-context: BC2-Validation
Evidence: .github/workflows/claude-code-review.yml
2026-06-02 23:43:15 +00: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 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 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 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 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 4107bbed1c refactor(ci): rebuild validate.yml — 67 jobs → 10 purpose-grouped (ag-877 #gate-rebuild) (#592)
## What

First-principles rebuild of `.github/workflows/validate.yml` (ag-877 /
epic ag-5ck, no strangler). Collapses the **67-job** orchestration into
**9 purpose-grouped jobs** (+ `changes` + `summary` = 12 total). All
**59** `scripts/{check,validate}-*` are preserved verbatim — the checks
are the safety logic; the 67-way job fan-out was accretion slop.

Design: `spec/teardown-2026-05-28/gate-rebuild-first-principles.md`

## How

Each purpose job runs its script family as **path-gated steps**
(per-step `if: needs.changes.outputs.X`), with advisory checks marked
`continue-on-error: true` at the **step** level (no whole-job
non-blocking). Notable structural moves:

- **correctness** = matrix `[ubuntu, windows]` — folds `windows-smoke`
in as a Windows leg (it runs `tests/windows/*.ps1`, no `scripts/`
family) instead of a standalone job.
- **doctrine-proof** = the doctrine/GOALS proofs **+ spec-linkage**
(executable-spec link, scenario↔test linkage, AGENTS split,
docs↔learning) — both prove the GOALS/spec apparatus is consistent and
share the Go+ao+Python setup (10→9).
- **summary** absorbs **AP#7** Evidence verification (was
`validate-pr-evidence-claims`) — it needs every sibling job's logs, so
it must run last, not in a parallel group.

## Acceptance (ag-877)

- **ac-gr.1 coverage-proof empty** — `comm -23` of old-vs-new
`scripts/*` invocations is empty (no script dropped). ✅
- **ac-gr.2 job count ≤12** — `grep -cE '^  [a-z][a-z0-9-]+:$'` = 12. ✅
- **ac-gr.3 self-CI green** — this PR runs the new `validate.yml`
against itself (changes `.github/**` → all paths trigger). ⏳ this run.

Coupled job-name contract projections updated in lockstep:
`docs/contracts/ci-jobs.yaml` manifest (64→9), regenerated
`AGENTS-CI.md` table + `registry.json` (gate SKUs 66→11; skills/cli/ref
untouched), and 3 structural bats tests re-anchored to the grouped jobs.
Local: `validate-ci-policy-parity`, `registry-check`,
`validate-sku-catalog-drift`, `check-wiring-closure` all PASS; full bats
suite **740 tests, 0 failures**.

## ⚠️ Operator-gated cutover (do NOT auto-merge)

Branch protection still lists the **64 old** required-check names. This
PR **cannot auto-merge** until an admin swaps them for the new ~10
(**ag-7hpl**), then verifies a no-op PR is gated by exactly the new set
(**ag-1eqi**). Both are repo-admin, repo-wide blast radius →
operator-coordinated.

Closes-scenario: ag-877#uniform-gates-consolidated
Closes-scenario: ag-877#heterogeneous-setup-ported
Closes-scenario: ag-877#changes-preserved-summary-rewired
Closes-scenario: ag-877#coverage-proof-empty-ci-green
Bounded-context: BC2-Validation
Evidence: CI_JOBS_TABLE: PASS
2026-05-29 00:16:47 -04:00
Bo b4c6aec361 feat(skills)!: 3.0 consolidation — merge 4, cut 2, resolve 6 keep-flags (81→75) (#533)
## AgentOps 3.0 skill consolidation — reconcile-and-tighten

Resolves all 12 skills flagged `merge-review`/`cut-review` in
`docs/contracts/skill-dispositions.yaml` per the operator-approved
dispositions. **Zero capability loss** — every merged skill's content
lives in its target as a mode/section.

### MERGE (4) — content folded into target, source removed
| Source | Target | How |
|---|---|---|
| expert-council | council | `--mode=debate` (alias triggers documented
in council) |
| oss-docs | doc | `--mode=oss` (refs + `audit-oss-docs.sh` copied into
`doc/`) |
| readme | doc | `--mode=readme` (`readme-craft.md`; `bootstrap`
consumer repointed readme→doc) |
| pr-retro | post-mortem | `--scope=pr` (`pr-scope.md` + gh PR-outcome
mining) |

### CUT (2) — genuinely redundant, no live consumer
- **pr-plan** — folds into `/plan` + `/pr-research`; pr-* chain
repointed.
- **update** — install-script concern; refresh note added to
`using-agentops` + install one-liner.

### KEEP — resolved 6 flags (rationale in `skill-dispositions.yaml`)
`validate` + `curate` (designed-future canonical validator/miner; epic
`soc-cp7pv` GO/REVERT is a separate decision) · `security` (release-gate
driver, distinct from security-suite) · `converter` (packaging adapter
skill-builder consumes) · `knowledge-activation` (outer-loop
operationalization) · `grafana-platform-dashboard` (marketplace
specialization).

### Result
**81 → 75 skills** (65 user-facing + 10 internal). Trunk regenerated
once: skill-counts, skill-catalog, skill-domain-map, context-map,
registry, sku-catalog, codex hashes, embedded-sync. Evals repointed to
absorbed locations.

### Gates verified locally (all green)
lint-skills · heal.sh --strict · skill-schema · skill-frontmatter ·
skill-dependency-check · scenario-test-linkage ·
validate-context-map-drift · check-registry-drift · generate-registry
--check · skill-domain-map golden · validate-sku-catalog-drift ·
bounded-contexts-drift · ci-policy-parity · codex
parity/override-coverage/manifest/generated-artifacts/skill-parity/runtime-sections/backbone/lifecycle
· regen-codex-hashes --check · embedded-sync · validate-skill-count ·
markdownlint · shellcheck (--severity=error) · `cd cli && go build && go
vet && go test ./cmd/ao` (9126 passed).

Closes-scenario: ag-cons#consolidation
Bounded-context: BC1-Corpus
Evidence: .agents/discovery/2026-05-24-skill-consolidation-plan.md
2026-05-24 23:17:27 -04:00
Bo ad69fec1d7 feat(skills): using-gc agent guide + complete tool-dependency declaration (ag-p4p) (#523)
## What

Builds the GC on-ramp for AgentOps 3.0: a `using-gc` skill that guides
agents on the `gc` (Gas City) CLI exactly like the `bd` protocol guides
them, plus a complete, accurate tool-dependency declaration. **Additive
— no existing behavior changed.**

THE MODEL (operator): "use gc like we use bd" — skills GUIDE agents on
the gc workflow; `ao` does NOT wrap gc. gc is a guided out-of-session
dependency, same as bd.

## Changes

1. **New skill `skills/using-gc/`** — agent-facing guide to running
AgentOps on Gas City, mirroring the bd-protocol style. Covers the gc
primitives (City/`city.toml`, Rig, Pack, Agent, Order, Formula, mayor +
refinery), the end-to-end workflow (`gc start` → `gc rig add` → the
mayor-driven dispatch loop: `bd ready` → `gc sling <rig>/refinery
<bead>` → worker runs `ao rpi <bead>`), cron `exec` Orders for
maintenance (`ao compile`/`ao maturity`), and is HONEST about the
order-auto-dispatch gap (no per-fire var-binding → dispatch is
mayor-driven today; order-auto-dispatch is an upstream-GC item,
soc-5jwah). References the real pack at `packs/agentops/` and
`docs/3.0.md`. Two reference docs + a `.feature` (linked +
`@covered-by:` a new bats test).

2. **Complete dependency declaration** — derived from `ao doctor` tool
checks (`ao`, `awk`, `bash`, `bd`, `cass`, `gc`, `git`, `tmux`) +
`scripts/install*.sh` + the shared fallback table. Classified REQUIRED
(ao, git, runtime), TRACKING (bd + Dolt), ORCHESTRATION (gc,
out-of-session), PR/CI (gh), BUILD-FROM-SOURCE (go), UTILITIES (jq, rg,
curl, openssl, sha256sum, tmux, cass). Landed in: `docs/dependencies.md`
(canonical detail, catalogued in documentation-index), a README
"Requirements" section (summary), and the expanded
`skills/shared/SKILL.md` fallback table (now includes gc, gh, go, jq,
rg).

3. **Fixed stale `using-agentops/SKILL.md:212`** — the runtime-mode `gc`
row described the DELETED `runtime=gc` auto-executor ("ao rpi
auto-selects gc executor", "gc event bus"). Reframed to the mayor-driven
reference City: gc dispatches whole `ao rpi`/`ao evolve` loops; there is
no in-CLI `runtime=gc` mode.

4. **Brief gc pointer** in repo `CLAUDE.md` + `AGENTS.md` near the bd
section, pointing to the using-gc skill (no skill content duplicated).

## Gates (all green locally)

- `sync-skill-counts.sh`: 80→81 total, 9→10 internal — PASS, verified
consistent.
- `validate-context-map-drift`: regenerated
docs/contracts/context-map.md — matches.
- Codex twin `skills-codex/using-gc/` created (`$skill` notation, no
Claude primitives); registered across the 4 catalog surfaces;
`regen-codex-hashes.sh` clean; `audit-codex-parity` PASS; 81 codex
artifacts.
- `generate-registry.sh` (81 skills) — up to date.
- skill-domain-map disposition added (BC5 Runtime) + regenerated golden
— matches; registry-drift narrative counts fixed (80→81).
- plugin-load-test (no symlinks — references copied), skill-schema
(81/81), skill-frontmatter (81/81), skill-dependency-check, heal.sh
--strict (clean), scenario-test-linkage (PASS, new .feature linked via
bats), markdownlint (0 errors), doc-release-gate (PASS).
- New bats test `tests/scripts/using-gc-skill.bats` (5/5).
- Codex description aggregate budget bumped 2700→2800 (catalog grew to
81; same precedent as the 2600→2700 bump when expert-council landed).
- `cd cli && go build && go vet && go test ./cmd/ao/` green (embedded
using-agentops copy synced via `make sync-hooks`).

Closes-scenario: ag-p4p#gc-onramp
Bounded-context: BC5-Runtime
Evidence: skills/using-gc/SKILL.md
2026-05-24 19:39:54 -04:00
Bo e431339c40 feat(hookless)!: remove all hooks — skills + CLI only (soc-57b7f #remove-all-hooks) (#511)
## What

AgentOps 3.0 goes **fully hookless**. This removes the entire hook
product surface — the product is now skills + the `ao` CLI with **zero
hooks**. CI is the authoritative gate.

## Deleted

- `hooks/` — 46 hook scripts + `hooks.json` + examples (whole directory)
- `cli/embedded/hooks/` + embedded `hooks.json` +
`embedded/lib/hook-helpers.sh`
- `lib/hook-helpers.sh`
- `ao hooks` CLI command: `cli/cmd/ao/hooks.go`, `hooks_run.go` + 5 hook
test files; `cli/internal/bridge/hooks.go`;
`cli/internal/doctor/fix_hooks.go` + test
- Codex hook manifest (`hooks/codex-hooks.json`) + handler/audit scripts
(`scripts/audit-codex-hooks.sh`, `install-dev-hooks.sh`,
`test-hooks-output.sh`, `test-codex-hookless-lifecycle.sh`,
`test-hookless-rpi-phased.sh`)
- Hook lease surface: `docs/contracts/hook-lease-*`,
`schemas/hook-lease.v1.schema.json`,
`scripts/check-hook-lease-inventory.sh`,
`check-hook-port-replacements.sh`, `generate-hook-lease-inventory.py`
- Hook docs: `docs/HOOKS.md`, `cli/docs/HOOKS.md`,
`docs/architecture/hook-noise-audit.md`,
`docs/contracts/hook-runtime-contract.md`
- `tests/hooks/` (whole dir) + hook test scripts; 5 hook eval suites +
fixtures

## CI gates removed

`hook-preflight`, `validate-hooks-doc-parity`, `hook-output-schema-lint`
(+ scripts/bats), the hook eval suites, the `test-runtime-codex-smoke` /
`test-codex-native-install` / `test-codex-plugin-install` hook-handler
assertions, the cli-integration hook-lifecycle steps, the bats
`tests/hooks/*` glob + orphan-hooks audit, and the `--with-hooks`
install path. `embedded-sync` now validates only lib/skills. Both
summary `needs:` lists + the summary echo +
`docs/contracts/ci-jobs.yaml` updated; `validate-ci-policy-parity`
passes (66 rows). `.codex-plugin/plugin.json` drops the "Hooks"
capability.

## Load-bearing PRESERVED (reported, not forced)

- **`cli/cmd/ao/codex_runtime.go`** — the codex runtime *lifecycle
profile* (`HookCapable`/`HookConfigured` detection) is a
runtime-capability abstraction used by 6 `validate-codex-*` CI gates,
distinct from the hook product. Deleting it is a separate refactor.
- **`hooks-authoring` skill** + `schemas/hooks-manifest.v1.schema.json`
— reframed as an opt-in "author your own hooks" guide. Deleting the
skill cascades into catalog/domain-map/dispositions/context-map golden
files (skill-count sync), out of scope for the hook-product removal.
- **`scripts/pre-push-gate.sh`** — retired local gate (not in CI);
self-skips deleted hook scripts via `[[ -x ]]` guards; its 55 bats tests
still pass.
- Domain-enforcement audit keeps the `enforced`-mode schema for
backward-compatible JSON readers, but the hookless resolver only returns
`audited`/`unavailable`.

## Verification

`go build` / `go vet` clean; `go test ./...` = **11849 passed, 0
failed** (68 pkgs). gofmt clean on all touched files. Green: registry
`--check` (0 hooks), `regen-codex-hashes --check`,
`validate-ci-policy-parity`, `check-wiring-closure`,
`validate-embedded-sync`, `validate-manifests`, `validate-agents-split`,
`doc-release` (0 broken links), `generate-cli-reference --check`,
`heal.sh --strict`, codex/claude/plugin smoke tests, baseline-audit (0
stale). Diff: 231 files, +354 / −39803.

Closes-scenario: soc-57b7f#remove-all-hooks
Bounded-context: BC5-Runtime
Evidence: .github/workflows/validate.yml
2026-05-24 11:19:37 -04:00
Bo c1a46cee26 chore: scrub all jsm references — external ref only, patterns kept (soc-wnic7 #scrub-jsm) (#501)
## What

Operator directive (soc-wnic7): scrub ALL references to "jsm" from
AgentOps. jsm was only an external reference corpus we learned patterns
from. The absorbed **patterns stay** (skill-quality rubric, SELF-TEST
shape, system-tuning methodology, bug-hunt patterns, attribution
patterns, marketplace-export profile) — only the jsm **name**,
jsm-dedicated docs, and jsm export tooling are removed.

## Deleted (8 files)

- `docs/reference/jsm-agentops-gap-audit.md`
- `docs/reference/jsm-clean-room-extraction-policy.md`
- `docs/reference/jsm-cli-capability-map.md`
- `docs/reference/jsm-pilot-upgrade-backlog.md`
- `docs/reference/jsm-skill-absorption.md`
- `docs/reference/jsm-skill-standards.md`
- `scripts/check-jsm-export.sh`
- `scripts/inventory-jsm-skills.sh`

## Renamed (kept methodology, stripped jsm)

`skills/standards/references/jsm-attribution.md` →
`external-source-attribution.md` (+ skills-codex + cli/embedded
mirrors). The attribution methodology (Pattern A/B, choice rule, mkdocs
constraint, clean-room hygiene) is a kept pattern — renamed and de-named
rather than deleted, so the standards skill keeps a repoint target.

## Edited

- De-catalogued the 6 deleted docs from `docs/documentation-index.md`
and `docs/reference/index.md`; de-named the kept skill-quality-rubric
entries.
- Genericized every footer/credit per the scope rule:
- `Adapted from jsm / \`x\`` → `Adapted from an external skill corpus /
\`x\``
- `(jsm/ACFS skill corpus)` → `(ACFS skill corpus)` — **ACFS/gstack
credits left intact**
- jsm-only credits (system-tuning, hooks-authoring) → "external skill
corpus", keeping the methodology-only/no-verbatim hygiene clause
- Genericized: "JSM-Style/Marketplace Export Profile", hexagonal-map
adapter node, domain-evolution BDD/plan gherkin steps, CHANGELOG
entries, skill-auditor validation-terms tuple.
- Removed dead `check-jsm-export` blocks from 4 SELF-TEST.md files.

## Regen + gates (all green)

`make sync-hooks` · `regen-codex-hashes.sh` · `generate-registry.sh`
re-run. Verified: `grep -ri jsm` empty (per exclusions);
`regen-codex-hashes --check` OK; `generate-registry --check` OK;
`validate-embedded-sync` in sync; `validate-context-map-drift` OK;
`check-docs-learning-references` PASS; `heal.sh --strict` clean;
`audit-codex-parity` PASS; `go build ./...` OK; no dangling punctuation;
no broken links to deleted files.

Closes-scenario: soc-wnic7#scrub-jsm
Bounded-context: BC1-Corpus
Evidence: docs/documentation-index.md
2026-05-23 22:41:56 -04:00
Bo 9b18056637 chore(embedded): remove 5 stale deleted-hook copies from cli/embedded/hooks (soc-o4x5x #rm-stale-embedded) (#498)
S1 deleted 5 noise hooks but `make sync-hooks` copies-without-deleting +
validate-embedded-sync.sh is one-directional, so the embedded `ao`
binary still shipped them. `git rm` the 5 (research-loop-detector,
context-monitor, write-time-quality, edit-knowledge-surface,
go-vet-post-edit). Embedded now matches source (46=46), embedded-sync
green, go build green, -518 LOC.

NOTE: claude-review infra-red (weekly limit) — operator-authorized
bypass when sole red.

Closes-scenario: soc-o4x5x#rm-stale-embedded
Bounded-context: BC5-Runtime
Evidence: cli/embedded/hooks/
2026-05-23 22:01:14 -04:00
Bo 211f04cfbe chore(hooks): delete commit-review-gate — hookless S3 (soc-vpmzg #rm-commit-review-gate) (#494)
## Summary

Deletes `commit-review-gate` — a value-negative noise-injector. Despite
its name it never blocked: it always exited 0 and injected the staged
diff + a "SELF-REVIEW" prompt on every `git commit` (A/B showed Δ=0).
Hookless S3 of the go-hookless epic (`soc-e2ju0`).

The "+7 conditional injectors" the original audit grouped with it were
reclassified as kept-gates (they speak only on a real violation) — **out
of scope, not deleted**. S3 removes only `commit-review-gate`.

## Changes

- **Hook scripts:** `git rm` of `hooks/commit-review-gate.sh` +
`cli/embedded/hooks/commit-review-gate.sh`
- **Go runtime:** removed `runCommitReviewHook` managed-backend + its
exclusive helpers (`gitOutput`, `countDiffFiles`, `hookCountLines`,
`firstLines`, `redactSensitiveDiff` + credential regexes) and the
now-dead `TestHooksRunRedactsSensitiveDiff` test
- **Manifests:** pruned from `hooks/hooks.json`,
`hooks/codex-hooks.json`, `registry.json`,
`hook-lease-classification.v1.json` (lease-inventory regenerated)
- **Codex handler count 15 → 14:** assertions in
`test-runtime-codex-smoke.sh` + `test-codex-native-install.sh`, plus
require-handler arrays in `install-codex-plugin.sh` /
`install-codex.ps1` / `test-codex-native-install.sh` /
`audit-codex-hooks.sh`
- **Test blocks:** removed commit-review @test blocks from
`test-hooks.bats`/`.sh`, `hook-output-schema.bats`,
`hook-stdin-contracts.bats`, the eval fixture, and
manifest-runtime-contracts
- **Docs:** `HOOKS.md`, `software-factory.md`, `how-it-works.md`,
`update-principles.md`, `SDK-INVENTORY.md`; `hook-noise-audit.md`
records the S3 deletion (46 hooks remaining)
- **Drive-by:** fixed pre-existing stale `length == 20` assertions in
`test-audit-codex-hooks.sh` (codex bundle is 14 post-delete; this test
is not CI-gated and was already failing on main)

## Verification (all green)

`check-hook-lease-inventory` · `validate-hooks-doc-parity` ·
`check-hook-port-replacements` · `validate-hook-preflight` ·
`generate-registry --check` · `smoke-test` · `test-runtime-codex-smoke`
(33/0) · `bats tests/hooks/*.bats tests/scripts/pre-push-gate.bats`
(297/0) · `test-agentops-contract-canaries` (failures=0, incl
pre-push-gate-governance + runtime-smoke-matrix) ·
`test-codex-native-install` · `test-audit-codex-hooks` (4/4) · `go
build/vet/test ./cmd/ao/`

Diff stat: 30 files, +26 / −569 (deletion-heavy, as expected).

Closes-scenario: soc-vpmzg#rm-commit-review-gate
Bounded-context: BC5-Runtime
Evidence: docs/contracts/hook-lease-inventory.md
2026-05-23 21:43:03 -04:00
Bo 29e0acc26e chore(hooks): delete standards-injector + retire its CI gate — hookless S2 (soc-khev6 #rm-standards-injector) (#488)
## What

Hookless epic S2 (`soc-khev6`): delete the `standards-injector`
PreToolUse hook and **fully retire** its dedicated CI gate.

`standards-injector` is a value-negative noise-injector — it injects
language standards on every Edit/Write regardless of relevance (A/B Δ=0,
per `docs/architecture/hook-noise-audit.md`). The replacement is the
`standards` skill, read on demand: a PRODUCT surface, not hook magic.

## Teardown (all of it)

- **Hook + tests:** `git rm hooks/standards-injector.sh`, its embedded
copy, and `tests/hooks/standards-injector.bats`.
- **Manifests:** pruned the Edit + Write entries from `hooks/hooks.json`
and `hooks/codex-hooks.json`, dropping the now-empty matcher groups.
**Codex native handlers 17 → 15** (two entries removed, not one — Edit
retains `codex-parity-warn.sh`, Write group dropped).
- **CI gate retired:** removed the `standards-injector-completeness` job
from `validate.yml` + both `needs:` lists
(`validate-pr-evidence-claims`, `summary`) + the summary echo; `git rm`
the check script + its bats; removed from `ci-jobs.yaml` manifest and
regenerated `AGENTS-CI.md`; removed from `pre-push-gate.sh` + its bats
stub.
- **Codex test assertions (the S1 bite):** `test-runtime-codex-smoke.sh`
and `test-codex-native-install.sh` length `17 → 15`; removed
`standards-injector.sh` from the require-handlers array.
- **Shared iterators:** pruned the `@test`/section blocks from
`test-hooks.bats`, `hook-output-schema.bats`,
`hook-stdin-contracts.bats`, `test-hook-chain.sh`,
`test-hook-lifecycle.sh`, `test-hooks.sh`, and the eval fixture
`hook-context-value-smoke.sh`.
- **Other surfaces:** `validate-hook-preflight.sh`,
`install-codex-plugin.sh`, `install-codex.ps1` owned-script lists;
`hooks_test.go` (swapped synthetic name to a live hook);
`context_compiler.go` port doc comment.
- **Regen:** hook-lease classification + inventory, registry, embedded
sync.
- **Docs:** `HOOKS.md`, `hook-noise-audit.md` (records S2 deletion),
`ENV-VARS.md` (`AGENTOPS_STANDARDS_*` vars), `LOOP-BUDGET.md`,
`cli-skills-map.md`, `software-factory.md`, `SDK-INVENTORY.md`.

## Verify (all green locally)

`check-hook-lease-inventory`, `validate-hooks-doc-parity`,
`check-hook-port-replacements`, `validate-hook-preflight`,
`generate-registry --check`, `validate-ci-policy-parity`,
`tests/smoke-test.sh` (codex smoke + native install),
`test-runtime-codex-smoke.sh`, the 3 bats hook suites, `go
build/vet/test`. `grep standards-injector validate.yml
ci-local-release.sh` → empty.

Diff stat: 39 files, +32 / -1045 (deletion-heavy, as expected for a
teardown).

Closes-scenario: soc-khev6#rm-standards-injector
Bounded-context: BC5-Runtime
Evidence: docs/contracts/hook-lease-inventory.md
2026-05-23 20:54:24 -04:00
Bo 09b4a95cb0 chore(hooks): delete 5 noise-injector hooks — hookless S1 (soc-s1i3b #rm-noise-hooks) (#483)
**GO HOOKLESS** epic `soc-e2ju0`, slice 1. Delete the 5
lowest-entanglement value-negative noise-injectors (A/B Δ=0). The
workflow is carried by the **product** (skills + `ao` CLI), not these
hooks.

Deleted (**53→48 hooks**): research-loop-detector, context-monitor,
write-time-quality, edit-knowledge-surface, go-vet-post-edit (all
pure-noise, 0 blocks, no dedicated CI gate).

Governed teardown per hook: rm .sh + .bats; prune hooks.json +
codex-hooks.json; remove hook-lease-classification entry (37→32) + regen
hook-lease-inventory.md; remove per-hook @test blocks from shared
iterators (heredoc-aware, bats re-run green); sync-hooks + regen
registry (44→38); update HOOKS.md + hook-noise-audit.md. Replacement =
product surfaces (skills + ao inject/lookup); go vet stays CI's job
(factory, not product).

Gates: check-hook-lease-inventory ✓, check-hook-port-replacements ✓,
validate-hooks-doc-parity ✓, validate-hook-preflight ✓, registry --check
✓, go build ✓, bats 81/15/78 green. Deletion-heavy diff = intentional
removal.

NOTE: claude-review infra-red (weekly limit, resets May 25) —
operator-authorized bypass when sole red.

Closes-scenario: soc-s1i3b#rm-noise-hooks
Bounded-context: BC5-Runtime
Evidence: docs/contracts/hook-lease-inventory.md
2026-05-23 19:55:07 -04:00
Bo 1a7e2cb748 feat(ao session bootstrap): universal init prompt (soc-vuu6.25 #ao-session-bootstrap) (#390)
## Summary

`ao session bootstrap` — every agent spawned into an AgentOps repo runs
this first. Output shape is identical regardless of model (the
fungibility contract: swap Claude for Codex on any bead without
re-orienting).

## What

Four fail-open substeps emit fields in
`schemas/session-bootstrap.v1.schema.json`:

| Field | Source | Fallback |
|---|---|---|
| `agents_md_read` + `agents_siblings_read` | `AGENTS.md` +
post-soc-vuu6.3 siblings | `false` / empty array |
| `onboard_phase` | `onboard --auto` (soc-vuu6.9 future) |
`skipped:not-implemented` |
| `ready_beads_count` | `bd ready --json` | `null` |
| `mail_unread_count` | mcp-agent-mail | `null` (wiring is follow-up
bead) |

## Why

The fungibility philosophy mandates one init prompt for every agent
regardless of type. Today every operator hand-rolls orientation; two
agents spawned by two different operators don't share a starting frame.
`ao session bootstrap` is the operational primitive that closes the gap.
Tiny (~270 LOC including helpers), fail-open, deterministic.

## Files

- New: `cli/cmd/ao/session_bootstrap.go` + `_test.go` (8 cases)
- New: `schemas/session-bootstrap.v1.schema.json` (draft-07)
- New: `skills/session-bootstrap/SKILL.md` +
`skills-codex/session-bootstrap/SKILL.md` (mirrored)
- Catalog: `skills/SKILL-TIERS.md`, `skills/using-agentops/SKILL.md`,
`skills-codex/using-agentops/SKILL.md`
- Regenerated: `cli/docs/COMMANDS.md` (sub 196→197, all 269→270),
`registry.json` (cli_commands 173→174),
`PRODUCT.md`/`docs/ARCHITECTURE.md`/`docs/SKILLS.md` (count sync 79→80),
`evals/agentops-core/cli-command-surface-{matrix.json,fixtures/cli-command-surface-smoke.sh}`
(fixture bump)

## Verification

```
cd cli && go build ./... && go test ./cmd/ao/ -run TestSessionBootstrap -count=1
# 8 passed
bash evals/agentops-core/fixtures/cli-command-surface-smoke.sh
# cli-command-headings: top=73 sub=197 all=270 / cli-help-matrix-ok
bash tests/docs/validate-doc-release.sh
# PASS: doc-release gate succeeded
```

Closes-scenario: soc-vuu6.25#ao-session-bootstrap
Bounded-context: BC5-Runtime
Evidence: cli/cmd/ao/session_bootstrap.go
Evidence: cli/cmd/ao/session_bootstrap_test.go
Evidence: schemas/session-bootstrap.v1.schema.json
Evidence: skills/session-bootstrap/SKILL.md
2026-05-21 04:27:09 +00:00
Bo ac05392744 feat(skills/standards): CLI wireup template reference (soc-62qr #cli-wireup-template) (#339)
## What
New file: `skills/standards/references/cli-wireup-template.md` (~135
lines) + 1-line References entry in `skills/standards/SKILL.md`. Also
adds the embedded copy at
`cli/embedded/skills/standards/references/cli-wireup-template.md` (via
`make sync-hooks`).

Mirrors `docs/learnings/2026-05-13-cli-wiring-cycle-shape.md` (canonical
source) into the standards skill so any agent invoking /standards
discovers the reproducible cobra subcommand template.

## Why
The template was empirically derived across /evolve cycles 144-146
(three `ao` subcommands shipped in ~10 min each, 250-335 LOC). Promoted
to docs/learnings/ but no skill referenced it — so a fresh session
reaching for 'how do I wire up a new ao command' had to rediscover the
shape. Now the template + 4 anti-patterns + pre-flight checklist live
where the agent looks.

## Sibling pattern
Follows `skills/swarm/references/shared-checkout-discipline.md` (PR
#333) shape: empirical baseline table → Go template →
Why-this-shape-works → anti-patterns → pre-flight checklist → worked
reference impls → See Also.

## Fitness-delta
| Metric | Before | After |
|---|---|---|
| standards references | 12 | 13 |
| reproducible CLI wireup patterns | 0 | 1 |
| empirical reference cycles cited | 0 | 3 (144, 145, 146) |
| anti-patterns enumerated | 0 | 4 (name collisions, builtin shadowing,
dead imports, missed registry regen) |

## Validation
- pre-push-gate.sh --fast: **passed (24 skipped)** after `make
sync-hooks` corrected an embedded-drift and removed an anticipatory
cross-link to PR #336's not-yet-merged file
- standards tier=library, CI limit=200, current=180 (well under)
- doc-release link validation: green

## Closes
Closes-scenario: soc-62qr#cli-wireup-template
Evidence: skills/standards/references/cli-wireup-template.md

## Provenance
Cluster #8 of 2026-05-18 Track-C mining pass.
Source: `docs/learnings/2026-05-13-cli-wiring-cycle-shape.md` (primary).
See Also: bc-ports-wire-up-arc.md + bc-ports-narrowness-postmortem.md
(cited, not mirrored — those are arc/postmortem material, not reusable
templates).

Co-authored-by: Codex <codex@example.invalid>
2026-05-20 12:12:23 +00:00
Bo eb7874fd82 feat(hooks): session-pr-counter — mechanical session-scope enforcement (soc-1aou) (#362)
## Summary

Mechanical follow-through for **soc-waxr (PR #361)** — the session-scope
doctrine. soc-waxr encoded "2-4 PRs/session default; ≥5 triggers
mandatory post-mortem" as documentation; this PR makes that rule fire
mechanically as a PreToolUse hook on `gh pr create`.

Closes: soc-1aou · Discovered-from: soc-waxr

## Fitness delta

- Doc-only rules with mechanical backstop: **+1** (session-scope joins
AP#1→ship.sh and AP#7→verify-gate-claim.sh)
- Session-scope recurrence prevention: **0 → 1** (would have fired on PR
#5 of yesterday's 7-PR session)
- New bats: **0 → 12** (kill switches, tool matching, threshold logic,
hard-block mode, fail-open on malformed output)

## What it does

- PreToolUse on Bash + `gh pr create`
- Counts the operator's PRs (any state, last 24h via `gh pr list
--search`)
- At `count >= threshold-1`, emits `additionalContext` with post-mortem
prompts:
  - Which PRs were planned vs reactive?
  - How many self-corrections so far?
  - Is the marginal PR discovery or churn?
- Hard-block mode (`AGENTOPS_SESSION_PR_BLOCK=1`) exits 2 with clear
reason instead

## Configuration

| Variable | Default | Purpose |
|---|---|---|
| `AGENTOPS_SESSION_PR_THRESHOLD` | 5 | PR count that triggers the
reminder |
| `AGENTOPS_SESSION_PR_WINDOW_HOURS` | 24 | Window for "current session"
|
| `AGENTOPS_SESSION_PR_BLOCK` | 0 | 1 = hard block (exit 2) instead of
advisory |
| `AGENTOPS_SESSION_PR_COUNTER_DISABLED` | 0 | 1 = bypass this hook |
| `AGENTOPS_HOOKS_DISABLED` | 0 | 1 = bypass all AgentOps hooks |

## Sibling pattern

Hook structure mirrors `hooks/commit-review-gate.sh` — same PreToolUse
Bash matcher, same kill-switch chain, same jq+env fallback for tool
input parsing, same `emit_hook_context` → `jq -n` → escape-fallback
emission chain. Standards discipline matches (set -uo pipefail without
-e, fail-open advisory shape). Sibling pattern:
`hooks/commit-review-gate.sh`.

## Files

| File | Change |
|---|---|
| `hooks/session-pr-counter.sh` | New, 133 lines |
| `hooks/hooks.json` | New PreToolUse Bash entry (timeout 10s) |
| `cli/embedded/hooks/*` | Auto-synced via `make sync-hooks` |
| `tests/hooks/test-session-pr-counter.bats` | New, 12 tests, all green
|

## Dogfood: what would have fired

Yesterday's 7-PR session (#356 through #361 + #320) would have triggered
this hook at PR #5 (`#359` soc-bbvw — the FIRST self-correction PR). The
hook's reminder would have been visible to the agent before opening
#359, prompting "is this churn or discovery?". The answer was "churn —
fixing my own regression from #357", which exactly fits the failure mode
soc-waxr names.

## What's NOT in this PR

The soc-waxr doctrine surfaces (CLAUDE.md, AGENTS.md, ship-loop SKILL,
anti-patterns.md) still say "mechanical enforcement is a successor
concern". Updating those will be a tiny follow-up PR once soc-waxr
(#361) itself merges — editing the same lines now would conflict on
rebase.

## Verification

- `bats tests/hooks/test-session-pr-counter.bats` → 12 ok
- `shellcheck hooks/session-pr-counter.sh` clean (SC1091 info-only on
hook-helpers source, matching `commit-review-gate.sh`)
- `jq -e . hooks/hooks.json` clean
- `cd cli && make sync-hooks` clean

Bounded-context: BC0-foundations + BC5-runtime (hook plumbing)
Evidence: shellcheck

Co-authored-by: Codex <codex@example.invalid>
2026-05-20 01:41:34 +00:00
Bo 0c3b8f25a4 fix(hooks): drop PWD-in-worktrees heuristic from lead-only-worker-git-guard (soc-is4c) (#345)
The `lead-only-worker-git-guard` hook classifies any session with PWD
under `.claude/worktrees/` as a swarm worker and blocks every
destructive git verb. That fires on **solo Claude sessions opened in a
worktree for isolation** — the human-in-the-loop case, where the user IS
the lead. The documented kill-switch env vars only reach the hook when
set in the parent shell that launched Claude Code; passing them inline
to a Bash tool call doesn't reach the hook process. So the documented
escape hatch routinely fails in exactly the case that hits it most.

The hook is also trivially bypassed by writing a shell script and
invoking it via `bash script.sh` — the regex only matches literal text
in the Bash tool command string, not script contents. The heuristic
punishes the legitimate solo-worktree case and barely inconveniences a
determined worker.

**Bead:** soc-is4c (discovered-from: soc-acte / PR #342)
**Bounded-context:** BC2-Hooks
**Evidence:** tests/hooks/test-lead-only-worker-git-guard.sh — `ALL
TESTS PASSED` locally (33 cases, including the new regression at the
end)

## Fix

Drop the PWD heuristic. Require an EXPLICIT positive worker signal — one
of:
- `AGENTOPS_SWARM_ROLE=worker`
- `AGENTOPS_ROLE=worker`
- `CLAUDE_AGENT_NAME=worker-*`
- `.agents/swarm-role` file containing `worker`

The NTM swarm runner already sets one of these when it spawns workers,
so real swarm-worker contexts continue to be blocked. Solo sessions stop
being false-positives.

## Changes

- `hooks/lead-only-worker-git-guard.sh` — delete the PWD-in-worktrees
`elif` branch. Add a comment block citing soc-is4c with the rationale.
- `cli/embedded/hooks/lead-only-worker-git-guard.sh` — embedded mirror,
synced via `make sync-hooks` per the embedded-hooks-must-stay-in-sync
rule.
- `tests/hooks/test-lead-only-worker-git-guard.sh` — add one regression
test that explicitly forces PWD into a synthetic `.claude/worktrees/foo`
and asserts the hook now allows. All 32 pre-existing cases continue to
PASS.

## Sibling pattern

Mirrors the explicit-positive-signal shape from existing hooks like
`context-guard.sh` and `holdout-isolation-gate.sh` — they require
explicit env vars (`AGENTOPS_CONTEXT_GUARD_STRICT`,
`AGENTOPS_HOLDOUT_EVALUATOR`) with no heuristic role inference.

## What this does NOT change

- All destructive-verb blocking still works when the worker is
explicitly signaled.
- Both documented kill switches still work (`AGENTOPS_HOOKS_DISABLED=1`,
`AGENTOPS_LEAD_ONLY_GUARD_DISABLED=1`).
- The hook's regex, exit codes, and JSON output schema are unchanged.

## Fitness delta

False-positive rate on solo worktree sessions: 100% → 0%. Test count: 32
→ 33.

---------

Co-authored-by: Codex <codex@example.invalid>
2026-05-18 22:18:26 -04:00
Bo 772d13b8ce feat(skills): ship-loop — bot-paired internal-PR fast-lane cycle (soc-b0nn) (#332)
## What

Promote the 2026-05-18 session pattern from `docs/learnings` (PR #331)
into an invokable skill. Operators can now type `/ship-loop` to load the
discipline; future agents in fresh sessions can invoke it via Skill
tool.

## Distinct from pr-* family

The existing `pr-*` skills (`pr-research`, `pr-plan`, `pr-implement`,
`pr-validate`, `pr-prep`, `pr-retro`) are **tier=contribute** —
fork-based OSS contribution workflow. Their window is `fork`, output is
`code changes on fork branch`.

`ship-loop` is **tier=execution** — internal repo, branch off main,
auto-merge back to main. Sibling skill family, not a replacement.

## What it captures

| Section | Content |
|---|---|
| **9-step cycle** | claim → branch off fresh main → first failing test
→ minimal impl → `pre-push --fast` → commit → push → `gh pr merge
--squash --auto` → `bd close` |
| **Gate sequence** | pre-push --fast, claude-review (auto-fires on PR
open), validate.yml, gh-merge-chain |
| **Anti-patterns (5)** | Bundling pre-existing fixes,
copy-rewrite-leaves-dead-vars, asserting local-only state in CI,
branches off out-of-date main, skipping the failing-test-first step |
| **Failure modes (F1–F5 + meta)** | Each with mechanical guard already
landed this session |
| **Pair mechanics** | claude-review auto-fires on `pull_request:
opened/synchronize` — no @claude mention required |
| **gh-merge-chain dogfooding** | When and how to invoke the multi-PR
sequencer |

## Files

- `skills/ship-loop/SKILL.md` (177 lines)
- `skills/ship-loop/scripts/validate.sh` (78 lines; 17/17 self-checks
PASS)
-
`skills/ship-loop/references/{anti-patterns,examples,gh-merge-chain,test-shape}.md`
- `skills-codex/ship-loop/SKILL.md` (95 lines, slim frontmatter)
- `skills-codex/ship-loop/prompt.md` (35 lines, Codex Execution Profile)

## Registry inventory updates (all automated)

| File | Change |
|---|---|
| `skills/SKILL-TIERS.md` | New row under execution tier |
| `docs/contracts/skill-dispositions.yaml` | BC5 Runtime /
driving-adapter / keep |
| `docs/reference/agentops-skill-domain-map.md` | Regenerated, 78 → 79 |
| `docs/reference/agentops-domain-evolution-bdd.md` | Count 78 → 79 |
| `PRODUCT.md`, `docs/ARCHITECTURE.md`, `docs/SKILLS.md` | Synced via
`scripts/sync-skill-counts.sh` |

**The registries-drift remediation arc (soc-zxia) is paying off** —
adding a new skill costs 5 inventory doc updates, ALL automated and
gate-checked. Pre-push gate caught and the operator (me) fixed each one
mechanically.

## Validation

- ✅ `bash skills/ship-loop/scripts/validate.sh`: 17/17 PASS
- ✅ `scripts/pre-push-gate.sh --fast`: passed (1 pre-existing
scenarios/trace warn, unrelated)
- ✅ `tests/docs/validate-doc-release.sh`: link validation PASS
(synthesis doc reference uses GitHub URL since PR #331 isn't merged yet)
- ✅ `scripts/check-registry-drift.sh`: PASS
- ✅ `scripts/generate-skill-domain-map.sh`: 79 skills / 5 BCs / 79
dispositions

## Discovered

2026-05-18 session, immediately after [PR
#331](https://github.com/boshu2/agentops/pull/331) (docs/learnings
synthesis). User asked: "shouldn't we turn this into a skill?" — yes.
This is the executable form.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Codex <codex@example.invalid>
2026-05-19 00:56:38 +00:00
Bo 56e4fde894 Harden .agents policy hook handling (#314)
## Summary
- make `dangerous-git-guard.sh` block staged `.agents/` additions only
when Git ignore policy marks the path as runtime state
- make `session-start.sh` avoid injecting a root `/.agents/` blanket
when a co-located `.agents/.gitignore` already owns the local policy
- sync embedded hook copies and add BATS coverage for ignored runtime
paths and child-policy allowlists

Tracked from Mt Olympus bead `mo-a1enre`.

## Validation
- `bats --filter 'session-start|dangerous-git-guard'
tests/hooks/test-hooks.bats`
- `bats --filter 'dangerous-git-guard'
tests/hooks/hook-stdin-contracts.bats`
- `shellcheck -S warning hooks/dangerous-git-guard.sh
hooks/session-start.sh cli/embedded/hooks/dangerous-git-guard.sh
cli/embedded/hooks/session-start.sh`
- `bash scripts/validate-hooks-doc-parity.sh`
- `bash scripts/test-hooks-output.sh`
- `scripts/validate-embedded-sync.sh`
- `git diff --check`
- `scripts/pre-push-gate.sh --fast` (passed; known warn-only
executable-spec messages for `scenarios --lint` and `trace --orphans`)

Co-authored-by: Codex <codex@example.invalid>
2026-05-18 09:46:41 -04:00
Bo 0c87e52977 Document Rust adapter recursion guard (#310)
## Summary
- add an Adapter Recursion Guard section to the Rust standards reference
- name the `<TOOL>_IN_PROGRESS=1` convention and two-end
set-on-spawn/check-at-entry shape
- sync the Codex standards copy, embedded standards copy, and Codex hash
metadata

## Validation
- `rg -n 'Adapter Recursion
Guard|<TOOL>_IN_PROGRESS|MTO_SKILL_AUDIT_IN_PROGRESS|97e16fe|mo-l1tyqp\.23|re-entry|set-on-spawn|check-at-entry'
skills/standards/references/rust.md
skills-codex/standards/references/rust.md`
- `cd cli && make sync-hooks`
- `bash skills/standards/scripts/validate.sh`
- `scripts/validate-embedded-sync.sh`
- `scripts/check-standards-injector-completeness.sh`
- `bash skills/heal-skill/scripts/heal.sh --strict`
- `./tests/docs/validate-doc-release.sh`
- `bash scripts/refresh-codex-artifacts.sh --scope worktree`
- `scripts/pre-push-gate.sh --fast`
- `git diff --check`

Tracked from Mt Olympus bead `mo-od5j1c`.

Co-authored-by: Codex <codex@example.invalid>
2026-05-18 09:17:38 -04:00
Bo b3774cf139 refactor(council): brainstorm/debate/verdict mode taxonomy (soc-ml4l) (#293)
* docs(readme): lead with problem/solution and the executable-spec chain

* feat(skills): add expert-council — adversarial persona council

Named domain-expert personas duel via the dueling-idea-wizards route (verdict -> 0-1000 cross-scoring -> reveal -> score matrix). judgment tier. Slated for absorption into council --mode=debate per soc-ml4l.

* docs(council): add council-modes.feature acceptance spec for soc-ml4l

* refactor(council): formalize brainstorm/debate/verdict mode taxonomy

Refactor `council` into the three-mode taxonomy settled by the 2026-05-17
cross-vendor taxonomy duel (soc-ml4l). `--mode` selects one of exactly three
deliberation patterns — brainstorm (diverge), debate (contend), verdict
(converge); verdict is the default. `--focus`/`--depth`/`--runtime`/`--roster`
are orthogonal knobs, never modes.

- New `references/modes.md` — full taxonomy, mode-invariant lifecycle
  (convene/brief/deliberate/synthesize/record), knob aliases.
- Rename the `--debate` flag (a verdict intensifier) to `--adversarial`;
  the word `debate` now names the contend mode. `debate-protocol.md` ->
  `adversarial-protocol.md`.
- Absorb `expert-council` as `--mode=debate`: move `dueling-route.md` into
  `council/references/`; `expert-council` is now a 1-release thin alias ->
  `/council --mode=debate`.
- `research` verb folds into brainstrom (`--focus=research`); `validate`
  stays a verdict alias.
- Sync codex twins, SKILL-TIERS, using-agentops catalog, validate.sh
  behavioral checks, codex hashes.

Acceptance: every scenario in council/references/council-modes.feature holds.

---------

Co-authored-by: Codex <codex@example.invalid>
2026-05-17 19:33:07 -04:00
Bo a984b742d9 feat(skills): productize skill factory workflow (#290) 2026-05-17 09:56:32 -04:00
Boden Fuller b8c5a3761b feat(agentops): make 3.0 hookless-first
Add DDD skill-domain contracts, hook lease inventory, replacement ports, artifact-first RPI skill boundaries, and release exact-SHA validation. Demote ao inject to a compatibility adapter and remove prompt-only default hooks.
2026-05-16 09:43:08 -04:00
Boden Fuller ee763750ba docs: rename PRACTICE.md to PRACTICE-REGISTRY.md + add CDLC narrow-waist doctrine
Rescope PRACTICE.md into PRACTICE-REGISTRY.md: it now owns only the
practice-slug lineage registry, not product positioning or CDLC doctrine.
Update all references (schema, validate-practice-citations.sh, bats test,
architecture-terms.md, documentation-index.md, aggregate.go comment).

Introduce the Context Density Rule as a canonical domain concept: every
high-value context token carries intent, boundary, evidence, decision,
constraint, or next action. New domain entry context-density-rule.md (+
codex mirror). Thread the BDD/Gherkin + DDD + Hexagonal + TDD narrow waist
through cdlc.md, README.md, PRODUCT.md, GOALS.md, and the rpi/domain/
post-mortem skills. Sync codex artifacts.
2026-05-15 20:16:53 -04:00
Boden Fuller 3d6ee4d06a chore(embedded): sync using-agentops embedded copy after billboard trim
embedded-sync gate: cli/embedded/ mirrors using-agentops; trim was 261 -> 239
lines in source, embedded copy now matches (make sync-hooks).
2026-05-15 16:33:38 -04:00
Boden Fuller b85eee22c4 Merge branch 'main' into crank/ddd-hexagonal-2026-05-12
Main advanced 127 commits while this DDD/hexagonal+doctrine branch was in
flight (v2.41.0 + v2.41.1 shipped on main). Resolved 4 conflicts:

- skills/validation/SKILL.md: kept --ours (full DAG extraction to
  references/dag.md). Supersedes main's d59c0d60 partial refactor that only
  extracted STEP 1.7.5 + Flags; my macro-refactor + v2 frontmatter is the
  more complete result.
- AGENTS.md: kept both new gate rows (validate-context-map-drift from this
  branch + validate-docs-learning-references from main).
- .github/workflows/validate.yml: unioned both sides' summary `needs:` list
  additions (validate-skill-frontmatter + validate-context-map-drift from
  this branch + validate-docs-learning-references from main).
- .agents/rpi/next-work.jsonl: took main's consumed:true bd-routed update
  for evolution-roadmap-drain-2026-05-11 + kept this branch's new
  discovery-2026-05-12-ddd-hexagonal entry.

Five other files auto-merged (docs/documentation-index.md, scripts/pre-push-gate.sh,
skills/evolve/SKILL.md, skills/release/SKILL.md, tests/scripts/pre-push-gate.bats).

Validation post-merge: all 15 process skills PASS lint within tier caps,
codex-parity-drift PASS, wiring-closure PASS, next-work-contract-parity
PASS, context-map-drift PASS, embedded mirror synced.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 16:05:20 -04:00
Boden Fuller d722ed5c01 feat(skills): operating-loop doctrine + billboard refactor for 15 process skills
Introduce the CDLC operating loop as the execution discipline that runs
through the existing DDD/hexagonal seams, refactor 15 process skills to
billboard shape per the agreed tier line caps, and land the DDD frontmatter
v2 backfill (consumes/produces/context_rel) that was in flight on this
branch.

Doctrine + templates:
- docs/architecture/operating-loop.md: operational spine (BDD intent ->
  vertical slices -> conflict-free wave -> bead acceptance -> evidence)
- docs/templates/intent-issue.md: BDD-shaped intent issue template
- docs/templates/slice-validation.md: per-slice validation plan template
- docs/cdlc.md: new section linking the conceptual seven phases to the
  operating loop; operating-loop.md added to companion docs
- docs/templates/README.md + docs/documentation-index.md: catalog updates
- GOALS.md Directive #12: BDD intent + vertical slice decomposition gate
- .agents/research/2026-05-15-cdlc-dojo-doctrine.md (gitignored, local-only):
  compact doctrine source for the maintainer

Process-skill sweep (15 skills):
- "Loop position" section added to: rpi, discovery, plan, implement, crank,
  validation, brainstorm, pre-mortem, council, swarm, autodev, post-mortem,
  forge, retro, vibe.
- Billboard refactor: bulk procedural content extracted from SKILL.md to
  per-skill references/*.md for discovery, validation, implement, crank,
  swarm, post-mortem, vibe (5,632 -> 3,205 SKILL.md lines, -43%, with
  every new references/*.md linked back from its SKILL.md per the repo
  gate).
- Restored ACT.3/ACT.4 sections in post-mortem after the billboard pass to
  keep validate-next-work-contract-parity.sh green.

Validation:
- tests/skills/lint-skills.sh: all 15 PASS within declared tier caps
- scripts/audit-codex-parity.sh: PASS for all 15
- scripts/validate-next-work-contract-parity.sh: PASS
- scripts/pre-push-gate.sh --fast: PASS (0 failures, 50 skipped)
- cli/embedded mirror synced via 'cd cli && make sync-hooks'

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 15:42:37 -04:00
Boden Fuller e8e139d1f0 fix(hooks): sync embedded session-start hook 2026-05-12 19:11:41 -04:00
Boden Fuller a16add912e feat(hooks): warn on commits missing sibling-pattern citation (update-principles P3)
Third mechanical enforcer of docs/contracts/update-principles.md.
Cycles 54 and 55 landed P4 (fitness delta) and P2 (drift-blocking
test). This cycle completes the trio with P3 (sibling-pattern
citation): every fix should name the precedent it follows.

Recognized phrasings: "matching the X pattern", "matches the X
shape", "follows the X invocation", "Sibling pattern: …", "shape from
commit <sha>", "mirrors the X pattern", "copies from …". The regex is
ERE; `.+` between key words lets multi-word X names match.

Exemptions:
- trivial-body commits (< 80 chars total) skip the check (chore/typo
  /dep-bump don't need precedent citation)
- explicit [no-sibling] tag suppresses for genuine first-of-kind work

Sibling pattern: matches the cycle-54 and cycle-55 enforcer shape —
same PreToolUse:Bash matcher, same heredoc + -m parser, same kill
switch layering (AGENTOPS_HOOKS_DISABLED + AGENTOPS_SIBLING_CITATION_
DISABLED), same warn-only posture.

Bats coverage: 10 tests covering all paths — 4 recognized phrasings
(matches/follows/Sibling:/shape-from-commit), longer body without
citation (WARN), trivial-body exemption, [no-sibling] tag exemption,
non-commit Bash silent, both kill switches.

Code-driven fitness: update-principles enforcers 2 → 3 of 3 (P2, P3,
P4 all warn-enforced; P1 and P5 remain TODO under epic soc-5yuy as
they are subjective/already-partial).

Cycle 57 / wave 1 of the 2026-05-12 rescope (epic soc-5yuy).
2026-05-12 14:08:47 -04:00
Boden Fuller 9e9de5e9ff feat(hooks): warn on commits with code-without-test (update-principles P2)
Lands hooks/check-test-pair-on-commit.sh as the second mechanical
enforcer of docs/contracts/update-principles.md. Fires on
PreToolUse:Bash matching `git commit -m …`, inspects the staged diff
via `git diff --cached --name-only`, and warns via additionalContext
when *.go staged without *_test.go OR hooks/scripts/lib *.sh staged
without *.bats.

Exemptions handled in v1:
- cli/embedded/ (generated mirror)
- */testdata/*, */testfixtures/* (fixtures, not source)
- *.md and docs/ (no test pairing expected for prose)

Sibling pattern: hooks/update-principles-check.sh (cycle 54 commit
ecb3b3ba) — same PreToolUse:Bash matcher, same kill-switch layering,
same warn-only posture. Two single-concern hooks > one multi-concern
hook (Principle 1 applied at the enforcer layer).

Bats coverage matches the operator-exemplar shape from commit
f62295f7: 10 tests covering all paths — staged code w/o test (WARN),
staged code with test (silent), staged shell w/o bats (WARN), staged
shell with bats (silent), three exemption classes (cli/embedded/,
testdata/, docs-only), non-commit Bash (silent), both kill switches.

Code-driven fitness: update-principles enforcers 1 → 2 of 3 (P2 wired,
P4 wired previously, P1 TODO under epic soc-5yuy).

Cycle 55 / wave 1 of the 2026-05-12 rescope (epic soc-5yuy).
2026-05-12 13:40:58 -04:00
Boden Fuller ecb3b3baf9 feat(hooks): warn on commit messages missing fitness-delta (update-principles P4)
Lands hooks/update-principles-check.sh as the first mechanical
enforcer of docs/contracts/update-principles.md (cycle 52 commit
0d5fd66a). Fires on PreToolUse:Bash matching `git commit -m …`
patterns (including heredoc), parses the commit message body, and
warns via additionalContext when no fitness-delta signal is present.

This is the harness automation that retroactively wires cycle-45's
falsified H45.3 hypothesis: skill-text patches without automation
behind them stay aspirational. Now the principle has a hook.

Scope (v1):
- Principle 4 (fitness delta): mechanically checked via regex on
  `N → M`, `N/X → M/X`, `N% → M%` patterns
- Principles 1, 2: deferred to subsequent cycles (P2 needs staged-
  diff inspection; P1 is heuristic)
- Warn-only, never blocking — false positives are cheap, false
  negatives tolerable while the regex tunes

Sibling pattern: matches hooks/commit-review-gate.sh's PreToolUse:Bash
matcher shape with the same kill-switch layering
(AGENTOPS_HOOKS_DISABLED + per-hook AGENTOPS_UPDATE_PRINCIPLES_DISABLED).

Bats coverage follows operator-exemplar shape from commit f62295f7
(cherry-picked from 1b9d139c): 6 tests covering all paths — heredoc
with delta (no warn), N/X→M/X delta (no warn), heredoc without delta
(WARN emitted), non-commit Bash (silent), both kill switches.

Code-driven fitness: update-principles enforcers 0 → 1 of 3 (P4 wired,
P1/P2 TODO under epic soc-5yuy).

Cycle 54 / wave 1 of the 2026-05-12 rescope (epic soc-5yuy).
2026-05-12 13:31:49 -04:00
Boden Fuller d4a7471209 chore(cli): sync embedded skills mirror after Wave 1/2 edits
make sync-hooks pulled the Wave 1 #1 architecture-terms.md into
cli/embedded/skills/standards/references/ and re-mirrored the
using-agentops/SKILL.md frontmatter reformatted in Wave 2 #3.
Required by CLAUDE.md: "After editing hooks/, lib/hook-helpers.sh,
or skills/standards/references/: run cd cli && make sync-hooks."

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 10:50:03 -04:00
Boden Fuller 3e374d842d feat(product): codify AgentOps 3 launch path 2026-05-10 23:22:14 -04:00
Boden Fuller ce8259f6ba feat(practice): pass-9 backfill — final hooks/ wave (30 hooks); hooks/ pool exhausted
Closes out hooks/ practices: declarations: eval-verdict-compiler,
factory-router, finding-compiler, git-worker-guard, go-complexity-precommit,
go-test-precommit, go-vet-post-edit, holdout-isolation-gate, intent-echo,
lead-only-worker-git-guard, new-user-welcome, pending-cleaner,
postedit-codex-refresh, pre-mortem-gate, precompact-snapshot, prompt-nudge,
quality-signals, ratchet-advance, research-loop-detector,
session-end-maintenance, session-start, skill-lint-gate, standards-injector,
stop-auto-handoff, stop-team-guard, subagent-stop, task-validation-gate,
worktree-cleanup, worktree-setup, write-time-quality.

After pass 9: 127 with practices / 627 missing. ALL hooks/ now declared
(52/52). Remaining missing pool: cli/ (533), evals/ (61), schemas/ (33).
Embedded hooks re-synced. Pass-10 picks up evals/ or schemas/ next.
2026-05-10 23:16:01 -04:00
Boden Fuller cdb3238b47 feat(practice): pass-8 backfill — second hooks/ wave (12 more)
ao-feedback-loop, ao-flywheel-close, ao-forge, ao-session-outcome,
ao-task-sync, constraint-compiler, context-guard, context-monitor,
dangerous-git-guard, edit-audit, edit-knowledge-surface, edit-scope-guard.
After pass 8: 97 with practices / 657 missing. Embedded hooks re-synced.
2026-05-10 23:06:41 -04:00
Boden Fuller 9aab164409 feat(practice): pass-7 backfill — broaden practices: into hooks/* (10 hooks)
First wave of practices: declarations in non-skill primitives. Pass-7 lands
10 hooks: ao-agents-check, ao-extract, ao-inject, ao-maturity-scan,
ao-ratchet-status, citation-tracker, codex-parity-warn, commit-review-gate,
compile-session-defrag, config-change-monitor. Header-comment shape:
"# practices: [slug, slug]" inserted near the existing hook description line.
After pass 7: 85 with practices / 669 missing. Embedded copies re-synced via
make sync-hooks. Validates proof-of-shape for hooks/ before expanding to
evals/, schemas/, and cli/ primitives in later passes.
2026-05-10 23:00:57 -04:00
Boden Fuller 302be5e16d feat(practice): pass-6 backfill — 10 more practices: declarations + sync-hooks
Adds practices: frontmatter to the remaining 10 missing skills under skills/
(pr-implement, pr-plan, pr-research, pr-retro, reverse-engineer-rpi, shared,
skill-auditor, skill-builder, system-tuning, using-agentops). After pass 6:
75 with practices / 679 missing. Zero skills under skills/ remain missing —
pass-7+ will broaden into non-skill primitives (hooks, evals, schemas,
scripts). Embedded using-agentops re-synced via make sync-hooks; codex
parity hashes regen'd.
2026-05-10 22:53:46 -04:00
Boden Fuller 81c2f3eca9 chore: sharpen go toolchain and hook skills 2026-05-09 22:42:27 -04:00
Bo 2f3630a694 fix(hooks): reconcile stale .agents/.gitignore deny-all with parent allowlist (soc-rv5p) (#263)
The session-start hook installs a `*` deny-all `.agents/.gitignore` only
when the parent .gitignore lacks an allowlist for `/.agents/` paths. But
the prior condition `[ ! -f ... ] && ! grep -qE '^!/?\.agents/'` only
gated CREATION — it did nothing when a stale deny-all child file already
existed (left from an older hook version, an external tool, or a
pre-fix session). Once present, the deny-all child silently overrode
every parent `!/.agents/...` re-include via gitignore's last-match-wins
precedence, hiding force-tracked audit-truth artifacts:

  $ git check-ignore -v .agents/nightly/2026-05-07/baseline-goals.json
  .agents/.gitignore:2:*    .agents/nightly/2026-05-07/baseline-goals.json

This was the corpus-durability bug filed as soc-rv5p — the moat claim in
README/PRODUCT.md is fragile if the audit corpus can drop off git
invisibly between sessions.

Fix: switch from a one-shot guard to a reconciler.

- Root has `!/.agents/` allowlist → REMOVE any deny-all child (audit
  truth wins; this catches stale child files from older hook versions
  or external tooling)
- Root has no allowlist → INSTALL the deny-all child (external repos
  embedding AgentOps still get the safety belt)

Tests:

- "removes stale deny-all child when parent has allowlist" — locks the
  reconciler against regression
- "preserves non-deny-all child gitignore" — locks reconciler scope
  (only the deny-all `*` pattern is targeted; user-authored child rules
  survive)

Verified locally:

  $ rm .agents/.gitignore && bash hooks/session-start.sh
  $ git check-ignore -v .agents/nightly/foo.txt
  .gitignore:140:!/.agents/nightly/**    .agents/nightly/foo.txt

The parent allowlist now governs as intended.

Closes soc-rv5p.
2026-05-07 21:37:54 -04:00