Skip to content

Report review and pull-request counts, light the graph nodes, move the heatmap up - #63

Closed
realmarcin wants to merge 5 commits into
feat/heatmap-column-orderfrom
feat/mech-pr-and-review-stats
Closed

realmarcin wants to merge 5 commits into
feat/heatmap-column-orderfrom
feat/mech-pr-and-review-stats

Conversation

@realmarcin

Copy link
Copy Markdown
Contributor

Stacked on #60 — its base is feat/heatmap-column-order, so merge that one first and this retargets to main on its own. The rebase kept both: the columns still sort by how widely each vocabulary is shared, and the caption wording from #60 travelled with the heatmap when it moved.

Merged pull requests, on the strip and on every card. A fifth stat tile carries 2,097 merged PRs summed across the nine Mech repositories, and each card gains a line of small print under its headline number with that Mech's reviewed records and merged PRs.

Mech reviewed merged PRs
HabitatMech 684 119
CommunityMech not tracked 476
TraitMech 427 373
CellStructureMech 0 143
ProteinTraitsMech 39,459 302
NaturalProductMech 0 43
AntibioticMech 80 61
MediaIngredientMech not tracked 337
CultureMech not tracked 243

Where "reviewed" comes from. Whether a Mech tracks review is read from its LinkML schema, not from the values its records happen to carry. Six declare a status slot whose enum permits REVIEWED, so a zero there is a real zero. MediaIngredientMech and CultureMech do have a mapping_status, but its enum runs UNMAPPED to AMBIGUOUS and never reaches REVIEWED, so it grades mapping rather than review; CommunityMech has no such slot. Those three print only their PR count, because "nobody has reviewed one" and "this Mech does not track review" are different claims and the page should not make the second look like the first.

Both numbers come from the new scripts/fleet/mech_stats.py and are substituted into the markup by assemble_page.py, which now fails the build on an unsubstituted placeholder. HabitatMech's headline drops its own "684 reviewed" now that every card carries the figure in the same place.

The heatmap moves above the graph, from the template into the fragment, since the graph is what it explains. Its heading is raw HTML carrying the id kramdown would have generated, because markdown is not processed inside the fragment.

Graph nodes are lit as spheres. One highlight gradient and one limb gradient, both in objectBoundingBox units so a single pair serves every node, neither carrying a hue, both multiplying over whichever Mech colour is underneath. The weighting is a theme token because it has to change: light-theme Mech colours are far darker, since they carry their contrast against white, and a limb tuned for the dark theme turned them to mud. The overlay circles take no pointer events, so hovering still hits the node. The hub keeps its flat fill and reads as the centre rather than a tenth planet.

NaturalProductMech gets its Browse button. It was the only card without one, because it had no published site when the page was written. It has one now: the repository root redirects to pages/index.html, which serves a browser over all 3,115 structures. Verified with a request to the live URL, not from the repository settings alone. The ladder link, the graph's site link and index.md stop pointing at GitHub.

Layout. The stat strip steps 5 to 3 to 2 columns on explicit breakpoints. auto-fit picks four between roughly 700px and 1010px, which leaves the fifth tile alone on a row and stretched across it.

Verified in Chrome against a local render of the page: five tiles with only the longest label wrapping, nine card stat lines, eighteen shading circles over nine nodes, the heatmap ahead of the graph in document order with no horizontal overflow, and the spheres checked in both themes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BXHrBTSU8fU4Zg7HfaMKs9

realmarcin and others added 4 commits September 10, 2026 21:30
The 22 columns were in the order they were first written down, so the table
said nothing by its shape: a vocabulary every Mech uses sat next to one only
ProteinTraitsMech has. They now sort left to right by the number of Mechs that
ground anything in the vocabulary, ties broken by the total records citing it
across the fleet, then by name so the order is stable when a vocabulary
appears in no records at all.

PMID and DOI are pinned to the right end instead of sorted. Every Mech cites
literature, so both would rank first on Mech count and crowd out the
vocabularies that actually say what the fleet shares; they also have no record
counts to rank by, since build_subsets.py skips citation prefixes.

The result runs NCBITaxon and ChEBI at nine Mechs each, through GO at six and
a five-Mech tier of UniProt, ENVO and UBERON, down to RHEA, MIBiG, NPAtlas and
GTDB at one. The order is computed in build_data.py, so a corpus refresh
re-derives it rather than leaving the columns stale.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BXHrBTSU8fU4Zg7HfaMKs9
Review of #60 found the list of prefixes that name a paper rather than a
concept written down twice, in scripts that cannot see each other:
build_subsets.py skipped them with a literal tuple so they get no record
lists, and build_data.py declared its own copy to pin them to the right of the
heatmap. Adding a third prefix to one would have left the other sorting it to
the far left on Mech count with no record total to break the tie, which is the
failure the pin exists to prevent.

Both now import CITATION from roots.py, which already owned the other shared
fact about the corpora. build_data.py also stops redeclaring ORDER, which
roots.py has derived from RECORD_GLOBS since #40.

fleet_data.json rebuilds byte-identical, so this changes no published number.

Closes #61

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BXHrBTSU8fU4Zg7HfaMKs9
Four changes to the fleet page, all asked for:

The stat strip gains a fifth tile, 2,097 merged pull requests summed across the
nine Mech repositories, and each Mech card gains a line of small print under
its headline number carrying that Mech's reviewed records and merged PRs.
Both come from scripts/fleet/mech_stats.py and are substituted into the markup
by assemble_page.py, so a recount moves the page instead of quietly disagreeing
with it.

Whether a Mech tracks review at all is read from its LinkML schema rather than
from the values its records happen to carry. Six declare a status slot whose
enum permits REVIEWED, so a count of zero there is a real zero.
MediaIngredientMech and CultureMech have a mapping_status, but its enum runs
UNMAPPED to AMBIGUOUS and never reaches REVIEWED, so it grades mapping rather
than review; CommunityMech has no such slot. Those three print only their PR
count, because "nobody has reviewed one" and "this Mech does not track review"
are different claims and the page should not make the second look like the
first. HabitatMech's headline drops its own "684 reviewed", now that every
card carries the same figure in the same place.

The Shared vocabulary heatmap moves above the graph, from the template into the
fragment, since the graph is what it explains. Its heading is written as raw
HTML with the id kramdown would have generated, because markdown is not
processed inside the fragment.

Graph nodes are shaded as lit spheres: one highlight and one limb gradient in
objectBoundingBox units, so a single pair serves every node, neither carries a
hue, and both multiply over whichever Mech colour is underneath. The weighting
is a theme token because it has to change between themes -- light-theme Mech
colours are far darker, carrying their contrast against white, and a limb
tuned for the dark theme turned them to mud. The overlays take no pointer
events, so hovering still hits the node. The hub keeps its flat fill and reads
as the centre rather than a tenth planet.

The stat strip steps 5 -> 3 -> 2 columns on explicit breakpoints. auto-fit
picks four between roughly 700px and 1010px, which leaves the fifth tile alone
on a row and stretched across it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BXHrBTSU8fU4Zg7HfaMKs9
The Mech card offered only a GitHub button while the other eight offered
Browse, because NaturalProductMech had no published site when the page was
written. It has one now: the repository root redirects to pages/index.html,
which serves a browser over all 3,115 structures, and the Pages deployment
reports built. Verified with a request to the live URL, not from the
repository settings alone.

The card gains its Browse button, the ladder link and the graph's site link
stop pointing at GitHub, and index.md stops doing so too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BXHrBTSU8fU4Zg7HfaMKs9
Copilot AI lite review requested due to automatic review settings September 11, 2026 08:26

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 reached their quota limit.

Five findings from the review of #63:

The graph's accessible title said "the eight Mech knowledge bases". It has
drawn nine since NaturalProductMech joined, and that title is the whole
description a non-sighted reader gets of the graph. Closes #67.

Three cards show a merged-PR count with no reviewed count beside it, which
reads as an oversight rather than as the deliberate refusal to print a
misleading zero that it is. The cards intro now names those three and says
their schemas have no field that records review. Closes #65.

mech_stats.py called its PR count "the closest thing the fleet has to a measure
of how much human review the corpus has passed through". It is not: seeding
runs, regeneration and dependency updates merge the same way curation does.
The docstring now says it measures development activity, not how much of it was
human. Closes #66.

mech_stats.py is the only pipeline script that needs PyYAML, and the repository
declares no Python dependencies, so a clean interpreter met a traceback. It now
stops with the install command instead, the way roots.py handles a missing
checkout. Closes #68.

_fleet/README.md gains the new pipeline step, its two external requirements and
its --no-prs flag, and stops saying NaturalProductMech publishes no site.

Left filed: #64, that the card record totals date from the 2026-09-08 census
while the reviewed counts are from today. Closing it means rerunning both
scanning passes and changing the card numbers, and CellStructureMech's 57 on
the page against 108 files matched today is too wide a gap to adopt without
first working out which of the two the card means.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BXHrBTSU8fU4Zg7HfaMKs9
@realmarcin

Copy link
Copy Markdown
Contributor Author

Adversarial review done, read-only, against feat/heatmap-column-order. Findings filed as #64 through #68.

What I checked beyond reading the diff:

  • Every nonzero heatmap pairing still has a record count behind it, and the column order from Order heatmap columns by how widely each vocabulary is shared #60 survived the rebase along with its caption wording. The heatmap block moved between files, so the caption was the thing most likely to be silently reverted to main's copy.
  • The reviewed counts were re-derived from each Mech's LinkML schema rather than from observed values, after finding that MediaIngredientMech's mapping_status enum runs UNMAPPED to AMBIGUOUS and never reaches REVIEWED. Counting observed values would have printed a false "0 reviewed" on two cards.
  • The shading overlays take no pointer events, so node hover and the tooltip still work, and no code changes a node's radius at runtime, so the three circles cannot drift apart.
  • Checked both themes. The light theme needed the shading weighted differently: its Mech colours are far darker because they carry contrast against white, HabitatMech being #2b6a4d on light against #4fbf85 on dark, and a limb tuned for dark turned them to mud.
  • Stat strip column counts measured at the breakpoints. auto-fit, which I used first, picks four columns between roughly 700px and 1010px and strands the fifth tile alone on a stretched row, so it is now explicit steps of 5, 3 and 2.

Addressed here: #65, #66, #67, #68, plus the pipeline README.

Left filed: #64. The card record totals are from the 2026-09-08 census while the reviewed counts are from today, and the two now sit one line apart, so a reader will divide them. TraitMech reads as 427 of 477 when today's corpus has 502. Closing it means rerunning both scanning passes and changing the card numbers, and CellStructureMech's 57 on the page against 108 files matched today is too wide a gap to adopt without first working out which of the two the card means.

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.

2 participants