fix: 提交安全检查默认忽略点前缀目录 - #59
Merged
Merged
Conversation
需求:codeguard 要默认忽略 . 开头的目录和文件(2026-09-23 用户指令)。 实测背景:插件仓发版时 .agents/plugins/marketplace.json 与 .codex-plugin/plugin.json 被判成'依赖/产物目录不应入库',阻断发版 ——它们是宿主插件清单(第一方配置),必须可入库。 变更: - check_paths 点前缀目录段不再触发'不应入库'目录拦截 (.agents/.codex-plugin/.zcode/.github/.claude/... 可入库); - 非点目录(build/dist/target/vendor/node_modules/...)维持原拦截; - 密钥类文件模式不受影响(.env、*.pem、.DS_Store 照拦); - 新增 tests/test_dot_dir_commit_policy.py 锁定新策略; - run_all 的 .venv 断言更新为'点目录默认忽略'。 测试:tests/run_all.py 144 通过 / 0 失败。
scan-scope-policy 新能力(2026-09-23 用户指令): - path_policy.is_dot_prefixed 单一谓词(root 相对判段,./.. 段豁免, 项目根在点父目录下不误伤) - 检查面四通道接入:changed_files 过滤、find 型 gate 注入 -not -path '*/.*'、 ruff full_excludes 追加点排除、save_application.should_skip 静默跳过 - 发现面 detect_languages 不计入点前缀文件 - 例外面回归锚定:入库安全照拦密钥(固化 0f284ee)、requiresConfig 点文件照常 - 提示词面:SessionStart 项目记忆 + AGENTS.md 硬性禁令 + current-architecture - tests/test_dot_prefix_default_skip.py 13 用例;架构依赖边登记
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.
需求来源
用户指令(2026-09-23):codeguard 要默认忽略 . 开头的目录和文件。
实测背景:codegraph-plugin 发版时,
.agents/plugins/marketplace.json与.codex-plugin/plugin.json被提交内容安全检查判成「目录 ./.agents/ 属于依赖/产物/本地环境,不应入库」,阻断发版——它们是宿主插件清单(第一方配置),必须可入库。变更
check_paths:点前缀目录段不再触发「不应入库」目录拦截(.agents/.codex-plugin/.zcode/.github/.claude/... 可入库).env*.pem *.key.DS_Store照拦——点规则只放开目录,不放开密钥边界)测试
tests/test_dot_dir_commit_policy.py(5 用例锁定新策略)tests/run_all.py:144 通过 / 0 失败(原「.venv 应拦截」断言更新为「点目录默认忽略」)test_git_boundaries/test_artifact_awareness/test_gate_hardening_usage不需改动即通过发版提示
合并后按惯例走
release/codeguard-v0.14.13bump + tag 发版流程。