The worker guard's bulk-staging block lowercased the command before matching
`*git add -a*`, which could match `-a` + `-u` clusters or (more subtly) any
text starting with `-a` after `git add `. Legitimate selective patterns like
`git add -u` (update-only) happened to slip past only because `-u` doesn't
contain `-a`, but the intent was already murky.
Split the patterns:
- commit/push/--all/. match against the lowercased command (subcommand
names can reasonably be case-insensitive in alias contexts)
- `-A` is checked against the raw command, so only the uppercase bulk flag
trips the block
Adds four regression tests: `-A` still blocks, `--all` still blocks,
selective `-u` is allowed, filenames containing `-a` are allowed.
Embedded hook copy resynced via `make sync-hooks`.
https://claude.ai/code/session_01TZeRkm97SrPchDwPsD41rd
## Docs site — boshu2.github.io/agentops
- Replace Jekyll minima with MkDocs Material (slate dark palette default)
- Landing hero scoped to .landing-hero (no gradient bleed on inner pages)
- Section landings (getting-started, architecture, reference, contracts, levels) with narrative ledes
- Generate skill catalog + per-skill pages from skills/*/SKILL.md at build
- Generate CLI reference from cli/docs/ at build (fails build on missing source)
- Fix every internal link via one-shot migration (scripts/migrations/2026-04-19-fix-docs-links.py)
- Wire mkdocs build --strict into pre-push gate (Check 25a)
- Replace .github/workflows/pages.yml with .github/workflows/docs.yml (actions/deploy-pages)
- README + docs/CONTRIBUTING updated with docs-build toolchain on-ramp
- tests/docs/validate-links.sh patched to understand mkdocs-generated paths
## RPI orchestrator strict-delegation contract
- Strict sub-skill delegation is now the default for /rpi, /discovery, /validation. No --full flag — always on.
- Canonical contract in skills/shared/references/strict-delegation-contract.md (plus Codex mirror)
- Forged learning with detection phrases + corrective actions (ao-inject-ready)
- Rename --no-lifecycle -> --no-scaffold in /discovery (Claude + Codex) with deprecation alias through v2.40.0
- Harden inline-work hotspots with orchestrator-owned markers in /crank STEPS 3a.3, 6.5, 8.7 + Inline Work Policy footer
- Flag consistency: --auto and --interactive scopes documented; --complexity syntax formalized
- CHANGELOG [Unreleased] documents + scaffolds; runtime hook enforcement explicitly deferred
## fix(hooks): go-test-precommit skips when no Go files staged
- Previously ran go vet + go build unconditionally, blocking non-Go commits when Go toolchain was missing or at a different version
- Now checks staged diff and exits cleanly if no *.go or go.{mod,sum,work} files are staged
- Applied to both hooks/ (source) and cli/embedded/hooks/ (synced)
Provenance: full RPI lifecycle with strict delegation at every phase boundary (Phase 1 Skill(discovery) -> Phase 2 Skill(crank) -> Phase 3 Skill(validation) -> Skill(vibe), Skill(post-mortem), Skill(retro)).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previously the pre-mortem gate fell back to UNLOCKED on missing,
unparseable, stale, or unrecognized state. A broken state file
silently disabled the safety gate. Flips default fallback to strict:
lock on any ambiguity, unlock only on explicit unambiguous evidence.
Strict default rules:
- Missing state file: BLOCKED
- Unparseable state (jq -e . fails): BLOCKED with clear error
- Verdict not in allow-list (passed|locked|ok|ratchet|approved): BLOCKED
- Missing epic-id or missing bd CLI in strict mode: BLOCKED
- Valid recognized verdict: ALLOWED
- Run-scoped orchestration log / epic-scoped council artifact / ratchet
status locked|skipped / chain.jsonl pre-mortem done: ALLOWED
Bypass: AGENTOPS_PREMORTEM_GATE_BOOTSTRAP=1 unlocks with mandatory
stderr warning 'WARN: pre-mortem-gate bypassed via ...'. Distinct
from the silent AGENTOPS_HOOKS_DISABLED=1 kill switch.
Legacy AGENTOPS_PREMORTEM_FALLBACK=open restores the previous silent-
allow behavior for operators who need the old semantics during the
transition.
Adds 8 new behavioral tests (20 total pass): missing/unparseable/
passed/expired/unknown-verdict/bootstrap/kill-switch/legacy-open.
Synced to cli/embedded/hooks/pre-mortem-gate.sh.
Consumes ag-yhr 'Harden pre-mortem gate fallback to locked-state
semantics'.
1. Add CHANGELOG sync check (check 36) to pre-push-gate.sh — fails if
root CHANGELOG.md differs from docs/CHANGELOG.md
2. Add 250-line limit guard to edit-knowledge-surface.sh for SKILL.md
files — warns at 240, errors at 250
3. Add TestMain to cli/cmd/ao/ that clears AGENTOPS_RPI_RUNTIME* env
vars so per-test t.Setenv is unnecessary
4. Broaden CLI docs parity check (24b) to trigger on any cmd/ao/*.go
change, not just go build changes
5. Wire --fast flag into .githooks/pre-push for faster push-time gates
Bonus: fix pre-existing pipefail bug in flywheel health check (35) that
silently killed all subsequent checks.
Rename the athena skill to compile — a descriptive name that communicates
what it actually does. Extend with Karpathy's LLM Knowledge Bases architecture:
- New compile phase: LLM reads raw .agents/ artifacts and produces interlinked
markdown wiki at .agents/compiled/ with index.md, log.md, backlinks
- New lint phase: detects contradictions, orphan pages, stale claims, coverage gaps
- Pluggable compute backend via AGENTOPS_COMPILE_RUNTIME (ollama|claude|openai)
- Hash-based incremental compilation (only recompile changed sources)
- compile.sh engine with security fixes (no shell injection, path traversal guard)
- Full rename across 93 files: skills, docs, CLI, tests, hooks, scripts, codex
Existing Mine → Grow → Defrag cycle preserved as phases within the larger
compile workflow. No vector DB — compiled wiki IS the retrieval layer.
Hook polish: add missing kill switch to go-test-precommit.sh, fix shebang
and bracket style in hook-helpers.sh, shellcheck annotations for
finding-compiler.sh and session-start.sh.
Test infra: refactor defrag.go writeDefragReport to accept io.Writer,
consolidate chdirTempWorkspace into chdirTo delegation, add godoc to
testutil_test.go helpers.
Skills: normalize output_contract quoting in brainstorm, design,
red-team, review SKILL.md frontmatter.
Epic D: Add pre-spawn worker detection to git-worker-guard (blocks worktree-add
and agent-spawn from workers). Enhance check-file-manifest-overlap.sh edge cases.
Wire validate-swarm-evidence.sh into CI. Fix .agents/retros→retro in index.go
and init.go. Add grep-for-existing-functions to swarm worker template.
Epic E: Replace partial embedded check in pre-push-gate with full
validate-embedded-sync. Lazy-init git rev-parse in research-loop-detector.
Add retag idempotency guard (skip if tag already at HEAD). Add git_sha to
release-artifacts.json manifest. Empty stdin guard in go-test-precommit.
Inspired by patterns discovered in Claude Code's npm source map leak:
- Add hook failure budget to lib/hook-helpers.sh (MAX_CONSECUTIVE_HOOK_FAILURES=3,
configurable via AGENTOPS_HOOK_FAILURE_CAP) — prevents runaway hook loops
- Add metadata.stability field (experimental|stable) to skill frontmatter schema
with heal.sh validation (H010) and skill-conventions documentation
- Add quality-signals.sh hook detecting repeated prompts and correction patterns,
logging to .agents/signals/session-quality.jsonl with defined schema
- Document orchestration-as-prompt as a first-class pattern in shared references,
linked from crank, swarm, evolve, rpi skills with codex parity
Add doc-release, contract-compatibility, hook-preflight, hooks-doc-parity,
ci-policy-parity, shellcheck, symlink-rejection, learning-coherence, and
orphan-hooks checks to pre-push-gate.sh (checks 25-33). Add fast-mode
detection for docs/shell/learning file categories so new checks only run
when relevant files change.
Also fix shellcheck warnings in task-validation-gate.sh (SC2053 glob
directives) and remove unused error_msg in watch-codex-stream.sh.
- harvest.go: use empty defaults with ~/ descriptions instead of baking $HOME
into flag defaults, resolving cli-docs-parity failures across environments
- athena-session-defrag.sh: swap stat order to try Linux stat -c first, fixing
integer expression error when macOS stat -f succeeds but returns mount path
- skills-codex/validation: replace ao codex stop with ao codex ensure-stop to
pass codex lifecycle guard validation
The session-start hook previously wrote a minimal 3-line gitignore
that only allowed .gitignore and README.md. This meant fresh repos
would lack the subdirectory-level deny rules, allowing session
artifacts to leak into git tracking on the first `git add`.
Now writes the same comprehensive gitignore as .agents/.gitignore
in the repo root: subdirectories allowed but contents denied, with
explicit exceptions for signposts, releases, plugins, and evolve state.
Add quality/balanced/budget/inherit tiers to ModelsConfig with
per-agent model resolution for council/crank/vibe cost management.
Includes ao config models subcommand, context-monitor hook,
and skill docs for tier consumption.
Epic: ag-w5c.6+ag-w5c.7
Use bare hookEventName "PreToolUse" (not "PreToolUse:Edit") to pass
the valid event name cross-check. Add hook to bats cross-check map.
Add 4 integration tests: kill switch, non-Edit tool exit, missing
file_path exit, and hooks.json wiring verification.
Move edit-knowledge-surface hook from PostToolUse to PreToolUse so
learnings surface before the edit, not after. Fix false positives by
matching relative path first, falling back to filename only when no
path match. Fix archive script to use YYYY-MM-DD from filenames
instead of mtime, which gets reset by ao mine.
Add PostToolUse:Edit hook that surfaces relevant learnings when editing
files mentioned in .agents/learnings/ (48ms, grep-based). Add
scripts/archive-research.sh to move stale research files to archive
and reduce search noise. Register hook in hooks.json with 3s timeout.
Close the knowledge pipeline gap where forge extracts at session end but
promotion to learnings never triggers. Add ao flywheel close-loop to
session-start hook, expand ao search to index .agents/research/ files
(72 orphans now discoverable), and add ao lookup to vibe and bug-hunt
skill Step 0s for contextual knowledge retrieval.
Four derived health indicators that distinguish knowledge compounding
from noise accumulation:
1. Velocity Trend — is σρ-δ increasing over time?
2. Citation Pipeline — are citations delivering value?
3. Research Closure — is research being mined into learnings?
4. Reuse Concentration — is the whole pool active or just a few items?
Accessible via `ao flywheel status --golden` (JSON/YAML/table).
Also adds forge→pool bridge (forge_pending.go) that writes pending
learnings as markdown for close-loop ingestion, and session-end
baseline capture hook for velocity trend tracking.
Security fixes from council review: path traversal sanitization,
frontmatter injection prevention, YAML encoder resource leak.
Every session now auto-retrieves top learnings via `ao lookup` using the
last commit subject as a contextual query, with a 5s timeout guard.
Citations are recorded automatically, closing the forge→pool→promote loop
that was broken since the ao inject → ao lookup migration.
Closes: ag-tf8
Pre-mortem WARN-2: plan B2 specified --profile passthrough but
session-start.sh never passed it. Adds conditional --profile when
.agents/profile.md exists. Syncs embedded copy.
- Fix hardcoded /tmp path in test-json-flag-consistency.sh (use mktemp)
- Add graceful skip for missing jq/python3 in check-contract-compatibility.sh
- Fix import grouping in maturity_test.go
- Update .agents/retros/ → .agents/learnings/ in ratchet gate.go
- Extract _validate_restricted_cmd to lib/hook-helpers.sh (shared lib)
- Wire test-json-flag-consistency.sh into CI (new validate.yml job)
- Add post-merge naming cleanup step to swarm local-mode.md
- Document operationalization heuristics in plan SKILL.md
- Create check-file-manifest-overlap.sh for pre-spawn conflict detection
- Wire file manifest overlap check into CI with self-tests
- Pre-mortem fixes: bash 4+ guard, mktemp in CI self-tests
Follow-up to #71 (merged, credit @mshuffett). Replaces raw printf
JSON emission with jq -n --arg as primary path, keeping escaped printf
as fallback for environments without jq. Prevents potential invalid
JSON from unescaped quotes or newlines in hook messages.