@cyber-dash-tech/revela 0.17.1 → 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.
@@ -470,7 +470,7 @@ These rules are mandatory for Summit.
470
470
 
471
471
  ### Layout Types
472
472
 
473
- Each `<section class="slide">` must set `slide-qa="true"` or `slide-qa="false"`. It must also set `data-slide-index="N"`, where `N` is the 1-based `DECKS.json` `slides[].index` value. Use the QA column to decide which value to write. Fetch any layout with the `revela-designs` tool (`action: "read"`, `layout: "<name>"`).
473
+ Each `<section class="slide">` must set `slide-qa="true"` or `slide-qa="false"`. It must also set `data-slide-index="N"`, where `N` is the canonical positive 1-based artifact slide identity from the approved deck plan or DOM order. Indexes must be unique and strictly increase. Use the QA column to decide which `slide-qa` value to write. Fetch any layout with the `revela-designs` tool (`action: "read"`, `layout: "<name>"`).
474
474
 
475
475
  Normal `qa=true` content layouts should start with a slide-level title block unless the layout marker explicitly says otherwise. Use an eyebrow for chapter/section context, then an `h2` that states the slide's claim or takeaway. Body boxes, charts, media, tables, and text panels should sit below or beside that title region rather than replacing it.
476
476
 
@@ -29,8 +29,8 @@ export async function handleHelp(
29
29
  `**Workflow**\n\n` +
30
30
  `1. \`init\` — discover workspace sources and capture intent\n` +
31
31
  `2. \`research\` — close evidence gaps and bind support\n` +
32
- `3. \`story\` — inspect audience, thesis, claims, evidence, risks, and approval\n` +
33
- `4. \`make\` — generate deck or brief from approved story state\n` +
32
+ `3. \`story\` — inspect audience, thesis, claims, evidence, risks, and diagnostics\n` +
33
+ `4. \`make\` — generate deck or brief from canonical story state\n` +
34
34
  `5. \`review\` — comment on and inspect rendered deck artifacts\n` +
35
35
  `6. \`export\` — export deck artifacts to PDF or PPTX\n\n` +
36
36
  `---\n\n` +
@@ -41,8 +41,8 @@ export async function handleHelp(
41
41
  `\`/revela init\` — initialize or refresh workspace story state\n` +
42
42
  `\`/revela research\` — research, bind evidence, and reduce story gaps\n` +
43
43
  `\`/revela story [-l language]\` — open the read-only story workspace UI\n` +
44
- `\`/revela make --deck\` — make a deck from approved story state\n` +
45
- `\`/revela make --brief [file.md]\` — render executive brief from approved story\n` +
44
+ `\`/revela make --deck\` — make a deck from story state and deck-plan/\n` +
45
+ `\`/revela make --brief [file.md]\` — render executive brief from story state\n` +
46
46
  `\`/revela review --deck\` — open deck reading, insight, and comment workspace\n` +
47
47
  `\`/revela export --deck pdf [file.html]\` — export HTML deck to PDF\n` +
48
48
  `\`/revela export --deck pptx [file.html] [--notes]\` — export HTML deck to PPTX\n` +
@@ -8,16 +8,17 @@ export function buildInitPrompt({
8
8
  workspaceRoot?: string
9
9
  }): string {
10
10
  const mode = exists
11
- ? `A ${DECKS_STATE_FILE} file already exists. Read it first through the revela-decks tool and update it conservatively.`
12
- : `No ${DECKS_STATE_FILE} file exists yet. Initialize the Markdown narrative vault through the revela-decks tool before writing narrative meaning.`
11
+ ? `A ${DECKS_STATE_FILE} file already exists as legacy/cache state. Read it first through the revela-decks tool and update it conservatively only for compatibility metadata.`
12
+ : `No ${DECKS_STATE_FILE} file exists yet. Keep this workspace file-native: initialize the Markdown narrative vault before writing narrative meaning and do not create ${DECKS_STATE_FILE}.`
13
13
 
14
14
  return `Initialize Revela narrative workspace state.
15
15
 
16
16
  Goal:
17
- - Build or refresh ${DECKS_STATE_FILE} and the Markdown narrative vault from local workspace evidence.
17
+ - Initialize or refresh the Markdown narrative vault and file-native source inventory from local workspace evidence.
18
18
  - Treat init as repeatable ingest: discover files, register source materials, follow returned ingest task hints, and distill stable narrative meaning.
19
19
  - Capture primary audience, belief before/after, decision/action, thesis, central claims, evidence availability, objections, risks, source materials, artifact history, and open questions.
20
20
  - Do not treat initialization as permission to write a deck. Do not require slide count, visual style, design selection, output path, layout choices, or component choices unless the user explicitly asks to render.
21
+ - Treat central claims as chapter-ready claims, not evidence fragments: a central claim should be able to support framing/context, proof/evidence, decision implication, and explicit boundary/gap/risk material. If local material only supports a narrow fact, record it as supporting evidence or a supporting claim instead of promoting it to central importance.
21
22
 
22
23
  Current state:
23
24
  - ${mode}
@@ -32,7 +33,7 @@ Workspace boundary rules:
32
33
  - If the current workspace appears too broad, stop and ask the user which workspace subdirectory to initialize instead of scanning outside or deeply across everything.
33
34
 
34
35
  Expected tool use during init:
35
- - \`revela-decks init\` and \`revela-decks initNarrativeVault\` are expected controlled workspace-state/vault boundaries. Empty-looking optional fields in tool UI are a schema display artifact, not user-provided evidence.
36
+ - \`revela-decks init\` and \`revela-decks initNarrativeVault\` are expected controlled file-native/vault boundaries. In fresh workspaces they must not create ${DECKS_STATE_FILE}; if legacy state already exists, they may update compatibility metadata conservatively. Empty-looking optional fields in tool UI are a schema display artifact, not user-provided evidence.
36
37
  - Treat \`authoringContract\` returned by \`read(summary: true)\`, \`initNarrativeVault\`, or \`narrativeInventory\` as the Markdown authoring guide: valid node types, plain id convention, inline relation syntax, forbidden compatibility actions, and optional helper templates.
37
38
  - Treat \`markdownQa\` returned by \`read(summary: true)\`, \`compileNarrativeVault\`, or \`revela-decks markdownQa\` as post-authoring repair feedback that is separate from compiler diagnostics. Fix \`repairCards\` by smallest repair; do not invent missing claims, evidence, source paths, URLs, quotes, or caveats just to clear QA. If \`compileNarrativeVault\` output does not visibly include \`markdownQa\`, call \`revela-decks markdownQa\` before final reporting.
38
39
  - Before authoring claims, evidence, relations, objections, risks, or research gaps, inspect \`narrativeInventory\` from \`read(summary: true)\` or call \`revela-decks narrativeInventory\`. Reuse existing ids and relation targets. Do not invent evidence ids, claim ids, or relation targets before checking inventory unless you are intentionally creating the missing node in Markdown.
@@ -58,7 +59,7 @@ Required workflow:
58
59
  5. For selected relevant tasks, read directly when \`suggestedAction: "read_directly"\`; call \`revela-extract-document-materials\` first when \`suggestedAction: "extract_then_read"\`. Do not extract every document by default.
59
60
  6. Before writing narrative meaning, inspect \`narrativeInventory\` from the latest \`read(summary: true)\` result or call \`revela-decks narrativeInventory\`. Then distill stable findings into \`revela-narrative/**/*.md\` using the Markdown authoring guide. Completeness is not a gate: write partial claims, caveats, unsupported scope, and research gaps rather than waiting for a complete story. Use optional helpers such as \`upsertVaultResearchGap\`, \`upsertVaultEvidence\`, or \`bindResearchFindings\` only when they fit the exact update. Preserve frontmatter ids and existing section headings when editing Markdown. Write nodes first; add inline \`## Relations\` edges afterward only when explicit.
60
61
  7. After Markdown changes, rely on the vault write hook or call \`revela-decks markdownQa\`, then \`revela-decks compileNarrativeVault\`; keep \`markdownQa.repairCards\` separate from compiler blockers and fix both before treating the narrative as usable. If no explicit \`markdownQa\` result is visible after compile, call \`revela-decks markdownQa\` as a manual fallback. Do not use \`upsertNarrative\`.
61
- 8. If explicit deck/artifact information exists, record conservative deck specs only from visible information. Do not infer hidden evidence from generated artifacts.
62
+ 8. If explicit deck/artifact information exists, record conservative artifact context in file-native outputs or existing compatibility state only from visible information. Do not infer hidden evidence from generated artifacts.
62
63
  9. Report initialized/updated/migrated state plus counts and paths for added, changed, newer-than-vault, unchanged, \`ingest.ingestCandidates\`, and \`ingest.suggestedTasks\`. Always include \`Markdown QA: clean\` or \`Markdown QA blockers:\` in the final report. If Markdown QA blockers remain, do not say the workspace initialized cleanly; say the vault was initialized but Markdown repairs remain.
63
64
 
64
65
  Evidence boundary:
@@ -67,6 +68,7 @@ Evidence boundary:
67
68
  - Preserve graph meaning by writing explicit edges in node-local \`## Relations\` sections after nodes exist. Use plain node-id wikilinks and optional inline rationale.
68
69
  - Intent briefs, proposals, and user-authored plans may support audience, decision, thesis, stakeholder framing, and stated internal intent. They do not by themselves prove market size, competitor performance, product-market fit, operating-model effectiveness, or external factual claims.
69
70
  - If a source states an intended strategy but not its external factual basis, record the strategy as a claim with partial or missing support and add a research gap instead of binding it as strong evidence.
71
+ - If a central claim cannot yet sustain a future claim-led chapter, keep the insufficiency visible through evidence status, unsupported scope, caveats, or a research gap rather than padding the future deck with generic slides.
70
72
  - A successful vault compile means the vault is structurally valid. It is not evidence readiness, narrative approval, or permission to make a deck/brief.
71
73
 
72
74
  Narrative questions to ask only when missing:
@@ -80,11 +82,11 @@ Narrative questions to ask only when missing:
80
82
  - What objections, risks, assumptions, or caveats could break the argument?
81
83
 
82
84
  Memory rules:
83
- - Only write facts supported by workspace files or explicit user statements into ${DECKS_STATE_FILE} workspace state, source materials, narrative compatibility fields, deck memory, and open questions.
85
+ - Only write facts supported by workspace files or explicit user statements into file-native narrative/source files or, when ${DECKS_STATE_FILE} already exists, conservative compatibility metadata such as source materials, deck memory, and open questions.
84
86
  - Only write user preferences if the user explicitly stated that Revela should remember them.
85
87
  - Do not infer personal preferences from one-off requests.
86
88
  - Do not store secrets, credentials, API keys, tokens, account details, or sensitive personal information.
87
- - Do not mark narrative approval, render override, or writeReadiness as ready during init.
89
+ - Do not create or update approval, render override, or writeReadiness workflow state during init.
88
90
  - Treat this workspace as a single deck project. If the user wants another deck, guide them to create another workspace/folder rather than adding a second deck record.
89
91
  - If new evidence conflicts with existing memory, preserve both briefly and add an Open Question instead of silently overwriting.
90
92
 
@@ -7,12 +7,11 @@
7
7
  * Example: decks/my-deck.html → decks/my-deck.pdf
8
8
  */
9
9
 
10
+ import { existsSync, readdirSync } from "fs"
10
11
  import { resolve } from "path"
11
- import { hasDecksState, readDecksState } from "../decks-state"
12
12
  import { exportToPdf } from "../pdf/export"
13
13
  import { assertExportQAPassed } from "../qa/export-gate"
14
14
  import { recordRenderedArtifact, workspaceRelative } from "../workspace-state/rendered-artifacts"
15
- import { resolveActiveHtmlDeckPath } from "../workspace-state/render-targets"
16
15
 
17
16
  export async function handlePdf(
18
17
  filePath: string,
@@ -22,15 +21,15 @@ export async function handlePdf(
22
21
  const root = resolve(workspaceRoot)
23
22
  const resolvedFile = resolvePdfDeckFile(root, filePath)
24
23
 
25
- if (!resolvedFile) {
24
+ if (!resolvedFile.ok) {
26
25
  await send(
27
- "**Usage:** `/revela export --deck pdf [file_path]`\n\n" +
28
- "Example: `/revela export --deck pdf decks/my-deck.html`"
26
+ `**PDF export cannot start**\n\n${resolvedFile.error}\n\n` +
27
+ "Usage: `/revela export --deck pdf [file_path]`"
29
28
  )
30
29
  return
31
30
  }
32
31
 
33
- const abs = resolvedFile.absoluteFile
32
+ const abs = resolvedFile.deck.absoluteFile
34
33
  await send(`Running pre-export QA for \`${abs}\`...`)
35
34
 
36
35
  try {
@@ -38,7 +37,7 @@ export async function handlePdf(
38
37
  await send(`Exporting \`${abs}\` to PDF...`)
39
38
  const result = await exportToPdf(abs)
40
39
  recordRenderedArtifact(root, {
41
- sourceHtmlPath: resolvedFile.file,
40
+ sourceHtmlPath: resolvedFile.deck.file,
42
41
  outputPath: result.outputPath,
43
42
  type: "pdf",
44
43
  actor: "revela-pdf",
@@ -56,17 +55,27 @@ export async function handlePdf(
56
55
  }
57
56
  }
58
57
 
59
- function resolvePdfDeckFile(workspaceRoot: string, filePath: string): { file: string; absoluteFile: string } | undefined {
58
+ function resolvePdfDeckFile(workspaceRoot: string, filePath: string): { ok: true; deck: { file: string; absoluteFile: string } } | { ok: false; error: string } {
60
59
  const explicit = filePath.trim()
61
60
  if (explicit) {
62
61
  const absoluteFile = resolve(workspaceRoot, explicit)
63
- return { file: workspaceRelative(workspaceRoot, absoluteFile), absoluteFile }
62
+ if (!existsSync(absoluteFile)) return { ok: false, error: `Deck HTML not found: ${explicit}` }
63
+ if (!/\.html?$/i.test(absoluteFile)) return { ok: false, error: `File must be an HTML file: ${explicit}` }
64
+ return { ok: true, deck: { file: workspaceRelative(workspaceRoot, absoluteFile), absoluteFile } }
64
65
  }
65
66
 
66
- if (!hasDecksState(workspaceRoot)) return undefined
67
- const state = readDecksState(workspaceRoot)
68
- const activePath = resolveActiveHtmlDeckPath(state)
69
- if (!activePath) return undefined
70
- const absoluteFile = resolve(workspaceRoot, activePath)
71
- return { file: workspaceRelative(workspaceRoot, absoluteFile), absoluteFile }
67
+ const htmlFiles = listDeckHtmlFiles(workspaceRoot)
68
+ if (htmlFiles.length === 0) return { ok: false, error: "No deck HTML found in decks/. Pass a file path or generate a deck first." }
69
+ if (htmlFiles.length > 1) return { ok: false, error: `Multiple deck HTML files found in decks/: ${htmlFiles.join(", ")}. Pass the deck path explicitly.` }
70
+ const absoluteFile = resolve(workspaceRoot, htmlFiles[0])
71
+ return { ok: true, deck: { file: workspaceRelative(workspaceRoot, absoluteFile), absoluteFile } }
72
+ }
73
+
74
+ function listDeckHtmlFiles(workspaceRoot: string): string[] {
75
+ const dir = resolve(workspaceRoot, "decks")
76
+ if (!existsSync(dir)) return []
77
+ return readdirSync(dir, { withFileTypes: true })
78
+ .filter((entry) => entry.isFile() && entry.name.toLowerCase().endsWith(".html"))
79
+ .map((entry) => `decks/${entry.name}`)
80
+ .sort((a, b) => a.localeCompare(b))
72
81
  }
@@ -9,11 +9,9 @@
9
9
 
10
10
  import { existsSync, readdirSync } from "fs"
11
11
  import { relative, resolve, sep } from "path"
12
- import { hasDecksState, isDeckHtmlPath, readDecksState } from "../decks-state"
13
12
  import { assertDeckHtmlContractValid } from "../deck-html/contract"
14
13
  import { exportToPptx } from "../pptx/export"
15
14
  import { recordRenderedArtifact } from "../workspace-state/rendered-artifacts"
16
- import { resolveActiveHtmlDeckPath } from "../workspace-state/render-targets"
17
15
 
18
16
  export interface PptxArgs {
19
17
  filePath: string
@@ -23,7 +21,7 @@ export interface PptxArgs {
23
21
  export interface ResolvedPptxDeck {
24
22
  file: string
25
23
  absoluteFile: string
26
- source: "render-target" | "decks-state" | "fallback" | "file-path"
24
+ source: "discovered" | "file-path"
27
25
  }
28
26
 
29
27
  function formatSecs(ms: number): string {
@@ -47,18 +45,6 @@ export function resolvePptxDeck(workspaceRoot: string, filePath = ""): ResolvedP
47
45
  return { file: workspaceRelative(root, absoluteFile), absoluteFile, source: "file-path" }
48
46
  }
49
47
 
50
- if (hasDecksState(root)) {
51
- const state = readDecksState(root)
52
- const outputPath = resolveActiveHtmlDeckPath(state)
53
- if (outputPath && isDeckHtmlPath(outputPath)) {
54
- const absoluteFile = resolve(root, outputPath)
55
- if (existsSync(absoluteFile)) {
56
- const source = state.renderTargets.some((target) => target.type === "html_deck" && target.outputPath === outputPath) ? "render-target" : "decks-state"
57
- return { file: workspaceRelative(root, absoluteFile), absoluteFile, source }
58
- }
59
- }
60
- }
61
-
62
48
  const htmlFiles = listDeckHtmlFiles(root)
63
49
  if (htmlFiles.length === 0) {
64
50
  throw new Error("No deck HTML found in decks/. Generate a deck first or pass a file path.")
@@ -68,7 +54,7 @@ export function resolvePptxDeck(workspaceRoot: string, filePath = ""): ResolvedP
68
54
  }
69
55
 
70
56
  const absoluteFile = resolve(root, htmlFiles[0])
71
- return { file: workspaceRelative(root, absoluteFile), absoluteFile, source: "fallback" }
57
+ return { file: workspaceRelative(root, absoluteFile), absoluteFile, source: "discovered" }
72
58
  }
73
59
 
74
60
  export function buildPptxNotesPrompt(deck: ResolvedPptxDeck): string {
@@ -16,6 +16,7 @@ export function buildResearchPrompt({
16
16
  Goal:
17
17
  - Reduce open gaps, unsupported scope, weak evidence, unattached findings, and overextended relation rationale for the current story.
18
18
  - Drive research from canonical narrative gaps: unsupported central claims, objections, risks, decision questions, explicit researchGaps, and claim_chain_gap warnings.
19
+ - Drive research from central-claim chapter sufficiency, not only missing proof. Each central claim should aim for framing/background support, one or two bound evidence items or cases/quantitative signals, and implication/risk/boundary material before it is treated as deck-ready.
19
20
  - Treat /revela research as authorization to bind clearly supported findings through the safe \`bindResearchFindings\` boundary without asking for item-by-item user confirmation.
20
21
  - Preserve evidence boundaries: eliminate caveats only when evidence or narrower wording actually resolves them; otherwise keep precise caveats visible.
21
22
  - Do not write decks, briefs, or design artifacts during research.
@@ -50,6 +51,7 @@ Allowed mutations:
50
51
 
51
52
  Binding criteria:
52
53
  - supported claim id exists and is expressed as \`## Relations\` with \`- supports: [[claim-id]]\` for new evidence; quote/snippet is traceable and not invented; source URL/path/findingsFile is present; supportScope and unsupportedScope are explicit; caveat is preserved; strength is strong or useful partial; binding does not expand the claim. Frontmatter \`claimId\` is compatibility fallback, not the preferred graph source.
54
+ - For central claims, prefer evidence that helps one of the future chapter jobs: framing/background, proof/case/quantitative signal, or implication/risk/boundary. If research only finds a weak context fact, bind or record it narrowly and keep the chapter sufficiency gap open.
53
55
 
54
56
  Stop conditions:
55
57
  - No open externally researchable gaps remain.
@@ -8,21 +8,19 @@ export function buildReviewPrompt({
8
8
  workspaceRoot?: string
9
9
  }): string {
10
10
  const state = exists
11
- ? `${DECKS_STATE_FILE} exists. Read it through the revela-decks tool.`
12
- : `${DECKS_STATE_FILE} does not exist yet. Create or normalize it through the revela-decks tool only if there is enough workspace narrative context.`
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
- - Use ${DECKS_STATE_FILE} as the compatibility workspace-state file, but review the canonical narrative state first: audience, belief shift, decision/action, thesis, central claims, evidence boundaries, objections, risks, and approval state.
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
- - Do not write, patch, or directly edit ${DECKS_STATE_FILE}. Use the \`revela-decks\` tool for all state changes.
20
- - Call \`revela-decks\` action \`reviewNarrative\` as the authoritative deterministic readiness engine.
21
- - Do not call \`revela-decks\` action \`review\` here. That action is the deck/artifact gate inside \`/revela make --deck\` after the deck plan is confirmed.
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
- - If the narrative is \`ready_for_approval\`, ask whether the user wants to approve it or revise it. Do not approve automatically.
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. Call \`revela-decks\` with action \`read\` and \`summary: true\` to inspect the current workspace state, \`vaultDiagnostics\`, \`markdownQa\`, and \`narrativeInventory\` when a vault exists.
39
- 2. If ${DECKS_STATE_FILE} is missing or empty, 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.
40
- 3. If legacy deck state exists, let the tool-normalized canonical narrative derived from \`narrativeBrief\`, slide roles, slide content, and slide evidence be reviewed. Do not assume old deck readiness means approval.
41
- 4. Call \`revela-decks\` action \`reviewNarrative\`. Use its returned \`status\`, \`blockers\`, \`warnings\`, \`issues\`, \`narrativeHash\`, \`approval\`, and \`nextActions\` as authoritative. If the read summary returned \`markdownQa.repairCards\` or \`vaultDiagnostics\`, report Markdown QA repair cards and compile diagnostics before readiness blockers and include file/node/code/message plus smallest repair or suggested next action.
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. If approval is missing or stale, clearly distinguish \`ready_for_approval\`, \`approved\`, and render override.
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
- - If blocked or needs research, list each blocker with issue type, claim text when available, and suggested next action. Keep Markdown QA repair cards separate from compiler diagnostics and narrative readiness blockers.
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} through \`revela-decks\`, then call \`revela-decks\` action \`reviewNarrative\`.`
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,49 +66,51 @@ export function buildDeckPrompt({
70
66
  workspaceRoot?: string
71
67
  }): string {
72
68
  const state = exists
73
- ? `${DECKS_STATE_FILE} exists. Read it through the revela-decks tool.`
74
- : `${DECKS_STATE_FILE} does not exist yet. Do not invent a deck; initialize narrative state first with /revela init.`
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 approved narrative state to user-confirmed deck planning.
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 show the compiled deck plan with low-fidelity layout sketches, then stop for user confirmation before any artifact review or HTML writing.
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 narrative handoff, explicit user deck-plan confirmation, and deck/artifact gate are all satisfied.
84
- - Do not treat legacy \`writeReadiness.status\`, old review snapshots, or existing HTML decks as narrative approval.
85
- - Do not bypass the deck HTML contract, review snapshot freshness, source-trace expectations, or export preflight protections.
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\`, stop before deck planning and report Markdown QA repair cards separately from compile diagnostics with file/node/code/message and smallest repair or suggested next action. If narrative readiness is \`approved\`, continue. If it is \`ready_for_approval\`, ask the user for explicit approval before continuing. If it is blocked, stale, or needs research, stop and report the smallest next action. Do not call \`approveNarrative\` unless the user explicitly approves or requests a render override.
95
- 4. After approval or explicit render override exists, call \`revela-decks\` action \`compileDeckPlan\`. This projects canonical narrative claims and evidence bindings into compatibility \`slides[]\` and \`slides[].evidence[]\`; it must not write HTML.
96
- 5. If \`compileDeckPlan\` returns \`skipped\`, stop and report the reason. Do not invent slide specs manually to bypass approval.
97
- 6. Treat each compiled slide's \`visuals[]\` and \`content.data.visualIntent\` as required render instructions, not optional decoration. Do not downgrade a planned chart, metric card, evidence table, comparison grid, risk matrix, steps view, or media brief into generic bullets unless the plan is revised and reconfirmed.
98
- 7. Present the compiled deck plan to the user and include a low-fidelity layout sketch for every slide. The plan must identify the chapter structure first: 3-5 chapter headings, each chapter's slide range, and which non-structural slides belong to each chapter. The sketch is ASCII/text structure only; do not generate visual images or HTML mockups.
99
- 8. Stop after presenting the plan. Ask the user to confirm or request changes. Do not call \`revela-decks review\`, do not fetch design context, and do not write HTML in the same turn unless the user had already explicitly confirmed the current plan before this command.
100
- 9. Only after explicit user confirmation of the current slide plan, call \`revela-decks\` action \`confirmDeckPlan\` with \`approvalBy=user\` and a compact \`approvalNote\`.
101
- 10. After confirmation is recorded, ask for or confirm visual design only after the narrative deck plan exists. Fetch required design layouts/components with \`revela-designs read\` as needed.
102
- 11. Update only deck/artifact metadata through \`revela-decks upsertDeck\` / \`upsertSlides\` when required by confirmed design/layout choices. Do not change canonical narrative claims unless the user asks to revise the narrative.
103
- 12. Call \`revela-decks\` action \`review\` as the artifact gate. It computes \`writeReadiness\` and review snapshots for deck HTML writing. If it reports \`slide_plan_unconfirmed\`, stop and ask for explicit deck-plan confirmation.
104
- 13. Write \`decks/*.html\` only if the deck/artifact gate is ready 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. Keep the HTML file valid after every write, preserve already-written slides, and update one chapter's slide sections at a time.
105
- 14. 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.
106
- 15. 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.
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.
107
103
 
108
104
  Deck plan report format:
109
- - Start with \`Deck plan: awaiting confirmation\` when a plan was compiled and has not yet been confirmed.
105
+ - Start with \`Deck plan: drafted\` when the deck-plan projection has been written, or \`Deck plan: diagnostics\` when reporting \`readDeckPlan\` warnings.
110
106
  - Include narrative readiness status and narrative hash when available.
111
- - Include Markdown QA repair cards and vault diagnostic blockers or warnings when returned by \`read(summary: true)\`; blockers prevent deck planning until fixed.
112
- - Include whether \`compileDeckPlan\` compiled or skipped.
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.
113
111
  - Include \`Required structure: Cover + Table of Contents + Closing\` and do not omit any of those slides.
114
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.
115
- - 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 from \`content.data.visualIntent\`, visual brief from \`visuals[]\`, and caveats/unsupported scope.
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\`.
116
114
  - Use this sketch style or similarly simple ASCII boxes:
117
115
 
118
116
  \`\`\`text
@@ -138,28 +136,30 @@ Visual intent:
138
136
  Visual brief:
139
137
  Caveats / unsupported scope:
140
138
  \`\`\`
141
- - End by asking the user to confirm the deck plan or request changes.
139
+ - End by asking the user whether to proceed to HTML, revise the plan, or run more research.
142
140
 
143
- Report format before any HTML write after confirmation:
141
+ Report format before any HTML write:
144
142
  - Start with \`Deck handoff: <status>\`.
145
- - Include which user-confirmed plan, approved narrative hash, and deck review snapshot authorized the artifact work.
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.
146
145
  - Include the chapter currently being generated and confirm already-written slides are being preserved.
147
- - If deck/artifact review is blocked, list blockers separately from narrative blockers.
146
+ - If technical artifact checks cannot be satisfied, list those blockers separately from narrative/deck-plan diagnostics.
148
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.
149
148
 
150
149
  Rules:
151
- - \`compileDeckPlan\` is the canonical narrative-to-deck planning path. Do not manually invent slide specs to avoid it.
152
- - Visual intent is part of the confirmed plan. During HTML generation, satisfy the planned component/visual brief using fetched design components; do not collapse planned visuals into prose-only bullets.
153
- - Deck slide specs are render-target projections. Canonical narrative remains the authority for audience, decision, claims, evidence boundaries, objections, risks, and approval.
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.
154
154
  - Cover, Table of Contents, and Closing are mandatory deck structure. TOC chapter headings must match the chapter grouping used for generation.
155
- - Do not generate the complete deck content in one broad pass after confirmation. Work chapter by chapter while keeping the artifact valid after each write.
156
- - Applying evidence candidates, rewriting canonical claims, or approving narratives 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 projection through \`upsertSlides\` and present the revised plan for confirmation.
158
- - If the user requests claim, evidence, caveat, decision, or recommendation meaning changes, update canonical narrative first and rerun narrative review/approval or explicit render override before compiling a new deck plan.
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.
159
159
  - Do not store secrets, credentials, tokens, or sensitive personal information.
160
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.
161
161
 
162
- Start now by reading ${DECKS_STATE_FILE}, reviewing narrative readiness, compiling the deck plan only if approval or explicit render override is current, then showing the deck plan with low-fidelity layout sketches and stopping for user confirmation.`
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.`
163
163
  }
164
164
 
165
165
  export function buildDeckReviewPrompt({
@@ -170,17 +170,17 @@ export function buildDeckReviewPrompt({
170
170
  workspaceRoot?: string
171
171
  }): string {
172
172
  const state = exists
173
- ? `${DECKS_STATE_FILE} exists. Read it through the revela-decks tool.`
174
- : `${DECKS_STATE_FILE} does not exist yet. Create it through the revela-decks tool if there is enough deck context.`
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.`
175
175
 
176
176
  return `Review Revela deck/artifact write readiness.
177
177
 
178
178
  Goal:
179
- - Use ${DECKS_STATE_FILE} as the source of truth for whether the current workspace deck is ready to be written to \`decks/*.html\`.
180
- - Treat this as an artifact gate for deck rendering, not strategic narrative approval. Narrative readiness is reviewed through \`/revela story\`.
181
- - Preserve the deck spec for future sessions: every slide's content, layout, components, evidence, visuals, production status, and the 0.9 narrative compiler brief when available.
182
- - Do not write, patch, or directly edit ${DECKS_STATE_FILE}. Use the \`revela-decks\` tool for all state changes.
183
- - Let \`revela-decks\` action \`review\` compute writeReadiness; do not manually set readiness to ready.
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.
184
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.
185
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.
186
186
  - Treat \`revela-narrative-reviewer\` findings as advisory critique only. Do not represent them as \`revela-decks\` readiness issues, blockers, or authoritative \`writeReadiness\`.
@@ -200,53 +200,37 @@ Workspace boundary rules:
200
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.
201
201
 
202
202
  Workflow:
203
- 1. Call \`revela-decks\` with action \`read\` and \`summary: true\` for the current workspace deck and any \`markdownQa\`, \`vaultDiagnostics\`, and \`narrativeInventory\`.
204
- 2. If the read summary returned \`markdownQa.blockers\` or \`vaultDiagnostics.blockers\`, report Markdown QA repair cards separately from compile diagnostics before artifact readiness with file/node/code/message and smallestRepair/suggestedAction; stop before \`revela-decks review\`, deck HTML writes, or export guidance until the blocker is fixed.
205
- 3. If no current deck exists but the conversation contains enough deck context, call \`revela-decks\` action \`upsertDeck\` with goal, outputPath, theme, requiredInputs, researchPlan, and narrativeBrief if the story intent is clear. Do not invent or ask for a deck key; the tool uses the workspace folder name internally.
206
- 4. If \`researchPlan[].status\` is \`done\` or \`read\` and \`researchPlan[].findingsFile\` exists, verify that evidence-sensitive slide claims are backed by compact \`slides[].evidence[]\` records that reference the relevant findings file or source material where known. The review tool may surface conservative \`evidenceCandidates\` for missing evidence by matching slide text against those findings files, and may fall back to bounded workspace \`researches/**/*.md\` discovery when the research plan has no matching findings file; report these as candidate bindings, not as already-bound evidence.
207
- 5. If a user-confirmed slide plan is available, call \`revela-decks\` action \`upsertSlides\` with every slide's title, purpose, narrativeRole, layout, components, structured content, evidence, visuals, and status. Use only lightweight narrativeRole values that are clear from the plan: \`context\`, \`tension\`, \`evidence\`, \`recommendation\`, \`risk\`, \`ask\`, \`appendix\`, or \`close\`.
208
- 6. Prefer evidence records with \`findingsFile\`, \`sourcePath\`, \`location\`, \`quote\`, \`url\`, \`caveat\`, \`extractedTextPath\`, or \`extractedManifestPath\` when those fields are known from research files or extracted workspace materials.
209
- 7. Do not invent quotes, page references, locations, URLs, caveats, or extraction paths. If source trace is missing, preserve the blocker or warning and report exactly what trace is needed.
210
- 8. Only set requiredInputs fields true when explicit conversation state, files read, research findings read, selected design, fetched layouts/components, or user confirmation supports them. Do not infer completion.
211
- 9. For substantial decision decks, preserve a compact \`narrativeBrief\` through \`upsertDeck\` when the conversation or confirmed plan supports it. Do not invent stakeholder beliefs, objections, or risks; leave gaps visible if unknown.
212
- 10. For substantial decision decks, launch the Task subagent with \`subagent_type: "revela-narrative-reviewer"\` after deck/slides are up to date. Ask it to read the current \`DECKS.json\`, run only its fixed rubric, use stable finding IDs, return \`Findings: none\` when all checks pass, and avoid optional pre-write improvements. Do not ask it to write state, call \`revela-decks review\`, or produce HTML.
213
- 11. Call \`revela-decks\` action \`review\`. The tool computes and writes \`writeReadiness\` plus structured readiness issues for the current workspace deck.
214
- 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.
215
-
216
- Minimum conditions for \`ready\`:
217
- - Topic, audience, slide count, language, and visual style/design are decided.
218
- - Source materials have been identified or explicitly deemed unnecessary.
219
- - Research need has been assessed.
220
- - If research is needed, all relevant findings have been read and reflected in the slide specs.
221
- - Read or done research findings are mapped into \`slides[].evidence[]\` where they support evidence-sensitive slide claims.
222
- - The user has confirmed the slide plan.
223
- - ${DECKS_STATE_FILE} contains per-slide specs with content, layout, components, and evidence where applicable.
224
- - 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.
225
- - 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.
226
- - 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.
227
- - The needed design layouts and components have been fetched with \`revela-designs read\`.
228
- - 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.
229
213
 
230
214
  Report format:
231
- - Start with \`Ready: yes/no\`.
232
- - If blocked, list each blocker with slide index/title when the tool provides it, the issue type, and the suggested next action.
233
- - If warnings exist but the deck is otherwise ready, say the deck can be written but note the residual risks.
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.
234
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.
235
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.
236
220
  - Do not invent evidence or silently downgrade blockers. Use the tool result as authoritative.
237
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.
238
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.
239
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.
240
- - Treat \`evidenceDraft\` as a proposed record, not a mutation. Do not call \`upsertSlides\` to bind it. If the user asks to apply candidate bindings, use \`initNarrativeVault\` if needed, 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.
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.
241
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.
242
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.
243
227
 
244
228
  Rules:
245
229
  - Do not write or overwrite \`decks/*.html\` during review.
246
230
  - Treat the workspace as one deck project. If the user wants another deck, tell them to use a separate workspace/folder.
247
- - Do not write, patch, or directly edit ${DECKS_STATE_FILE}; use \`revela-decks\`.
231
+ - Do not write, patch, or create ${DECKS_STATE_FILE} as workflow state.
248
232
  - Do not store secrets, credentials, tokens, or sensitive personal information.
249
233
  - Do not add inferred user preferences to long-term preference state.
250
234
 
251
- Start now by reading ${DECKS_STATE_FILE} through \`revela-decks\`.`
235
+ Start now by resolving the artifact path and reporting file-native artifact diagnostics.`
252
236
  }