feat(method): six-phase-loop — 8→6 phase merge, bundle-disclosed guides, persona presets, build-entry spec echo#148
Merged
Conversation
TinDang97
added a commit
that referenced
this pull request
Jul 14, 2026
CI fresh-checkout failure on PR #148: test_engine_twins_carry_the_echo asserted parity on the two gitignored dogfood twins (.add/tooling/ and add-method/.add/tooling/), which do not exist on a fresh clone — the known gitignored-twins class (build-strategy-facets lesson). The tracked _bundled twin now binds unconditionally; the dogfood twins are checked only when present (fresh-checkout skip-tolerance precedent ba09498). No assertion weakened where the files exist. refs: six-phase-loop milestone, PR #148 author: Tin Dang <tindang.ht97@gmail.com>
9ed0412 to
e35c85d
Compare
8->6 phase merge (specify absorbs scenarios; verify absorbs observe) + phase-guide disclosure into the bundle-owning roster agents so the orchestrator loads only SKILL.md + per-phase persona presets + the build-entry spec echo. Human decisions from the 2026-07-14 interview recorded in Ground; tasks gated until milestone-confirm. refs: milestone six-phase-loop (await-confirm) author: Tin Dang <tindang.ht97@gmail.com>
…x-phase-loop 1/6) TRUE phase merge, first of two (human-decided over recipe-ticks): the scenarios PHASE folds into specify — one drafting phase now produces §1 rules AND §2 Given/When/Then. The TASK.md §-section shape is UNTOUCHED (sections are the stable API; only the lifecycle list shrinks). Engine (synced x3 — tooling · .add/tooling · _bundled): - constants.py: PHASES=(specify,plan,tests,build,verify,observe,done); _SKIPPABLE_PHASES=(observe,); PHASE_GUIDE specify action gains the Given/When/Then duty; PHASE_OWNER/PHASE_AGENT drop scenarios; PHASE_GROUPS DIRECTION=(specify,plan,tests) - add.py: _normalize_phase_tokens legacy map gains scenarios->specify (silent, TOTAL, idempotent, normalize-on-read — expectations-first precedent); _FRONT_PHASES/(spawn-hints/guide-file map/freeze early-phase check/skip-rationale regex follow); _RETIRED_SKIP_TOKENS: a pre-merge `skips: scenarios` header is tolerated LOUD (note at the observe crossing, filtered from the skip set) while non-skippable tokens keep the die — the frozen M13 pin (zero skip logic on non-skippable crossings) holds; task_phases: explicit _PHASE_SECTIONS table replaces the index-derived n->section mapping (the named off-by-one trap, hit live) - installer showcase twins (bin/cli.js BRAND_LOOP · _installer.py _LOOP): 6-step loop, grounded by test_onboarding_brand Tests: NEW test_phase_merge_specify.py (8 red->green: phase list + maps, advance lands plan, scenarios refused, legacy state normalizes, old skip declaration tolerated loud, bad token still dies). ~30 fixture suites repaired as the declared sequence-shift ripple (test_min_pillar walk now 4 advances to verify; test_add advance pin; onboarding showcase slice; report dots; phase-detail blocks; fast-lane skips rewritten to observe) — zero tests weakened. Full fence 3517/3517 OK. Pins: ENGINE_MD5 -> b27ce845 · ENGINE_PKG_MD5 -> 870a4ce0 · SEAMS _declared_scope anchor -> add.py:5631. Gate: PASS (compound tick from build; scope widened +installer twins via sanctioned re-cross). refs: six-phase-loop milestone (37d5a80), stacked on feat/call-floor (#147) author: Tin Dang <tindang.ht97@gmail.com>
…ase-loop 2/6)
The second TRUE phase merge: the observe PHASE folds into verify — verify owns
evidence + gate AND the watch/spec-delta duty. §7 OBSERVE stays as a section
(the stable API) rendered under the verify block, exactly as §2 renders under
specify. The lifecycle is now specify · plan · tests · build · verify (+ done).
Engine (synced x3):
- constants.py: PHASES=(specify,plan,tests,build,verify,done);
_SKIPPABLE_PHASES=() — nothing is skippable; PHASE_GUIDE verify action
gains the watch+spec-delta duty; PHASE_GROUPS VERIFY=(verify,);
PHASE_OWNER/PHASE_AGENT drop observe
- add.py: _legacy gains observe->verify (normalize-on-read; a recorded gate
survives); _RETIRED_SKIP_TOKENS={scenarios,observe}; the cmd_advance skip
block PRUNED whole (dead once the tuple emptied — the old M13 zero-skip-
logic placement is now universal); gate/completion is the ONE seam that
reads a vestigial `skips:` header (one loud note, never a die) and the new
home of the fold nudge; advance --fill + status --section resolve through
_PHASE_SECTIONS (verify: (6,7)) — repairing the two ordinal->section
mappings that broke silently at phase-merge-specify (plan filled §2, not
§3); membership lists/spawn hints/guide map/help text swept
- templates: the fast template's skips scaffold removed (grammar retired
end-to-end); both templates' phase-marker comments show the 6-token flow
- installer showcase twins: BRAND_LOOP/_LOOP = 5 pre-done steps
Tests: NEW test_phase_merge_verify.py (13: list+maps, advance/gate land done
with the fold nudge, observe refused, legacy state normalizes keeping its
gate, vestigial skips noted at gate never die, _PHASE_SECTIONS + --fill/
--section table pins). Fence r1 ripple: 49 failures/17 suites repaired —
test_fast_lane_skips REWRITTEN to pin the retirement (resolver keeps naming
bad tokens; historic recorded skips keep status/audit surface); fold nudge
test re-aimed to gate; report dots 6-wide; phase-detail 5 blocks with §7
under verify; onboarding showcase 5 steps; len/range pins swept. Zero tests
weakened. Full fence 3527/3527 OK.
Pins: ENGINE_MD5 -> 5d5e0538 · ENGINE_PKG_MD5 -> fc40ad47 · SEAMS
_declared_scope anchor -> add.py:5603. Gate: PASS (compound tick from build;
the new fold nudge printed on this task's own gate — self-proved).
refs: six-phase-loop milestone, stacked branch feat/six-phase-loop
author: Tin Dang <tindang.ht97@gmail.com>
…six-phase-loop 3/6) The skill's guide tree follows the engine's merged lifecycle: 1-specify.md absorbs 2-scenarios' load-bearing duties (gherkin Given/When/Then format, one scenario per Must AND per Reject, the And-unchanged clause on every rejection, the edge-case sweep, the exit-gate boxes); 6-verify.md absorbs 7-observe's as a post-gate Observe block (scope-of-impact release, scenarios-as-monitors, the next SPEC delta, the voice-delta -> soul.md route, the persona tag line, the self-improve.md map pointer). The two absorbed files are DELETED from all three guide trees. SKILL.md's phase table shows the 6-row loop (specify row owns §1+§2, verify row §6+§7); 9355 B, under the orient-split 9500 ceiling. soul.md re-routes its Emit line to the verify guide. Pools: phases baseline re-anchored 41605 -> 40205 — the INVERSE of the rebaseline-for-new-surface method: deletion is won ground the ceiling locks in, so the baseline shrinks by NET won bytes ÷ ratio (deleted 3855 B minus the absorbing guides' +2735 B = 1120 net; −⌈1120/0.80⌉=1400), ratio 0.80 kept exactly. test_ground_anchor_sha's baseline floor forward-migrated 40280 -> 40205 with the accounting signed. Tests: NEW test_guide_recut.py (8: deletion ×3 trees · duty markers in both absorbing guides · no live prose names a deleted file · table rows/§-spans · ceiling held). Ripple: 11 failures/10 suites re-aimed (wording-surface census 32→30 in two pins; soul/persona/ADR/xml-census/per-step-hook pins moved onto the absorbing guides; pool lists trimmed). Zero tests weakened. Full fence 3535/3535 OK. Engine untouched — no MD5 re-aim. refs: six-phase-loop milestone, stacked branch feat/six-phase-loop author: Tin Dang <tindang.ht97@gmail.com>
… agents (six-phase-loop 4/6) The user's directive made mechanism: when the orchestrator delegates a phase, the roster bundle agent loads its OWN phase guides at spawn — the orchestrator reads only SKILL.md. The inline lane stays first-class (load the one phase guide yourself, unchanged). - add-design.md: NEW "Load your bundle guides" section (phases/0-setup.md on fresh projects + phases/1-specify.md + phases/3-plan.md); span prose re-cut to setup · specify · plan (grounding/scenarios/contract live inside them); description spawn steps -> SETUP, SPECIFY, or PLAN; Return enum follows - add-build.md: loads phases/4-tests.md + phases/5-build.md at spawn - add-verify.md: loads phases/6-verify.md (carries the post-gate Observe block); owns verify end-to-end — OBSERVE is no longer a spawn step; Return enum verify-only - SKILL.md flow lead-in states the split in one sentence: inline -> load only the phase you are in; delegating -> the Bundle-column agent loads its own guides, you read ONLY this file. 9442 B, under the orient-split 9500 ceiling. Synced x3 skill trees; agents synced canonical -> _bundled + .claude installed copies. Tests: NEW test_bundle_disclosure.py (6: per-agent guide census · no deleted guide or retired step name — path-qualified, docs chapters keep their names · disclosure sentence · ceiling · x2 parity). Full fence 3541/3541 OK. Engine untouched — no MD5 re-aim. refs: six-phase-loop milestone, stacked branch feat/six-phase-loop author: Tin Dang <tindang.ht97@gmail.com>
…ces (six-phase-loop 5/6) The interview decision made mechanism: per-phase expertise via PRESETS on the lean 5-agent roster, not a per-step agent rebuild. Each bundle agent's thin "use a generic engineer" fallback upgrades to named expert stances per owned phase, distilled from the vendored teacher library: - add-design.md: Preset (specify) — a 15-year domain analyst who asks rather than assumes, every Reject earns a named error code (setup rides this); Preset (plan) — a systems architect, contract-first, cites only anchors that exist, sizes the change's reach before freezing scope - add-build.md: Preset (tests) — red for the RIGHT reason, one test per scenario, behavior never internals; Preset (build) — the smallest honest diff in small reviewable batches, a test is never touched to go green - add-verify.md: Preset (verify) — adversarial reviewer then reliability analyst, refutes the green before trusting it, security always HARD-STOP, spans the post-gate Observe duties (§7) Presets are the FALLBACK tier only: project-persona routing stays first (the flow: selection sentence untouched); a preset never blocks and never lowers a gate. Synced canonical -> _bundled + .claude installed copies. Tests: NEW test_persona_presets.py (4: per-phase preset census · no bare generic fallback left · routing-first + never-lowers-a-gate survive · x2 parity). Full fence 3545/3545 OK. Engine untouched. refs: six-phase-loop milestone, stacked branch feat/six-phase-loop author: Tin Dang <tindang.ht97@gmail.com>
…WHAT to build (six-phase-loop 6/6) The interview decision made mechanism: at every successful tests->build tick the engine prints `build to (frozen plan):` + the §1 Must/Reject bullet first-lines + the frozen §3 contract-fence head, so the builder starts from the spec on the screen, not from memory. - add.py: NEW _spec_echo (PURE read beside _scope_echo; bullet walk stops at the next top-level `Key:` line, continuations never echo) + a wrapped tail call in _build_entry — AFTER every guard and snapshot, so a refused entry never echoes and BOTH entries (advance + the `phase build` override) fire; fail-open: exit code, state.json, and TASK.md are identical either way - ENGINE_MD5 re-aimed bf89b033; ENGINE_PKG_MD5 deliberately NOT re-aimed (add_engine/ untouched — the digest proved it unchanged); SEAMS _declared_scope pin 5603->5653; engine synced x3 twins - SELF-PROVED: the task's own re-cross into build rendered its Must/Reject/ contract echo live Tests: NEW test_build_entry_spec_echo.py (9: echo at advance + at the phase override · line order · forced-raise never blocks the tick · malformed §1/§3 partial-echo no-crash · refused crossing never echoes · --skip-freeze DRAFT crossing still echoes · pure-read byte check · engine-twin parity). Full fence 3554/3554 OK. LESSON: declare §4 tests as the exact FILE — a dir-form declaration sweeps the build targets into the tamper snapshot (recovered via signed re-cross, the expectations-first recipe). refs: six-phase-loop milestone, stacked branch feat/six-phase-loop author: Tin Dang <tindang.ht97@gmail.com>
…t criteria evidenced Milestone close-review bookkeeping: all six task boxes checked, seven exit criteria checked with (verify: ...) citations (test suites + fence 3554/3554 + the self-proved build-entry echo), rationale placeholder filled with the confirmed intake classification. The goal-gate holds the milestone OPEN on the eighth criterion — the paid WM1 re-measure (fid >= 0.97, calls <= 12) — which is human-gated: run or accept-partial. refs: six-phase-loop milestone, stacked branch feat/six-phase-loop author: Tin Dang <tindang.ht97@gmail.com>
CI fresh-checkout failure on PR #148: test_engine_twins_carry_the_echo asserted parity on the two gitignored dogfood twins (.add/tooling/ and add-method/.add/tooling/), which do not exist on a fresh clone — the known gitignored-twins class (build-strategy-facets lesson). The tracked _bundled twin now binds unconditionally; the dogfood twins are checked only when present (fresh-checkout skip-tolerance precedent ba09498). No assertion weakened where the files exist. refs: six-phase-loop milestone, PR #148 author: Tin Dang <tindang.ht97@gmail.com>
bb80287 to
8360b06
Compare
| # echoes; fail-open, so exit code, state, and TASK.md are identical either way. | ||
| try: | ||
| _spec_echo(root, slug) | ||
| except Exception: |
| # echoes; fail-open, so exit code, state, and TASK.md are identical either way. | ||
| try: | ||
| _spec_echo(root, slug) | ||
| except Exception: |
pilotspacex-byte
added a commit
that referenced
this pull request
Jul 14, 2026
…als follow-on draft (#150) Human decisions 2026-07-14: run the paid WM1 re-measure, then "Close + draft follow-on milestone". - WM1 re-measure (3 reps, pinned sonnet meter, engine = merged main 8360b06): fidelity 0.98 x3 / 0 regressions / oracle 1.0 -> criterion MET; calls 20.7 mean vs <=12 -> UNMET, HUMAN-ACCEPTED-PARTIAL at close; cost $3.17 mean = cheapest honest ADD round (-10% vs ceremony). Full record + waste anatomy: benchmark/results/2026-07-sixphase-remeasure.md (runs archived benchmark/runs/sixphase-r{1,2,3}). - six-phase-loop -> done (RETRO.md written; 21 open deltas left for the human fold review). - NEW milestone draft call-residuals (--await-confirm, tasks gated): the four message-layer levers the anatomy named — init-idempotent-nudge · scope-first-draft · status-orientation-diet · help-habit-kill — targeting the ~11-12 call landing with zero enforcement-path changes. refs: six-phase-loop close, PRs #146/#149/#148 merged author: Tin Dang <tindang.ht97@gmail.com> Co-authored-by: Tin Dang <tindang.ht97@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
six-phase-loop — TRUE 8→6 phase merge + guides disclosed into bundle subagents
Stacked on #147 (
feat/call-floor). Born from the operator's asks: "compress steps 1-2 and 6-7" · "make expert subagents for each step" · "disclose step skills into the subagents, not the main agent". All four design decisions were interview-confirmed before drafting (recorded in MILESTONE.md Ground).Close review: 6/6 tasks gate PASS · 7/8 exit criteria evidenced with
(verify:)citations · HELD OPEN on the paid WM1 re-measure (human-gated). Full fence 3554/3554 OK, zero tests weakened; suite grew 3508→3554.Every commit (pre-squash census)
37d5a80fa12a4d_PHASE_SECTIONSexplicit table kills the phase-index-vs-§-section off-by-one class8467b46specify·plan·tests·build·verify·done); skip grammar RETIRED whole (_SKIPPABLE_PHASES=(), vestigialskips:noted loud at gate, never a die); legacy phase tokens normalize-on-read;--fill/--sectionrepaired onto the table7ffdd2de3e0164be74a90Preset (<phase>):stances replace the thin generic fallback; project-persona routing stays first; never lowers a gate514df5f_spec_echo, pure read, fail-open tail of_build_entry, both entries) — self-proved live on its own re-cross16bbf27Pins & floors
ENGINE_MD5 →
bf89b033(PKG pin correctly NOT re-aimed —add_engine/digest unchanged at guide/agent tasks touched no engine) · SEAMS_declared_scopepin → :5653 · 3-tree skill parity + agents canonical→_bundled→.claudeparity test-pinned · gate semantics byte-identical (one recorded outcome, security HARD-STOP, tamper/scope guards untouched).What is proven vs pending
LESSON recorded: declare §4 tests as the exact FILE — a dir-form declaration sweeps build targets into the tamper snapshot (recovered via signed
re-cross, the expectations-first recipe).