Substrate fix for the intent-echo hook trap. The Mac codex install ships
~/.codex/hooks.json with intent-echo.sh on UserPromptSubmit; long prompts
containing destructive verbs or scope-limiters trigger a HIGH-STAKES
preamble that captures as the assistant message. Non-interactive `codex
exec` then produces no real output.
team-runner.sh:226 is the load-bearing dispatcher behind /swarm, /crank,
/evolve, /codex-team, /red-team — patching it once propagates the fix to
every team-runtime skill. Mirror on the dry-run echo at :195.
smoke-test-codex-skills.sh prompts contain "only" (line 175); validate
prompt contains "only" (line 61). Both trigger today.
test-sandbox-mode.sh and test-structured-output.sh patched defensively
for drift resistance.
See .agents/findings/registry.jsonl entries f-2026-05-02-002 and
f-2026-05-02-003.
Wire lib/hook-helpers.sh to source the canonical state-path resolver from
soc-irg1.1 (lib/ao-paths.sh). All path constants (_HOOK_PACKET_ROOT,
_EVIDENCE_ONLY_CLOSURE_DIR, _EVIDENCE_ONLY_CLOSURE_RELEASE_DIR, the failure-
budget state_dir paths) now prefer AO_AGENTS_DIR / AO_COUNCIL_DIR with the
legacy ${ROOT}/.agents fallback chain preserved when the resolver cannot be
sourced. AO_HOME / CLAUDE_PLUGIN_DATA precedence flows transparently.
Centralized resolver for .agents/ subpaths — replaces scattered hardcoded
paths across hooks and ao subcommands. Honors env precedence:
AO_HOME > CLAUDE_PLUGIN_DATA > \${PWD}/.agents.
- lib/ao-paths.sh: sourceable shell resolver, emits export NAME=value lines
on stdout. Idempotent. Per-subdir env overrides win over the layout.
- cli/internal/paths/paths.go: Go package with Resolve() / ResolveFromRepo()
/ Validate(). 12 resolved roots: AgentsDir, KnowledgeRoot, HooksDir,
ScopeLock, RPIDir, FindingsDir, PlansDir, CouncilDir, LearningsDir,
PatternsDir, DecisionsDir.
- L1 unit + L2 cross-language scenario test asserting shell + Go agree
for the same env (TestShellGoAgreement: 3 subcases).
KnowledgeRoot intentionally maps to .agents/wiki only (internal compiled
wiki); raw+wiki external knowledge tree is unmapped per f-2026-05-01-005.
This is the foundation; consumer migration lands in I5 under a warn-only
ratchet (per warn-then-fail-ratchet pattern).
Wave 1 of epic soc-irg1 (gstack absorption Tier 1).
lib/hook-helpers.sh exports BEADS_DOLT_SERVER_PORT with override via
${BEADS_DOLT_SERVER_PORT:-3307} so users can still override per shell.
All hooks that source hook-helpers.sh automatically inherit the port.
scripts/bd-audit.sh and scripts/bd-cluster.sh are standalone bd callers
that do not source hook-helpers.sh, so they get the same export inline.
cli/embedded/lib/hook-helpers.sh synced via make sync-hooks.
Consumes ag-co7 'Export BEADS_DOLT_SERVER_PORT=3307 in shell env'.
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.
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.
- 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