Skip to content

feat(corpus-v3): Wave 7b polish — reverse-relation panel · 1893 alias redirects · /corpus/graph/ live stats · Pagefind facets#272

Merged
ThorFuchs merged 1 commit into
mainfrom
feat/corpus-v3-wave-7b-polish
May 23, 2026
Merged

feat(corpus-v3): Wave 7b polish — reverse-relation panel · 1893 alias redirects · /corpus/graph/ live stats · Pagefind facets#272
ThorFuchs merged 1 commit into
mainfrom
feat/corpus-v3-wave-7b-polish

Conversation

@ThorFuchs
Copy link
Copy Markdown
Collaborator

Summary

Wave 7b adds four discoverability / navigability enhancements on top of Wave 7 (PR #271):

# What File(s)
1 Reverse-relation panel — incoming-edge graph (1417 items have 5681 reverse edges) scripts/generate_corpus_v3_pages.py + _includes/corpus-v3/relation-panels.html
2 1893 alias short-route redirects (/thm0001//id/cid000010/, etc.) scripts/generate_corpus_v3_alias_redirects.py + _corpus_v3_alias_redirects/ + _config.yml
3 /corpus/graph/ live v3 stats block with totals, type distribution, sample item links, doctrine pointer corpus/graph/index.md
4 Pagefind facets on every corpus-v3-item page (filter by type/status/lane, surface CID + alias in hit cards) _layouts/corpus-v3-item.html

Sample reverse-index payload on THM0001

downstream_uses:
- source_cid: cid000001       # BOK0001 Book II monograph
  source_primary_alias: BOK0001
  source_type: monograph
  predicate: has_part
- source_cid: cid000002       # CHP0001 Chapter 5
  ...
- source_cid: cid000022       # PRF0001 the proof
  predicate: proves
- source_cid: cid000020       # FTH0001 Lean formal theorem
  predicate: formalizes
...

Alias redirect stats

  • 1893 typed aliases with public visibility
  • 0 collisions with reserved top-level site paths
  • Examples: /thm0001/ /def0001/ /lem0001/ /prp0001/ /cor0001/ /axm0001/ /cns0001/ /bok0001/ /chp0001/ /pap0001/ /not0001/ /dos0001/ /rel0001/ /mod0001/ /fdf0001/ /fth0001/ /flm0001/ /fax0001/ /rsl0001/ /prf0001/

Test plan

  • CI green (build + Atlas integrity unaffected)
  • /id/cid000010/ (THM0001) renders "Downstream uses (computed)" panel with chip links to BOK0001, CHP0001, NOT0001, PRF0001-PRF0006, FTH0001, etc.
  • /thm0001/ returns 200 + 301-redirects to /id/cid000010/
  • /def0001/, /pap0001/, /dos0001/, /mod0001/, /fth0001/, /rsl0001/, /prf0001/ all redirect to corresponding /id/cid######/
  • /corpus/graph/ renders the new "Corpus v3 — live graph stats" section with totals chips + type distribution + sample item links
  • Pagefind UI surfaces cid: + alias: in search hit cards for corpus-v3 items

Net diff

3785 files changed, 41985 insertions(+), 3 deletions(-)

Most of the file count is regenerated _corpus_v3_items/*.md (1886 files with downstream_uses[] added) + new _corpus_v3_alias_redirects/*.md (1893 redirect files). Source code changes are small: 4 scripts/layouts touched (~150 lines net).

🤖 Generated with Claude Code

…rects + /corpus/graph/ stats + Pagefind facets

Builds on Wave 7 (PR #271) with four discoverability and navigability
enhancements that surface the Corpus v3 graph more deeply on the public
site.

What lands

  scripts/generate_corpus_v3_pages.py
    Extended with build_reverse_index() — computes the incoming-edge
    graph by walking every item's relations[] + convenience fields
    (depends_on, contains, formalized_by, appears_in, part_of, proves,
    supports, formalizes). Result: 1417 items have downstream links,
    5681 total reverse edges tracked. Each page now carries the
    downstream_uses[] frontmatter for the relation panel.

  _includes/corpus-v3/relation-panels.html
    Adds a "Downstream uses (computed)" panel rendering the reverse
    index. Each chip shows source primary alias + source type, with
    full tooltip (title + predicate) and 25-item cap with overflow note.
    Critical Wikipedia-style discoverability per web addendum §6.

  scripts/generate_corpus_v3_alias_redirects.py
    New generator emitting one Jekyll redirect page per public typed
    alias under _corpus_v3_alias_redirects/{alias-lower}.md → /id/{cid}/.
    Skips aliases that collide with reserved top-level paths (verify,
    publications, etc.). 1893 redirects generated, 0 collisions.
    Doctrine §14.3 — alias short routes for citation continuity.

  _config.yml
    Adds corpus_v3_alias_redirects collection with permalink: /:name/.

  corpus/graph/index.md
    Adds "Corpus v3 — live graph stats" section reading from
    site.data.corpus_v3.cid-index. Renders total Corpus Items + total
    aliases + total v2→v3 transitions as a totals chip. Type
    distribution as 2-column ul. Six representative sample item pages
    for orientation. Discipline pointer back to the Charter.

  _layouts/corpus-v3-item.html
    Adds data-pagefind-filter (lane, type, status) and data-pagefind-meta
    (cid, primary alias) on the article element. Enables Pagefind UI to
    filter search results by item type/status and surface CID + primary
    alias in search hit cards.

Sample reverse-index links surfaced

  THM0001 (master constant calibration)
    BOK0001 monograph (has_part) — Book II contains this theorem
    CHP0001 chapter (has_part) — Chapter 5 derives it
    NOT0001 research note (summarizes)
    PRF0001 proof (proves) + PRF0002 (uses)
    FTH0001 formal theorem (formalizes)
    ...etc

  DEF0001 (earned boundary constants)
    BOK0001 + CHP0001 (introduces / has_part)
    LEM0001 (depends_on) + PRP0001 (depends_on)
    THM0001 (depends_on)
    PRF0001-PRF0006 (uses) — every proof item uses this
    ...etc

Total: 1893 alias redirects ready to ship (e.g., /thm0001/, /def0001/,
/pap0001/, /dos0001/, /mod0001/, /fth0001/ — every typed alias).

Net diff: ~1900 files modified (mostly downstream_uses[] frontmatter
additions to existing _corpus_v3_items/*.md) + 5 new files (alias
redirects script, ~1893 redirect MD files, _config.yml addition,
relation-panels.html update, /corpus/graph/ append).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ThorFuchs ThorFuchs requested a review from AnSoFuchs as a code owner May 23, 2026 20:45
@ThorFuchs ThorFuchs merged commit 35bd091 into main May 23, 2026
5 checks passed
@ThorFuchs ThorFuchs deleted the feat/corpus-v3-wave-7b-polish branch May 23, 2026 20:57
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