Skip to content

test: pin raw render_markdown invocations to the pipeline allowlist#220

Open
PathGao wants to merge 1 commit into
alecdotdev:masterfrom
PathGao:test/render-pipeline-convention
Open

test: pin raw render_markdown invocations to the pipeline allowlist#220
PathGao wants to merge 1 commit into
alecdotdev:masterfrom
PathGao:test/render-pipeline-convention

Conversation

@PathGao

@PathGao PathGao commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What

Adds a source-convention test (same style as the existing script tests) asserting that the raw invoke('render_markdown') command appears only inside renderMarkdownPreview and in utils/export.ts (which strips front matter itself).

Why

renderMarkdownPreview exists so every preview render strips YAML front matter before hitting the Rust renderer (#194). But the raw command is a string RPC — the type checker can't flag a call site that bypasses the wrapper, and a bypass renders the front matter into the body (hr + setext heading). This is not hypothetical: two such bypasses have already slipped through merges silently in downstream branches. This test turns the convention into a red test instead of a code-review memory item.

If a future change legitimately needs the raw command, the allowlist in the test is the conscious place to widen it.

Verification

  • New test passes on master (2/2); full script suite still green.

🤖 Generated with Claude Code

The preview pipeline (renderMarkdownPreview) strips YAML front matter
before invoking the Rust renderer. The raw invoke('render_markdown')
command is a string RPC, so the type checker cannot flag call sites
that bypass the pipeline — two such bypasses have already slipped
through merges unnoticed. This test pins the exact files (and counts)
allowed to touch the raw command; any new render call site must go
through the pipeline or consciously widen the allowlist.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant