Skip to content

fix: pre-0.3.0 audit remediation#46

Merged
DemchaAV merged 3 commits into
developfrom
fix/pre-0.3.0-audit
Jul 3, 2026
Merged

fix: pre-0.3.0 audit remediation#46
DemchaAV merged 3 commits into
developfrom
fix/pre-0.3.0-audit

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Why

A pre-release audit before cutting v0.3.0 (9 dimensions, each factual finding
adversarially verified) surfaced 0 blockers but 45 verified findings — mostly
places where the library silently dropped content or diverged from its own
documented behaviour. This PR lands the correctness fixes, the safe minors, and
the release hygiene. The larger refactors are deferred to a follow-up (below).

What changed

Correctness (17ac17d)

  • Tables render as GitHub-Flavored Markdown. Flexmark's permissive defaults
    (column spans, extra header rows, trailing [caption]) were dropped by the
    mapper without a trace, and a header-less table mapped to null — its whole
    body vanished, invisible even to strict mode. The parser pins GFM options, and
    mapTable now surfaces a header-less table as UnsupportedBlockNode.
  • List-item continuation blocks keep the item indent instead of rendering
    flush against the page margin, left of their own marker.
  • The custom-renderer seam is open for headings/TOC: RenderContext.headingSlug(HeadingNode)
    and tocEntries() are public and TocEntry is a public record, so an external
    heading/TOC renderer declares the same planned anchors [TOC] links to instead
    of a desynced fresh slug.
  • Undefined [^label] renders as literal text, not a dangling numbered superscript.
  • Heading slugs stay unique even when a later heading's text slugifies to an
    already-generated -N anchor.
  • Dark themes get a dark-tuned alert palette (AlertColors.defaultDark); the
    light amber accents were below a readable contrast on the dark surface.
  • Locale.ROOT on the four case-folding sites (a Turkish locale broke :::INFO).

Release hygiene (66eff1b)

  • CLI --version is drift-proof: it read a hard-coded, already-stale
    0.2.0-SNAPSHOT; it now reads the Maven-filtered gcmd-cli.properties via a
    picocli IVersionProvider, tracking the module version the lockstep guard enforces.
  • README/examples version-status strings corrected; GP-Test/ gitignored;
    cli junit-bom aligned to 6.1.1.

Docs (7418041)

  • Manual's Installation section gains the "not yet on Central" caveat (README
    already had it); manual.pdf / manual-dark.pdf re-rendered to match, via a new
    opt-in ManualTest#regeneratesTheCommittedManualPdfs.

Verification

  • ./mvnw test -pl .188 green (1 skipped = the opt-in manual regenerator).
  • ./mvnw -f cli/pom.xml package7 green (incl. a --version assertion); the
    built jar prints graph-compose-markdown CLI 0.3.0-SNAPSHOT.
  • ./mvnw -f examples/pom.xml test-compile → green.
  • ./mvnw javadoc:javadoc -pl . → clean.

4 new tests: TableGfmParityTest, ListContinuationIndentTest (glyph-x geometry),
UndefinedFootnoteTest, HeadingSlugSeamTest.

Deferred to a follow-up PR

Bigger or riskier items from the audit (report §5): break the theme↔render and
theme↔extension package cycles, abstract the 4–5 hand-mirrored tree walks, the
dead SpacingTokens.headingSpaceBelow token, the code-block lineSpacing unit
mismatch, missing with* methods / PageTokens.of / RenderContext.of factories,
@since + package-info backfill, a golden-image regression harness, and exposing
the new 0.3.0 features through CLI flags.

DemchaAV added 3 commits July 3, 2026 14:21
A 9-dimension audit before cutting v0.3.0 surfaced several places where the
library silently dropped content or diverged from its own documented behaviour.

- Tables now parse as GitHub-Flavored Markdown. Flexmark's permissive defaults
  (column spans, multiple header rows, trailing `[caption]` lines) were all
  dropped by the mapper without a trace — a caption vanished, and a header-less
  table mapped to null, discarding its whole body invisibly even to strict mode.
  The parser pins GFM options and mapTable now surfaces a header-less table as
  UnsupportedBlockNode (rejected in strict, shown verbatim otherwise).
- List-item continuation blocks (a second paragraph, code block, quote) kept the
  item's left indent instead of rendering flush against the page margin, left of
  the marker. Nested lists, which compute their own indent, are unchanged.
- The custom-renderer seam the docs advertise for headings/TOC is now reachable:
  RenderContext.headingSlug(HeadingNode) and tocEntries() are public and TocEntry
  is a public record, so an external heading/TOC renderer can declare the same
  planned anchors [TOC] links to instead of allocating a desynced fresh slug.
- An undefined [^label] renders as literal text (CommonMark) rather than a
  numbered, dangling superscript with a gap in the run.
- Heading slugs stay document-unique even when a later heading's own text
  slugifies to an already-generated -N anchor (Foo / Foo / Foo 1).
- The built-in dark themes ship a dark-tuned alert palette (AlertColors.defaultDark);
  the light amber accents fell below a readable contrast on the near-black surface.
- Case-folding for custom-block dispatch, callout variants, image-URL schemes and
  inline-HTML detection uses Locale.ROOT (a Turkish locale broke :::INFO dispatch).

Tests: TableGfmParityTest, ListContinuationIndentTest (glyph-x geometry),
UndefinedFootnoteTest, HeadingSlugSeamTest added; full suite 188 green.
Housekeeping surfaced by the audit, none of it changing rendered output.

- CLI --version was hard-coded "0.2.0-SNAPSHOT" and had already gone stale at
  the v0.2.0 tag (the lockstep guard does not check it). It now reads the
  Maven-filtered gcmd-cli.properties via a picocli IVersionProvider, so it
  tracks the module <version> the guard already enforces and cannot drift again.
- README status line (two releases stale) and examples/README install line
  (claimed 0.1.0-SNAPSHOT while it installs 0.3.0-SNAPSHOT) corrected.
- The scratch sandbox project GP-Test/ is gitignored so a stray `git add .`
  cannot commit it.
- cli/ junit-bom pin aligned to 6.1.1 (matched the other synchronized pins).

Verified: `mvn -f cli/pom.xml package` green (7 tests, incl. a --version
assertion); the built jar prints "graph-compose-markdown CLI 0.3.0-SNAPSHOT".
The manual's Installation section showed a plain Maven dependency with no
"not yet on Central" caveat (the README already carries one), so it implied an
artifact that cannot be resolved yet. Added the caveat and re-rendered the
committed manual.pdf / manual-dark.pdf so they match the source.

Also adds ManualTest#regeneratesTheCommittedManualPdfs — an opt-in test
(`-Dgcmd.regenerateManual=true`) that rewrites both PDFs from manual.md with the
exact composers the other tests assert against, so the checked-in PDFs have a
single, drift-free way to be refreshed.
@DemchaAV DemchaAV merged commit b6b8371 into develop Jul 3, 2026
4 checks passed
@DemchaAV DemchaAV deleted the fix/pre-0.3.0-audit branch July 4, 2026 08:46
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