Skip to content

Cover the bundle-backed docs render path - #168

Merged
DavidBakerEffendi merged 1 commit into
mainfrom
dave/156-cover-docs-render-path
Aug 21, 2026
Merged

Cover the bundle-backed docs render path#168
DavidBakerEffendi merged 1 commit into
mainfrom
dave/156-cover-docs-render-path

Conversation

@DavidBakerEffendi

Copy link
Copy Markdown
Collaborator

Closes #156.

The publish failed on generated results.md does not begin with a heading
because nothing exercised the code that renders a bundle's pages. Local checks
(results:check, astro check, links:check) all run the no-bundle
placeholder
, which shares almost no code with the path that matters, so the
manual publish was the only integration test.

The suite

The rendering helpers are pure and read the page body from disk, so a realistic
generated page drives them without a checksum-valid bundle. Bundle validation
belongs to the publish itself and is deliberately not re-tested here — that was
the awkward part flagged in the issue, and testing the helpers directly is the
way around it.

Fixtures are shaped after what generate-results actually emits: provenance
comment first, an H1 in results.md and none in case-comparison.md, and
](../…) links relative to the bundle root.

Covered:

  • frontmatter leads the page
  • the generated H1 is demoted, so Starlight does not render two titles
  • the generator preamble survives transport
  • bundle-relative links become release-absolute; site-relative, absolute, and
    anchor links are left alone
  • index.md gets evidence/ and case-comparison.md gets ../evidence/
  • a page without the preamble is refused

These have teeth. Reintroducing the original startswith("#") guard turns
9 of the 14 red; restoring it turns them green. They hold the missing
behaviour rather than restating the implementation.

Python tests now run on pull requests

Following the issue's second half: test.yml ran no Python at all. Only the
reference-environment, freeze, and reproduction-contract workflows invoked
unittest, and each names a single file — so tests/test_generate_docs_evidence.py
had never run in CI. This uses discovery rather than another named file, so
the next suite added is not silently skipped.

Discovery finds 39 tests across the five suites; all pass.

🤖 Generated with Claude Code

The publish failed on "generated results.md does not begin with a heading"
because nothing exercised the path that renders a bundle's pages. Local checks
run the no-bundle placeholder, which shares almost no code with it, so the
manual publish was the only integration test and the bug reached production.

Add a suite over the rendering helpers. They are pure and read the page body
from disk, so a realistic generated page drives them without a checksum-valid
bundle; bundle validation belongs to the publish and is not re-tested. The
fixtures are shaped after what the Rust generator actually emits: the
provenance comment first, an H1 in results.md and none in case-comparison.md,
and links relative to the bundle root.

Covered: frontmatter leads, the generated H1 is demoted so Starlight does not
render two titles, the generator preamble survives, bundle-relative links
become release-absolute while site-relative and anchor links do not, the
sibling prefix differs between a page at /results/ and one a segment deeper,
and a page without the preamble is refused. Reintroducing the original guard
turns 9 of these red, so they hold the behaviour that was missing rather than
restating the implementation.

Also run Python tests on pull requests. These suites ran nowhere: only the
reference-environment, freeze, and reproduction-contract workflows invoked
unittest, each naming a single file, so tests/test_generate_docs_evidence.py
had never run in CI at all. Discovery is used rather than another named file,
so the next suite is not added and silently never run.

Testing: discovery finds 39 tests across the five suites and they pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@DavidBakerEffendi
DavidBakerEffendi merged commit dea2027 into main Aug 21, 2026
5 checks passed
@DavidBakerEffendi
DavidBakerEffendi deleted the dave/156-cover-docs-render-path branch August 21, 2026 15:00
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.

Cover the bundle-backed docs render path in CI

1 participant