docs(adr): a code block inside a record is a specimen, not an example - #8746
Merged
Merged
Conversation
Ruling A on objectui#8363 (director seat, decision batch #88, 2026-09-08) lands as text. CONTRIBUTING.md's `docs/` paragraph now states the convention once: a code block inside an ADR or a dated audit is a SPECIMEN of what was decided or measured, fenced `plaintext` — an unhighlighted spelling check-doc-fence-languages.mjs already lists and check-doc-snippet-types.mjs does not compile — never ts/tsx/typescript. Code a reader may copy stays in content/docs/** and skills/objectui/**, where a gate compiles it. The UNGATED_DOCS header comment in check-doc-snippet-types.mjs annotates the four ledgered rows as the terminal state: no record is edited to make it compile, no row is deleted to clear the ledger, and new records carry the convention instead so the list does not grow. Both edits are additive text. No record is edited, no ledger row is added, removed or reworded, and no gate behaviour moves. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxLw5aKDPR5RJgyUR7Exkd
This was referenced Sep 9, 2026
yinlianghui
marked this pull request as ready for review
September 9, 2026 06:30
yinlianghui
deleted the
claude/issue-8363-adr-code-blocks-are-specimens
branch
September 9, 2026 06:48
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.
Fixes #8363
Ruling A (director seat, comment
5582376965, decision batch #88, 2026-09-08) lands as text. Quoted verbatim, untranslated:The card's four-facet block recommended A with facet ① (long-term architecture) leading at ≥ 50 %: defining a record's block as a specimen keeps the record face and the teaching face apart, so an ADR never becomes an API document that has to be re-edited on every contract change. Facet ③ (making it structurally harder for an AI to write the wrong thing) is served by the same line — a non-compiled fence tells the next author at a glance that the block is a dated sketch, not runnable code to copy.
Two additive edits — 13 inserted lines, nothing removed, nothing reworded
1.
CONTRIBUTING.md(+2 lines, 708 → 710). The convention goes in the paragraph that introduces the repo-rootdocs/tree as internal engineering material (ADRs, audits, architecture notes) — the contributing text the ruling names. Added, in full:2.
scripts/check-doc-snippet-types.mjs(+11 lines, 2722 → 2733). The terminal-state annotation, appended to the comment block that opensUNGATED_DOCS's card-2 section, directly above the first row:⛔ Not touched: no
UNGATED_DOCSrow is added, removed or reworded; not one byte inside ADR-0001, ADR-0036, ADR-0057 or the 2026-07 objectview audit moves; no code path changes.git show --statreads 2 files changed, 13 insertions(+), 0 deletions.The ruling's "one sentence in the ADR template" — measured, that template does not exist
git ls-tree --name-only origin/main docs/adr/returns ten numbered records and nothing else — noREADME.md, no template file, and no record that presents itself as one.git grep -w -i ADRover the tree, minusdocs/adr/**and.changeset/**, reaches exactly three places that could have been a second home:CONTRIBUTING.md:426(thedocs/paragraph, edited here),AGENTS.md:478(the governed-surface register) andAGENTS.md:108(a reference to ADR-0054 from an unrelated commandment). There is no ADR-authoring section anywhere in the repository.docs/audits/is the same shape: six dated audits, no index and no template.⇒ The contributing line IS the convention, which is the branch the dispatch anticipated. ⛔ No template file was invented and ⛔ no record was edited — both are explicit terms of the ruling. Giving the convention a second home under
docs/adr/**would be a new governed card, not a silent addition here.Why
plaintextis the spelling the line namesUNHIGHLIGHTED_SPELLINGS(scripts/check-doc-fence-languages.mjs:246—plaintext,text,plain,txt, plus the empty info string), the set that gate's header already lists as non-compiled. ⛔ No new fence language is invented.scripts/check-doc-snippet-types.mjscompilesTS_FENCE_LANGUAGES=ts/tsx/typescriptand nothing else, so aplaintextspecimen is never collected for compilation — which is the property the ruling asks for.plaintextfences undercontent/docs/**against 5text.fences · snippets · types):docs/adr/**anddocs/audits/**are read by the snippet gate alone (✗ · ✓ · ✗), so a specimen fence inside a record is invisible tocheck:doc-fencestoday. Naming a spelling from that gate's known set is the cheap insurance for the day the two subtrees ever join its walk: a known synonym is classifiable, whereas an unknown spelling such asraworoutputfails there on sight and can never be baselined.Governed-surface reading — taken on the real change set
The ruling expected the template edit to land under
docs/adr/**and therefore called this governed; because that template does not exist, the change set never reaches the register. The PR is opened as a draft anyway and this seat flips nothing — ready, queue, auto-merge and approval are all the PM seat's call.Gates — exit codes captured before any pipe; every verdict line is the gate's own
All readings taken on head
4e57601.node scripts/check-governed-queue-guard.mjs --test …NOT GOVERNED — 2 path(s) checked against 5 governed surface(s); none matched.node scripts/check-doc-fence-languages.mjs(check:doc-fences)every TypeScript block in 227 document(s) is fenced ts/tsx/typescript, except 80 declared file(s) carrying 89 block(s) … No unknown fence spelling hides one.node scripts/check-doc-snippet-types.mjs(check:doc-snippets)Scanned 245 document(s): 241 covered (126 of them hold a ts/tsx block), 4 ungated·Semantic phase: 636 of 636 block(s) judged, 0 failed·Every covered documentation snippet compiles against the built types.node scripts/check-control-bytes.mjs(check:control-bytes)OK (scanned 6946 tracked text file(s); skipped 85 binary).node scripts/check-changeset-presence.mjs2 file(s) changed, 0 of them published source … No source or published contract of a released package changed in this range, so no changeset is owed.node scripts/check-doc-links.mjs(docs:check-links)Links are valid across 17 scan roots.vitest run --root . scripts/__tests__/check-doc-snippet-types.test.tsTest Files 1 passed (1)·Tests 101 passed (101)— includes the ledger pins (is green, and the ledger is exact,every entry in the real ledger carries a written reason, and the card-2 subtree pins)vitest run --root .over the nine otherscripts/__tests__files naming the edited gate (fence-languages walk-equality pin included)Test Files 9 passed (9)·Tests 409 passed (409)vitest run --root . scripts/__tests__/check-doc-links.test.ts scripts/__tests__/ci-cd-pipeline-doc.test.ts(the two suites that readCONTRIBUTING.md)Test Files 2 passed (2)·Tests 179 passed (179)pnpm exec eslint scripts/check-doc-snippet-types.mjsgrep -naPcontrol-character sweep over both changed filesThe snippet gate needed a build, and its first answer was not a failure. Unbuilt it printed
PRECONDITION NOT MET (exit 2) — The snippet program was NOT run … This is "I could not run", NOT "I ran and found errors", so that reading is recorded as NOT MEASURED, never as red. The scoped closure was then built through the shared verify lock —turbo run build $(node scripts/check-doc-snippet-types.mjs --build-filter) --concurrency=2, 35/35 tasks successful, 2m18s, lock verdictcommand-exit 0— and the gate re-ran green above. The 4 ungated documents it reports are the same four rows this PR annotates.Declared narrowing. The repository-wide
pnpm lintand fullpnpm testare CI's runs, not this seat's. Locally the change was linted as one file and tested through everyscripts/__tests__suite that names the edited gate plus the two that readCONTRIBUTING.md. No reverse-verification or ablation is reported: this change adds no assertion and no behaviour — both edits are prose and comment text — so there is nothing that could be mutated into a red. The standing measurement in its place is the re-run of the gate itself against the built closure, before and after the edit.验收备注
content/docs/guide/ci-cd-pipeline.mddocuments the three doc gates and the governed register, and one of its lines namesdocs/adr/**. Nothing on that page is falsified by this change (it makes no claim about fence conventions inside records), so it is left untouched. Noted, not filed.docs/adr/**has no index, no template and noREADME.md, so a new ADR takes its shape by copying an existing record. That is an observation about the tree, not a defect of this card, and giving it a home is a governed decision for the maintainer rather than something to add here. Noted, not filed.维护者速读(草稿)
改了什么 —— 两处纯新增文字,共 13 行,没有删改任何既有内容。一是
CONTRIBUTING.md介绍仓库根docs/目录那一段后面加一句约定:ADR 与带日期的审计里的代码块是「样本」,写成plaintext围栏,不写ts;可抄的示例仍然放在content/docs/**与skills/objectui/**。二是门禁脚本check-doc-snippet-types.mjs里那张账本(UNGATED_DOCS)的头部注释,标明四条记录的账目按裁决 A 就是终态。为什么改 —— 你在决策批 #88 裁的 A:记录不可改,记录里的代码块是「当天决定/当天测到什么」的样本,不是 API 文档。之前的问题是四份记录里的代码块按字面编译报 29 处错误,门禁只能把它们挂在账上,而这笔账没人有权去付——修了就等于篡改历史记录。这次把裁决写成文字:新记录照约定写,不会再产生新的债;旧的四条明确标为终态,后来的人不会误以为那是待办事项。
风险与代价(含回滚) —— 风险很低:两处都是文字,门禁行为一行未动,账本一行未改,全部门禁与相关测试本地跑绿(见上表)。代价是这条约定目前只有一个家:
docs/adr/下没有模板文件,而裁决明令不许新造一个,所以写 ADR 的人要从CONTRIBUTING.md读到它——实测这是仓里唯一讲docs/是什么的地方。回滚就是 revert 这一个 commit,不牵连任何东西。席位意见 ——(待补)
你要做的 —— 看一眼那句约定的措辞是否就是你要的意思,特别是「
plaintext」这个拼写(它取自门禁自己已列为不编译的集合,没有发明新拼写)。若你希望约定在docs/adr/下也有一份(比如一个 ADR 模板文件),那是另一张受管卡,说一声即可。Generated by Claude Code