377 Commits

Author SHA1 Message Date
Boden Fuller d38ed52e31 feat(rpi): implement phase-1 c2 center surfaces 2026-02-26 21:35:15 -05:00
Boden Fuller 988ca9e376 feat: update RPI runtime flow and codex skill references 2026-02-26 14:08:46 -05:00
Boden Fuller 86aa0e4efd feat: add ao mind command and standardize skill YAML frontmatter
Integrate mind knowledge graph tool as `ao mind` subcommand (scan,
normalize, link, index, all, graph) wrapping python3 -m mind. Update
all 9 skill output templates to emit standardized YAML frontmatter
(id, type, date) with source wikilinks for RPI chain skills. Mirror
all changes to skills-codex/ for parity.

Also includes: hooks coverage test updates, go-complexity precommit
guard, ci-local-release allowlist fix, and new integration/lint tests.
2026-02-26 11:54:10 -05:00
Boden Fuller 4fd2512c87 refactor: flatten CLI namespace and liquidate debt
Remove 5 namespace parent commands (know, work, quality, settings, start)
and register all 49 leaf commands directly on rootCmd. Flat namespace is
simpler for users; GroupID-based help provides visual grouping without
requiring namespace tokens.

Namespace flattening (184 files):
- Delete know.go, work.go, quality.go, settings.go, start.go
- Invert deprecatedCommands map (old namespace paths → flat paths)
- Update 127 consumer files (hooks, skills, docs, scripts, tests)

Debt liquidation (7 items from post-mortem):
- Fix 62 broken smoke test invocations
- Delete 118 LOC dead deprecatedAlias code
- Widen doctor scan to docs/, scripts/, and subdirectories
- Expand expectedCmds test to all 49 commands (floor 45)
- Add bidirectional expectedCmds sync check
- Create sweep-namespace-references.sh automation
- Fix EXPECTED_COMMANDS array to list flat commands
- Escape sed variables in sweep script

All Go tests pass (36s). All conformance checks pass.
2026-02-26 09:27:38 -05:00
Boden Fuller 67378cd7aa ci: harden failing gates and add missing markdown/dependency checks 2026-02-26 06:42:03 -05:00
Boden Fuller bdf112ba7f feat: align codex skill docs and hook command mappings 2026-02-26 05:48:41 -05:00
Boden Fuller 0c3fcc1fff fix(docs): regenerate CLI reference after seed and feedback-loop changes 2026-02-25 20:17:09 -05:00
Boden Fuller b74c501b9d fix(flywheel): close MemRL feedback loop and complete skill-to-CLI coverage
Three epics (ag-9vy, ag-19q, ag-41t) fixing knowledge flywheel integrity:

Epic 1 — Fix feedback loop:
- Unhide `ao feedback-loop` command (was Hidden=true, never discoverable)
- Add `ao dedup --merge` + `ao contradict` to session-end hook

Epic 2 — Skill-to-CLI coverage:
- /retro: add session close, flywheel close-loop, MEMORY.md sync, constraint review
- /post-mortem: add session close + flywheel close-loop
- /crank: add flywheel close-loop on completion
- /flywheel: add 6 maintenance commands + active pruning (expire/evict/archive)
- Fix stale /forge+/extract user-facing reference in flywheel troubleshooting
- Fix crank --tier=pending typo (should be --status=pending)

Epic 3 — Slim boot + active pruning:
- Change session-start default from lean to manual (MEMORY.md auto-load)
- Add AGENTOPS_STARTUP_LEGACY_INJECT=1 rollback env var
- Update docs (ENV-VARS.md, HOOKS.md, using-agentops SKILL.md) to reflect new default
- Sync embedded hooks via make sync-hooks
2026-02-25 18:51:50 -05:00
Boden Fuller 742d4e8579 fix(flywheel): sync docs, comments, and tests to new thresholds
Council vibe found 9 stale references after the threshold changes:
- Auto-prune comment: "opt-in" → "opt-out" (default is now 1)
- Add AGENTOPS_AUTO_PRUNE to docs/ENV-VARS.md
- 5+ docs said "manual (default)" for startup mode → now "lean"
- Add stub rejection test for pool_ingest "no significant learnings"
- Update 8 stale test comments (0.7→0.55, harmful>=5→>=3, conf<0.2→<0.3)
- Fix helpers2_test boundary confidence 0.19→0.29 for new 0.3 threshold
- Fix json_validity_test fixture data to match new thresholds
2026-02-25 16:02:30 -05:00
Boden Fuller efca732ae9 fix(docs): regenerate CLI reference after maturity threshold updates 2026-02-25 15:43:40 -05:00
Boden Fuller 142b13ec53 feat(memory): add ao memory sync for repo-root MEMORY.md (ag-chm)
- New `ao memory sync` command writes session history to repo-root
  MEMORY.md with managed block markers (<!-- ao:memory:start/end -->)
- Multi-session history (newest-first, configurable --max-entries)
- Manual content outside markers is preserved on every sync
- Dedup by 7-char session ID prefix prevents duplicate entries
- Unicode-safe summary truncation (rune-based, not byte-based)
- readNLatestSessionEntries() reads N most recent sessions
- Opt-in SessionEnd wiring via AGENTOPS_MEMORY_SYNC=1 env var
- 22 tests: block parsing, dedup, trim, unicode, e2e
- Docs: ENV-VARS.md, HOOKS.md, COMMANDS.md updated
2026-02-25 08:44:19 -05:00
Boden Fuller a6076e379c fix(hooks): address code review findings — stale nudge, scanner, docs (ag-8km)
- Move MEMORY.md path derivation before mode branch so stale-MEMORY
  nudge works in manual mode (was unreachable before)
- Add scanner.Err() check in readSessionFile
- Update HOOKS.md customization section for new startup modes
- Fix inject SKILL.md token budgets to match actual hook (400/800)
- Add test for invalid --source value
2026-02-25 08:44:19 -05:00
Boden Fuller 27948cc263 feat(hooks): slim SessionStart boot + notebook source robustness (ag-8km)
- Add AGENTOPS_STARTUP_CONTEXT_MODE tristate (manual/lean/legacy)
  - manual (default): MEMORY.md auto-loaded, no extract/inject, pointer only
  - lean: extract + inject with reduced budget (existing behavior)
  - legacy: extract + inject with full budget (backward compat)
- Add --source auto|sessions|pending and --session flags to ao notebook update
  - auto (default): tries sessions/*.jsonl first, falls back to pending.jsonl
  - Filters .jsonl only (ignores .md files in sessions dir)
- Fix minimal hook install: add SessionEnd to events, use script paths
  - generateMinimalHooksConfig uses ${CLAUDE_PLUGIN_ROOT} script refs
  - replacePluginRoot called for minimal mode too
- Remove --queue from forge call in session-end-maintenance.sh
- Update inject SKILL.md, using-agentops SKILL.md, HOOKS.md, ENV-VARS.md
- Regenerate COMMANDS.md with new flags
- 7 new tests for session source resolution, all passing
2026-02-25 08:44:19 -05:00
Boden Fuller 4b55aceae1 fix(notebook): address pre-mortem findings — cursor dedup, stat safety, CLI docs
- F1: Add session_id cursor (.agents/ao/notebook-cursor.json) to prevent
  replaying the same pending.jsonl entry across sessions
- F2: Fix stat fallback in session-start.sh — assume fresh (age=0) when
  stat fails instead of epoch-zero (age=20000+) which disabled lean mode
- F3: Regenerate cli/docs/COMMANDS.md with notebook subcommand
- F4: Fix pre-existing atomicWriteFile temp file leak on os.Rename failure
- Add TestNotebookCursor_SkipsDuplicate test
2026-02-25 06:10:51 -05:00
Boden Fuller 922e8d4f74 feat(inject): two-phase knowledge injection with ao lookup (ag-mrr)
Phase 1 — index at startup: ao inject --index-only renders a compact
table (~200 tokens) instead of full content (~800 tokens). Enabled via
AGENTOPS_INDEX_INJECT=1 feature flag in session-start.sh.

Phase 2 — on-demand pull: ao lookup <id> fetches full content by ID,
ao lookup --query "topic" searches by relevance, ao lookup --bead ag-xyz
filters by source bead lineage. Records "pulled" citations for MemRL.

Also: remove 3 unused test helpers (writeGoalsMD, setupRatchetChain,
setupAgentsDirs) to fix lint, add prune policies for evolve/vibe/crank/
brainstorm/local-ci directories, update skills and docs.
2026-02-24 21:19:46 -05:00
Boden Fuller c665343d2c fix: resolve 32 vibe findings (2 critical, 7 high, 12 medium, 11 low)
Fix all findings from the v2.17.0..HEAD vibe review across 12 source files:

Critical: panic guards for negative budget in truncateToCharBudget and
dead prefix slice in generateArtifactID. High: bead override in batch
extract, json file counting in metrics, constraint index.json exclusion,
complexity reduction in curate status/verify (38→<25), flexible hook
script count assertion. Medium: truncate panic guards, error logging for
silent failures, null→[] JSON output, goals auto-detect (GOALS.md then
GOALS.yaml), raw var→getter usage, truncate-before-lock race fix. Low:
scanner.Err() checks, os.Stdout→cmd.OutOrStdout(), dry-run output
differentiation.

Docs: 5 missing INDEX.md concept links, curation-pipeline v1 status
callout. Tests: new TestSeed_DryRun_JSON. Regen: COMMANDS.md, embedded
hooks synced. All gates pass: build, vet, test, gocyclo, heal, doc-gate.
2026-02-24 16:51:26 -05:00
Boden Fuller 4f1fa62759 feat(inject): work-scoped knowledge injection and predecessor context
Add bead-scoped knowledge injection (`--bead` flag) that boosts learnings
tagged with the active work item using multiplicative scoring (1.5x direct,
1.2x label, 1.1x keyword). Add predecessor context injection (`--predecessor`
flag) that extracts structured progress/blockers/next-steps from handoff
files. Wire both into SessionStart hook via Gas Town env vars.

Epic ag-9uy: 9 issues across 4 waves (schema, resolver, flags, hooks,
citation feedback pipeline, bootstrap template, docs).

New files: inject_bead.go, inject_predecessor.go, flywheel_citation_feedback.go
Tests: 26 new (bead: 12, predecessor: 8, citation: 6)
2026-02-24 12:00:13 -05:00
Boden Fuller b16f85567c feat(goals): replace GOALS.yaml with curated GOALS.md, improve migrate --to-md
- Delete GOALS.yaml (35 goals) in favor of curated GOALS.md (13 gates, 3 directives)
- Migrate command generates directives from pillar groups instead of generic default
- Adds default north/anti stars when converting YAML → MD
- Updated help text to document both migration paths (v1→v2 YAML and YAML→MD)
- Regenerated COMMANDS.md with updated descriptions
2026-02-24 07:41:36 -05:00
Boden Fuller da65774d06 fix: pipe escaping in RenderGoalsMD, steer subcommand docs, adversarial parser tests
- Add escapeMDCell helper to escape pipe chars in markdown table cells,
  preventing silent data corruption on GOALS.md round-trip
- Add pipe unescaping in splitTableRow parser for correct read-back
- Fix generate-cli-reference.sh to traverse nested sub-subcommands;
  regenerate COMMANDS.md with steer add/remove/prioritize entries
- Fix goals_add.go Short description to be format-agnostic
- Add 9 adversarial parser test fixtures (pipes, backticks, unicode,
  empty cells, malformed separators, skipped directive numbers)
- Remove dangling --no-directives flag reference from evolve skill
- Set beads issue-prefix to "ag"
2026-02-24 07:23:29 -05:00
Boden Fuller a7887a1a30 feat(cli): add GOALS.md OODA-driven intent layer with directives
GOALS.md (version 4) extends GOALS.yaml with strategic intent sections:
mission, north/anti stars, directives with steer values, and markdown
gates tables. Evolve can now act on directives when beads and gates are
empty, addressing the 58% idle rate from stagnation.

Go library:
- Directive type, GoalFile extensions (Format, NorthStars, AntiStars, Directives)
- DetectFormat/ResolveGoalsPath auto-detection (GOALS.md preferred when both exist)
- 5-function markdown parser with case-insensitive heading matching
- RenderGoalsMD template renderer, round-trip tested
- 26 new tests (19 parser + 7 format detection)

CLI commands:
- ao goals init: interactive GOALS.md bootstrap (--non-interactive)
- ao goals steer: add/remove/prioritize directives
- ao goals prune: remove stale gates referencing missing paths
- ao goals measure --directives: output directives as JSON
- ao goals validate: reports format and directive count
- ao goals add: format-aware writeback (md or yaml)
- ao goals migrate --to-md: convert YAML to markdown format

Skills:
- /goals rewritten with 5 OODA verbs (init/measure/steer/validate/prune)
- /evolve Step 3 rewritten with directive-based cascade
- Schema docs updated for both formats

Pre-mortem fixes applied: format-aware writeback, version 4 for markdown,
case-insensitive headings, --directives/--goal mutual exclusion.
2026-02-24 06:37:01 -05:00
Boden Fuller ef32a2b5d6 docs: regenerate CLI reference for --json flag
Updates COMMANDS.md to reflect the new persistent --json flag
on root and updated help text examples across all subcommands.
2026-02-24 05:29:34 -05:00
Boden Fuller bb3aaa62b8 fix: sync embedded skills and regenerate CLI docs
Pre-release CI gate fix: embedded using-agentops/SKILL.md was stale,
CLI docs/COMMANDS.md had new trace command not reflected.
2026-02-23 12:32:23 -05:00
Boden Fuller 753b52f4e1 fix: strip hooks to bare-minimum flywheel
Hooks were breaking and doing too much. Reduced from 22 hooks across
12 events to 3 hooks across 3 events (SessionStart, SessionEnd, Stop).

Kept only what the knowledge flywheel needs:
- SessionStart: mkdir .agents, ao extract, ao inject, skill context
- SessionEnd: ao forge transcript, ao maturity (scan/expire/evict)
- Stop: ao flywheel close-loop

Removed from registration (scripts still in hooks/ for re-enablement):
PreToolUse, PostToolUse, UserPromptSubmit, TaskCompleted, PreCompact,
SubagentStop, WorktreeCreate, WorktreeRemove, ConfigChange hooks.

session-start.sh: 600 → 99 lines
session-end-maintenance.sh: 79 → 53 lines
2026-02-22 19:26:22 -05:00
Boden Fuller 93ed03470a feat(rpi): harden supervisor loop controls and canonical automation path 2026-02-21 21:46:54 -05:00
Boden Fuller e3b69af2f9 fix(rpi): avoid detached-branch sprawl and add branch pruning control 2026-02-21 21:23:53 -05:00
Boden Fuller fec1bc3c60 stabilize rpi loop landing and control docs 2026-02-21 21:21:23 -05:00
Boden Fuller 37d4b5b2ae Merge branch 'codex/rpi-supervisor-cli' into main 2026-02-21 19:41:50 -05:00