Skip to content

fix: link-check extraction, deprecated tombstones, orphaned component, docs label (#3, #99, #48) - #101

Merged
maehr merged 4 commits into
textrefs:stagingfrom
maehr:fix/pre-release-cleanup
Aug 27, 2026
Merged

maehr merged 4 commits into
textrefs:stagingfrom
maehr:fix/pre-release-cleanup

Conversation

@maehr

@maehr maehr commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Four pre-release items from the v0.1.0 triage in #68. Each commit is self-contained.

fix(ci): repair the link-check URL extraction — closes #3

The 17 errors in the Link Checker Report were mostly not broken links.

The extractor trimmed trailing markup in a fixed order: strip one unbalanced ), then strip trailing punctuation. A URL that ends a markdown link inside a sentence or a bold run carries both at once, so the ) survived and lychee checked a truncated URL — …/Republic_(Plato, …/Bible_(King_James, …/4.0/), …/arks.org/)**, …/rfc3987)).

The trim now runs as a loop. Each pass strips trailing punctuation, then one unbalanced ), until the string stops changing. Backticks join the punctuation set, so a URL inside an inline code span is trimmed too. Wikipedia and Wikisource disambiguation titles keep their balanced parentheses.

Three smaller changes:

  • Drop percent-encoded resolver templates (%7B/%7D). The literal {} filter missed them, which is why sefaria.org/%7Bbook%7D… and wikidata.org/…/Q%7Bn%7D.json were checked as real URLs.
  • Skip node_modules, so a local data/node_modules cannot pull dependency READMEs into the list. CI never installs there; this keeps a local reproduction honest.
  • Exclude iso.org and loc.gov in lychee.toml. Both answer a bot with 403 and neither link is broken.

Verified

The step was extracted verbatim from the workflow YAML and run against the tree, then checked with the repo's own lychee.toml:

🔍 353 Total  ✅ 264 OK  🚫 3 Errors  👻 37 Excluded  🔀 49 Redirects

17 errors → 3. No URL in the list carries unbalanced parentheses any more.

The three that remain, and why they are not fixed here

[404] .../blob/main/decisions/ADR-0001-conforms-to-replaces-target-kind.md
[404] .../blob/main/decisions/ADR-0002-uuid-seed-semantic-identity.md
[404] .../blob/main/decisions/ADR-0006-mapping-relation-vocabulary.md

git ls-tree upstream/main decisions/ returns ADR-TEMPLATE.md and README.md only. main still sits at the bootstrap commit, so it carries no ADRs. The links name the right target on the right branch; merging #4 resolves all three, and main is the branch a citable baseline should point at. Repointing them at staging would be wrong. Verify after the tag — this is now a line in #68 §5.

The stale entries in the report are already gone from the sources: no perseus.tufts.edu/hopper/about/copyright, no %7B templates. Open Collective was excluded earlier.

fix(site): render a deprecated record as a tombstone — closes #99

Decision. deprecated renders the existing tombstone presentation with deprecated-specific copy and the normal superseded_by treatment. deprecated, withdrawn and blocked stay one tombstone category; their user-facing messages distinguish their different semantics.

This is option 2 in #99. The three statuses differ in reach, not in kind — a deprecated record is retained and still resolves, while a withdrawn or blocked record is additionally excluded from Work mapping projections — so the copy carries that difference and the markup does not.

The gap it closes: both derivation sites tested withdrawn and blocked only, while ADR-0004, specification.md:284, the Status enum comment and RETIRED_STATUSES in scripts/compile.ts all call deprecated a tombstone. A deprecated record rendered with no banner at all, and dropped its superseded_by link even though the .json sibling published it.

The copy, by status:

Status Banner
deprecated This record is deprecated. It is retained and it still resolves, but it is no longer recommended.
withdrawn This record has been withdrawn.
blocked This record is blocked by a rights, trust, or policy dispute.

Each then carries the successor link, or "No successor record exists."

Latent, not live: no record in the registry is deprecated today, so nothing was mis-rendered. The cost lands the first time a promoted record is corrected.

No spec change is needed. specification.md and versioning.md already say what this implements; the templates were the half that disagreed.

#100 is now unblocked. The copy still lives in two templates, and this decision is what its shared status module has to encode. A comment in [uuid]/index.astro names the pairing until then.

refactor(site): delete the orphaned CitationBox.astro — closes #48

No consumers. The reference page was the only one, and #30 replaced it with inlined Chicago and COinS rendering against src/lib/citation.ts. git grep CitationBox now returns nothing, and npm run build:fast produces identical dist/ output.

fix(github): label the docs issue template with a label that exists

Unrelated to the three above, and folded in because the tag freezes .github/.

.github/ISSUE_TEMPLATE/docs.yml asked for a docs label. The repository has no such label — it has documentation, which is what #68, #79 and #81 already carry. GitHub applies the labels an issue form names only when they exist, and does not create a missing one, so an issue filed through this template would arrive with triage alone and miss a label:documentation query. Every other template in the directory names a label that exists; this is the one that did not.

Latent so far: no issue in the repository carries triage, so nothing has been filed through the form yet.

Gate

npm run verify:fast — 0 errors, 0 warnings, 99 tests pass, all internal links valid, build complete. CI on this branch reports 354 URLs collected and 3 link errors, all three the ADR links above.

Commits are signed. This targets staging, per the release workflow in #68.

maehr and others added 3 commits August 27, 2026 16:03
The extractor trimmed trailing markup in a fixed order: strip one
unbalanced `)`, then strip trailing punctuation. A URL that ends a
markdown link inside a sentence or a bold run carries both at once, so
the `)` survived and lychee checked a truncated URL. Twelve of the
seventeen errors in the report were this, not a broken link.

Trim in a loop instead. Each pass strips trailing punctuation, then one
unbalanced `)`, until the string stops changing. Backticks join the
punctuation set, so a URL inside an inline code span is trimmed too.

Also drop percent-encoded resolver templates (`%7B`/`%7D`), which the
literal `{}` filter missed, and skip `node_modules` so a local
`data/node_modules` cannot pull dependency READMEs into the list.

Exclude `iso.org` and `loc.gov` in lychee.toml: both answer a bot with
403 and neither link is broken.

The report drops from 17 errors to 3. The remaining three are
`blob/main` links to ADR-0001, ADR-0002 and ADR-0006, which `main` does
not carry yet. Merging staging into main for v0.1.0 resolves them.

Closes textrefs#3

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0148cB4MGy2zPeuhemebM38h
`deprecated` is one of the three tombstone statuses in the model, but no
record template treated it as one. ADR-0004, `specification.md:284` and
the `Status` enum all say so, and `RETIRED_STATUSES` in the compiler
agrees, yet both derivation sites tested `withdrawn` and `blocked` only.
A `deprecated` record therefore rendered with no banner and dropped its
`superseded_by` link, while the `.json` sibling published it.

Decision: the three statuses stay one tombstone category with one
presentation. They differ in reach, not in kind — a `deprecated` record
is retained and still resolves, while a `withdrawn` or `blocked` record
is additionally excluded from `Work` mapping projections — so the
user-facing copy distinguishes them and the markup does not. The
`superseded_by` treatment is the normal one.

This is latent, not live: no record in the registry is `deprecated`
today. The cost lands the first time a promoted record is corrected.

The copy still lives in two templates. textrefs#100 single-sources it, and this
decision is what its shared status module has to encode.

Closes textrefs#99

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0148cB4MGy2zPeuhemebM38h
`src/components/CitationBox.astro` has no consumers. The reference page
was the only one, and textrefs#30 replaced it with inlined Chicago and COinS
rendering against `src/lib/citation.ts`.

`git grep CitationBox` now returns nothing, and `npm run build:fast`
produces identical `dist/` output.

Closes textrefs#48

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0148cB4MGy2zPeuhemebM38h
Copilot AI lite review requested due to automatic review settings August 27, 2026 14:04

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.

Pull request overview

This PR addresses three pre-release triage items for the TextRefs Astro/Starlight site: it fixes CI link-check URL extraction to eliminate false failures, aligns site rendering with the standard’s definition of deprecated as a tombstone status, and removes an unused Astro component.

Changes:

  • Fixes the URL collection/trimming logic used by the CI link checker to correctly handle layered trailing markup and percent-encoded {} templates.
  • Updates tombstone rendering to include deprecated alongside withdrawn and blocked, with status-specific banner copy and consistent supersession handling.
  • Deletes the orphaned CitationBox.astro component and adds bot-403 exclusions for iso.org and loc.gov in lychee.toml.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/links.yml Reworks external-URL extraction/trimming (looped trimming, drops %7B/%7D templates, skips node_modules).
lychee.toml Excludes iso.org and loc.gov from link checking to avoid persistent bot 403s.
src/pages/id/ref/[uuid]/index.astro Treats deprecated references as tombstones and renders deprecated-specific copy while preserving successor links.
src/components/Tombstone.astro Extends the shared tombstone banner component to handle deprecated consistently.
src/components/CitationBox.astro Removes an unused component file (no remaining references found).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@maehr

maehr commented Aug 27, 2026 •

Copy link
Copy Markdown
Member Author

CI confirms the numbers in the description. linkcheck on this branch:

Collected 354 unique URLs
| 🔍 Total  | 354 |
| 🚫 Errors |   3 |

All three are the blob/main ADR links (ADR-0001, ADR-0002, ADR-0006). main carries only ADR-TEMPLATE.md and README.md today; merging #4 brings all seven ADRs and resolves them. Recorded as a post-tag check in #68 §5.

Run 33080241993. Both required checks are green and the PR is CLEAN.

`docs.yml` asked for `docs`. The repository has no such label; it has
`documentation`, which is what textrefs#68, textrefs#79 and textrefs#81 already carry. GitHub
applies the labels an issue form names only when they exist, and it does
not create the missing one, so every issue filed through this template
would arrive with `triage` alone and miss a `label:documentation` query.

Every other template in the directory names a label that exists. This is
the one that does not.

Latent so far: no issue in the repository carries `triage`, so no docs
issue has been filed through the form yet. The tag freezes `.github/`,
which makes a one-line fix cheaper now than after.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0148cB4MGy2zPeuhemebM38h
@maehr maehr changed the title fix: link-check extraction, deprecated tombstones, orphaned component (#3, #99, #48) fix: link-check extraction, deprecated tombstones, orphaned component, docs label (#3, #99, #48) Aug 27, 2026
@maehr
maehr merged commit 1c827f1 into textrefs:staging Aug 27, 2026
2 checks passed
This was referenced Sep 2, 2026
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