Repository navigation
[DONE] 정리 2단계 PR 3 — BOM 이 빌드 가이드 부품표나 회로도와 어긋나면 CI 가 빨개지는 검사 둘을 단다 - #28
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KYL31rYvPyhizskqp57VqM
The BOM against the build guide's two parts tables, and the BOM's designators against the schematic PDF's text layer (pdftotext). Cleanup step 2, PR 3 of docs/investigations/2026-10-cleanup-step2-plan.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KYL31rYvPyhizskqp57VqM
patternflow-bot
marked this pull request as ready for review
October 15, 2026 00:40
This was referenced Oct 15, 2026
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.
ops / https://claude.ai/code/session_01KYL31rYvPyhizskqp57VqM
정리 2단계 계획서 표의 PR 3 이다. BOM 과 빌드 가이드의 부품표, BOM 과 회로도 PDF 를 맞춰 보는 드리프트 검사 둘을 넣었다. 머지하면 하드 규칙 2(BOM·가이드·회로도를 같이 맞춘다)를 사람이 기억하지 않아도 웹 CI 의 check:ci 가 본다.
좋아지는 것: 없음
할 일
docs/investigations/2026-10-cleanup-step2-plan.md) 표의 PR 3 행과 소견 3·4,docs/rfc-cleanup.md§2.1·§2.4·§2.11,docs/voice.md를 읽는다web/scripts/drift/_bom.ts,web/scripts/drift/bom.ts,web/scripts/drift/bom-schematic.tsnpm run check:ci전체,typecheck,lint,check:drift를 돌린다pdftotext가 없을 때 skip,PF_DRIFT_STRICT=1이면 실패하는 것을 보인다git fetch --tags뒤npm run doc-map을 돌리고 두 CSV 는 커밋하지 않는다build초록한 일
web/scripts/drift/_bom.ts: 두 검사가 같이 쓰는 BOM 읽기.BOM(경로),bom()(CSV 를 머리 줄 이름으로 읽은 행들. 따옴표 안의 쉼표·""를 RFC 4180 대로 푼다),designators(ref)(J1은 하나,SW1-SW4는 넷, 하이픈이든 en dash 든.-·—·U1 (sockets)처럼 그 밖의 칸은 0개. 거꾸로 쓴 범위는 throw).web/scripts/drift/bom.ts(check:bom):BUILD_GUIDE.md1절의 표 둘과 BOM 을 비교한다.category가pcb): 줄마다 「지정자: 수량 × MPN」. 가이드의 MPN 칸 끝(Bourns)같은 제조사는 뗀다. 부품 이름은 비교하지 않는다(소견 3: 「Rotary encoder w/ switch」와 「…with push switch」처럼 일부러 다르게 쓴다). 소켓 줄은 BOM 의U1 (sockets)도 가이드의—도 지정자가 없어서 「—」로 맞는다.off-board): 지정자도 MPN 도 없어서 차례로 짝짓는다. 가이드 줄의 부품 이름이 짝 BOM 줄의 단어를 모두 가지면 같은 줄이다(「Sacrificial USB cable (it gets cut)」 ⊇ 「USB cable (sacrificial)」). 수량의 하이픈과 en dash 는 같다(6-12=6–12).### On the board·### Off the board) 아래 첫 표를 읽고, 필요한 열이 없으면 무엇이 없는지 말하고 실패한다.web/scripts/drift/bom-schematic.ts(check:bom-schematic):pdftotext -layout hardware/pcb/schematic.pdf -의 글에서 지정자 접두어(U, SW, J, C 와 R, D, Q, L, F, USB)로 시작하는 토큰을 모아 BOM 의 지정자와 비교한다. 핀 이름(S1S3, IO4IO48)과 ESP32 는 접두어가 없어 빠진다.pdftotext가 없으면(ENOENT)skip()(D2). 첫날부터 strict 다(D4, 소견 4).바뀐 줄: 3 파일, +171 −0. 다른 파일은 건드리지 않았다(
git diff --stat origin/dev).증거
npm run check:ci(web/, 머지 전 HEADc149f27): exit 0. vitestTest Files 35 passed (35),Tests 478 passed (478), 끝은:dev(#26) 를 merge 한 뒤 HEAD
427437d:npm run typecheckexit 0,npx eslint scripts/drift/ scripts/doc-map.tsexit 0,npm run check:drift:npm run lint(전체): exit 0,✖ 12 problems (0 errors, 12 warnings). 경고 12개는 모두 원래 있던src/의 것이다.Web CI
build(HEAD427437d): success. 러너 로그 끝은passed bom,skipped bom-schematic(designators: skipped, pdftotext is not installed (poppler-utils)),passed features,passed links-absolute. 가정에 적은 대로 웹 CI 러너에는 poppler 가 없어서 회로도 비교는 k10 의 strict 워크플로에서 처음 돈다.일부러 어긋나게 고친 판(따로 만든 worktree 에서, 고친 뒤
git checkout으로 되돌리고 worktree 는 지움):판 1, 가이드의 J4 수량 1→2, C11 MPN 끝
.5지움,check:bomexit 1:판 2, 가이드 보드 밖의 「Sacrificial USB cable」→「Sacrificial cable」, 나사
6–12→6–10,check:bomexit 1:판 3, BOM 에
R1줄을 더하고C11줄을 지움,check:bom-schematicexit 1 (양쪽 방향 다):판 4, 가이드의 소켓 줄
—→U1:only in BUILD_GUIDE.md: U1: 2 × PPPC221LFBN-RC,failed bom, exit 1.판 5, BOM 의
SW1-SW4→SW4-SW1:Error: SW4-SW1: a range keeps one prefix and counts up,failed bom-schematic, exit 1.판 6,
pdftotext없는 PATH(node·git 만):designators: skipped, pdftotext is not installed (poppler-utils)/skipped bom-schematicexit 0. 같은 PATH 에PF_DRIFT_STRICT=1:PF_DRIFT_STRICT=1, so a skip fails/failed bom-schematicexit 1.git fetch --tags뒤npm run doc-map:1070 links from 213 files,0 do not resolve,1366 Korean/English pairs. 지도 CSV 에 4줄이 더 생기는데 모두docs/investigations/2026-10-cleanup-step5-plan.md에서 나가거나 들어오는 줄이다(dev 에 이미 있는 #24). origin/dev 에서 같은 명령을 돌린 CSV 와 이 브랜치의 CSV 가cmp로 같다. 이 PR 이 바꾼 지도 줄은 없다. 두 CSV 는git checkout으로 되돌렸다.docs/voice-banned.txt의 말은 새 파일에 없다. em dash 는 가이드 칸의 값—을 그대로 적은 곳뿐이다.실행법
가정
X1이나X1-X4꼴인지로 가린다. 그래서U1 (sockets)는 지정자가 없고, 회로도 쪽 BOM 지정자는 소견 4 의 아홉 개가 된다. 그 줄의 notes 를 읽어 가리지는 않는다.USB하나를 더했다. v3.0 보드의 USB-C 자리가USB1이었고, 그것이 회로도에 돌아오면 하드 규칙 6 의 일이라 BOM 에 없는 채로 보이면 빨개져야 한다고 봤다. 지금 PDF 에는USB로 시작하는 토큰이 없다.check:ci는PF_DRIFT_STRICT없이 돈다. 러너에pdftotext가 없으면bom-schematic은 skipped 로 지나간다(이 PR 의 CI 가 그랬다). strict 로 도는 것은 k10 의drift.yml몫이다(계획서 D2·D4).CHANGELOG.md·docs/rfc-cleanup-progress.md·doc-map CSV 는 고치지 않았다(머리말·계획서대로). 넣을 줄은 아래 「Changelog」. 검사가 지키는 것이 하드웨어 규칙이라### Hardware절에 둔다.cleanup·step-2는 포크에 없어서 달지 않았다(D7).Rev: 3.0이다(patternflow.kicad_sch의(rev "3.0")도 같다). 지정자는 v3.9 BOM 과 맞아서 이 검사의 드리프트는 아니다.hardware/는 이 PR 몫이 아니라 그대로 두었다.for another k
bom-schematic이 CI 에서 strict 로 비교하려면drift.yml이pdftotext없을 때 poppler-utils 를 깔아야 한다(계획서 k10 그대로).web/scripts/doc-map.ts:--check absolute가 skip 일 때도 exit 0 으로 끝나서(process.exit(failed ? 1 : 0)) 러너가passed links-absolute로 찍는다. 이 PR 의 CI 로그에links-absolute: skipped바로 뒤passed links-absolute가 있다. skip 이면 exit 75(_lib.ts의SKIPPED)여야 러너가 skipped 로 읽는다. strict 일 때 1 로 끝나는 것은 맞다. k2 행 파일이라 이 PR 에서 고치지 않았다.Changelog
Hardware
check:bomandcheck:bom-schematichold the BOM to the build guide and the schematic. Hard rule 2 as two checks. A designator, an MPN or a quantity thathardware/bom/bom_v3.9.csvand the parts tables in section 1 ofBUILD_GUIDE.mddo not share turnscheck:cired, and so does a designator that the BOM andhardware/pcb/schematic.pdfdo not share. The schematic's designators come out of its text layer throughpdftotext(poppler); where it is not installed the check skips, and underPF_DRIFT_STRICT=1the skip fails. Part names on the board are not compared, since the guide words them its own way. Off the board, where there is no MPN, the rows pair in order and each guide row keeps every word of its BOM row's part.Upstream
check:bom, the BOM against the two parts tables in section 1 of BUILD_GUIDE.md, andcheck:bom-schematic, the BOM designators against the text layer of hardware/pcb/schematic.pdf, with their shared BOM readerweb/scripts/drift/_bom.ts.npm run check:ci,npm run typecheck,npm run lint(0 errors) andnpm run check:driftpass; edits to the guide or the BOM turn each check red; without pdftotext it skips, and fails under PF_DRIFT_STRICT=1.🤖 Generated with Claude Code
https://claude.ai/code/session_01KYL31rYvPyhizskqp57VqM