Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/workflows/mermaid-feasibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,27 @@ jobs:
git diff --exit-code -- pnpm-lock.yaml
- name: Install browser
run: pnpm exec playwright install --with-deps "$THROUGHLINE_QA_BROWSER"
- name: Verify process-memory measurement helper
run: node --test scripts/mermaid-process-memory.test.mjs
- name: Build and inventory proof dependency boundary
run: |
git status --porcelain --untracked-files=all
test -z "$(git status --porcelain --untracked-files=all)"
mkdir -p "$RUNNER_TEMP/mermaid-proof"
pnpm build
node scripts/audit-mermaid-proof.mjs "$RUNNER_TEMP/mermaid-proof/dependencies.json"
- name: Measure independent packed feasibility host
run: node scripts/audit-mermaid-packed.mjs "$RUNNER_TEMP/mermaid-proof/packed.json"
run: |
git status --porcelain --untracked-files=all
test -z "$(git status --porcelain --untracked-files=all)"
node scripts/audit-mermaid-packed.mjs "$RUNNER_TEMP/mermaid-proof/packed.json"
- name: Measure source workload and capture actual rendered screenshots
if: ${{ !cancelled() }}
shell: bash
run: |
set -euo pipefail
git status --porcelain --untracked-files=all
test -z "$(git status --porcelain --untracked-files=all)"
mkdir -p "$RUNNER_TEMP/mermaid-proof"
pnpm exec vite --host 127.0.0.1 --port 5174 > "$RUNNER_TEMP/mermaid-proof/vite.log" 2>&1 &
server=$!
Expand All @@ -66,11 +75,18 @@ jobs:
done
curl --fail --silent http://127.0.0.1:5174/scripts/mermaid-proof.html > /dev/null
node scripts/measure-mermaid-proof.mjs "$THROUGHLINE_QA_BROWSER" "$RUNNER_TEMP/mermaid-proof"
# Vitest writes failure screenshots into the checkout. Run these tests
# after measurements so failed regressions cannot contaminate source evidence.
- name: Verify focused Mermaid browser feasibility
if: ${{ !cancelled() }}
run: pnpm test:browser:run src/react/__tests__/mermaid-proof src/react/__tests__/mermaid-player.browser.test.tsx
- name: Retain actual evidence, including failures where available
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: mermaid-feasibility-${{ matrix.browser }}-${{ github.run_id }}
path: ${{ runner.temp }}/mermaid-proof/
path: |
${{ runner.temp }}/mermaid-proof/
src/react/__tests__/__screenshots__/
if-no-files-found: warn
retention-days: 30
53 changes: 53 additions & 0 deletions docs/mermaid-feasibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,56 @@ Per-area recommendation (maintainer decision still required):
The read-only Mermaid feasibility workflow captures browser-specific packed proof, workload measurements/screenshots and the dependency inventory as retained artifacts. Its browser suite is separate from final release acceptance. Browser heap snapshots are explicitly method-labeled (or unavailable); they do not establish peak process memory.

Record subsequent exact commit, engine versions, actual timings, asset hashes/bytes and failure outcomes; never replace missing measurements with estimates. No human AT or native zoom was performed for this candidate. The display-reference and Graph state-strip design choices require explicit review. Graph/Sequence/collapse/source selection/performance/browser safety each remain unaccepted until reviewed against the evidence. Do not start production cutover or publication on this report alone.

## Follow-up feasibility candidate — review and measurement required

This branch adds a fixed host-owned Graph value slot per mapped node, painted from the same bounded value summary as the native player, without putting frame values into Mermaid syntax or triggering layout on writes. The state strip remains a textual equivalent. Graph/Sequence source controls are ordinary host-owned buttons derived directly from the descriptor and remain available during loading or failure; event-caption pointer/keyboard selection now binds directly to globally unique host-authored tokens on ordinary SVG text elements, not private CSS classes, route positions or generated IDs. Visual arrow paths and phase boxes are no longer semantic selection targets; their guarded pinned association is used only for optional presentation and motion. Participant visual binding remains version-specific, with independent host controls available. Global row-token uniqueness includes participant captions and rejects duplicated rendered references. Review the explicit interaction tradeoff (select a caption/reference or host control, not the bare arrow path or phase box), actual browser behavior and optional visual geometry before declaring MR-04/MR-10 accepted. The cache is trace-scoped; retries and stale request cancellation retain the existing abort boundary.

The independent packed proof now includes the shared primitive/shape summary helper. Source and packed measurement scripts record Linux process-tree RSS samples (100 ms requested interval), baseline and sampled maximum. The measure includes the dedicated Node measurement runner and descendants, may double-count shared pages, and is not exact peak or browser-only unique memory. Do not compare across differing process trees or interpret unavailable measurements as zero. CI runs the focused browser suite on all three engines and retains reports. The package is still native; this is copied-adapter feasibility, not U29 production proof.

| Requirement | Candidate change / required fresh evidence | Disposition |
| --- | --- | --- |
| MR-01–03 | Repeat pure/packed boundary, hierarchy and topology checks | Pending exact-head results |
| MR-04–06 | Global row references, independent source controls, repeated/orphan phases, windows and perturbations | Pending caption/host source-selection and optional geometry review |
| MR-07–08 | Native State unchanged; inline state slot and current focus/write cues, unchanged-topology seek, motion lifecycle | Pending three-engine parity and legibility review |
| MR-09–10 | Host-owned selection/fallback, hostile content, trace-scoped cache, retry and SSR | NO-GO pending exact results, participant visual binding/optional geometry review and required human evidence |
| MR-11 | Sampled process-tree RSS, asset/lock/inventory and workload reports | Pending actual measured results and notice review |
| MR-12 | Review all four references and failures with exact SHA | NO-GO until reviewed evidence |

A synthetic SVG regression exercises token selection with deliberately unknown classes and reversed text-element order; real renderer perturbation, participant lookalike and missing graph-slot regressions remain required alongside the four canonical cases. Memory availability requires multiple observations and an observed descendant process. No measurements, screenshots, human AT or native zoom results are claimed for this candidate before its workflows execute. No production integration, package export change, release or ticket closure is authorized. A failure of the reserved state slot must fall back rather than silently omit modeled values. If the caption-based selection interaction, participant binding or optional geometry fails parity, retain native rendering and seek a reviewed disposition; do not equate independent source buttons with approved visual parity.


## Evidence review — 2026-11-26, tested source `5bfeebd1237efaa5a46fcb5ad2c87ede6a2f7720`

The [full CI](https://github.com/0xbuffdev/throughline/actions/runs/45893817204), [Firefox/WebKit QA](https://github.com/0xbuffdev/throughline/actions/runs/45893817211) and [three-engine feasibility workflow](https://github.com/0xbuffdev/throughline/actions/runs/45893817198) passed. Full suites: 454 unit/compiler tests; 201 browser tests per engine; 55 focused feasibility tests per engine; two process-memory helper tests per engine. Native public package consumer/security/quality checks and proposed merge result passed. This is evidence for the named SHA, not for subsequent changes or the production Mermaid renderer.

All three downloaded artifact archives were examined, including measurements, packed reports, lock and inventory JSON, and rendered Graph/Sequence/mobile screenshots. Source, packed and dependency reports identify the same clean, unchanged SHA and input fingerprint `7ff61a7509b2b9dbe79e262870cc23d41f9ce2b2da08cf314e52ee339527cadb`. Independent consumer lock SHA-256 `c2f8c1d170db51c4b0ccf342ed49352084e61cdacd5eb81ee591688d5c4f24d9` and per-engine inventory hashes were independently recomputed from the retained JSON. All three archives report identical native tarball SHA-256 `6f7a96a2cf72c7e40f8ce282fb7eb7e674e63858b5a5d4329f68b010b083770a`; the tarball itself is not in those ZIPs and its hash was not independently recomputed. No nonlocal requests or page errors. Packed tests selected all four reference entities by pointer, keyboard and independent list, compared exact source IDs/cells/inline summaries to the installed native core, and selected Sequence event captions by pointer and keyboard. Packed host document widths matched viewport at 260/320/375/720 px; graph scroll surface was 575 px wide in the narrow checkout measurement with 12 px node font.

| Browser / artifact | 8/12 native geometry / candidate render ms | 64/160 native / candidate ms | 200/1000 native / candidate ms | 10k phases projection / 40-phase render ms | Source / packed sampled max RSS (MiB) |
| --- | --- | --- | --- | --- | --- |
| [Chromium](https://github.com/0xbuffdev/throughline/actions/runs/45893817198/artifacts/15152143619) | 0.4 / 57.7, 53.6, 52.4 | 2.9 / 455.1, 427.0, 405.4 | 17.8 / 6088.6 | 60 / 55.1 | 980.2 / 1346.7 |
| [Firefox](https://github.com/0xbuffdev/throughline/actions/runs/45893817198/artifacts/15152024100) | 0 / 83, 67, 67 | 8 / 587, 540, 531 | 45 / 9120 | 90 / 115 | 1486.2 / 1769.1 |
| [WebKit](https://github.com/0xbuffdev/throughline/actions/runs/45893817198/artifacts/15153300770) | 1 / 100, 70, 71 | 4 / 545, 473, 474 | 32 / 5708 | 82 / 103 | 1178.2 / 1448.2 |

Native geometry timings and Mermaid render timings measure different operations; zero denotes timer resolution. All graph nodes/edges mapped; the large graph bypasses the preview cap and produces a 2.64–2.72 MB SVG with width about 31,275–31,287 units. Even the 64/160 graph is about 9,990–9,994 units wide. Do not claim interactive parity at these extremes. Source measurements sampled 101/148/105 times, packed 51/73/121 (Chromium/Firefox/WebKit). The aggregate RSS includes the Node runner, browser descendants and potentially shared pages counted repeatedly. Packed baseline includes the prior build and is not directly comparable with the source runner. No unique or instantaneous peak-memory claim. All engines reported 89 built assets totaling 5,825,337 bytes (1,696,561 gzip bytes); initial Graph host requests 2,933,913 bytes (878,957 gzip bytes); additional Sequence requests 117,959 bytes (31,282 gzip bytes). These are full copied-adapter host costs, not Mermaid-only or production release costs.

The source audit found 115 reachable packages and no missing license texts; the independent npm host resolved 202 installed packages with the same lock across engines. The latter includes DOMPurify 3.5.0 (MPL-2.0 OR Apache-2.0), elkjs 0.12.2 (EPL-2.0 OR GPL-3.0-or-later), and Khroma 2.1.0 (manifest UNDECLARED, license file present). The source inventory differs from independently resolved consumer versions. Production notice and source-availability review remains necessary; native runtime MIT-only audit is not approval of this tree.

**Negative visual finding from actual screenshots:** while the one-shot Sequence cue is moving, its duplicate text caption overlaps the fixed source-reference caption on desktop and mobile in all three engines. Source identity is technically correct but legibility and access to the authoritative caption during motion are not assured. The follow-up removes the duplicate moving Sequence text, retains the one-shot directional cue and keeps the exact fixed selectable caption visible. Graph motion retains its label. The regression now asserts that the only moving Sequence element is the directional cue, tied to the same source as the stationary visible caption, and no receipt-only cue is generated. Fresh three-engine tests/screenshots are required after this correction; this section records the previous exact-head evidence, not their result.

| Requirement | Review disposition for feasibility |
| --- | --- |
| MR-01 | GO for isolated proof: pure/public native package boundary intact; no production adoption |
| MR-02 | GO for tested syntax and mapped Graph sources across four references and negative cases |
| MR-03 | GO for current-presence/collapse projection; union reuse rejected; native group/camera integration still U27 |
| MR-04 | GO for exact host controls and explicit event-caption tokens; NO-GO for claiming private-independent bare-mark/participant geometry parity; approve caption-selection interaction explicitly |
| MR-05 | GO for recorded phases and honest arrows/notes, including repeats/orphans; caption legibility correction needs fresh evidence |
| MR-06 | GO for bounded 40-phase diagram and complete evidence navigation |
| MR-07 | GO for native State and bounded inline Graph summary/focus/write implementation at tested frames |
| MR-08 | Automated clock/seek/reduced-motion behavior passed; visual overlap found, corrected subsequently, new evidence pending |
| MR-09 | GO for tested hostile/offline trust boundary, not arbitrary untrusted SVG |
| MR-10 | Automated browser/SSR/packed proof passed; human AT/zoom, participant mapping review and production integration still outstanding |
| MR-11 | GO for collected measurements; NO-GO for unbounded Graph or production performance/notice approval. Review bounded fallback and default display budget, not merely finite geometry. |
| MR-12 | Overall NO-GO for production cutover pending visual correction verification, review of interaction/limits/notices and applicable human evidence. |

**Per-area decision:** Graph/collapse: GO for bounded feasibility experiments, not production. Sequence: conditional on the corrected caption and explicit interaction approval. Exact source ID/selection: GO for host controls and event captions on tested inputs; remaining private participant/geometry association is presentation-specific and must not become essential. Performance: NO-GO for unbounded rendering, review the 64/160 preview limit before integration. Browser safety: GO for tested automated/offline proof; human AT/native zoom not performed. No package publication, public exports, U27 start, or U29 acceptance is implied. Maintainer must approve the explicit go/no-go and tradeoffs; final exact-candidate TL-U18 AT/zoom remains separate.
Loading