feat(analysis): add harness component snapshots - #69
Open
U1oSun wants to merge 1 commit into
Open
Conversation
U1oSun
force-pushed
the
feat/harness-component-snapshot-v1
branch
from
August 5, 2026 09:38
898d5c9 to
17d542c
Compare
There was a problem hiding this comment.
Pull request overview
该 PR 落地了一个能力私有(capability-owned)的 HarnessComponentSnapshotV1:为 Qoder 项目范围 的 Rules / Skills / Hooks / Commands / Workflows 生成确定性、隐私安全、可校验(digest/rollback ref)的组件快照,并提供有界 diff 与非授权的 rollback-reference 解析;同时通过 agent-customize 增加“项目集合 allowlist”以确保只采集明确在范围内的资产,符合所述 LC-02 v1 读面切片与 spec 约束。
Changes:
- 新增
scripts/harness-component-snapshot/:contract(canonical/digest/route safety)、snapshot 组装、bounded diff、rollback-reference resolution,以及 direct CLI(create/validate/diff/resolve)。 agent-customize的 Qoder provider 支持projectCollectionsallowlist,并在非 Qoder provider 上显式拒绝该参数。- 增加端到端 fixture + contract/CLI 测试与架构/规格文档路由更新。
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/harness-component-snapshot.test.mjs | 覆盖快照确定性、隐私边界、hook/skill revision 维度、populationRef 约束、有界 diff、校验与 rollback-reference 行为。 |
| test/harness-component-snapshot-cli.test.mjs | 覆盖 direct CLI help/strict parsing、JSON stdout、stderr 不回显路径/不可信字段、各子命令回归。 |
| test/fixtures/harness-component-snapshot/project/scripts/check.mjs | fixture:用于验证 hook script 纳入 revision 且不泄露内容。 |
| test/fixtures/harness-component-snapshot/project/AGENTS.md | fixture:用于验证相对路径 route 与证据读取边界。 |
| test/fixtures/harness-component-snapshot/project/.agents/workflows/handoff.json | fixture:包含绝对路径哨兵,验证隐私不泄露(只保留摘要)。 |
| test/fixtures/harness-component-snapshot/project/.agents/skills/handoff/SKILL.md | fixture:用于 skills 采集/树 revision 行为覆盖。 |
| scripts/harness-component-snapshot/snapshot.mjs | 核心:workspace 边界校验、Qoder inventory 完整性探测、组件证据读取与 revision、workflow 扫描与快照组装。 |
| scripts/harness-component-snapshot/rollback.mjs | 非授权 rollback-reference 解析与解析结果契约。 |
| scripts/harness-component-snapshot/README.md | 能力说明与 direct CLI 用法,链接到 spec。 |
| scripts/harness-component-snapshot/index.mjs | 公共导出面:contract/create/diff/resolve。 |
| scripts/harness-component-snapshot/diff.mjs | 有界、确定性 diff(added/removed/changed/unchanged)与 digest。 |
| scripts/harness-component-snapshot/contract.mjs | v1 contract:canonical stringify、route 规范化、ID/rollback ref、snapshot 校验与 digest。 |
| scripts/harness-component-snapshot/cli.mjs | direct CLI:严格参数解析、stdout JSON、stderr 稳定 code 且不回显路径/不可信字段。 |
| scripts/agent-customize/providers/qoder.mjs | 增加 projectCollections allowlist 支持,按集合选择性采集 hooks/skills/rules/commands/agents/mcps。 |
| scripts/agent-customize/inventory.mjs | 非 Qoder provider 禁止 projectCollections,避免误用/误期望。 |
| docs/specs/2026-08-02-harness-component-snapshot-v1.md | 规格:AC(HCS-AC-1..10)、非目标、风险与证据链。 |
| docs/ARCHITECTURE.md | 记录能力 owner 与路由/边界(不注册 root CLI、只组合 allowlisted agent-customize 集合等)。 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add a deterministic Qoder project component snapshot and bounded diff contract for Rules, Skills, Hooks, Commands, and Workflows. Keep identity, content revision, activation evidence, provenance, and non-authorizing rollback references separate. Keep project inventory reads collection-scoped so out-of-scope MCP and subagent assets cannot affect the snapshot. Fail closed on Qoder Home aliases and unsafe routes, and emit stable diagnostics without exposing caller-selected paths or parser details. Reuse one snapshot-scoped canonical workspace boundary across evidence reads without retaining process-lifetime caller-path caches. Implements roadmap LC-02 using docs/specs/2026-08-02-harness-component-snapshot-v1.md. Validation passed with 1,288 tests and 1 platform skip, doc links 6/6, and package verification at 458 npm and 480 runtime ZIP entries. Co-authored-by: Codex (GPT 5.6 Sol) <codex@openai.com>
U1oSun
force-pushed
the
feat/harness-component-snapshot-v1
branch
from
August 5, 2026 10:12
17d542c to
d053275
Compare
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.
Summary
Add deterministic, privacy-safe Qoder project component snapshots and bounded diffs for Rules, Skills, Hooks, Commands, and Workflows.
Why
LC-02(no separate GitHub issue found)Traceability and Scope
docs/specs/2026-08-02-harness-component-snapshot-v1.mdHCS-AC-1throughHCS-AC-10scripts/harness-component-snapshot/owns the capability;docs/ARCHITECTURE.mdrecords the route; Qoder project inventory gains a collection allowlist.Change Type
Test and Review Evidence
node --test test/harness-component-snapshot.test.mjs test/harness-component-snapshot-cli.test.mjsnode --test test/doc-link-graph.test.mjsnpm testnpm run pack:verifygit diff --check origin/main...HEADManual or visual evidence: Not applicable; this is a JSON automation and direct CLI capability with subprocess coverage.
Risk and Recovery
HarnessComponentSnapshotV1capability and shipped CLI modules. No generated files or dependency changes.d053275. Snapshot rollback references are deliberately non-authorizing and cannot mutate a workspace.AI Involvement
main, and validated with focused, full-suite, documentation-link, package, and diff checks.Checklist
AGENTS.md,CONTRIBUTING.md, and the relevant canonical-owner guidance.CHANGELOG.md. (Not applicable: this additive v1 capability is not registered in the root CLI and changes no existing user-facing behavior.)