fix(docs-kit): block unmanaged files in docs/; make the root guides ordinary units - #561
Open
interacsean wants to merge 5 commits into
Open
interacsean wants to merge 5 commits into
interacsean wants to merge 5 commits into
Conversation
…ordinary units An agent adding a component wrote `docs/components/toolbar.md` straight into the generated tree (app-shell#559) and `docs:check` said nothing: check walked outlines→outputs and manifest→outlines, so a file that was neither was invisible rather than rejected. Closing that cleanly meant removing the last hand-authored files under `docs/`. The four root guides are now `kind: prose` units in `docs-src/guides/` that map to the `docs/` root, so there is one authoring mechanism rather than a general rule plus four exceptions — and, since they are units, their code fences can later become tokenised, type-checked examples (quickstart carries five). Their published content is unchanged apart from the generated-by banner. `check` then needs no special cases: every `.md` under an output root must be a unit's output, and anything else blocks with "has no source". Two docs-browser fixes this exposed: - category is derived from the output directory, which is empty for a root-level output; root outputs now group under `guides`. - relative `.md` links are authored against the generated tree, but routes are not the same shape (`docs/api/guards/hidden.md` is served at `/api/guards/hidden`). They are now resolved in doc-space against the unit's output and then mapped to a route, so a guide linking `./concepts/x.md` reaches `/concepts/x` rather than `/guides/concepts/x`. CLAUDE.md, CONTRIBUTING, the decision record and the resync-docs skill drop the four-file exception; CLAUDE.md also no longer claims the gate catches a case it did not. Refs tailor-inc/platform-planning#1549 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Code Metrics Report
Details | | main (486607c) | #561 (e23e15e) | +/- |
|---------------------|----------------|----------------|------|
| Coverage | 87.5% | 87.5% | 0.0% |
| Files | 206 | 206 | 0 |
| Lines | 6082 | 6082 | 0 |
| Covered | 5323 | 5323 | 0 |
+ | Test Execution Time | 2m8s | 1m24s | -44s |Reported by octocov |
IzumiSy
approved these changes
Sep 30, 2026
# Conflicts: # docs-manifest.json
# Conflicts: # docs-manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #396, prompted by @IzumiSy's observation on #559: an agent wrote
docs/components/toolbar.mdstraight into the generated tree andpnpm docs:checksaid nothing.The gap
checkonly walked the things it already knew about — outlines→outputs and manifest→outlines. A file that was neither was invisible rather than rejected. The "never hand-editdocs/" rule was enforced for files the pipeline generates, but nothing enforced that only those files exist.Reproduced on
main: a hand-writtendocs/components/toolbar.mdpasses with✓ no blocking issues.Removing the last exceptions
Closing this cleanly meant getting rid of the four hand-authored root docs, since a tree check with a four-file allowlist just moves the ambiguity.
They are now ordinary
kind: proseunits indocs-src/guides/, mapped todir: "docs"so they still publish atdocs/introduction.md,docs/quickstart.md,docs/design-philosophy.md,docs/migrations.md. Published content is unchanged apart from the two-line generated-by banner — frontmatter and body are byte-identical.One authoring mechanism, no exceptions. And because they're units, their code fences can later become tokenised, type-checked examples (quickstart carries five) — incrementally, since literal fences stay literal, which matters for
migrations.mdwhose snippets are historical and must not compile against current APIs.The gate
With no exceptions left,
checkneeds no special cases: every.mdunder an output root must be a unit's output, and anything else blocks:Two docs-browser bugs this surfaced
entry.output.split("/")[1]yields"quickstart.md"for a root-level output. Root outputs now group underguides.docs/api/guards/hidden.mdis served at/api/guards/hidden). They were resolved against the route, so a guide linking./concepts/x.mdwould have reached/guides/concepts/x. They are now resolved in doc-space against the unit'soutputand then mapped to a route — correct in general, not just for guides.Verification
unmanagedOutputs)./guides/quickstartrenders and its./concepts/modules-and-resources.mdlink navigates to/concepts/modules-and-resources.Docs
CLAUDE.md, CONTRIBUTING, the decision record and the resync-docs skill drop the four-file exception. CLAUDE.md's gate claim was also overstated — it promised
docs:check"blocks on any hand edit or drift", which did not cover a newly created file; it now says so accurately.Agent-instruction hardening (
AGENTS.md/.github/copilot-instructions.md, so non-Claude agents see the rule at all) is deliberately not here — tracked separately.🤖 Generated with Claude Code