Repository navigation
Run the Mermaid quality pass and ship gates #530
Description
Part of #521. Depends on #529. Read the tracker first: its §Shared contract binds this issue. Work on main.
Summary
Run the house DRY and KISS pass and take the code-janitor flag. Then sweep layering and dead files on the final code, and audit the docs against the code. Finish with check:ci and the Docker cold build.
Rulings: 8 (#521 §Maintainer rulings).
Files and interfaces
Files
- Modify only on a failed check: files earlier tasks created or changed. Create no new repo file.
- Modify: the ship-check file.
Implementation steps
-
Step 1: Run the
code-janitorskill onPKGplus the webapp and server files from Draw Mermaid diagrams in the pad, history and /editor #528. Tell it:- The design fixes the exported names, the public types and the
src/types.tsJSDoc ([Tracking] Mermaid diagrams in docs.plus through a headless Pele extension #521 §Public API). It also fixes the CSS class names and the file map ([Tracking] Mermaid diagrams in docs.plus through a headless Pele extension #521 §Shared contract). Decline every rename, move or split. - Add no dependency, option or test.
- In tracked webapp and server files, edit only the lines this feature added.
Record its verdict word for word in
## Quality pass. Pass needs the code-janitor flag granted and noBLOCKfinding left. - The design fixes the exported names, the public types and the
-
Step 2: Sweep layering and dead files (after the janitor, so it checks the final code).
git -C REPO ls-files --others --exclude-standardlists only new files from the file map: noLICENSE,tsconfig.test.json,examples/vanilla/style.cssor scratch file.git -C REPO grep --untracked -nE "from ['\"]pele|import\(['\"]pele" -- 'extensions/**/*.ts' 'apps/**/*.ts' 'apps/**/*.tsx' 'packages/**/*.ts': every hit is increateRenderer.ts, and exactly one is the runtimeimport('pele/lazy').- No
export *inPKG/src. Rerun the Add the Mermaid renderer, default view, styles and node view #524 Step 7 layering greps.types.tsimports only from@tiptap/*, andconstants.tsat mostimport typefrom./types. - In
PKG, the orphan check prints nothing:for f in $(find src -name '*.ts' ! -name index.ts); do b=$(basename $f .ts); grep -rqE "from '[./]+.*$b'" src || echo "orphan $f"; done. - The d.ts greps ([Tracking] Mermaid diagrams in docs.plus through a headless Pele extension #521 §Global constraints → Pele).
git -C REPO grep -n "extension-mermaid\|insertMermaid" -- apps/webapp/src/components/chatroomandgit -C REPO diff --stat -- apps/webapp/src/storesprint nothing.
-
Step 3: Recheck after janitor edits. If the janitor changed any
src/or webapp file, rebuild and runbun run testinPKG. Then rerun Run the Mermaid browser pass and security probes #529 Step 1, so dev is running. Runbrowser.ts type-race offline, and repeat Step 2. -
Step 4: Audit the docs against the code. This runs after the janitor, because its documentation chain rewrites prose. It edits docs only.
- Check each factual claim in the package README, CONTRIBUTING,
docs/*.mdandcypress/e2e/README.md, plusdocs/diagrams.md, theCONTEXT.mdentry, the design-system row and the new family rows, against a code line. Checkdocs/security.mdagainst the probe rows. Fix false claims and record each fix. - Rollback check: start
bun run playgroundinPKGin the background, and stop it afterwards. In the playground console, after_editor.commands.setContent('<p>Intro</p><pre><code class="language-mermaid">flowchart LR\n A --> B</code></pre>'), run:Expected:const json = _editor.getJSON() const bare = new _editor.constructor({ extensions: _editor.extensionManager.extensions.filter((e) => !['mermaid', 'starterKit'].includes(e.name)), content: json }) const result = [JSON.stringify(bare.getJSON()) === JSON.stringify(json), bare.getHTML().includes('<code class="language-mermaid">'), bare.extensionManager.extensions.some((e) => e.name === 'mermaid')] bare.destroy() result
[true, true, false], with no duplicate-extension warning. - Repeat the credit-line grep, the caveat parity loop and the quickstart sync check (Write the extension-mermaid README, docs, assets and StackBlitz example #526 Step 10).
- Check each factual claim in the package README, CONTRIBUTING,
-
Step 5: Format untracked files.
cd REPO && git ls-files --others --exclude-standard -z | xargs -0 bunx prettier --check --ignore-unknown --ignore-path REPO/.prettierignore --printsAll matched files use Prettier code style!. -
Step 6: Run
check:ci. Stopmake dev-localand any playground.bun REPO/scripts/check-next-server.tsexits 0. Runbun run check:cifromREPO.- The header
extline listsextension-mermaid. webapp build:cireadspass. Askipthere means a Next server was live and the build never ran.- The last line is
PASS every run gate passed. Named skips are not implied green on GitHub. - Copy the verdict block into
## check:ci verdict.
- The header
-
Step 7: Run the Docker cold build.
make build-prod-cifromREPO. Expected last line:✅ Production build validation passed. Record the result as a row in## Measure and release gates. If the Docker daemon is not running, add "make build-prod-cibefore the first(build):push" to Owed. That is not a pass. -
Step 8: Clean up. Run
rm -f REPO/apps/webapp/public/sw.js REPO/apps/webapp/public/workbox-*.js REPO/apps/webapp/public/worker-*.js. -
Step 9: Loop rule. The flag and the verdicts must describe the final code. A code fix after Step 1 goes back through Steps 1 to 8. A doc-only fix after Step 4 goes back through Steps 5 and 6.
-
Step 10: Report on the tracker. Hand the verdict block (janitor flag,
check:ci, Docker) to the maintainer to post on [Tracking] Mermaid diagrams in docs.plus through a headless Pele extension #521. -
Step 11: Review checkpoint. Report the janitor verdict, the sweep, the doc audit, the
check:ciblock, the Docker result, and everything Owed.
Acceptance criteria
code-janitorgrants its flag with noBLOCKfinding.check:ciends with thePASSline on the final code, withwebapp build:cireadingpass.make build-prod-cipasses, or is recorded as owed because the Docker daemon was down.
Activity
HMarzban commentedon Oct 19, 2026
Maintainer ruling, 2026-10-19
The source split is accepted:
nodeView/fold.ts,nodeView/renderLoop.ts,view/icons.ts,view/element.ts,nodeView/copy.ts,nodeView/theme.ts,src/hashSource.ts, and internal types insrc/renderer/types.ts. #521 §File map is updated to match.The work is in the maintainer's working tree and is not committed or pushed yet.
feat(extension-mermaid): add the Mermaid diagram extension
HMarzban commentedon Oct 19, 2026
Ship gates, progress 2026-10-19
bun test src(12/12) andbun run typecheck.lint,lint:stylesandformat.formatpasses again since7ed4254df, which makes Prettier skip.claude/worktrees.export *.peleentry. It now usespele/lazy(1258a9d42).:focus-visible, plus.pele-zoomandcontain: noneinside@media print. The print lines are what make the package print correctly.7547ee82e(limit advice, print rules, runtime theme guard), because the earlier pass came before it.check:ci, which the maintainer runs.HMarzban commentedon Oct 19, 2026
Step 4 rollback check, 2026-10-19 (HEAD
7ca925101)The rollback passes. With the Mermaid extension removed, the document keeps the same JSON, the HTML keeps
<code class="language-mermaid">, and nomermaidextension is left:[true, true, false], with no duplicate warning. The result is the same as the earlier run. Commits7547ee82eand17b96cc3bchanged nothing here.The snippet in Step 4 crashes as written.
new Editoradds the 10 core extensions again, soRangeError: Adding different instances of a keyed plugin (focusEvents$). Use this filter:Dropping
listItemBranchingDeleteKeymapremoves a duplicate warning that does not come from Mermaid. In@tiptap/extension-list3.31.3,ListItem.addExtensions()adds that child again, and the control run without the Mermaid change shows the same warning.Log:
Notes/local-docs/mermaid-ship-check/rollback-head-7ca925101.log(local). Step 4's three doc checks were not part of this run.HMarzban commentedon Oct 21, 2026
Fresh review pass on
7547ee82e,17b96cc3b,494af7123andaebd55866, 2026-10-21A strict maintainability review, run as the thermo-nuclear reviewer agent. Its rubric skill refused to load (
disable-model-invocation), so the agent used its stated fallback: a strict maintainability audit.Verdict:
GRANTED_WITH_NOTES. Nothing blocks the release.Checked and correct:
limitMessage.tsmaps each of Pele 1.7.0's sevenlimitmessages, and the test passes on 1.7.0.LIMITSincheckDiagrams.ts(15000/500) matchesDEFAULT_LIMITS.ignoreMutationtouches only the frame's style attribute.Findings:
apps/hocuspocus.server/src/modules/mcp/domain/checkDiagrams.tstold everylimiterror "over 15000 characters or 500 edges". It still did after17b96cc3bfixed the same thing in the extension. Before:block-beta\n columns 1\n space:1000000(38 characters) got the size sentence. After: "Pele refused it: A block diagram can hold at most 100000 space blocks." The size and edge cases keep the old sentence, and the 14-keyword smoke test still passes.extensions/extension-mermaid/docs/api.mdsaid alimitmessage is always the extension's sentence, which contradicts the next lines. It now says "usually".edge-a11y-theme.cy.ts: the helperparagraphTexts()ends in.then, so it never retries, and494af7123copied its body inline. Make the helper retry, then drop the copy.check:cipassed on the final code in the pre-push run for3784c2c65, and that same tree built and deployed (run 39398067267). The two fixes above need one commit and a(build): back.HMarzban commentedon Oct 21, 2026
Findings 1 and 2 above are committed in
ae692d54dand deployed to production on 2026-10-21 (deploy tip0130027bf). It also addscheckDiagrams.test.ts, which fails on the old code. Findings 3 and 4 stay as noted.HMarzban commentedon Oct 21, 2026
Status, 2026-10-21
make build-prod-cipasses. All four production images build: webapp, admin, rest-api and hocuspocus. It first failed after Require a password on production Redis #438, because the build stub had noREDIS_PASSWORD.5cb91e273fixed that.check:cipasses on every push today, withwebapp build:cireadingpass.code-janitor, group G1 (the package): four comment-only edits, no runtime change, and all gates pass (shipped ind6a09faa1). Five file-name renames were proposed and skipped, becauseCONTEXT.mdnames those modules by their current file names. G2 (the webapp wiring), the production-readiness sweep and the supervisor step are still owed.Flaky test, seen in CI on 2026-10-21.
edge-a11y-theme.cy.ts› "keeps diagram zoom keys and the editor caret apart on a fine pointer" failed once in run 39597105751, then passed on the re-run:The typed
Znever reached the "After" paragraph.caretInParagraphalready waits for.ProseMirrorfocus, and494af7123already retries the read, so the key itself is lost. The likely cause is that the editor is not ready for real keys at that moment. Finding 3 above names the same file. That case is not covered by the focus wait: the Wide diagram finishes rendering, or the 300 ms redraw debounce fires, between the caret set and the key. Fix it before 2.2.0 ships. Wait for the diagram to settle and for the selection to sit inside "After" beforerealType, then prove the fix by sabotage.test(mermaid): wait out ProseMirror's focus resync before a real key
test(mermaid): pin the exact character limit