Commit Graph

9 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 1e0317f876 feat(ci): enforce inner/middle/outer loop boundaries (#230)
* feat(ci): enforce inner/middle/outer loop boundaries

- Default pre-push gate to two-pass mode for local pushes:
  pass 1 blocks in <10s (--fast --scope head), pass 2 is advisory
- Add --single-pass flag to opt out of two-pass default
- Add `make inner` target for <10s edit-time validation (build+vet)
- Add dorny/paths-filter to CI: codex/eval/go/learning jobs only run
  when their paths change (saves ~30 runner-minutes on docs-only PRs)
- Fix summary job: tolerate skipped jobs (use contains failure check
  instead of != success) so path-filtered PRs can merge
- Add docs/LOOP-BUDGET.md classifying all 35 pre-push checks and 46
  CI jobs into inner/middle/outer loops with latency budgets

* fix(ci): update CI policy parity script for contains() failure pattern

The summary job now uses contains(needs.*.result, 'failure') instead of
enumerating each job. Update extract_summary_failset to derive the
blocking set from needs list minus continue-on-error jobs. Exclude the
utility 'changes' job from parity comparison.
2026-05-05 10:11:38 -04:00
Boden Fuller fa6f4048af fix(compile,quickstart): embed compile.sh, auto-detect claude-cli, batch large corpora
Fixes three onboarding defects that surfaced on 2026-04-15 when running
against a global ~/.agents corpus from a non-git home directory:

1. `ao compile --full` failed in the installed bundle with
   "open skills/compile/scripts/compile.sh: file does not exist". The
   Makefile's sync-hooks target never copied compile.sh into
   cli/embedded/skills/, so the //go:embed all:skills fallback had
   nothing to fall back to. Fix: sync-hooks now seeds the script and a
   regression test (TestMaterializeCompileScriptFallsBackToEmbedded)
   asserts the embedded copy resolves when no local skills/ exists.

2. Headless compile implicitly required OLLAMA_HOST / OPENAI_API_KEY /
   ANTHROPIC_API_KEY with no actionable error when none were set, and
   ignored a locally installed `claude` CLI. Fix: resolveCompileRuntime
   auto-detects the `claude` binary and selects claude-cli runtime (no
   API key needed — inherits Claude Code auth). preflightCompileRuntime
   fails fast with an actionable error naming the exact env var to set.
   compile.sh gains a matching claude-cli backend and a --preflight flag.

3. The headless compiler concatenated all changed files into one LLM
   prompt, which is unworkable on 2000+ file corpora. Fix: compile.sh
   batches by --batch-size (default 25) and --max-batches (default
   unlimited); ao compile propagates both flags.

Onboarding gaps:

- $quickstart now detects a global ~/.agents corpus (GLOBAL_AGENTS=true)
  and, when GIT=false + AO=true, surfaces a harvest → compile →
  knowledge-activation path instead of only suggesting `git init`.
- Harvest SKILL.md clarifies that promotion writes to ~/.agents/learnings/
  (not ~/.agents) and adds a "which skill do I need?" decision table.
- Compile SKILL.md documents the claude-cli runtime and batching flags.
- skills-codex/compile/scripts/compile.sh wrapper now falls back through
  multiple candidate paths and finally delegates to `ao compile`, so an
  installed bundle without a sibling skills/ checkout still works.

Tests added:
- TestMaterializeCompileScriptFallsBackToEmbedded
- TestResolveCompileRuntime
- TestPreflightCompileRuntimeErrors (5 subtests)
- TestPreflightCompileRuntimeSuccess
- TestCompileScriptOptionsPassesBatchFlags
- TestQuickstartSkillCoversGlobalCorpus (both parity surfaces)

Verification:
  cd cli && go vet ./... && go test ./...   # all green
  bash skills/heal-skill/scripts/heal.sh --strict   # clean
  bash tests/docs/validate-doc-release.sh   # PASS
  bash scripts/check-contract-compatibility.sh   # 0 failures
  bash scripts/regen-codex-hashes.sh   # 3 skills rehashed
  bash scripts/generate-cli-reference.sh   # COMMANDS.md regenerated
2026-04-15 09:32:06 -04:00
Boden Fuller cc3259f262 fix(ci): pin golangci-lint v2 contract 2026-04-11 14:09:00 -04:00
Boden Fuller f1045a0bd0 refactor(cli): enable -shuffle=on in CI + fix 5 ordering-dependent tests (wave 13)
Add -shuffle=on to go test in validate.yml and Makefile to detect
test ordering dependencies at CI time.

Fix 5 tests that failed under shuffle:
- TestCobraIndexCheckCommand: add resetCommandState(t)
- TestDoctor_Integration_*: add resetCommandState(t) + env isolation
- TestMaturity_Integration_ScanPendingTransitions: add env isolation
- TestInjectForFlag_NoDeclaration: add env isolation
- TestRunGoals_GoroutineLeak: use goleak.IgnoreCurrent() to avoid
  false positives from parallel test subprocess cleanup

Root causes: leaked cobra flag values, missing maturity var resets in
testutil, and missing AGENTOPS_RPI_RUNTIME env var isolation.
2026-04-06 19:07:05 -04:00
Boden Fuller c7cffbcd3f fix(cli): address post-mortem findings — 6 of 7 harvested improvements
1. Makefile: add build dependency to test target (prevents stale binary)
2. testutil_test.go: extract 10 shared helpers from 8 test files
3. negative_path_test.go: 29 integration tests for CLI error formatting
4. preflight-swarm.sh: already committed at 4de22bf
5. os.Chdir audit: all 160+ sites require production refactor (no change)
6. Strengthen version/completion/promotion_defaults tests (+17 tests)
7. Replace time.Sleep with channel-based sync in stream tests
2026-02-26 18:32:28 -05:00
Boden Fuller 3299fd4680 fix(doctor): add ~/.codex/ paths, fix stale hints, add CI gate
Doctor was reporting 3 false warnings after the Codex-native migration:
- Plugin check missed ~/.codex/skills/ (only searched ~/.claude/, ~/.agents/)
- Search index hint referenced old flat "ao store rebuild" command
- Version display showed "vv2.18.2" (double v prefix from ldflags)

Also:
- Add check-doctor-health.sh to ci-local-release.sh Phase 2
- Fix make install to run build first (ensures embedded sync)
- Add formatVersion unit test
2026-02-26 06:56:12 -05:00
Boden Fuller 7f7441ecb9 fix(cli): codesign ao binary with stable Mach-O identifier
Go/clang defaults the Mach-O identifier to `a.out` with ad-hoc signature,
causing syspolicyd to repeatedly scan the binary during hook-driven workflows.
Add post-build codesign step (Identifier=com.12factoragentops.ao) to Makefile
build/install targets and GoReleaser Homebrew post_install.
2026-02-25 06:56:43 -05:00
Boden Fuller 37d4b5b2ae Merge branch 'codex/rpi-supervisor-cli' into main 2026-02-21 19:41:50 -05:00