Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
"source": {
"source": "url",
"url": "https://github.com/full-stack-plugins/codeguard-plugin.git",
"ref": "v0.15.3"
"ref": "v0.15.4"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_USE"
},
"category": "Developer Tools",
"version": "0.15.3",
"version": "0.15.4",
"description": "Evidence-backed code checks and Git content gates for AI assistants, with Maven/Gradle module impact analysis. Save hooks provide feedback; unverified checks are explicit.",
"icon": "https://cdn.jsdelivr.net/gh/full-stack-plugins/codeguard-plugin@v0.15.3/assets/official-logo.png",
"icon": "https://cdn.jsdelivr.net/gh/full-stack-plugins/codeguard-plugin@v0.15.4/assets/official-logo.png",
"interface": {
"displayName": "代码规范守卫",
"shortDescription": "Trustworthy code checks and Java impact analysis",
"logo": "https://cdn.jsdelivr.net/gh/full-stack-plugins/codeguard-plugin@v0.15.3/assets/official-logo.png"
"logo": "https://cdn.jsdelivr.net/gh/full-stack-plugins/codeguard-plugin@v0.15.4/assets/official-logo.png"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeguard",
"version": "0.15.3+codex.20260923",
"version": "0.15.4+codex.20260923",
"description": "Evidence-backed code checks and Git content gates for AI assistants, with Maven/Gradle module impact analysis. Save hooks provide feedback; unverified checks are explicit.",
"author": {
"name": "Full Stack Skills / PartMe.AI",
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/skills-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
- name: Verify lockfile pins still match upstream refs and content
run: python3 scripts/vendor/skill_vendor.py check
- name: Exercise vendor and manifest behavior
run: python3 -m unittest discover -s tests -p 'test_*.py' -v
run: python3 -m pip install --disable-pip-version-check coverage && python3 -m coverage run -m unittest discover -s tests -p 'test_*.py' -v
- name: Coverage report (advisory, non-gating)
run: python3 -m coverage report --include='scripts/**,hooks/**' --skip-empty
- name: Validate languages.json schema
run: python3 scripts/validate_languages_json.py
- name: Run plugin regression suite
Expand Down
2 changes: 1 addition & 1 deletion .zcode-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"en": "代码规范守卫",
"zh-CN": "代码规范检查"
},
"version": "0.15.3",
"version": "0.15.4",
"description": "Evidence-backed code checks and Git content gates for AI assistants, with Maven/Gradle module impact analysis. Save hooks provide feedback; unverified checks are explicit.",
"description_i18n": {
"en": "Evidence-backed code checks and Git content gates for AI assistants, with Maven/Gradle module impact analysis. Save hooks provide feedback; unverified checks are explicit.",
Expand Down
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Changelog

按版本段落提炼的主题摘要(生成于 2026-09-23,来源:git 历史 212 个提交与各 release 提交)。逐提交细节以 `git log` 与 GitHub Releases 为准;本文件按主题归纳,不逐条罗列。

## v0.15.x — Git 归因收敛与诊断安全

- **v0.15.4** 测试卫生与可见性:`tests/run_all.py`(809 行)拆分为
`_harness.py`(共享夹具)+ `_subsets.py`(8 个回归子集),入口签名与
逐字节输出保持不变(golden diff 验证);CI 单测改由 coverage 包装并
追加 advisory 覆盖率报告(非门禁)。
- **v0.15.3** heredoc 正文按归属语义归因(数据段 git 样例误报清零)。
- **v0.15.2** 发版链 fail-loud(bump 漂移即抛错);非 Shell 间接 git 归因收紧;`hook-protocol` 归因 delta 并入主规格。
- **v0.15.1** 诊断日志改为私有原子落盘;准确 Git 快照的 index 与 HEAD 身份复核。
- **v0.15.0** 点前缀目录与文件默认忽略(代码 + 提示词双层硬约束)。

## v0.14.x — Git 操作判定与 MCP 诊断(15 个补丁系列)

- 显式 / 多仓 / 间接 / 带前缀 Git 操作的仓库与暂存判定逐步收敛(0.14.3–0.14.6)。
- 逐命令执行证据与 MCP 脱敏(0.14.7);诊断日志与 CLI 判定收敛(0.14.8)。
- 门禁故障隔离与 MCP 诊断收敛(0.14.9);Git 提交链暂存时间归属(0.14.10)。
- Git 快照批量对象身份与内容哈希校验(0.14.11);MCP 自动修复文件身份边界(0.14.12)。
- MCP 逐项修复可信度判定收敛(0.14.13);外部检查进程有界输出护栏(0.14.14)。
- Git 快照资源边界与覆盖层一致性(0.14.15);提交安全检查默认忽略点前缀目录。

## v0.13.x — 执行内核收敛

- **v0.13.0** 执行内核(execution kernel)重构:五类 Hook 应用层收敛统一判定内核。

## v0.12.x — 会话实测优化与 Java 影响分析

- 规则聚合计数、`java_project` executable 键、scope 边界加固(会话实测批)。
- 默认检查等级不含测试执行(`-DskipTests` / `-x test`);ruff 版本基线钉扎。
- 工具链不兼容归 UNVERIFIED 而非误红;JDK 兼容版本解析;mvnw 感知接入门禁。
- 版本横幅不再前置——stderr 首行必须是门禁综述(契约测试锁定)。

## v0.8–v0.11 — 门禁硬化与构建产物认知

- v0.8.x:门禁硬化 14 项实弹审计修复;推送面补齐;判定归一化 + 安全检查范围收窄;守卫绕过闭环。
- v0.10.x:门禁全量扫描剔除构建产物(`find` 型 gate 注入 `-not -path`);GNU `xargs` 空输入误红修复。
- v0.11.x:构建产物认知补全——单一事实源 + 四通道生效;manifest 收敛。
- v0.12.0:判定可信度收敛 + Java 项目影响分析(mvn/gradle 变更面)。

## v0.7.x — MCP 接入与双语门禁

- **v0.7.0** 门禁触发词词边界匹配(`pushed`/`deployment` 不误触发)+ 定向语言子集 + MCP 官方 SDK 三工具 + 失败日志落盘。
- **v0.7.1** `pre_tool` import 规范化与版本行对齐收编。

## v0.6.x — 注册表契约与结构门禁

- **v0.6.1** `detect_lang` 三职责拆分(`paths.py` / `user_config.py`),hooks↔scripts 跨社区边清零;manifest bundle 测试动态化。
- **v0.6.2** `run_per_language` 共享 per-language 编排(`run_check` / `fix` 去重)。
- **v0.6.3** `hooks/__protocol__.md` 宿主契约 cheat-sheet(exit 码 / JSON / fail-open 单源化)。
- **v0.6.4** `languages.json` 11 条 schema 校验器(自捕 `ansible` 误标 planned 的真实 bug)。
- **v0.6.5** env_check 的 linter 配置盘点改由注册表驱动。
- **v0.6.6** 零引用营销资产清理 + `assets/README.md`。
- **v0.6.7** 双语 README 结构对齐门禁(标题层级/链接/版本串三断言)+ 技术方案文档改名去全角逗号。
- **v0.6.8** `linter_config_files` 推全局(4 → 39/54 stable-beta)+ 覆盖守护测试。

## v0.5.x 及更早 — 三宿主插件成型

- v0.5.x:ZCode / Codex / Kimi 三端 manifest 收敛、发版与市场仓同步链成型。
- v0.3–v0.4:早期技能 vendor 与分发安全边界(`safe-skill-distribution`)。
- v0.1.x:初版三端插件。
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ ruff check hooks scripts tests

Tests include real temporary Git repositories, native subprocess fixtures and official-SDK stdio MCP calls. Fixture wrapper success is not a real Maven/Gradle integration build. Live Codex/ZCode/Kimi loading, real project builds, online CVE scanner runs and precision/recall benchmarks require separate acceptance.

Current implementation and evidence: [architecture and extension guide](docs/current-architecture.md), [refactor verification](openspec/changes/refactor-codeguard-architecture/verification.md). Earlier documents remain historical context: [verdict and Java architecture](docs/verdict-java-architecture.md), [prior verification](docs/verification-verdict-java.md), [original architecture](docs/partme-codeguard-plugin-Architecture.zh_CN.md), [roadmap](docs/technical-roadmap.zh_CN.md).
Current implementation and evidence: [architecture and extension guide](docs/current-architecture.md), [refactor verification](openspec/changes/archive/2026-09-23-refactor-codeguard-architecture/verification.md). Earlier documents remain historical context: [verdict and Java architecture](docs/verdict-java-architecture.md), [prior verification](docs/verification-verdict-java.md), [original architecture](docs/partme-codeguard-plugin-Architecture.zh_CN.md), [roadmap](docs/technical-roadmap.zh_CN.md).

Version history: see [CHANGELOG.md](CHANGELOG.md) for release highlights by version.

## License and privacy

Expand Down
4 changes: 3 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ ruff check hooks scripts tests

测试包含真实临时 Git 仓库、原生子进程 fixture 与官方 SDK stdio MCP 调用。fixture wrapper 成功不是真实 Maven/Gradle 集成构建。Codex/ZCode/Kimi 当前版本加载、真实项目构建、在线漏洞扫描与准确率/召回率基准仍需独立验收。

当前实现与证据:[架构及扩展指南](docs/current-architecture.md)、[重构验证记录](openspec/changes/refactor-codeguard-architecture/verification.md)。旧文档保留为历史参考:[判定与 Java 架构](docs/verdict-java-architecture.md)、[此前验证报告](docs/verification-verdict-java.md)、[原架构](docs/partme-codeguard-plugin-Architecture.zh_CN.md)、[路线图](docs/technical-roadmap.zh_CN.md)。
当前实现与证据:[架构及扩展指南](docs/current-architecture.md)、[重构验证记录](openspec/changes/archive/2026-09-23-refactor-codeguard-architecture/verification.md)。旧文档保留为历史参考:[判定与 Java 架构](docs/verdict-java-architecture.md)、[此前验证报告](docs/verification-verdict-java.md)、[原架构](docs/partme-codeguard-plugin-Architecture.zh_CN.md)、[路线图](docs/technical-roadmap.zh_CN.md)。

版本历史见 [CHANGELOG.md](CHANGELOG.md)(按版本段落的主题摘要)。

## 许可与隐私

Expand Down
2 changes: 1 addition & 1 deletion kimi.plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeguard",
"version": "0.15.3",
"version": "0.15.4",
"description": "Evidence-backed code checks and Git content gates for AI assistants, with Maven/Gradle module impact analysis. Save hooks provide feedback; unverified checks are explicit.",
"author": {
"name": "Full Stack Skills / PartMe.AI"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
- [x] 5.3 新增当前架构 Mermaid 与扩展指南;报告版本读取插件 manifest,双语 README 指向当前证据,旧设计标明历史范围;双语标题/链接/版本及本地链接存在性测试通过。发布版本仍需在 5.5 检查。
- [x] 5.4 全量单测/真实 hook 回归/ruff/语言 schema/vendor 离线与在线/本 change strict 和逐条规格追溯通过;第三十一批在 0.15.0 main 上本地 590 项单测、144 项真实 Hook 回归、57 项/11 规则,证据见 verification.md。仅证明本地契约,不等同三宿主现场验收。
- [x] 5.5 按仓规升级版本、生成市场元数据、授权的 PR/CI/不可变 tag/Release 闭环;第二十九批已发布 v0.14.15(插件 PR #64、市场 PR #19、导航 PR #20、源码 PR/main CI、注释 tag/正式 Release 均核对;市场 PR 无 CI 检查)。宿主安装运行另行记录,未授权不得改宿主;发布证据见 verification.md。
- [ ] 5.6 完成全目标审计,代码/规格/证据一致后同步并归档 change,才可将整体优化标记完成。
- [x] 5.6 完成全目标审计,代码/规格/证据一致后同步并归档 change,才可将整体优化标记完成。(2026-09-23 独立会话审计,证据见 verification.md 全目标审计段)
Original file line number Diff line number Diff line change
Expand Up @@ -322,3 +322,26 @@
- CodeGraph 沿 `save_application._failure_context → storage.write_private_text` 审计发现:保存检查的截断诊断仍直接用可预测的临时路径 `write_text`,不同于已收敛的 CLI/MCP/Git 门禁日志。四项真实文件系统测试先 RED,分别覆盖宽松 umask、预置文件链接、临时父目录链接和原子替换失败;现由统一私有原子写入处理,日志故障不改变保存反馈且不返回虚假路径。另以 `evaluate_save` 的应用层用例锁定错误反馈及私有日志路径。
- 在 0.15.0 main 上本地完整单测 **590/590、0 skipped**,真实 Hook **144/0/0**;Ruff、架构依赖门禁、语言 schema **57 项/11 规则**、vendor 离线与在线、本 change strict、diff whitespace 均通过。临时索引已同步到 143 文件、2,334 节点、5,263 边;CodeGraph 的受影响测试列表为空,不能替代实际回归。上述只证明本地契约,不证明三宿主现场、Windows、联网 CVE、大型 Java 工程或恶意并发文件系统。
- 并行的 0.15.0 源码 main `eb5b638` CI 已成功;缺失的 `v0.15.0` 注释 tag 与正式 Release 已补齐,均指向该 main 提交。第三十、三十一批自身仍须另行升级版本、PR/CI、市场同步和发布,不借 0.15.0 的证据声称交付。

## 全目标审计(2026-09-23,5.6 门禁)

独立会话复核,四项证据:

1. `openspec validate refactor-codeguard-architecture --strict` → valid。
2. `python3 scripts/check_architecture.py` → `Architecture OK: declared core dependencies and first-party import cycles checked`。
3. 16 条 ADDED Requirement ↔ 模块/测试映射核对:12 组专属模块/测试对全部在位
(execution / planning / save_application / hook_state / fingerprint / gate /
language_check / java_analysis / cve / git_snapshot / git_staging / dockerfile);
其余 4 条(进程证据、失败可观测、入口兼容、诊断原子)由 execution 与各协议
入口 + 既有契约测试覆盖(与任务 2.1–2.4、4.1–4.3 的证据台账一致)。
4. `tests/run_all.py` 144/0/0。

本地契约边界(如实披露):本机 `python3 -m unittest discover` 存在 6 个预存
环境敏感失败(`test_gate_application` ×2——本机未装 ruff 致 F821 输出为空;
`test_state_storage` ×4——多会话并发共享状态目录干扰),已在共享工作树对照
复现同红,证明非本审计批引入;CI 钉扎 `ruff==0.16.8` 且状态目录隔离下为绿。
该 6 项属测试环境隔离债(建议后续 change:state fixture 注入隔离 STATE_DIR、
ruff 依赖测试按工具可用性自适应),不构成规格/代码不一致。

结论:代码 / 规格 / 证据一致,5.6 满足,change 可归档。三宿主现场安装验收
仍按 4.3/5.5 声明独立进行,不在此豁免。
Loading
Loading