Skip to content

Commit 4268f93

Browse files
mpstatonclaude
andcommitted
new(context-v, loops): codify the spec-execution loop — the first occupant of the experimental loops/ folder
Retrospective codification of the cadence that took Augment-From-DB-Flow from Signed-Off to Shipped in one session: per phase — author the plan against the LIVE code (correcting spec drift explicitly), implement from named in-repo templates, test scriptable-first up the ladder (typecheck → builds → smoke → container rebuild + raw-NATS proof → standing regression script → side-effect-safe live e2e), changelog honestly, flip statuses with post_ship_notes, commit as attempt(<flow>, <capability>, stepN) and push per phase. Exit: milestone() marker when the spec runs dry; hard stop if a proof won't go green. Carries the first run's hard-won rules: quote YAML revisions entries (the "mapping values are not allowed" bite), the proof script as the loop's spine, svelte-check catching what builds don't, seams-before-code, splash content's git add -f trap, and NATS-verbs-not-shared-DB for cross-service reads. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014zrFkWSVgTkoQyiobdBjrd
1 parent a9a42b0 commit 4268f93

1 file changed

Lines changed: 121 additions & 0 deletions

File tree

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
title: "Loop through a spec — write the plan, implement, test, changelog, commit, repeat until Shipped"
3+
lede: "The phase-execution loop that took Augment-From-DB-Flow.md from Signed-Off to Shipped in one day: each spec phase becomes a plan authored against the live code, executed immediately, proven as far as scripts can reach, changelogged, and pushed as its own attempt() commit — with a milestone() marker when the spec runs dry."
4+
date_created: 2026-07-22
5+
date_modified: 2026-07-22
6+
authors:
7+
- Michael Staton
8+
augmented_with:
9+
- Claude Code on Claude Fable 5
10+
semantic_version: 0.0.0.1
11+
proven_on: "[[../specs/Augment-From-DB-Flow]] — five phases, commits 8d141ca..251dda4 + milestone a9a42b0, 2026-07-22"
12+
tags:
13+
- Loop
14+
- Augment-It
15+
- Spec-Driven
16+
- Plans
17+
- Changelog-Conventions
18+
- Git-Conventions
19+
status: Proven-Once
20+
---
21+
22+
# Loop through a spec — plan → implement → test → changelog → commit
23+
24+
> `context-v/loops/` is an **experimental** folder (per the context-vigilance
25+
> skill) and this is its first occupant here. Expect the shape to drift as
26+
> more loops get codified.
27+
28+
## What this loop is
29+
30+
A per-phase execution cadence for a spec that is already **Signed-Off** and
31+
decomposed into phases. The spec is the contract; each iteration turns one
32+
phase into a plan, lands it, proves it, records it, and pushes it — so the
33+
repo is never more than one phase away from a green, documented, pushed
34+
state. First proven on [[../specs/Augment-From-DB-Flow]] (five phases in one
35+
session, 2026-07-22).
36+
37+
**Preconditions:** a Signed-Off spec with a phase decomposition whose Phase 1
38+
is service/data-layer work (surfaces come after their capabilities — this
39+
ordering is what makes later phases UI-only and cheap); a proof-script
40+
convention; the changelog and git-conventions skills.
41+
42+
## The iteration (one phase per pass)
43+
44+
1. **Author the plan**`context-v/plans/<Spec>-Phase-N-<Name>.md`,
45+
`spec_reference` in frontmatter. Before writing steps, **re-ground
46+
against the live code**: read the exact files the phase touches. Where
47+
reality diverges from the spec's anticipated snippets, the plan corrects
48+
the spec and says so explicitly (Phase 1 found three such divergences;
49+
Phase 2 found a whole missing verb). The plan names its verification
50+
before implementation starts.
51+
2. **Implement** — smallest dependency-ordered steps, every new file copied
52+
from a named in-repo template (the plan lists which). Service verbs cross
53+
their three files (handler → capabilities map+timeout → typed client
54+
wrapper); remotes follow the scaffold of the newest shipped remote.
55+
3. **Test, scriptable-first** — the ladder, cheapest to dearest:
56+
- svelte-check / `tsc --noEmit` on everything touched;
57+
- builds (each remote + the shell — the federation host build is the
58+
regression that catches registration typos);
59+
- dev-server smoke (`curl :PORT/remoteEntry.js`);
60+
- **rebuild the touched service containers** (the running stack is old
61+
code until you do) and prove new verbs over raw NATS;
62+
- re-run the standing proof script as a regression
63+
(`scripts/prove-<spec-slug>-capabilities.mjs` — Phase 1 writes it,
64+
every later phase re-runs it);
65+
- live end-to-end where it's side-effect-safe (the stream-scan flip
66+
test); **never** where it pollutes shared data (no test persons in the
67+
canonical layer — name the operator walk-through instead of faking it).
68+
4. **Changelog** — one entry per phase, changelog-conventions shape, honest
69+
about what was NOT tested and why.
70+
5. **Status flips** — plan → `Shipped` + `date_first_published` +
71+
`post_ship_note` recording deviations and skipped checks; spec →
72+
`Implementing` on the first phase, `Shipped` (+ post_ship_note listing
73+
what remains human-only) when the last phase lands.
74+
6. **Commit + push** — one commit per phase:
75+
`attempt(<flow-slug>, <capability>, stepN): <impact-first headline>`,
76+
body per git-conventions (why before how, proof summary included). Stage
77+
explicit paths only — never sweep in unrelated dirty state (submodules
78+
like `clients/*` stay untouched for deliberate tidying). Push each phase;
79+
don't batch.
80+
81+
## Exit conditions
82+
83+
- **All phases shipped** → an empty `milestone(<flow-slug>): <verdict>`
84+
marker commit naming the step range and the known follow-ups. Then stop —
85+
usability iteration is a NEW loop with its own findings, not a tail on
86+
this one.
87+
- **A phase's proof won't go green** → stop the loop, surface it; don't
88+
proceed to a phase that builds on red.
89+
- **The spec turns out wrong mid-phase** (not just drifted — wrong) → stop,
90+
revise the spec with the user, resume.
91+
92+
## Hard-won rules (from the first run)
93+
94+
- **Quote YAML `revisions:` entries.** Any list item containing `: ` breaks
95+
standard YAML parsers ("mapping values are not allowed in this context").
96+
Double-quote every revision string at write time — this bit four files,
97+
two of them pre-existing.
98+
- **The proof script is the loop's spine.** Written once in Phase 1, re-run
99+
every phase; it converts "did we break the floor?" from a worry into a
100+
ten-second check.
101+
- **svelte-check is not optional even when the build passes** — it caught a
102+
prop declared in a type but missing from the destructure that rsbuild
103+
happily bundled.
104+
- **Existing seams beat new machinery.** Phase 5 was a half-day because
105+
`curated_index_urls` already existed; the plan-authoring step's job is to
106+
find that seam BEFORE writing code.
107+
- **Splash content needs `git add -f`** (the `.gitignore` `content` rule
108+
silently drops `splash/src/content/*`), and splash deploys only from
109+
`main` — a card authored on a work branch ships at reconciliation.
110+
- **Cross-service needs go through NATS verbs, never shared DB access**
111+
the dedup read (`content.urls.check`) is the pattern, per the domains.ts
112+
precedent.
113+
114+
## Related
115+
116+
- [[../specs/Augment-From-DB-Flow]] — the proving run's spec (Shipped)
117+
- [[../plans/Augment-From-DB-Phase-1-Service-Capabilities]] through
118+
[[../plans/Augment-From-DB-Phase-5-Stream-Scan-Mode]] — the five iterations
119+
- `changelog/2026-07-22_01``_05` — the paper trail, one per pass
120+
- context-vigilance skill §Experimental tier — what `loops/` is for;
121+
changelog-conventions + git-conventions skills — the formats steps 4 and 6 follow

0 commit comments

Comments
 (0)