Skip to content

Property-test Markdown frontmatter parsing - #13

Merged
adewale merged 4 commits into
mainfrom
codex/pbt-fuzz-next-step
Sep 23, 2026
Merged

adewale merged 4 commits into
mainfrom
codex/pbt-fuzz-next-step

Conversation

@adewale

@adewale adewale commented Aug 30, 2026 •

Copy link
Copy Markdown
Owner

What

  • Add a structured Hypothesis property for TOML frontmatter plus arbitrary Markdown bodies.
  • Assert exact metadata, body preservation, and body-line accounting through the production parser.
  • Add Hypothesis to the locked development dependency group.
  • Update the locked Wrangler toolchain to 4.137.0, which carries fixed Undici and Sharp releases required by the repository's high-severity audit gate.
  • Record the TOML/Markdown generator and oracle rule in docs/lessons-learned.md.

Why

Example source files combine two grammars at one trust boundary. The existing unittest suite covered examples but did not generate escaping, Unicode, empty values, and arbitrary Markdown combinations with shrinking.

The hosted audit began rejecting Wrangler 4.114.0 after high-severity Undici advisories were published, then rejected Wrangler 4.127.1 after the Sharp/libheif advisory landed. Wrangler 4.137.0 is the current release selected by npm's remediation and resolves both dependency chains.

How

The generator builds valid TOML string fields with variable frontmatter height and an independent Markdown body, then calls _split_frontmatter and checks both sides of the boundary exactly. A deterministic example covers escaped metadata, delimiter-shaped metadata, and a later +++ Markdown line. The test remains collectable by the repository's unittest runner. The project lesson preserves the need to reach the valid-frontmatter path without rebuilding the production parser as the oracle.

Testing

  • Full Python suite: 225 tests passed
  • Ruff passed
  • The focused property passed 5,000 generated cases plus the deterministic delimiter case
  • Mutation checks confirmed the property fails if _split_frontmatter hardcodes body line 5 or searches backward for the closing delimiter
  • Clean npm install succeeded, Wrangler reports 4.137.0, and npm audit --audit-level=high found 0 vulnerabilities
  • Hosted Verify passed under Node 22, including locked installs, Worker startup, browser checks, format checks, and the high-severity npm audit

Risk

No application-runtime code changes. The Worker development toolchain moves within Wrangler 4.x and CI exercises it under the repository's required Node 22 runtime.

@adewale
adewale force-pushed the codex/pbt-fuzz-next-step branch from e3b5179 to d2c26a5 Compare August 31, 2026 00:13
@adewale
adewale force-pushed the codex/pbt-fuzz-next-step branch from d2c26a5 to 4897be1 Compare August 31, 2026 00:15
@adewale adewale mentioned this pull request Sep 23, 2026
7 tasks
@adewale
adewale marked this pull request as ready for review September 23, 2026 14:20
@adewale
adewale merged commit b6e9062 into main Sep 23, 2026
1 check passed
adewale pushed a commit that referenced this pull request Sep 24, 2026
Wrangler upgrades kept arriving as manual fixes once the high-severity
npm audit gate went red (#12, and twice in #13). Dependabot now
proposes weekly updates for:

- npm (Wrangler), after a 3-day cooldown;
- uv, limited to hypothesis, pillow and workers-py. Runtime packages
  stay on `make upgrade-runtime-deps`, since production vendors
  pylock.toml from Pyodide wheels, and Ruff upgrades stay deliberate
  because they add lint rules and must match `required-version`;
- GitHub Actions, grouped into one PR.

The toolchain contract test now asserts that Wrangler is exactly pinned
and consistent across package.json and package-lock.json instead of
hard-coding a version, so Dependabot's bumps can pass CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112H6AesYWoaS2XdDEHUJ4b
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