@open-agent-toolkit/cli 0.2.73 → 0.2.75

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 (149) hide show
  1. package/assets/bundle-metadata.json +1 -1
  2. package/assets/docs/cli-utilities/configuration.md +3 -56
  3. package/assets/docs/cli-utilities/tool-packs.md +4 -4
  4. package/assets/docs/contributing/code.md +2 -2
  5. package/assets/docs/contributing/index.md +0 -1
  6. package/assets/docs/reference/cli-reference.md +1 -1
  7. package/assets/docs/reference/troubleshooting.md +17 -40
  8. package/assets/docs/workflows/projects/artifacts.md +16 -34
  9. package/assets/docs/workflows/projects/lifecycle.md +20 -19
  10. package/assets/docs/workflows/skills/explainer-kit.md +180 -440
  11. package/assets/docs/workflows/skills/index.md +1 -2
  12. package/assets/public-package-versions.json +4 -4
  13. package/assets/skills/explainer-kit/SKILL.md +96 -171
  14. package/assets/skills/explainer-kit/recipes/engineer-tour.json +1 -22
  15. package/assets/skills/explainer-kit/recipes/program-recap.json +1 -29
  16. package/assets/skills/explainer-kit/recipes/project-explainer.json +1 -22
  17. package/assets/skills/explainer-kit/recipes/project-recap.v2.json +1 -43
  18. package/assets/skills/explainer-kit/references/fact-base-contract.md +76 -101
  19. package/assets/skills/explainer-kit/references/recap-authoring.md +99 -0
  20. package/assets/skills/explainer-kit/schemas/manifest.schema.json +13 -135
  21. package/assets/skills/explainer-kit/scripts/bundle.mjs +712 -0
  22. package/assets/skills/explainer-kit/scripts/lib/claim-subject.mjs +40 -0
  23. package/assets/skills/explainer-kit/scripts/lib/contracts.mjs +113 -1504
  24. package/assets/skills/explainer-kit/scripts/lib/failure.mjs +13 -0
  25. package/assets/skills/explainer-kit/scripts/lib/package-coverage.mjs +57 -403
  26. package/assets/skills/explainer-kit/scripts/lib/qa-result.mjs +168 -0
  27. package/assets/skills/explainer-kit/scripts/lib/qa.mjs +90 -488
  28. package/assets/skills/explainer-kit/scripts/lib/recipes.mjs +28 -545
  29. package/assets/skills/explainer-kit/scripts/lib/run-package.mjs +120 -0
  30. package/assets/skills/explainer-kit/scripts/lib/sanitize.mjs +42 -0
  31. package/assets/skills/explainer-kit/scripts/record.mjs +335 -0
  32. package/assets/skills/explainer-kit/scripts/verify.mjs +648 -0
  33. package/assets/skills/oat-explainer-kit/SKILL.md +57 -117
  34. package/assets/skills/oat-explainer-kit/references/config-contract.md +20 -64
  35. package/assets/skills/oat-explainer-kit/references/lifecycle-contract.md +85 -237
  36. package/assets/skills/oat-explainer-kit/scripts/bind-project-sources.mjs +18 -10
  37. package/assets/skills/oat-explainer-kit/scripts/check-core.mjs +1 -0
  38. package/assets/skills/oat-explainer-kit/scripts/check-terminal-outcome.mjs +256 -21
  39. package/assets/skills/oat-explainer-kit/scripts/persist-intent.mjs +82 -3
  40. package/assets/skills/oat-explainer-kit/scripts/resolve-config.mjs +0 -162
  41. package/assets/skills/oat-explainer-kit/scripts/resolve-intent.mjs +57 -123
  42. package/assets/skills/oat-project-autonomous/SKILL.md +14 -13
  43. package/assets/skills/oat-project-autonomous/references/gate-inventory.md +165 -165
  44. package/assets/skills/oat-project-complete/SKILL.md +168 -349
  45. package/assets/skills/oat-project-complete/scripts/consume-persisted-recap-intent.mjs +125 -0
  46. package/assets/skills/oat-project-complete/scripts/execute-synced-archive-entry.mjs +0 -30
  47. package/assets/skills/oat-project-complete/scripts/parse-completion-retry-fields.mjs +4 -37
  48. package/assets/skills/oat-project-complete/scripts/parse-synced-archive-resume-fields.mjs +17 -16
  49. package/assets/skills/oat-project-complete/scripts/recover-completion-receipts.mjs +9 -174
  50. package/assets/skills/oat-project-complete/scripts/resolve-completion-retry.mjs +1 -2
  51. package/assets/skills/oat-project-document/SKILL.md +1 -1
  52. package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +165 -165
  53. package/assets/skills/oat-project-implement/SKILL.md +1 -1
  54. package/assets/skills/oat-project-implement/references/completion-and-closeout.md +44 -56
  55. package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +165 -165
  56. package/assets/skills/oat-project-lite/SKILL.md +1 -1
  57. package/assets/skills/oat-project-lite/references/docs/autonomy-contract.md +165 -165
  58. package/assets/skills/oat-project-plan/SKILL.md +5 -6
  59. package/assets/skills/oat-project-pr-final/SKILL.md +1 -1
  60. package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +165 -165
  61. package/assets/skills/oat-project-quick-start/SKILL.md +1 -1
  62. package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +165 -165
  63. package/assets/skills/oat-project-summary/SKILL.md +35 -25
  64. package/assets/skills/oat-wave-execute/SKILL.md +11 -36
  65. package/assets/skills/oat-wave-program/SKILL.md +13 -37
  66. package/dist/commands/config/index.d.ts.map +1 -1
  67. package/dist/commands/config/index.js +9 -113
  68. package/dist/commands/project/archive/archive-utils.d.ts.map +1 -1
  69. package/dist/commands/project/archive/archive-utils.js +32 -184
  70. package/dist/commands/project/archive/explainer-package-coverage.d.ts +3 -8
  71. package/dist/commands/project/archive/explainer-package-coverage.d.ts.map +1 -1
  72. package/dist/commands/project/archive/explainer-package-coverage.js +1 -1
  73. package/dist/config/oat-config.d.ts +0 -11
  74. package/dist/config/oat-config.d.ts.map +1 -1
  75. package/dist/config/oat-config.js +0 -34
  76. package/dist/config/resolve.d.ts.map +1 -1
  77. package/dist/config/resolve.js +0 -8
  78. package/dist/release/public-package-contract.d.ts.map +1 -1
  79. package/dist/release/public-package-contract.js +2 -10
  80. package/dist/validation/project-state.d.ts.map +1 -1
  81. package/dist/validation/project-state.js +42 -3
  82. package/package.json +2 -2
  83. package/assets/docs/contributing/explainer-kit-verification.md +0 -133
  84. package/assets/docs/workflows/skills/explainer-kit-providers.md +0 -155
  85. package/assets/skills/explainer-kit/briefs/deep-dive.md +0 -35
  86. package/assets/skills/explainer-kit/briefs/project-page.md +0 -38
  87. package/assets/skills/explainer-kit/briefs/supporting-diagram.md +0 -28
  88. package/assets/skills/explainer-kit/briefs/walkthrough-deck.md +0 -35
  89. package/assets/skills/explainer-kit/examples/project-explainer/content.md +0 -31
  90. package/assets/skills/explainer-kit/examples/project-explainer/fact-base.md +0 -22
  91. package/assets/skills/explainer-kit/examples/project-recap/content.md +0 -77
  92. package/assets/skills/explainer-kit/examples/project-recap/fact-base.json +0 -104
  93. package/assets/skills/explainer-kit/examples/project-recap/fact-base.md +0 -44
  94. package/assets/skills/explainer-kit/examples/theme-bundle.json +0 -87
  95. package/assets/skills/explainer-kit/recipes/project-recap.v1.json +0 -93
  96. package/assets/skills/explainer-kit/references/contracts.md +0 -324
  97. package/assets/skills/explainer-kit/references/destination-contract.md +0 -210
  98. package/assets/skills/explainer-kit/references/extension-contract.md +0 -80
  99. package/assets/skills/explainer-kit/references/golden-conformance.md +0 -80
  100. package/assets/skills/explainer-kit/references/visual-review.md +0 -71
  101. package/assets/skills/explainer-kit/schemas/author-request.v2.schema.json +0 -212
  102. package/assets/skills/explainer-kit/schemas/author-request.v3.schema.json +0 -241
  103. package/assets/skills/explainer-kit/schemas/author-result.v2.schema.json +0 -52
  104. package/assets/skills/explainer-kit/schemas/build-record.schema.json +0 -98
  105. package/assets/skills/explainer-kit/schemas/durability-evidence.schema.json +0 -53
  106. package/assets/skills/explainer-kit/schemas/publish-receipt.v1.schema.json +0 -97
  107. package/assets/skills/explainer-kit/schemas/publish-receipt.v2.schema.json +0 -215
  108. package/assets/skills/explainer-kit/schemas/publish-request.v1.schema.json +0 -32
  109. package/assets/skills/explainer-kit/schemas/publish-request.v2.schema.json +0 -34
  110. package/assets/skills/explainer-kit/schemas/run-request.schema.json +0 -147
  111. package/assets/skills/explainer-kit/schemas/set-plan.v1.schema.json +0 -149
  112. package/assets/skills/explainer-kit/schemas/terminal-evidence.v1.schema.json +0 -81
  113. package/assets/skills/explainer-kit/schemas/visual-review-evidence.v1.schema.json +0 -66
  114. package/assets/skills/explainer-kit/schemas/visual-review-request.v1.schema.json +0 -117
  115. package/assets/skills/explainer-kit/schemas/visual-review-result.v1.schema.json +0 -80
  116. package/assets/skills/explainer-kit/scripts/lib/catalog.mjs +0 -349
  117. package/assets/skills/explainer-kit/scripts/lib/content-approval.mjs +0 -418
  118. package/assets/skills/explainer-kit/scripts/lib/diagram.mjs +0 -514
  119. package/assets/skills/explainer-kit/scripts/lib/durability.mjs +0 -643
  120. package/assets/skills/explainer-kit/scripts/lib/fact-base.mjs +0 -664
  121. package/assets/skills/explainer-kit/scripts/lib/internal-references.mjs +0 -538
  122. package/assets/skills/explainer-kit/scripts/lib/markdown.mjs +0 -414
  123. package/assets/skills/explainer-kit/scripts/lib/publication-policy.mjs +0 -54
  124. package/assets/skills/explainer-kit/scripts/lib/records.mjs +0 -954
  125. package/assets/skills/explainer-kit/scripts/lib/render.mjs +0 -703
  126. package/assets/skills/explainer-kit/scripts/lib/s3-roots.mjs +0 -353
  127. package/assets/skills/explainer-kit/scripts/lib/s3-static.mjs +0 -759
  128. package/assets/skills/explainer-kit/scripts/lib/set-plan.mjs +0 -209
  129. package/assets/skills/explainer-kit/scripts/lib/source-backlinks.mjs +0 -218
  130. package/assets/skills/explainer-kit/scripts/lib/terminal-evidence.mjs +0 -157
  131. package/assets/skills/explainer-kit/scripts/lib/visual-review.mjs +0 -400
  132. package/assets/skills/explainer-kit/scripts/publish.mjs +0 -76
  133. package/assets/skills/explainer-kit/scripts/record-durability.mjs +0 -64
  134. package/assets/skills/explainer-kit/scripts/render-qa.mjs +0 -461
  135. package/assets/skills/explainer-kit/scripts/run.mjs +0 -3038
  136. package/assets/skills/explainer-kit/scripts/validate.mjs +0 -59
  137. package/assets/skills/oat-explainer-kit/references/author-callback.md +0 -53
  138. package/assets/skills/oat-explainer-kit/references/migration.md +0 -144
  139. package/assets/skills/oat-explainer-kit/references/visual-review-callback.md +0 -83
  140. package/assets/skills/oat-explainer-kit/scripts/derive-destination.mjs +0 -91
  141. package/assets/skills/oat-explainer-kit/scripts/finalize-tracked-run.mjs +0 -531
  142. package/assets/skills/oat-explainer-kit/scripts/probe-recap-seams.mjs +0 -371
  143. package/assets/skills/oat-explainer-kit/scripts/run.mjs +0 -905
  144. package/dist/commands/project/archive/explainer-source-backlinks.d.ts +0 -18
  145. package/dist/commands/project/archive/explainer-source-backlinks.d.ts.map +0 -1
  146. package/dist/commands/project/archive/explainer-source-backlinks.js +0 -27
  147. package/dist/commands/project/archive/explainer-terminal-evidence.d.ts +0 -29
  148. package/dist/commands/project/archive/explainer-terminal-evidence.d.ts.map +0 -1
  149. package/dist/commands/project/archive/explainer-terminal-evidence.js +0 -37
@@ -1,454 +1,194 @@
1
1
  ---
2
2
  title: Explainer Kit
3
- description: 'Build destination-neutral visual explainers directly or from OAT project lifecycle artifacts.'
3
+ description: 'Generate one source-grounded visual explainer directly or from OAT lifecycle artifacts.'
4
4
  ---
5
5
 
6
6
  # Explainer Kit
7
7
 
8
- The public explainer family separates a destination-neutral core from an
9
- OAT-aware adapter:
10
-
11
- - `explainer-kit` validates explicit versioned inputs, reconciles one cited fact
12
- base, applies a recipe and theme, renders and checks the artifact set, and
13
- records a manifest and build outcome.
14
- - `oat-explainer-kit` resolves OAT configuration, project intent, source
15
- artifacts, and canonical output paths before invoking the same core.
16
-
17
- The core does not read OAT, user, vault, or destination configuration. Direct
18
- callers provide a complete `ExplainerRunRequestV1` and an explicit output root.
19
- OAT lifecycle callers use the adapter.
20
-
21
- ## Recipes
22
-
23
- The core ships four recipe families on the `explainer-kit.recipe/v2` file
24
- schema. Most recipe selectors remain at version `"1"`. New project recaps use
25
- immutable `project-recap@2`, while `project-recap@1` remains readable for replay.
26
-
27
- A v2 recipe declares a **floor** — the artifacts every run must produce — plus
28
- a licensed **expansion** set. Most recipes retain one floor artifact.
29
- `project-recap@2` requires one complete navigational hub and plans any additional
30
- artifact before an author runs.
31
-
32
- | Recipe | Use | Required floor |
33
- | ------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
34
- | `project-explainer` | Working explanation after project planning | one Markdown `hub` covering architecture, decisions, risks, phases, and validation |
35
- | `project-recap` | Final record after implementation and final review | one HTML navigational hub; diagrams, decks, and deep dives are adaptive expansions |
36
- | `program-recap` | Bird's-eye record of a multi-wave delivery program | one Markdown `hub` covering the wave map, outcomes, convention evolution, aggregate numbers, and follow-up ledger |
37
- | `engineer-tour` | Engineer-facing orientation to a codebase and its flow | one HTML-composed `explainer` covering orientation, architecture, execution flow, key code, and validation |
38
-
39
- The OAT project lifecycle owns `project-explainer` and `project-recap`. Both
40
- bind one project source set. The adapter binds `plan.md`, `design.md`, and
41
- `spec.md` for a project explainer; a project recap can also include
42
- `implementation.md` and `summary.md`. Wave callers supply the program source
43
- set for `program-recap`; direct core callers can use `engineer-tour` without
44
- adding an OAT dependency.
45
-
46
- ### Project recap modes
47
-
48
- Project recaps default to `recapMode: artistic`. This mode uses the shared set
49
- plan and provider-neutral author seam to compose the required HTML hub plus any
50
- source-backed expansion that answers a distinct reader question.
51
-
52
- `recapMode: deterministic-markdown` is an explicit fallback for callers that
53
- need deterministic output. It preserves the same planned artifact portfolio and
54
- cardinality rather than collapsing the recap to one file. The runtime never
55
- switches modes after an artistic author failure: changing modes requires a new
56
- request, and a failed artistic run remains failed.
57
-
58
- ### Expansion profiles
59
-
60
- Each recipe declares the expansion it licenses as a list of profiles. A profile
61
- fixes everything the pipeline needs to build a follow-up author request —
62
- artifact `type`, authoring path, brief, optional shell, and a mandatory
63
- `maxCount`. Every recipe also carries a mandatory `expansion.limits.maxArtifacts`
64
- that caps the whole expansion set; floor artifacts do not count against it.
65
-
66
- | Recipe | Profiles (max per profile) | `maxArtifacts` |
67
- | ------------------- | ----------------------------------------------------------- | -------------- |
68
- | `project-recap@2` | `supporting-diagram` 1, `walkthrough-deck` 1, `deep-dive` 3 | 5 |
69
- | `program-recap` | `supporting-diagram` 3, `project-page` 12 | 12 |
70
- | `project-explainer` | `supporting-diagram` 4 | 4 |
71
- | `engineer-tour` | `supporting-diagram` 4 | 4 |
72
-
73
- For project recaps, every optional diagram, deck, or deep dive needs a distinct
74
- reader question, supporting source evidence, and rationale for choosing that
75
- medium. Other recipes retain their recipe-owned diagram and project-page
76
- profiles. Every declared type stays inside the frozen `manifest/v1` enum.
77
-
78
- ## Content authoring and review
79
-
80
- ### Two authoring paths
81
-
82
- Each artifact is authored on exactly one of two paths, and the **recipe**
83
- chooses which — the author never does:
84
-
85
- - **Narrative path** (`authoring: markdown`). The author writes Markdown. The
86
- core parses it to a validated AST and renders it deterministically through a
87
- themed block library: headings with anchors, GFM tables, lists including task
88
- lists, strikethrough, GFM alert callouts (`> [!NOTE]`, `> [!TIP]`,
89
- `> [!IMPORTANT]`, `> [!WARNING]`, `> [!CAUTION]`), fenced ` ```timeline `
90
- blocks, code blocks, and figures. Fenced ` ```diagram ` blocks are rendered to
91
- inline SVG at build time with no client-side script. Raw HTML passthrough and
92
- links that violate the publish contract are hard errors; style findings are
93
- warnings.
94
- - **Artistic path** (`authoring: html`). The author composes a complete HTML
95
- document, starting from a curated shell delivered inside the request. The core
96
- validates the result at the DOM level rather than re-rendering it. Non-script
97
- markup is free within the allowlist, so decks, standalone diagrams, and tours
98
- keep full visual latitude.
99
-
100
- Script safety on the artistic path is enforced by hash pinning rather than a
101
- blanket ban, because the bundled shells legitimately contain scripts. The
102
- validator derives an ordered multiset of script hashes from the declared core
103
- shell and requires the authored document's scripts to match it exactly — same
104
- hashes, same count, same order, compared over exact bytes. Missing, added,
105
- duplicated, reordered, replaced, or mutated scripts all hard-fail, as do inline
106
- event-handler attributes and external active content.
107
-
108
- ### Briefs carry the editorial bar
109
-
110
- Quality expectations live in versioned prose briefs shipped with the core under
111
- `briefs/`, not in the content schema. There is one brief per floor entry and one
112
- per expansion profile. A brief states audience, voice, per-section intent, the
113
- artifact's depth floors (for example "at least one high-level architecture
114
- diagram"), and the expansion license. The core inlines the brief into every
115
- author request, so an unattended author receives everything it needs in one
116
- payload. Changing a brief changes output expectations with no contract
117
- migration.
118
-
119
- The bundled authoring prose covers typographic roles, hierarchy, composition,
120
- density, medium leverage, template repetition, diagram semantics, and
121
- cross-artifact cohesion. These remain editorial judgments rather than numeric
122
- scores or deterministic layout checks.
123
-
124
- ### The planning and author seams
125
-
126
- Before authoring, one provider-neutral `planSet` callback produces the complete
127
- shared terminology, status, and number ledger plus the adaptive artifact
128
- portfolio. Every run also requires one provider-neutral author callback, in
129
- **both** modes — there is no synthetic content model to fall back on. A run
130
- without one fails with `E_AUTHOR_REQUIRED`.
131
-
132
- The core invokes the author once per planned artifact with an
133
- `explainer-kit.author-request/v3` payload carrying the artifact identity and
134
- type, its authoring path, the inlined brief, the reconciled fact base, the
135
- resolved theme, the shell source for artistic artifacts, the immutable set
136
- context, the matching planned artifact, canonical artifact links, and bundled
137
- medium-specific authoring guidance. Version 2 requests remain readable for
138
- replay. The installed skill is the complete unattended baseline; optional
139
- provider capabilities can enhance composition but are not required. The core
140
- accepts only a schema-valid `explainer-kit.author-result/v2` containing exactly
141
- one of `content.markdown` or `content.html` plus non-secret provenance.
142
- Authored content is still checked for excessive verbatim overlap with the fact
143
- base.
144
-
145
- Direct callbacks and module entry points are first-class but transient: they
146
- never enter retained request contracts. See
147
- [Explainer Provider Integration](explainer-kit-providers.md) for the exact
148
- planner, author, browser-session, and visual-critic boundaries.
149
-
150
- ### Planner-owned adaptive sets
151
-
152
- The set planner finalizes required and optional artifacts before authoring.
153
- New project recaps always contain a navigational hub. The planner may add only
154
- recipe-licensed optional diagrams, decks, or deep dives with a distinct reader
155
- question, source evidence, and medium rationale. Recipe and per-profile limits
156
- still bound the portfolio.
157
- Undeclared sources, conflicting ledger values, duplicate IDs, and unjustified
158
- optionals fail validation. Author results cannot add, remove, or replace
159
- artifacts.
160
-
161
- When the plan contains a non-linear graph, artistic output must preserve its
162
- closed semantics exactly: direction, every node and label, every edge and
163
- label, branching, fan-in, and cycles. Missing, extra, duplicated, rewired, or
164
- semantically drifting observations fail topology validation before browser or
165
- critic review.
166
-
167
- ### Approval and marking
168
-
169
- The interactive approval gate sits **after** theme, render, safety validation,
170
- the guideline checker, and render QA — immediately before publish and
171
- durability. Rendering is local and non-destructive, and nothing leaves the
172
- machine before approval, so the reviewer now approves the rendered artifacts and
173
- the complete warning set instead of raw prose.
174
-
175
- An interactive run therefore stops with an `incomplete` outcome once the
176
- artifacts are built and checked. Review the rendered `site/` tree, the sources
177
- under `source/content/`, and the accumulated warnings, then supply an explicit
178
- JSON decision and rerun the same request. A rejection persists its correction
179
- list; after the sources are edited, approving resumes the same run, which
180
- re-renders and re-runs QA against the edited sources before approval is
181
- processed rather than publishing the stale render.
182
-
183
- Unattended runs — including recaps triggered by automated project completion —
184
- flow through end-to-end and auto-approve content. The approval record
185
- distinguishes the two honestly: `explainer-kit.content-approval/v2` carries
186
- `marking: human-approved` for interactive approval and `auto-drafted` for an
187
- unattended run.
188
-
189
- Unattended project recaps also require a separate whole-set visual review.
190
- The adapter supplies a branded session created by the compatible core, which
191
- derives Chromium name and version from the launched browser rather than trusting
192
- caller metadata. The browser captures each rendered artifact at exact 320, 768,
193
- and 1440 viewports. The core validates decoded PNG dimensions and pixels, binds
194
- screenshots and metrics to one capture identity, and sends only that confined
195
- evidence to an independent critic. Fixture sessions are test-only and are
196
- rejected in unattended production.
197
-
198
- A `correct` disposition permits one bounded correction and exactly one final
199
- review; there is no second correction or third review. The correction budget is
200
- shared with the internal-link gate described below, so a `correct` disposition
201
- is refused outright with `E_VISUAL_CORRECTION` when link validation already
202
- spent the single bounded correction on this run. Missing, forged,
203
- cross-record-mismatched, or invalid evidence, a failed critic, or an unresolved
204
- correction ends as `built-needs-review`. Such output is retained for diagnosis
205
- but cannot become durable, finalized, archived, or published.
206
-
207
- The critic reviews the whole set for typography, hierarchy, composition,
208
- density, medium leverage, template repetition, diagram semantics, and
209
- cross-artifact cohesion. It returns the existing provider-neutral result:
210
- `pass` when no required correction remains or `correct` with concrete,
211
- artifact-scoped actions for the bounded correction round. No numeric design
212
- threshold is part of the contract.
213
-
214
- The approval record is also the durable source of truth for the resolved
215
- artifact set. It records every floor and accepted expansion artifact for all
216
- approval states, including pending and rejected, so a paused expanded run
217
- rehydrates with stable artifact IDs, paths, hub links, and hashes without
218
- re-invoking the author.
219
-
220
- Content approval never authorizes publishing.
221
-
222
- ### Interactive resume security
223
-
224
- An incomplete interactive run returns an opaque `approval.resumeToken`. Keep it
225
- outside the package, then echo it as `reviewedSource.resumeToken` when resuming
226
- the same request. Only fixed-format authenticated `ekrt2` tokens are accepted.
227
- They bind the run ID, original canonical output root, exact retained
228
- `run-request.json` bytes, and all retained set-plan records.
229
-
230
- Before hydrating authored content or invoking planner, author, durability, or
231
- publish callbacks, resume also compares the complete canonical current request
232
- with the authenticated retained request. Changes to source binding, recipe,
233
- mode, theme, render strategy, privacy, public URL, durability, or publish
234
- destination fail with `E_APPROVAL_RESUME`. Intentionally non-retained art
235
- direction is omitted from the persisted request projection; executable provider
236
- seams are separately transient and never part of request equality.
237
-
238
- Every legacy `ekrt1` token is rejected. A paused run created with the legacy
239
- format must restart to receive an authenticated token; editing retained package
240
- state cannot opt it into compatibility.
241
-
242
- ### Internal-link validation
243
-
244
- Every internal reference in the rendered set must resolve to a
245
- manifest-declared target before the run can reach browser review. The gate runs
246
- after render and uses a bounded tokenizer rather than a general HTML parser.
247
- Relative references resolve from the current explicit file and must bind
248
- exactly to the manifest/site tree, and a referenced fragment must resolve to
249
- exactly one ID in its target document. Directory references, path traversal,
250
- missing targets, missing fragments, ambiguous fragments, and unsafe schemes all
251
- fail with `E_INTERNAL_REFERENCE`.
252
-
253
- A failure gets one bounded correction round, re-rendered and revalidated. That
254
- round is the same single budget the visual-review `correct` disposition uses —
255
- whichever gate reaches it first consumes it. Once it is exhausted the run fails
256
- hard: the QA stage is recorded `failed` with code-only evidence and the scrubbed
257
- message `The qa stage failed.`, and the run is neither durability- nor
258
- publication-eligible. No finding is retained, so nothing in the durable record
259
- names the broken reference; the failure is attributed to the `link-validation`
260
- evidence stage.
261
-
262
- ## Warnings and QA severity
263
-
264
- QA findings are split by severity, and the split is what lets thin content ship
265
- visibly instead of failing a run. Safety and provenance violations — unsafe DOM
266
- or AST content, external assets, link-form violations, unresolved tokens,
267
- denylisted strings, tag imbalance, cohesion breaks, and source dumping — still
268
- throw `E_QA` and fail the run. Editorial and layout findings append stable
269
- warning identifiers to the manifest's `warnings[]` array and let the run
270
- succeed in both modes.
271
-
272
- | Warning ID | Meaning |
273
- | ---------------------------------------- | --------------------------------------------------------------- |
274
- | `guideline-narrative-coverage-missing` | A required narrative section is not covered by the artifact |
275
- | `guideline-architecture-diagram-missing` | No architecture diagram, inline or standalone, was produced |
276
- | `guideline-structured-depth-missing` | The artifact lacks the structured blocks its floor expects |
277
- | `expansion-profile-limit-exceeded` | A proposal was rejected against its profile's `maxCount` |
278
- | `expansion-artifact-limit-exceeded` | A proposal was rejected against `expansion.limits.maxArtifacts` |
279
- | `render-qa-document-overflow` | The document overflows the viewport at a probed width |
280
- | `render-qa-inner-container-overflow` | An inner container overflows horizontally |
281
- | `render-qa-viewport-clipping` | Content is clipped and unreachable |
282
- | `render-qa-heading-unreadable` | A heading fails the readability probe |
283
- | `render-qa-animations-enabled` | Animation remained active where it should be suppressed |
284
- | `render-qa-reduced-motion` | The reduced-motion preference was not honored |
285
- | `render-qa-keyboard-navigation` | Keyboard navigation did not reach expected targets |
286
- | `render-qa-theme-toggle` | The theme toggle did not behave as expected |
287
- | `render-qa-deck-no-js-layout` | A deck degrades incorrectly without JavaScript |
288
- | `render-qa-deck-print-layout` | A deck degrades incorrectly in print layout |
289
- | `render-qa-skipped-no-probe` | Render QA was skipped because no browser probe was supplied |
290
-
291
- When a caller supplies a browser provider, the stage serves the built site
292
- directory, loads each artifact with animations disabled, and runs the
293
- layout-probe battery. Viewport clipping deliberately exempts content inside a
294
- horizontally scrollable ancestor, so intentionally paged deck slides are not
295
- reported as clipped while genuinely unreachable content still is. The core
296
- never launches a browser implicitly; the caller creates and closes an explicit
297
- session, and the OAT adapter validates it before core invocation. For ordinary
298
- non-retaining runs, omitting a legacy probe records
299
- `render-qa-skipped-no-probe` and continues. Unattended project recaps require
300
- the branded browser session and visual critic described in
301
- [Explainer Provider Integration](explainer-kit-providers.md); missing evidence
302
- fails closed as `built-needs-review`.
303
-
304
- ## Curated styles and themes
305
-
306
- Every artifact set uses one resolved theme. The primary selection surface is
307
- one of four complete curated styles:
308
-
309
- - `clean-neutral` — restrained neutral default
310
- - `business-corporate` — structured corporate presentation
311
- - `navy-ocean` — navy-led technical and operational presentation
312
- - `dark-edgy` — solid dark canvas with high-contrast editorial accents
313
-
314
- A caller may select a style, supply a validated theme bundle, or provide
315
- per-run art direction. A supplied bundle takes precedence over a style. Legacy
316
- `palette` and `visualProfile` inputs remain nullable compatibility fields, but
317
- an explicit style wins and legacy use emits a deprecation warning. When no
318
- selection is explicit, the core uses `clean-neutral` and records the fallback.
319
-
320
- The resolved concrete bundle is retained with the run; raw art-direction text
321
- is not retained by default. Every bundle contains validated light and dark
322
- modes. The render strategy chooses either the default mode or a user-switchable
323
- result without changing the bundle identity.
324
-
325
- ## Build, durability, and publish
326
-
327
- Missing publish configuration means build-only. A completed build writes the
328
- privacy-safe request, content approval, fact base, author results, authored
329
- content, resolved theme, `manifest.json`, `build-record.json`, and the rendered
330
- `site/` tree. Rendering or publishing failures preserve successful
331
- intermediates and recovery information.
332
-
333
- Reviewed source and citation backlinks are absolute canonical GitHub blob URLs
334
- pinned to the exact 40-character commit revision and line range, so they
335
- survive project archival without resolving through a mutable branch or local
336
- checkout. Each recap also emits
337
- `site/initiatives/<slug>/catalog.json` from the finalized manifest, versioned
338
- as `explainer-kit.initiative-catalog/v2`. Its artifact IDs, types, paths,
339
- URLs, and source backlinks must remain in exact manifest parity; authors do
340
- not hand-maintain the catalog. The catalog's `publicVerification` field is a
341
- **policy marker, never an outcome**: `required` when the run's public access
342
- policy calls for anonymous URL verification, `skipped-by-policy` for
343
- protected destinations. It records what the publication policy was — the
344
- per-artifact verification outcomes live in `publish-receipt.json`.
345
- Compatibility is regenerate-only: consumers parse the declared version, and
346
- no v1 read path exists because no released consumer could verify v1 catalog
347
- evidence.
348
-
349
- `manifest.immutableHashes` covers the exact retained bytes for
350
- `run-request.json`, content approval, fact-base JSON and Markdown, declared
351
- author results, authored content, the resolved theme, and every built
352
- artifact. Canonical fact-base and theme hashes identify normalized objects;
353
- they are intentionally distinct from serialized file-byte hashes. The mutable
354
- manifest and build record are excluded from their own durability evidence and
355
- are committed separately after verification. Older v1 manifests without
356
- complete coverage fail with a legacy-manifest diagnostic and must be
357
- regenerated.
358
-
359
- Build success and durability are separate:
360
-
361
- - `built-not-durable` means artifacts exist but verified commit or publish
362
- evidence is absent.
363
- - `built-needs-review` means the required unattended visual-review chain did
364
- not finish with a pass; durability and publishing remain blocked.
365
- - `built-durable` requires verified evidence for every required
366
- non-rebuildable artifact.
367
- - `failed` records a failed run without treating partial output as success.
368
-
369
- The core verifies caller-supplied commit or publish evidence; it never creates
370
- Git commits. Publishing is always explicitly requested and human-gated. The
371
- public `s3-static` connector validates each S3 and HTTPS root independently and
372
- proves the destination with a run-unique sentinel, uploads only
373
- manifest-declared `site/` files, and writes `publish-receipt.json`.
374
- Verification depends on the declared `publicAccess` policy: in `public` mode
375
- the connector anonymously fetches each published URL and compares content
376
- type and SHA-256 response bytes; in `protected` mode it verifies object
377
- integrity through authenticated S3 hashing instead, and every receipt entry
378
- records `publicVerification: skipped-protected` so the skipped anonymous
379
- check is visible rather than implied.
380
-
381
- Root screening is strict on both roots: no credentials, queries, or
382
- fragments; no whitespace, C0/C1 control characters, or backslashes; and the
383
- gate applies to every publish-request and publish-receipt contract version
384
- rather than being pinned to one version string. Public roots must be HTTPS
385
- and must not address loopback, link-local, or private networks, and
386
- verification fetches refuse redirects (`redirect: 'error'`) — see the
387
- [publication environment variables](/docs/cli-utilities/configuration#explainer-publication-environment-variables)
388
- for the explicit private-root opt-in and its durable receipt trace.
389
- Publishing is additive and does not run a root-wide destructive sync.
390
-
391
- Release validation drives the bounded curated-style/template matrix in a real
392
- installed Chromium browser and retains machine-readable viewport, clipping,
393
- motion, keyboard, no-JavaScript, and print measurements. The gate fails closed
394
- when no supported browser executable is available.
395
-
396
- Frozen RC runs require both the identity record and the explicit retained
397
- tarball directory:
8
+ Explainer Kit turns approved source material into one standalone visual
9
+ explainer. The host agent writes the page; the kit prepares evidence and checks
10
+ that the result stays faithful to it.
11
+
12
+ The public explainer family has two layers:
13
+
14
+ - `explainer-kit` is the destination-neutral core. It reads only explicit
15
+ inputs and never reads OAT, user, vault, or destination configuration.
16
+ - `oat-explainer-kit` adapts OAT projects and programs to the core. It resolves
17
+ lifecycle intent, approved artifacts, theme defaults, and canonical output
18
+ roots.
19
+
20
+ ## The generation flow
21
+
22
+ Every run follows the same five stages:
23
+
24
+ 1. **Bundle** — collect allowlisted inputs into a cited fact base and bounded
25
+ anchor ledger, and resolve the recipe and theme.
26
+ 2. **Author** — the host agent reads the recipe brief, fact base, ledger,
27
+ theme, and recipe shell, then writes exactly one standalone
28
+ `site/index.html`.
29
+ 3. **Verify** — run browser-free safety and traceability checks plus the
30
+ highest available browser rung.
31
+ 4. **Record** — write the terminal manifest and freeze the package.
32
+ 5. **Consume** — return the run path, run ID, and outcome to the caller.
33
+
34
+ If bundling reports `reuse: true`, the caller returns that already-satisfied
35
+ package without authoring or recording it again. Nothing may write into a run
36
+ root after recording.
37
+
38
+ ## Recipes and required narratives
39
+
40
+ The core ships four recipes. Each produces one HTML page from one recipe shell.
41
+
42
+ | Recipe | Intended use | Required narrative |
43
+ | ------------------- | ------------------------------------------ | ---------------------------------------------------------------- |
44
+ | `project-explainer` | Working explanation after project planning | architecture, decisions, risks, phases, and validation |
45
+ | `project-recap` | Final implementation recap | outcome, architecture, decisions, validation, changes, follow-up |
46
+ | `program-recap` | Bird's-eye view of a multi-wave program | wave map, outcomes, conventions, metrics, and follow-up |
47
+ | `engineer-tour` | Engineer-facing orientation to a codebase | orientation, architecture, flow, key code, and validation |
48
+
49
+ Recipe briefs carry the audience, voice, section intent, and depth
50
+ expectations. The author preserves every recipe-required section ID, uses only
51
+ the supplied source material, and keeps CSS and approved scripts inline.
52
+ External requests are not allowed.
53
+
54
+ ## Direct core usage
55
+
56
+ Choose one recipe and exactly one input mode:
398
57
 
399
58
  ```bash
400
- node tools/release/run-explainer-rc.mjs \
401
- --rc-manifest .oat/repo/reference/explainer-kit-acceptance/v1/rc.json \
402
- --artifacts-dir dist/explainer-kit-rc \
403
- --entry scripts/run.mjs \
404
- --record /path/to/sanitized-execution.json \
405
- -- --request /path/to/request.json
59
+ node scripts/bundle.mjs \
60
+ --recipe project-recap \
61
+ --project /path/to/project \
62
+ --theme /path/to/theme.resolved.json \
63
+ --out /path/to/run-root
406
64
  ```
407
65
 
408
- The packaged CLI emits one complete JSON result document; pretty-printed
409
- multiline JSON is valid, while progress text and line-by-line guessing are not.
410
- The resulting execution record binds the canonical request and child-reported
411
- manifest to the core run ID without retaining private argument values.
412
- Wrapper-created receipt evidence is produced only after core execution and is
413
- validated separately against the immutable execution record and manifest.
66
+ Supported input modes are:
67
+
68
+ - `--project <dir>` for a project recap or project explainer;
69
+ - `--program <artifact> --summaries <dir> --archive <dir>` for a program
70
+ recap;
71
+ - `--inputs <file|dir>...` for ordinary documents; or
72
+ - `--fact-base <path>` for an already-supplied fact base.
73
+
74
+ Bundling fails before authoring if an input escapes its declared root or if
75
+ different inputs resolve to the same document locator.
76
+
77
+ After the host agent authors `site/index.html`, verify and record it:
78
+
79
+ ```bash
80
+ node scripts/verify.mjs \
81
+ --run-root /path/to/run-root \
82
+ --recipe project-recap
83
+
84
+ node scripts/record.mjs \
85
+ --run-root /path/to/run-root \
86
+ --recipe project-recap \
87
+ --slug project-recap \
88
+ --mode interactive \
89
+ --theme /path/to/run-root/theme.resolved.json
90
+ ```
91
+
92
+ Direct front-door runs record as `interactive`; OAT lifecycle callers use
93
+ `unattended`.
94
+
95
+ Always pass `--recipe`, `--theme`, and `--out` to the bundle stage. Direct
96
+ callers choose their output root; OAT callers use the adapter's canonical
97
+ project or repository path.
98
+
99
+ ## OAT lifecycle callers
100
+
101
+ The adapter binds lifecycle artifacts to recipe source roles and runs the same
102
+ flow in unattended mode:
414
103
 
415
- ## OAT lifecycle policy
104
+ - Planning can generate `project-explainer` after plan review, the configured
105
+ plan gate, and the plan commit.
106
+ - Implementation closeout can generate `project-recap` after final review and
107
+ configured pre-approval steps but before final approval.
108
+ - Project completion can reuse or generate the final recap before lifecycle
109
+ mutation and pass a selected satisfied package to archive.
110
+ - Wave program and execution closeout can generate `program-recap` from the
111
+ reconciled program artifact and selected wave summaries.
416
112
 
417
- Interactive project explainer and recap preferences resolve independently from
113
+ Lifecycle generation never prompts. A persisted skip ends the flow before
114
+ manifest discovery, bundling, or authoring. A persisted generate decision
115
+ reuses a fresh satisfied package when one exists.
116
+
117
+ If a run is `failed` or `incomplete`, interactive completion requires an
118
+ explicit retry or skip. Autonomous closeout retries once; if the retry is also
119
+ unsatisfied, it persists `skip/failed_attempt`, re-reads that decision, and
120
+ continues without another generation pass.
121
+
122
+ Project explainer and project recap preferences resolve independently from
418
123
  `workflow.explainers.projectExplainer` and
419
124
  `workflow.explainers.projectRecap`. Each accepts `always`, `ask`, or `never`;
420
- the built-in default is `ask`. A resolved project decision in `state.md`
421
- outranks those preferences.
422
-
423
- Autonomous mode has stricter policy: it always runs the project-recap gate,
424
- while a project explainer runs only when the kickoff request explicitly asks
425
- for one. The gate probes the five seams an unattended recap needs — author,
426
- fact critic, browser session, visual critic, and set planner — before
427
- generating. It attempts the recap only when all five resolve; when a seam has
428
- no provider configured at all, it records a `skip` with source
429
- `capability_probe` and a warning instead. A seam that is configured but invalid
430
- is a configuration error and still fails closed. Lifecycle-triggered runs do
431
- not publish automatically, and neither recap failure nor an unavailable seam
432
- blocks project completion.
433
-
434
- See [Project Artifacts](../projects/artifacts.md) for active and durable output
435
- locations, and [Configuration](../../cli-utilities/configuration.md) for the
436
- typed adapter settings.
437
-
438
- ## Private wrappers
439
-
440
- Private integrations use the core boundary directly: resolve private inputs
441
- before the run, construct one versioned request, invoke the core once, then
442
- publish or link the versioned manifest after the run. Wrapper acceptance reads
443
- the complete post-run `publish-receipt/v2`, requires complete manifest and
444
- catalog evidence, verifies the core run ID, and rejects foreign or stale
445
- receipts; `publish-receipt/v1` remains readable for replay of older runs only.
446
- Public and protected v2 receipts must each provide exactly one entry for every
447
- finalized manifest artifact and exactly one generated catalog entry. The
448
- `explainer-kit` wrapper extension contract owns this rule; this page restates
449
- it for integrators. Presets, private source systems, external-document
450
- synchronization, and personal destinations remain wrapper-owned.
451
-
452
- V1 exposes no plugin registry or private mid-pipeline hook. Unsupported
453
- contract majors and identity mismatches fail closed instead of being guessed
454
- or coerced.
125
+ the built-in default is `ask`. A valid project decision already persisted in
126
+ `state.md` has higher precedence.
127
+
128
+ ## Verification ladder
129
+
130
+ Verification always runs browser-free checks for:
131
+
132
+ - standalone HTML structure and external assets;
133
+ - excessive source copying;
134
+ - recipe-required narrative sections;
135
+ - shell-script integrity;
136
+ - ledger-to-page claim coverage; and
137
+ - page-to-ledger claim traceability.
138
+
139
+ The browser ladder uses the first available rung:
140
+
141
+ 1. host browser capture and inspection at 320, 768, and 1440 pixels;
142
+ 2. the bundled Playwright probe; or
143
+ 3. the browser-free `none` rung.
144
+
145
+ Browser evidence is bound to the exact artifact hash. A missing browser does
146
+ not discard otherwise usable output; it records a review-needed outcome.
147
+
148
+ ## Run package
149
+
150
+ Before recording, the run root contains:
151
+
152
+ - `source/fact-base.json` and `source/fact-base.md`;
153
+ - `source/ledger.json`;
154
+ - `theme.resolved.json`;
155
+ - the authored `site/index.html`; and
156
+ - verification output under `qa/`, including `qa/result.json`, which records
157
+ the browser rung and visual-check results.
158
+
159
+ Recording adds `manifest.json` with schema
160
+ `explainer-kit.manifest/v2`. The manifest is an exact inventory of the
161
+ completed package and carries the run ID, recipe, source hashes, warnings, and
162
+ outcome.
163
+
164
+ The project archive command may copy one selected satisfied project recap into
165
+ the tracked reference export. That archive export is the durable completion
166
+ copy; generation itself does not publish or create a separate durability
167
+ record.
168
+
169
+ ## Outcomes
170
+
171
+ | Outcome | Meaning |
172
+ | -------------------- | ------------------------------------------------------------------------ |
173
+ | `built` | Browser and visual checks passed |
174
+ | `built-needs-review` | The page is usable, but the browser rung was unavailable or found issues |
175
+ | `failed` | Generation or verification failed |
176
+ | `incomplete` | The package did not reach a terminal satisfied build |
177
+
178
+ `built` and `built-needs-review` satisfy generate intent.
179
+ `built-needs-review` is also a valid archive candidate when the complete
180
+ package guard and freshness checks pass; it remains visible in summaries as
181
+ needing a human look. `failed` and `incomplete` do not satisfy generation.
182
+
183
+ ## Installation boundary
184
+
185
+ The core belongs to the `utility` tool pack and the OAT adapter belongs to
186
+ `workflows`. Install the core before using the adapter:
187
+
188
+ ```bash
189
+ oat tools install utility --scope user
190
+ oat tools install workflows
191
+ ```
192
+
193
+ The adapter checks the installed canonical core path and compatible version
194
+ before reading OAT configuration. It never falls back to a source checkout.