Skip to content

chore(blueprint): regenerate import_graph_colored {svg,png} (refresh)#129

Merged
cameronfreer merged 2 commits into
mainfrom
regen-import-graphs
May 28, 2026
Merged

chore(blueprint): regenerate import_graph_colored {svg,png} (refresh)#129
cameronfreer merged 2 commits into
mainfrom
regen-import-graphs

Conversation

@cameronfreer

Copy link
Copy Markdown
Owner

Summary

The colored module-import graph artifacts in blueprint/web/ were last regenerated on 2026-01-13 (commit 15370489); the module list has drifted ~5 months. This PR refreshes the two static artifacts that are actually embedded as <img> in README.md and home_page/index.md:

  • blueprint/web/import_graph_colored.svg — 105 clickable nodes (matches current Exchangeability/**/*.lean count)
  • blueprint/web/import_graph_colored.png — 2304×456 / 272 KB (was 2400×508 / 293 KB)

Procedure

  1. lake exe graph /tmp/g.dot → fresh uncolored DOT
  2. Apply 3-way proof coloring via a small Python pass: blue #6baed6 for ViaMartingale, green #74c476 for ViaL2, orange #fd8d3c for ViaKoopman, red-ish #fc9272 for the top-level Theorem* files, gray #e0e0e0 for shared infrastructure
  3. dot -Tsvg colored.dot -o ...svg and dot -Tpng -Gsize="24,5" colored.dot -o ...png
  4. scripts/make_svg_clickable.py to add <a xlink:href> per node

This isn't a pixel-perfect reproduction of the Jan 2026 palette (the original used ~14 distinct shades subdividing each proof family); this is a simpler 3-way scheme matching the user-facing claim "Modules colored by proof".

Still deferred to a follow-up

File Reason
blueprint/web/import_graph_colored.html lake exe graph file.html produces a valid sigma.js viewer with the current module list, but uses the lake-default grayscale palette (by decl_count), not per-proof coloring. Replacing the existing colored HTML with an uncolored one would be a quality regression on the "Interactive" link. Keeping the existing file for now; proper fix needs sigma.js attribute injection.
blueprint/web/import_graph_full_declarations.html Produced by doc-gen4 inside the docgen-action CI step. Can't be regenerated locally. The live GitHub Pages copy is refreshed by the CI deploy on every push to main, so the user-facing version IS current; only the checked-in mirror is stale.

Test plan

  • lake build clean (3527/3527, 0 warnings)
  • lake exe checkdecls blueprint/lean_decls passes
  • python3 blueprint/check_blueprint.py passes
  • SVG parses cleanly; 105 <g class="node"> elements with one <a xlink:href> each
  • PNG dimensions and size comparable to previous artifact

Net: 2 files (svg + png), +1,073 / −1,037 lines for SVG; binary delta for PNG.

…refresh)

The colored module-import graph artifacts in `blueprint/web/` were last
regenerated 2026-01-13 (commit 1537048); the module list they showed
was missing PRs from the past 5 months of restructuring.

Procedure:

1. Generate a fresh DOT via `lake exe graph /tmp/g.dot` — gives 104
   `Exchangeability.*` modules from the current import graph.
2. Apply 3-way proof-based coloring: blue (#6baed6) for ViaMartingale,
   green (#74c476) for ViaL2, orange (#fd8d3c) for ViaKoopman, red-ish
   (#fc9272) for the top-level `Theorem*` files, gray (#e0e0e0) for
   shared infrastructure.
3. Render: `dot -Tsvg colored.dot -o ...svg` and
   `dot -Tpng -Gsize="24,5" colored.dot -o ...png` (the `-Gsize` bound
   keeps PNG dimensions and file size close to the previous artifact).
4. Post-process SVG via `scripts/make_svg_clickable.py` to add `<a
   xlink:href>` per node pointing at the doc page.

Result: SVG has 105 clickable nodes (one per current `Exchangeability/`
`.lean` file); PNG is 2304×456 / 272 KB (was 2400×508 / 293 KB).

### Still deferred

* `blueprint/web/import_graph_colored.html` — the interactive
  sigma.js viewer. `lake exe graph file.html` produces a valid HTML with
  the current module list, but its node-coloring scheme is the lake
  default (uncolored / grayscale by `decl_count`), not the per-proof
  palette. Reproducing the proof colors in the interactive view would
  need additional sigma.js attribute injection; left for follow-up to
  avoid downgrading the existing colored interactive view.
* `blueprint/web/import_graph_full_declarations.html` — produced by
  doc-gen4 inside the `docgen-action` CI step; can't be regenerated
  locally. The live GitHub Pages copy is refreshed on every push to
  main.

Sanity gates pass:
* `lake build` 3527/3527, 0 warnings
* `lake exe checkdecls blueprint/lean_decls` passes
* `python3 blueprint/check_blueprint.py` passes
…oot node

Reviewer caught that the SVG had 105 node groups but only 104 \`<a>\`
wrappers — the umbrella module node \`<!-- Exchangeability -->\` was
left unlinked because the regex required a dot-separated suffix.

Loosen the regex from
\`^<!-- (Exchangeability\\.[^\\s]+) -->$\` to
\`^<!-- (Exchangeability(?:\\.[^\\s]+)?) -->$\` so a bare
\`Exchangeability\` matches too. Reran the script on the existing
colored SVG; node groups and link wrappers are now both 105, and the
root \`Exchangeability\` node links to
\`https://cameronfreer.github.io/exchangeability/docs/Exchangeability.html\`.
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