release: v0.11.1(构建产物认知补全:单一事实源 + 四通道生效 + html NUL 管道) - #35
Merged
Merged
Conversation
需求:codeguard 得知道哪些是构建产物、不需要检测。实测两类永久红: target/**/apidocs/javadoc.sh(java 门禁自产、shell 门禁必红)与 target/site/jacoco/*.html(html 门禁必红);html 门禁旧 -exec 形态在产物 数百个时把整串换行路径塞进单参数(xargs: insufficient space)。 - 单一事实源:scope.FULL_SCAN_EXCLUDES 扩为 24 目录(补 out/.next/.nuxt/ .gradle/coverage/.terraform/.eggs/htmlcov/.turbo/.parcel-cache/三缓存/env), 新增 is_build_artifact() 谓词;gate_lib.GUARD_EXCLUDE_DIRS 改为派生 (本清单 + IDE 目录)——此前两份手抄清单已漂移:扫描面缺 14 个产物目录、 入库面缺 upstream - 注入器三形态全覆盖:-print0 锚(原样)、-exec 锚(旧 html 形态曾整族漏网)、 无 NUL 锚 → find <path> 后插入(c/objc/cuda);c/objc 的 -o 组补括号, 否则 -not -path 被 OR 优先级短路、排除形同虚设 - changed_files 过滤产物路径:force-add 进索引的 target 文件不进 delta 面 - PostToolUse should_skip 产物静默跳过:写 target/ 的生成物不跑 linter, 防止 AI"自动修复"生成物(改完下次构建又重写) - html 门禁改 NUL 全管道:print0 → xargs -0 grep -L → tr '\n' '\0' → xargs -0 htmlhint,消灭换行单参数溢出面(macOS grep -Z 是模糊匹配非 NUL 输出,实测不可用,故用 tr 转换) - spec 同步 language-gate-commands:ruff 单族 → 全门禁族 + 单源 + NUL 管道 - README×2 与 4 份 manifest → 0.11.1(v0.11.0 漏改 README 版本行,一并对齐) 验证:unittest 149/149(新增 tests/test_artifact_awareness.py 29 用例)、 run_all 141/0、validate_languages_json 11 规则、LANGUAGES.md 再生成零 diff
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.
需求
codeguard 得知道哪些是构建产物,不需要进行检测。(用户在真实工作区被 target/ 生成物反复误拦后提出)
实测根因
target/**/apidocs/javadoc.sh(java 门禁自产)→ shell 门禁必红;target/site/jacoco/*.html→ html 门禁必红——生成物不会被修复,每次构建重写-exec … {} + | xargs -0形态:换行分隔的文件清单在产物数百个时成为单参数(xargs: insufficient space)-print0锚:html(-exec)/c/objc/cuda 四族整族漏网改动
scope.FULL_SCAN_EXCLUDES(24 目录)+is_build_artifact()谓词;gate_lib.GUARD_EXCLUDE_DIRS改为派生(+IDE 目录),两侧永不漂移-print0/-exec/ 无 NUL 锚(find <path>后插入);c/objc 的-o组补括号(否则 OR 优先级让排除形同虚设)--exclude、find 注入、PostToolUse 产物静默跳过、changed_files过滤(force-add 的 target 不进 delta 面)print0 → xargs -0 grep -L → tr "\n" "\0" → xargs -0 htmlhint验证
tests/test_artifact_awareness.py29 用例)run_all.py141/0、validate_languages_json11 规则、LANGUAGES.md 再生成零 diff