Stage 5's `find ... | grep -v "$(basename "$TEST_LEARNING")"` exited 1 when
the corpus contained only the test sentinel (grep filters all input → no
matches → exit 1), killing the script under set -euo pipefail before the
soft-fail NOTE branch could run. This flipped the flywheel-lifecycle gate
(w=6) to fail on every fresh corpus.
Replace the grep -v filter with `find -name ! -name`, which is pipefail-safe
and produces the same exclusion. Add bats coverage for the sparse-corpus,
populated-corpus, and cross-citing-corpus paths.
Directive #1 (multi-runtime): Promote 2 runtime smoke tests from quarantine to
tests/skills/ — test-runtime-opencode-smoke.sh (install script + skill structure)
and test-runtime-claude-code-smoke.sh (plugin manifest + hooks + frontmatter).
Both standalone, no live runtime required. Remaining gap documented: Codex CLI
and live execution need external infra.
Directive #2 (install path): Add runtime execution tests to test-install-smoke.sh
— when cli/bin/ao exists, verifies `ao version`, `ao help`, and that flywheel/
goals/inject subcommands are registered. End-to-end install execution (clean env
+ network) documented as out-of-scope for local gate.
Directive #4 (knowledge lifecycle): Extend check-flywheel-lifecycle.sh with
stage 5 (citation in downstream work) — checks cross-citations between learnings,
briefings directory population, and corpus density. Soft-fail on sparse corpus;
hard-fail only when corpus is populated but citations are structurally absent.
Gate now traces 5 stages end-to-end. Live run shows 58 cross-citations found.