feat(docs): emit the canonical public-docs artifact the app renders

MkDocs retires and the Astro app becomes the only public site, so the artifact is
the product and the Markdown stays the source -- the split tools/newsgen already
states for releases. tools/docsite walks the published set and writes
docs/data/generated/docs.json: every page's directory-style url, title, section and
raw Markdown body, plus the sidebar tree derived from the layout.

Three things the artifact has to get right, each of which was wrong in a draft:

- LINKS. The published pages carry relative .md links that MkDocs rewrote at build
  time and nothing else will. Each is rewritten to the target page's url using the
  same function that builds urls, so a link and its target cannot disagree; anchors
  and scheme-qualified links pass through; assets resolve by the same rule and none
  are referenced.
- FRAGMENTS. A link can resolve to a page and still be broken, because a fragment
  matching no heading lands the reader at the top of a long document. Each is
  checked against the target's headings, by the slug rule a table of contents uses.
- REFUSAL. A link whose target the set holds back, or whose fragment matches no
  heading, fails the generator naming the file, the line and the target. This found
  three citations from settled architecture pointing at two PRDs the blanket prds/*
  exclusion withheld -- links that were already 404s on the published site, so the
  exclusion broke citations rather than withholding drafts. Both targets are now
  published, for a reason distinct from the three ratified PRDs already published.

The published set moves out of mkdocs.yml into the generator with its reasons: a
renderer reading the artifact cannot see why a page is absent. docs/data/generated
is accounted for by docsgen's generatedArtifacts, which now names this file beside
contracts.json -- one ownership registry for the directory rather than one per
writer, so neither tool reports the other's artifact as unaccounted.

docs:artifact regenerates; docs:artifact:check reproduces into memory and fails on
drift without touching the tree, wired into task check beside news:check. The
existing docs:site target is MkDocs and was left alone -- a first attempt at that
name silently ran MkDocs and produced nothing.

Verified: task check exit 0, docs:artifact:check reporting 23 pages. The artifact
carries 23 pages, no archive/ inspiration/ or news/ entry, and the five PRDs the
set declares. Coverage: the published set and its count, url derivation, the nav
tree, both refusal paths, and check's no-write guarantee.
This commit is contained in:
sam committed 2026-09-22 12:44:18 +10:00
1 parent fa517fb49e
commit 1b54a18e43
7 files changed
+1168 -24

No files matched your search

+4 -17
View File
@@ -5,23 +5,10 @@ repo_url: https://github.com/samcharles93/archie-core
edit_uri: edit/main/docs/
copyright: Vectis Labs
# Everything under docs/ is published to the public internet. These subtrees are
# held back deliberately, each for its own reason:
# archive/ superseded design. Publishing it competes with the current
# architecture for a reader's attention, which is the exact
# failure this repo already fights.
# inspiration/ research notes that discuss other products by name.
# prds/ open design decisions, not settled architecture.
# github-token setup notes about credentials.
# Widen this by deleting a line; nothing else needs to change.
exclude_docs: |
archive/
inspiration/
prds/*
!prds/ui-service-boundary.md
!prds/service-decomposition.md
!prds/config-schema.md
github-token.md
# The published set and the reasons for what is held back now live in
# tools/docsite/main.go, which emits the canonical artifact a renderer reads
# (docs/data/generated/docs.json). MkDocs is being retired, so its exclusions are
# not duplicated here: a second copy of a decision is a second thing to keep true.
# The generated release-notes pages are linked from docs/news/index.md and stay
# published, but they are kept out of the derived navigation: a version list