@gtrabanco/pi-agentic-workflow 0.13.3 → 0.14.0

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 (91) hide show
  1. package/README.md +3 -9
  2. package/dist/runtime.d.ts +45 -0
  3. package/dist/runtime.js +62 -0
  4. package/package.json +3 -2
  5. package/skills/audit-docs/SKILL.md +6 -5
  6. package/skills/audit-pr/SKILL.md +1 -1
  7. package/skills/audit-pr/references/PORTABILITY.md +1 -1
  8. package/skills/execute-phase/SKILL.md +207 -116
  9. package/skills/execute-phase/references/DESCOPE.md +22 -18
  10. package/skills/execute-phase/references/EXECUTION_CONTRACT.md +69 -77
  11. package/skills/execute-phase/references/FOLDING.md +34 -47
  12. package/skills/execute-phase/references/PREFLIGHT.md +103 -114
  13. package/skills/execute-phase/references/PRE_EXECUTION_GATE.md +53 -60
  14. package/skills/init-workspace/SKILL.md +35 -5
  15. package/skills/init-workspace/references/BOOTSTRAP_DISCOVERY.md +5 -5
  16. package/skills/init-workspace/references/BOOTSTRAP_WRITE.md +15 -8
  17. package/skills/init-workspace/references/PORTABILITY.md +1 -1
  18. package/skills/init-workspace/references/UPGRADE.md +17 -7
  19. package/skills/log-session/SKILL.md +4 -3
  20. package/skills/orchestration-envelope/references/TURN_CONTRACT.md +1 -1
  21. package/skills/pre-execution-review/references/LEDGERS.md +39 -39
  22. package/skills/pre-execution-review/references/POLICY.md +1 -0
  23. package/skills/review-change/SKILL.md +1 -1
  24. package/skills/review-change/references/PORTABILITY.md +1 -1
  25. package/skills/unit-lane/SKILL.md +154 -0
  26. package/skills/unit-lane/references/DESIGN.md +35 -0
  27. package/skills/unit-lane/references/DOCS.md +36 -0
  28. package/skills/unit-lane/references/EVIDENCE.md +34 -0
  29. package/skills/unit-lane/references/IMPLEMENT.md +45 -0
  30. package/skills/unit-lane/references/PLAN.md +38 -0
  31. package/skills/unit-lane/references/RELEASE.md +45 -0
  32. package/skills/unit-lane/references/RESEARCH.md +37 -0
  33. package/skills/unit-lane/references/REVIEW.md +45 -0
  34. package/skills/unit-lane/references/STEPS.md +23 -0
  35. package/skills/unit-lane/references/TESTS.md +32 -0
  36. package/skills/workflow-status/references/ENVELOPE_FIELDS.md +5 -6
  37. package/skills/workflow-status/references/SENSOR_CORE.md +16 -20
  38. package/skills/workflow-status/references/SENSOR_SIGNALS.md +5 -7
  39. package/skills/design-feature/SKILL.md +0 -231
  40. package/skills/design-feature/references/INTERVIEW.md +0 -74
  41. package/skills/design-feature/references/PORTABILITY.md +0 -15
  42. package/skills/design-feature/references/REPAIR.md +0 -88
  43. package/skills/design-feature/references/UPSERT_EXAMPLE.md +0 -8
  44. package/skills/design-feature/references/WRITE_AND_UPSERT.md +0 -115
  45. package/skills/evidence-grounding/SKILL.md +0 -174
  46. package/skills/evidence-grounding/references/DELEGATION.md +0 -131
  47. package/skills/evidence-grounding/references/READINESS.md +0 -130
  48. package/skills/evidence-grounding/references/ROWS.md +0 -93
  49. package/skills/execute-phase/references/BATCH_AND_PORTABILITY.md +0 -57
  50. package/skills/execute-phase/references/CLOSEOUT.md +0 -77
  51. package/skills/execute-phase/references/HANDOFF.md +0 -21
  52. package/skills/execute-phase/references/OPPORTUNISTIC_FINDING.md +0 -45
  53. package/skills/execute-phase/references/UNIT_LOOP.md +0 -88
  54. package/skills/execute-phase/references/WORKFLOWS_FEATURE.md +0 -37
  55. package/skills/execute-phase/references/WORKFLOWS_FIX.md +0 -43
  56. package/skills/execute-phase/references/WORKFLOWS_LEGACY.md +0 -26
  57. package/skills/execute-phase/references/WORKFLOWS_SMALL_PHASED.md +0 -38
  58. package/skills/generate-docs/SKILL.md +0 -145
  59. package/skills/generate-docs/references/ADAPTERS.md +0 -15
  60. package/skills/generate-docs/references/ADAPTER_DISCOVERY.md +0 -33
  61. package/skills/generate-docs/references/GENERATION_PROCESS.md +0 -90
  62. package/skills/implementation-discovery/SKILL.md +0 -209
  63. package/skills/plan-feature/SKILL.md +0 -208
  64. package/skills/plan-feature/references/ROUTING.md +0 -155
  65. package/skills/plan-feature-from-issue/SKILL.md +0 -162
  66. package/skills/plan-feature-scaffold/SKILL.md +0 -112
  67. package/skills/plan-feature-scaffold/references/SCAFFOLD_PROCESS.md +0 -122
  68. package/skills/plan-fix/SKILL.md +0 -161
  69. package/skills/plan-fix/references/PLANNING_PROCESS.md +0 -148
  70. package/skills/plan-fix/references/SPEC_CONTRACT.md +0 -22
  71. package/skills/planning-preflight/SKILL.md +0 -130
  72. package/skills/replan-findings/SKILL.md +0 -131
  73. package/skills/replan-findings/references/PHASE_APPEND.md +0 -89
  74. package/skills/review-plan/SKILL.md +0 -154
  75. package/skills/review-plan/references/CHECKS.md +0 -111
  76. package/skills/review-plan/references/ENG-CHECKS.md +0 -30
  77. package/skills/review-plan/references/OUTPUT.md +0 -166
  78. package/skills/review-spec/SKILL.md +0 -145
  79. package/skills/review-spec/references/CHECKS.md +0 -108
  80. package/skills/review-spec/references/OUTPUT.md +0 -160
  81. package/skills/ship-roadmap/SKILL.md +0 -120
  82. package/skills/ship-roadmap/references/ADVANCE.md +0 -117
  83. package/skills/ship-roadmap/references/AUDIT_AND_MERGE.md +0 -64
  84. package/skills/ship-roadmap/references/CLOSEOUT_AND_LOG.md +0 -27
  85. package/skills/ship-roadmap/references/FOUNDING.md +0 -101
  86. package/skills/ship-roadmap/references/GUARDRAILS.md +0 -56
  87. package/skills/ship-roadmap/references/MODEL_ROUTING.md +0 -16
  88. package/skills/ship-roadmap/references/PORTABILITY.md +0 -34
  89. package/skills/ship-roadmap/references/RECOVERY_AND_SELECTION.md +0 -94
  90. package/skills/ship-roadmap/references/STOP_CONDITIONS.md +0 -9
  91. package/skills/ship-roadmap/references/TERMINAL_REPORT.md +0 -34
@@ -1,145 +0,0 @@
1
- ---
2
- name: generate-docs
3
- user-invocable: true
4
- version: 2.0.1
5
- argument-hint: "[NN-slug | fix-n | path/glob] [--review]"
6
- author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
7
- license: MIT
8
- description: >
9
- Generate incremental, diff-driven developer guides through the project's
10
- detected docs adapter. Never regenerate the whole site, scaffold it, or edit
11
- source. Triggers: "generate-docs", "generate the docs", "document this unit".
12
- ---
13
-
14
- # Generate Docs
15
-
16
- Turn the knowledge produced by a unit of work into developer documentation a
17
- contributor can read on the project's docs website — incrementally, as a
18
- by-product of shipping, so a public repo's docs stay current instead of
19
- rotting. A commit says what changed; a guide says how to use it ("how do I
20
- create a domain event and where do I register its handler").
21
-
22
- ## Turn contract — verify before ending the turn
23
-
24
- ```
25
- ✓ The docs adapter was resolved through the Step 0 detection checklist and the
26
- outcome (adapter name, or NOT CONFIGURED) is stated in the report
27
- ✓ Every generated/updated page is WRITTEN to disk (paths listed in the report)
28
- and carries the provenance frontmatter — or zero pages were written and the
29
- report says exactly why
30
- ✓ The verify step was RUN (docs build command or link check) and its result
31
- pasted — never assumed
32
- ✓ Artifact language: explicit user instruction > the project's declared docs
33
- language > English. The CONVERSATION language never decides
34
- ✓ The fixed report block is printed, then the closing `→ Next:` block, as the
35
- ABSOLUTE last output
36
- ```
37
-
38
- About to end the turn with any box unchecked? The turn is NOT done — complete
39
- the missing box first (weak models drop end-of-document duties; this list is
40
- first on purpose).
41
-
42
- ## When to use
43
-
44
- - **After finishing a unit of work** — `execute-phase` recommends this skill at
45
- close-out when the project declares a docs site: document what the unit
46
- changed while the context is fresh.
47
- - **On demand** for a specific area: `generate-docs src/domain/events/`.
48
- - **`--review`** — export the latest `review-change` report as a docs page so
49
- humans can review findings from the website.
50
- - Not for writing SPECs/planning docs (`plan-feature`), session journals
51
- (`log-session`), or reviewing code (`review-change` produces the findings;
52
- this skill only publishes an existing report on request).
53
-
54
- ## Progressive loading — resolve the docs route
55
-
56
- The reference allowlist is exactly the three paths below. Read them in this
57
- order; every selected resource is normative and one hop from this entrypoint.
58
-
59
- 1. Every invocation: read [adapter discovery](references/ADAPTER_DISCOVERY.md)
60
- and resolve the adapter with evidence. `NOT CONFIGURED` stops writing.
61
- 2. Configured adapter only: before choosing any output path or format, read
62
- [adapter slots](references/ADAPTERS.md).
63
- 3. Read [generation process](references/GENERATION_PROCESS.md) and execute the
64
- scope, incrementality, map/review, verify, and report steps.
65
-
66
- Do not load steps 2–3 after `NOT CONFIGURED`. Missing required resource → stop;
67
- never guess an adapter, output path, or fixed contract.
68
-
69
- ## Allowed & forbidden (fixed lists — no interpretation)
70
-
71
- **Allowed:**
72
- - Writing/updating pages under the adapter's guides location
73
- - Updating only the adapter's declared manual sidebar config when the adapter
74
- table requires it
75
- - Running the declared docs build/verify command
76
- - Reading anything (diff, code, docs)
77
-
78
- **Forbidden — never, even if it "would help":**
79
- - Whole-project doc regeneration (the incrementality checklist is the only
80
- page selector)
81
- - Editing source code, tests, or any config other than the adapter's declared
82
- manual sidebar config
83
- - Scaffolding a docs site (installing Astro/Starlight, creating configs)
84
- - Writing outside the adapter's content locations, except that declared manual
85
- sidebar config
86
- - Pages without the provenance frontmatter
87
- - Committing or pushing (the unit's workflow owns the commit)
88
-
89
- ## Return exactly
90
-
91
- ```
92
- GENERATE DOCS — adapter: <starlight|docusaurus|markdown|NOT CONFIGURED> — scope: <scope>
93
-
94
- | Page | Action | Source-unit | Subject paths |
95
- |---|---|---|---|
96
- | <content-path> | created|updated | <NN-slug> | <paths> |
97
-
98
- Map: regenerated (<command>) | n/a — no map command declared | invalid output — <reason>
99
- Review export: <page path> | not requested | no report available
100
- Verify: <command + exit code | links checked: <n>, broken: 0 | n/a — not configured>
101
- Pages: <n> written, <n> skipped by incrementality checklist
102
- Decision: PASS | FAIL | NOT-CONFIGURED
103
- ```
104
-
105
- `FAIL` only when the verify step is red or a written page had to be reverted;
106
- `NOT-CONFIGURED` per Step 0.5; `PASS` otherwise (including 0 pages).
107
-
108
- ## Portability (agents other than Claude Code)
109
-
110
- The workflow is the contract; Claude Code features are conveniences. On an
111
- agent that lacks one, apply the fallback — never skip the step the feature
112
- enables:
113
-
114
- - **No slash-command menu** — where this skill says `/<skill>`, open that
115
- skill's `SKILL.md` and follow it literally in a fresh conversation.
116
- - **No per-skill `model:`/`effort:`** — writing guides is structured
117
- summarization over a diff: a **mid-tier** model suffices; never below the
118
- tier that can read the project's language accurately.
119
- - **No argument passing** — state the scope in the invocation message
120
- ("generate docs for 01-generate-docs"); the Process step 1 order still
121
- applies.
122
-
123
- ## Relationship to other skills
124
-
125
- - **`execute-phase`** recommends this skill at unit close-out when the
126
- documentation map declares a docs site (hand-off via `→ Next:` — never
127
- composed in-turn).
128
- - **`audit-docs`** detects orphan/stale generated pages via the provenance
129
- frontmatter.
130
- - **`init-workspace`** records the `Docs site` declaration this skill's Step 0
131
- reads.
132
- - Not a review: findings/quality belong to `review-change`.
133
-
134
- ## Done when
135
-
136
- - The adapter outcome is stated with evidence; every selected page is written
137
- with provenance frontmatter; the verify step ran and is green (or the
138
- NOT-CONFIGURED report was printed and nothing was written).
139
- - The fixed report block was returned, then:
140
-
141
- ```
142
- → Next: commit these pages with the unit's close-out (they ride the unit's PR)
143
- · unit already closed → commit as docs(<unit>): generated guides on the unit's branch
144
- · adapter NOT CONFIGURED → add the Docs site block to the documentation map, then re-run /generate-docs
145
- ```
@@ -1,15 +0,0 @@
1
- ## Adapters (reference implementations)
2
-
3
- The generic contract is the slots below; anything stack-specific lives only in
4
- this table. Starlight is the first-class reference.
5
-
6
- | Slot | Starlight (reference) | Docusaurus | Plain markdown (fallback) |
7
- |---|---|---|---|
8
- | Content dir | `src/content/docs/` (or the declared one) | `<site>/docs/` (or the declared one) | `docs/site/` |
9
- | Page format | `.mdx`; frontmatter `title`, `description` + provenance keys | `.mdx`; frontmatter `title`, `description` + provenance keys | `.md`; H1 title + provenance keys in an HTML comment frontmatter block |
10
- | Guides | `<content>/guides/<area>/<topic>.mdx` | `<content>/guides/<area>/<topic>.mdx` | `docs/site/guides/<area>/<topic>.md` |
11
- | Knowledge map | `<content>/map/graph.json` + `<content>/map/<module>.mdx` wrappers | `<content>/map/graph.json` + `<content>/map/<module>.mdx` wrappers | `docs/site/map/graph.json` + `docs/site/map/<module>.md` |
12
- | Review reports | `<content>/reviews/<unit>-<date>.mdx` | `<content>/reviews/<unit>-<date>.mdx` | `docs/site/reviews/<unit>-<date>.md` |
13
- | Sidebar | Starlight autogenerated sidebar (directory-based); no manual sidebar edits | If the project declares a manual `sidebars.js`/`sidebars.ts`, update only that declared config; otherwise use the Docusaurus autogenerated sidebar and make no sidebar edit. Stop when the sidebar mode or declared config path cannot be resolved. | n/a — directory listing |
14
- | Verify | declared build command (`npx astro check` / `astro build`) | declared Docusaurus build command (`npx docusaurus build` or project equivalent) | intra-docs link check |
15
- | Assets | none generated | none generated | none generated |
@@ -1,33 +0,0 @@
1
- ## Step 0 — Discover the project (always first)
2
-
3
- Per the agent guide's **Workflow conventions** + **documentation map**, then
4
- resolve the **docs adapter** with this checklist — fixed order, first match
5
- wins, evidence required for the match:
6
-
7
- 1. **Explicit declaration** — the documentation map contains a `Docs site`
8
- block (format, content dir, build command, map command). Evidence: quote
9
- the block. → use the declared adapter.
10
- 2. **Starlight** — an `astro.config.*` exists AND `@astrojs/starlight` is in
11
- the project's dependencies. Evidence: config path + the dependency line.
12
- → Starlight adapter.
13
- 3. **Docusaurus** — a `docusaurus.config.*` exists AND `@docusaurus/core` is a
14
- dependency. Evidence: config path + the dependency line. → Docusaurus
15
- adapter (same slots as Starlight; `.mdx` under the site's `docs/` dir,
16
- sidebar per its convention).
17
- 4. **Plain-markdown fallback** — a `docs/` directory exists. → plain-markdown
18
- adapter (always available).
19
- 5. **None of the above** → **NOT CONFIGURED**: write nothing. Print the report
20
- with `Decision: NOT-CONFIGURED`, and include this snippet for the user to
21
- add to their documentation map:
22
-
23
- ```markdown
24
- ## Docs site
25
- - format: starlight | docusaurus | markdown
26
- - content-dir: <path, e.g. src/content/docs/>
27
- - build: <command, e.g. npx astro check | none>
28
- - map: <command emitting a nodes/edges JSON | none>
29
- ```
30
-
31
- Detection is per invocation — never cached, never guessed. A monorepo with
32
- more than one docs site is a documented limitation: use the first declaration
33
- found and say so in the report (see the feature's `known-issues.md`).
@@ -1,90 +0,0 @@
1
- ## Process
2
-
3
- 1. **Resolve the scope** — exactly one of, in this order:
4
- - an explicit argument (`NN-slug`, `fix-n`, or a path/glob) → that unit's
5
- branch diff vs the default branch, or the given paths;
6
- - no argument → the current branch's diff vs the default branch;
7
- - on the default branch with a clean tree → the last merged unit's diff
8
- (`git log --merges -1` → its diff). State the resolved scope in the
9
- report.
10
-
11
- 2. **Select pages with the incrementality checklist.** A guide page is
12
- (re)written only if at least one holds — otherwise it is not touched:
13
- - ✓ the diff changes files under the page's subject paths (page exists →
14
- update it);
15
- - ✓ the diff introduces a public entry point (exported API, event, command,
16
- route, port) that no existing guide covers (→ create the page).
17
-
18
- **Whole-tree regeneration is Forbidden** — an empty selection is a valid,
19
- reportable outcome (`0 pages`, `Decision: PASS`).
20
-
21
- 3. **Write the pages** into the adapter's guides location (see the adapter
22
- table). Fixed page shape, identical on every agent:
23
- - **Title** — task-oriented ("Create a domain event"), not file-oriented.
24
- - **Frontmatter** — the adapter's required keys **plus the provenance
25
- keys** (mandatory, exactly these names):
26
-
27
- ```yaml
28
- generated-by: agentic-workflow/generate-docs
29
- source-unit: <NN-slug | fix-n>
30
- updated: <ISO date>
31
- ```
32
-
33
- - **Body sections, in order**: *What this is* (1 paragraph) · *How to do
34
- it* (numbered steps citing real paths — `src/...`, clickable) · *Where
35
- the pieces live* (table: role → path) · *Related* (links to sibling
36
- guide pages that share subject paths).
37
- - **File name**: kebab-case derived from the subject module path
38
- (`src/domain/events/` → `guides/domain/events.mdx`) — never a
39
- model-invented name.
40
- - Facts come from the diff and the code — a claim that cannot cite a path
41
- does not go in the page.
42
-
43
- 4. **Knowledge map** (only when the documentation map declares a `map`
44
- command). The map is the navigable call/module graph that lets a reader
45
- trace an error doc-to-doc to its origin. Rules — no interpretation:
46
- - **Run the declared command** (a project script wrapping deterministic
47
- tooling — dependency-cruiser, madge, TypeDoc, tree-sitter, an LSP dump…).
48
- The model **never infers graph nodes or edges** — zero-token structural
49
- truth, or no map at all.
50
- - **Validate the output**: JSON with `nodes[]` (each
51
- `{"id", "path"}` minimum) and `edges[]` (each `{"from", "to"}`), any
52
- extra keys allowed. Invalid → write nothing, report
53
- `Map: invalid output — <first mismatch>` and count it as a FAIL.
54
- - Valid → write it to the adapter's map location as `graph.json`, then
55
- write/refresh one wrapper page per top-level module **the scope
56
- touched** (incrementality applies to wrapper pages, not to the JSON):
57
- the page lists the module's nodes with source paths, direct callers,
58
- direct callees, and links to guide pages sharing subject paths — the
59
- stack-trace walk. Wrapper pages carry the provenance frontmatter.
60
- - No `map` command declared → `Map: n/a — no map command declared` in the
61
- report. Never substitute model inference.
62
-
63
- Per-tool recipes (the mapping each tool needs to emit the shape above):
64
- `dependency-cruiser --output-type json` → modules⇒nodes, dependencies⇒edges;
65
- `madge --json` → adjacency object⇒edges; TypeDoc JSON → reflections⇒nodes,
66
- references⇒edges; tree-sitter/LSP call hierarchy → definitions⇒nodes,
67
- calls⇒edges. The project's script owns the mapping; these recipes are
68
- documentation for writing that script, not something this skill executes ad
69
- hoc.
70
-
71
- 5. **Review export** (only with the explicit `--review` flag — never
72
- automatic; findings may predate their fixes and a public site is a
73
- publishing decision). Take the most recent `review-change` report available
74
- in the invoking context (or the path the user names), convert its
75
- fixed-format blocks verbatim into one page at the adapter's reviews
76
- location (`reviews/<unit>-<ISO-date>.mdx` or `.md`), provenance frontmatter
77
- included, findings tables intact — no summarizing, no re-judging (that is
78
- `review-change`'s output, frozen). No report available → state it in the
79
- report block and write nothing.
80
-
81
- 6. **Verify.** Run the declared docs build command (e.g. `npx astro check`)
82
- when the adapter declares one; otherwise check that every intra-docs link
83
- in the written pages resolves. Paste the command + exit code (or the link
84
- count) in the report. A red build → fix the written pages or revert them;
85
- never leave the docs site broken.
86
-
87
- 7. **Report** (fixed block), then the closing `→ Next:` block as the
88
- ABSOLUTE last output. This skill does **not** commit — the pages ride the
89
- unit's workflow (the executor or the user commits them with the unit's
90
- close-out).
@@ -1,209 +0,0 @@
1
- ---
2
- name: implementation-discovery
3
- user-invocable: false
4
- version: 1.1.0
5
- author: "Gabriel Trabanco <1969593+gtrabanco@users.noreply.github.com>"
6
- license: MIT
7
- description: >
8
- Internal contract: the single owner of the bounded pre-write implementation
9
- discovery step. One read-only mapper that closes seven evidence questions,
10
- emits one fixed compact map, and routes READY | REPLAN | NEEDS-DESIGN |
11
- BLOCKED before any branch, planning, or source write. Consumed only by
12
- execute-phase on the pre-write route. Not a menu entry.
13
- ---
14
-
15
- # Implementation Discovery (internal)
16
-
17
- The one authoritative owner of the bounded, read-only pre-write mapper consumed
18
- by `execute-phase`. A phase does not touch the repository until this step has
19
- closed its questions and said `READY`. Nothing else may define what a valid
20
- pre-write discovery pass is.
21
-
22
- ## When to use
23
-
24
- - `execute-phase` — before any branch/planning/source write, after the read-only
25
- dependency/status/acceptance/phase/feature-28 receipt checks.
26
- - The step runs only on the pre-write route; it is never a general-purpose
27
- orientation pass and never a substitute for planning.
28
-
29
- ## Inputs (exact, only these)
30
-
31
- The mapper receives only:
32
-
33
- - the governing SPEC/fix obligations for the current phase;
34
- - the current feature-28 SPEC and Plan receipt digests;
35
- - the phase-relevant rows from frozen planning evidence, with source revision,
36
- affected decision/obligation, freshness, and declared unknowns;
37
- - the phase fingerprint, ordered tasks, acceptance/obligation ids, and the last
38
- progress receipt;
39
- - source HEAD plus clean-source / allowed-planning-path evidence;
40
- - applicable NRS / decision / invariant evidence;
41
- - the repository discovery tools available in this environment.
42
-
43
- ## Advisory locators
44
-
45
- Semantic/symbol navigation and Engram/memory tools are optional adapters that may
46
- locate evidence faster; they are never authority. Direct repository/Git/search/
47
- read/test fallback must satisfy the identical evidence contract, and only
48
- repository bytes answer a map field. The tool that found a citation does not
49
- excuse a missing `path:line` or a contradictory claim.
50
-
51
- ## Seven evidence questions
52
-
53
- Every pass must answer — each answer citing repository-relative `path:line`,
54
- symbol, or test plus exact source revision / content identity:
55
-
56
- 1. Which entry points and public/internal interfaces own current behaviour?
57
- 2. Which callers, adapters, roles, compatibility surfaces, and failure paths
58
- can this phase affect?
59
- 3. Which helpers, patterns, decisions, and invariants constrain the change?
60
- 4. Which tests, fixtures, probes, and production-like scenarios establish
61
- current behaviour?
62
- 5. Which exact writes are expected, and which reviewed obligation does each
63
- serve?
64
- 6. Which carried planning-evidence claims and Plan assumptions are directly
65
- confirmed, refined, stale, missing, or contradicted by source?
66
- 7. Which relevant unknowns remain, who owns them, and what evidence resolves
67
- them?
68
-
69
- The mapper records conclusions, not every search. Repeating a search/read
70
- requires a new question, changed source, or insufficient cited evidence;
71
- otherwise it stops (no-progress).
72
-
73
- ## Inline and fresh routing
74
-
75
- **Inline** is permitted only when behaviour is localized/familiar, targeted
76
- evidence answers every question, no public/persistence/security/recovery/
77
- compatibility boundary may change, and the executor can finish the map before
78
- writing.
79
-
80
- **A fresh read-only mapper** is required for cross-module/layer or unfamiliar
81
- work, public/persistence/security/recovery/compatibility impact, competing
82
- project patterns, an unproven material Plan assumption, prior failed
83
- attempts/review bias, or any case where editing would begin before the map
84
- closes. Same-model fresh context is useful but is not model diversity. Manual
85
- sequential fresh conversations are the portable fallback.
86
-
87
- No file-count threshold participates in the route or the verdict.
88
-
89
- ## Fixed implementation map
90
-
91
- ```text
92
- IMPLEMENTATION MAP — unit-id phase-id
93
- Map revision: opaque single-consumption id
94
- Source identity: HEAD + clean-source proof + cited-evidence manifest digest
95
- Authority: SPEC receipt + Plan receipt + phase fingerprint
96
- Planning evidence: carried row ids + current confirmation/refinement/conflict
97
- Obligations: ordered acceptance/fix/obligation ids
98
- Entry points: path:line or symbol + role + exact evidence
99
- Affected surfaces: callers/adapters/roles/compatibility/failure paths + evidence
100
- Current behaviour: evidence-backed summary
101
- Reuse and constraints: helper/pattern/decision/invariant/fixture + evidence
102
- Expected writes: ordered path + obligation served + reason
103
- Validation: falsification probe + TDD target + phase gate
104
- Plan assumptions: confirmed items + evidence
105
- Contradictions: none or exact Plan/source conflict
106
- Unknowns: none or exact missing fact + owner + resolution evidence
107
- Decision: READY | REPLAN | NEEDS-DESIGN | BLOCKED
108
- ```
109
-
110
- ## Verdicts
111
-
112
- `READY` requires every field, question, and owned obligation covered, no
113
- material contradiction/unknown, an observed falsification probe, and expected
114
- writes inside phase authority. It also requires every carried planning-evidence
115
- row to be confirmed or narrowly refined.
116
-
117
- `REPLAN` means source disproves Engineering assumptions while Product remains
118
- stable, or Plan-level topology/architecture/obligation/validator evidence is
119
- absent.
120
-
121
- `NEEDS-DESIGN` means Product, acceptance, authority, or architecture intent is
122
- missing or conflicting.
123
-
124
- `BLOCKED` names evidence that cannot currently be obtained.
125
-
126
- No other verdict exists.
127
-
128
- ## Routes and upstream owners
129
-
130
- A verdict routes, it never repairs. Missing/contradicted Plan-level topology,
131
- architecture, obligations, validators, or assumptions return to
132
- `plan-feature`/`plan-fix` plus a fresh `review-plan`. Product/acceptance/
133
- authority/architecture gaps return to `design-feature` then `review-spec`. A
134
- verdict with unavailable evidence is one exact `BLOCKED` prerequisite. Mapping
135
- does not decide code correctness — candidate review, verification, and audit
136
- authority are unchanged, and a second repair/re-review cycle inherits feature
137
- 28's `CONVERGENCE-ANOMALY` diagnosis.
138
-
139
- Source-local findings stay local; Plan/Product defects return upstream. A
140
- missing current-unit behaviour entailed by reviewed scope joins the obligation
141
- map and routes upstream; it is never a follow-up issue and never calls the
142
- forge.
143
-
144
- ## Legacy and manual routes
145
-
146
- The portable fallback uses sequential fresh conversations with exact
147
- artifact/source bindings. It may not claim a machine receipt or a durable
148
- guarantee it cannot produce; it says plainly what was observed and what was
149
- not.
150
-
151
- ## Early falsification
152
-
153
- Before READY, run the cheapest relevant read-only probe: a focused existing
154
- test, current parser/CLI output, public type/schema inspection, symbol callers,
155
- or an existing fixture. Record the command/query, the observed result, and the
156
- evidence. A failed probe informs REPLAN/NEEDS-DESIGN; unavailable high-risk
157
- evidence is BLOCKED, never rewritten as confident evidence. This does not
158
- replace TDD or later verification.
159
-
160
- ## No-progress
161
-
162
- Conclusion once. Do not re-read or re-search to reconfirm the same conclusion
163
- without a new question, changed source, or insufficient cited evidence. On
164
- repetition, stop with `BLOCKED` and name what is still missing. Re-read is
165
- allowed only for a changed source revision, a new question, insufficient
166
- evidence, or a contradiction.
167
-
168
- ## Read-only boundary
169
-
170
- The mapper reads; it may not write. It creates no forge issue, no committed
171
- map, no planning unit, no schema, no source edit, and no test edit. It emits the
172
- map and reuses `SkillOutcome v1`. A missing current-unit behaviour entailed by
173
- reviewed scope joins the obligation map and routes upstream; it is not a
174
- follow-up issue. Discovery never calls the forge.
175
-
176
- ## Writer handoff
177
-
178
- The writer receives frozen phase authority plus the fixed compact map. It does
179
- not receive raw files, repeated summaries, raw planning discovery, raw
180
- exploration history, or the authoring conversation unless a cited claim cannot
181
- be interpreted without a focused excerpt. The map preserves the phase-relevant planning-evidence ids and
182
- their current confirmation. The writer may only touch expected paths /
183
- obligations; a newly discovered path or contradiction stops and remaps/routes
184
- rather than expanding silently.
185
-
186
- ## Source identity
187
-
188
- Source identity is exact pre-map HEAD, proof that tracked/untracked changes
189
- outside the allowed planning paths are absent, an ordered manifest digest of
190
- every cited evidence path/content plus the current phase/receipt bindings, and
191
- an opaque `mappingRevisionId` created for this mapping event.
192
-
193
- ## Preparation continuity
194
-
195
- After READY, deterministic setup may create the branch and commit only the
196
- already-reviewed planning paths. Before the first source/test edit the executor
197
- proves either HEAD is unchanged or the new commit is a direct descendant whose
198
- entire diff is the allowed planning set and whose authority/content digests
199
- match. Any other path, parent, receipt, phase, or evidence change invalidates
200
- the map and routes again.
201
-
202
- ## Consumption and recovery
203
-
204
- READY is single-consumption: the first implementation write consumes it. A crash
205
- before the write may resume only after freshness/no-consumption proof. A crash
206
- after any partial write remaps current source during recovery. A new map
207
- revision plus changed Git causal identity prevents reuse after revert; direct
208
- out-of-protocol state manipulation cannot be claimed detectable without runtime
209
- history.