# Generate Errata Flow Diagram

This file states the procedure for generating an HTML page that renders the `errata-submission` user flow specified in `errata-flow.md` as a Mermaid flowchart.

## Source and Output

- The procedure's single source for the flow is `errata-flow.md`. The procedure MUST derive every step node from that file's six numbered steps and MUST NOT inject any step the source file does not contain.

- The procedure produces a single output file named `errata-flow.html`, placed in the `artifacts/` subfolder. Before the file is written, the output MUST be registered in the File Registry — protocol `generated`, Instructions `gen-errata-flow.md`, Dependencies including `errata-flow.md`.

- The output file MUST NOT be hand-edited. To change the diagram, edit `errata-flow.md`; to change the rendering procedure, edit this file. Either way, rerun the procedure.

## HTML Document

- The output MUST be a single, self-contained HTML document. The page MUST render with no project-local assets — all runtime is either embedded inline or fetched from a public CDN.

- The Mermaid runtime MUST be loaded from the official Mermaid CDN via a `<script>` tag. Inline-bundling the Mermaid source MUST NOT be used; the CDN load is the required mechanism.

- The document MUST initialize Mermaid so the flowchart renders on page load without user interaction.

- The document MUST NOT contain any rationale text from `errata-flow.md`. Only step headline phrases and labels required by the diagram are permitted.

- The document MUST NOT make outbound network requests other than the single Mermaid CDN fetch. No analytics, no tracking pixels, no extra font fetches — the Mermaid CDN call is the only allowed outbound request.

## Mermaid Diagram

- The diagram MUST be a single `flowchart TD` block embedded in the document body.

- Each numbered step in `errata-flow.md` MUST appear as exactly one node. The node label MUST be the step's headline phrase — the text of the `### N. ...` heading minus the leading number and period — and MUST NOT include rationale.

- Sequential steps MUST be connected with default arrows (`-->`) in the order they appear in `errata-flow.md`.

- The branch inside Step 4 between "explanation only" and "explanation + proposed correction" MUST be drawn explicitly. Render it as two labeled arrows from the Step 4 node toward Step 5 (or via an intermediate decision node), with each arrow's label naming the case it represents.

- The handoff from the on-site portion of the flow to the off-site portion (the reader's email client) MUST be visually distinguished from the on-site nodes. Use one of:
  - A different Mermaid node shape for the email-client step and any subsequent off-site nodes (for example the stadium shape `([...])` for on-site and the cylinder `[(...)]` or subroutine `[[...]]` shape for off-site), with the rest of the diagram using a single consistent on-site shape; or
  - A labeled `subgraph` boundary grouping on-site steps under one label and off-site steps under another.

  The chosen mechanism MUST be applied consistently across the diagram, and the on-site/off-site distinction MUST be obvious to a reader without further explanation.
