Files
boshu2__agentops/docs/learnings
Bo c6b5be6180 docs(ship-loop): encode 2026-05-19 self-correction learnings into doctrine (soc-7ovd) (#354)
## Summary

Promotes today's 3 local learnings (from `.agents/learnings/`) into
durable doctrine. Encoded:
- 2 new anti-patterns in `skills/ship-loop/references/anti-patterns.md`
(now 8 total)
- Self-verify + bats discipline in the ship-loop 9-step cycle (step 5)
- HAS_<surface> footgun warning at scripts/pre-push-gate.sh
- Durable cross-session learning at
`docs/learnings/2026-05-19-coherent-arc-rule-validation.md`

Closes: soc-7ovd

## Why

Three self-corrections in the 2026-05-19 session each cost an extra PR
cycle:
1. PR #350 claimed eval-canary fix worked; canonical post-merge re-run
showed it didn't → PR #352
2. PR #352's first push broke a bats regression test that guards
fast-mode semantics → re-pushed
3. PR #349 cleaned 6 shellcheck files; PR #353 had to clean 3 more the
full-gate found after #350 landed

All three could have been caught at write-time with the discipline now
encoded here.

## Files

| File | Change |
|---|---|
| `skills/ship-loop/references/anti-patterns.md` | +2 anti-patterns (#7,
#8); header count 6→8 |
| `skills/ship-loop/SKILL.md` | Step 5 strengthened with verify-at-HEAD
+ bats-before-commit |
| `skills-codex/ship-loop/SKILL.md` | Codex twin parity |
| `scripts/pre-push-gate.sh` | +16-line comment header explaining
HAS_<surface> mode-scoping footgun |
| `docs/learnings/2026-05-19-coherent-arc-rule-validation.md` | New
durable learning |
| `skills-codex/.agentops-manifest.json` | Regen (parity hash) |
| `skills-codex/ship-loop/.agentops-generated.json` | Regen (parity
hash) |

## Dogfood

This PR is itself a coherent arc — single rollback semantic ("encode
today's learnings"), 7 tracked file edits + 1 regen. Per the rule that
started this whole arc (#348), shipped as 1 PR.

Also: I ran the bats suite locally (all 55 green) BEFORE pushing —
practicing the very discipline this PR encodes as anti-pattern #8.

## Known drift (not bundled, anti-pattern #2)

Local full-gate FAILs on 3 pre-existing items that are NOT in my diff
and CI does not fail on:
- `worktree disposition` (leftover other-session worktrees on disk)
- `contract canaries` (pre-existing, distinct from eval-canaries)
- `shellcheck` (pre-existing in scripts not touched by #349 or #353)

All filed in evolve-2026-05-19 next-work harvest. Pushing despite per
anti-pattern #2: CI runs differently and these are operator-env
failures.

## Self-verify Evidence (per the new anti-pattern #7)

Targeted claim: the eval-canary skip from PR #352 still works on
canonical post-merge.
Verification: `/tmp/encode-gate.log` shows `AgentOps eval canaries (no
eval changes; set PRE_PUSH_RUN_EVAL=1) (skipped)`. ✅

Bounded-context: BC1-corpus + BC0-foundations
Evidence: `bats tests/scripts/pre-push-gate.bats` → 55 ok; canonical
full gate at HEAD: AgentOps eval canaries skipped per the path filter.

Co-authored-by: Codex <codex@example.invalid>
2026-05-19 16:57:21 +00:00
..

Learnings Index

Durable observations and rules-derived-from-mistakes extracted from live sessions. Each file is a single learning; the date prefix is the day it was captured.

For canonical contracts (what the system SHOULD do), see ../contracts/. For research deep-dives, see ../brainstorms/ or ../research/. Learnings are the "what we learned by running" layer in between.

Catalog (chronological, newest first)

Date File One-line takeaway
2026-05-13 cli-wiring-cycle-shape.md CLI-wiring is a repeatable ~10-min cycle-shape: parent noun + verb subcommand + injectable func; 3 production adapters exposed in 3 cycles.
2026-05-13 loop-context-drift-87-cycle-observation.md /loop context accumulates but disk-state ledger protects correctness — soc-wx55q.1 P1 may be P3.
2026-05-13 substring-sed-rename-overreach.md Before any bulk sed rename, enumerate ALL substring-containing identifiers and classify by concept.
2026-05-13 bc-ports-wire-up-arc.md 12 production adapters in 11 cycles via repeatable file-triplet pattern; 8 distinct adapter shapes proven.
2026-05-12 parity-surface-inventory-grew-from-4-to-7-across-cycles-64-70.md The parity surface count between Claude and Codex grew incrementally; tracking the count caught drift.
2026-05-11 evolve-skill-friction-from-13-cycle-session.md 6 concrete skills/evolve/SKILL.md patches identified from direct cycle-by-cycle observation.
— orchestrator-compression-anti-pattern.md Don't collapse /research → /plan → /pre-mortem into a single inlined call; strict delegation matters.

When to add a learning here

Add a file when one of these is true:

  1. A long arc landed and the lessons are non-obvious. Example: the cycle-122 BC-ports wire-up arc (12 cycles, 8 adapter shapes proven) — future operators reading just the commit messages would miss the meta-pattern. The arc summary captures it.
  2. A mistake produced a rule. Example: the cycle-127 substring- sed overreach learning. The mistake was caught, the corrective commit landed, and the rule that prevents repeating it is now durable.
  3. Empirical observation refines a prior theoretical concern. Example: cycle-132 documented 87 fires of /loop showing the feared context-drop didn't materialize because disk state protects correctness — refining soc-wx55q.1.

Do NOT add a file for:

  • One-off bug fixes (the commit message is enough)
  • Already-canonical-contract material (put it in ../contracts/)
  • Status updates on in-progress work (use bd comment or .agents/evolve/cycle-history.jsonl)

File shape

---
title: <single-sentence statement of the learning>
date: YYYY-MM-DD
tags: [topic1, topic2, ...]
source: <where the observation came from — cycle range, incident, PR>
companion: <optional sibling file>
---

# <repeat title>

<short paragraph: what happened>

## What went wrong / What we learned

<concrete details>

## The rule

<numbered or bulleted, actionable for future cycles>

## See also

<other learnings, contracts, beads>

Frontmatter is required so ao lookup and future indexers can rank. The body shape is a guideline, not a contract — match what the observation demands.