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:
7 files changed
+1168
-24
No files matched your search
+14
-6
@@ -33,13 +33,21 @@ const (
|
||||
modeCheck
|
||||
)
|
||||
|
||||
// generatedArtifacts declares the directories docsgen owns end-to-end, and the
|
||||
// file names it produces in each. Obsolete detection is scoped to these
|
||||
// directories: an arbitrary --out location is not ours to judge, and the target
|
||||
// layout anticipates further named artifacts here (catalog.json, AsyncAPI
|
||||
// output), which must not be reported as stale merely for existing.
|
||||
// generatedArtifacts declares the directories whose contents are generated
|
||||
// end-to-end, and every file name accounted for in each. Obsolete detection is
|
||||
// scoped to these directories: an arbitrary --out location is not ours to judge,
|
||||
// and the target layout anticipates further named artifacts here (catalog.json,
|
||||
// AsyncAPI output), which must not be reported as stale merely for existing.
|
||||
//
|
||||
// docs/data/generated is shared. docsgen writes contracts.json from the
|
||||
// Go contract types; tools/docsite writes docs.json from the Markdown sources.
|
||||
// Each tool verifies its OWN file, and both files are named here because this map
|
||||
// is the directory's ownership record: whichever tool runs first must not report
|
||||
// the other's artifact as an unaccounted file. docsgen does not verify docs.json,
|
||||
// and tools/docsite keeps no registry of its own for that reason -- one fact, one
|
||||
// home.
|
||||
var generatedArtifacts = map[string][]string{
|
||||
"docs/data/generated": {"contracts.json"},
|
||||
"docs/data/generated": {"contracts.json", "docs.json"},
|
||||
}
|
||||
|
||||
// options is a parsed command line.
|
||||
|
||||
Reference in new issue
Block a user