axstack 0.75.0 → 0.76.0

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.
@@ -82,8 +82,12 @@ Preserve this phase's independent source/fact and exact-byte review requirements
82
82
  ## 2. Choose proportional output
83
83
 
84
84
  Explain owns evidence gathering, claim labels, the 700-word cap, dispatch, and delivery.
85
- Choose the best visual for the concept: flowchart, sequence, state, architecture
86
- map, timeline, comparison or bespoke SVG are examples, not a taxonomy.
85
+ Use a diagram whenever it can show the structure being explained.
86
+ Use Mermaid for every Explain diagram unless the user explicitly requests a
87
+ different drawing format.
88
+ For diagrams, follow [Mermaid](references/mermaid.md).
89
+ Quantitative charts that need true scales follow Neon's evidence-graphics rules.
90
+ Anatomy figures follow the explicit-request path below.
87
91
  Follow [Fidelity](references/fidelity.md) for every visual.
88
92
  For whole-work understanding or defense, follow [Whiteboard defense](references/whiteboard-defense.md).
89
93
  For architecture and system-map diagram requests, follow [Architecture diagrams](references/architecture-diagram.md).
@@ -104,10 +108,8 @@ Explicitly requested standalone HTML files keep their existing review and Visual
104
108
  Non-anatomy standalone HTML files also get exact-byte design review in the dark Neon theme or an explicit user theme.
105
109
  Plain-prose answers stay driver-written; other phases retain their own Mermaid
106
110
  owners, and README/docs diagram edits go through Implement under these rules.
107
- Use inline SVG or CSS inside inline pages. Never use Mermaid in inline pages.
108
- Use Mermaid for chat, GitHub, and docs.
109
- Include `accTitle` and `accDescr` in each Mermaid view.
110
- Never use theme init in Mermaid. Split large Mermaid diagrams into views.
111
+ Never use a Mermaid or pele runtime in inline pages.
112
+ Embed checker-rendered SVG in inline pages.
111
113
  Use anatomy only on an explicit isometric, physical-object or anatomy request,
112
114
  through [Anatomy](../axstack-anatomy/SKILL.md).
113
115
 
@@ -126,10 +128,13 @@ through [Anatomy](../axstack-anatomy/SKILL.md).
126
128
  supporting detail to a separate linked ticket or appendix. Essential answers
127
129
  must not be hidden behind links, and evidence must not be silently discarded.
128
130
  Count node labels, headings, captions, and all page text.
129
- 2. Use chat only for an explicit chat request, an answer outside the description's conditions,
130
- or interim blocked status under Delivery.
131
- Use a compact diagram when useful.
132
- 3. For the conditions in the description, create an inline page by default.
131
+ 2. Use chat only for diagram-led explanations, an explicit chat request, an answer outside
132
+ the description's conditions, or interim blocked status under Delivery.
133
+ A diagram-led explanation uses the diagram to show its main content, such as a
134
+ structure, flow, sequence, state or map, with prose as annotation.
135
+ Deliver diagram-led explanations as prose plus native Mermaid fences in chat.
136
+ Spec readbacks, prototype pages and whiteboard defense keep their routes and formats.
137
+ 3. Create an inline page by default for non-diagram layouts that meet the description's conditions.
133
138
  Honor an explicitly requested artifact format.
134
139
  The reply adds only what the page omits.
135
140
  4. Profile IDs are presets, not availability proof. Before dispatch, follow the
@@ -37,7 +37,8 @@ Include the bounded question, audience, format, inspected identities and open ga
37
37
  Require `axstack-explainer` as the one writer of the architecture diagram.
38
38
  The driver never authors architecture diagrams.
39
39
  Return every repair to the same author.
40
- The author follows Explain's existing format and design references.
40
+ The author follows [Mermaid](mermaid.md) for every diagram view and the design
41
+ references for the requested artifact format.
41
42
 
42
43
  ## 3. Review the final artifact
43
44
 
@@ -52,17 +53,20 @@ markers, legend and prior findings.
52
53
  Give the reviewer the source map and reconciled evidence so it can reopen the
53
54
  sources independently, rather than trusting the author's account.
54
55
 
56
+ Rerun the checker with `--overview` on the exact source. Check visible
57
+ relationships and status against the source map. Follow [Mermaid render
58
+ proof](mermaid.md#render-proof) for chat and embed evidence.
55
59
  For inline HTML, the driver captures 728px dark and 360px light previews before
56
60
  review, bound to SHA-256. The reviewer inspects the driver's 728px dark and
57
61
  360px light previews for design review.
58
- Follow [Inline pages](inline-pages.md) for exact-byte scans, preview acceptance
59
- and any interaction verification, and [Visual QA](visual-qa.md) for reviewer
60
- design checks and other requested artifact formats.
62
+ For HTML, follow [Inline pages](inline-pages.md) and [Visual QA](visual-qa.md)
63
+ for exact-byte and interaction checks.
61
64
  Every byte change requires fresh review.
62
65
 
63
66
  ## 4. Deliver or hold
64
67
 
65
68
  The driver renders only reviewed bytes after the review passes.
69
+ For chat, send the reviewed Mermaid fences with the explanation.
66
70
  Follow [Delivery](delivery.md) for repairs, missing evidence or tools, and
67
71
  delivery readback; interim prose leaves the requested diagram incomplete.
68
72
  If a required seat is unavailable or rejected, hold the diagram and name the
@@ -7,12 +7,11 @@ Keep the source map outside the reader view.
7
7
  Display the short SHA.
8
8
 
9
9
  Give planned and unknown nodes a visible marker in the node label.
10
- Give planned and unknown edges a visible `planned` or `unknown` marker in the edge label.
11
- In Mermaid, use the same visible markers and a dashed cue where its syntax permits.
10
+ Give planned and unknown edges visible status in the edge labels or surrounding text.
11
+ Follow [Mermaid](mermaid.md) for status markers that preserve each diagram type’s syntax.
12
12
 
13
- Treat about 9 core nodes as a signal to split.
14
- This is a design signal rather than a hard gate.
15
- Use 1–2 accent nodes.
13
+ Use Mermaid density warnings as an advisory to split and legibility as a gate.
14
+ Limit each flowchart to one accent hue.
16
15
  Keep labels short and name each relationship's direction and meaning.
17
16
  Provide a text alternative that describes nodes and edges.
18
17
  Never load network assets in the HTML.
@@ -55,7 +55,8 @@ Write one self-contained HTML document with inline styles and scripts.
55
55
  Never load network resources, including CDN scripts, fonts, images, or Mermaid.
56
56
  Use images as `data:` URIs. Never include absolute local paths in page bytes.
57
57
  Allow plain `<a href>` links, with GitHub URLs or `path@<sha>` for source links.
58
- Use inline SVG or CSS for diagrams, with a text alternative.
58
+ Embed pre-rendered SVG for Mermaid diagrams with a text alternative.
59
+ Follow [Mermaid](mermaid.md) for checker output and render proof.
59
60
 
60
61
  Count page and reply together under the 700-word cap for inline T3 pages only.
61
62
  Use body `textContent` minus script and style, including collapsed content and SVG labels.
@@ -67,6 +68,37 @@ Plain links are not interactive.
67
68
  Use semantic elements, labels, visible focus, and sufficient contrast in both T3 themes on inline pages and in the selected theme on Publish articles.
68
69
  Pages never use storage, cookies, modals, or popups.
69
70
 
71
+ ### Embed Mermaid
72
+
73
+ Use the SVG from the checker on the reviewed source. Prefer TB flowcharts.
74
+ Keep each figure in a horizontal scroller and override Pele’s inline
75
+ `max-width:100%` so its SVG keeps its intrinsic width and readable labels.
76
+ For inline pages, reuse T3’s `.pele` theme mapping.
77
+
78
+ ```css
79
+ .mermaid-scroll {
80
+ min-width: 0;
81
+ max-width: 100%;
82
+ overflow-x: auto;
83
+ }
84
+ .mermaid-scroll > svg {
85
+ display: block;
86
+ max-width: none !important;
87
+ --pele-bg: var(--background);
88
+ --pele-fg: var(--foreground);
89
+ --pele-muted: var(--muted-foreground);
90
+ --pele-line: var(--muted-foreground);
91
+ --pele-surface: var(--secondary);
92
+ --pele-surface-alt: var(--accent);
93
+ --pele-border: var(--foreground);
94
+ --pele-accent: var(--primary);
95
+ --pele-critical: var(--destructive);
96
+ }
97
+ ```
98
+
99
+ Bind the Mermaid source, SVG and final-page hashes in review evidence.
100
+ Verify any needed horizontal scrolling by keyboard and keep overflow inside the figure.
101
+
70
102
  ## Check the exact bytes
71
103
 
72
104
  Keep page bytes, SHA-256, and attachmentId in run evidence.
@@ -0,0 +1,165 @@
1
+ # Mermaid diagrams
2
+
3
+ Use Mermaid for chat, GitHub, and docs. Use `flowchart` for topology and
4
+ branching flows, `sequenceDiagram` for ordered exchanges, `stateDiagram-v2`
5
+ for states, `erDiagram` for data models, and `timeline` for events. Other
6
+ types need an explicit user request.
7
+
8
+ Include `accTitle` and `accDescr` in every Mermaid view. Name relationships
9
+ and keep labels short. Never use theme init in Mermaid (`%%{init}%%` or
10
+ `%%{initialize}%%`). Omit theme, themeVariables, themeCSS, look and font keys.
11
+ Use multiline YAML with nested maps and scalar values. An optional top-level
12
+ `title` can precede the config. Other types allow only a title.
13
+
14
+ - Flowchart config requires `nodeSpacing` and `rankSpacing` under `config.flowchart`,
15
+ each an integer from 40 to 150. Optional `config.flowchart.curve` accepts
16
+ `step`, `linear`, or `basis`. Optional `config.layout` accepts `elk`.
17
+ - Sequence config requires `actorMargin` and `messageMargin` under
18
+ `config.sequence`, each an integer from 40 to 150.
19
+ - Use only these keys. Omit single-line flow mappings such as `config: { ... }`.
20
+
21
+ Flowchart spacing of 90/110 gives labels and step connectors room. Tenfold
22
+ spacing shrinks labels at the same viewing width.
23
+ Split wide Mermaid diagrams into views.
24
+ Keep estimated label size at least 12px at an 860px reading width
25
+ (`16 * min(1, 860 / renderedWidth)`).
26
+ Restructure diagrams that fail legibility with TB, tiers, aggregated edges or a zoom-in.
27
+ Never shrink labels to pass the legibility gate.
28
+ Density warnings prompt a split: more than 9 nodes, 12 edges or 5 participants,
29
+ labels above 40 characters, or sequence messages above 28.
30
+
31
+ Open every system-design or architecture explanation with one whole-system
32
+ overview. Use `flowchart TB` with tiered subgraphs as the default overview.
33
+ Stack tiers with about five direct nodes each. Use names with at most one status
34
+ word. Aggregate relationships to one edge per tier or component pair. Put detail
35
+ in zoom-ins after the overview.
36
+ Split only when you keep the overview.
37
+ Run the checker with `--overview`. Block 1 gets tier-size and short-label
38
+ advisories in place of general node and edge prompts.
39
+
40
+ For an overview with more than 25 edges, LR is also allowed. A dense overview
41
+ can use `layout: elk` with LR or TB and omit tiered subgraphs. Check dense ELK
42
+ overview labels at their natural size of 16px. Provide zoom or pan for reading
43
+ a dense overview in chat. All other views keep the 12px gate at 860px.
44
+
45
+ Use neutral grey strokes (HSL saturation at most 0.15) and one optional
46
+ accent hue per diagram. Keep accent stroke hues within 15° of their shared
47
+ hue. Use `classDef` and node or subgraph `style` with only `fill`, `stroke`,
48
+ `stroke-width`, and `stroke-dasharray`. Set fills to `transparent` or `none`.
49
+ Use only `stroke-width` in a `linkStyle` with `default` or edge indices.
50
+ The following class definitions illustrate blue accents and two dash patterns.
51
+
52
+ ```text
53
+ classDef accent stroke:#5b7bd5,stroke-width:2px
54
+ classDef planned stroke-dasharray:6 4
55
+ classDef unknown stroke-dasharray:2 3
56
+ ```
57
+
58
+ Do not use `rect`, coloured `box`, or sequence `classDef` statements.
59
+ Keep status visible in text. Include a status word in every node label that
60
+ uses a dashed class.
61
+
62
+ - Flowcharts can use dashed classes with the words planned, unknown, retiring,
63
+ open, partial, deprecated, or proposed in the node label. Dashed edges can
64
+ use short relationship labels such as `E3`.
65
+ - Sequences mark status in message text and keep the arrow’s meaning.
66
+ - States use status label text. Keep native transitions and omit `classDef`.
67
+ - ER uses status label text. Dotted `..` means a non-identifying relationship.
68
+ - Timelines use status label text and omit `classDef`. Use `timeline TD` past
69
+ four periods.
70
+ - In those three types use `(planned)` or `(unknown)` as the status text.
71
+
72
+ Allow semicolons in double-quoted flowchart labels and in `accTitle` and
73
+ `accDescr`. T3 rendered semicolons in quoted flowchart labels and
74
+ accessibility descriptions. The observed T3 failure was a semicolon in a
75
+ sequence participant alias.
76
+ Use a comma or dash in place of semicolons in sequence aliases and messages.
77
+ Use a comma or dash in place of semicolons in unquoted labels and in labels
78
+ outside flowcharts.
79
+ Keep brackets and parentheses out of participant aliases. Put status in message
80
+ text. Use `✱` for an asterisk in a flowchart label.
81
+
82
+ ## Canonical overview and zoom-in
83
+
84
+ ```mermaid
85
+ ---
86
+ config:
87
+ flowchart:
88
+ nodeSpacing: 90
89
+ rankSpacing: 110
90
+ curve: step
91
+ ---
92
+ flowchart TB
93
+ accTitle: Review routing
94
+ accDescr: A candidate goes to the driver for review. The reviewer returns findings and a summary is planned.
95
+ classDef accent stroke:#5b7bd5,stroke-width:2px
96
+ classDef planned stroke-dasharray:6 4
97
+ subgraph Intake
98
+ candidate[Candidate]
99
+ end
100
+ subgraph Review
101
+ driver[Driver] -->|requests review| reviewer[Independent reviewer]:::accent
102
+ end
103
+ subgraph Outcome
104
+ findings[Findings]
105
+ summary["Review summary (planned)"]:::planned
106
+ end
107
+ candidate -->|submit| driver
108
+ reviewer -->|findings| findings
109
+ reviewer -.->|planned| summary
110
+ ```
111
+
112
+ ```mermaid
113
+ ---
114
+ config:
115
+ sequence:
116
+ actorMargin: 80
117
+ messageMargin: 48
118
+ ---
119
+ sequenceDiagram
120
+ accTitle: Review request
121
+ accDescr: The driver sends the candidate and receives findings.
122
+ participant D as Driver
123
+ participant R as Reviewer
124
+ D->>R: Review candidate
125
+ R-->>D: Return findings
126
+ ```
127
+
128
+ ## Check and render
129
+
130
+ Run `mermaid-check.js` on every Mermaid view before delivery. Before posting
131
+ any Mermaid block in chat, run `mermaid-check.js` to parse and render that block
132
+ with pinned Pele.
133
+ From the installed Explain skill directory, check reviewed Markdown or raw
134
+ `.mmd` source with Bun.
135
+
136
+ ```sh
137
+ bun ../axstack/scripts/mermaid-check.js --help
138
+ bun ../axstack/scripts/mermaid-check.js --overview --svg-out ./svg review.md
139
+ ```
140
+
141
+ Diagram presence is required by default (`--expect`). Use `--no-expect` for
142
+ optional Markdown diagrams, `--pele <path>` for another copy of the pinned
143
+ bytes, and `--allow-type <type>` for an explicitly requested Pele type.
144
+ Exit codes are 0 for pass, 1 for an input, contract or render failure, 2 for
145
+ usage and 3 for a missing or invalid renderer. Exit 3 holds visual delivery
146
+ under Explain's [Delivery](delivery.md). Export all views from one input for
147
+ distinct SVG IDs.
148
+
149
+ ## Render proof
150
+
151
+ A checker pass proves contract compliance and pinned-pele parse and size on
152
+ the exact source bytes. Record the Pele version and per-block source SHA-256.
153
+ Pinned Pele renders ELK input using its default layout, leaving ELK geometry
154
+ unmeasured. T3 renders ELK layouts in chat. Real ELK measurement is tracked
155
+ in [issue #714](https://github.com/axatbhardwaj/axstack/issues/714).
156
+ A checker pass never proves T3 or GitHub appearance.
157
+ Save the posted Markdown and its SHA-256 with the review. For embeds, the
158
+ reviewer matches embedded SVG bytes to the checker-printed SHA-256.
159
+ Record `T3 render: unobserved` unless an actual inline render is observed.
160
+ Claim GitHub or docs fidelity only after a fixture render on that host.
161
+
162
+ ## Embeds
163
+
164
+ Follow [Inline pages](inline-pages.md#embed-mermaid) or
165
+ [Publish](../../axstack-publish/SKILL.md#2-prepare-the-final-artifact).
@@ -26,7 +26,11 @@ A page failing to look decent is a blocking design finding, repaired by the same
26
26
  For Anatomy and Publish only, retain Delivery's design-only exception.
27
27
  Never describe a remaining finding as fixed or a clean pass.
28
28
  Follow [Delivery](delivery.md) for other failure holds and unknown-render holds.
29
- Chat Mermaid and anatomy keep their existing review. Explicitly requested standalone HTML files keep their existing review and Visual QA.
29
+ Chat Mermaid and anatomy keep their existing review.
30
+ For Mermaid, follow [Mermaid](mermaid.md) for checker and host render proof.
31
+ For embedded Mermaid SVG, check intrinsic size, label fit and colour in the page’s
32
+ tested theme and widths. Keep horizontal scrolling inside the figure.
33
+ Explicitly requested standalone HTML files keep their existing review and Visual QA.
30
34
  Interaction checks remain with `axstack-ui-verifier`; source-fidelity review is unchanged.
31
35
 
32
36
  Use this checklist for every HTML explanation and other visual artifacts where
@@ -82,6 +82,13 @@ to remove private paths, IDs, credentials, prompts, messages and internal record
82
82
  For public mode, run Explain's [self-contained asset check](../axstack-explain/references/inline-pages.md#check-the-exact-bytes).
83
83
  Reuse Explain's [page rules](../axstack-explain/references/inline-pages.md#page-rules)
84
84
  and [Visual QA](../axstack-explain/references/visual-qa.md) for checks and verifier routing.
85
+ For diagrams, follow [Mermaid](../axstack-explain/references/mermaid.md).
86
+ Never use a Mermaid or pele runtime in articles.
87
+ Embed checker-rendered SVG from the reviewed Mermaid source.
88
+ Use the [figure scroller](../axstack-explain/references/inline-pages.md#embed-mermaid)
89
+ and bind `--pele-*` to the article’s Neon tokens. Use ground for background,
90
+ ink for foreground, muted for lines and borders, surface for fills, and
91
+ `--neon-emphasis` for `--pele-accent`.
85
92
 
86
93
  Send the article adaptation, including art direction and the dark Neon theme,
87
94
  to `axstack-explainer` with a bounded brief.