ci(docs): enforce governed knowledge records - #369
Conversation
tt-a1i
left a comment
There was a problem hiding this comment.
方向对,覆盖面不够
docs/README.md 治理的是 research、design、architecture、Decision、benchmarks。检查器只扫了 docs/research 和 docs/benchmarks。#386/#382 这种 validated 的 architecture/design 记录现在不会被拦。
请扩到 design / architecture / Decision,或明确写「其余类别暂不强制」并改 README。#309 是 Decision-only 且 Windows 路径 fail-open,请吸收进来,不要并排合。
frontmatter 选择加入、「结构 ≠ 验证」是对的。
tt-a1i
left a comment
There was a problem hiding this comment.
Exact-head review: 81320b2
[P1] The new CI contract is opt-out, so it does not enforce the forward-only policy for new records. scripts/check-knowledge-contract.mjs:136-142 classifies every frontmatter-less research/benchmark Markdown file as legacy and skips it. A contributor can therefore add a brand-new record without frontmatter and bypass required metadata, index reachability, links, frozen identities, accounting, failures, limitations, and evidence checks while bun run check remains green.
Decision 0001 says documents from that Decision forward are governed; legacy is a fixed historical set, not a property a new file may claim by omitting metadata. Please encode an immutable legacy allowlist or baseline and fail closed for every new unlisted record. Add a regression proving that a newly added frontmatter-less record fails, while the enumerated pre-Decision records remain accepted.
Verification boundary: exact-head checker/policy review. Existing tests intentionally assert the bypass as legacy exclusion, so their green result confirms rather than mitigates the issue.
Problem
Issue #198 established the forward-only knowledge and evidence contract, but new Research and Benchmark records still have no repository check for required metadata, category-index reachability, or local link integrity. A complete-looking Benchmark can therefore omit frozen identities, accounting, failure classification, limitations, or a retrievable evidence reference without failing CI.
Value
Approach
check-knowledge-contract.mjsfor governed records underdocs/researchanddocs/benchmarks.bun run check, and append the Decision-0001-backed promise to the discipline ledger.Validation
bun run check— passed.bun run test— passed: 1246 Node tests passed, 1 platform test skipped; 30/30 Vitest tests passed.git diff --check— passed.Impact
Refs #198.