@cyber-dash-tech/revela 0.17.0 → 0.17.2
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.
- package/README.md +45 -567
- package/README.zh-CN.md +47 -535
- package/designs/monet/DESIGN.md +1 -1
- package/designs/starter/DESIGN.md +1 -1
- package/designs/summit/DESIGN.md +1 -1
- package/lib/commands/help.ts +4 -4
- package/lib/commands/init.ts +9 -7
- package/lib/commands/narrative.ts +13 -4
- package/lib/commands/pdf.ts +24 -15
- package/lib/commands/pptx.ts +2 -16
- package/lib/commands/research.ts +2 -0
- package/lib/commands/review.ts +81 -93
- package/lib/deck-html/contract.ts +26 -10
- package/lib/decks-state.ts +75 -86
- package/lib/edit/deck-state.ts +3 -111
- package/lib/edit/open.ts +2 -2
- package/lib/edit/resolve-deck.ts +14 -24
- package/lib/inspect/open.ts +2 -2
- package/lib/media/download.ts +23 -3
- package/lib/media/save.ts +1 -0
- package/lib/media/types.ts +1 -0
- package/lib/narrative-state/deck-plan-artifact.ts +584 -0
- package/lib/narrative-state/display.ts +74 -4
- package/lib/narrative-state/map-html.ts +242 -107
- package/lib/narrative-state/render-plan.ts +649 -44
- package/lib/narrative-state/research-gaps.ts +5 -2
- package/lib/narrative-vault/compile.ts +16 -1
- package/lib/narrative-vault/types.ts +4 -2
- package/lib/qa/checks.ts +206 -5
- package/lib/qa/measure.ts +63 -1
- package/lib/refine/open.ts +2 -2
- package/lib/refine/server.ts +157 -20
- package/package.json +1 -1
- package/plugin.ts +2 -2
- package/skill/NARRATIVE_SKILL.md +19 -19
- package/skill/SKILL.md +99 -35
- package/tools/decks.ts +83 -51
- package/tools/narrative-view.ts +16 -0
package/lib/commands/review.ts
CHANGED
|
@@ -8,21 +8,19 @@ export function buildReviewPrompt({
|
|
|
8
8
|
workspaceRoot?: string
|
|
9
9
|
}): string {
|
|
10
10
|
const state = exists
|
|
11
|
-
? `${DECKS_STATE_FILE} exists
|
|
12
|
-
: `${DECKS_STATE_FILE} does not exist
|
|
11
|
+
? `${DECKS_STATE_FILE} exists as legacy/cache state. Prefer file-native narrative sources.`
|
|
12
|
+
: `${DECKS_STATE_FILE} does not exist. Do not create it for narrative review.`
|
|
13
13
|
|
|
14
14
|
return `Review Revela narrative readiness.
|
|
15
15
|
|
|
16
16
|
Goal:
|
|
17
|
-
-
|
|
17
|
+
- Review canonical narrative state from \`revela-narrative/\` when present: audience, belief shift, decision/action, thesis, central claims, evidence boundaries, objections, and risks.
|
|
18
18
|
- Treat this as a narrative readiness review, not a deck HTML write-readiness review.
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
- Do not
|
|
22
|
-
- Do not treat legacy \`writeReadiness.status\`, old review snapshots, or an existing HTML deck as narrative approval.
|
|
19
|
+
- Treat missing evidence, open research gaps, stale artifacts, and incomplete deck-plan links as diagnostics. They are not workflow permission gates.
|
|
20
|
+
- Do not call \`revela-decks\` action \`review\` here. That action is legacy deck/artifact diagnostics.
|
|
21
|
+
- Do not treat legacy \`writeReadiness.status\`, old review snapshots, or an existing HTML deck as narrative state.
|
|
23
22
|
- Do not write or overwrite \`decks/*.html\` during narrative review.
|
|
24
|
-
-
|
|
25
|
-
- Only call \`revela-decks\` action \`approveNarrative\` when the user explicitly asks to approve or override.
|
|
23
|
+
- Do not ask for narrative approval. Users decide whether to continue; report diagnostics and consequences.
|
|
26
24
|
|
|
27
25
|
Current state:
|
|
28
26
|
- ${state}
|
|
@@ -35,21 +33,19 @@ Workspace boundary rules:
|
|
|
35
33
|
- For Glob/file searches, use the current workspace as the search root. Do not set the search root to a parent directory or home directory.
|
|
36
34
|
|
|
37
35
|
Workflow:
|
|
38
|
-
1.
|
|
39
|
-
2. If
|
|
40
|
-
3. If legacy deck state exists,
|
|
41
|
-
4.
|
|
36
|
+
1. Read/compile \`revela-narrative/\` when present; use \`revela-decks\` read/reviewNarrative only as a compatibility helper while migration is in progress.
|
|
37
|
+
2. If canonical narrative is missing or thin, do not invent a deck plan, slide count, design, output path, or visual style. Report the smallest narrative inputs needed, usually audience, belief-before, belief-after, decision/action, thesis, central claims, evidence availability, objections, and risks.
|
|
38
|
+
3. If legacy deck state exists, treat it as cache/provenance only. Do not assume old deck readiness or approval fields are workflow authority.
|
|
39
|
+
4. Report \`status\`, \`warnings\`, \`issues\`, \`narrativeHash\`, and \`nextActions\` when returned. If the read summary returned \`markdownQa.repairCards\` or \`vaultDiagnostics\`, report Markdown QA repair cards and compile diagnostics with file/node/code/message plus smallest repair or suggested next action.
|
|
42
40
|
5. If research findings have been saved but not attached or evidence-bound, report them as unattached research state, not proof.
|
|
43
41
|
6. If central claims lack required evidence, report the named claim and the exact next action: attach findings, bind evidence, run targeted research, narrow unsupported scope, or rewrite the claim.
|
|
44
|
-
7.
|
|
42
|
+
7. Do not report missing or stale approval as a problem. If artifacts or deck-plan files may not reflect current narrative, describe that alignment gap directly.
|
|
45
43
|
|
|
46
44
|
Report format:
|
|
47
45
|
- Start with \`Narrative readiness: <status>\`.
|
|
48
46
|
- Include \`Narrative hash: <hash>\` when returned.
|
|
49
|
-
-
|
|
47
|
+
- List diagnostics with issue type, claim text when available, and suggested next action. Keep Markdown QA repair cards separate from compiler diagnostics.
|
|
50
48
|
- If warnings exist, list them after blockers as residual risks.
|
|
51
|
-
- If approval is missing, ask whether the user wants to approve the narrative or revise it.
|
|
52
|
-
- If approval is stale, say the prior approval no longer matches the current narrative hash.
|
|
53
49
|
- Keep deck/artifact readiness separate. If the user wants to write or review deck artifacts, tell them to run \`/revela make --deck\`.
|
|
54
50
|
|
|
55
51
|
Rules:
|
|
@@ -59,7 +55,7 @@ Rules:
|
|
|
59
55
|
- Do not store secrets, credentials, tokens, or sensitive personal information.
|
|
60
56
|
- Do not add inferred user preferences to long-term preference state.
|
|
61
57
|
|
|
62
|
-
Start now by reading ${DECKS_STATE_FILE}
|
|
58
|
+
Start now by reading canonical narrative files and reporting diagnostics. Do not create ${DECKS_STATE_FILE} or request approval.`
|
|
63
59
|
}
|
|
64
60
|
|
|
65
61
|
export function buildDeckPrompt({
|
|
@@ -70,48 +66,51 @@ export function buildDeckPrompt({
|
|
|
70
66
|
workspaceRoot?: string
|
|
71
67
|
}): string {
|
|
72
68
|
const state = exists
|
|
73
|
-
? `${DECKS_STATE_FILE} exists.
|
|
74
|
-
: `${DECKS_STATE_FILE} does not exist
|
|
69
|
+
? `${DECKS_STATE_FILE} exists as legacy/cache state. Do not treat it as workflow authority.`
|
|
70
|
+
: `${DECKS_STATE_FILE} does not exist. Continue from file-native narrative and deck-plan files.`
|
|
75
71
|
|
|
76
72
|
return `Begin Revela deck plan handoff.
|
|
77
73
|
|
|
78
74
|
Goal:
|
|
79
|
-
- Treat this as the explicit transition from
|
|
75
|
+
- Treat this as the explicit transition from canonical narrative state to user-directed deck planning.
|
|
80
76
|
- Use the deck-render prompt mode for design, layout, component, HTML, QA, and deck artifact rules.
|
|
81
|
-
- Default behavior is two-stage: first
|
|
77
|
+
- Default behavior is two-stage: first generate or update \`deck-plan/index.md\` plus \`deck-plan/slides/*.md\` with low-fidelity layout sketches and narrative wikilinks, then proceed only when the user chooses to continue.
|
|
82
78
|
- Every deck plan must include Cover, Table of Contents, and Closing slides. The TOC must show 3-5 chapter headings that match the deck's slide groups.
|
|
83
|
-
- Do not write or overwrite \`decks/*.html\` until the
|
|
84
|
-
- Do not treat legacy \`writeReadiness.status\`, old review snapshots, or existing HTML decks as
|
|
85
|
-
- Do not bypass the deck HTML contract,
|
|
79
|
+
- Do not write or overwrite \`decks/*.html\` until the user chooses to proceed from the current deck-plan projection.
|
|
80
|
+
- Do not treat legacy \`writeReadiness.status\`, old review snapshots, approval fields, or existing HTML decks as workflow permission.
|
|
81
|
+
- Do not bypass the deck HTML contract, source-trace expectations, or export preflight protections.
|
|
86
82
|
|
|
87
83
|
Current state:
|
|
88
84
|
- ${state}
|
|
89
85
|
${workspaceRoot ? `- Current workspace root: \`${workspaceRoot}\`` : ""}
|
|
90
86
|
|
|
91
87
|
Workflow:
|
|
92
|
-
1. Call \`revela-decks\` action \`read\` with \`summary: true
|
|
93
|
-
2. Call \`revela-decks\` action \`reviewNarrative\` before planning deck slides.
|
|
94
|
-
3. If the read summary returned \`markdownQa.blockers\` or \`vaultDiagnostics.blockers\`,
|
|
95
|
-
4.
|
|
96
|
-
5. If \`compileDeckPlan\` returns \`skipped\`,
|
|
97
|
-
6.
|
|
98
|
-
7.
|
|
99
|
-
8.
|
|
100
|
-
9.
|
|
101
|
-
10.
|
|
102
|
-
11. Call \`revela-decks\` action \`
|
|
103
|
-
12.
|
|
104
|
-
13.
|
|
105
|
-
|
|
88
|
+
1. Call \`revela-decks\` action \`read\` with \`summary: true\` when useful for vault diagnostics and canonical narrative projection.
|
|
89
|
+
2. Call \`revela-decks\` action \`reviewNarrative\` or compile narrative files to surface diagnostics before planning deck slides. Treat missing evidence, research gaps, and stale hashes as diagnostics, not permission blockers.
|
|
90
|
+
3. If the read summary returned \`markdownQa.blockers\` or \`vaultDiagnostics.blockers\`, report Markdown QA repair cards separately from compile diagnostics with file/node/code/message and smallest repair or suggested next action. These are data-integrity issues; ask the user whether to repair before proceeding.
|
|
91
|
+
4. Call \`revela-decks\` action \`compileDeckPlan\`. This returns a claim/evidence planning packet plus deck-plan authoring requirements; it must not write HTML and does not generate the final slide list. Do not infer render structure from \`DECKS.json.slides[]\`.
|
|
92
|
+
5. If \`compileDeckPlan\` returns \`skipped\`, report the reason and ask the user whether to continue manually, repair narrative files, or provide missing intent.
|
|
93
|
+
6. If target slide count, audience, language, output purpose, or visual style is unclear, ask the user for the smallest needed confirmation before writing the plan.
|
|
94
|
+
7. Write \`deck-plan/index.md\` and one file per planned slide under \`deck-plan/slides/*.md\` from the planning packet and requirements. The index must identify the chapter structure first: 3-5 chapter headings, each chapter's slide range, and which non-structural slides belong to each chapter. Each slide file must include frontmatter with positive 1-based \`slideIndex\` and \`## Narrative Links\` using plain wikilinks to canonical claim/evidence/risk/objection/gap ids. Include a low-fidelity ASCII/text layout sketch for every slide; do not generate visual images or HTML mockups.
|
|
95
|
+
8. Stop after presenting the plan unless the user already asked to proceed. Ask whether to continue, revise the plan, or run more research. Do not require an Approval block or \`confirmDeckPlan\` gate; \`confirmDeckPlan\` is compatibility/provenance only.
|
|
96
|
+
9. Ask for or confirm visual design only after the narrative deck plan exists. Fetch required design layouts/components with \`revela-designs read\` as needed.
|
|
97
|
+
10. Do not update cached \`DECKS.json\` slide specs for plan authoring. Use \`deck-plan/\` files and artifact files as the execution surface.
|
|
98
|
+
11. Call \`revela-decks\` action \`readDeckPlan\` before artifact review or HTML writing; use it to inspect the current deck-plan projection without regenerating it. Treat stale hashes, missing links, or incomplete coverage as advisory diagnostics unless the user asks to stop.
|
|
99
|
+
12. Run artifact diagnostics when useful, but do not treat \`writeReadiness\`, cached slide specs, unconfirmed plans, missing research, or stale coverage as workflow blockers.
|
|
100
|
+
13. Write \`decks/*.html\` when the user chooses to proceed and all deck HTML contract requirements can be satisfied. Generate the artifact chapter by chapter instead of drafting all content slides in one broad pass. Partial decks are allowed during chapter-by-chapter authoring when written slide sections have unique, increasing 1-based \`data-slide-index\` values and valid canvases; do not pad missing planned chapters with filler to match cached \`DECKS.json.slides[]\` length. Keep the HTML file valid after every write, preserve already-written slides, and update one chapter's slide sections at a time.
|
|
101
|
+
15. For each chapter, make every content slide carry a distinct claim, evidence item, comparison, risk, or action. If a chapter lacks enough substance for its allocated slides, merge weak slides or reduce the slide count instead of creating sparse filler.
|
|
102
|
+
16. After each HTML write, the system automatically runs artifact QA before opening Review. If post-write artifact QA reports hard errors, fix them and let QA run again. Review opens only after hard errors pass. Density warnings about thin claim/evidence substance should be reported and improved when useful, but they do not block Review.
|
|
106
103
|
|
|
107
104
|
Deck plan report format:
|
|
108
|
-
- Start with \`Deck plan:
|
|
105
|
+
- Start with \`Deck plan: drafted\` when the deck-plan projection has been written, or \`Deck plan: diagnostics\` when reporting \`readDeckPlan\` warnings.
|
|
109
106
|
- Include narrative readiness status and narrative hash when available.
|
|
110
|
-
- Include Markdown QA repair cards and vault diagnostic
|
|
111
|
-
- Include whether \`compileDeckPlan\`
|
|
107
|
+
- Include Markdown QA repair cards and vault diagnostic warnings when returned by \`read(summary: true)\`; user decides whether to repair before planning unless the file is malformed or unsafe to write.
|
|
108
|
+
- Include whether \`compileDeckPlan\` prepared the planning packet or skipped.
|
|
109
|
+
- Include the plan artifact paths \`deck-plan/index.md\` and \`deck-plan/slides/*.md\`, and explain that the LLM-authored plan is advisory render-layer projection state.
|
|
110
|
+
- Include the required Source Authority and remind that \`DECKS.json.slides[]\` is cache/compatibility data, not the render contract.
|
|
112
111
|
- Include \`Required structure: Cover + Table of Contents + Closing\` and do not omit any of those slides.
|
|
113
112
|
- Include a \`Chapters\` section before the slide list. It must list 3-5 TOC headings, their slide ranges, and the non-structural slides assigned to each chapter.
|
|
114
|
-
- For every slide, include: slide index, title, purpose, narrative role, low-fidelity layout sketch, layout, components, primary/supporting claim ids, evidence binding ids or source summary, visual intent,
|
|
113
|
+
- For every slide file, include: slide index, title, purpose, narrative role, low-fidelity layout sketch, layout, components, primary/supporting claim ids, evidence binding ids or source summary, visual intent, visual brief, caveats/unsupported scope, and \`## Narrative Links\`.
|
|
115
114
|
- Use this sketch style or similarly simple ASCII boxes:
|
|
116
115
|
|
|
117
116
|
\`\`\`text
|
|
@@ -133,29 +132,34 @@ Components:
|
|
|
133
132
|
Primary claim:
|
|
134
133
|
Supporting claims:
|
|
135
134
|
Evidence bindings:
|
|
135
|
+
Visual intent:
|
|
136
|
+
Visual brief:
|
|
136
137
|
Caveats / unsupported scope:
|
|
137
138
|
\`\`\`
|
|
138
|
-
- End by asking the user to
|
|
139
|
+
- End by asking the user whether to proceed to HTML, revise the plan, or run more research.
|
|
139
140
|
|
|
140
|
-
Report format before any HTML write
|
|
141
|
+
Report format before any HTML write:
|
|
141
142
|
- Start with \`Deck handoff: <status>\`.
|
|
142
|
-
- Include which
|
|
143
|
+
- Include which deck-plan projection and narrative hash are guiding artifact work.
|
|
144
|
+
- State that \`revela-decks readDeckPlan\` was called and the current \`deck-plan/\` Chapter Writing Batches are being followed.
|
|
143
145
|
- Include the chapter currently being generated and confirm already-written slides are being preserved.
|
|
144
|
-
- If
|
|
146
|
+
- If technical artifact checks cannot be satisfied, list those blockers separately from narrative/deck-plan diagnostics.
|
|
145
147
|
- After writing HTML, read the appended \`Artifact QA\` report from the tool output. If it failed, fix hard errors before considering the deck ready for Review.
|
|
146
148
|
|
|
147
149
|
Rules:
|
|
148
|
-
- \`compileDeckPlan\`
|
|
149
|
-
-
|
|
150
|
+
- \`compileDeckPlan\` prepares the canonical narrative claim/evidence packet and deck-plan requirements. The LLM authors \`deck-plan/index.md\` and \`deck-plan/slides/*.md\` from that packet and asks the user for page count, audience, language, output purpose, or visual style when unclear.
|
|
151
|
+
- \`deck-plan/\` is the execution blueprint for HTML generation when present. It must be read before writing HTML and followed chapter by chapter; \`DECKS.json.slides[]\` is compatibility/cache data, not the HTML slide-count authority.
|
|
152
|
+
- Visual intent is part of the deck-plan projection. During HTML generation, satisfy the planned component/visual brief using fetched design components; do not collapse planned visuals into prose-only bullets.
|
|
153
|
+
- Cached deck slide specs in \`DECKS.json\` are legacy projections only. Canonical narrative remains the authority for audience, decision, claims, evidence boundaries, objections, and risks.
|
|
150
154
|
- Cover, Table of Contents, and Closing are mandatory deck structure. TOC chapter headings must match the chapter grouping used for generation.
|
|
151
|
-
- Do not generate the complete deck content in one broad pass
|
|
152
|
-
- Applying evidence candidates
|
|
153
|
-
- If the user requests slide order, layout, component, or visual-intent changes that do not alter meaning, update only the deck projection
|
|
154
|
-
- If the user requests claim, evidence, caveat, decision, or recommendation meaning changes, update canonical narrative first
|
|
155
|
+
- Do not generate the complete deck content in one broad pass. Work chapter by chapter while keeping the artifact valid after each write.
|
|
156
|
+
- Applying evidence candidates or rewriting canonical claims requires explicit user instruction.
|
|
157
|
+
- If the user requests slide order, layout, component, or visual-intent changes that do not alter meaning, update only the \`deck-plan/\` projection or artifact-level plan content.
|
|
158
|
+
- If the user requests claim, evidence, caveat, decision, or recommendation meaning changes, update canonical narrative first, then report alignment diagnostics before compiling a new deck plan.
|
|
155
159
|
- Do not store secrets, credentials, tokens, or sensitive personal information.
|
|
156
160
|
- Artifact QA requires each slide to render exactly 1920x1080px, not merely any 16:9 ratio. It also checks component compliance, text overflow/clipping, page scrollbars, and whether normal QA-enabled content slides have enough claim/evidence/source substance.
|
|
157
161
|
|
|
158
|
-
Start now by reading
|
|
162
|
+
Start now by reading canonical narrative files, reporting diagnostics, compiling the planning packet, then writing or updating the \`deck-plan/\` projection with low-fidelity layout sketches and narrative wikilinks. Do not create ${DECKS_STATE_FILE} as workflow state.`
|
|
159
163
|
}
|
|
160
164
|
|
|
161
165
|
export function buildDeckReviewPrompt({
|
|
@@ -166,17 +170,17 @@ export function buildDeckReviewPrompt({
|
|
|
166
170
|
workspaceRoot?: string
|
|
167
171
|
}): string {
|
|
168
172
|
const state = exists
|
|
169
|
-
? `${DECKS_STATE_FILE} exists.
|
|
170
|
-
: `${DECKS_STATE_FILE} does not exist
|
|
173
|
+
? `${DECKS_STATE_FILE} exists as legacy/cache state. Do not treat it as workflow authority.`
|
|
174
|
+
: `${DECKS_STATE_FILE} does not exist. Review artifacts directly from files.`
|
|
171
175
|
|
|
172
176
|
return `Review Revela deck/artifact write readiness.
|
|
173
177
|
|
|
174
178
|
Goal:
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
- Do not
|
|
179
|
-
-
|
|
179
|
+
- Review the current deck artifact and \`deck-plan/\` projection directly. ${DECKS_STATE_FILE}, when present, is legacy/cache state only.
|
|
180
|
+
- When \`deck-plan/\` exists, treat it as the deck execution blueprint for slide order, chapter batches, visual intent, and evidence trace.
|
|
181
|
+
- Treat this as artifact diagnostics, not workflow permission. Narrative, research, and deck-plan gaps are warnings unless they are malformed/unsafe files.
|
|
182
|
+
- Do not create or update ${DECKS_STATE_FILE}; use file-native sources and explicit artifact paths.
|
|
183
|
+
- Use technical blockers only for missing/ambiguous deck files, invalid HTML contract, invalid slide identity, canvas/overflow/export failures, malformed vault frontmatter, or unsafe writes.
|
|
180
184
|
- Treat this as an evidence and Narrative Compiler readiness review, not only a checklist review: unsupported numbers, market sizing, recommendations, competitor comparisons, technical assertions, investment conclusions, missing audience belief change, unclear decision/action, unproven key claims, unhandled objections, weak so-what, missing risk/assumption handling, or abrupt narrative transitions should be made visible before writing.
|
|
181
185
|
- For substantial decision decks, use the read-only Task subagent \`revela-narrative-reviewer\` for independent rubric-based critique of narrative brief and slide-plan alignment. Do not self-certify semantic narrative quality in the primary agent.
|
|
182
186
|
- Treat \`revela-narrative-reviewer\` findings as advisory critique only. Do not represent them as \`revela-decks\` readiness issues, blockers, or authoritative \`writeReadiness\`.
|
|
@@ -196,53 +200,37 @@ Workspace boundary rules:
|
|
|
196
200
|
- For Glob/file searches, use the current workspace as the search root. Do not set the search root to a parent directory or home directory.
|
|
197
201
|
|
|
198
202
|
Workflow:
|
|
199
|
-
1.
|
|
200
|
-
2.
|
|
201
|
-
3.
|
|
202
|
-
4.
|
|
203
|
-
5. If a
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
11. Call \`revela-decks\` action \`review\`. The tool computes and writes \`writeReadiness\` plus structured readiness issues for the current workspace deck.
|
|
210
|
-
12. Briefly report whether the deck is ready. If blocked, list the exact blockers returned by the tool. If warnings exist, list them after blockers as residual risks; separate evidence/source warnings from narrative warnings when possible. If the read summary or review result includes \`markdownQa\`, \`vaultDiagnostics\`, or \`diagnosticReport\`, include \`Markdown QA\` and \`Vault diagnostics\` sections before artifact readiness with file/node/code/message and smallestRepair/suggestedAction. If the review result includes \`diagnostics\`, include a \`Plan and coverage diagnostics\` section with plan quality blockers/warnings, artifact \`coverageStatus\`, \`missingClaimIds\`, \`affectedClaimIds\`, stale reasons, and \`nextActions\`. If the review result includes \`evidenceCandidates\`, add a separate \`Candidate evidence bindings\` section with candidateId, slide index/title, supported claim scope, sourceKind, findingsFile/sourcePath, quote/snippet, caveat, evidenceDraft summary, unsupportedScope, and recommendedRewrite. Tell the user they may explicitly ask to apply selected candidate IDs; do not apply them during review. If candidates are absent but \`evidenceCandidateSearch\` is present, briefly report searched file counts and the best near misses so the user can tell whether review failed to search or searched but did not find a bindable match. If the reviewer returned findings, include them in a separate \`Narrative reviewer notes\` section and label them advisory.
|
|
211
|
-
|
|
212
|
-
Minimum conditions for \`ready\`:
|
|
213
|
-
- Topic, audience, slide count, language, and visual style/design are decided.
|
|
214
|
-
- Source materials have been identified or explicitly deemed unnecessary.
|
|
215
|
-
- Research need has been assessed.
|
|
216
|
-
- If research is needed, all relevant findings have been read and reflected in the slide specs.
|
|
217
|
-
- Read or done research findings are mapped into \`slides[].evidence[]\` where they support evidence-sensitive slide claims.
|
|
218
|
-
- The user has confirmed the slide plan.
|
|
219
|
-
- ${DECKS_STATE_FILE} contains per-slide specs with content, layout, components, and evidence where applicable.
|
|
220
|
-
- Evidence-sensitive slide claims have compact evidence references with source trace where available. Numeric claims and strong recommendations should not be unsupported or source-only when trace exists.
|
|
221
|
-
- Multi-slide decision decks have a practical narrative flow: context/tension before evidence, recommendations after support, risk or assumption handling when recommending action, and a clear so-what or ask at the end. Narrative gaps are normally warnings, not hard blockers.
|
|
222
|
-
- Substantial decision decks should have a compact \`narrativeBrief\` that states the intended audience belief change, required decision/action, key claims, likely objections, and risks/assumptions. Missing fields are narrative warnings, not hard blockers.
|
|
223
|
-
- The needed design layouts and components have been fetched with \`revela-designs read\`.
|
|
224
|
-
- No unresolved blockers remain.
|
|
203
|
+
1. Resolve the deck artifact from an explicit user path or discover \`decks/*.html\` when unambiguous.
|
|
204
|
+
2. Read \`deck-plan/\` with \`readDeckPlan\` when present and report stale hashes, missing links, missing coverage, or slide-index issues as diagnostics.
|
|
205
|
+
3. Run HTML contract and Artifact QA checks for the artifact when the user is preparing to write, review, or export.
|
|
206
|
+
4. Report evidence/source/narrative risks as diagnostics. Do not bind evidence, rewrite narrative, or update cached slide specs unless the user explicitly asks.
|
|
207
|
+
5. If a technical blocker exists, report the exact blocker and smallest repair. Otherwise say the user can proceed and list residual diagnostics.
|
|
208
|
+
|
|
209
|
+
Technical blockers only:
|
|
210
|
+
- Missing or ambiguous deck artifact path.
|
|
211
|
+
- Invalid HTML contract, slide identity, DOM order, canvas, overflow, or export failure.
|
|
212
|
+
- Malformed narrative/deck-plan Markdown/frontmatter or unsafe writes.
|
|
225
213
|
|
|
226
214
|
Report format:
|
|
227
|
-
- Start with \`
|
|
228
|
-
- If blocked, list each blocker with slide
|
|
229
|
-
- If warnings exist but
|
|
215
|
+
- Start with \`Artifact diagnostics: <status>\`.
|
|
216
|
+
- If technically blocked, list each blocker with file/slide when available, issue type, and smallest repair.
|
|
217
|
+
- If warnings exist but no technical blocker exists, say the user can proceed and note residual risks.
|
|
230
218
|
- Include coverage-driven make diagnostics when returned: whether the active deck artifact coverage is current/stale/partial/missing, which required claims are missing, which claims are affected, and the next command/action recommended by the tool.
|
|
231
219
|
- Report \`narrative_gap\` warnings as story-structure risks such as weak so-what, missing risk/assumption handling, conclusion before support, missing audience framing, or abrupt transition.
|
|
232
220
|
- Do not invent evidence or silently downgrade blockers. Use the tool result as authoritative.
|
|
233
221
|
- Do not convert \`revela-narrative-reviewer\` advisory findings into tool readiness issues. Keep them separate from \`revela-decks review\` blockers and warnings, and preserve the reviewer's stable finding IDs when reporting them.
|
|
234
222
|
- When reporting weak evidence, say whether the missing trace is \`findingsFile\`, \`sourcePath\`, \`location\`, \`quote\`, \`url\`, or \`caveat\` if that is clear from the reviewed materials.
|
|
235
223
|
- When reporting candidate evidence bindings, distinguish partial support from full-slide support. Never say a candidate supports unrelated future-state, recommendation, roadmap, or product-vision claims unless the candidate explicitly supports those claims.
|
|
236
|
-
- Treat \`evidenceDraft\` as a proposed record, not a mutation. Do not call \`upsertSlides\` to bind it. If the user asks to apply candidate bindings,
|
|
224
|
+
- Treat \`evidenceDraft\` as a proposed record, not a mutation. Do not call \`upsertSlides\` to bind it. If the user asks to apply candidate bindings, write \`revela-narrative/evidence/*.md\` directly with explicit source trace, then run \`compileNarrativeVault\`. Use \`upsertVaultEvidence\` only as a fallback helper when direct Markdown editing is unavailable or unsafe.
|
|
237
225
|
- When reporting candidate search diagnostics, do not present near misses as evidence. Say they are below binding threshold and use them only to explain why no candidate was returned.
|
|
238
226
|
- When reporting vault diagnostics, do not fill missing evidence, source trace, quotes, URLs, page references, or caveats from model memory. Preserve the blocker until the Markdown source is fixed and compiled.
|
|
239
227
|
|
|
240
228
|
Rules:
|
|
241
229
|
- Do not write or overwrite \`decks/*.html\` during review.
|
|
242
230
|
- Treat the workspace as one deck project. If the user wants another deck, tell them to use a separate workspace/folder.
|
|
243
|
-
- Do not write, patch, or
|
|
231
|
+
- Do not write, patch, or create ${DECKS_STATE_FILE} as workflow state.
|
|
244
232
|
- Do not store secrets, credentials, tokens, or sensitive personal information.
|
|
245
233
|
- Do not add inferred user preferences to long-term preference state.
|
|
246
234
|
|
|
247
|
-
Start now by
|
|
235
|
+
Start now by resolving the artifact path and reporting file-native artifact diagnostics.`
|
|
248
236
|
}
|
|
@@ -9,11 +9,12 @@ export type DeckHtmlContractIssueType =
|
|
|
9
9
|
| "file_not_found"
|
|
10
10
|
| "no_matching_deck_spec"
|
|
11
11
|
| "missing_slide_section"
|
|
12
|
-
| "
|
|
12
|
+
| "partial_deck"
|
|
13
|
+
| "extra_slide"
|
|
13
14
|
| "missing_data_slide_index"
|
|
14
15
|
| "invalid_data_slide_index"
|
|
15
16
|
| "duplicate_data_slide_index"
|
|
16
|
-
| "
|
|
17
|
+
| "slide_index_order"
|
|
17
18
|
| "legacy_data_index_noncanonical"
|
|
18
19
|
|
|
19
20
|
export interface DeckHtmlContractIssue {
|
|
@@ -95,15 +96,19 @@ export function validateDeckHtmlContract(workspaceRoot: string, filePath: string
|
|
|
95
96
|
return finalize(base)
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
if (sections.length !== base.expectedIndexes.length) {
|
|
99
|
-
base.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
if (base.expectedIndexes.length > 0 && sections.length !== base.expectedIndexes.length) {
|
|
100
|
+
const partial = sections.length < base.expectedIndexes.length
|
|
101
|
+
base.warnings.push({
|
|
102
|
+
type: partial ? "partial_deck" : "extra_slide",
|
|
103
|
+
severity: "warning",
|
|
104
|
+
message: partial
|
|
105
|
+
? `Deck HTML currently has ${sections.length} slide sections while the cached DECKS.json projection has ${base.expectedIndexes.length}. This is allowed during chapter-by-chapter authoring.`
|
|
106
|
+
: `Deck HTML has ${sections.length} slide sections while the cached DECKS.json projection has ${base.expectedIndexes.length}. Treat the cached slide projection as compatibility context, not the artifact source of truth.`,
|
|
103
107
|
})
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
const seen = new Set<number>()
|
|
111
|
+
let previousIndex = 0
|
|
107
112
|
sections.forEach((section, offset) => {
|
|
108
113
|
const expectedIndex = base.expectedIndexes[offset]
|
|
109
114
|
if (section.dataIndex !== undefined) {
|
|
@@ -150,16 +155,27 @@ export function validateDeckHtmlContract(workspaceRoot: string, filePath: string
|
|
|
150
155
|
}
|
|
151
156
|
seen.add(actualIndex)
|
|
152
157
|
|
|
153
|
-
if (
|
|
158
|
+
if (actualIndex <= previousIndex) {
|
|
154
159
|
base.issues.push({
|
|
155
|
-
type: "
|
|
160
|
+
type: "slide_index_order",
|
|
156
161
|
severity: "error",
|
|
157
|
-
message: `Slide ${section.position} has data-slide-index=${actualIndex}, but
|
|
162
|
+
message: `Slide ${section.position} has data-slide-index=${actualIndex}, but slide indexes must increase in DOM order.`,
|
|
158
163
|
slidePosition: section.position,
|
|
159
164
|
expectedIndex,
|
|
160
165
|
actualIndex,
|
|
161
166
|
})
|
|
162
167
|
}
|
|
168
|
+
previousIndex = actualIndex
|
|
169
|
+
|
|
170
|
+
if (base.expectedIndexes.length > 0 && !base.expectedIndexes.includes(actualIndex)) {
|
|
171
|
+
base.warnings.push({
|
|
172
|
+
type: "extra_slide",
|
|
173
|
+
severity: "warning",
|
|
174
|
+
message: `Slide ${section.position} has data-slide-index=${actualIndex}, which is not present in the cached DECKS.json slide projection.`,
|
|
175
|
+
slidePosition: section.position,
|
|
176
|
+
actualIndex,
|
|
177
|
+
})
|
|
178
|
+
}
|
|
163
179
|
})
|
|
164
180
|
|
|
165
181
|
return finalize(base)
|