docs-guard

command
v0.32.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command docs-guard bounds the size of the package overviews and keeps their heading structure honest.

Run via `make docs-guard`, wired into `make check`. Scans every .md file under docs/knowledge/features and exits non-zero on either of two faults: a file over the size cap, and a line that markdown reads as a heading only because a wrapped paragraph put a ticket reference first.

**Why the size cap.** QMD is the search surface every agent uses. It cuts a document into roughly 900-token chunks, and it does prefer a heading boundary: its break table scores an h1 at 100 down to a bare newline at 1. But it only looks for that boundary inside a narrow window around each 900-token mark. When a document's sections run much larger than one chunk, no heading falls inside the window, so the cut lands on a paragraph break and the chunk carries no heading with it.

Measured 2026-08-31 against the then-315KB v2-session-manager.md, whose sections averaged 7000 bytes: a semantic query, a hybrid query and a keyword query with reranking off, all aimed at a topic whose canonical home was a section of that file, and none of the three returned the file. What came back instead was the frozen docs/knowledge/codebase/ archive. After the split the owning section document ranks first on the same query.

So the cap is really a statement about section size: keep a document small enough that its sections are comparable to a chunk, and the chunker's heading preference starts working for you instead of being unreachable.

**Why the heading check.** A paragraph line that wraps with a ticket reference first, "#1840 (below), and published on...", is a top-level heading as far as markdown is concerned. 72 of them had accumulated across 23 overviews, corrupting every document outline.

**Why code and not a rule in a prompt.** Both faults are produced by the documentation agent, which already carries a prose rule against them. A prose rule is roughly 80% advisory, and the repo's own doctrine is that a safety net for one must be a different fabric: deterministic code, not a second rule that shares the first one's blind spot.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL