Commit Graph

3 Commits

Author SHA1 Message Date
Bo b84dcf3ca2 docs(hookless): close cold-start orientation drift (soc-qh2g1 #cold-start-orientation-coherence) (#795)
## Summary

Close the hookless cold-start orientation gap for `soc-qh2g1` by making
the live startup docs and skills point at explicit `ao session
bootstrap` plus pulled context (`ao inject` / `ao lookup`) instead of
hidden SessionStart behavior.

## Changes

- Reframes live docs that still implied automatic startup/handoff
injection to the hookless explicit-command path.
- Updates source and Codex skill mirrors for `quickstart`, `inject`,
`using-agentops`, `recover`, `bug-hunt`, and `session-bootstrap`.
- Expands the cold-start and docs drift gates so `SessionStart hook`,
`startup hooks`, and `auto-inject ... hook` promises fail unless
explicitly hedged as opt-in, removed, or historical.
- Refreshes scoped Codex skill hashes for the touched mirrors.

## Test plan

- [x] `bash scripts/check-hookless-cold-start.sh`
- [x] `bash scripts/check-doc-hooks-drift.sh`
- [x] `bats tests/scripts/check-hookless-cold-start.bats
tests/scripts/check-doc-hooks-drift.bats`
- [x] `shellcheck scripts/check-hookless-cold-start.sh
scripts/check-doc-hooks-drift.sh`
- [x] `bash scripts/regen-codex-hashes.sh --check --only
session-bootstrap,quickstart,inject,using-agentops,recover,bug-hunt`
- [x] `bash scripts/validate-codex-generated-artifacts.sh`
- [x] `bash scripts/validate-codex-lifecycle-guards.sh`
- [x] `bash scripts/validate-agents-split.sh`
- [x] `git diff --check`
- [x] `bash scripts/validate-skill-runtime-parity.sh`
- [x] `bash scripts/lint-codex-native.sh`

Closes-scenario: soc-qh2g1#cold-start-orientation-coherence
Bounded-context: BC1-Corpus
Evidence: scripts/check-hookless-cold-start.sh
2026-06-06 11:23:56 -04:00
Bo 0dcbae450c fix(loop): re-enforce session-PR-scope hooklessly + fix stale hook refs (ag-o5xp #session-pr-scope) (#661)
## Problem

The session-PR-scope guardrail shipped as a PreToolUse hook
(`hooks/session-pr-counter.sh`, PR #362), but **PR #511 (the 3.0
hookless teardown) deleted all hooks**. Six workflow-discipline surfaces
were never updated — they still advertise the hook as a live, shipping
mechanism. That's a **stale active-surface promise + a lost reliability
guardrail** (surfaced by the ag-4hf7 Google-SRE audit:
"explainability/trust" turned inward).

## Hookless re-enforcement (the decision)

- **The mandatory layer already survives**: the `/evolve` post-mortem
checkpoint #6 (council-gated, cannot be bypassed) enforces session-scope
for autonomous loops — the actual failure mode. It only lacked a
canonical count source.
- **New `scripts/session-pr-scope.sh`** — the reusable hookless count +
verdict (`OK`/`WARN`/`BLOCK`), fail-open, robot-friendly
(`--json`/`--count`). It is now:
  - the checkpoint's `$session_pr_count` source, and
- the one-liner an **opt-in** hook wraps (re-author via the
hooks-authoring skill — AgentOps ships none).
- 8 bats cases (thresholds, block-mode exit code, fail-open); shellcheck
clean.

## Stale-doc truth (6 surfaces, all hedged)

CLAUDE.md · AGENTS-WORKFLOW.md · skills/ship-loop/SKILL.md · the evolve
postmortem-checkpoint (skills/, skills-codex/, packs overlay — kept in
parity; codex hashes regenerated for **evolve + ship-loop only**, the 7
pre-existing drifts left untouched).

## Ratchet (knowledge → a constraint)

Extend `check-hookless-cold-start.sh` to cover these workflow-discipline
surfaces — reversing the now-stale CLAUDE.md carve-out — so this exact
drift class **cannot recur**. Gate scope 5 → 10 surfaces; its bats test
stays green. (This is the "knowledge becomes a constraint" invariant the
whole ag-4hf7 thread identified as our edge — applied to the very gap
that thread surfaced.)

## Verification

- `bats tests/scripts/session-pr-scope.bats` → 8/8
- `bash scripts/check-hookless-cold-start.sh` → PASS (10 surfaces)
- `check-hookless-cold-start.bats` → 5/5 ·
`validate-codex-generated-artifacts.sh --scope head` → pass ·
wiring-closure → pass · shellcheck clean · overlay ≡ source

Closes-scenario: ag-o5xp#session-pr-scope
Bounded-context: BC3-Loop
Evidence: scripts/session-pr-scope.sh
2026-05-31 19:51:07 +00:00
Bo b39feb843d docs(corpus): cold-start orientation coherence after hook removal (soc-qh2g1 #hookless-cold-start) (#566)
## Summary

Hookless AgentOps 3.0 ships no SessionStart/Stop hooks, but several
cold-start surfaces still named hook scripts as live context-injectors —
misleading a fresh agent into expecting auto-injection. This is a pure
doc/skill reconciliation pass (BC1 Corpus); **no command logic
changed**.

- **Scenario 1 (orientation reachable without a hook):** `CLAUDE.md` +
`AGENTS.md` Zero-Context startup now name the explicit orientation
command — `ao session bootstrap` → `ao inject` / `ao corpus inject
--query "<topic>"`. `AGENTS.md` drops the stale "when soc-vuu6.25 lands
/ until then" hedge: bootstrap shipped in PR #390 (soc-vuu6.25 is
closed).
- **Scenario 2 (no doc/skill promises hook-provided context):**
`docs/architecture/primitive-chains.md` Chain 6,
`skills/session-bootstrap/SKILL.md` (+ codex twin), and
`docs/newcomer-guide.md` no longer present hook scripts as active
surfaces; remaining hook mentions are reframed opt-in (author via the
`hooks-authoring` skill). New `scripts/check-hookless-cold-start.sh` +
bats lock the regression.
- **Scenario 3 (each removed hook accounted for):** a disposition table
in `primitive-chains.md` maps each removed hook *behavior* (context
injection, end-of-session curation, standards surfacing, validation
reminders) → an explicit replacement or "confirmed noise".

## Design notes

- The new gate rides the existing `bats tests/scripts/*.bats` CI lane
(no new `validate.yml` job, per plan). It scans a **fixed** list of
cold-start surfaces and flags any `hooks/<name>.sh` path presented
without an opt-in/historical hedge — deliberately *not* a broad
`docs/`+`skills/` grep (release notes / `hooks-authoring` / scope guards
legitimately name hook paths).
- `CLAUDE.md` is **hand-maintained**: `build-claude.py` is vestigial
(its `--check` reports STALE on clean `main` and it's absent from CI),
so `CLAUDE.md` was edited directly rather than regenerated — running the
generator would have clobbered it.
- Scenario-3's disposition was folded into the `primitive-chains.md`
Chain 6 reframe rather than a new doc (co-located, no catalogue-gate or
mkdocs-nav churn).
- Scope held tight: broader hook-taxonomy drift in `primitive-chains.md`
(Terminology Ledger / Audit Snapshot "7 hook event sections") and the
out-of-scope `CLAUDE.md:145` `session-pr-counter.sh`
(workflow-discipline, soc-waxr) are left for follow-up beads.

## Test plan

- [x] `bash scripts/check-hookless-cold-start.sh` → PASS (5 surfaces)
- [x] `bats tests/scripts/check-hookless-cold-start.bats` → 5/5
- [x] `shellcheck scripts/check-hookless-cold-start.sh` → clean
- [x] `bash scripts/audit-codex-parity.sh --skill session-bootstrap` →
passed
- [x] `bash skills/heal-skill/scripts/heal.sh --strict` → clean
- [x] `cd cli && make sync-hooks` → no embedded drift
- [x] `bash scripts/validate-agents-split.sh` → PASS (99 lines)
- [x] `markdownlint --config .markdownlint.json` on changed files →
clean
- [x] No Go changes (build/test unaffected)

Closes-scenario: soc-qh2g1#hookless-cold-start
Bounded-context: BC1-Corpus
Evidence: bash scripts/check-hookless-cold-start.sh; bats
tests/scripts/check-hookless-cold-start.bats
2026-05-28 02:39:04 -04:00