Skip to content

Publish a dependency graph and tree for the Math Reference pages - #166

Merged
d-morrison merged 3 commits into
mainfrom
claude/project-thread-j628gi
Nov 12, 2026
Merged

d-morrison merged 3 commits into
mainfrom
claude/project-thread-j628gi

Conversation

@d-morrison

@d-morrison d-morrison commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Ezra · project thread

Closes #165.

Why

mds already treats 40 mcs definitions as prerequisites (391 edges in its published dependency-graph.json), but mcs publishes no graph of its own. Because of that, no tree can show how the mcs definitions depend on each other, and the cross-repo tree on lds leaves mcs out entirely. This PR is step 1 of the plan from Ezra's thread. Step 2 adds a combined mcs+mds tree to mds. Step 3 adds mcs to the lds all-notes tree, then a radial layout and grouping (lds#2298).

What changed

  • tools/build_dependency_graph.py and dependency-graph.js: copied unchanged from lds. The lds JavaScript has the guard from lds#1698 that the mds, pds and sds copies lack (lds#2412).
  • _quarto-website.yml: a pre-render step builds dependency-graph.json from the top-level pages, and the script and JSON are published as resources. A Dependency Tree entry is added at the end of Math Reference in both the navbar and the sidebar.
  • dependency-tree.qmd: the tree page, HTML only (like lds's all-notes tree), since the tree is drawn in the browser. Only this page loads the script. The chapters/ pages reuse 105 of the same ids and share three page names (sets, relations, induction), so loading the script site-wide would draw per-div graphs on chapter pages that link to the wrong page.
  • .gitignore: ignores the generated JSON, as mds does.
  • CLAUDE.md: names the new files in the layout list.

Size

The diff is over the 300-line cap only because of tools/build_dependency_graph.py and dependency-graph.js (516 lines), which are byte-identical copies of the lds files. They are copied, not written here (mechanical, content-identical). The rest of the PR is about 40 lines.

Scope

The graph covers only the Math Reference pages, because those are the pages the other sites link to. Graphing chapters/ needs the builder to handle several page directories, so that is a follow-up.

Verification

  • The builder reports 162 nodes, 300 edges, 0 cycles and 0 forward references. All 40 mcs nodes in mds's graph match a node here by id, so the cross-site tree will join them.
  • quarto render dependency-tree.qmd --to html succeeds. The rendered page loads the script once, and the theorem link resolves to ./proof-writing.html#def-theorem.
  • I ran the script on the rendered page under jsdom (no browser). It drew 162 boxes, each linking to its page, for example expressions-algorithms.html#def-algorithm.

Generated by Claude Code

mds records 40 mcs definitions as prerequisites, but mcs publishes no
graph, so no tree can show how the mcs definitions depend on each other.
Copy the shared builder and script (the lds copies), build
dependency-graph.json before each render from the top-level pages, and
add a Dependency Tree page under Math Reference. Only that page loads the
script, since the chapters/ pages reuse some of the same ids.

Closes #165

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9mnLpkrgpT23d9m5ee
Copilot AI balanced review requested due to automatic review settings November 12, 2026 22:51
@d-morrison d-morrison self-assigned this Nov 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

The tree is drawn by a script in the browser, so the slides, PDF and
Word outputs would show an empty box under text about hovering and
clicking (review of #166). lds's all-notes tree is HTML only too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9mnLpkrgpT23d9m5ee
Copilot AI balanced review requested due to automatic review settings November 12, 2026 22:54

Copy link
Copy Markdown
Contributor Author

Addressed in e83304b:

  • CLAUDE.md: the layout list now names tools/build_dependency_graph.py, dependency-graph.js and dependency-tree.qmd. It also covers the pre-render step and the git-ignored JSON, and says the builder and script are copies of the lds ones.
  • dependency-tree.qmd: the page is now HTML only, as lds's all-notes tree is. It renders to _site/dependency-tree.html and nothing else.

Deferred: dependency-graph.js fetch failure. This file is a byte-identical copy of lds's chapters/dependency-graph.js, and four repos share it. Changing it here alone would add a fifth variant to the drift that lds#2412 already tracks. I've added the "graph unavailable" message to that issue, so all the copies get it together: https://github.com/Morrison-Lab/lds/issues/2412


Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

… gets a 404

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9mnLpkrgpT23d9m5ee
Copilot AI balanced review requested due to automatic review settings November 12, 2026 22:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


I fetched PR 166 live just now. It is open, not a draft and not merged, and its head is 749d8c44bd8c1cbe0f09938bd9c014de33f19654. That is the commit I reviewed, so the review above stands.

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "749d8c44bd8c1cbe0f09938bd9c014de33f19654",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "The dependency-tree.qmd front matter now declares only html, matching the script loading, and CLAUDE.md documents the new graph files; the silent fetch catch in dependency-graph.js is a deliberate, non-blocking suggestion.",
  "holistic_assessment": "Both blocking items from the prior round are resolved, scope remains limited to the dependency graph feature, and regression risk to existing chapters is low."
}

Reviewed commit: 749d8c4

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $0.2105 (review) — run

@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2
🚀 Preview available at: https://Morrison-Lab.github.io/mcs/pr-preview/pr-166/

Built to branch gh-pages at 2026-11-12 23:09 UTC.

@d-morrison

Copy link
Copy Markdown
Contributor Author

Cross-harness review (agy Flash) on 749d8c4: VERDICT: CLEAN

The dependency-graph builder and viewer are consistent with the navigation, .gitignore and CLAUDE.md entries; no logic bugs or broken targets found. Reviewed from the diff only; the page was not rendered by me.

Posted by Claude Code (AI agent) --- not written by a human.

@d-morrison
d-morrison merged commit 1b742c4 into main Nov 12, 2026
42 checks passed
@d-morrison
d-morrison deleted the claude/project-thread-j628gi branch November 12, 2026 23:45
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.

Publish a dependency graph and tree for the Math Reference pages

3 participants