@ngockhoale/ukit 3.4.65 → 3.4.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/manifests/documentation.yaml +11 -0
  3. package/package.json +2 -2
  4. package/scripts/release/verify-release.mjs +7 -0
  5. package/scripts/test/run-handoff-isolated.mjs +178 -0
  6. package/src/core/executionContracts.js +2 -2
  7. package/template_project/.claude/agents/code-reviewer.md +4 -1
  8. package/template_project/.claude/agents/handoff-planner.md +3 -0
  9. package/template_project/.claude/commands/ukit/handoff-clear.md +34 -35
  10. package/template_project/.claude/commands/ukit/handoff-create.md +40 -21
  11. package/template_project/.claude/commands/ukit/handoff-fullstack.md +141 -66
  12. package/template_project/.claude/commands/ukit/handoff-implement.md +27 -12
  13. package/template_project/.claude/commands/ukit/handoff-review.md +18 -8
  14. package/template_project/.claude/hooks/handoff-resume.sh +8 -0
  15. package/template_project/.claude/skills/advisor-plan/REFERENCE.md +33 -2
  16. package/template_project/.claude/skills/advisor-plan/SKILL.md +6 -4
  17. package/template_project/.claude/ukit/index/route-resolver.mjs +2 -2
  18. package/template_project/.claude/ukit/runtime/resumable-run.mjs +40 -7
  19. package/template_project/.claude/ukit/runtime/stop-coordinator.mjs +128 -44
  20. package/template_project/.claude/ukit/runtime/task-watchdog.mjs +1 -1
  21. package/template_project/.omp/agents/code-reviewer.md +4 -1
  22. package/template_project/.omp/agents/handoff-planner.md +3 -0
  23. package/template_project/AGENTS.md +2 -2
  24. package/template_project/CLAUDE.md +2 -2
  25. package/template_project/docs/AI_HANDOFF/RULES.md +24 -27
  26. package/template_project/docs/AI_HANDOFF/queued/README.md +52 -0
  27. package/template_project/instructions/core.md +2 -2
@@ -43,15 +43,29 @@ point in the phases below has a defined automatic resolution. Take it. Specifica
43
43
  | Situation | Old behavior | Required behavior now |
44
44
  |-----------|--------------|----------------------|
45
45
  | Scope spans multiple subsystems | wait for confirmation | decompose into sequential cycles, run cycle 1 now, queue the rest in `INDEX.md` |
46
- | Plan review returns `Issues Found` | up to 3 rounds, then stop | 1 revision round; if round 2 still has findings, apply them and proceed — log to `## Plan Review Log` |
46
+ | Plan review returns `Issues Found` | up to 3 rounds, then stop | bounded repair + fresh independent escalation per P2.5; unresolved tasks stay `needs_breakdown` with `PLAN_REVIEW: Unresolved`, only independently cleared work proceeds |
47
47
  | Two same-wave tasks share a file | STOP | move the later task to the next wave (add the dependency), continue |
48
48
  | INDEX has `pending_review`/`blocked` tasks | STOP | **resume** — see Resume below |
49
49
  | Reviewer returns `changes_requested`/`critical_block` | report and stop | run the Phase 4 auto-fix loop (max 2 rounds) |
50
50
  | Verification command fails | stop | fix and re-verify inside the auto-fix loop |
51
51
 
52
- Escalate to the human **only** for: a blocker outside the repo (missing credential, external
53
- service down), or a task still failing after both auto-fix rounds. Even then, finish every
54
- other task first and report what was left undone.
52
+ Escalate to the human **only** for a valid blocker:
53
+ - an external blocker outside the repo (missing credential, external service down, network/API unreachable), or
54
+ - a genuine requirement conflict that only the owner can decide (two owner requirements that cannot both be met).
55
+
56
+ Even then, finish every independent task first and report what was left undone.
57
+
58
+ **BLOCKED is reserved for valid blockers. Local failures: route to repair or replan, NEVER BLOCKED.**
59
+ **Internal failures are never blockers.** Failing tests, review findings, and repairs that exhausted
60
+ their cap are internal failures. They get bounded escalation, never an infinite retry, an endless
61
+ replan loop, or a DONE claim:
62
+ 1. Retry the same edit at most `orchestration.maxAttemptsPerFailure` (2) times.
63
+ 2. Then change strategy: investigate the cause and apply a different fix (`maxRecoveryStrategies`, 2).
64
+ 3. Then record progress: note the failure, its attempts and strategies in the task's `## Discussion`
65
+ thread, mark the task not approved, and continue every independent task.
66
+
67
+ A stuck task is never approved by cap and is NOT an external block.
68
+ Continue independent tasks while a blocked branch waits.
55
69
 
56
70
  **Never pause to ask for `/compact`.** Context is managed structurally — subagents write full
57
71
  logs to disk and return short summaries (see 3b), and the run cursor makes the pipeline
@@ -70,13 +84,28 @@ Phase: <P0|P1|P2|P2.5|P3|I1|I2|I3|I4|R1|R2|R3|R4|R4.5|R5|F|done|blocked>
70
84
  Cursor: wave <N> batch <M> — <what just finished>
71
85
  Next: <the exact next step to run>
72
86
  ExitPredicate: all(<term>[,<term>...]) # written once at P2; never relaxed
87
+ Cycle: <NN> # current assigned cycle; preserve through reset/archive and resume
73
88
  QuietScans: <n>/<required> # only while sweeping for stragglers near the end
74
89
  Acceptance: <the acceptance line the CurrentTask must satisfy> # optional
75
90
  CurrentTask: <TASK-xxx> # optional; the single task mid-flight right now
76
91
  RetryFingerprint: <stable id of the failing step> # optional; retry-loop identity
77
92
  RetryCount: <n> # optional; consecutive attempts of that fingerprint
93
+ ScopePlans: <slug[,slug...]> | none # optional; history/archive/Ready-for-AI items the invocation authorized
94
+ ScopeQueue: <slug[,slug...]> | none # optional; the queued blueprints frozen into this run at P2
95
+ Authorization: <one line — who authorized the scope and from which invocation> # optional
96
+ LateCreate: <slug> — <disposition> # optional; a create that arrived mid-run, never auto-folded
78
97
  ```
79
98
 
99
+ **Scope fields are additive and optional, and they survive compaction.** After a compact, the SessionStart resume hook carries `ScopePlans` / `ScopeQueue` / `Authorization` unchanged, so the run never re-derives its scope. A RUN.md without them behaves exactly as before:
100
+ `ScopeQueue` absent means every queued blueprint counts toward the run-all backlog (legacy).
101
+ When `ScopeQueue` is present, only the listed slugs count; a blueprint queued after the run froze
102
+ its scope never extends that run. These fields carry the run's authorized scope across compact and
103
+ session boundaries; they never replace INDEX.md or RUN.md authority.
104
+
105
+ **Late creates do not expand scope.** A blueprint or Ready-for-AI item that appears mid-run and is
106
+ not in `ScopeQueue`/`ScopePlans` is recorded as `LateCreate:` with disposition `Backlog`. A late create does not expand scope and is never silently folded in. Repairs of work already assigned to this run
107
+ still continue.
108
+
80
109
  **Compact-carry fields.** `Acceptance`, `CurrentTask`, `RetryFingerprint` and `RetryCount`
81
110
  are what a compacted session carries forward — these four lines plus `Goal`/`Next:`, never
82
111
  the full subagent prompts. The SessionStart resume hook prints them verbatim after a
@@ -174,8 +203,10 @@ This run has exactly **two** legal ways to end:
174
203
 
175
204
  - `HANDOFF FULLSTACK COMPLETE` — the completion gate in Phase F passed. First line of the
176
205
  final report, verbatim.
177
- - `HANDOFF FULLSTACK BLOCKED` — every remaining task depends on the same external blocker
178
- (missing credential, dead service, permission wall) AND no safe local work exists. Write
206
+ - `HANDOFF FULLSTACK BLOCKED` — every remaining task depends on the same valid blocker (an external
207
+ blocker such as a missing credential, dead service, or permission wall, or a genuine requirement
208
+ conflict that needs the owner's decision) AND no safe local work exists. Internal failures
209
+ never qualify. Write
179
210
  `Phase: blocked` to RUN.md before emitting it so the Stop gate releases the session.
180
211
 
181
212
  Nothing else ends the run. A recap is a progress notification, not a stopping point. If you
@@ -206,8 +237,11 @@ work, not only the current plan:
206
237
  2. `docs/AI_HANDOFF/tasks/TASK-*.md` — stale `in_progress` from a dead session, `blocked`,
207
238
  `changes_requested`, `needs_executor_report`, `needs_breakdown`.
208
239
  3. Previous cycles — `docs/AI_HANDOFF/HISTORY.md` and `archive/` for cycles closed with
209
- unfinished tasks; their leftovers join THIS cycle.
210
- 4. `docs/TASKS.md` — `Ready for AI` items are newly-assigned work; fold them into the plan.
240
+ unfinished tasks. Their leftovers join THIS cycle ONLY when named by the invocation or listed
241
+ in the run's `ScopePlans:` field (see the RUN cursor). Unnamed history/archive leftovers are
242
+ reported as `Backlog:` and are never auto-imported.
243
+ 4. `docs/TASKS.md` — `Ready for AI` items are newly-assigned work. Fold one into the plan only when the
244
+ invocation names it or it is listed in `ScopePlans:`; otherwise report it as `Backlog:`.
211
245
  5. `docs/AI_HANDOFF/queued/*/` — dormant blueprints. A planning run that could **not**
212
246
  touch the canonical plan (a live run was in flight) queues its SPEC/PLAN/tasks under
213
247
  `docs/AI_HANDOFF/queued/<slug>/` instead of overwriting (see `/ukit:handoff-create`).
@@ -216,7 +250,10 @@ work, not only the current plan:
216
250
  overwrite a blueprint — a blueprint the run decides to defer stays queued.
217
251
  Blueprints WITHOUT the `QueueIntent` metadata are still folded in as described above.
218
252
  A blueprint whose header carries `QueueIntent: deliberate-future` is the exception: it is
219
- **not folded** in; report it as `Backlog: <slug>` and leave it untouched.
253
+ **not folded** in; report it as `Backlog: <slug>` and leave it untouched. Only blueprints
254
+ whose LEDGER rows are `deferred` carry that header. Mandatory overflow (`feasible`/`adapted`
255
+ rows queued by create because the plan exceeded 10 tasks) is queued WITHOUT `QueueIntent`,
256
+ so it is folded in here like any legacy blueprint and is never silently excluded.
220
257
  Backlog items do not count toward `index:all-done` / `ExitPredicate`, so they never block completion. Only
221
258
  an explicit slug in the invocation drains one (one blueprint per invocation). The
222
259
  create phase of this command applies the same advisor intake as `/ukit:handoff-create`.
@@ -264,11 +301,15 @@ The run must keep itself alive without the human watching.
264
301
  - **Harnesses with neither:** treat EVERY activation as a watchdog recovery turn — read
265
302
  RUN.md first, rescan the inventory, continue `Next:`.
266
303
 
267
- **Quiet-period rule.** The run may finish only after the backlog is empty AND
268
- `handoff.fullstack.quietScansRequired` (default 2) consecutive watchdog scans find no new
269
- assignment, no recoverable task, and no uncommitted intended change. Record each quiet
304
+ **Quiet-period rule.** The run may finish only after the frozen assigned scope is empty AND
305
+ `handoff.fullstack.quietScansRequired` (default 2) consecutive watchdog scans find, within that
306
+ frozen scope only, no new assignment, no recoverable task, and no uncommitted intended change.
307
+ Work outside the frozen scope (a queued blueprint not in `ScopeQueue`, an unnamed history item) is
308
+ never counted by a quiet scan. Record each quiet
270
309
  scan in RUN.md as `QuietScans: <n>/<required>`. A scan that finds anything resets the
271
- counter and starts a new cycle automatically.
310
+ counter. A new in-scope recoverable task (assigned or repair of assigned work) starts work in this
311
+ run. A late create outside `ScopeQueue`/`ScopePlans` is recorded as `LateCreate:` (Backlog) and does
312
+ not start a new cycle.
272
313
 
273
314
  ---
274
315
 
@@ -294,7 +335,7 @@ Return a compact summary. Do NOT write any files yet.
294
335
  The planner agent does the following (use P1 summary — do NOT re-read files):
295
336
 
296
337
  1. **Guard — check INDEX statuses:**
297
- - All tasks are `ready` (planning only) → re-run is allowed: overwrite `PLAN.md` and `TASK-xxx.md` freely (iterative refinement).
338
+ - All tasks are `ready` (planning only) → **only an explicit amendment may overwrite**: when the human explicitly names this plan to amend, first copy every prior file (PLAN.md, SPEC.md, LEDGER.md, NOTES.md, SOURCE.md, tasks/TASK-*.md, when present) to the next unused `amendments/rev-<NN>/` (scan existing rev dirs, take max+1, never reuse one). Then compose the revised PLAN.md in full: carry the existing `## Amendment History` forward and append this amendment's entry (prior review rounds and verdicts; prior requirement, decision and task versions with what changed and why; each change's `invalidated` evidence: tasks, executor reports, verdicts that no longer hold). Write the revised PLAN.md only after that entry is in the composed text, so the overwrite can never drop the history. An **independent new request** is NOT an amendment: write its plan under `docs/AI_HANDOFF/queued/<slug>/` (the queued lane, see Phase 0) and never overwrite the existing canonical plan.
298
339
  - Any task has status `pending_review`, `changes_requested`, `merge_conflict`, or `blocked` → **do not overwrite, and do not stop either.** Mid-flight work exists. Skip the rest of P2 entirely, write the run cursor with `Phase: I1`, and hand control back to the orchestrator to resume from Phase 3 with the surviving tasks (see Resume in the Autonomy Contract). Overwriting is what is unsafe here — stopping is not required.
299
340
  - No tasks → fresh cycle, proceed.
300
341
 
@@ -362,18 +403,23 @@ The planner agent does the following (use P1 summary — do NOT re-read files):
362
403
 
363
404
  ### P2.5 — Independent plan review (strong model, separate agent)
364
405
 
365
- **Loop cap — check first:** count `### Round` entries in PLAN.md's `## Plan Review Log` (0 if the section doesn't exist yet).
406
+ **Loop cap — check first:** count completed reviewer verdicts in PLAN.md's `## Plan Review Log` = `### Round` entries that carry a `PLAN_REVIEW:` or verdict line (repair-only `### Repair <N>` / `### Escalation <N>` markers are NOT counted; 0 if the section doesn't exist yet).
366
407
 
367
408
  - count = 0 → run the review below.
368
409
  - count = 1 and the round returned `Issues Found` → planner revises once, then run **one** more review round.
369
- - count ≥ 2 → do NOT invoke the reviewer again. **Do not stop and do not ask the human.** Have the planner apply every outstanding finding directly to `PLAN.md` and the affected `TASK-xxx.md` files, append `### Round <N> — findings applied without re-review` to the Plan Review Log listing what was changed, then proceed to P3.
410
+ - count ≥ 2 and no escalation recorded yet → **bounded escalation, once, without a human, in this run.** Record `### Escalation 1 — <reason>` in the Plan Review Log before the reviewer runs. The planner applies the outstanding findings with a **changed strategy** (different decomposition or task split, not a re-run of the same edit) and appends `### Repair <N> — changed strategy`. Then invoke `code-reviewer` **once more** as a fresh independent smart-tier review (new agent, no prior context) and append its verdict as `### Round <N>`.
411
+ - count ≥ 2 and an escalation is already recorded → the escalation is spent. No further reviewer round runs except the **Recovery exception** below. Do not wait: proceed to P3 for the tasks that are `ready`, and mark each still-flagged task `needs_breakdown` with its open finding named unless the Recovery exception runs.
412
+ - `Approved` (escalation round or earlier) → proceed to P3 with the normal `PLAN_REVIEW: Approved by <reviewer model>` footer.
413
+ - `Issues Found` after the escalation, or an escalation that cannot run → any task still carrying an open finding is `needs_breakdown` (never `ready`); the footer records `PLAN_REVIEW: Unresolved — round cap reached, findings applied without independent verification` (never `Approved`), and the Final Report names each `needs_breakdown` task with its open finding. Independent work on the other tasks continues in this run.
414
+ - Finding signature: each open finding is identified by `<location>` (the file and section or line the reviewer cites) plus its normalized claim (lowercased, whitespace collapsed, first 120 characters). The reviewer's verdict lists each finding with that location and claim, and after every verdict the planner appends `### Signatures Round <N>: <sig>; <sig>; …` to the Plan Review Log, so the set is persisted per plan.
415
+ - Non-progress rule: a repair whose open-signature set equals the previous round's `### Signatures` set is non-progress and goes straight to the Unresolved path. It is never retried in a loop and never reported as DONE. **Recovery exception (explicit, at most once per plan):** it runs only when the escalation is spent, the latest verdict is still `Issues Found`, the latest repair changed the signature set, and the Plan Review Log has no `### Recovery 1 — consumed` marker. Then, in order: (1) append `### Recovery 1 — consumed <YYYY-MM-DD>` before any other work; (2) run a root-cause investigation and a different decomposition (at most one further recovery round); (3) run one fresh independent review of the changed artifact and append its verdict as `### Round <N>`. The marker is never removed or re-created. If the marker already exists, or the signature set is unchanged, no further review runs: retain Unresolved with a precise diagnostic and continue with the other tasks. An owner conflict routes an owner decision.
416
+ - The Plan Review Log and `needs_breakdown` marks keep the open state visible, so no plan is left silently pending.
370
417
 
371
- The gate still does its job — two independent opus passes shape the plan before a line of code
372
- is written. What it no longer does is hand a stalled plan back to a human who isn't there.
418
+ The gate still does its job: two independent opus passes plus one escalation pass shape the plan before a line of code is written.
373
419
 
374
420
  **Claude Code — MANDATORY, do this before anything else in P2.5:** call the Agent tool with `subagent_type: "code-reviewer"` (omp: the `task` tool with `agent: "code-reviewer"`), passing `REVIEW_TARGET_TYPE=plan` and the paths to `docs/AI_HANDOFF/PLAN.md` AND `docs/AI_HANDOFF/SPEC.md`. This MUST be a separate agent invocation from P2's `handoff-planner` call (fresh context) — same-session self-review defeats the purpose of an independent gate.
375
421
 
376
- 1. Reviewer reads `SPEC.md` + `PLAN.md` only (no diff, no task files, no executor report), checks Completeness / Consistency / Clarity / Scope / YAGNI plus the spec quality gate — every requirement testable, every fullstack layer covered, dependencies explicit, legacy sweep included, no vague instruction left ("improve UI" without defined behavior fails) — see `.claude/agents/code-reviewer.md` → Spec/Plan Review — and appends its verdict to PLAN.md's `## Plan Review Log` (new round entry, prior rounds kept).
422
+ 1. Reviewer reads `SPEC.md` + `PLAN.md` plus the plan's sources, starting from the original: `SOURCE.md` (the verbatim original bytes; verify the recorded sha256 against them; for chat input, the durable verbatim message origin stands in for the file), then `LEDGER.md` (classification of every requirement), `NOTES.md` (optional source-only notes, when present; a missing note is caught because the chain starts at SOURCE, not at NOTES), the `tasks/TASK-*.md` files of the plan, and the current source the plan's Target Files touch (no diff, no executor report). It compares the chain SOURCE → classification (LEDGER) → tasks (acceptance and verification), and NOTES are checked against the same chain. Each `feasible`/`adapted` row maps to a task with acceptance and a verification command; it checks that every `feasible`/`adapted` row and every requirement not explicitly deferred, blocked, or classified as rejected/proposal/example is covered by a task with acceptance and verification, and checks Completeness / Consistency / Clarity / Scope / YAGNI plus the spec quality gate — every requirement testable, every fullstack layer covered, dependencies explicit, legacy sweep included, no vague instruction left ("improve UI" without defined behavior fails) — see `.claude/agents/code-reviewer.md` → Spec/Plan Review — and appends its verdict to PLAN.md's `## Plan Review Log` (new round entry, prior rounds kept).
377
423
  2. `Issues Found` → route back to P2: `handoff-planner` revises `PLAN.md` and the affected `TASK-xxx.md` files to address every finding, then re-submit for one more P2.5 review round — subject to the loop cap above.
378
424
  3. `Approved` → append `PLAN_REVIEW: Approved by <reviewer model>` to PLAN.md's `## Planner Report` footer, then proceed to P3.
379
425
 
@@ -383,7 +429,8 @@ is written. What it no longer does is hand a stalled plan back to a human who is
383
429
 
384
430
  **Claude Code — MANDATORY:** call the Agent tool with `subagent_type: "ukit-small-task-maintainer"` (omp: the `task` tool with `agent: "ukit-small-task-maintainer"`) for this commit step (lite tier — haiku/unic-lite). Run:
385
431
  ```bash
386
- git add docs/AI_HANDOFF/ && git commit -m "handoff: plan — <goal>"
432
+ git add -- <explicit assigned plan paths>
433
+ git commit --only -m "handoff: plan — <goal>" -- <explicit assigned plan paths>
387
434
  ```
388
435
 
389
436
  Replace `<goal>` with the one-sentence goal from ACTIVE.md. This locks the plan in git before any implementation begins.
@@ -417,11 +464,20 @@ Verify working tree is clean after the plan commit:
417
464
  git status # must be clean — plan commit already done in P3
418
465
  ```
419
466
 
420
- If the working tree is dirty, do not stop. Commit the stragglers as a checkpoint so they stay
421
- recoverable and the wave copy-back starts from a known state:
467
+ If the working tree is dirty, do not stop. Classify each dirty path first:
468
+ - **Run-owned** — a path the run itself wrote in this cycle (its PLAN/SPEC/task files, RUN.md,
469
+ INDEX.md, ACTIVE.md, or a path listed in the task's `Target Files`). Only these are checkpointed.
470
+ - **Foreign dirty** — anything else (another owner's WIP, unrelated files). Never stage, commit, or
471
+ revert it. Record it in RUN.md under `Foreign dirty:` and leave it in place.
472
+
473
+ Checkpoint only the run-owned paths, by explicit name, so the wave copy-back starts from a known
474
+ state without absorbing unrelated owner changes:
422
475
  ```bash
423
- git add -A && git commit -m "handoff: checkpoint before implement"
476
+ git add -- <run-owned paths>
477
+ git commit --only -m "handoff: checkpoint before implement" -- <run-owned paths>
424
478
  ```
479
+ Never `git add -A` (or `git add .`) for a checkpoint: it sweeps foreign dirty paths into the
480
+ run's commit.
425
481
 
426
482
  ### I2 — Infer wave groups
427
483
 
@@ -548,7 +604,8 @@ node .claude/ukit/index/land-worktree.mjs \
548
604
  # After each exit-0 landing, checkpoint-commit the landed paths (receipt stays outside the target set)
549
605
  # BEFORE landing the next task: the helper refuses a destination with tracked modifications
550
606
  # (destination-dirty), so uncommitted landed work would block every later task in the wave.
551
- git add -- <landed paths> && git commit -m "checkpoint: $TASK landed"
607
+ git add -- <landed paths>
608
+ git commit --only -m "checkpoint: $TASK landed" -- <landed paths>
552
609
 
553
610
  # update INDEX.md: status → pending_review
554
611
  ```
@@ -557,7 +614,8 @@ For **FAIL:**
557
614
  ```bash
558
615
  # Landing is refused by contract (no EXECUTOR_REPORT). Retain the worktree and branch
559
616
  # as recovery evidence and mark it in INDEX.md:
560
- # status → blocked, reason "FAIL"
617
+ # status → in_progress for bounded fix/investigate, then replan if needed.
618
+ # Only an external blocker or genuine owner-decision conflict justifies blocked.
561
619
  ```
562
620
 
563
621
  For **EXECUTOR_MODEL missing:**
@@ -582,7 +640,8 @@ already on disk (task files hold the full logs, git holds the code). Do all four
582
640
  copied-back changes are reverted and nothing is committed. A plateau is not a stop —
583
641
  the run continues to the next wave or fix round; the predicate is never relaxed.
584
642
  ```bash
585
- git add -A && git commit -m "handoff: wave <N> — TASK-00x, TASK-00y"
643
+ git add -- <run-owned paths of this wave>
644
+ git commit --only -m "handoff: wave <N> — TASK-00x, TASK-00y" -- <run-owned paths of this wave> # foreign index entries stay unchanged
586
645
  ```
587
646
  Do not push here; the single push happens at R5.
588
647
 
@@ -612,7 +671,7 @@ logs used to cost. That difference is what makes a multi-wave cycle finish in on
612
671
 
613
672
  1. Update `docs/AI_HANDOFF/INDEX.md`:
614
673
  - PASS tasks → `pending_review`
615
- - FAIL tasks → `blocked`
674
+ - FAIL tasks → `in_progress` for bounded fix/investigate/replan; `blocked` only with a recorded external blocker or owner-decision conflict
616
675
  - EXECUTOR_MODEL missing → `needs_executor_report`
617
676
  Then **verify the write** (read back the updated status column).
618
677
 
@@ -739,28 +798,32 @@ For round in 1..2:
739
798
  - the same ≤10-line return contract as 3b.
740
799
  3. Copy back and delete worktrees per 3c. Commit the round:
741
800
  ```bash
742
- git add -A && git commit -m "handoff: fix round <N> — TASK-00x"
801
+ git add -- <run-owned paths of this round>
802
+ git commit --only -m "handoff: fix round <N> — TASK-00x" -- <run-owned paths of this round>
743
803
  ```
744
804
  4. Re-review **only the tasks touched this round**, in parallel, per R2–R4. A reviewer must
745
805
  still differ from the executor model, and still re-runs verification itself.
746
806
  5. Update `INDEX.md` and `RUN.md`. If everything is now approved, exit the loop.
747
807
 
748
- After round 2, any task still not approved is genuinely stuck: leave it `blocked`, record why
749
- in its `## Discussion` thread, and carry it into the Final Report. **Every other task still
808
+ After round 2, any task still not approved is a local failure (NOT an external block): record
809
+ the failure and the attempted strategies in its `## Discussion` thread and carry it into the
810
+ Final Report. Route it to replan in the next cycle; never approve it by cap. **Every other task still
750
811
  proceeds to R5** — one stubborn task must never hold the whole cycle hostage.
751
812
 
752
813
  ### R5 — Commit + push (orchestrator)
753
814
 
754
815
  R4.5 has already run, so by this point every task is either approved or genuinely stuck.
755
816
 
756
- Update `docs/AI_HANDOFF/INDEX.md`: approved tasks → `done`; anything still failing after both
757
- fix rounds → `blocked`.
817
+ Update `docs/AI_HANDOFF/INDEX.md`: approved tasks with acceptance met → `done`;
818
+ local failures remain `in_progress`/`changes_requested` with bounded recovery diagnostics.
819
+ Only an external blocker or genuine owner-decision conflict is `blocked`.
758
820
 
759
821
  Commit whatever remains uncommitted (the per-wave commits from 3d are already in), then push
760
822
  once — this is the run's only push:
761
823
 
762
824
  ```bash
763
- git add -A && git commit -m "handoff: implement <goal>" # skip if nothing left to commit
825
+ git add -- <run-owned paths>
826
+ git commit --only -m "handoff: implement <goal>" -- <run-owned paths> # skip if nothing left to commit
764
827
  git push origin $BASE
765
828
  ```
766
829
 
@@ -782,11 +845,13 @@ Do NOT set `Phase: done` yet — Phase F still has to close the books.
782
845
 
783
846
  ### F1 — Quiet-period scan
784
847
 
785
- Run the sweep from Phase 0 again (INDEX, task files, `docs/TASKS.md`, git status).
848
+ Run the Phase 0 sweep again within the frozen assigned scope recorded in RUN.md
849
+ (ScopePlans/ScopeQueue, canonical assigned tasks and intended changes only). Do not import
850
+ `docs/TASKS.md`, history, late independent plans or unrelated dirty files.
786
851
  `handoff.fullstack.quietScansRequired` (default 2) consecutive scans must each find:
787
- no unfinished task, no new assignment, no uncommitted intended change. Record each scan
788
- in RUN.md (`QuietScans: <n>/<required>`). Anything found resets the counter — fold it in
789
- through the normal pipeline and keep going.
852
+ no unfinished in-scope task, review/integration/delivery debt or uncommitted intended change.
853
+ Record each scan in RUN.md (`QuietScans: <n>/<required>`). In-scope findings reset the counter;
854
+ repair them through the normal pipeline. Independent out-of-scope work does not extend this run.
790
855
 
791
856
  ### F2 — Docs sync
792
857
 
@@ -798,37 +863,47 @@ evidence, rollback notes.
798
863
 
799
864
  ### F3 — Archive the cycle
800
865
 
801
- When `handoff.fullstack.autoArchive` is true (default), archive per `handoff-clear`
802
- conventions so a future session needs no transcript to understand the cycle:
803
-
804
- 1. Move the completed cycle's records (PLAN.md, SPEC.md, task files, ACTIVE.md snapshot)
805
- into `docs/AI_HANDOFF/archive/cycle-<NN>/`, then — BEFORE resetting `INDEX.md` — run
806
- `node .claude/ukit/runtime/resumable-run.mjs archive-cycle . <NN>`. It writes the verified
807
- INDEX rows to `archive/cycle-<NN>/INDEX.md` and stamps each terminal task header, so the
808
- stop predicate reads the INDEX status, not a stale executor-written header. It is
809
- idempotent; after an interrupted archive just run it again.
810
- 2. If `archive/` holds more than 3 cycle folders → fold the oldest into a one-line
811
- summary in `HISTORY.md` and remove it.
812
- 3. Reset `ACTIVE.md` to its empty template; clear `INDEX.md` rows to a fresh header;
813
- remove `tasks/TASK-*.md`; clear `PLAN.md`/`SPEC.md` (templates stay).
814
- **Predicate terms:** the stop gate's `index:all-done` accepts a header-only INDEX when
815
- every task in `archive/cycle-<NN>/` is terminal-success (`done`/`cancelled_superseded`)
816
- according to that cycle's INDEX snapshot (legacy archives without one fall back to the task
817
- header). A finalized cycle is NOT run-all completion: under `GoalScope: run-all` the
818
- predicate still fails while `queued/<slug>/` blueprints (not `QueueIntent:
819
- deliberate-future`) remain. Keep archived task files until the goal is complete. When the
820
- `ExitPredicate` contains `verify:pass`, run the final verification command through the
821
- shell in THIS session after the last edit (the receipt is per-session; a pipe without
822
- `pipefail` is unproven).
823
- Then **verify the write** on each reset file (read back the empty header /
824
- template marker).
825
- 4. Commit the docs + archive changes:
826
- `git add -A && git commit -m "handoff: finalize + archive cycle <ID>"`
866
+ When `handoff.fullstack.autoArchive` is true (default), archive only a genuinely completed
867
+ cycle. Pending, blocked, pending-review, changes-requested, pending-release or failed
868
+ integration work remains open. Task status alone cannot replace independent review,
869
+ integration and any owner-required release/consumer evidence. Do not archive to escape a gate.
870
+
871
+ 1. Select a new unused `docs/AI_HANDOFF/ARCHIVE/cycle-<NN>/` for this completed cycle;
872
+ never merge into an unrelated prior cycle. Record `Cycle: <NN>` and the recovery step in RUN.md;
873
+ retain it after INDEX reset so the runtime checks this archive, not unrelated history.
874
+ Move only its completed task records first, preserving PLAN.md, SPEC.md, LEDGER.md,
875
+ SOURCE.md, NOTES.md (or equivalent classifications), amendments, reviews, verification
876
+ and delivery evidence plus ACTIVE.md. Preserve queued and unrelated active records.
877
+ BEFORE resetting INDEX.md, run
878
+ `node .claude/ukit/runtime/resumable-run.mjs archive-cycle . <NN>`.
879
+ Verify `ok: true`, the expected task IDs/statuses in `ARCHIVE/cycle-<NN>/INDEX.md`,
880
+ and the preserved records. On snapshot failure retain the live INDEX and recovery
881
+ cursor; investigate/fix, never reset or treat the failure as completion. Resume an
882
+ interrupted move using that same recorded destination, not a new cycle or blind overwrite.
883
+ 2. Never prune completed history or replace detailed evidence with a summary. Legacy
884
+ lowercase `archive/` remains read-only provenance; do not silently migrate or reactivate it.
885
+ 3. Only after the snapshot and evidence are verified, reset records wholly represented
886
+ in that archive to templates and remove only their INDEX rows. Do not wildcard-delete
887
+ task files or erase remaining open records. Verify each reset marker and retained ID.
888
+ **Predicate terms:** evaluate the current assigned scope, not unrelated historical
889
+ success. A finalized cycle is NOT run-all completion: unfinished frozen ScopeQueue
890
+ blueprints still require the next cycle. Out-of-scope late creates and deliberate-future
891
+ blueprints remain preserved, not silently admitted. When `ExitPredicate` contains
892
+ `verify:pass`, run final verification through the shell in THIS session after the last
893
+ edit (the receipt is per-session; a pipe without `pipefail` is unproven).
894
+ 4. Commit only the enumerated run-owned docs/archive paths and tracked task deletions
895
+ from the move (`git add -- <explicit run-owned paths>`). Foreign staged or dirty paths
896
+ stay untouched; never an unscoped stage-all. Keep the recorded archive destination in
897
+ RUN.md so completion verification and recovery use this cycle's evidence.
827
898
 
828
899
  ### F4 — Close the run
829
900
 
830
- Set `Phase: done` in `docs/AI_HANDOFF/RUN.md`, disarm any watchdog job armed at the
831
- start, and emit the Final Report below.
901
+ Only after the entire assigned scope is complete — canonical tasks, every unfinished
902
+ blueprint in frozen ScopeQueue, independent review, integration and required release/consumer
903
+ verification — set `Phase: done` in `docs/AI_HANDOFF/RUN.md`, disarm any watchdog job armed
904
+ at the start, and emit the Final Report below. A completed cycle with assigned queue work
905
+ remaining instead advances RUN.md to that next cycle; it does not close the run. Open local
906
+ recovery work retains its real phase and next diagnostic step, never a false completion.
832
907
 
833
908
  Then **verify the write** (read back `Phase: done`) — a lost cursor write
834
909
  leaves the next session resuming a finished run.
@@ -890,7 +965,7 @@ Then the body:
890
965
  Verification: <commands + results>
891
966
  Git: <K> wave commits + pushed to <branch>
892
967
  Docs updated: <files>
893
- Archive: docs/AI_HANDOFF/archive/cycle-<NN>/
968
+ Archive: docs/AI_HANDOFF/ARCHIVE/cycle-<NN>/ | not archived — <reason>
894
969
  Worktrees: all cleaned
895
970
  Branches: all cleaned
896
971
  Remaining tasks: NONE | <list>
@@ -25,9 +25,9 @@ resolution — take it, and note it in the wave summary:
25
25
 
26
26
  | Situation | Required behavior |
27
27
  |-----------|------------------|
28
- | Working tree dirty at Step 1 | commit a checkpoint, continue |
28
+ | Working tree dirty at Step 1 | scoped checkpoint of run-owned paths only (`git commit --only -- <paths>`), unrelated changes untouched, continue |
29
29
  | Two same-wave tasks share a file | move the later task to the next wave, continue |
30
- | A task's agent reports FAIL | leave it `blocked`, finish every other task, report at the end |
30
+ | A task's agent reports FAIL | bounded local fix/investigate (max 2 distinct strategies, then replan); `blocked` only for external blocker or genuine owner-decision conflict; finish every other task, report at the end |
31
31
  | Context warning fires | collapse the finished wave to one line per task, continue |
32
32
  | No `ready` tasks but `changes_requested` ones exist | treat those as the work — this is a fix pass |
33
33
 
@@ -71,11 +71,16 @@ Verify working tree state:
71
71
  git status
72
72
  ```
73
73
 
74
- If the working tree is dirty, do not stop — commit a checkpoint so the wave copy-back starts
75
- from a known state and the pre-existing edits stay recoverable:
74
+ If the working tree is dirty, do not stop — checkpoint **only the run-owned paths** (the Target
75
+ Files of the `ready` tasks plus `RUN.md`/`INDEX.md`/task files). Never `git add -A`: unrelated
76
+ modified or already-staged owner changes stay exactly as they are.
76
77
  ```bash
77
- git add -A && git commit -m "handoff: checkpoint before implement"
78
+ git status --porcelain
79
+ git add -- <run-owned paths>
80
+ git commit --only -m "handoff: checkpoint before implement" -- <run-owned paths>
78
81
  ```
82
+ `--only` commits just the listed paths and leaves other index entries staged. Do not unstage,
83
+ revert or commit unrelated changes.
79
84
 
80
85
  ## Step 2 — Build wave groups
81
86
 
@@ -210,7 +215,8 @@ node .claude/ukit/index/land-worktree.mjs \
210
215
  # After each exit-0 landing, checkpoint-commit the landed paths (receipt stays outside the target set)
211
216
  # BEFORE landing the next task: the helper refuses a destination with tracked modifications
212
217
  # (destination-dirty), so uncommitted landed work would block every later task in the wave.
213
- git add -- <landed paths> && git commit -m "checkpoint: $TASK landed"
218
+ git add -- <landed paths>
219
+ git commit --only -m "checkpoint: $TASK landed" -- <landed paths>
214
220
 
215
221
  # update INDEX.md: status → pending_review
216
222
  ```
@@ -218,7 +224,11 @@ git add -- <landed paths> && git commit -m "checkpoint: $TASK landed"
218
224
  **FAIL:**
219
225
  ```bash
220
226
  # No landing for a FAIL report — retain the worktree and branch as recovery evidence.
221
- # update INDEX.md: status → blocked
227
+ # Bounded local recovery first: diagnose from the executor report, then retry with a
228
+ # different strategy (max 2 distinct strategies), or replan the task as TASK-xxx-R<n>.
229
+ # update INDEX.md: status → in_progress (fix round) — NOT blocked for a local failure.
230
+ # `blocked` only when the blocker is external (credential, dead service, network) or a
231
+ # genuine requirement conflict needs the owner; record that reason in ## Discussion.
222
232
  ```
223
233
 
224
234
  **EXECUTOR_MODEL missing:**
@@ -236,10 +246,13 @@ never an unconditional forced removal or branch deletion sitting next to the lan
236
246
  A wave boundary is the only safe place to shed context, because everything of value is
237
247
  already on disk (task files hold the full logs, git holds the code). Do all four, in order:
238
248
 
239
- 1. **Checkpoint the code** — one commit per wave, so every wave is independently revertible:
249
+ 1. **Checkpoint the code** — one commit per wave, so every wave is independently revertible.
250
+ Stage and commit only this wave's landed paths (the receipt-listed targets), never `git add -A`:
240
251
  ```bash
241
- git add -A && git commit -m "handoff: wave <N> — TASK-00x, TASK-00y"
252
+ git add -- <wave landed paths>
253
+ git commit --only -m "handoff: wave <N> — TASK-00x, TASK-00y" -- <wave landed paths>
242
254
  ```
255
+ Unrelated staged or modified owner changes are left as they are.
243
256
  Do not push. `/ukit:handoff-review` owns that decision.
244
257
 
245
258
  2. **Update the run cursor** — rewrite `docs/AI_HANDOFF/RUN.md` with `Cursor: wave <N> done`,
@@ -273,8 +286,10 @@ snapshot, unmerged history. Unexplained leftovers fail the gate; nothing is remo
273
286
  An eligible task is retired only through the shared, receipt-gated helper
274
287
  (`node .claude/ukit/index/cleanup-task-worktree.mjs --receipt <json> --approval <json> --apply`).
275
288
 
276
- All changes are committed as **one commit per wave on `$BASE`**, nothing pushed. No branches
277
- or worktrees remain. Set `Phase: done` in `docs/AI_HANDOFF/RUN.md`.
289
+ All changes are committed as **one commit per wave on `$BASE`**, nothing pushed. Worktrees and
290
+ branches are retired only through the receipt-gated helper; any that remain are named in the
291
+ retained-reason report. Set `Phase: done` in `docs/AI_HANDOFF/RUN.md` only when no task is
292
+ still open.
278
293
 
279
294
  ## Step 5 — Report
280
295
 
@@ -283,7 +298,7 @@ Wave summary:
283
298
  Wave 1: TASK-001 [pending_review], TASK-002 [blocked]
284
299
  Wave 2: TASK-003 [pending_review]
285
300
  Commits: <K> wave commits on <BASE>, not pushed
286
- All worktrees and branches removed.
301
+ Retained (receipt-gated cleanup): <worktree/branch — reason> | none
287
302
  Blocked (needs you): <TASK-xxx — one-line reason> | none
288
303
  ```
289
304
 
@@ -206,25 +206,33 @@ For round in 1..2:
206
206
  to the task file;
207
207
  - a ≤10-line return contract (`TASK` / `STATUS` / `EXECUTOR_MODEL` / `FILES` / `VERIFY` /
208
208
  `NOTE`) — no pasted logs.
209
- 3. Copy changes back, delete worktrees, then checkpoint:
209
+ 3. Copy changes back, then checkpoint only the fix-round paths (never `git add -A`). Worktree
210
+ removal is a separate receipt-gated step (`cleanup-task-worktree.mjs`), not a forced delete:
210
211
  ```bash
211
- git add -A && git commit -m "handoff: fix round <N> — TASK-00x"
212
+ git add -- <fix-round landed paths>
213
+ git commit --only -m "handoff: fix round <N> — TASK-00x" -- <fix-round landed paths>
212
214
  ```
213
215
  4. Re-review **only the tasks touched this round**, in parallel, per 2a–2f — panel spawn, aggregation, and lead bucketing included. The reviewers must
214
216
  still differ from the executor model and still re-runs verification itself.
215
217
  5. Update `INDEX.md` and `RUN.md`. Exit when everything is approved.
216
218
 
217
- After round 2, a task still failing is genuinely stuck: leave it `blocked`, record why in its
218
- `## Discussion` thread, and name it in the report. **Every other task still proceeds to Step
219
+ After round 2, a task still failing gets one bounded investigate/replan pass (a new strategy or a
220
+ `TASK-xxx-R<n>` replacement, never a silent loop). Only an external blocker or a genuine
221
+ requirement conflict that needs the owner justifies `blocked`; record the reason in its
222
+ `## Discussion` thread and name it in the report. A local test or review failure alone is not
223
+ `blocked`. **Every other task still proceeds to Step
219
224
  4** — one stubborn task must not hold the rest hostage.
220
225
 
221
226
  ## Step 4 — Commit + push
222
227
 
223
- Update `INDEX.md`: approved tasks → `done`; still-failing tasks → `blocked`.
228
+ Update `INDEX.md`: approved tasks with acceptance met → `done`; still-failing tasks stay at their last non-approved
229
+ status (`changes_requested`/`critical_block`) with the bounded investigate/replan reason in `## Discussion`.
230
+ `blocked` is set only for an external blocker or a genuine requirement conflict that needs the owner.
224
231
 
225
- Commit anything left uncommitted, then push once:
232
+ Commit only the review-owned paths that are still uncommitted (never `git add -A`), then push once:
226
233
  ```bash
227
- git add -A && git commit -m "handoff: review <goal>" # skip if nothing left to commit
234
+ git add -- <review-owned paths>
235
+ git commit --only -m "handoff: review <goal>" -- <review-owned paths> # skip if nothing left to commit
228
236
  git push origin $BASE
229
237
  ```
230
238
 
@@ -234,7 +242,9 @@ run never stalls at the last step. Force-push stays denied, so this can only fas
234
242
  If some tasks are `blocked`, still push: the approved work is reviewed, tested and
235
243
  committed, and the per-wave commits make any subset revertible.
236
244
 
237
- Set `Phase: done` in `docs/AI_HANDOFF/RUN.md`.
245
+ Set `Phase: done` in `docs/AI_HANDOFF/RUN.md` only after all assigned work and required
246
+ integration/delivery verification are complete. Otherwise retain the actual phase, scope and
247
+ next repair step; a partial review or push does not complete the run.
238
248
 
239
249
  ## Step 5 — Report
240
250
 
@@ -223,6 +223,11 @@ async function emitOrdinaryResume(payload, source) {
223
223
  const currentTask = field('CurrentTask');
224
224
  const retryFingerprint = field('RetryFingerprint');
225
225
  const retryCount = field('RetryCount');
226
+ // Optional durable scope carry (additive). Printed verbatim so compact never re-derives the
227
+ // authorized scope; the hook only echoes them — it never widens authority from them.
228
+ const scopePlans = field('ScopePlans');
229
+ const scopeQueue = field('ScopeQueue');
230
+ const authorization = field('Authorization');
226
231
 
227
232
  // The session's CURRENT handoff intent — structured transcript evidence, the
228
233
  // same shared module the Stop gate uses. A session whose latest request is
@@ -297,6 +302,9 @@ async function emitOrdinaryResume(payload, source) {
297
302
  ...(acceptance ? [` Acceptance: ${acceptance}`] : []),
298
303
  ...(currentTask ? [` CurrentTask: ${currentTask}`] : []),
299
304
  ...(retryFingerprint ? [` RetryFingerprint: ${retryFingerprint} (RetryCount: ${retryCount || '0'})`] : []),
305
+ ...(scopePlans ? [` ScopePlans: ${scopePlans}`] : []),
306
+ ...(scopeQueue ? [` ScopeQueue: ${scopeQueue}`] : []),
307
+ ...(authorization ? [` Authorization: ${authorization}`] : []),
300
308
  '',
301
309
  'This is a CONTINUATION, not a new cycle. Do not re-plan, do not overwrite PLAN.md or the',
302
310
  'task files, and do not ask the user whether to continue — they already asked for a',
@@ -20,11 +20,16 @@ Dispositions (exactly one per row):
20
20
  - `deferred` - intentionally later; names its queue entry (the blueprint slug).
21
21
  - `blocker` - cannot proceed; names the missing precondition. An unreadable or empty source is `R-000 | blocker`.
22
22
 
23
+ Prohibitions are confirmed exclusions: a source "must not" / "never" rule is recorded as a confirmed exclusion with its rationale. If it is enforceable in scope, it is a `feasible` or `adapted` row whose acceptance includes a referenced negative test (a test that proves the forbidden behaviour is absent). No new taxonomy is needed for this.
24
+
25
+ The `10` limit is a dispatch and context window, not a classification. Queued drafts carry no runnable rows; their INDEX rows are `queued_blueprint`.
26
+
23
27
  Footer (required, last lines of the file):
24
28
 
25
29
  ```
26
30
  Coverage: N/N rows dispositioned
27
- Note: disposition coverage is not implementation coverage.
31
+ Executable coverage: M/K feasible|adapted rows carry an executable acceptance and test/verification command
32
+ Note: disposition coverage is not implementation coverage; executable coverage is counted separately.
28
33
  ```
29
34
 
30
35
  A row without a disposition means the ledger is unfinished. A claim of "100% implemented" is a defect.
@@ -68,7 +73,33 @@ QueueDrain: separate-backlog
68
73
  QueueSource: <ledger R-IDs or epic ids, e.g. R-003, R-007 / COW-300>
69
74
  ```
70
75
 
71
- A blueprint with `QueueIntent: deliberate-future` is reported as backlog by fullstack and is not folded into the current cycle. A blueprint without the line keeps the legacy fold-in behaviour. The contract is documented in `docs/AI_HANDOFF/queued/README.md`.
76
+ Two queue kinds share the `queued/` lane and must not be confused:
77
+
78
+ - **Mandatory overflow** (`feasible`/`adapted` rows beyond the 10-task threshold): queued WITHOUT `QueueIntent` (no `Queue*` header line at all). Fullstack folds it into the cycle like a legacy blueprint; it is consumable work, never excluded.
79
+ - **Deliberate-future** (`deferred` rows only): carries the four `Queue*` lines above. Fullstack reports it as `Backlog: <slug>`, never folds it, and drains it only when the human names the slug.
80
+
81
+ A blueprint without the line keeps the legacy fold-in behaviour. The contract is documented in `docs/AI_HANDOFF/queued/README.md`.
82
+
83
+ **Mandatory overflow naming (default):** group overflow tasks by dependency chain (a task and everything it depends on that is also overflow form one group). Each group is one blueprint: `queued/<plan-slug>-overflow-<NN>/`, where `<plan-slug>` is the plan's slug and `<NN>` is the next unused two-digit index under that plan (scan existing `overflow-*` dirs, take max+1). Never reuse or overwrite an existing blueprint dir; on any collision append `-2`, `-3`, … to the directory name. Each blueprint's `HANDOFF.md` lists its R-IDs and task IDs.
84
+
85
+ ## Source snapshot
86
+
87
+ Before chunking, persist the original verbatim: `${OUTPUT_ROOT}SOURCE.md` holds the original path, the `sha256` of the original file's bytes (not of this wrapper or any metadata header), and an unmodified copy of those bytes. For chat or pasted input with no file, record the durable verbatim message origin (message id or transcript path plus the exact text) in place of the path. Gatherers and planners cite `SOURCE.md` lines; no model paraphrase replaces it. The reviewer starts its chain from `SOURCE.md` and re-hashes the original bytes.
88
+
89
+ ## Source-only notes
90
+
91
+ File: `${OUTPUT_ROOT}NOTES.md` (the semantic record is mandatory: every classification, exclusion, and rationale is recorded durably, and this file is the default home for the non-task items; an equivalent name is acceptable, and the file is written only when such items exist). Non-requirement material that a ledger row cannot carry. Each entry names its source (`doc §… L…`, or the human's words) and one kind:
92
+
93
+ | Kind | Meaning |
94
+ |------|---------|
95
+ | `confirmed` | requirement or exclusion the human confirmed, with its rationale and a verbatim owner quote |
96
+ | `example` | illustration only; not a requirement |
97
+ | `proposal` | suggested approach not yet chosen |
98
+ | `assumption` | default taken where the source is silent; names the default |
99
+ | `question` | open question; names the resolution used or "open" |
100
+ | `rejected` / `superseded` | choice dropped, with the reason and the replacing row or task |
101
+
102
+ Rules: never drop an entry because it is not a task; a `rejected`/`superseded` entry stays so the rationale survives a replan. Replans append, never rewrite, prior entries.
72
103
 
73
104
  ## Chunking
74
105