The build counted and published bytecode as example source
Two build scripts walked every file under an example. The first Python example brought __pycache__ with it, so 176 lines of bytecode were counted as source and .pyc files were published to readers as part of the structure.
同一個缺陷,每一個視角
- 使用者
The published page listed .pyc files as part of the example's structure, next to the code a reader is meant to study.
- 開發者
walk() collected every file it found. That was correct for four JavaScript examples and silently wrong for the first Python one.
- 測試
The runnable check executes the example, so the artifact is produced by the same pass that then counts it.
判斷軌跡
- 何事 · 開發者build-artifact-published-as-source2026-08-02 18:45 → 至今信心 0.99
- 何時 · 測試guaranteed-by-the-check-itself2026-08-02 18:52 → 至今信心 0.97
- 為何 · 開發者language-specific-artifact-in-a-language-agnostic-walk2026-08-02 18:50 → 至今信心 0.94
觀察記錄
- 2026-08-02 18:40已捕捉
Example line count looked implausible against the files actually written.
- 2026-08-02 18:45已重現
Seven .pyc files were being counted and published.
- 2026-08-02 18:50已定位
The runnable check produces them, so they are guaranteed rather than incidental.
- 2026-08-02 19:05已驗證
Count unchanged with bytecode present.
可執行見證
BU-0005 · A verification step that produces the artifact it then measures
假設
- refuted
A stale directory left over from an earlier manual run.
Deleting it and rebuilding reproduced it immediately — the build makes it.
證據
- tool_output · 2026-08-02 18:42
Reported 963 lines across 20 files; the actual source is 730 across 12. Seven .pyc files, 176 lines of bytecode counted as code.
- execution · 2026-08-02 18:50
Removed __pycache__, rebuilt: 730/12. Ran the example once, rebuilt: 963/20 again.
- test_result · 2026-08-02 19:04
After the fix, with six .pyc files present on disk, the count stays 730/12.
修補
- rejected
Delete __pycache__ before each build.
Rejected: treats the symptom on a schedule. The next artifact-producing language reintroduces it.
- accepted
Exclude build-artifact directories and compiled extensions in both walks.
關聯
- co_occurs_withBC-0007