101 Commits

Author SHA1 Message Date
Claude 767de4e12c fix(hooks): narrow git-worker-guard -A pattern to avoid selective-flag false blocks
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
2026-04-21 06:52:58 +00:00
Boden Fuller 1e073d8363 chore: purge archived AO↔Olympus bridge integration + prefer local Go in precommit hook
Olympus (ol) was the power-user daemon predecessor to AgentOps, archived
in strategic-direction.md. The bridge contracts (SPEC_ONLY, never
enforced), MemRL policy surface, OL quarantine constraints collector, and
supporting scripts/tests all referenced a now-dead integration. Purging
them removes ~2400 lines of stale surface area.

## Deleted files
- docs/ol-bridge-contracts.md
- docs/architecture/ao-olympus-ownership-matrix.md
- docs/plans/2026-02-13-ao-olympus-bridge-next-steps.md
- docs/contracts/memrl-policy-integration.md
- docs/contracts/memrl-policy.schema.json
- docs/contracts/memrl-policy.profile.example.json
- cli/cmd/ao/inject_ol_test.go
- skills/vibe/scripts/ol-validate.sh + codex mirror
- skills-codex/swarm/scripts/ol-ratchet.sh, ol-wave-loader.sh
- tests/ol-integration/ (entire directory)

## CLI code stripped
- internal/search/types.go: OLConstraint struct + InjectedKnowledge.OLConstraints field
- internal/search/inject_run.go: CollectOLConstraints, WriteConstraintsSection, quarantineRelPath const, all related trim/render logic
- cmd/ao/inject.go: gatherOLConstraints, collectOLConstraints wrapper, olConstraint type alias, init-time call site
- Package comments in provenance/storage/types/formatter updated "olympus" → "agentops"
- formatter/markdown.go: session tag "olympus" → "agentops" (+ test update)
- Tests: deleted TestCollectOLConstraints + TestInject_collectOLConstraints, stripped OL subtests from TestFormatKnowledgeMarkdown and TestInject_*, renamed "olympus" literal test data to "other-repo"
- rpi_phased_context.go: stripped "matches Olympus DefaultTimeout" and "Modeled on Olympus internal/git/worktree.go" comments

## Docs + skills stripped
- mkdocs.yml nav: 3 entries removed (AO-Olympus Matrix, MemRL Policy, OL-AO Bridge)
- docs/INDEX.md, contracts/index.md, architecture/index.md, index.md: cross-refs removed
- strategic-direction.md: retirement rationale compressed to one paragraph
- docs/context-packet.md, positioning/devops-for-vibe-coding.md, plans/README.md: OL-specific content removed
- skills/vibe/SKILL.md + codex mirror, swarm/SKILL.md: OL script refs removed
- skills/vibe/references/deep-checks.md, plan/references/planning-rules.md (+ codex), pre-mortem/references/council-fail-patterns.md (+ codex): OL rule/pattern entries removed
- skills-codex hashes regenerated (plan, pre-mortem, swarm, vibe)

## Precommit hook fix
- hooks/go-test-precommit.sh: prefer ~/.local/go/bin/go when present. Hooks
  don't inherit interactive-shell PATH, so apt-provided go-1.22 would
  otherwise override a user-local 1.26 install. Mirrors the zshrc pattern.

## Retained (historical / useful)
- strategic-direction.md: 1-paragraph archival note
- Historical release notes (docs/releases/*.md) — immutable past-release record
- cli/testdata/transcripts/real-2.4mb.jsonl — captured test fixture
- docs/brownian-ratchet.md ol-rg3p bead-ID refs — internal bead prefix, not Olympus

## Verification
- go build ./... && go vet ./... clean
- go test ./... clean except pre-existing TestGCBridgeVersion_Live panic
- scripts/docs-build.sh --check (mkdocs strict) clean
- scripts/check-contract-compatibility.sh passes
- scripts/regen-codex-hashes.sh run — 4 skills updated
2026-04-19 14:33:00 -04:00
Boden Fuller cc6750c4e8 feat(docs,skills): rebuild Pages site with MkDocs Material + harden RPI orchestrator delegation contract
## 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>
2026-04-19 10:37:58 -04:00
Boden Fuller 48bee957b0 fix(hooks): pre-mortem gate locks on ambiguous state (deny by default)
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'.
2026-04-15 16:48:31 -04:00
Boden Fuller 7f9a6bfb38 feat(hooks): enforce lead-only worker git guard as PreToolUse hook
Adds hooks/lead-only-worker-git-guard.sh: mechanical PreToolUse guard
that blocks destructive git commands (commit, push, reset, rebase,
merge, cherry-pick, branch -D, checkout -B, worktree remove) when
running inside a swarm worker context.

Worker detection (in order): AGENTOPS_SWARM_ROLE=worker,
AGENTOPS_ROLE=worker (legacy), CLAUDE_AGENT_NAME=worker-*,
.agents/swarm-role file, CWD under /.claude/worktrees/. Allows all
non-destructive git (status, diff, log, show, blame, fetch) and safe
variants (branch -d, checkout -b). Allows everything in lead context.

Respects AGENTOPS_HOOKS_DISABLED=1 (global kill) and
AGENTOPS_LEAD_ONLY_GUARD_DISABLED=1 (local disable). Catches chained
commands (foo && git commit) via leading-token regex.

Registered under PreToolUse / Bash matcher in hooks/hooks.json.
Synced to cli/embedded/hooks/ via make sync-hooks. Adds 30-assertion
test file covering block paths, allow paths, kill switches, legacy
signals, and native-team worker naming.

Consumes ag-yhr 'Enforce lead-only worker git guard before spawn'.
Mechanical enforcement of the swarm skill's lead-only commit policy
which was previously informational only.
2026-04-15 16:48:09 -04:00
Boden Fuller 729840d126 feat: add fresh-repo onboarding welcome 2026-04-09 16:41:44 -04:00
Boden Fuller 4747c797d3 fix(ci): eliminate 5 CI toil sources from v2.35.0 post-mortem
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.
2026-04-07 18:43:26 -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 3eb679c6f6 feat(knowledge): rename athena → compile + add Karpathy-style knowledge compiler
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.
2026-04-05 17:57:40 -04:00
Boden Fuller 8f7e80a239 fix(hooks): add blocking mode to codex-parity-warn + cleanup stale worktrees
- codex-parity-warn.sh: opt-in blocking mode via AGENTOPS_CODEX_PARITY_BLOCK=1
  (exit 2 instead of 0 when codex counterpart needs sync). Default unchanged.
- Enabled git rerere for future conflict resolution memory
- Pruned 25 stale worktrees and deleted 8 orphaned local branches
- Synced embedded hook copy
2026-04-05 10:55:28 -04:00
Boden Fuller aef1efab3f feat(validation): add Stage 4 behavioral validation — holdout scenarios + satisfaction scoring
Add the missing validation tier between council/vibe (Stage 3) and production
(Stage 5). Inspired by StrongDM's Digital Twin Universe and Shield AI's
SITL/HITL/VITL fidelity ladder.

New capabilities:
- Holdout isolation hook: PreToolUse gate blocks agent access to .agents/holdout/
  unless AGENTOPS_HOLDOUT_EVALUATOR=1 (prevents reward hacking)
- Scenario schema: schemas/scenario.v1.schema.json defines holdout scenario format
- Verdict extension: satisfaction_score (0.0-1.0) and satisfaction_breakdown added
  as optional fields to verdict schema (v4)
- Scenario skill: /scenario for authoring and managing holdout scenarios
- Validation pipeline: STEP 1.8 inserted for behavioral validation
- Vibe exposure: weighted_score now exposed as satisfaction_score
- CLI commands: ao scenario init|list|validate with 11 passing tests
- Planning rule: schema wave ordering for additionalProperties:false
2026-04-05 08:35:31 -04:00
Boden Fuller c3fd166f7e refactor(rpi): wave 2 — hook polish, test infra cleanup, skill normalization
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.
2026-04-04 23:25:12 -04:00
Boden Fuller 99d3d369c5 feat(rpi): wave 2 backlog — swarm guards, hook hardening, release idempotency
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.
2026-04-04 20:56:17 -04:00
Boden Fuller ad029207cf feat(flywheel): complete escape velocity epic (ag-9qm)
Section-first retrieval with weighted scoring, namespace comparison,
verified citation semantics, and escape velocity verification.

- Add weighted multi-feature scoring (heading, exact token, adjacency,
  proximity) gated by shadow namespace in inject_scoring.go
- Add `ao flywheel compare` command for primary-vs-shadow side-by-side
  metrics with promotion/rollback contract
- Add VerifyEscapeVelocity() with configurable targets (sigma>=0.30,
  rho>=0.65, sigma_rho > delta/100) in metrics_health.go
- Update 8 skill packet consumers with section evidence guidance and
  verified citation semantics (applied vs retrieved)
- 24 new tests across inject_scoring, metrics_flywheel, metrics_health
- Regenerate CLI reference for new compare subcommand

Closes: ag-9qm, ag-9qm.10, ag-9qm.11, ag-9qm.12, ag-9qm.13, ag-9qm.14
2026-04-04 16:22:38 -04:00
Boden Fuller 1ea93951f5 merge: codex flywheel remediation 2026-04-03 15:21:03 -04:00
Boden Fuller 5db2d4b29b fix: remediate flywheel curation gaps 2026-04-03 10:13:59 -04:00
Boden Fuller 24b8d29738 fix: purge tracked .agents artifacts 2026-04-03 09:33:31 -04:00
Boden Fuller 2fc5234911 refactor(hooks): keep Claude startup surface in CLAUDE.md 2026-04-02 15:52:33 -04:00
Boden Fuller 6df03bdbb3 feat(hooks): add claude factory startup routing 2026-04-02 15:32:50 -04:00
Boden Fuller 45db7ab97b feat(skills): apply Claude Code architecture lessons — retry budgets, stability flags, quality signals, orchestration pattern
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
2026-04-01 08:07:39 -04:00
Boden Fuller 7ac8a29b56 feat(ci): shift 9 CI-only checks to pre-push gate
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.
2026-03-31 15:19:50 -04:00
Boden Fuller c56269da1b fix(ci): resolve 3 CI failures — docs parity, hook portability, codex lifecycle
- 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
2026-03-31 11:59:46 -04:00
Boden Fuller b247a133b9 fix(ci): resolve 4 pre-existing CI failures
- codex-runtime-sections: replace .claude/settings.json check with
  .git/hooks/ check in skills-codex/bootstrap/SKILL.md
- skill-lint: remove "bootstrap" trigger collision from scaffold skill,
  add bootstrap/design/harvest to codex-overrides catalog
- cli-docs-parity: regenerate COMMANDS.md (missing ao harvest docs)
- cli-integration: fix mawk-incompatible awk regex in athena-session-defrag
  hook (#{1,3} → ##?#? for portable h1-h3 matching)
2026-03-30 18:36:26 -04:00
Boden Fuller 20eaf81ca1 fix(hooks): write full .agents/.gitignore on first session start
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.
2026-03-30 17:49:55 -04:00
Boden Fuller 0030790283 feat(skills): encode evidence-driven anti-patterns, unify flywheel metrics, add normalization defect detection
- Create global ~/.agents/MEMORY.md with 7 universal principles and top patterns
- Unify sigma/rho/delta definitions across skills/docs/code (code is truth)
- Add normalization defect scan to Athena defrag (placeholder, stacked frontmatter, bundled, dupes)
- Add anti-pattern pre-flight to /plan (dead infra, brainstorm-as-plan, 40% context, commit cadence)
- Expand pre-mortem from top-5 to top-8 FAIL patterns (dead infra activation, rollback maps, four-surface closure)
- Add 4 new forge uncaptured lesson categories (normalization defects, promotion pipeline, taxonomy, stale contradictions)
- Add normalization defect check to post-mortem four-surface closure
- Fix pre-existing broken link in flywheel-diagnostics.md (regex in code block)
- Sync all changes to skills-codex with Codex-specific adaptations preserved
2026-03-30 15:27:49 -04:00
Boden Fuller d94be296be chore: merge upstream changes (hooks, scripts) 2026-03-27 19:47:01 -04:00
Boshu2 8d1475f328 fix(flywheel): close remaining ag-73u gaps 2026-03-22 16:04:52 -04:00
Boshu2 8365584399 feat(skills): implement 5 post-mortem improvements via parallel swarm
- Mirror-reference script (scripts/mirror-codex-references.sh) for automated skills→codex sync
- Confidence scoring in athena Mine/Grow with 0.3-0.9 weighted scale and auto-promotion
- SHARED_TASK_NOTES bridge in crank orchestrator for cross-worker context
- PostToolUse write-time quality hook for Write/Edit anti-pattern detection
- Plan mutation JSONL audit trail in crank for drift analysis
- 15 reference docs across 10 skills from competitive analysis
- All codex mirrors updated, embedded hooks synced
2026-03-21 21:46:38 -04:00
Boshu2 fb494b1f8b feat(config,skills): add config write support, bridge docs, pre-mortem improvements
- Add Save() to config package with atomic YAML write and merge semantics
- Add --set-tier and --set-skill flags to ao config models subcommand
- Add statusline bridge setup examples to context-monitor.sh
- Add pseudocode-fix requirement to pre-mortem findings
- Add input validation check (Step 2.7) to pre-mortem checklist

Harvest: ag-w5c.6+ag-w5c.7 next-work items 1-4
2026-03-21 19:24:54 -04:00
Boshu2 821624822d feat(config): add model cost tiers with per-agent model assignments
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
2026-03-21 19:17:54 -04:00
Boshu2 549d4b1b14 feat(skills): integrate competitive features from GSD/CE analysis
Add 5 features identified from reverse-engineering GSD v1.27 and
Compound Engineer v2.47:

- Node repair operator in crank (RETRY/DECOMPOSE/PRUNE recovery)
- Knowledge refresh auto-trigger via SessionEnd athena defrag hook
- Configurable review agents per project (.agents/reviewer-config.md)
- Three-tier plan detail scaling (Minimal/Standard/Deep)
- Adversarial ideation critique in brainstorm (Phase 3b red-team)
2026-03-21 15:35:04 -04:00
Boshu2 d11b1563d7 fix(hooks): fix CI failures for edit-knowledge-surface hook
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.
2026-03-21 00:18:53 -04:00
Boshu2 83ce8597b0 fix(flywheel): improve edit hook precision and archive reliability
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.
2026-03-21 00:06:55 -04:00
Boshu2 a550d43064 feat(flywheel): add edit knowledge hook and research archive script
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.
2026-03-20 23:58:52 -04:00
Boshu2 aa1f7448ed feat(flywheel): auto-promote forge candidates and expand knowledge surfacing
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.
2026-03-20 23:42:49 -04:00
Boshu2 771ba2fa88 feat(flywheel): add golden signals for knowledge compounding health
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.
2026-03-20 14:25:30 -04:00
Boshu2 fd4b882afb feat(hooks): wire ao lookup into SessionStart to close citation gap
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
2026-03-20 13:24:36 -04:00
Boshu2 b657b25e26 chore: preserve flywheel rpi v2 wip 2026-03-09 21:24:30 -04:00
Test 3272abcd99 fix(agentops): repair push validation regressions 2026-03-08 11:22:59 -04:00
Test 54fababc0d fix(agentops): land audit follow-ups and codex sync 2026-03-08 10:53:35 -04:00
Boden Fuller 18c0db867c Hotfix Codex install docs and Athena metadata 2026-03-07 15:30:07 -05:00
Boden Fuller b68a739331 feat(context): replace ao inject with signpost network + on-demand ao lookup
Kill the pre-loaded inject blob pattern. Context is now delivered via:
- AGENTS.md signpost files in .agents/ subdirectories (navigation)
- ao lookup --query for on-demand learnings retrieval
- session-start.sh emits a pointer instead of a blob

Issues 1-8 of context-enforcement-phase3 plan:
1. Root .agents/AGENTS.md signpost + .gitignore restructure
2. Six directory signposts (learnings, patterns, plans, council, handoff, rpi)
3. session-start.sh and worktree-setup.sh no longer call ao inject
4. Skills updated: recover, evolve, crank, swarm, council, SKILL-TIERS
5. CLAUDE.md zero-context startup references .agents/AGENTS.md
6. context-contract-check hook deleted + CI/BATS refs removed
7. ao inject stderr deprecation notice + ao lookup help improved
8. Flywheel docs updated (ARCHITECTURE.md, knowledge-flywheel.md)
2026-03-07 11:03:13 -05:00
Boden Fuller fcef173b12 Release v2.20.0 2026-03-05 19:02:32 -05:00
Boden Fuller fc216209c8 fix(hooks): wire --profile flag in session-start inject call
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.
2026-03-05 17:51:01 -05:00
Boden Fuller 727f661cb9 feat(cli,hooks): Wave 2+3 — flywheel loop closure (8 issues)
B1: Auto-extraction at session close (--auto-extract flag)
B2: Session-start hook passes predecessor goal/type to ao inject
B3: Handoff→learnings bridge (bridgeHandoffToLearnings)
B4: Session-type scoring boost in injection (--session-type, --profile)
B5: MEMORY.md auto-promotion as Step 7 in flywheel close-loop
B6: Session-type detection in forge output (detectSessionTypeFromContent)
B7: Session-end hook wiring (auto-extract before forge)
B8: .agents/profile.md durable identity artifact
2026-03-05 15:18:46 -05:00
Boden Fuller 744bcabeb9 chore(cli,ci,docs): tech debt swarm — 10 fixes across scripts, hooks, CI, docs
- 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
2026-03-05 13:12:54 -05:00
Boden Fuller dcf65664f0 chore(na-3re): wave 3 — swarm hardening + script/doc fixes (2 issues)
Issues: na-3re.11, na-3re.13

- na-3re.11: Swarm worker hardening:
  - worktree-setup: GIT_WORKER_GUARD=1 for worker sessions
  - session-start: unalias -a env sanitization for workers
  - swarm SKILL.md: scope-escape protocol for out-of-scope findings
- na-3re.13: Script/doc fixes:
  - check-contract-compatibility: graceful skip when docs/contracts/ missing
  - ENV-VARS.md: document RPI_RUN_ID env var
  - Verified NO-OPs: proof-run.sh (no bc), release-cadence (already tz-safe)
2026-03-05 10:24:41 -05:00
Boden Fuller 9d06279043 chore(na-3re): wave 2 — harden hooks, wire context, clean docs, add CI job (5 issues)
Issues: na-3re.7, na-3re.8, na-3re.9, na-3re.10, na-3re.12

Wave 2 changes (37 files):

- na-3re.7: Add check-test-staleness CI job (warn-only, continue-on-error)
- na-3re.8: Harden 4 hooks with WARN-first defaults:
  - pre-mortem-gate: AGENTOPS_PREMORTEM_FALLBACK=open (advisory by default)
  - task-validation-gate: recursion depth limit (max 3), AGENTOPS_METADATA_GATE=warn
  - ratchet-advance: epic-scoped gating via AGENTOPS_ACTIVE_EPIC
  - go-complexity-precommit: _validate_restricted_cmd helper
- na-3re.9: Extract section name constants, add context section validation tests
- na-3re.10: Clean stale /learn→/retro refs (5 docs), .agents/retros/→.agents/learnings/
  refs (17 files), fix post-mortem SKILL.md step numbering
- na-3re.12: Verify Go code items (6/7 already correct), add ASCII fast-path comment
2026-03-05 10:21:27 -05:00
Boden Fuller e8572ee8d9 feat(cli): backlog blitz wave 1 — bug fixes, test cleanup, skill templates (na-3re)
Wave 1 of na-3re (6 parallel issues, 0 file conflicts):

Issue 1 - Hook bugs:
- Merge double-jq in commit-review-gate.sh into single @tsv call
- Add session-aware dedup (PID-based) to intent-echo.sh

Issue 2 - Script bugs:
- Add pattern resolution logging to cherry-pick-wave.sh
- Improve coverage-ratchet.sh error handling for failed go test

Issue 3 - Run-ID classification:
- Fix rpiRunIDPattern: accept rpi-{8-12hex}, drop bare 8-hex false positives
- Update contract tests and serve tests for new pattern

Issue 4 - UTF-8 safety:
- Fix truncateGoal to use rune-safe slicing (was byte-slicing)
- Audit strings.Trim in goals/ — no misuse found

Issue 5 - Test cleanup:
- Strip 153 TestCov3_ prefixes across 15 files
- Merge fire_deep_test.go → fire_test.go
- Merge maturity_deep_test.go → maturity_test.go
- Fix malformed test names (lowercase after Test)

Issue 6 - Skill templates:
- Add test-fixture audit + go-build verification to /plan
- Add single-epic scope WARN to /crank
- Add footgun entries section to /post-mortem
2026-03-05 10:09:13 -05:00
Boden Fuller 083fa8bb84 fix(hooks): harden ratchet-advance and standards-injector JSON output
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.
2026-03-05 07:43:24 -05:00