Skip to content

feat(method): expectations-first plan phase + plan-legibility + quality-floors (3 milestones, supersedes #144)#145

Merged
pilotspacex-byte merged 16 commits into
mainfrom
feat/flow-reorder
Jul 13, 2026
Merged

feat(method): expectations-first plan phase + plan-legibility + quality-floors (3 milestones, supersedes #144)#145
pilotspacex-byte merged 16 commits into
mainfrom
feat/flow-reorder

Conversation

@pilotspacex-byte

Copy link
Copy Markdown
Contributor

Summary

Three closed method milestones on one branch, all gate-PASS with the full suite green (3446 tests at the tip). Supersedes #144 — the quality-floors commits are included here verbatim.

Milestone Tasks Close What shipped
quality-floors 3/3 ad950c2 4 zero-turn input-dialect floors (wm2 benchmark miss → mechanical checks)
expectations-first 4/4 65bc276 collapse ground+contract into ONE plan phase; 8→7 work phases, one freeze
plan-legibility 2/2 ca86bf1 freeze report surfaces the build-strategy plan-of-action; structured task+milestone relations

expectations-first — the headline change

The lifecycle is reordered to expectations-first. The former ground and contract phases collapse into one plan phase that carries the single human freeze:

specify → scenarios → plan → tests → build → verify → observe → done
                       └─ ground + freeze contract + build strategy, ONE approval (plan→tests)
  • specify/scenarios become LIGHT projections of a milestone-level ## Ground (gathered once), not re-grounded per task.
  • The grounding floor is preserved: the frozen contract may cite only anchors named in the plan's ### Grounding sub-block.
  • Legacy ground/contract task states still load (migrate to specify/plan).

Shipped across three domains: tooling (PHASES reorder, freeze move, §3 PLAN sub-block template ×4 twins, state migration, MILESTONE.md ## Ground), skill (phases/3-plan.md unifies the retired 0-ground + 3-contract guides; SKILL.md + sibling guides read the 7-phase order), book (ch02 flow + mermaid + CHECKLIST; GLOSSARY defines Plan + redefines Ground as Plan's first part + a Contract "within Plan" nod; appendix-g + diagram render-source; a stale-prose grep-guard pins it).

quality-floors (was #144)

4 zero-turn floors closing the wm2 input-dialect benchmark class: spec-dialect floor (the red suite must speak the contract's own example formats), a fast-lane Boundary: line (freeze refuses an undeclared input-format boundary), a §6 dialect check line, and datetime/money/tz ⇒ data vocabulary. Balance principle: quality via floors, never re-added ceremony.

plan-legibility

  • plan-in-report — the freeze/DECIDE report now surfaces the §3 build-strategy plan-of-action, so the human can follow the AI's plan before approving.
  • relations-surface — structured --depends-on / --extends / --relates-to edges at both task and milestone level; check validates them (advisory dangling/self guard; the wave DAG stays depends_on-only).

Verification

  • Full suite 3446 green at the tip (PYTHONDONTWRITEBYTECODE=1 python3 -B -m unittest discover).
  • ENGINE_MD5 → 9311ec35 · ENGINE_PKG_MD5 → 28212a55, re-pinned across ×4 engine twins.
  • ×3/×4 tree byte-parity holds (engine, templates, book docs).
  • Each of the 9 tasks gate=PASS; 3 RETRO.md exit reports written.

Not in this PR (human-gated follow-ups)

  • add.py fold — 27 open SPEC deltas + 21 learnings (mostly add-bench) to review before folding into the foundation.
  • archive-milestone for the closed milestones.
  • add-flow.png raster regen — image-model visual gate (diagram source prompt-flow.txt is updated here; the raster is a human step).

Test plan

  • full suite green (3446)
  • engine MD5s re-pinned + twin byte-parity
  • grep-guards pin the book/guide/diagram alignment
  • human review + merge

author: Tin Dang tindang.ht97@gmail.com

TinDang97 added 14 commits July 11, 2026 00:35
…act's own example formats (quality-floors 1/4)

Closes the WV1 wm2 failure CLASS for ~zero turns (benchmark evidence:
an arm's own suite stayed green on naive timestamps while the spec's
examples were Z-suffixed — the aware/naive crash shipped green at 0.80):

- add_engine/constants.py: _DIALECT_CLASSES closed registry (v1: one
  class, aware-iso-timestamp; full-shape regex — bare dates never
  match), named in __all__ like _GATE_MODES.
- add.py: _dialect_gaps PURE helper (frozen section-3 body vs declared
  section-4 test files, fail-open) + a print-only tests->build crossing
  warning naming the class and the re-cross repair (never refuses;
  exit/state byte-identical) + a dialect_gap WARN in check over ACTIVE
  build/verify/done tasks (measure-not-block).
- 6 red-first pins (test_spec_dialect_floor.py, live-CLI board harness);
  three trees byte-identical; ENGINE_MD5 7f96609e / PKG 710a009f;
  SEAMS x17 re-pin. Full tooling suite 3367 green.

Tripwire lesson recorded in-task: a bare directory token in section-4
"Tests live in:" sweeps add.py itself into the tamper snapshot — the
build's own target must never be declared as a test file (honest redo
via TESTS re-cross, attempt 1).

Task: spec-dialect-floor (oneshot lane, AI-plan-verify freeze @v1),
milestone quality-floors.
author: Tin Dang
…lary (quality-floors 3+4)

Task dialect-check-and-data-vocab (quality-floors levers 3+4, gate PASS,
frozen @v1 via ai-plan-verify). Two more zero-turn floors closing the
wm2 input-dialect class from the WV1 benchmark:

- TASK.md.tmpl `### Deep checks` gains the DIALECT line ("tests speak
  the same value formats the spec's examples use") — audit-counted by
  the existing `shallow` machinery, zero engine code; TASK.fast.md.tmpl
  §6 gains the condensed twin ("input dialect held").
- GLOSSARY.md.tmpl `## Sensitivity classes` + this project's
  .add/GLOSSARY.md + sensitivity.md skill guide gain the PROSE rule:
  datetime, money, or timezone arithmetic ⇒ declare `data` (full lane),
  wm2 evidence cited. No new sensitivity token minted —
  _project_sensitivity_domain proven () over a fresh render.
- Byte fences held by compression, not rebaseline: TASK.md.tmpl 11391B
  (≤11400), skill pool/tree back under 51885/145974 via ~183B trimmed
  from sensitivity.md prose.
- 5 sibling pins amended via an explicit TESTS re-cross, as the frozen
  least-sure flag predicted: 4 Deep-checks fixtures now fill the
  DIALECT placeholder (guarantee-lints, advisor-review-step,
  advisor-verdict-audit, verify-record-rollup); fast-lane-skips'
  task-local empty-git-diff guard re-pinned to its durable invariant
  (skip machinery stays fast-lane-only).
- New red suite test_dialect_vocab_lines.py (6 pins). All twins synced
  incl. the 4th gitignored dogfood tree. Full suite 3374 passed.
- §6 OBSERVE: lever-1 false positive found dogfooding — _dialect_gaps
  scans §3 raw body incl. the engine's own freeze timestamp; left as an
  open SPEC delta.

refs: quality-floors milestone (task 2/3) · benchmark/results/2026-07-wv1-rep0.md
author: Tin Dang
… input-format boundary (quality-floors 2)

Task fast-lane-boundary-line (quality-floors lever 2, gate PASS, frozen
@v1 via ai-plan-verify). The last of the 4 zero-turn floors closing the
WV1 wm2 input-dialect class:

- TASK.fast.md.tmpl §1 gains, directly after Accept:, a `Boundary:`
  line — >=1 format-variant per external input shape the tests must
  speak (e.g. aware vs naive timestamp), or an explicit "none — no
  external input".
- cmd_freeze refuses a task whose Boundary value is still the bare
  template placeholder (or empty): `boundary_unfilled`, fired in the
  shared validate block directly after unflagged_freeze — BOTH freeze
  paths (human and --ai-plan-verify), validate-then-write (zero bytes
  land on refusal). A task with NO Boundary: line is grandfathered:
  legacy fast tasks and the full lane gain no new refusal. Placeholder
  rule = empty or bare unfenced `<...>`, backtick-exempt (mirrors
  _section_unfilled).
- New red suite test_fast_boundary_line.py (9 pins, live-CLI board:
  refusal exit codes + byte-identical state on refusal + both paths +
  grandfathering + §3-fence text never triggers).
- 2 test_fast_lane_skips fixtures amended via an explicit TESTS
  re-cross (they freeze fresh-rendered fast tasks, which now scaffold
  the placeholder line): shared _fill_boundary helper.
- ENGINE_MD5 re-aimed 16cd7cca (prior 7f96609e); SEAMS
  scope-token-grammar pin x18 (:5337); add.py + fast template synced
  across all twins incl. the 4th dogfood tree. Full suite 3383 passed.

refs: quality-floors milestone (task 3/3) · benchmark/results/2026-07-wv1-rep0.md
author: Tin Dang
…hipped)

All 4 human-picked input-dialect floors from the WV1 wm2 miss are live
and gated PASS:
  1. spec-dialect floor      (f9d2303) — tests->build dialect_gap warning
  2. fast-lane Boundary line  (b2483be) — freeze refuses boundary_unfilled
  3. §6 dialect check line     (bb72452) — Deep-checks DIALECT bullet
  4. datetime/money/tz => data (bb72452) — sensitivity vocabulary

milestone-done wrote RETRO.md; archive-milestone removed it from active
state (files on disk untouched). Balance principle held: every floor is
a ~zero-turn mechanical check at an existing seam — the lean lane keeps
its cost, the failure class is closed without re-added ceremony.

One SPEC delta left open (task 2 gate record): lever 1's _dialect_gaps
scans the §3 raw body incl. the engine's own freeze timestamp, a
self-referential false positive found dogfooding — candidate future task.

refs: quality-floors milestone
author: Tin Dang
… the plan phase (engine core)

Reorder the task lifecycle to expectations-first. The 9-phase flow
(ground→specify→scenarios→contract→tests→build→verify→observe→done) becomes an
8-phase flow (specify→scenarios→plan→tests→build→verify→observe→done): grounding,
the frozen contract, and the build strategy unify into ONE `plan` phase carrying the
single human freeze. Specify/scenarios become light projections of a milestone-level
Ground + the request — no re-grounding per task.

Engine core (this commit; the existing-test migration follows):
- constants.py: PHASES/PHASE_GROUPS/PHASE_OWNER/PHASE_AGENT/PHASE_GUIDE re-pointed;
  DIRECTION = (specify,scenarios,plan,tests); plan owner = seam; fallback templates.
- add.py: freeze allowed at >= plan; the freeze gate MOVES from tests->build to the
  plan->tests crossing (the red suite is written FROM the frozen contract), with a
  recorded --skip-freeze that carries through _build_entry; _grounded_state / ground
  anchor-SHA / scope-lock read §3 PLAN sub-blocks; _FRONT_PHASES names plan; decide-seam
  label PLAN; legacy load maps ground->specify, contract->plan (fail-soft _phase_index +
  idempotent _normalize_phase_tokens on read). The cross-component contract system is
  UNTOUCHED (only the phase token changed).
- templates: §0 GROUND removed; §3 PLAN carries ### Grounding / ### Contract (first fence,
  tamper-HARD) / ### Build-strategy (SOFT); §5 BUILD is execution-only.
- engine_pin: ENGINE_MD5 re-aimed to 07659b10; 3-tree byte parity held.
- test_plan_phase_flow.py: new red/green suite (16 tests) pinning the whole change.

author: Tin Dang <tindang.ht97@gmail.com>
…hase + harden the engine

Second half of plan-phase-core: migrate every existing test to the new 8-phase flow
(specify→scenarios→plan→tests→build→verify→observe→done) and fix the engine defects the
migration surfaced. 274 red → green with no weakened assertion; 3399 tests pass.

Test migration (61 files, 8 themed batches):
- phase tokens (ground→specify, contract→plan), advance counts (specify→build = 4), and the
  §-heading renames (§0 GROUND gone; §3 CONTRACT→PLAN with Grounding/Contract/Build-strategy
  sub-blocks) re-pointed across grounding, freeze-gate, fast-lane, cross-component, bundle/advance,
  template, ai-plan-verify, and strategy/persona suites. Fixtures re-pointed to the new locations;
  facts genuinely removed updated to new-truth; the cross-component contract SYSTEM stayed untouched.

Engine hardening (defects the 9→8 PHASES shrink introduced, all found by the migration):
- task_phases / advance --fill / status --section used the phase ordinal as the literal §-number;
  now map ordinal→section (n+1) since §0 is gone. Fixes the phase-detail off-by-one + IndexError.
- render_task_detail's hardcoded `p["n"] == 6` verify branch → keys on phase name.
- ADR facet harvest read §5; the facets moved to §3 ### Build-strategy → reads §3.
- _build_entry's freeze-skip carry-through leaked into re-cross (a DRAFT §3 could re-cross); a new
  require_frozen flag makes re-cross re-assert the freeze — "re-cross is never a freeze bypass" holds.
- skip-rationale read the dead §0; now reads the task header (where `skips:` lives) — advance + audit.
- _FALLBACK_TASK_FAST regained its ## 5 · BUILD heading; the fast template regained a Skip rationale
  line; the template §3 regained the "never retro-red" grandfather clause.

Prose ripple (kept the suite green; deep book rewrite stays T4):
- ch02 flow diagram + prose (×4 twins) + diagrams/CHECKLIST name the plan phase (grounding folds
  into Plan, not a §0 preamble); the interactive installer showcase (cli.js / _installer.py) names
  Plan not Contract; .add/SEAMS.md anchor re-pinned to _declared_scope's current line.

Trees: 4-way engine/template parity (tooling · _bundled · .add · add-method/.add); bundle docs
synced; ENGINE_MD5→33f46b7d, ENGINE_PKG_MD5→a968f9e6 re-pinned.

author: Tin Dang <tindang.ht97@gmail.com>
…ns-first)

Close T1's verify phase for the 9->8 expectations-first flow collapse.

Evidence (all confirmed by direct observation, not test names alone):
- full suite 3397/3397 OK; guard set 51/51 OK
- fresh task seeds phase specify; walk reaches plan before tests
- rendered TASK.md has no §0 GROUND; §3 PLAN carries Grounding/Contract/Build-strategy
- legacy ground/contract states load without crash (ground->specify migration; 0 tracebacks)
- engine byte-parity x3 (add.py) / x4 (templates) == pins; cross-component contract SYSTEM untouched

Refute-read EARNED: audited the whole migration diff — net +1 assertion (146/145),
0 assertRaises dropped, the 4 removed strong asserts are §0-removal index re-points,
all 10 deleted test methods have 1:1 8-phase replacements. Coverage increased.

Advisor 3-lens PASS: Security CLEAR (freeze gate moved plan->tests, preserved; re-cross
re-asserts it), Concurrency CLEAR, Architecture PASS with one disclosed residue — deep
skill/glossary/book prose still names a "Contract" phase, deferred to T4 book-align.

Gate crossing tripped the post-freeze test-change tripwire (the 61-file migration is this
task's TESTS-phase deliverable, fingerprinted at the earlier tests->build crossing);
re-crossed tests->build (human-approved, Tin Dang) to re-snapshot the migrated tree, then
recorded PASS honestly. Reviewed by Tin Dang, 2026-07-12.

author: Tin Dang <tindang.ht97@gmail.com>
…m it (T2 expectations-first)

Second task of expectations-first: a milestone gains a thin `## Ground` section — shared
real-code context gathered ONCE — that each task's `specify` projects its §1 expectations
from, so tasks stop re-grounding shared context. Prose/template-only; the engine digest is
unchanged (a heavy milestone-ground validator stays deferred, per the milestone Out).

What shipped:
- MILESTONE.md.tmpl (×3 trees) carries `## Ground` right after `## Scope`, before
  `## Shared decisions`, with four milestone-altitude fields: Touches · Anchors ·
  Honors (conventions) · Issues/Risks (shared). A fresh `new-milestone` scaffolds it.
- phases/1-specify.md (×3) Converge step now cues: draft §1 by PROJECTING from the
  milestone `## Ground` + the request (replacing the stale §0-GROUND reference).
- scope.md (×3) Position-the-goal step records the goal-grounding AS the milestone's
  `## Ground` section — it persists now instead of being discarded once the goal is written.
- test_milestone_ground.py (new) pins presence/placement/thinness/specify-cue/scope-mention/
  byte-parity/engine-untouched; test_scope_loop bumped 9→10 named sections (adds `ground`).

Two engineering notes worth recording:
- LEAN BUDGET, NOT BUMP: the added prose pushed the phases pool, the reference pool, and the
  whole-skill-tree byte budgets over. Absorbed by COMPRESSING existing verbose prose under the
  existing frozen targets (33284 / 51885 / 145974) — never by raising a target.
- CHANGE REQUEST, NOT SILENT EDIT: the v1 field label `Conventions/Seams:` collided with the
  ubiquitous-language slang guard (bans bare 'seam' on the template surface) — missed at
  grounding. Corrected honestly: phase plan → rename to `Honors (conventions):` → re-freeze @ v2
  (human-approved) → re-cross tests → rebuild. The frozen contract was never edited to pass a build.

Verify: full suite 3408/3408 OK; refute-read EARNED; advisor 3-lens PASS (one disclosed prose
residue — scope.md goal-grounding fields vs the `## Ground` fields diverge slightly → T3).
Reviewed by Tin Dang, 2026-07-12.

author: Tin Dang <tindang.ht97@gmail.com>
…ases (guides-and-skill, T3 expectations-first)

Third task of expectations-first: retire the two split phase guides — `phases/0-ground.md`
(grounding) + `phases/3-contract.md` (freeze the shape) — into ONE unified `phases/3-plan.md`
that teaches the plan phase end-to-end (ground the real code · freeze the contract · set the
build strategy), and cascade the rename through SKILL.md, the book, and the engine's ref.

What shipped:
- skill (×3 trees, byte-identical): NEW `phases/3-plan.md` merges the two retired guides —
  Grounding (Touches·Context·Honors·Anchors·Issues/Risks·Related-intent·Ground-SHA + the
  gather-method hint) → Contract (freeze the external shape, a response per Reject code) →
  Build-strategy; keeps the 7-item freeze-review checklist and the v16 `<output_format>`/
  `<prompt>`/`<exit_gate>` XML convention. `0-ground.md` + `3-contract.md` DELETED.
- SKILL.md (×3): phase table drops the `ground` + `contract` rows for one `plan` row →
  `phases/3-plan.md`; flow prose reads specify→scenarios→plan→tests→build→verify→observe.
  Dangling refs healed in scope.md · run.md · components.md · fast-lane.md · 2-scenarios.md.
- book (×4 trees): `git mv 05-step-3-contract.md → 05-step-3-plan.md`; the `05-step-3-contract`
  PATH survives NOWHERE (mkdocs nav + 03/04/06/10/appendix-f/README/GETTING-STARTED/agents
  cross-links all follow); the glossary "Ground" entry's guide path re-pointed (deep term
  NARRATIVE deferred to T4). TASK.md.tmpl §3 heading (×4 twins) points at the new chapter.
- engine: `add_engine/constants.py` PHASE_GUIDE["plan"] chapter → `05-step-3-plan.md`;
  ENGINE_PKG_MD5 re-aimed a968f9e6 → 28212a55; add.py UNCHANGED (ENGINE_MD5 stable).
- tests: NEW `test_guides_skill_realigned.py` grep-guard (guide existence/deletion · SKILL
  table · engine ref · zero stale chapter path · no stale phase prose · dangling-guide refs).
  ~21 existing suites re-pointed (pool-lists · freeze-checklist/ground-content constants ·
  counts 32→31 · a 4th template twin) — every content FLOOR preserved in 3-plan.md, never a
  weakened assertion.

Engineering notes worth recording:
- BLAST RADIUS AS FLAGGED: the §1 ⚠ (guide-rename ripple across enumerated test lists)
  realized exactly — ~21 files, all mechanical re-point, same class as plan-phase-core's
  78-file migration. Content floors (7-item checklist · four grounding fields · completeness
  rubric · context categories · gather-method hint · SHAPE/unflagged-freeze phrases · flag
  grammar · output_format tag) were PRESERVED by carrying them into 3-plan.md — the honest
  path, not by loosening the tests. Two edits were fragile-regex robustness fixes.
- SOFT strategy self-improved: did the book cascade INLINE (one atomic git-mv + path-replace
  pass) rather than the planned parallel worktree agents — mechanical path-replacement is
  faster/safer atomically (recorded at §5).
- SCOPE HONESTY: the human-requested glossary path fix touched a repo-root copy outside the
  frozen §5 Scope; the gate flagged scope_violation → extended the SOFT Scope line, re-crossed,
  re-gated (never a silent out-of-scope build).

Verify: full suite 3417/3417 OK (exit 0), net +10 tests; 3-tree skill + 4-tree book +
4-twin template parity; phases byte-budget pool shrinks; refute-read EARNED; advisor 3-lens
PASS (one disclosed T4 residue: the GLOSSARY "Ground"/"Contract" term rewrite + flow diagram).
Reviewed by Tin Dang, 2026-07-13.

author: Tin Dang <tindang.ht97@gmail.com>
… report (plan-in-report, T1 plan-legibility)

First task of the plan-legibility sub-milestone: at the ONE freeze, the human now sees
the AI's full plan-of-action (HOW it will build) — not just the frozen contract SHAPE.
`report --decide` already dumped §3 verbatim as raw template markup (illegible as a plan);
this extracts the §3 Build-strategy fields into a legible, labeled BUILD PLAN block.

What shipped (add.py ×3 engine trees):
- NEW `_build_plan(raw3)` — extracts the plan-of-action fields in a fixed order
  (Scope · Strategy/ordered batches · Approach · Persona · Spawn isolation · Known-problem
  fixes) as [{label, value}]. Single-physical-line capture (each field is authored one per
  line): NOT `_capture_wrapped`, whose `Word Word:` continuation boundary misses a label like
  `Known-problem fixes:` and bled one field's value into the next. Skips a placeholder value
  (leading `<`, or the bare `./src/` Scope default); strips a trailing `   <hint>`. PURE.
- `decide_data` gains ONE additive `plan` key, populated only at the front+unfrozen seam
  (the freeze); [] everywhere else. Every pre-existing key/value is unchanged; still PURE.
- `render_decide` appends a `BUILD PLAN (§3 · how the AI will build)` block after the §3
  verbatim dump when `plan` is non-empty — the HARD contract and the SOFT plan stay distinct.
- the milestone `--decide --json` payload carries `plan: []` so both altitudes share the shape.
- report-template.md (×3, byte-identical) documents the block; net-ZERO byte change
  (same-guide compression) keeps the reference pool under its frozen budget.
- ENGINE_MD5 re-aimed → 7e6ebec0 (add_engine untouched, ENGINE_PKG_MD5 stable).

Tests (red→green):
- test_decide_digest: +8 (front-seam render · additive json key · placeholder-skip ·
  trailing-hint-strip · empty-omit · gate-seam-absent · purity · a NO-FIELD-BLEED regression
  that a live dogfood surfaced — Spawn isolation must not swallow Known-problem fixes).
- the two exact-key-set asserts + the shared `FROZEN_DECIDE_KEYS` constant re-pinned to
  include `plan` (a deliberate shape change, never a weakened assertion).
- report-template byte-pin migrated 9627→9626; a frozen needle ("the flag count") preserved.

Engineering notes:
- The §1 ⚠ (exact-key-pinned shape) realized as flagged: the full suite surfaced strays
  beyond the two named asserts (a 3rd shape test, a rollup key-set, byte/pool budgets, a
  frozen report needle). Recovery each time = step back to tests (tripwire-safe), fix, re-cross.
- The Optimization-stance ⚠ (wrapped-list capture) ALSO realized: a live dogfood render
  proved the bleed was real, not hypothetical — the regression test + single-line rewrite
  close it. The dogfood is why the block ships clean.

Verify: full suite 3426/3426 OK; 3-tree engine + 3-tree skill parity; reference pool under
budget; refute-read EARNED; advisor 3-lens PASS (no residue). Gate PASS by Tin Dang 2026-07-13.

author: Tin Dang <tindang.ht97@gmail.com>
…ard (relations-surface, T2 plan-legibility)

Add two NON-BLOCKING relation types — `extends` and `relates-to` — as siblings
to the existing BLOCKING `depends_on`, declared per task and per milestone,
surfaced at status, and validated (dangling/self) by check. The wave scheduler
stays a pure depends_on DAG: extends/relates_to never enter _edges_fingerprint,
so the schedule is unchanged (test-proven).

Task altitude:
- new-task --extends / --relates-to seed migration-tolerant state keys (old
  tasks with no key read []), reusing _parse_deps.
- _task_relations reader (fail-safe []-default), status task-row ext=/rel=
  segments, and a `relations: N dangling · M self` status line.

Milestone altitude:
- _milestone_relations parses the MILESTONE.md HEADER (pre-first-`##` region, so
  a per-task depends-on: row is never mistaken for a milestone edge); fail-safe
  on a missing/garbled/old doc.

Advisory guard:
- _relations_health is PURE over (state + milestone docs) -> findings
  {dangling, self_relation}; an archived (PASS-done) target resolves, mirroring
  depends_on. cmd_check resolves + flags; the guard never writes, never blocks a
  gate.

Vocabulary + where-declared:
- GLOSSARY.md.tmpl gains depends-on / extends / relates-to terms; TASK.md.tmpl
  (autonomy header) + MILESTONE.md.tmpl (relations: header line) name where each
  relation is declared.

test_relations.py: 15 red/green tests (state records, migration-tolerant reader,
status show/silent, check dangling/self, health archived-resolves/writes-nothing,
milestone header parse/migration/not-confused-with-task-rows, edge-fingerprint
invariance, glossary vocab, template naming). Full suite 3441 green.

Engine housekeeping: ENGINE_MD5 re-pinned c9c2a671 -> 9311ec35 (relations code +
a docstring altitude->level slang fix); SEAMS.md _declared_scope anchor re-pinned
5402 -> 5491; TASK.md.tmpl net-compressed sibling header comments to absorb the
relations note under the frozen 12400B/2850B lean ceilings; canonical + bundled
engine trees synced byte-identical.

Scope note: the frozen §5 bare tokens mis-resolved under the task dir; corrected
to the two walked engine-tree directory tokens and re-baselined via a
human-signed re-cross (add.py re-cross --by "Tin Dang") — §3 stayed frozen, no
test touched.

author: Tin Dang <tindang.ht97@gmail.com>
…riteria (2/2 PASS)

Both tasks done and committed:
- plan-in-report    (331306b) — freeze report surfaces the FULL §3 build-strategy
  plan-of-action (the human approves HOW, not just WHAT).
- relations-surface (ed48dc5) — structured depends-on·extends·relates-to at task
  + milestone altitude, status-surfaced, advisory dangling/self guard.

Fill the Close ship-review (ship-by-domain · cross-task evidence · goal-met map),
check all three exit criteria, define release steps (defer the package cut — this
is a method/engine change to bundle in a later release scope). milestone-done
recorded status=done; RETRO.md generated. Full suite 3441 green.

author: Tin Dang <tindang.ht97@gmail.com>
…ase (book-plan-align, T4 expectations-first)

Close the book-narrative debt guides-and-skill (T3) deferred: the book now names
the expectations-first flow the engine actually runs.

- appendix-c-glossary.md (×4 trees): ADD a **Plan** term (the unified step 3 —
  ground → freeze the contract → build strategy, exactly one human approval);
  REWRITE **Ground** as Plan's FIRST part (drop "phase-0 preamble / step 0 /
  the phase before Specify"); **Contract** gains a "frozen within the Plan phase"
  clause (meaning intact); the Grounding-map term's stale "§0 GROUND" → "the
  GROUND part of §3 PLAN".
- appendix-g-references.md (×4): "ADD's specify and contract phases" →
  "specify and plan phases".
- add-method/diagrams/prompt-flow.txt: the flow diagram's image-gen SOURCE card 3
  "Contract / freeze the shape" → "Plan / ground the code, freeze the contract"
  (matches CHECKLIST.md + the ch02 mermaid). The add-flow.png RASTER regeneration
  is an image-model + human visual-gate step (flagged in §7, not producible
  headless) — the tracked source is now correct.
- test_ground_prose.py: new PlanPhaseGlossaryTest pins the **Plan** term, the
  redefined **Ground**, and a stale-prose grep-guard (forbids phase-0-preamble /
  as-step-0 / phase-before-specify / the-contract-phase / the-ground-phase across
  the book; exempts a "formerly …" history bridge; non-vacuous — still fires on a
  live stale claim). EngineUntouchedByBookAlignTest pins add.py == ENGINE_MD5.

Docs-only: engine byte-identical (ENGINE_MD5/PKG unchanged). Full suite 3446 green.
Freeze approved by Tin Dang (v1); gate auto-PASS under autonomy:auto.

author: Tin Dang <tindang.ht97@gmail.com>
…teria)

Close the expectations-first sub-milestone: the lifecycle now collapses the
former `ground` + `contract` phases into ONE `plan` phase carrying the single
human freeze, so the flow runs 7 work phases with one approval instead of 8
with grounding scattered per task.

Shipped across three domains:
- tooling  : PHASES reordered specify→scenarios→plan→tests→build→verify→
             observe→done; freeze moved to plan→tests; §3 PLAN template
             renders Grounding/Contract/Build-strategy sub-blocks; legacy
             ground/contract task states migrate; MILESTONE.md gains `## Ground`.
- skill    : phases/3-plan.md unifies the retired 0-ground + 3-contract guides;
             SKILL.md + sibling guides read the 7-work-phase order.
- book     : ch02 flow + mermaid + CHECKLIST aligned; GLOSSARY defines Plan +
             redefines Ground as Plan's first part + a Contract "within Plan"
             nod; appendix-g + diagram render-source read "Plan"; a stale-prose
             grep-guard pins it. add-flow.png raster regen = human visual gate.

Evidence: 4 tasks each gate=PASS (plan-phase-core, milestone-ground-seed,
guides-and-skill, book-plan-align); full suite 3446 green; ENGINE_MD5 9311ec35 /
ENGINE_PKG_MD5 28212a55 re-pinned; ×3/×4 tree byte-parity holds. RETRO.md written.

author: Tin Dang <tindang.ht97@gmail.com>
Comment on lines +94 to +95
"Least-sure flag surfaced at freeze: [contract] narrow "
"shape — cost: one re-freeze.",
try:
with redirect_stdout(buf), redirect_stderr(err):
add.main(list(argv))
except SystemExit:
import unittest
from pathlib import Path

import add
Run: python3 -m unittest test_fast_boundary_line -v
"""
import io
import json
def test_no_05_step_3_contract_path_survives(self): # M4 / M6
# the PATH cascade must be complete: mkdocs nav + every cross-linking chapter moved.
hits = []
roots = [ADD_METHOD / "docs", BUNDLE / "docs", REPO / ".add" / "docs",
The expectations-first state migration moved cross-platform-inode-reuse-stress
ground->specify in state.json, but the dormant task file marker only syncs on
touch — add.py check flagged marker=ground vs state=specify. Sync the marker +
its phase-order comment to the 7-work-phase flow. check: 730 passed, 0 failed.

author: Tin Dang <tindang.ht97@gmail.com>
…t grammar

The seam-audit CI job (and local `add.py audit`) exits 1 on
`unstamped_freeze pilot-cwd-hardening`: the task WAS frozen and gated
PASS (add-bench milestone, merged in PR #142), but its stamp cited the
approval precedent prose-first instead of the canonical
`approved by <name>` form the audit regex requires. Reword the same
recorded approval into grammar — no new approval invented, the
precedent citation kept in the parenthetical.

audit: exit 1 -> 0 locally; this was one of the two CI failures
pre-existing on main (the other is the known lock-reclaim TOCTOU
flake in test_project_scope_lock, re-run by this push).

author: Tin Dang <tindang.ht97@gmail.com>
@pilotspacex-byte pilotspacex-byte merged commit 54733fa into main Jul 13, 2026
10 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants