Repository navigation
feat: 会话实测优化——executable 键契约/scope 子仓排除/规则聚合/审计明细 - #43
Merged
3 commits merged intoSep 22, 2026
Merged
3 commits merged into
3 commits merged into
Conversation
基于 opencode-java-sdk 六分支发布实测的后续优化: - gate_lib:新增 _rule_summary() 聚合 lint 规则计数(AI 被截断后 一次看到问题全集与规模,不再 whack-a-mole 逐个修) - pre_tool_git_guard:gate_directive 传入 project_root(供日志/决策) - java_project:plan 顶层暴露 executable 键——门禁消费者直接读取 用于 mvn→./mvnw 替换(POM 4.1.0 场景) - scope:新增 is_git_repo 工具函数 + full_excludes 泛化改进 测试 248 个全绿。codeguard skipGate 已获用户明确指令启用。
…skip_event 审计明细增强 - JavaExecutableContractTest 夹具补 groupId/artifactId/version/packaging—— 不完整 pom 会让 _maven 在 wrapper 判定前就抛"缺少 artifactId", 契约测试恒 UNVERIFIED 无法到达 executable 断言 - record_skip_event 增加可选 detail 参数:skipGate-read-error 与 monorepo-fallback 事件记录具体原因(豁免/跳过必须可回溯到"哪个仓、 什么时候、为什么");resolve_project_roots 回退路径同步传 None lanes - 测试断言消息附带 plan reasons(失败时直接看到判定依据)
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.
背景
基于 opencli-java-sdk + codex-java-sdk 六分支发布/审计会话实测的痛点修复(POM 4.1.0 + mvnw 仓库的 Java 门禁、跨仓误伤、whack-a-mole 报错揭示)。
修复项
P0 mvnw 感知死代码(生产者-消费者键不匹配)
gate_libJava 门禁读取_jp.get("executable"),但java_project.analyze从不产出该键(wrapper 只体现在commands[0].argv[0])→ 替换逻辑恒不触发,POM 4.1.0 仓库照旧走裸 mvn 必失败executable键;gate_lib 增加回退纯函数_java_executable_from_plan(顶层键 → commands argv 里的 mvnw/gradlew)./mvnw;缺失 →mvn;不可执行 → UNVERIFIED + 原因含"不可执行"chmod +x mvnwscope 子 git 仓排除(跨仓误伤根治)
.git的独立仓库——它们由各自的提交门禁负责报告质量
gate_directive首行显式标注"本次门禁目标仓库"——cwd 漂移扫到非目标仓时 AI 第一时间发现EXE001×2 DTZ011×1)——治理 whack-a-mole 逐条揭示[*]时附加ruff check --fix精确命令chmod +x mvnw自救提示record_skip_event增加可选detail:skipGate-read-error 与 monorepo-fallback 事件记录具体原因(豁免/跳过可回溯到"哪个仓、什么时候、为什么")测试
tests/test_session_pain_fixes.py:17 用例(executable 契约 ×3、消费纯函数 ×4、目标仓标签 ×3、[可自动修复提示 ×2、规则聚合 ×2、子仓排除 ×3——含"git 仓根不加子仓排除"的反向断言)验证
unittest discover -s tests -p 'test_*.py':269+ 全绿(skipped=4 为环境条件跳过)python3 tests/run_all.py:141 通过 / 0 失败 / 0 跳过ruff check hooks/ scripts/ tests/:All checks passed