@open-agent-toolkit/cli 0.2.25 → 0.2.27

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 (87) hide show
  1. package/assets/NOTICES.md +156 -0
  2. package/assets/docs/cli-utilities/configuration.md +42 -11
  3. package/assets/docs/contributing/explainer-kit-verification.md +125 -0
  4. package/assets/docs/contributing/index.md +1 -0
  5. package/assets/docs/reference/troubleshooting.md +47 -0
  6. package/assets/docs/workflows/projects/artifacts.md +24 -6
  7. package/assets/docs/workflows/projects/dispatch-ceiling.md +67 -16
  8. package/assets/docs/workflows/skills/explainer-kit-providers.md +144 -0
  9. package/assets/docs/workflows/skills/explainer-kit.md +121 -69
  10. package/assets/docs/workflows/skills/index.md +1 -0
  11. package/assets/public-package-versions.json +4 -4
  12. package/assets/skills/explainer-kit/SKILL.md +18 -3
  13. package/assets/skills/explainer-kit/recipes/project-recap.json +43 -16
  14. package/assets/skills/explainer-kit/references/contracts.md +167 -20
  15. package/assets/skills/explainer-kit/references/golden-conformance.md +80 -0
  16. package/assets/skills/explainer-kit/references/visual-authoring.md +92 -0
  17. package/assets/skills/explainer-kit/references/visual-review.md +57 -0
  18. package/assets/skills/explainer-kit/schemas/author-request.v2.schema.json +172 -1
  19. package/assets/skills/explainer-kit/schemas/build-record.schema.json +7 -1
  20. package/assets/skills/explainer-kit/schemas/fact-base.schema.json +38 -2
  21. package/assets/skills/explainer-kit/schemas/manifest.schema.json +25 -1
  22. package/assets/skills/explainer-kit/schemas/run-request.schema.json +4 -0
  23. package/assets/skills/explainer-kit/schemas/set-plan.v1.schema.json +149 -0
  24. package/assets/skills/explainer-kit/schemas/visual-review-request.v1.schema.json +117 -0
  25. package/assets/skills/explainer-kit/schemas/visual-review-result.v1.schema.json +80 -0
  26. package/assets/skills/explainer-kit/scripts/lib/browser-runtime.mjs +148 -4
  27. package/assets/skills/explainer-kit/scripts/lib/catalog.mjs +243 -0
  28. package/assets/skills/explainer-kit/scripts/lib/contracts.mjs +586 -8
  29. package/assets/skills/explainer-kit/scripts/lib/diagram.mjs +285 -8
  30. package/assets/skills/explainer-kit/scripts/lib/durability.mjs +35 -0
  31. package/assets/skills/explainer-kit/scripts/lib/fact-base.mjs +144 -8
  32. package/assets/skills/explainer-kit/scripts/lib/package-coverage.mjs +379 -0
  33. package/assets/skills/explainer-kit/scripts/lib/png.mjs +287 -0
  34. package/assets/skills/explainer-kit/scripts/lib/qa.mjs +280 -8
  35. package/assets/skills/explainer-kit/scripts/lib/recipes.mjs +132 -3
  36. package/assets/skills/explainer-kit/scripts/lib/records.mjs +513 -21
  37. package/assets/skills/explainer-kit/scripts/lib/render.mjs +67 -3
  38. package/assets/skills/explainer-kit/scripts/lib/s3-static.mjs +43 -1
  39. package/assets/skills/explainer-kit/scripts/lib/set-plan.mjs +208 -0
  40. package/assets/skills/explainer-kit/scripts/lib/source-backlinks.mjs +218 -0
  41. package/assets/skills/explainer-kit/scripts/lib/visual-review.mjs +380 -0
  42. package/assets/skills/explainer-kit/scripts/render-qa.mjs +48 -10
  43. package/assets/skills/explainer-kit/scripts/run.mjs +859 -134
  44. package/assets/skills/oat-explainer-kit/SKILL.md +40 -12
  45. package/assets/skills/oat-explainer-kit/references/author-callback.md +12 -10
  46. package/assets/skills/oat-explainer-kit/references/lifecycle-contract.md +40 -2
  47. package/assets/skills/oat-explainer-kit/references/visual-review-callback.md +72 -0
  48. package/assets/skills/oat-explainer-kit/scripts/bind-project-sources.mjs +167 -5
  49. package/assets/skills/oat-explainer-kit/scripts/finalize-tracked-run.mjs +92 -5
  50. package/assets/skills/oat-explainer-kit/scripts/run.mjs +324 -2
  51. package/assets/skills/oat-project-autonomous/references/gate-inventory.md +1 -1
  52. package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +1 -1
  53. package/assets/skills/oat-project-implement/SKILL.md +9 -11
  54. package/assets/skills/oat-project-implement/references/dispatch-and-dry-run.md +18 -9
  55. package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +1 -1
  56. package/assets/skills/oat-project-implement/references/phase-execution.md +13 -4
  57. package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +1 -1
  58. package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +1 -1
  59. package/dist/commands/config/index.d.ts.map +1 -1
  60. package/dist/commands/config/index.js +27 -3
  61. package/dist/commands/project/archive/archive-utils.d.ts +1 -0
  62. package/dist/commands/project/archive/archive-utils.d.ts.map +1 -1
  63. package/dist/commands/project/archive/archive-utils.js +109 -42
  64. package/dist/commands/project/archive/explainer-package-coverage.d.ts +14 -0
  65. package/dist/commands/project/archive/explainer-package-coverage.d.ts.map +1 -0
  66. package/dist/commands/project/archive/explainer-package-coverage.js +27 -0
  67. package/dist/commands/project/archive/explainer-source-backlinks.d.ts +18 -0
  68. package/dist/commands/project/archive/explainer-source-backlinks.d.ts.map +1 -0
  69. package/dist/commands/project/archive/explainer-source-backlinks.js +27 -0
  70. package/dist/commands/project/archive/push-runner.d.ts +2 -1
  71. package/dist/commands/project/archive/push-runner.d.ts.map +1 -1
  72. package/dist/commands/project/archive/push-runner.js +5 -1
  73. package/dist/commands/project/dispatch-ceiling/index.d.ts.map +1 -1
  74. package/dist/commands/project/dispatch-ceiling/index.js +90 -0
  75. package/dist/config/dispatch-notices.d.ts +8 -0
  76. package/dist/config/dispatch-notices.d.ts.map +1 -0
  77. package/dist/config/dispatch-notices.js +79 -0
  78. package/dist/config/dispatch-policy-options.d.ts +2 -0
  79. package/dist/config/dispatch-policy-options.d.ts.map +1 -1
  80. package/dist/config/dispatch-policy-options.js +14 -2
  81. package/dist/providers/identity/dispatch-report.d.ts +17 -0
  82. package/dist/providers/identity/dispatch-report.d.ts.map +1 -1
  83. package/dist/providers/identity/dispatch-report.js +30 -0
  84. package/dist/release/public-package-contract.d.ts +6 -0
  85. package/dist/release/public-package-contract.d.ts.map +1 -1
  86. package/dist/release/public-package-contract.js +75 -0
  87. package/package.json +2 -2
@@ -35,20 +35,111 @@ callback; a run without one fails `E_AUTHOR_REQUIRED`. An in-process caller
35
35
  supplies `options.author(request)`; a JSON-only CLI caller uses
36
36
  `--author-module author.mjs`. The core invokes it once per resolved artifact
37
37
  with an `explainer-kit.author-request/v2` payload containing the artifact
38
- identity and type, the artifact's authoring path, the inlined brief, the
39
- reconciled fact base, the resolved theme, the shell source for artistic
40
- artifacts, the required narrative sections for narrative floor artifacts, and
41
- bounded-discovery context. It must return an `explainer-kit.author-result/v2`
42
- carrying exactly one of `content.markdown` or `content.html`, matching the
43
- artifact's declared authoring path, plus non-secret provenance. A floor result
44
- may also carry `proposedArtifacts` of `{id, profileId, rationale}`; the
45
- referenced expansion profile supplies the type, authoring path, brief, and
46
- shell. The executable callback is never persisted in `run-request.json`.
47
-
48
- Unknown profile IDs and unsafe, duplicate, or floor-colliding artifact IDs are
49
- hard errors. Proposals beyond a profile's `maxCount` or the recipe's
50
- `expansion.limits.maxArtifacts` are rejected with a warning and the run
51
- continues.
38
+ identity and type, the artifact's authoring path, the inlined brief, the bundled
39
+ `visualAuthoringGuidance`, the reconciled fact base, the resolved theme, the
40
+ shell source for artistic artifacts, the required narrative sections for
41
+ narrative floor artifacts, and bounded-discovery context. The guidance is
42
+ loaded only from the installed skill's `references/visual-authoring.md`; no
43
+ ambient or home-directory file is consulted. The callback must return an
44
+ `explainer-kit.author-result/v2` carrying exactly one of `content.markdown` or
45
+ `content.html`, matching the artifact's declared authoring path, plus non-secret
46
+ provenance. The executable callback is never persisted in `run-request.json`.
47
+
48
+ Project recap requests have an explicit `recapMode`. Omitting it selects and
49
+ persists `artistic`, which keeps the recipe's rich HTML floor. Selecting
50
+ `deterministic-markdown` before the run applies the recipe-owned fallback to
51
+ the complete planned portfolio, including optional expansions, while retaining
52
+ the same adaptive hub, architecture, and deck identities. The resulting
53
+ Markdown author records and `source/content/*.md` paths remain distinct in the
54
+ manifest and immutable rebuild package. An artistic author failure fails the
55
+ run; the core never silently retries or downgrades it as Markdown.
56
+
57
+ Before artifact authoring, a caller supplies one provider-neutral `planSet`
58
+ callback. It receives the reconciled fact base and recipe policy and returns
59
+ `explainer-kit.set-plan/v1`:
60
+
61
+ ```json
62
+ {
63
+ "schemaVersion": "explainer-kit.set-plan/v1",
64
+ "planId": "project-recap-set",
65
+ "recipe": { "id": "project-recap", "version": "1" },
66
+ "sourceIds": ["plan"],
67
+ "ledger": {
68
+ "terminology": [],
69
+ "statuses": [],
70
+ "numbers": []
71
+ },
72
+ "portfolio": [
73
+ {
74
+ "artifactId": "project-recap",
75
+ "artifactType": "hub",
76
+ "profileId": "recap-hub",
77
+ "required": true,
78
+ "sourceIds": ["plan"],
79
+ "draft": "Lead with the validated outcome.",
80
+ "visualIntent": "Orient the reader in the first viewport."
81
+ }
82
+ ]
83
+ }
84
+ ```
85
+
86
+ The set plan owns the shared terminology/status/number ledger, source coverage,
87
+ adaptive portfolio, per-artifact draft, and visual intent. Optional entries add
88
+ a source-backed `justification`; undeclared sources, conflicting ledger values,
89
+ duplicate artifact IDs, and unjustified optional entries are invalid. Each
90
+ `author-request/v2` carries the complete immutable `setContext` plus the exact
91
+ matching `plannedArtifact`. The planner finalizes floor and expansion entries
92
+ before authoring; author results cannot add, remove, or replace artifacts.
93
+ When a planner draft contains a supported non-linear graph, the request also
94
+ carries its closed `graphSemantics` (direction, nodes, edges, and topology).
95
+ Artistic HTML must expose one exact `data-direction`. Each planned node requires
96
+ one observation carrying `data-node`, `data-node-label`, `data-node-shape`, and
97
+ `data-node-explicit`; each planned edge requires one observation carrying
98
+ `data-from`, `data-to`, `data-edge-kind`, and `data-edge-label`. Values must
99
+ match the complete frozen planner tuples exactly, including canonical HTML
100
+ attribute escaping and explicit empty edge labels. Missing, extra, duplicate,
101
+ malformed, noncanonical, rewired, or semantically drifting observations fail
102
+ with `E_DIAGRAM_TOPOLOGY` before browser or visual-critic review.
103
+
104
+ Visual review uses provider-neutral
105
+ `explainer-kit.visual-review-request/v1` and
106
+ `explainer-kit.visual-review-result/v1` envelopes. The request combines the
107
+ shared plan with rendered artifact paths and viewport evidence, binds every
108
+ rendered file, screenshot, and metrics file by raw-byte SHA-256 hash, and
109
+ binds the launched Chromium name, version, and stable capture identity from
110
+ `explainer-kit.browser-evidence/v2`. It derives a deterministic `requestId` and
111
+ canonical `requestHash`. The critic
112
+ receives a confined reader for those snapshotted paths and cannot read
113
+ unlisted evidence. Core revalidates the bytes after the callback returns.
114
+ Before snapshotting, each screenshot must fully decode as a bounded,
115
+ CRC-verified, non-interlaced 8-bit RGB or RGBA PNG with exact zlib consumption
116
+ and viewport-matched dimensions. The pixel hash established during QA must
117
+ match the later visual-review snapshot.
118
+ The result must echo the exact request identity and hash, name the complete
119
+ artifact set, include artifact-scoped rubric findings, and select exactly one
120
+ `pass`, `correct`, or `fail` disposition. Application validation must pass the
121
+ reviewed request as `visualReviewRequest` context when validating the result.
122
+ Request artifacts must exactly equal the planned portfolio, result artifact IDs
123
+ must exactly equal that reviewed set, and every finding must name one of those
124
+ artifacts. `pass` permits no findings; `correct` and `fail` require at least one
125
+ correction finding. Provider, model, command, credential, and dispatch fields
126
+ are not part of any core contract.
127
+
128
+ Unattended project recaps require retained browser evidence at every required
129
+ viewport from a branded session returned by `createBrowserProbeSession()` and a
130
+ final visual-critic `pass`. The core derives `runtime.name` and
131
+ `runtime.version` from the launched browser instance; caller assertions cannot
132
+ replace that identity. Deterministic fixture sessions are explicit and may be
133
+ used only in bounded non-production tests. A fixture session, missing trusted
134
+ session, visual-critic failure, terminal `fail`, or second `correct` after the
135
+ one allowed correction pass closes the QA gate with `built-needs-review`. That
136
+ terminal outcome preserves rendered artifacts and all available review
137
+ evidence while skipping durability and publish callbacks.
138
+
139
+ The canonical immutable evidence consumer contract is
140
+ `explainer-kit.package-coverage/v2`. It requires one matching launched-Chromium
141
+ runtime and capture identity across browser metrics, review requests, retained
142
+ attempt copies, manifest hashes, finalization, and archive validation.
52
143
 
53
144
  ## Explicit source forms
54
145
 
@@ -66,6 +157,15 @@ continues.
66
157
  documents. The core validates these bindings before loading facts, then
67
158
  reconciles the loaded claims and invokes the critic exactly once.
68
159
 
160
+ Reviewed GitHub provenance is one indivisible tuple: `repository`, full
161
+ lowercase 40-character `revision`, repository-relative `path`, inclusive
162
+ `lineRange`, and its exact canonical `url`. Every declared source or citation
163
+ backlink must include the complete tuple. The URL authority is
164
+ `scripts/lib/source-backlinks.mjs`; it rejects moving refs, dot or empty path
165
+ segments, decoded separators, noncanonical percent encoding, credentials,
166
+ queries, and tuple/URL mismatches. Adapters must bind facts and hashes to the
167
+ exact reviewed Git blob bytes, not mutable working-tree content.
168
+
69
169
  An unattended request asserts that its explicit source artifacts are already
70
170
  approved. It does not prompt, and it fails before narrative serialization when
71
171
  the author is absent, returns an invalid result, or copies excessive verbatim
@@ -78,16 +178,48 @@ The core executes:
78
178
 
79
179
  1. validate request and recipe
80
180
  2. reconcile or check the fact base
81
- 3. apply bounded discovery
181
+ 3. apply bounded discovery and produce one validated set plan
82
182
  4. resolve one theme
83
- 5. author each floor artifact against its brief, evaluate expansion proposals,
84
- and author each accepted expansion artifact
183
+ 5. author every planned artifact against the same set context
85
184
  6. render typed artifacts through the narrative renderer or validate
86
185
  agent-composed HTML, per each artifact's declared authoring path
87
- 7. run structural, guideline, and optional browser QA
88
- 8. resolve content approval the interactive gate pauses here, after render and
186
+ 7. run structural and guideline QA, plus required browser and independent
187
+ visual review for unattended project recaps
188
+ 8. close any unresolved recap review gate before external persistence
189
+ 9. resolve content approval — the interactive gate pauses here, after render and
89
190
  QA and before anything is published or persisted externally
90
- 9. write the manifest and build record
191
+ 10. write the manifest and build record
192
+
193
+ An incomplete interactive result includes
194
+ `approval.resumeToken: "ekrt2:<64 lowercase hex characters>"`. The token is an
195
+ opaque v2 digest over the run ID, original canonical absolute output root, the
196
+ raw-byte SHA-256 hash of `run-request.json`, and raw-byte SHA-256 hashes of the
197
+ five retained `source/set-plan/*.json` records. It is generated from trusted
198
+ in-memory run identity before the interactive pause. The external caller must
199
+ retain it outside the run root and echo it unchanged as
200
+ `reviewedSource.resumeToken` with the later approval decision.
201
+
202
+ Resume validates the fixed-length token with a timing-safe comparison before
203
+ parsing retained request fields or hydrating set-plan, author, or content
204
+ state. Missing, malformed, mismatched, relocated-root, or byte-drifted tokens
205
+ fail `E_APPROVAL_RESUME` before planner, author, durability, or publish
206
+ callbacks. Only the fixed-format authenticated `ekrt2` token is accepted.
207
+ Every `ekrt1` token is rejected, including a correctly derived legacy digest.
208
+ Legacy paused runs must restart to obtain an authenticated token; a retained
209
+ relative `outputRoot` or any other mutable package state cannot opt into legacy
210
+ resume behavior. The token is not written into the run request, content
211
+ approval, build record, set-plan projections, manifest, or immutable-hash
212
+ inventory.
213
+
214
+ After authenticating the retained bytes, resume applies initialization's same
215
+ canonical privacy-safe request projection to the current request, including the
216
+ canonical output root and default render strategy, and requires an exact match
217
+ with `run-request.json` before installing current request state or hydrating any
218
+ package content. This binds recipe and recap mode, fact-base input, complete
219
+ theme and render policy, privacy, public base URL, durability, publish
220
+ destination, and run mode. Raw art direction may differ only when
221
+ `privacy.retainRawArtDirection` is not `true`, because that deliberately
222
+ redacted input is non-semantic after the rendered package has paused.
91
223
 
92
224
  The run package retains the privacy-safe `run-request.json`,
93
225
  `source/content-approval.json`, `source/fact-base.json`,
@@ -98,6 +230,15 @@ The run package retains the privacy-safe `run-request.json`,
98
230
  structured error and recovery action without deleting earlier outputs. Raw art
99
231
  direction is omitted unless the request explicitly opts in.
100
232
 
233
+ `scripts/lib/package-coverage.mjs` is the versioned pure-ESM authority for
234
+ required immutable paths. Successful unattended recaps require complete
235
+ attempt-1 evidence. Successful interactive recaps require no review paths when
236
+ none are retained, but any retained review material requires a complete
237
+ attempt. Failed and incomplete packages follow the same no-evidence/complete-
238
+ evidence split. Only `built-needs-review` may retain a deliberately partial
239
+ chain. Outside that handoff, any attempt-2 material requires complete attempt
240
+ 1, the revision record, and complete attempt 2.
241
+
101
242
  Build-record stages are terminal once `passed` or `warned`. A rejected run that
102
243
  is later approved reopens the render and QA stages through a narrowly guarded
103
244
  record-level reset so the corrected sources are re-rendered and re-validated,
@@ -111,6 +252,10 @@ empty rounds and always stops at the recipe's `maxRounds`.
111
252
 
112
253
  Durability and publishing are never implicit.
113
254
 
255
+ `built-needs-review` is not durability-eligible. The core skips both callbacks
256
+ for that outcome, and downstream finalizers, exporters, and archive pushers
257
+ must reject it rather than converting it to success.
258
+
114
259
  - `durability.strategy: none` invokes neither seam.
115
260
  - `durability.strategy: commit` invokes the explicit `durability` callback.
116
261
  Caller-created commit evidence is subsequently verified with
@@ -139,6 +284,8 @@ marking rides in the result and the approval record only; `manifest/v1` stays
139
284
  frozen and carries no marking field. Input validation and unsupported
140
285
  recipes reject before output mutation. Failures after initialization return a
141
286
  `failed` result with paths to the retained record and intermediates.
287
+ `built-needs-review` is a distinct terminal review-gate result, not a synonym
288
+ for `built-not-durable`.
142
289
 
143
290
  V1 readers reject unknown schema majors and unknown contract fields. Relative
144
291
  record paths are run-root confined, hashes use `sha256:<hex>`, and command
@@ -0,0 +1,80 @@
1
+ # Golden conformance contract
2
+
3
+ Golden conformance runs the unattended project-recap workflow from portable
4
+ semantic inputs and validates its live output in real Chromium. It is a
5
+ behavioral oracle, not a pixel snapshot: output may change markup, spacing, or
6
+ composition when it clears the same quality bar.
7
+
8
+ ## Cases
9
+
10
+ Each case directory under `tests/fixtures/golden/` contains:
11
+
12
+ - `simple` checks viewport-sized lead evidence and a cohesive baseline recap.
13
+ - `non-linear` checks branch, fan-in, and cycle preservation.
14
+ - `explainer-authoring-redesign` checks an archive-only rebuild from a dense
15
+ completed project record.
16
+
17
+ | Path | Contract |
18
+ | ----------------------------- | --------------------------------------------------------------- |
19
+ | `descriptor.json` | Case identity plus paths and SHA-256 hashes for semantic inputs |
20
+ | `source-input.json` | Source-grounded claims, topology, and reader questions |
21
+ | `evidence/source-record.json` | Retained source claims, upstream repository hash, and topology |
22
+
23
+ All cases share `tests/fixtures/golden/rubric.json`. Generated HTML, browser
24
+ captures, measurements, manifests, catalogs, and review records are temporary
25
+ test output and must not be committed.
26
+
27
+ The descriptor's retained-file set is case-relative and content addressed. The
28
+ loader recomputes each hash, resolves source records, and rejects missing,
29
+ changed, duplicate, non-portable, or ungrounded input.
30
+ `sharedRubricPath` resolves from `tests/fixtures/golden/`, and
31
+ `sharedRubricSha256` content-addresses that common contract.
32
+
33
+ ## Required rubric
34
+
35
+ The shared `explainer-kit.golden-rubric/v1` `checks` object has exactly these
36
+ required fields:
37
+
38
+ 1. `adaptiveMinimumSet`
39
+ 2. `firstViewport`
40
+ 3. `hierarchy`
41
+ 4. `representationChoice`
42
+ 5. `legibility`
43
+ 6. `cohesion`
44
+ 7. `sourceCoverage`
45
+ 8. `interactions`
46
+ 9. `topologyPreservation`
47
+ 10. `catalogParity`
48
+ 11. `boundedCorrection`
49
+
50
+ The benchmark enforces every field against live runtime evidence. A passing set
51
+ contains exactly the project recap, architecture, and deck; preserves source
52
+ meaning and topology; has catalog-to-manifest parity; includes real browser
53
+ captures and measurements; and reaches a passing terminal review without a
54
+ correction. Integration suites separately exercise the one-correction ceiling.
55
+
56
+ ## Runtime evidence
57
+
58
+ The suite generates one complete recap package per case in a temporary
59
+ directory. It validates artifact membership, claim markers, exact topology,
60
+ catalog parity, independent visual review, real Chromium identity, viewport
61
+ dimensions, lead-content presence, heading order, capture identity, overflow,
62
+ keyboard and deck-arrow behavior, and bounded review. The temporary package is
63
+ removed when the test completes.
64
+
65
+ Claims are accepted only when their source ID exists and their text exactly
66
+ matches a claim in the retained source record. Repository-backed records also
67
+ pin the upstream repository file and prove every retained claim occurs there.
68
+ Runtime tests must not load an operator plugin, home directory, active project,
69
+ or moving branch.
70
+
71
+ ## Portability rules
72
+
73
+ - Retained descriptor paths are relative to their case and cannot escape it;
74
+ the shared rubric path is relative to the golden fixture root.
75
+ - POSIX roots, Windows drive paths, UNC paths, home-relative paths, and
76
+ `file://` locators are rejected wherever they occur in committed inputs.
77
+ - Repository-relative paths and supported `https://` source URLs are allowed.
78
+ - Every claim, topology node, and topology edge resolves to retained,
79
+ hash-verified source input, so later runs do not need the original
80
+ workstation.
@@ -0,0 +1,92 @@
1
+ # Visual authoring guidance
2
+
3
+ Use this reference with the reconciled fact base, shared set plan, selected
4
+ theme, and the artifact-specific brief. It is sufficient for an unattended
5
+ author. An optional installed visual-explainer capability may improve the
6
+ composition, but the run must not depend on it.
7
+
8
+ ## Choose the representation
9
+
10
+ Choose the visual form that makes the reader's question easiest to answer:
11
+
12
+ - Use a hub for orientation, current state, key decisions, and links into the
13
+ rest of the set.
14
+ - Use a system visual for boundaries, relationships, direction, ownership, or
15
+ flow. Preserve branches, fan-in, and cycles; reject or reroute a topology the
16
+ selected renderer cannot represent.
17
+ - Use a deck for a paced beginning-to-end narrative with one idea per frame.
18
+ - Use a table for repeated facts with comparable columns, not for prose.
19
+ - Use cards for independent summaries and lanes for parallel work.
20
+
21
+ Do not turn every fact into a chart. Prefer structured text when shape or
22
+ position adds no meaning.
23
+
24
+ ## Establish hierarchy
25
+
26
+ Make the first viewport answer what this is, why it matters, and where the work
27
+ stands. Use one dominant title, a short framing statement, and the most useful
28
+ visual or status summary before secondary detail. Keep headings descriptive,
29
+ group related items, and use size, spacing, and contrast consistently.
30
+
31
+ Use the shared terminology, status labels, and numbers exactly. Never create a
32
+ shorter synonym that changes meaning. Keep source-backed uncertainty visible as
33
+ `needs confirmation`.
34
+
35
+ ## Hubs and responsive navigation
36
+
37
+ - Lead with the project outcome and current state, then expose architecture,
38
+ decisions, validation, and next steps.
39
+ - Link every artifact in the planned set using descriptive labels.
40
+ - Keep navigation compact and keyboard reachable. On narrow screens, collapse
41
+ a side rail into horizontal, wrapping, or disclosure navigation.
42
+ - Avoid fixed widths. Let text wrap, put wide tables and diagrams in bounded
43
+ scroll containers, and ensure the document itself does not overflow.
44
+ - Keep the primary reading order useful without JavaScript.
45
+
46
+ ## Diagrams and system visuals
47
+
48
+ - Encode relationships with position and connectors, not color alone.
49
+ - Label nodes with concrete nouns and edges with actions or data movement.
50
+ - Make direction explicit and include a legend only when the encoding needs it.
51
+ - Preserve graph semantics. Never serialize branches, fan-in, or cycles into a
52
+ false linear sequence.
53
+ - For each non-linear `graphSemantics` input, emit one element with the exact
54
+ `data-direction`. Emit every node exactly once with `data-node`,
55
+ `data-node-label`, `data-node-shape`, and `data-node-explicit`; emit every
56
+ edge exactly once with `data-from`, `data-to`, `data-edge-kind`, and
57
+ `data-edge-label`. Use the frozen tuple values verbatim with canonical HTML
58
+ attribute escaping, including `data-edge-label=""` for an unlabeled edge.
59
+ - Give the canvas an accessible name and description. Keep labels readable at
60
+ the required viewport widths and provide bounded pan or zoom for large maps.
61
+ - Use the same component names and status vocabulary as the hub and deck.
62
+
63
+ ## Decks
64
+
65
+ - Give each slide one claim, decision, or transition.
66
+ - Open with the outcome and audience question; close with current state and next
67
+ action.
68
+ - Prefer short headings, diagrams, lists, and comparisons over paragraphs.
69
+ - Keep critical content inside one viewport, with overflow available as a
70
+ safety valve rather than the default reading experience.
71
+ - Support keyboard controls, visible position, reduced motion, print, and a
72
+ readable no-script flow.
73
+
74
+ ## Tables
75
+
76
+ - Use a clear header row and comparable values in each column.
77
+ - Put units in headings, align numbers consistently, and preserve exact values
78
+ from the shared ledger.
79
+ - Keep cells concise. Move explanations below the table or into a linked deep
80
+ dive.
81
+ - Wrap or scroll wide tables without clipping their final column.
82
+
83
+ ## Composition check before return
84
+
85
+ Confirm the artifact:
86
+
87
+ 1. answers its planned reader question in the first viewport;
88
+ 2. uses the planned medium and visual intent;
89
+ 3. follows the shared ledger without terminology, status, or number drift;
90
+ 4. includes only source-grounded claims and planned links;
91
+ 5. remains legible and navigable on desktop, tablet, and mobile; and
92
+ 6. returns complete content for the recipe-selected authoring path.
@@ -0,0 +1,57 @@
1
+ # Visual review guidance
2
+
3
+ Review the rendered artifact set against its reconciled fact base, shared
4
+ ledger, set plan, and browser evidence. This rubric is independent of authoring
5
+ guidance: it tells a critic what to assess, not how an author should compose.
6
+ An optional installed visual-explainer capability may assist, but review must
7
+ remain possible from bundled evidence and rules alone.
8
+
9
+ ## Review the whole set
10
+
11
+ Inspect the complete set before assigning artifact findings. Verify:
12
+
13
+ - **First viewport:** each artifact establishes purpose, project state, and the
14
+ primary reader question without scrolling.
15
+ - **Hierarchy:** the most important outcome or relationship is dominant, with
16
+ secondary detail grouped and ordered consistently.
17
+ - **Representation choice:** the selected medium makes the evidence easier to
18
+ understand than plain prose would.
19
+ - **Legibility:** text, labels, status cues, tables, and connectors remain
20
+ readable at every required viewport.
21
+ - **Medium fit:** the hub orients and links, the system visual preserves
22
+ relationships, the deck paces a narrative, and optional artifacts add a
23
+ distinct source-backed perspective.
24
+ - **Cohesion:** terminology, status labels, numbers, color meaning, and visual
25
+ language match the shared ledger and one another.
26
+ - **Coverage and redundancy:** planned sources and reader questions are covered
27
+ once at the right depth; optional artifacts do not repeat the hub or deck
28
+ without a justified purpose.
29
+ - **Interaction:** navigation, links, keyboard controls, reduced motion, table
30
+ overflow, and diagram pan or zoom work without hiding content.
31
+
32
+ ## Artifact-scoped findings
33
+
34
+ Every finding identifies an artifact ID, the failed rubric area, evidence, and
35
+ a concrete correction. Distinguish factual or ledger conflicts from visual
36
+ judgment. Never infer a fact that is absent from the retained sources.
37
+
38
+ Use severity proportionally:
39
+
40
+ - Critical: unsafe, fabricated, or materially false output.
41
+ - Important: the artifact cannot answer its primary question or loses required
42
+ topology, content, or legibility.
43
+ - Medium: meaningful visual or cohesion weakness that does not invalidate the
44
+ set.
45
+ - Minor: localized polish issue.
46
+
47
+ ## Disposition
48
+
49
+ Return exactly one provider-neutral disposition:
50
+
51
+ - `pass` when the full set clears the rubric with no required correction.
52
+ - `correct` when bounded artifact-scoped changes can clear the rubric.
53
+ - `fail` when evidence is missing, the plan or ledger is internally invalid, or
54
+ correction would require unsupported facts or a different artifact set.
55
+
56
+ Do not award `pass` from source code inspection alone. Base visual findings on
57
+ the retained browser evidence available to the review request.
@@ -10,8 +10,11 @@
10
10
  "artifactType",
11
11
  "authoring",
12
12
  "brief",
13
+ "visualAuthoringGuidance",
13
14
  "factBase",
14
- "theme"
15
+ "theme",
16
+ "setContext",
17
+ "plannedArtifact"
15
18
  ],
16
19
  "properties": {
17
20
  "schemaVersion": { "const": "explainer-kit.author-request/v2" },
@@ -21,9 +24,17 @@
21
24
  },
22
25
  "authoring": { "enum": ["markdown", "html"] },
23
26
  "brief": { "type": "string", "minLength": 1 },
27
+ "visualAuthoringGuidance": { "type": "string", "minLength": 1 },
24
28
  "factBase": { "$ref": "explainer-kit.fact-base/v1" },
25
29
  "shell": { "type": "string", "minLength": 1 },
26
30
  "theme": { "$ref": "explainer-kit.theme/v1" },
31
+ "setContext": { "$ref": "explainer-kit.set-plan/v1" },
32
+ "plannedArtifact": { "$ref": "#/$defs/plannedArtifact" },
33
+ "graphSemantics": {
34
+ "type": "array",
35
+ "items": { "$ref": "#/$defs/graphSemantics" },
36
+ "minItems": 1
37
+ },
27
38
  "floor": {
28
39
  "type": "object",
29
40
  "additionalProperties": false,
@@ -37,5 +48,165 @@
37
48
  }
38
49
  }
39
50
  }
51
+ },
52
+ "$defs": {
53
+ "graphSemantics": {
54
+ "type": "object",
55
+ "additionalProperties": false,
56
+ "required": ["direction", "nodes", "edges", "topology"],
57
+ "properties": {
58
+ "direction": { "enum": ["TD", "LR"] },
59
+ "nodes": {
60
+ "type": "array",
61
+ "items": {
62
+ "type": "object",
63
+ "additionalProperties": false,
64
+ "required": ["id", "label", "shape", "explicit"],
65
+ "properties": {
66
+ "id": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_-]*$" },
67
+ "label": { "type": "string", "minLength": 1 },
68
+ "shape": { "enum": ["rectangle", "rounded", "diamond"] },
69
+ "explicit": { "type": "boolean" }
70
+ }
71
+ },
72
+ "minItems": 1,
73
+ "uniqueItems": true
74
+ },
75
+ "edges": {
76
+ "type": "array",
77
+ "items": {
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": ["from", "to", "kind", "label"],
81
+ "properties": {
82
+ "from": {
83
+ "type": "string",
84
+ "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
85
+ },
86
+ "to": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_-]*$" },
87
+ "kind": { "enum": ["arrow", "line"] },
88
+ "label": { "type": "string" }
89
+ }
90
+ },
91
+ "minItems": 1
92
+ },
93
+ "topology": {
94
+ "type": "object",
95
+ "additionalProperties": false,
96
+ "required": [
97
+ "kind",
98
+ "features",
99
+ "branchNodes",
100
+ "fanInNodes",
101
+ "cycle",
102
+ "order"
103
+ ],
104
+ "properties": {
105
+ "kind": { "const": "non-linear" },
106
+ "features": {
107
+ "type": "array",
108
+ "items": {
109
+ "enum": [
110
+ "branch",
111
+ "fan-in",
112
+ "cycle",
113
+ "disconnected",
114
+ "non-linear"
115
+ ]
116
+ },
117
+ "minItems": 1,
118
+ "uniqueItems": true
119
+ },
120
+ "branchNodes": {
121
+ "type": "array",
122
+ "items": {
123
+ "type": "string",
124
+ "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
125
+ },
126
+ "uniqueItems": true
127
+ },
128
+ "fanInNodes": {
129
+ "type": "array",
130
+ "items": {
131
+ "type": "string",
132
+ "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
133
+ },
134
+ "uniqueItems": true
135
+ },
136
+ "cycle": { "type": "boolean" },
137
+ "order": {
138
+ "type": "array",
139
+ "items": {
140
+ "type": "string",
141
+ "pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
142
+ },
143
+ "maxItems": 0
144
+ }
145
+ }
146
+ }
147
+ }
148
+ },
149
+ "plannedArtifact": {
150
+ "type": "object",
151
+ "additionalProperties": false,
152
+ "required": [
153
+ "artifactId",
154
+ "artifactType",
155
+ "profileId",
156
+ "required",
157
+ "sourceIds",
158
+ "draft",
159
+ "visualIntent"
160
+ ],
161
+ "properties": {
162
+ "artifactId": {
163
+ "type": "string",
164
+ "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
165
+ },
166
+ "artifactType": {
167
+ "enum": ["hub", "diagram", "explainer", "deck", "catalog"]
168
+ },
169
+ "profileId": {
170
+ "type": "string",
171
+ "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
172
+ },
173
+ "required": { "type": "boolean" },
174
+ "sourceIds": {
175
+ "type": "array",
176
+ "items": {
177
+ "type": "string",
178
+ "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
179
+ },
180
+ "minItems": 1,
181
+ "uniqueItems": true
182
+ },
183
+ "draft": { "type": "string", "minLength": 1 },
184
+ "visualIntent": { "type": "string", "minLength": 1 },
185
+ "justification": {
186
+ "type": "object",
187
+ "additionalProperties": false,
188
+ "required": ["kind", "sourceIds", "rationale"],
189
+ "properties": {
190
+ "kind": {
191
+ "enum": [
192
+ "status-change",
193
+ "rollout-complexity",
194
+ "source-backed-detail"
195
+ ]
196
+ },
197
+ "sourceIds": {
198
+ "type": "array",
199
+ "items": {
200
+ "type": "string",
201
+ "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
202
+ },
203
+ "minItems": 1,
204
+ "uniqueItems": true
205
+ },
206
+ "rationale": { "type": "string", "minLength": 1 }
207
+ }
208
+ }
209
+ }
210
+ }
40
211
  }
41
212
  }