C03
The requested correction belongs in flag-presence matching, with coupled tests and documentation. Static inspection establishes the failure; no tests or workflows were run.
Current behavior
src/gzkit/doc_coverage/flag_scanner.py:220–259 checks if flag in content. Therefore a manpage containing only --output-format satisfies coverage for --output. Presence reads the entire UTF-8 manpage, permits mentions in examples/prose, maps spaces in command names to hyphens, skips absent files, and returns existing {path, issue} dictionaries. Explicit waivers override the default empty _PER_FLAG_DOC_WAIVERS.
The same module already has a reusable boundary rule: _mentions uses re.escape(flag) followed by _FLAG_END = r"(?![\w-])" (lines 281–291). Truth checking uses that rule to avoid --attestor/--attestor-present collisions. It checks required-ness and value-taking only within fenced Usage/Synopsis blocks. The actual adr-emit-receipt.md independently names both siblings.
commands/cli_audit.py:242–274 derives presence names and truth specs from one scan, appends both issue lists, sets top-level valid, prints human/JSON output, and exits 1 on findings. quality.py:798 runs this audit; the command quality registry includes it. Command-level cross_coverage and the separate doc-coverage chore report do not include per-flag issues. A flag finding can therefore coexist with passing command-level coverage without requiring a schema change.
Necessary coupled obligations and boundaries
- Reuse the existing suffix-aware matcher for presence, adapting its usage-only documentation to describe arbitrary text. Preserve whole-page presence scanning; borrowing the truth check’s Usage-only scope would reject currently valid prose/example documentation.
- Update the coverage docstring’s explicit substring contract and the Presence description in
docs/user/manpages/cli-audit.mdto explain that longer siblings do not count. Correct any real manpages newly exposed by the stricter check; their identity/count needs a later census. Do not add waivers simply to restore green results. - Preserve waiver lookup, missing-file delegation, slug/path construction, issue wording and ordering, absent-source fallback, and the shared AST discovery. This request does not require a parser/discovery rewrite, new dependency, output-field change, or expansion of the chore report.
- Preserve truth checks when sharing the matcher. Its current suffix rule rejects continuations containing letters, digits, underscores, and hyphens, while permitting whitespace, punctuation, backticks,
=, brackets, and end-of-text. It is case-sensitive and regex-escapes names. - The existing matcher has no left boundary:
prefix--outputor---outputcan still match. It also allows a dot after the flag. Rejecting every embedded or unusual option spelling would broaden this request; define that separately before strengthening the shared rule and changing truth behavior.
Meaningful verification proposed
- First add a direct coverage regression with both flags registered and only
--output-formatdocumented. Require exactly the shorter flag’s missing-documentation issue and the correct path. Then add an independent--outputmention and require no issues. This fails under the current implementation. - Table-test longer suffixes, accepted Markdown/prose/example forms,
--output=VALUE, end-of-file, punctuation, case sensitivity, and literal regex-special characters. Derive expectations from the intended matching contract rather than copying implementation output. - Exercise explicit/default waivers, multiword command slugs, missing files, and independent commands. Retain truth regressions for sibling flags, optional/required flags, valueless arguments, and claims outside Usage.
- Exercise CLI audit with actual collision-containing temporary documentation and nonempty discovered specs: verify exit 1, JSON
valid: false, the diagnostic, and human failure output, then successful repair. Existing synchronized-doc fixtures can omit CLI sources, causing the scan to return empty; those alone cannot witness this change. - Run the real-manpage waiver census and relevant audit/quality integration tests after implementation. Existing quality tests verify failure propagation through mocks; they complement, but cannot replace, the collision test.
Uncertainty: no repository-wide impact census, runtime verification, ownership assessment, or governance action was performed. No claim of clean current docs or passing checks is made.
Read inventory: /tmp/gzkit-current-inputs/C03.md; under /tmp/gzkit-current-snapshot/: src/gzkit/doc_coverage/{flag_scanner,scanner,manifest,__init__,runner}.py, src/gzkit/commands/cli_audit.py, excerpts of src/gzkit/{quality.py,commands/quality.py}, tests/commands/{test_cli_audit,test_audit}.py, excerpts of tests/test_quality.py, and docs/user/manpages/{cli-audit,adr-emit-receipt}.md. Targeted rg searches also inspected matching lines under src, tests, features, docs/user, and .gzkit/skills; search hits were not treated as whole-file reads. One combined read output was truncated; the omitted relevant test section was subsequently read.
Call count: 9 shell/read calls, including task read and this sole permitted output write. Assessment complete within the bound; implementation and execution remain intentionally unperformed.