Skip to content
Open
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": "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/full-stack-plugins/codeguard-plugin.git",
"ref": "v0.20.0"
"ref": "v0.20.1"
},
"policy": {
"installation": "AVAILABLE",
"authentication": "ON_USE"
},
"category": "Developer Tools",
"version": "0.20.0",
"version": "0.20.1",
"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.20.0/assets/official-logo.png",
"icon": "https://cdn.jsdelivr.net/gh/full-stack-plugins/codeguard-plugin@v0.20.1/assets/official-logo.png",
"interface": {
"displayName": "CodeGuard",
"shortDescription": "Trustworthy code checks and Java impact analysis",
"logo": "https://cdn.jsdelivr.net/gh/full-stack-plugins/codeguard-plugin@v0.20.0/assets/official-logo.png"
"logo": "https://cdn.jsdelivr.net/gh/full-stack-plugins/codeguard-plugin@v0.20.1/assets/official-logo.png"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"name": "codeguard",
"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.",
"version": "0.20.0",
"version": "0.20.1",
"source": "./"
}
]
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codeguard",
"version": "0.20.0",
"version": "0.20.1",
"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
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.20.0+codex.20261004",
"version": "0.20.1+codex.20261017",
"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
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Vendored text bytes must remain identical to the LF source snapshots.
# Auto detection keeps binary skill artifacts byte-for-byte unchanged.
skills/** text=auto eol=lf
26 changes: 26 additions & 0 deletions .github/workflows/skills-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,29 @@ jobs:
print("Edit codeguard-skills, release a new tag, then run scripts/vendor/skill_vendor.py update.")
sys.exit(1)
PY

vendor-portability-windows:
runs-on: windows-latest
permissions:
contents: read
env:
PYTHONUTF8: "1"
PYTHONDONTWRITEBYTECODE: "1"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
with:
python-version: '3.13'
- name: Prepare isolated test temporary directory
shell: pwsh
run: |
$taskTmp = Join-Path $env:RUNNER_TEMP 'vendor-portability/tmp'
New-Item -ItemType Directory -Force -Path $taskTmp | Out-Null
"TEMP=$taskTmp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"TMP=$taskTmp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Verify Windows path ordering and LF checkout behavior
run: python -B -m unittest discover -s tests -p test_skill_vendor_portability.py -v
- name: Verify checkout bytes against locked skill digests
run: python -B scripts/vendor/skill_vendor.py check --offline
- name: Verify upstream pins and bytes with ordinary Git configuration
run: python -B scripts/vendor/skill_vendor.py check
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": "CodeGuard",
"zh-CN": "代码规范检查"
},
"version": "0.20.0",
"version": "0.20.1",
"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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.20.1 — 2026-10-17

- 修复 Windows 与 Unix 路径排序不同导致的受管技能摘要误报;上游检出固定 LF,保留二进制原件和既有来源锁。
- 补齐公共发版器的 Claude 清单、Python 项目版本预检及写后核对,版本漂移在写入前拒绝。
- 登记工程守卫插件接入规划,所有新增任务仍待实施;不声明新增原生检查或真实宿主资格。

## 0.20.0 — 2026-10-04

- 固定 Rust CLI 0.1.4 与全部 32 份可执行、未验收 grammar 的公开制品身份。
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CodeGuard plugin

## Plugin marketplaces

This plugin belongs to **Full-stack development**.

| Category | Marketplace | Purpose |
| --- | --- | --- |
| Full-stack development | [Full Stack Plugins](https://github.com/partme-ai/full-stack-plugins) | Architecture and UI design, code understanding, quality checks, code review, workflow governance, and server operations |
| AIGC content creation | [Full AIGC Plugins](https://github.com/partme-ai/full-aigc-plugins) | Image, video, audio, music, 3D, and multimodal content creation |

> Parity: README.md and README.zh-CN.md must keep the same heading structure, local links and version strings; enforced by tests/test_readme_parity.py.

[English](README.md) · [简体中文](README.zh-CN.md)
Expand Down
9 changes: 9 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CodeGuard 插件

## 插件市场导航

本插件所属分类:**全栈开发**。

| 分类 | 插件市场入口 | 用途 |
| --- | --- | --- |
| 全栈开发 | [Full Stack Plugins](https://github.com/partme-ai/full-stack-plugins) | 架构与 UI 设计、代码理解、质量检查、代码审查、流程治理与服务器运维 |
| AIGC 内容创作 | [Full AIGC Plugins](https://github.com/partme-ai/full-aigc-plugins) | 图像、视频、音频、音乐、3D 与多模态内容创作 |

> 结构对齐:README.md 与 README.zh-CN.md 的标题层级、本地链接和版本串必须一致,由 tests/test_readme_parity.py 检查。

[English](README.md) · [简体中文](README.zh-CN.md)
Expand Down
53 changes: 53 additions & 0 deletions docs/vendor-portability.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Portable vendor byte verification

Managed skills remain owned by their locked source repositories. The verifier
fix does not update a source ref, lock digest or skill blob. Plugin versioning
and publication are separate release steps.

The directory digest sorts case-sensitive POSIX **relative path strings** and
hashes each relative path plus the SHA256 of the file's original bytes. It does
not sort native Path objects, case-fold paths, normalize Unicode, or rewrite
CRLF during validation. Binary data is hashed unchanged. Mixed case and file /
directory prefixes have explicit regression coverage.

The private upstream checkout uses command-local `core.autocrlf=false` and
`core.eol=lf`; it does not change global / repository Git configuration or
replace inherited `GIT_CONFIG_COUNT` options. Tests use a real temporary Git
source and prove LF text, exact binary bytes and unchanged caller configuration
even when inherited settings request CRLF.

`.gitattributes` declares `skills/** text=auto eol=lf`. Git detects binary files
and preserves their bytes; text snapshots use LF on future checkouts. Adding
this policy does **not** repair bytes already present in a Windows working tree.
A current CRLF snapshot must continue to fail raw-byte vendor validation. Do
not regenerate the lock, silently normalize during hashing, overwrite local
changes, or reset the whole skills directory to make that failure disappear.
Use a separately verified clean LF checkout when local bytes differ. Any repair
of an existing checkout requires per-file verification and preservation of all
real modifications and untracked files.

Validation commands (temporary files must be on the approved development drive):

```text
python -B -m unittest discover -s tests -p test_skill_vendor_portability.py -v
python -B scripts/vendor/skill_vendor.py check --offline
python -B scripts/vendor/skill_vendor.py check
```

Offline checks prove local byte equality. Online checks additionally verify the
pinned upstream ref / commit and byte content; they do not prove installed-agent
loading, actual model invocation, or release publication.

## Existing Windows checkout verification

On 2026-10-17 the existing checkout initially failed its raw-byte checks. Each
tracked skill file was compared with its Git blob before any repair; only exact
CRLF equivalents were restored to the already locked source bytes. All 484
restored text files were backed up with before/source SHA256 records on the
approved development drive. Real modifications and untracked files were not
included. Skill blobs and the source lock remain unchanged in Git.

After restoration, both offline and online checks in this actual checkout
passed; the earlier failures and isolated LF results remain separate evidence.
The five portability tests also passed independently on Windows. These checks
do not claim a plugin release or installed-host acceptance.
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.20.0",
"version": "0.20.1",
"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
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-10-17
33 changes: 33 additions & 0 deletions openspec/changes/integrate-engineering-guard-host/design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 集成设计与验收边界

来源:2026-10-17 按既有总体规划重建;原引用路径在当前检出及本地可用历史中未找到。本变更是新重建的任务定义,不声称恢复了历史原文,也不声明实现或用户验收已完成。依据为 [traceability](https://github.com/full-stack-plugins/codeguard/blob/8d7c0e997bf21b3306573b3be89ff8c312c9de38/docs/engineering-guard/traceability.md)、[acceptance](https://github.com/full-stack-plugins/codeguard/blob/8d7c0e997bf21b3306573b3be89ff8c312c9de38/docs/engineering-guard/acceptance.md)、[protocol](https://github.com/full-stack-plugins/codeguard/blob/8d7c0e997bf21b3306573b3be89ff8c312c9de38/docs/engineering-guard/protocol.md) 与本仓现有维护约束。

## Context

本仓已有实现、公共接口和兼容义务,属于 Brownfield。当前变更沿用既有 OpenSpec,只定义总体规划已要求的增量,不建立第二套领域规则或宿主 Runtime。

## Goals / Non-Goals

目标:维持现有行为,以版本化输入、来源身份与明确覆盖向专业守卫提供可核验事实;在原生账本保留稳定任务及真实验收证据。

非目标:在插件内复制公共内核、持久数据库、专业规则判定或授权签发;仅凭模型结论、Hook 或本地文件声明对抗性强制。

## Decisions

1. 本仓 specs/tasks 是 H 系列定义及状态的唯一事实源,总体追溯表只引用。现有原生规格继续适用。
2. 适配器固定 producer/adapter/protocol/制品身份,保留原始报告。解析不赋予可信身份;确定性结果、建议、覆盖与执行状态分离。
3. 跨仓依赖只使用任务 ID 与发布接口,不在已安装插件中要求相邻源码目录。当前临时账本仍在 CodeGuard,公共内核实际实现仓库为 guardengine(逻辑 GuardCore)。
4. provider 兼容任务可在最终产品发布前独立验收,但不能以离线协议样本替代任务明确要求的真实工具、宿主或服务端验收。最终迁移/发布任务保留全部组合验收责任。
5. 授权只接受独立受信来源;已有同范围授权复用,扩大权限另核验。输入报告视为数据,不执行建议文本。

## Risks / Trade-offs

旧引用只说明规划意图,不能证明旧任务实现。缺工具、宿主、身份或权限时保持 pending/blocked 证据,不编造完成节点。安装与发布时按本仓版本、技能来源和市场规则执行,规划文件存在不构成安装或发布。

## Migration Plan

先固定现有 provider 行为与黄金反例,再接入公共协议和消费者,最后完成真实宿主/平台/升级回滚与规则单一 owner 交接。迁移前旧实现继续唯一拥有既有语义,迁移后不保留第二判定核;历史证据保留原身份,不自动升权。

## Validation

每个任务先使目标反例失败,再实现并执行目标测试与受影响回归。证据记录输入/候选/契约/工具/平台/宿主/命令/原始输出及摘要。全部 required 场景满足后才能勾选、同步和归档。
28 changes: 28 additions & 0 deletions openspec/changes/integrate-engineering-guard-host/proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 工程守卫集成:codeguard-plugin

来源:2026-10-17 按既有总体规划重建;原引用路径在当前检出及本地可用历史中未找到。本变更是新重建的任务定义,不声称恢复了历史原文,也不声明实现或用户验收已完成。依据为 [traceability](https://github.com/full-stack-plugins/codeguard/blob/8d7c0e997bf21b3306573b3be89ff8c312c9de38/docs/engineering-guard/traceability.md)、[acceptance](https://github.com/full-stack-plugins/codeguard/blob/8d7c0e997bf21b3306573b3be89ff8c312c9de38/docs/engineering-guard/acceptance.md)、[protocol](https://github.com/full-stack-plugins/codeguard/blob/8d7c0e997bf21b3306573b3be89ff8c312c9de38/docs/engineering-guard/protocol.md) 与本仓现有维护约束。

## Why

总体规划引用的 H 系列任务缺少原生定义,无法校验依赖与验收归属。需要补齐本插件的唯一实施账本,并把已有插件能力接到七产品的版本化证据协议;不得把规划补齐等同于产品交付。

## What Changes

- 在本仓保留 EG-CGH-001、EG-CGH-002、EG-CGH-003、EG-CGH-004、EG-CGH-005 的职责及可观察行为。
- 定义 EG-H01、EG-H02、EG-H03、EG-H04、EG-H05、EG-H06、EG-H07、EG-H08、EG-H09、EG-H10,全部待实施;保留总体规划的稳定引用。
- provider 兼容证明先于消费方最终发布;最终迁移验收仍要求实际产品、宿主、版本与保护证据,不减少验收范围。
- 不初始化新规格体系,不改变既有运行时、技能来源锁、Hook 语义、批准策略或发布流程。

## Capabilities

### New Capabilities

- `engineering-host-bridge`:本插件面向公共工程协议的来源、范围、覆盖、权限与生命周期边界。

### Modified Capabilities

无;既有规格继续适用,不通过本变更改写已确认行为。

## Impact

计划影响本插件的适配入口、证据投影、测试与未来发布。实施时遵守 AGENTS.md;受管技能不在插件内手改,真实宿主和托管保护不得由离线模拟替代。普通验证不顺带安装、初始化、索引、外发或 Git 写动作。
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
## Purpose

定义 codeguard-plugin 在七产品工程守卫体系中的证据和集成契约;沿用现有插件边界,不以报告、模型或本地 Hook 自称交付授权。

来源:2026-10-17 按既有总体规划重建;原引用路径在当前检出及本地可用历史中未找到。本变更是新重建的任务定义,不声称恢复了历史原文,也不声明实现或用户验收已完成。依据为 [traceability](https://github.com/full-stack-plugins/codeguard/blob/8d7c0e997bf21b3306573b3be89ff8c312c9de38/docs/engineering-guard/traceability.md)、[acceptance](https://github.com/full-stack-plugins/codeguard/blob/8d7c0e997bf21b3306573b3be89ff8c312c9de38/docs/engineering-guard/acceptance.md)、[protocol](https://github.com/full-stack-plugins/codeguard/blob/8d7c0e997bf21b3306573b3be89ff8c312c9de38/docs/engineering-guard/protocol.md) 与本仓现有维护约束。

## ADDED Requirements

### Requirement: EG-CGH-001 Pinned bridge

系统 SHALL 宿主桥必须调用固定版本及摘要的 CodeGuard/公共执行入口,保留当前 CLI 与旧 Hook 行为;缺核心、策略或平台资格时不得回退为工程通过。

#### Scenario: EG-CGH-001 reject unsupported or unsafe input

- **WHEN** 固定运行时损坏或不支持当前平台
- **THEN** 返回准备阻塞,不选择 PATH 上另一工具

#### Scenario: EG-CGH-001 preserve supported behavior

- **WHEN** 已验证组合处理同一请求
- **THEN** 跨入口产生同一领域结果并保留运行身份

### Requirement: EG-CGH-002 Correct event subject

系统 SHALL 每类事件必须绑定实际 session/worktree/task、动作和候选类型;保存、暂存、提交、合入报告不得互用,真正执行前重新核对目标身份。

#### Scenario: EG-CGH-002 reject unsupported or unsafe input

- **WHEN** index 报告用于不同 HEAD 或合入候选
- **THEN** 拒绝复用并要求验证实际候选

#### Scenario: EG-CGH-002 preserve supported behavior

- **WHEN** 事件与绑定候选完全相符
- **THEN** 仅使用该候选的有效结果

### Requirement: EG-CGH-003 Singleflight interaction

系统 SHALL 相同身份和输入的并发事件可单飞;不同内容、会话、工作树不可误去重。最新失败/取消不能被迟到旧 PASS 覆盖。

#### Scenario: EG-CGH-003 reject unsupported or unsafe input

- **WHEN** 两个会话并发且一个新运行失败
- **THEN** 分别保留归属,新失败不被旧 PASS 清除

#### Scenario: EG-CGH-003 preserve supported behavior

- **WHEN** 完全相同的重复事件到达
- **THEN** 复用同一次受管运行,不重复申请相同范围授权

### Requirement: EG-CGH-004 Nonmisleading feedback

系统 SHALL 反馈必须区分执行、规则结论、覆盖和信任;保存后反馈不声称 Git 放行;报告内容只作为数据,公开摘要脱敏,违规与 incomplete 同时保留。

#### Scenario: EG-CGH-004 reject unsupported or unsafe input

- **WHEN** 报告含指令、秘密或超时前违规
- **THEN** 不执行报告内容,保留违规与限制,公开内容脱敏

#### Scenario: EG-CGH-004 preserve supported behavior

- **WHEN** 有效检查无违规但范围局部
- **THEN** 仅报告局部结果,不称全面通过

### Requirement: EG-CGH-005 Host and distribution gates

系统 SHALL 安装、事件适配、取消、重入、卸载和升级回滚须按宿主/平台逐格验收;候选桥与正式启用必须区分,缺格明确 unverified。

#### Scenario: EG-CGH-005 reject unsupported or unsafe input

- **WHEN** 只有离线 Hook 重放通过
- **THEN** 不声明真实宿主验收完成

#### Scenario: EG-CGH-005 preserve supported behavior

- **WHEN** 某宿主真实安装及允许/拒绝/取消/回滚均完成
- **THEN** 只登记该宿主版本和平台的证据
Loading
Loading