Skip to content

Commit 0e57a70

Browse files
mpstatonclaude
andcommitted
update(context-v, loops): visual pass on the spec-execution loop — mermaid cycle, status lifecycles, ASCII test ladder, artifact-trail tree
The loop doc now shows itself: a mermaid flowchart of the full per-phase cycle with both hard-stop exits (red proof; wrong-not-drifted spec), a stateDiagram of the spec/plan status lifecycles the loop drives, the six-rung test ladder as an ASCII cost/risk column (humans-only rung explicitly separated from the scripted ones), and a tree of the four artifacts + one commit every pass leaves behind, drawn from the proving run's Phase 2. Also names the inversion for next time: this one was codified after the run because no example existed — future loops get their doc BEFORE execution, using this file as the template. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014zrFkWSVgTkoQyiobdBjrd
1 parent 4268f93 commit 0e57a70

1 file changed

Lines changed: 83 additions & 14 deletions

File tree

context-v/loops/Loop-through-Spec-Write-Plans-Implement-Test-Changelog-Commit.md

Lines changed: 83 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ authors:
77
- Michael Staton
88
augmented_with:
99
- Claude Code on Claude Fable 5
10-
semantic_version: 0.0.0.1
10+
semantic_version: 0.0.0.2
1111
proven_on: "[[../specs/Augment-From-DB-Flow]] — five phases, commits 8d141ca..251dda4 + milestone a9a42b0, 2026-07-22"
12+
revisions:
13+
- "2026-07-22 — v0.0.0.2 — visual pass: mermaid loop cycle + status-lifecycle diagram, ASCII test ladder, per-iteration artifact-trail tree. Written retrospectively from the first run, so the diagrams show what happened, not what was hoped."
14+
- "2026-07-22 — v0.0.0.1 — initial codification, same day as the proving run."
1215
tags:
1316
- Loop
1417
- Augment-It
@@ -24,6 +27,11 @@ status: Proven-Once
2427
> `context-v/loops/` is an **experimental** folder (per the context-vigilance
2528
> skill) and this is its first occupant here. Expect the shape to drift as
2629
> more loops get codified.
30+
>
31+
> This one was codified *retrospectively* — the run came first because there
32+
> was no example to write against. **Next time, invert it:** author (or
33+
> update) the loop doc before running, using this file as the template. The
34+
> doc is the durable definition; the session is the execution.
2735
2836
## What this loop is
2937

@@ -39,6 +47,26 @@ is service/data-layer work (surfaces come after their capabilities — this
3947
ordering is what makes later phases UI-only and cheap); a proof-script
4048
convention; the changelog and git-conventions skills.
4149

50+
## The loop at a glance
51+
52+
```mermaid
53+
flowchart TD
54+
SPEC["Spec: Signed-Off,<br/>phases 1..N"] --> PICK["Take next phase"]
55+
PICK --> PLAN["1 · Author plan<br/>re-ground against LIVE code;<br/>correct spec drift explicitly"]
56+
PLAN --> IMPL["2 · Implement<br/>from named in-repo templates"]
57+
IMPL --> TEST["3 · Test, scriptable-first<br/>(the ladder, below)"]
58+
TEST --> GREEN{proof green?}
59+
GREEN -- "no" --> STOP1(["STOP — surface it;<br/>never build a phase on red"])
60+
GREEN -- "yes" --> LOG["4 · Changelog entry<br/>honest about what was NOT tested"]
61+
LOG --> FLIP["5 · Status flips<br/>plan → Shipped + post_ship_note;<br/>spec → Implementing / Shipped"]
62+
FLIP --> COMMIT["6 · Commit + push<br/>attempt(flow, capability, stepN)<br/>explicit paths only"]
63+
COMMIT --> MORE{phases left?}
64+
MORE -- "yes" --> PICK
65+
MORE -- "no" --> MILE["milestone(flow): verdict<br/>empty marker commit"]
66+
MILE --> DONE(["Loop ends.<br/>Usability iteration = a NEW loop"])
67+
PLAN -. "spec turns out WRONG<br/>(not just drifted)" .-> STOP2(["STOP — revise spec<br/>with the user, resume"])
68+
```
69+
4270
## The iteration (one phase per pass)
4371

4472
1. **Author the plan**`context-v/plans/<Spec>-Phase-N-<Name>.md`,
@@ -52,19 +80,25 @@ convention; the changelog and git-conventions skills.
5280
from a named in-repo template (the plan lists which). Service verbs cross
5381
their three files (handler → capabilities map+timeout → typed client
5482
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).
83+
3. **Test, scriptable-first** — climb the ladder, cheapest to dearest;
84+
stop climbing only where the next rung would pollute shared data:
85+
86+
```text
87+
cost/risk ▲ ┌──────────────────────────────────────────────────────┐
88+
6 │ operator browser walk-through ── NAMED, not faked │ humans only
89+
────┼──────────────────────────────────────────────────────┤ ─────────────
90+
5 │ live end-to-end, side-effect-safe only │
91+
│ ✓ stream-scan flip test ✗ test persons in canon │
92+
4 │ container rebuild + raw-NATS proof of new verbs │
93+
│ (the running stack is OLD code until you rebuild) │
94+
3 │ standing regression: prove-<spec>-capabilities.mjs │ every phase,
95+
│ written in Phase 1, re-run every phase │ scripted
96+
2 │ dev-server smoke: curl :PORT/remoteEntry.js │
97+
1 │ builds — each remote + THE SHELL (catches │
98+
│ federation-registration typos) │
99+
0 │ svelte-check + tsc --noEmit on everything touched │
100+
└──────────────────────────────────────────────────────┘
101+
```
68102
4. **Changelog** — one entry per phase, changelog-conventions shape, honest
69103
about what was NOT tested and why.
70104
5. **Status flips** — plan → `Shipped` + `date_first_published` +
@@ -78,6 +112,41 @@ convention; the changelog and git-conventions skills.
78112
like `clients/*` stay untouched for deliberate tidying). Push each phase;
79113
don't batch.
80114

115+
### What one pass leaves behind (the artifact trail)
116+
117+
Every iteration deposits the same four artifacts plus one commit — this is
118+
the proving run's Phase 2, but every phase leaves the identical shape:
119+
120+
```text
121+
augment-it/
122+
├── context-v/
123+
│ ├── specs/Augment-From-DB-Flow.md ← status flip (+ post_ship_note at the end)
124+
│ └── plans/
125+
│ └── Augment-From-DB-Phase-2-….md ← NEW: the plan, → Shipped + post_ship_note
126+
├── changelog/
127+
│ └── 2026-07-22_02_Org-Workbench-….md ← NEW: one entry, honest about untested legs
128+
├── apps/ | services/ | shell/ ← the code, from named in-repo templates
129+
└── (git) attempt(augment-from-db, org-workbench, step2): … ← one pushed commit
130+
```
131+
132+
### Status lifecycles the loop drives
133+
134+
```mermaid
135+
stateDiagram-v2
136+
direction LR
137+
state "Spec" as S {
138+
[*] --> SignedOff
139+
SignedOff --> Implementing: first phase starts
140+
Implementing --> Shipped: last phase lands
141+
note right of Shipped: post_ship_note lists what stays human-only
142+
}
143+
state "Each phase's Plan" as P {
144+
[*] --> Draft
145+
Draft --> Shipped_: proof green, same day
146+
note right of Shipped_: date_first_published + post_ship_note record deviations and skipped checks
147+
}
148+
```
149+
81150
## Exit conditions
82151

83152
- **All phases shipped** → an empty `milestone(<flow-slug>): <verdict>`

0 commit comments

Comments
 (0)