Commit Graph

21 Commits

Author SHA1 Message Date
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 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
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 3fb9963fb8 fix(codex): migrate deprecated hooks flag 2026-05-12 19:08:46 -04:00
Boden Fuller 984e5cbfe0 fix(codex): migrate hooks feature flag 2026-05-09 11:50:59 -04:00
Boden Fuller 3693fdde34 fix(rpi): harden hook install and release audit gates 2026-05-03 09:31:42 -04:00
Boden Fuller 86a822bb44 Re-architect AgentOps hooks around JIT context 2026-04-28 16:06:14 -04:00
Bo 9b08fb933d refactor(cli): go cli quality discovery batch (gc-bridge, json contracts, leaf-help smoke) (#162)
* docs: add go cli quality discovery plan

* fix(cli): harden gc bridge version parsing

* docs(go): align complexity policy with gates

* docs(cli): classify command surface

* fix(cli): enforce json output contracts

* feat(cli): expand completion coverage

* refactor(cli): pilot badge options writer

* refactor(cli): inject contradict output writer

* refactor(cli): inject notebook update writer

* fix(cli): enable gc runtime smoke coverage

* fix(cli): align gc bridge with gascity v1

* Release v2.39.0

* fix(tests): align next-work schema test with widened type enum

Commit ed35c47f added `docs` and `chore` to the script's VALID_TYPES,
but tests/scripts/check-next-work-schema-rows.bats:42 still used
`type:"docs"` as its supposed-to-be-rejected example, so the test
now passes through the validator — `bats-tests` has been red on
main since.

Switch the rejected-type example to `finding`, which is still
outside the enum and is also the canonical example cited in the
script's own header comment ("type=finding ... caught at push time").

Local: 11/11 in tests/scripts/check-next-work-schema-rows.bats pass.

* docs: capture finding generator postmortem (#157)

* fix(rpi): sort verdicts deterministically in context and status helpers (#158)

BuildPhaseContext and JoinVerdicts iterated the verdicts map directly,
producing non-deterministic output across runs. Sort keys before
rendering so prompt injection and status logs are reproducible.

Closes council finding W-7 (context-orchestration-leverage batch). The
related buildHandoffContext path was already fixed to delegate to
FormatVerdicts (which sorts); this completes the remaining helpers.

- cli/internal/rpi/status.go: sort keys in JoinVerdicts
- cli/internal/rpi/phased_context.go: sort keys in BuildPhaseContext
- tests: replace "ordering not deterministic" waivers with exact-order
  asserts and add a 50-run stability check

https://claude.ai/code/session_01Qw4bZvXUNuLs8Rp1j1homB

Co-authored-by: Claude <noreply@anthropic.com>

* fix(codex): audit noisy hook injections (#159)

* docs: add competitive radar (#160)

* feat(agents): harden operator control plane (#161)

* docs(discovery): plan agents control plane hardening

* feat(agents): harden operator control plane

* Release v2.39.0

* fix(tests): align next-work schema test with widened type enum

Commit ed35c47f added `docs` and `chore` to the script's VALID_TYPES,
but tests/scripts/check-next-work-schema-rows.bats:42 still used
`type:"docs"` as its supposed-to-be-rejected example, so the test
now passes through the validator — `bats-tests` has been red on
main since.

Switch the rejected-type example to `finding`, which is still
outside the enum and is also the canonical example cited in the
script's own header comment ("type=finding ... caught at push time").

Local: 11/11 in tests/scripts/check-next-work-schema-rows.bats pass.

* docs: capture finding generator postmortem (#157)

* fix(rpi): sort verdicts deterministically in context and status helpers (#158)

BuildPhaseContext and JoinVerdicts iterated the verdicts map directly,
producing non-deterministic output across runs. Sort keys before
rendering so prompt injection and status logs are reproducible.

Closes council finding W-7 (context-orchestration-leverage batch). The
related buildHandoffContext path was already fixed to delegate to
FormatVerdicts (which sorts); this completes the remaining helpers.

- cli/internal/rpi/status.go: sort keys in JoinVerdicts
- cli/internal/rpi/phased_context.go: sort keys in BuildPhaseContext
- tests: replace "ordering not deterministic" waivers with exact-order
  asserts and add a 50-run stability check

https://claude.ai/code/session_01Qw4bZvXUNuLs8Rp1j1homB

Co-authored-by: Claude <noreply@anthropic.com>

* fix(codex): audit noisy hook injections (#159)

* docs: add competitive radar (#160)

* fix(merge): drop unused AgentsDoctorError ref and prune allowlist entries without production refs

---------

Co-authored-by: Claude <noreply@anthropic.com>

* fix(merge): resolve conflicts by taking PR's refactored contradict/codex_runtime, main's overnight test schema

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-26 23:09:48 -04:00
Boden Fuller 26f73a51d3 fix(codex): cover hook test gaps 2026-04-23 23:50:54 -04:00
Boden Fuller 22fbfa2253 fix(codex): repair native hook manifest install 2026-04-23 23:15:27 -04:00
Boden Fuller 52d99f9ea3 feat(codex): add native Codex CLI hooks support
Codex CLI v0.115.0+ supports hooks (SessionStart, Stop,
UserPromptSubmit, PreToolUse, PostToolUse). Add codex-hooks.json
mapping 8 AgentOps hooks to the Codex hook format.

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

Hooks installed: session-start, ao-inject, flywheel-close,
prompt-nudge, quality-signals, go-test-precommit, commit-review,
ratchet-advance.
2026-04-07 09:37:35 -04:00
Boden Fuller 24b8d29738 fix: purge tracked .agents artifacts 2026-04-03 09:33:31 -04:00
Boden Fuller f4c9ececb5 feat(codex): record hook_runtime in install metadata, add smoke test coverage
Install metadata now records hook_runtime=codex-hookless-fallback and
references the hook runtime contract. Smoke test validates both fields.

Implements: ag-35a.3
2026-03-28 14:35:37 -04:00
Boden Fuller cec1e6030a hotfix: include pending repo updates 2026-03-21 11:50:30 -04:00
Boshu2 b3b9fc12e9 fix: dedupe codex native skill installs 2026-03-12 19:54:34 -04:00
Boden Fuller 8180474cb8 Remove Codex raw skill mirror 2026-03-07 14:52:51 -05:00
Boden Fuller b9fabf4645 Harden Codex skill install discovery 2026-03-07 14:40:31 -05:00
Boden Fuller 9205270833 Harden local codex skill validation 2026-03-07 13:26:49 -05:00
Boden Fuller 6dfef761b3 Fix codex skill sync and local push gates 2026-03-07 12:14:08 -05:00
Boden Fuller e0e21e3535 feat: add native Codex plugin install support 2026-03-07 07:30:08 -05:00