Markdown/MDX authoring verification
18 October 2026. Linked to REQ-PRODUCT-AUTHORING, REQ-PRODUCT-CF-HISTORY, REQ-PRODUCT-SAFE-CONTENT and REQ-PRODUCT-MOBILE.
- Package tests compile Markdown and MDX with YAML frontmatter, static component maps, stable heading IDs, generated addenda, GFM tables, link destinations and image alternatives. They reject invalid metadata before executing components, unsafe output, missing references and suspended fallbacks.
- Source-only edits produce new release identities while retaining equal rendered hashes. Component-output changes with equal authored source change body and readable-content hashes. Archive registration rejects missing, extra, mismatched and tampered source attachments; ordinary history projections omit raw source.
- Source routes authorize before storage, reject invalid references, escape stored MDX, support HEAD and use private/no-store responses. Diff tests cover source-only changes, separate distant ranges, insertions/deletions, newline-only changes and bounded work for large inputs.
- The authoring npm tarball installs offline from the dependency cache, compiles a real document outside the workspace, and passes a strict TypeScript consumer check without depending on this repository's ambient type setup. Core and CF packages retain their existing zero-dependency distribution checks.
- Site tests initialize the host's synthetic archives, deny unauthenticated source access and recover the same source through a new object instance. The actual local Wrangler/SQLite runtime also passed
scripts/check-site-runtime.mjs: protected source inspection, source comparison and public static output all worked. No cloud deployment was performed. - Browser inspection at 390×844 confirmed readable MDX terms, a styled static custom callout and ordinary legal navigation. The source comparison displayed separate metadata and provision changes with surrounding context. At 320×700, document client and scroll widths were both 305 CSS pixels, including after expanding complete retained MDX source. The viewport override was reset afterward.
Screenshots: mobile authored terms, source comparison.
Full keyboard/screen-reader review, platform-matrix testing, reproducibility across arbitrary host components and retention/erasure operations remain adopter work or later verification. Static-output sanitization does not sandbox trusted MDX execution.
23 October file-reader review
Review of the local readDocumentSource() helper found that it read the entire input before the compiler applied the existing 24 KiB source limit. A disposable 24,577-byte file was returned by the reader; a named pipe with no writer left its child process waiting until the reproduction deadline terminated it. This was an explicit local build-input issue, not evidence of a remote attack or MDX sandbox escape.
The reader now checks file type and size before opening, opens without following a final symlink or waiting for a pipe writer, and compares the opened file's identity with the earlier check. Reads use a fixed 24,577-byte buffer: the extra byte detects growth beyond the source limit. UTF-8 decoding remains strict and preserves byte-order marks and line endings. Read failures return a fixed error without the local filename or source contents.
Seven focused tests passed on macOS. They cover a multibyte UTF-8 source exactly at the limit, one byte over it, invalid encoding, empty regular files, path and file-URL inputs, option/base-URL preservation, directories, symlinks and a named pipe. Child-process tests deterministically replace the file with a pipe, symlink or different regular file after the initial check, and grow it after the opened-file check. Each replacement is confirmed to have occurred; the growth case reads exactly the boundary sentinel before rejection. Child deadlines detect blocking reads. These tests do not establish physical Windows/Linux filesystem behavior or turn trusted MDX into safe untrusted input.
23 October URL serialization review
A selected review reproduced a local-image policy bypass in the previous authoring archive. A path containing literal or encoded parent segments passed the parsed-origin check, but removing the origin from its normalized URL could leave a leading //. In a published document, that is a protocol-relative external image URL. This could load externally controlled imagery and contact an external server. It was not JavaScript execution or an authentication bypass; the project website's same-origin image CSP also mitigated the request there. No external image was fetched during the reproduction.
The sanitizer now rejects a same-origin result whose serialized local path begins with //, for both images and links. It keeps ordinary parent-relative paths, local dot-segment normalization, query strings, fragments, internal doubled slashes and encoded path slashes when they still resolve locally. Explicit permitted HTTPS links remain supported. The guard applies after static Markdown or MDX component output is rendered; it does not sandbox MDX evaluation or inspect the contents of image files.
All 46 authoring tests passed on Node 22. Two new regressions first failed against the previous implementation. They cover Markdown images, MDX component images and links, literal/encoded parent segments and positive same-origin resolution checks. A separate in-memory check against the previous verified authoring tarball reproduced the external result for two paths, without network requests. The broader security and browser/platform acceptance gates remain open; this was a selected URL-boundary review.