docs: enforce audience-specific documentation ownership#944
Closed
kunchenguid wants to merge 1 commit into
Closed
Conversation
kunchenguid
force-pushed
the
fm/fm-documentation-audience-cleanup-r1
branch
from
July 23, 2026 22:12
a62322c to
331c0e0
Compare
kunchenguid
force-pushed
the
fm/fm-documentation-audience-cleanup-r1
branch
from
July 24, 2026 07:10
331c0e0 to
3a45d9d
Compare
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.
Intent
The developer wanted a single no-mistakes validation run for the committed documentation-audience cleanup, carried through all synchronous gates, push, pull request creation, and green CI unless a genuinely new decision required escalation. They required quantified, reproducible before-and-after prompt reduction measurements and a concise preservation map tracing removed durable facts to their current authoritative owners. The evidence needed to stay current without adding historical clutter to operator documentation, while preserving the documentation audience policy and one-owner rule. They explicitly required the pipeline to make the fix, prohibited hand edits and --yes, and said not to start a second run while the current one was active.
What Changed
Risk Assessment
✅ Low: The documentation migration is well-bounded, its preservation evidence is coherent, and the final shared link extractor now closes all previously identified Markdown, reStructuredText, anchor, parsed-literal, and raw-HTML paths with focused regression coverage.
Testing
After inspecting the base-to-target diff, I ran the focused documentation policy tests and repository checker, manually audited the preservation map, rendered actual before-and-after harness prompts, reproduced every published size reduction, confirmed unchanged harness prompts remained byte-identical, captured reviewer-visible transcript artifacts, removed snapshot scaffolding, and verified the worktree remained clean. No screenshot was produced because this change has no graphical UI; the actual rendered prompt text and documentation-check transcripts are the end-user surfaces.
Evidence: Documentation audience tests
All focused classification, ownership-pointer, Markdown/reStructuredText link, anchor, and code-example fixtures passed.Evidence: Audience and link check
fm-doc-audience-check: ok surfaces=55 local_links=155Evidence: Prompt and guide reductions
Reproduced committed before-and-after prompt and guide measurements.Evidence: OpenCode prompt before
Actual base and target OpenCode prompt outputs for reviewer comparison.Evidence: OpenCode prompt after
Actual target OpenCode prompt output.Evidence: Pi prompt before
Actual base Pi prompt output.Evidence: Pi prompt after
Actual target Pi prompt output.Evidence: Unchanged harness preservation
Claude, Codex, Grok, and unknown-harness prompts are byte-identical across the change.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (4) ✅
bin/fm-doc-audience-check.sh:358- Local-link enforcement ignores standard syntax in formats declared in scope. The extractor recognizes inline Markdown links and HTML attributes only, so broken reference-style Markdown links ([label][id]plus[id]: missing.md) pass..rstfiles are also sent through this Markdown parser, so broken reStructuredText links pass too. Dispatch extraction by file type and validate reference definitions at this shared boundary.bin/fm-doc-audience-check.sh:381- Anchor extraction scans raw lines without masking code blocks, so a heading appearing only inside a fenced or indented code example is accepted as a real target anchor. A link totarget.md#exampletherefore passes when# Exampleexists only in sample code. Mask code before extracting headings or use the same Markdown parse representation for links and anchors.🔧 Fix: Validate format-aware documentation links and anchors
2 warnings still open:
bin/fm-doc-audience-check.sh:29- The durable reference-link fix remains bypassable. CommonMark permits one line ending between[id]:and its destination, but this regex only accepts same-line destinations. reStructuredText also permits the alternate anonymous target form__ missing.rst, while the new extractor only recognizes__:. Either valid form can still contain a broken local target that passes validation. Extend reference-token extraction at this shared boundary.bin/fm-doc-audience-check.sh:383-rst_without_codetreats every line ending in::as the start of literal code, including directives such as.. note::. Admonition content is parsed as ordinary reStructuredText, so a broken link inside an indented note body is rendered but masked from validation. Distinguish ordinary parsed directives from literal-block introductions, masking only actual code or literal content.🔧 Fix: Cover multiline and parsed directive links
1 warning still open:
bin/fm-doc-audience-check.sh:379- The reStructuredText fix still masks rendered links.parsed-literalexplicitly parses inline markup, so.. parsed-literal::containing`Broken <missing.rst>`_produces a real link, but this branch classifies the directive as literal code and removes its body before extraction. The same durable broken-link path therefore remains reachable. Keep parsed directives in prose and mask only directives whose contents are genuinely non-rendered code.🔧 Fix: Validate links inside parsed literals
1 warning still open:
bin/fm-doc-audience-check.sh:379- Rendered raw HTML still bypasses local-link validation. A reStructuredText block such as.. raw:: htmlcontaining<a href="missing.html">emits a real link, butrawis classified as literal code and its body is masked. The reStructuredText branch also never appliesHTML_LINK_RE, so merely retaining the body would still miss it. Keep raw content available and extract HTML link attributes at the sharedlocal_linksboundary.🔧 Fix: Validate raw HTML links in reStructuredText
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
git diff --stat d89a1b69115525f9c3b1cef03615afabee186ff7 a963e1999ba68980c70473a68ada7f93e7eb4388plus changed-file and commit-history inspectiontests/fm-documentation-audiences.test.shbin/fm-doc-audience-check.shRendered OpenCode and Pi supervision blocks from both commits withFM_ROOT_OVERRIDE=/firstmate FM_HOME=/firstmate --read-only 0 --afk 0 --x-mode 0Counted committedAGENTS.md, backend guides, supervision guides, andREADME.mdwithwcat both revisionsRendered and byte-compared Claude, Codex, Grok, and unknown-harness supervision blocks across both revisionsManually audited preservation-map owners against current Calm, backend, supervision, and verification documentationgit status --shortafter tests and evidence cleanup✅ **Document** - passed
✅ No issues found.
🔧 **Lint** - 1 issue found → auto-fixed ✅
🔧 Fix: Silence intentional reStructuredText fixture lint warnings
✅ Re-checked - no issues remain.
✅ **Push** - passed
✅ No issues found.