Skip to content

fix: release hardening before v0.1.0 (#46, #47, #49, #50) - #75

Merged
maehr merged 4 commits into
textrefs:stagingfrom
maehr:fix/release-hardening
Aug 12, 2026
Merged

fix: release hardening before v0.1.0 (#46, #47, #49, #50)#75
maehr merged 4 commits into
textrefs:stagingfrom
maehr:fix/release-hardening

Conversation

@maehr

@maehr maehr commented Aug 12, 2026

Copy link
Copy Markdown
Member

Four issues found while reviewing #4 that are cheaper to fix before the tag than after it. Reviewed against #68 §4's "triage what is deliberately not in v0.1.0" — these four were pulled in, the rest stay out.

#50 — drop the github-profile submodule

Nothing read it, yet all four workflows clone it via submodules: recursive. The tag freezes .gitmodules, so anyone checking out v0.1.0 would inherit a hard dependency on textrefs/.github for a directory with no consumer.

#47 — draft record pages out of the sitemap

ADR-0003 says draft records are "noindex, excluded from sitemap and search". Two of three shipped. A production build was advertising 67,959 draft references plus their work, system and mapping pages as crawlable URLs that carry no persistence promise and may be retracted.

Starlight registers @astrojs/sitemap only when the project has not, so it is now declared explicitly with a filter. The predicate keys on record status, not on a route prefix — excluding /id/ wholesale would keep hiding pages after they are promoted to active. Fixture-backed tests cover both directions, which the real registry cannot (it is 100% draft under ADR-0004).

#46 — non-SPDX licences fail the build

A licence the compiler could not map to an SPDX IRI was dropped from the published record with only a console warning. A typo like CC-BY-4 silently removed the licence statement; registry#9 already had to clean one round of these by hand. Now validated in ResolverEntrySource, so it fails the build and names the file.

Marked ! because a registry that currently authors a non-SPDX license would newly fail to compile. Verified against the real registry: zero occurrences, so no data change is needed.

#49spdx-license-ids is a runtime dependency

The compiler requires it at build time, so it belongs in dependencies. npm ci installs devDependencies, so nothing broke today; any --omit=dev path would have. Also drops the unused direct @astrojs/markdown-satteri pin.

Verification

npm run verify:fast green — 27 tests, up from 21. Full npm run verify against the real 67,959-reference registry runs in CI here; the sitemap assertion at real scale is part of the pre-tag check.

Closes #46, closes #47, closes #49, closes #50. Part of #68.

Copilot AI lite review requested due to automatic review settings August 12, 2026 21:05
maehr added 4 commits August 12, 2026 23:05
Nothing read it: no build step, script, workflow, or doc referenced
`github-profile/`, and it sits outside `src/` and `public/` so Astro never
saw it. Meanwhile all four workflows check out `submodules: recursive`,
which made `textrefs/.github` a hard dependency of data, linkcheck, pages
and release for a directory with no consumer.

Removing it before the tag matters because v0.1.0 freezes `.gitmodules`:
anyone checking out the tag would otherwise inherit that dependency.
`scripts/compile.ts` requires it at build time through
`scripts/source-schema.ts`, so it is a runtime dependency of the compiler,
not a development tool. CI installs with `npm ci`, which includes
devDependencies, so nothing broke today — but any `--omit=dev` install
path would have failed at compile.

Also drops the direct `@astrojs/markdown-satteri` devDependency: nothing
imports it, and both astro and starlight already depend on it.
A licence value the compiler could not map to an SPDX IRI was dropped from
the published record with a console warning, leaving the build green. A
typo such as `CC-BY-4` for `CC-BY-4.0` silently removed the licence
statement from a record whose entire value is machine-readable claims —
and registry#9 already had to clean one round of these by hand.

`ResolverEntrySource` now validates `license` against the SPDX id set, so
an unmappable value fails the build and names the file. The emit path
keeps a defensive throw for callers that bypass the parser.

The SPDX set moves to source-schema.ts, which is now its only definition.
ADR-0003 says draft records are rendered noindex and excluded from search
and the sitemap. The first two shipped; the sitemap did not, so a
production build advertised every draft record — 67,959 references and
their work, system and mapping pages — as crawlable URLs that carry no
persistence promise and may be retracted outright.

Starlight registers `@astrojs/sitemap` only when the project has not, so
the integration is now declared explicitly with a filter. The predicate is
derived from record status rather than from a route prefix, so it narrows
on its own as records are promoted to active instead of permanently hiding
pages that have earned a place in the sitemap.

`npm test` now also picks up `src/lib/*.test.ts`.
@maehr
maehr force-pushed the fix/release-hardening branch from 78ac095 to de61be5 Compare August 12, 2026 21:05
@maehr
maehr merged commit 71dd92a into textrefs:staging Aug 12, 2026
2 checks passed

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 hardens the repository ahead of the v0.1.0 tag by removing an unused submodule dependency from CI, ensuring draft record pages are excluded from the generated sitemap (per ADR-0003/0004), and tightening license validation so non-SPDX values fail the build instead of being silently omitted.

Changes:

  • Add a registry-derived noindex predicate and apply it to @astrojs/sitemap filtering, with fixture-backed tests.
  • Validate resolver license values against the SPDX id set at source-parse time, and fail hard if an invalid value reaches emit time; add tests for both valid/invalid cases.
  • Move spdx-license-ids to runtime dependencies, add an explicit @astrojs/sitemap dependency, remove an unused @astrojs/markdown-satteri pin, and drop the unused github-profile submodule.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/lib/noindex.ts Builds a pathname predicate to identify draft-derived pages for noindex/sitemap exclusion.
src/lib/noindex.test.ts Fixture-backed tests for sitemap exclusion behavior.
astro.config.mjs Registers @astrojs/sitemap explicitly with a filter using the new predicate.
scripts/source-schema.ts Adds SPDX id set and validates license via Zod refinement at parse time.
scripts/compile.ts Reuses SPDX_IDS and turns invalid license values into hard failures (defensive check).
scripts/compile.test.ts Adds tests asserting SPDX license IRI emission and invalid license build failure.
package.json Updates test globbing; moves spdx-license-ids to dependencies; adds @astrojs/sitemap; removes unused pin.
package-lock.json Lockfile updates reflecting dependency moves/additions/removals.
.gitmodules Removes the unused github-profile submodule entry.

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

Comment thread src/lib/noindex.test.ts
Comment on lines +6 to +12
process.env.TEXTREFS_REGISTRY_FIXTURE = '1';

import { test } from 'node:test';
import assert from 'node:assert/strict';
import { buildNoindexPredicate } from './noindex.js';

const isNoindex = buildNoindexPredicate();
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