frontend-project-context 1.3.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +39 -2
  2. package/README.md +94 -16
  3. package/UPGRADING.md +47 -2
  4. package/docs/04-PROGRAM-DESIGN.md +40 -4
  5. package/docs/05-ACCEPTANCE-CONTRACT.md +33 -3
  6. package/docs/08-INSTALLATION-AND-DISTRIBUTION.md +36 -6
  7. package/docs/14-FORMAL-RELEASE-READINESS.md +46 -0
  8. package/docs/18-BRANCH-AWARE-STAGED-CONTEXT-DESIGN.md +62 -2
  9. package/docs/19-POST-1.3.1-AI-TAKEOVER-EVIDENCE-AND-UPGRADE-PLAN.md +579 -0
  10. package/docs/20-PHASE-A-AI-TAKEOVER-AND-HEALTH-CLOSURE-DESIGN.md +535 -0
  11. package/docs/21-PHASE-B-EVIDENCE-FEEDBACK-PROTOCOL-DESIGN.md +347 -0
  12. package/docs/22-PHASE-C-TARGET-UPGRADE-PROTOCOL-DESIGN.md +398 -0
  13. package/docs/README.md +21 -5
  14. package/docs/USER-AND-AI-OPERATION-MANUAL.md +797 -0
  15. package/examples/README.md +38 -0
  16. package/examples/package.json +6 -2
  17. package/migration-manifest.json +88 -0
  18. package/package.json +3 -2
  19. package/schemas/action-plan.schema.json +31 -3
  20. package/schemas/capabilities.schema.json +50 -18
  21. package/schemas/evidence-bundle.schema.json +64 -0
  22. package/schemas/evidence-input.schema.json +82 -0
  23. package/schemas/migration-manifest.schema.json +29 -0
  24. package/schemas/migration-plan.schema.json +32 -0
  25. package/schemas/project-status.schema.json +75 -0
  26. package/schemas/projection-lock.schema.json +48 -0
  27. package/schemas/review-bundle.schema.json +3 -3
  28. package/schemas/upgrade-assessment.schema.json +48 -0
  29. package/schemas/upgrade-result-bundle.schema.json +35 -0
  30. package/src/project-context/ai-entry.mjs +320 -0
  31. package/src/project-context/capabilities.mjs +44 -17
  32. package/src/project-context/checker.mjs +20 -3
  33. package/src/project-context/cli.mjs +84 -7
  34. package/src/project-context/contract-schema.mjs +30 -16
  35. package/src/project-context/dashboard-model.mjs +4 -4
  36. package/src/project-context/dashboard-renderer.mjs +3 -3
  37. package/src/project-context/discovery.mjs +6 -1
  38. package/src/project-context/evidence-schema.mjs +209 -0
  39. package/src/project-context/evidence.mjs +99 -0
  40. package/src/project-context/exchange-schema.mjs +21 -11
  41. package/src/project-context/exchange.mjs +26 -4
  42. package/src/project-context/maintenance.mjs +2 -2
  43. package/src/project-context/migration-manifest.mjs +166 -0
  44. package/src/project-context/project-status.mjs +157 -0
  45. package/src/project-context/projection-store.mjs +8 -1
  46. package/src/project-context/task-context-schema.mjs +237 -1
  47. package/src/project-context/task-context.mjs +154 -13
  48. package/src/project-context/upgrade-schema.mjs +215 -0
  49. package/src/project-context/upgrade.mjs +494 -0
package/CHANGELOG.md CHANGED
@@ -1,13 +1,50 @@
1
1
  # Changelog
2
2
 
3
- ## 1.3.0 unreleased
3
+ ## 1.6.0 - 2026-09-11
4
+
5
+ - Add read-only `upgrade-check` and `upgrade-plan`, plus preview-by-default `upgrade-apply` with explicit `--write` for one compiled product-owned migration unit.
6
+ - Add strict, self-digested Migration Manifest schema 2 and Upgrade Assessment, Migration Plan, and Upgrade Result Bundle schema 1.
7
+ - Bind every plan to manifest, assessment, store snapshots, and managed target byte digests; stale baselines and ownership conflicts fail closed.
8
+ - Reuse existing managed AI Entry/projection CAS, atomic replacement, and conditional recovery primitives; healthy baselines converge through zero-write `verify-complete`.
9
+ - Upgrade capabilities and exchange protocol to version 4 while Action Plan and Review Bundle remain schema 2.
10
+ - Keep package-manager, Git, network, project tests, business writes, automatic approval/upgrade/rollback, and overall-upgrade claims outside the product boundary.
11
+ - Pass A-101 through A-114 plus all existing regressions, 120/120 total.
12
+
13
+ ## 1.5.0 - Unreleased
14
+
15
+ - Add read-only `evidence` for deterministic, project-local Evidence Bundle schema 1 output.
16
+ - Add strict Evidence Input schema 1, canonical 32 KiB input and 48 KiB output budgets, self-verifying digests, and structural privacy minimization.
17
+ - Sample uninitialized, partial, invalid, attention, conflict, and clean Project Context health without writing or conflating observation result with governance health.
18
+ - Upgrade capabilities and exchange protocol to version 3, publish both evidence schemas, and declare `automaticEvidenceUpload: false`.
19
+ - Keep all transfer states human-review-required; add no upload, telemetry, Provider, Agent Runtime, Git, network, store migration, or automatic product-decision path.
20
+ - Pass A-91 through A-100 plus all existing regressions, 106/106 total.
21
+
22
+ ## 1.4.0 - Unreleased
23
+
24
+ - Add read-only project `status` with deterministic health and next-action references.
25
+ - Add managed-region `publish-entry` and `remove-entry` with byte ownership, CAS, and conditional lock recovery.
26
+ - Read Projection Lock schemas 1/2 and lazily write schema 2 on the first AI Entry write.
27
+ - Upgrade capabilities, Action Plan, Review Bundle, and exchange protocol to version 2 while retaining schema-1 Action Plan input.
28
+ - Publish project-status, projection-lock, and migration-manifest schemas plus the minimal `1.3.1` to `1.4.0` migration manifest.
29
+
30
+ ## 1.3.1 — 2026-09-10
31
+
32
+ - `stage-context` 与 `integration-review` 新增可重复 `--receipt-bundle` 输入,按 Stage identity 将每份 receipt 与其输入 Stage Context Bundle 精确配对。
33
+ - 新增严格 Stage Context Bundle schema 1 运行时验证、自身 digest/规范 UTF-8 字节核对,并按 plan 依赖顺序用已验证前序 receipt 确定性重建 Bundle。
34
+ - 缺失、重复、多余、错配、篡改、过期 snapshot、completed receipt 绑定 blocked bundle,以及不完整或绕过的多级依赖链全部以稳定 finding 失败封闭。
35
+ - README 中英文安装 pin、`examples/package.json`、package version 与发布验收统一为 `1.3.1`。
36
+ - Task Context Plan、Stage Receipt、Stage Context Bundle、Integration Review Bundle 与所有 store schema 保持原版本;没有新增 Provider、Agent Runtime、Git/网络、任务执行或第三方依赖。
37
+ - A-74 至 A-76 与全部旧回归共 82/82 项通过;候选包与官方 registry tarball 逐字节一致,并已完成独立安装冒烟验证。
38
+
39
+ ## 1.3.0 — 2026-09-10
4
40
 
5
41
  - 新增严格的 Task Context Plan schema 1 与 Stage Receipt schema 1:宿主显式提供任务、stage 依赖、revision label、snapshot、路径和预算,未知、权限、执行、循环依赖、非法路径与无依赖范围重叠均失败封闭。
6
42
  - 新增永远只读的 `stage-context`,复用 Scope Compiler 为显式指定阶段生成 Stage Context Bundle schema 1,并用调用方提供的规范 UTF-8 字节与 read-target 预算失败封闭。
7
43
  - 新增永远只读的 `integration-review`,比较 plan/receipt/Contract baseline、宿主提供的 main/branch changed paths、Contract item 重叠、stage 越界、生命周期 finding 和待人判断的 decision candidate。
8
44
  - 公开 Stage Context Bundle 和 Integration Review Bundle schema 1,capabilities 增加两个命令、四份 schema 和 `canonical-utf8-bytes` 预算语义。
9
45
  - 不新增 store migration、Provider、Agent Runtime、Git 读写、源码正文读取、任务/测试执行、依赖、自动批准、合并或长期事实晋升。
10
- - A-64 至 A-73 与全部旧回归共 79/79 项为实现 Gate;本条不代表 npm 打包、发布、Git 提交/push 或真实项目验收。
46
+ - A-64 至 A-73 与全部旧回归共 79/79 项通过;候选包与官方 registry tarball 逐字节一致,并已完成独立安装冒烟验证。
47
+ - 发布后核验发现不可覆盖的 `1.3.0` tarball 中 README 安装命令与示例依赖仍固定为 `1.2.0`;运行时不受影响,仓库已修正为 `1.3.0`,后续修复版本需单独授权。
11
48
 
12
49
  ## 1.2.0 — 2026-09-09
13
50
 
package/README.md CHANGED
@@ -14,7 +14,7 @@ AI coding tools often read only part of a repository. Important conventions may
14
14
 
15
15
  - selects the approved guidance that applies to a file or directory;
16
16
  - renders focused context for existing coding agents;
17
- - exposes versioned machine capabilities and schemas for model-neutral hosts;
17
+ - exposes versioned machine capabilities, schemas, and human-reviewed evidence bundles for model-neutral hosts;
18
18
  - converts AI suggestions into authority-free Action Plans and read-only Review Bundles;
19
19
  - publishes managed Markdown, AGENTS, or Ruler-compatible projections;
20
20
  - reports source, contract, and projection drift;
@@ -32,15 +32,29 @@ It does **not** call an AI provider, edit business code, manage Git, install dep
32
32
  Pin it as a development dependency so local users and CI run the same version:
33
33
 
34
34
  ```bash
35
- npm install --save-dev frontend-project-context@1.2.0
35
+ npm install --save-dev frontend-project-context@1.6.0
36
36
  ```
37
37
 
38
38
  The package has zero runtime dependencies.
39
39
 
40
- `1.2.0` is the current independently verified public npm version. The published tarball was byte-matched against the reviewed release candidate and smoke-tested from the official registry.
40
+ `1.6.0` is the current release line and includes the cumulative `1.4.0` status/takeover, `1.5.0` evidence, and `1.6.0` target-upgrade protocols.
41
41
 
42
42
  ### Quick start
43
43
 
44
+ Every host can begin with one read-only status command, including before initialization:
45
+
46
+ ```bash
47
+ npx project-context status --project . --json
48
+ ```
49
+
50
+ `status` classifies uninitialized, partial, invalid, attention, clean, and ownership-conflict states without reading business source bodies or writing project files. After initialization, publish a fixed startup route into a managed region of root `AGENTS.md` while preserving all human content outside that region:
51
+
52
+ ```bash
53
+ npx project-context publish-entry --project . --output AGENTS.md --write --json
54
+ ```
55
+
56
+ Use `remove-entry` with the same output to remove only a trusted managed region. Plans and previews never include `--write`; human approval of the exact path remains required.
57
+
44
58
  Let an existing Coding Agent prepare deterministic onboarding candidates:
45
59
 
46
60
  ```bash
@@ -117,7 +131,7 @@ Discover the exchange contract without initializing the project:
117
131
  npx project-context capabilities --project . --json
118
132
  ```
119
133
 
120
- An external AI host can create an Action Plan schema 1 using the returned project snapshots and one of the eight advertised action kinds. Save that short-lived plan inside the project, then produce a read-only Review Bundle:
134
+ An external AI host can create an Action Plan schema 2 using the returned project snapshots and one of the ten advertised action kinds. Schema-1 plans remain readable. Save that short-lived plan inside the project, then produce a read-only Review Bundle:
121
135
 
122
136
  ```bash
123
137
  npx project-context preflight \
@@ -136,6 +150,7 @@ npx project-context stage-context \
136
150
  --plan task-context-plan.json \
137
151
  --stage stage-render \
138
152
  --receipt stage-understand.receipt.json \
153
+ --receipt-bundle stage-understand.bundle.json \
139
154
  --changed-path src/example.ts \
140
155
  --json
141
156
  ```
@@ -147,6 +162,7 @@ npx project-context integration-review \
147
162
  --project . \
148
163
  --plan task-context-plan.json \
149
164
  --receipt stage-understand.receipt.json \
165
+ --receipt-bundle stage-understand.bundle.json \
150
166
  --main-changed-path src/shared.ts \
151
167
  --branch-changed-path src/example.ts \
152
168
  --json
@@ -154,7 +170,28 @@ npx project-context integration-review \
154
170
 
155
171
  Both commands are read-only. They do not inspect Git, read source bodies, execute the task or tests, save task state, promote decisions, or grant merge authority. Budget limits are caller-supplied canonical UTF-8 bytes and read-target counts, not model tokens.
156
172
 
157
- The package publishes eight machine schemas: capabilities, Assist Bundle, Action Plan, Review Bundle, Task Context Plan, Stage Receipt, Stage Context Bundle, and Integration Review Bundle.
173
+ Starting with `1.3.1`, every supplied Stage Receipt must have exactly one matching `--receipt-bundle`. Both commands strictly validate and deterministically rebuild the complete receipt/bundle dependency chain before accepting `inputBundleDigest`; missing, duplicate, mismatched, tampered, stale, or blocked inputs fail closed.
174
+
175
+ To turn an already-redacted local observation into a deterministic Evidence Bundle, keep the input JSON inside the project and run:
176
+
177
+ ```bash
178
+ npx project-context evidence --project . --input evidence-input.json --json
179
+ ```
180
+
181
+ `evidence` reads only the supplied input plus Project Context health metadata, writes nothing, and never uploads. It excludes project identity, paths, source bodies, logs, and Contract values by structure. The two summary fields remain free text, so every bundle is permanently marked `human-review-required`; a person decides whether and where to transfer it.
182
+
183
+ After a human and the Host pin an exact target package version outside this product, assess the project-owned migration surface and create one digest-bound work unit:
184
+
185
+ ```bash
186
+ npx project-context upgrade-check --project . --from-version 1.5.0 --json > .project-context/upgrade-assessment.json
187
+ npx project-context upgrade-plan --project . --assessment .project-context/upgrade-assessment.json --json > .project-context/migration-plan.json
188
+ npx project-context upgrade-apply --project . --plan .project-context/migration-plan.json --json
189
+ npx project-context upgrade-apply --project . --plan .project-context/migration-plan.json --write --json
190
+ ```
191
+
192
+ `upgrade-check` and `upgrade-plan` are permanently read-only. `upgrade-apply` previews by default and can write only the single compiled, product-owned unit shown in that exact plan. Re-run check and plan after every unit. Even `coreMigration: complete` still requires the Host to verify dependency/lockfile pins, project tests or CI, and an independent new window. The product does not run a package manager, Git, network, project tests, business writes, automatic approval, rollback, or publication.
193
+
194
+ The package publishes sixteen machine schemas, including capabilities, project status, projection lock 1/2, Migration Manifest 2, Upgrade Assessment/Migration Plan/Upgrade Result Bundle 1, Evidence Input/Bundle, Assist/Action/Review bundles, and the four staged-context schemas.
158
195
 
159
196
  Generate the read-only governance dashboard:
160
197
 
@@ -201,6 +238,7 @@ All commands are read-only unless that command explicitly includes `--write`. So
201
238
  | --- | --- |
202
239
  | `setup` | Aggregate safe initialization, conservative discovery, and an Assist Bundle |
203
240
  | `capabilities` | Discover protocol versions, schemas, action kinds, initialization, and permanent boundaries |
241
+ | `evidence` | Build a deterministic, read-only, human-reviewed Evidence Bundle from a project-local input |
204
242
  | `init` | Create an empty project contract safely |
205
243
  | `register` | Register a file, path, JSON pointer, or human decision |
206
244
  | `discover` | Conservatively propose bootstrap candidates |
@@ -211,8 +249,8 @@ All commands are read-only unless that command explicitly includes `--write`. So
211
249
  | `check` | Detect stale sources, contracts, and projections |
212
250
  | `sync` | Aggregate source drift, item impact, changed paths, and reconciliation work units |
213
251
  | `preflight` | Validate an Action Plan and return a read-only grouped Review Bundle |
214
- | `stage-context` | Compile the explicitly requested stage within caller-provided byte/read-target budgets |
215
- | `integration-review` | Review plan, receipts, host path signals, baselines, and context-layer conflicts without Git |
252
+ | `stage-context` | Rebuild receipt/bundle inputs and compile the explicitly requested stage within caller-provided byte/read-target budgets |
253
+ | `integration-review` | Review paired receipts/bundles, host path signals, baselines, and context-layer conflicts without Git |
216
254
  | `dashboard` | Render the read-only governance dashboard |
217
255
  | `review-source` | Review a changed source and its exact impact set |
218
256
  | `accept-source-change` | Accept a pinned source digest and revoke affected approvals |
@@ -223,6 +261,7 @@ Run `npx project-context --help` for the complete command syntax.
223
261
 
224
262
  ### Documentation
225
263
 
264
+ - [User and AI operation manual](./docs/USER-AND-AI-OPERATION-MANUAL.md)
226
265
  - [Product constitution](./docs/00-PRODUCT-CONSTITUTION.md)
227
266
  - [Program and CLI design](./docs/04-PROGRAM-DESIGN.md)
228
267
  - [Acceptance contract](./docs/05-ACCEPTANCE-CONTRACT.md)
@@ -233,7 +272,7 @@ Run `npx project-context --help` for the complete command syntax.
233
272
  - [Guided onboarding and AI-assisted reconciliation](./docs/16-GUIDED-ONBOARDING-AND-AI-RECONCILIATION-DESIGN.md)
234
273
  - [AI exchange boundary](./docs/17-AI-EXCHANGE-BOUNDARY-DESIGN.md)
235
274
  - [Branch-aware staged context and handoff](./docs/18-BRANCH-AWARE-STAGED-CONTEXT-DESIGN.md)
236
- - [AI Exchange Boundary design](./docs/17-AI-EXCHANGE-BOUNDARY-DESIGN.md)
275
+ - [Evidence Feedback Protocol](./docs/21-PHASE-B-EVIDENCE-FEEDBACK-PROTOCOL-DESIGN.md)
237
276
  - [Upgrade notes](./UPGRADING.md)
238
277
 
239
278
  ## 中文
@@ -244,7 +283,7 @@ AI 编程工具通常只读取仓库的一部分,而项目约定分散在文
244
283
 
245
284
  - 按文件或目录选择真正生效的已批准规则;
246
285
  - 为现有 Coding Agent 生成精简且可追溯的上下文;
247
- - 向模型无关宿主公开版本化 capability 与机器 schema;
286
+ - 向模型无关宿主公开版本化 capability、机器 schema 与需人工复核的证据包;
248
287
  - 把 AI 建议收敛为无权限 Action Plan 和只读 Review Bundle;
249
288
  - 从同一合同生成受管 Markdown、AGENTS 或 Ruler 兼容投影;
250
289
  - 检测来源、合同和投影是否过期;
@@ -262,15 +301,29 @@ AI 编程工具通常只读取仓库的一部分,而项目约定分散在文
262
301
  建议固定为开发依赖,让本地与 CI 使用同一版本:
263
302
 
264
303
  ```bash
265
- npm install --save-dev frontend-project-context@1.2.0
304
+ npm install --save-dev frontend-project-context@1.6.0
266
305
  ```
267
306
 
268
307
  本包没有运行时第三方依赖。
269
308
 
270
- `1.2.0` 是当前已独立核验的公共 npm 最新版本。已发布 tarball 与审查过的发布候选逐字节一致,并已从官方 registry 完成安装冒烟验证。
309
+ `1.3.1` 仍是已核验的 npm 公开版本。当前仓库包含本地已实现的 `1.6.0` 候选;公开发布仍需单独授权。
271
310
 
272
311
  ### 快速开始
273
312
 
313
+ 任何宿主都可以先运行同一条只读状态命令,包括尚未初始化的项目:
314
+
315
+ ```bash
316
+ npx project-context status --project . --json
317
+ ```
318
+
319
+ `status` 在不读取业务源码正文、不写项目文件的前提下分类 uninitialized、partial、invalid、attention、clean 和所有权冲突。初始化后,可把固定启动路由发布到根 `AGENTS.md` 的受管区域,同时完整保留区域外人工内容:
320
+
321
+ ```bash
322
+ npx project-context publish-entry --project . --output AGENTS.md --write --json
323
+ ```
324
+
325
+ 使用相同 output 的 `remove-entry` 只移除可信受管区域。计划与 preview 都不含 `--write`,仍需人对精确路径授权。
326
+
274
327
  让现有 Coding Agent 生成确定性的首次接入候选:
275
328
 
276
329
  ```bash
@@ -347,7 +400,7 @@ npx project-context sync \
347
400
  npx project-context capabilities --project . --json
348
401
  ```
349
402
 
350
- 外部 AI 宿主可使用返回的三个项目 snapshot 和八类 action 生成 Action Plan schema 1。把这份短生命周期计划保存在项目内,再生成只读 Review Bundle:
403
+ 外部 AI 宿主可使用返回的三个项目 snapshot 和十类 action 生成 Action Plan schema 2;schema-1 plan 仍可读取。把这份短生命周期计划保存在项目内,再生成只读 Review Bundle:
351
404
 
352
405
  ```bash
353
406
  npx project-context preflight \
@@ -366,6 +419,7 @@ npx project-context stage-context \
366
419
  --plan task-context-plan.json \
367
420
  --stage stage-render \
368
421
  --receipt stage-understand.receipt.json \
422
+ --receipt-bundle stage-understand.bundle.json \
369
423
  --changed-path src/example.ts \
370
424
  --json
371
425
  ```
@@ -377,6 +431,7 @@ npx project-context integration-review \
377
431
  --project . \
378
432
  --plan task-context-plan.json \
379
433
  --receipt stage-understand.receipt.json \
434
+ --receipt-bundle stage-understand.bundle.json \
380
435
  --main-changed-path src/shared.ts \
381
436
  --branch-changed-path src/example.ts \
382
437
  --json
@@ -384,7 +439,28 @@ npx project-context integration-review \
384
439
 
385
440
  两个命令都不会读取 Git 或源码正文、执行任务或测试、保存任务状态、晋升决定或授予合并权限。预算由调用方以规范 UTF-8 字节数和 read-target 数量显式提供,不等同于模型 token。
386
441
 
387
- npm 包公开八份机器 schema:capabilities、Assist Bundle、Action Plan、Review Bundle、Task Context Plan、Stage Receipt、Stage Context Bundle Integration Review Bundle。
442
+ `1.3.1` 起,每份 Stage Receipt 都必须恰好对应一份 `--receipt-bundle`。两个命令会严格验证并确定性重建完整 receipt/bundle 依赖链后再接受 `inputBundleDigest`;缺失、重复、错配、篡改、过期或 blocked 输入都会失败封闭。
443
+
444
+ 要把一次已经脱敏的本地观察收敛为确定性 Evidence Bundle,请把输入 JSON 保持在项目内并运行:
445
+
446
+ ```bash
447
+ npx project-context evidence --project . --input evidence-input.json --json
448
+ ```
449
+
450
+ `evidence` 只读取这份输入和 Project Context 健康元数据,不写文件,也不上传;项目身份、路径、来源正文、日志和 Contract value 按结构排除。两个 summary 仍是自由文本,因此所有 bundle 永远标记为 `human-review-required`,由人决定是否以及向谁转交。
451
+
452
+ 在人和 Host 已于产品边界外把依赖固定到精确目标版本后,可以评估产品自有迁移面,并生成一个 digest 绑定的工作单元:
453
+
454
+ ```bash
455
+ npx project-context upgrade-check --project . --from-version 1.5.0 --json > .project-context/upgrade-assessment.json
456
+ npx project-context upgrade-plan --project . --assessment .project-context/upgrade-assessment.json --json > .project-context/migration-plan.json
457
+ npx project-context upgrade-apply --project . --plan .project-context/migration-plan.json --json
458
+ npx project-context upgrade-apply --project . --plan .project-context/migration-plan.json --write --json
459
+ ```
460
+
461
+ `upgrade-check` 与 `upgrade-plan` 永久只读;`upgrade-apply` 默认 preview,只有显式 `--write` 才能执行该 plan 展示的一个已编译、产品自有单元。每个单元后必须重新 check/plan。即使 `coreMigration: complete`,Host 仍需核对依赖与 lockfile、运行项目测试或 CI,并用独立新窗口复核。产品不会执行包管理器、Git、网络、项目测试、业务写入、自动批准、回滚或发布。
462
+
463
+ npm 包公开十六份机器 schema,包括 capabilities、project status、projection lock 1/2、Migration Manifest 2、Upgrade Assessment/Migration Plan/Upgrade Result Bundle 1、Evidence Input/Bundle、Assist/Action/Review Bundle 与四份 staged-context schema。
388
464
 
389
465
  生成只读治理看板:
390
466
 
@@ -431,6 +507,7 @@ npx project-context dashboard --project . > project-context-dashboard.html
431
507
  | --- | --- |
432
508
  | `setup` | 聚合安全初始化、保守 discovery 和 Assist Bundle |
433
509
  | `capabilities` | 查询协议版本、schema、action kind、初始化状态和永久边界 |
510
+ | `evidence` | 从项目内输入生成确定性、只读且需人工复核的 Evidence Bundle |
434
511
  | `init` | 安全创建空项目合同 |
435
512
  | `register` | 登记文件、路径、JSON Pointer 或人工决定 |
436
513
  | `discover` | 保守提出首次接入候选 |
@@ -441,8 +518,8 @@ npx project-context dashboard --project . > project-context-dashboard.html
441
518
  | `check` | 检测来源、合同和投影漂移 |
442
519
  | `sync` | 聚合来源漂移、item 影响、变化路径和维护工作单元 |
443
520
  | `preflight` | 验证 Action Plan 并返回只读分组 Review Bundle |
444
- | `stage-context` | 在调用方字节/read-target 预算内编译显式指定的当前阶段 |
445
- | `integration-review` | 不读取 Git,只读审查 plan、receipt、路径信号、baseline 与上下文冲突 |
521
+ | `stage-context` | 重建 receipt/bundle 输入,并在调用方字节/read-target 预算内编译显式指定的当前阶段 |
522
+ | `integration-review` | 不读取 Git,只读审查成对 receipt/bundle、路径信号、baseline 与上下文冲突 |
446
523
  | `dashboard` | 生成只读治理看板 |
447
524
  | `review-source` | 查看来源变化及精确影响集 |
448
525
  | `accept-source-change` | 接受固定摘要并撤销受影响批准 |
@@ -453,6 +530,7 @@ npx project-context dashboard --project . > project-context-dashboard.html
453
530
 
454
531
  ### 深入文档
455
532
 
533
+ - [使用与 AI 协作操作手册](./docs/USER-AND-AI-OPERATION-MANUAL.md)
456
534
  - [产品宪法](./docs/00-PRODUCT-CONSTITUTION.md)
457
535
  - [程序与 CLI 设计](./docs/04-PROGRAM-DESIGN.md)
458
536
  - [验收合同](./docs/05-ACCEPTANCE-CONTRACT.md)
@@ -463,7 +541,7 @@ npx project-context dashboard --project . > project-context-dashboard.html
463
541
  - [引导式接入与 AI 辅助维护](./docs/16-GUIDED-ONBOARDING-AND-AI-RECONCILIATION-DESIGN.md)
464
542
  - [AI 双向交换边界](./docs/17-AI-EXCHANGE-BOUNDARY-DESIGN.md)
465
543
  - [分支感知的分阶段上下文与交接](./docs/18-BRANCH-AWARE-STAGED-CONTEXT-DESIGN.md)
466
- - [AI 双向交换边界设计](./docs/17-AI-EXCHANGE-BOUNDARY-DESIGN.md)
544
+ - [Evidence Feedback Protocol](./docs/21-PHASE-B-EVIDENCE-FEEDBACK-PROTOCOL-DESIGN.md)
467
545
  - [升级说明](./UPGRADING.md)
468
546
 
469
547
  ## License / 许可证
package/UPGRADING.md CHANGED
@@ -1,5 +1,48 @@
1
1
  # 升级说明
2
2
 
3
+ ## `1.3.1 / 1.4.0 / 1.5.0 → 1.6.0`
4
+
5
+ `1.6.0` 新增 Target Upgrade Protocol:Migration Manifest 升至 schema 2,新增 Upgrade Assessment、Migration Plan 与 Upgrade Result Bundle schema 1,并把 capabilities / Exchange Protocol 升至 4。Action Plan 与 Review Bundle 继续写 schema 2;Contract、source lock、proposal、projection lock 与 renderer 的目标版本不变。
6
+
7
+ 依赖和 lockfile 必须先由人授权、由 Host 在产品边界外固定到精确 `1.6.0`。随后按顺序运行:
8
+
9
+ ```bash
10
+ project-context upgrade-check --project . --from-version 1.5.0 --json
11
+ project-context upgrade-plan --project . --assessment .project-context/upgrade-assessment.json --json
12
+ project-context upgrade-apply --project . --plan .project-context/migration-plan.json --json
13
+ project-context upgrade-apply --project . --plan .project-context/migration-plan.json --write --json
14
+ ```
15
+
16
+ assessment 与 plan 文件由 Host 保存到项目内 `.project-context/` 的非 store JSON 路径。前两条命令永久只读;apply 默认 preview,并且每份 plan 只允许一个已编译的产品自有工作单元。每次写入后旧 plan 必然过期,必须从真实字节重新 check/plan。健康的 `1.3.1`、`1.4.0`、`1.5.0` 基线走 `package-only` / `verify-complete`,不会为了升级人为改写 store;只有仍受工具所有且 renderer 过旧的 AI Entry/projection 才会生成 republish 单元。
17
+
18
+ `coreMigration: complete` 只证明产品自有迁移面收敛。依赖/lockfile 一致性、项目测试或 CI、独立新窗口复核、外部恢复点以及临时 assessment/plan/result 清理由 Host 或人确认。工具不调用包管理器、不读 Git、不联网、不执行项目测试、不修改业务代码,也不自动批准、回滚或发布。
19
+
20
+ ## `1.4.0 → 1.5.0`
21
+
22
+ `1.5.0` 新增只读 `evidence`、Evidence Input/Bundle schema 1,并把 Exchange Protocol 与 capabilities 升至 3。Action Plan/Review Bundle 保持 schema 2,Project Status、Assist Bundle 与四份 staged-context schema 保持原版本;Contract、source/projection lock、proposal 和 renderer 均无迁移。
23
+
24
+ 本版本的 manifest `writes` 为空,回退类别为 `package-only`。从公开 `1.3.1` 直达 `1.5.0` 时,仍需遵守 `1.4.0` 已声明的 AI Entry/projection-lock 延迟迁移:如果曾运行 `publish-entry --write`,回到 `1.3.1` reader 需要从外部 Git 或备份同时恢复 `AGENTS.md` 和 projection lock。
25
+
26
+ 外部 consumer 必须按 capabilities schema 3 / Exchange Protocol 3 分支,并把 Evidence Bundle 视为短生命周期、`human-review-required` 的本地工件。工具不上传、不保存、不自动脱敏自由文本、不创建需求或执行权限。
27
+
28
+ ## `1.3.1 → 1.4.0`
29
+
30
+ `1.4.0` 新增只读 `status`、`publish-entry` / `remove-entry`区域型 AI Entry、Projection Lock schema 1/2 reader、Exchange Protocol 2 与机器可读迁移清单。Contract 1/2、source lock 1、proposal 1、Assist Bundle 1 和四份 staged-context schema 1 不变。
31
+
32
+ 只安装新包且未写 AI Entry 时可仅回退包版本。第一次成功执行 `publish-entry --write` 才会把 `.project-context/projections.lock.json` 延迟转换为 schema 2;此后对 `1.3.1` reader 为 forward-only。如必须回到 `1.3.1`,需通过外部 Git 或备份同时恢复 `AGENTS.md` 与 projection lock,不能只降包版本。精确 reader/writer、consumer change 与 rollback class 见 `migration-manifest.json`。
33
+
34
+ Action Plan 2 新增 `publish-ai-entry` 和 `remove-ai-entry`,但仍只是无权建议;Review Bundle 的 structured invocation 不含 `--write` 或 `--by`。`status.health: clean` 只证明 Project Context 治理层健康,不代表业务测试、Git 或发布状态。本仓库已完成本地实现与隔离验收,npm 发布仍需单独授权。
35
+
36
+ ## `1.3.0 → 1.3.1`
37
+
38
+ `1.3.1` 修复 `1.3.0` 正式调用链未把 Stage Receipt `inputBundleDigest` 绑定到实际 Stage Context Bundle 的协议缺陷,并统一 README、示例依赖、package 与发布验收的消费者版本 pin。
39
+
40
+ 采用分阶段协议的宿主必须同步升级调用:每个 `--receipt FILE` 都要提供同 stage 的 `--receipt-bundle FILE`。两类文件按内部 project/task/stage identity 配对,不依赖参数顺序。工具会严格验证 Bundle schema、自身 digest、规范 UTF-8 字节、plan 与三个 snapshot,并按依赖顺序用已验证前序 receipt 和 Bundle 自带的 `changedPaths` 重建规范 Bundle。缺失、重复、多余、错配、篡改、过期 baseline、completed receipt 绑定 blocked bundle 或传递依赖链不完整都会返回 blocked finding。
41
+
42
+ 不带 receipt 的首 stage 调用不变。旧的“只传 receipt”调用会从可能错误的 ready/reviewable 收紧为 blocked,这是恢复既有失败封闭合同。四份 task/bundle schema 仍为 1,所有持久 store、exchange protocol、renderer 和 Dashboard View Model 均不迁移。命令仍只读,不创建 task store、不读取 Git/网络/源码正文、不执行任务或测试,也不增加依赖。
43
+
44
+ 实现与 A-01 至 A-76、B0、CLI 和发布工件共 82 项验收已经完成。该版本已于 2026-09-10 发布到官方公共 npm,`latest` 指向 `1.3.1`;发布包与冻结候选逐字节一致,从 registry 独立安装后的 help、capabilities 与版本冒烟均通过。
45
+
3
46
  ## `1.2.0 → 1.3.0`
4
47
 
5
48
  `1.3.0` 增加可选 Branch-aware Staged Context & Handoff 协议:四份新的短生命周 schema、只读 `stage-context` 和只读 `integration-review`。Contract、proposal、source/projection lock、renderer、Dashboard View Model、Assist Bundle、Action Plan 和 Review Bundle schema 都不变,旧项目无需迁移 `.project-context/`。
@@ -7,12 +50,14 @@
7
50
  采用该可选协议时:
8
51
 
9
52
  1. 宿主根据 `schemas/task-context-plan.schema.json` 显式准备 task、stage DAG、workspace label、三个 snapshot 与 UTF-8 字节/read-target 预算。
10
- 2. 运行 `project-context stage-context --project . --plan FILE --stage STAGE_ID --json`;只为当前 stage 提供有效前序 receipt 和 changed-path 信号。
53
+ 2. 运行 `project-context stage-context --project . --plan FILE --stage STAGE_ID --json`;只为当前 stage 提供有效前序 receipt、对应 receipt bundle 和 changed-path 信号。
11
54
  3. 外部 Coding Agent 执行任务后,由宿主按 `schemas/stage-receipt.schema.json` 记录结构化结果;receipt 不是人工验收或后续权限。
12
55
  4. 合并前运行 `project-context integration-review`,显式传入 main/branch changed paths;工具不自行读 Git。
13
56
  5. 合并、测试、业务正确性、任务工件存放/删除和长期事实晋升仍由外部工具与人决定。
14
57
 
15
- 当前源码已完成实现验收,但未获得 npm 打包或发布授权;已公开核验的 npm `latest` 仍为 `1.2.0`。
58
+ 该版本已于 2026-09-10 发布到官方公共 npm,`latest` 指向 `1.3.0`;发布包与冻结候选逐字节一致,从 registry 独立安装后的 help、capabilities、init 与 clean check 均通过。
59
+
60
+ 已发布的不可覆盖 tarball 有两项已知问题:README 安装命令与 `examples/package.json` 仍固定为 `1.2.0`;同时正式 `stage-context`/`integration-review` 路径未将 receipt `inputBundleDigest` 与对应 Stage Context Bundle 工件重建结果核对。这两项缺陷已在本地 `1.3.1` 实现中修复;公开发布仍需单独授权。
16
61
 
17
62
  ## `1.1.0 → 1.2.0`
18
63
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > 权威说明:本文记录当前实现设计;如与 [00-PRODUCT-CONSTITUTION.md](./00-PRODUCT-CONSTITUTION.md) 冲突,以产品宪法为准。
4
4
 
5
- > 状态:`1.3.0 Branch-aware Staged Context implemented locally; A-01 through A-73, B0 regressions, CLI, schemas, and package metadata verified; 79 tests total; pack and release not authorized`
5
+ > 状态:`1.6.0 Target Upgrade Protocol implemented locally; A-01 through A-114 pass 120/120; release not authorized`
6
6
  >
7
7
  > 前置真源:[03-FINAL-SOLUTION.md](./03-FINAL-SOLUTION.md)。本文不得重新引入 Agent Runtime、任务执行、Git 生命周期或完整多工具适配矩阵。
8
8
 
@@ -13,6 +13,7 @@ v1 是一个本地 Node.js CLI 和一组无第三方依赖的可复用模块,
13
13
  ```text
14
14
  project-context init
15
15
  project-context capabilities
16
+ project-context evidence
16
17
  project-context setup
17
18
  project-context register
18
19
  project-context propose
@@ -60,7 +61,7 @@ CLI 不提供 `run`、`generate-code`、`validate`、`retry`、`review-candidate
60
61
  - projection lock 为 `{ schemaVersion, projections[] }`,每项记录输出路径、target、目标 scope paths、合同/bundle/内容 digest、item IDs 和 renderer version;
61
62
  - Contract reader 支持 schema 1/2,并只在成功废弃来源时延迟写 schema 2;proposal 和两个 lock 继续使用 schema 1;新投影使用 renderer version 3,读取器兼容 renderer version 1/2 的受管投影并要求显式重发;
62
63
  - `contract.json` 中的本地 source digest 必须与 source lock 一致;lock 是上次人工批准时的确认点,`check` 不自动更新它。
63
- - npm 包中的 `schemas/capabilities.schema.json`、`assist-bundle.schema.json`、`action-plan.schema.json` `review-bundle.schema.json` 是版本化机器交换合同,不是项目 store 或第二真源。
64
+ - npm 包中的 capabilities、Evidence Input/Bundle、Assist/Action/Review Bundle 与 staged-context JSON schema 是版本化机器交换合同,不是项目 store 或第二真源。
64
65
 
65
66
  ## 4. Project Contract schema
66
67
 
@@ -316,7 +317,7 @@ project-context sync --project PATH [--changed-path RELATIVE_PATH...] [--json]
316
317
  project-context capabilities --project PATH [--json]
317
318
  ```
318
319
 
319
- `capabilities` 在未初始化、partial 或已初始化项目中均只读可用。JSON 从实现常量派生 package/exchange protocol/schema version、公共命令、八类 Action Plan action、初始化状态、项目 ID/name 和永久 false 的 Provider、Agent Runtime、Git、network、dependency install、automatic approval、business-code write、apply-plan、scheduler、daemon 边界;它不创建 capability 配置文件。
320
+ `capabilities` 在未初始化、partial 或已初始化项目中均只读可用。JSON 从实现常量派生 package/exchange protocol/schema version、公共命令、十类 Action Plan action、初始化状态、项目 ID/name 和永久 false 的 Provider、Agent Runtime、Git、network、dependency install、automatic approval、business-code write、apply-plan、scheduler、daemon、telemetry、self-update、automatic evidence upload 边界;它不创建 capability 配置文件。
320
321
 
321
322
  ### 5.12 `preflight`
322
323
 
@@ -330,6 +331,14 @@ project-context preflight --project PATH --plan FILE [--json]
330
331
 
331
332
  Assist Bundle 默认只含摘要、digest、精确 ID、locator、`readTargets` 和稳定 `workUnits`,不含来源正文或无关 item 的完整值。超大影响显式标记并保留全部 ID,不静默截断。AI 可以据此准备既有安全命令,但规范写入仍要求人明确批准具体 ID 和路径。
332
333
 
334
+ ### 5.13 `evidence`
335
+
336
+ ```text
337
+ project-context evidence --project PATH --input FILE [--json]
338
+ ```
339
+
340
+ `evidence` 只读取项目内普通 JSON 输入、现有 Project Context store 与 AI Entry,生成 Evidence Bundle schema 1 到 stdout。Evidence Input schema 1 严格限制枚举、单行 summary、数组数量、artifact `kind + sha256` 结构与 32 KiB 规范 UTF-8 预算;Bundle 只保留最小治理健康、协议/schema 版本、永久 false 边界和排除自身计算的 digest,总量上限 48 KiB,不截断。输出按结构排除项目身份、路径、Contract/source 正文、日志和凭据;自由文本永远标记 `human-review-required`。命令无 output/upload/write 参数,不保存、上传、执行复现或晋升结论。
341
+
333
342
  ## 6. 确定性编译规则
334
343
 
335
344
  1. 只读取 `approved` item。
@@ -420,6 +429,7 @@ Action Plan 的新增稳定错误为:schema/project mismatch 退出 2;projec
420
429
  10. setup/sync Assist Bundle 聚合、changed path 映射和 A-46 至 A-55。
421
430
  11. capabilities、Action Plan/Review Bundle、只读 preflight、机器 schema 和 A-56 至 A-63。
422
431
  12. Task Context Plan/Stage Receipt、字节预算 Stage Context Bundle、只读 integration review 和 A-64 至 A-73。
432
+ 13. 只读 Evidence Feedback Protocol、capabilities/exchange 3、两份 evidence schema 和 A-91 至 A-100。
423
433
 
424
434
  任何一步都不需要真实项目任务或 Provider。
425
435
 
@@ -512,4 +522,30 @@ A-56 至 A-63 和全部既有回归共 69/69 通过。实现未增加 store migr
512
522
  - `integration-review` 只消费宿主传入的 main/branch changed paths,报告 path/Contract overlap、stage 越界、生命周阻塞和 decision candidate;
513
523
  - capabilities 公开两个新命令、四份 schema version 1 和 `canonical-utf8-bytes` 预算单位。
514
524
 
515
- A-64 至 A-73 与全部旧回归共 79/79 通过。实现不读 Git 或源码正文,不执行任务/测试,不保存 task store,不自动批准、合并或晋升决定,不增加 Provider、Agent Runtime、Git、网络、依赖、scheduler 或 daemon。未执行 npm pack、registry、真实项目试用、Git commit/push 或发布。
525
+ A-64 至 A-73 与全部旧回归现有 79 项测试仍全部通过。实现不读 Git 或源码正文,不执行任务/测试,不保存 task store,不自动批准、合并或晋升决定,不增加 Provider、Agent Runtime、Git、网络、依赖、scheduler 或 daemon。`frontend-project-context@1.3.0` 已公开发布,候选包、标签、运行时与 registry 工件已独立核验。发布后审查确认正式调用链未核对 receipt `inputBundleDigest` 与实际 Bundle,以及已发布 tarball 的 README/example 仍固定 `1.2.0`;两项缺陷已经合并为 `1.3.1` 修复。
526
+
527
+ ## 19. `1.3.1` Receipt Binding 与 Consumer Pins 修复结果
528
+
529
+ [18-BRANCH-AWARE-STAGED-CONTEXT-DESIGN.md](./18-BRANCH-AWARE-STAGED-CONTEXT-DESIGN.md) 第 18 节冻结的补丁已完成本地实现:`stage-context` 与 `integration-review` 接受可重复 `--receipt-bundle`,严格验证 Stage Context Bundle schema 1、项目内路径、预算、自身 digest 与规范字节数;随后按 plan 依赖顺序,以 bundle 的 `changedPaths` 和已经验证的前序 receipt 重建每个输入 Bundle。只有 project/task/stage、plan、三个 snapshot、规范内容和 `inputBundleDigest` 全部匹配,且 completed receipt 未绑定 blocked bundle,receipt 才能解锁后续 stage 或进入可审查集成结果。
530
+
531
+ 缺失、重复、多余、错配、篡改、过期 baseline、blocked bundle、缺失中间 bundle 和绕过传递依赖均返回冻结的稳定 finding 并 blocked。A-74 至 A-76 与 A-01 至 A-73、B0、CLI、machine schema 和发布工件共 82/82 通过。package 与消费者 pin 为 `1.3.1`;四份 task/bundle schema 和所有 store 版本不变,仍为零第三方依赖、只读、无 Provider/Agent Runtime/Git/网络/任务执行。`frontend-project-context@1.3.1` 已公开发布,候选标签、registry 字节一致性与安装后 CLI 已独立核验。
532
+
533
+ ## 20. `1.4.0` AI Takeover & Health Closure 实现结果
534
+
535
+ [20-PHASE-A-AI-TAKEOVER-AND-HEALTH-CLOSURE-DESIGN.md](./20-PHASE-A-AI-TAKEOVER-AND-HEALTH-CLOSURE-DESIGN.md) 冻结的实现已完成:新增只读 `status`、Project Status schema 1、受管 AI Entry 区域、`publish-entry` / `remove-entry`、Projection Lock schema 1/2 reader 与首次 entry write 的延迟 schema-2 迁移。`checkProject`、`sync` work unit、Scope Compiler 与既有 lock-first/条件恢复原语均被直接复用,未建第二套 checker、scanner 或文件 patch 框架。
536
+
537
+ Exchange Protocol、capabilities、Action Plan 与 Review Bundle 升为 schema 2,新增 `publish-ai-entry` / `remove-ai-entry` 两类无权 action,同时保留 schema-1 Action Plan reader。包内新增 projection-lock 与 migration-manifest 公开 schema 及 `migration-manifest.json`。Contract/source/proposal、Assist Bundle 与 staged-context 合同不迁移。
538
+
539
+ A-77 至 A-90 新增 14 项顶层验收,连同既有 82 项回归共 96/96 通过。验收只使用隔离临时 fixture;未访问真实 Host/目标项目、Provider、网络或产品内 Git,未执行业务任务。npm 发布、Git 写入与真实 Host 验证仍需单独授权。
540
+
541
+ ## 21. `1.5.0` Evidence Feedback Protocol 实现结果
542
+
543
+ [21-PHASE-B-EVIDENCE-FEEDBACK-PROTOCOL-DESIGN.md](./21-PHASE-B-EVIDENCE-FEEDBACK-PROTOCOL-DESIGN.md) 的冻结合同已完成本地实现:新增只读 `evidence`、Evidence Input/Bundle schema 1、capabilities schema 3、Exchange Protocol 3 和 `automaticEvidenceUpload: false`。相同输入与状态产生逐字节相同 bundle;uninitialized、partial、invalid、attention、conflict、clean 都可零写入采样;观察结果与治理健康保持分离。
544
+
545
+ A-91 至 A-100 新增 10 项顶层验收,连同原 96 项回归共 106/106 通过。Contract、source/projection lock、proposal、Action Plan、Review Bundle、Project Status、Assist Bundle 与 staged-context schema 均未迁移。migration manifest 的本版本 writes 为空、rollback class 为 package-only,并保留从 1.3.1 直达时继承的 AI Entry/projection-lock 延迟迁移说明。未访问真实项目、Provider、网络、Git,未打包或发布。
546
+
547
+ ## 22. `1.6.0` Target Upgrade Protocol 实现结果
548
+
549
+ [22-PHASE-C-TARGET-UPGRADE-PROTOCOL-DESIGN.md](./22-PHASE-C-TARGET-UPGRADE-PROTOCOL-DESIGN.md) 的冻结合同已完成本地实现:新增永久只读 `upgrade-check`、`upgrade-plan` 与默认 preview/显式 `--write` 的 `upgrade-apply`;新增严格、自校验的 Migration Manifest schema 2、Upgrade Assessment/Migration Plan/Upgrade Result Bundle schema 1;capabilities 与 Exchange Protocol 升至 4,Action Plan/Review Bundle 仍为 2。
550
+
551
+ 每份 plan 绑定 manifest、assessment、三份 store snapshot 和一个具体受管目标的 before digest,只展示一个已编译工作单元。健康基线通过零写入 `verify-complete` 收敛;旧 renderer 只在所有权仍可信时复用现有 AI Entry/projection CAS、原子替换与条件恢复。A-101 至 A-114 新增 14 项顶层验收,连同原 106 项回归共 120/120 通过。实现没有包管理器、Git、网络、项目测试、业务代码写入、自动批准、自动升级/回滚或整体升级完成声称;未打包、发布或访问真实目标项目。
@@ -2,7 +2,7 @@
2
2
 
3
3
  > 权威说明:本文记录核心引擎验收;完整 v1 完成定义以 [00-PRODUCT-CONSTITUTION.md](./00-PRODUCT-CONSTITUTION.md) 第 7 节为准。
4
4
 
5
- > 状态:`A-01 through A-73 plus B0-01/B0-02, CLI, machine schemas, and release artifacts passed; 79 tests total. Public npm latest remains independently verified 1.2.0; 1.3.0 pack and release are not authorized.`
5
+ > 状态:`A-01 through A-114 plus B0-01/B0-02, CLI, machine schemas, and release artifacts passed locally; 120 tests total. Public npm latest remains independently verified at 1.3.1; 1.6.0 release is not authorized.`
6
6
 
7
7
  ## 1. 验收原则
8
8
 
@@ -322,7 +322,7 @@
322
322
 
323
323
  ### A-39 发布候选边界
324
324
 
325
- - package name 固定为 `frontend-project-context`,当前本地实现版本为 `1.3.0`,公共 npm 已核验 latest 仍为 `1.2.0`,bin 为 `project-context`,Node.js 下限为 18,第三方 runtime dependency 为零;
325
+ - package name 固定为 `frontend-project-context`,当前本地实现版本为 `1.3.0`,公共 npm 已核验 latest `1.3.0`,bin 为 `project-context`,Node.js 下限为 18,第三方 runtime dependency 为零;
326
326
  - package metadata 声明 Apache-2.0,发布包包含官方 LICENSE 和 `Copyright 2026 Fushan` NOTICE;
327
327
  - `files` 白名单包含 bin、src、docs、examples、四份公开 machine schema、变更/升级说明和许可证文件,但不包含测试、PROJECT_STATE、RTK、自托管 `.project-context/` 或本地生成物;
328
328
  - `prepack` 必须运行全量检查,bin 保持可执行;
@@ -394,4 +394,34 @@ A-39 是发布工件一致性验证,不扩展 Project Contract、CLI、schema
394
394
  - **A-72 baseline 与恢复**:Contract/source/projection snapshot、plan 或 receipt baseline 失效立即 blocked;刷新显式输入后可确定性恢复;
395
395
  - **A-73 生命周期、兼容与边界**:合并审查不执行 Git、测试或业务代码,不自动晋升决定或保存任务;A-01 至 A-63、B0、CLI 和发布工件全部继续通过。
396
396
 
397
- 实现 Gate 已满足:A-64 至 A-73 新增 10 项编号验收,连同全部旧回归为 `npm run check` 79/79。验收只使用隔离临时 fixture,没有访问真实业务项目、Provider、网络或产品内 Git,没有安装依赖、执行任务/测试、产生新 store、自动晋升决定或发布。测试通过不等于团队试用或发布授权。
397
+ 实现 Gate 已满足:A-64 至 A-73 新增 10 项编号验收,连同全部旧回归为 `npm run check` 79/79。实现验收只使用隔离临时 fixture,没有访问真实业务项目、Provider 或产品内 Git,没有执行任务/测试、产生新 store 或自动晋升决定。独立发布流程随后完成候选打包、公开 npm 发布、registry 安装与工件一致性复验;发布后发现 tarball 中 README/示例仍固定 `1.2.0`,运行时不受影响,仓库已修正为 `1.3.0`,补丁发布与团队试用均未授权。
398
+
399
+ ## 16. `1.3.1` Receipt Binding 与 Consumer Pins 合并修复验收(已发布并通过)
400
+
401
+ `1.3.0` 的 79 项现有测试仍全绿,但发布后审查证明,正式 `stage-context`/`integration-review` 路径未将 receipt `inputBundleDigest` 与对应 Stage Context Bundle 重建结果核对;伪造 digest 可以在无 finding 时解锁下一 stage。因此 A-69/A-72 的原测试不足以证明正式调用链满足冻结语义。
402
+
403
+ `1.3.1` 必须在同一版本中完成:
404
+
405
+ - **A-74**:正式 CLI 通过 receipt + receipt bundle 成对输入核对 `inputBundleDigest`;缺失、错配或错误 digest 均 blocked;
406
+ - **A-75**:篡改 bundle 字段、自身 digest、identity、stage、plan/snapshot baseline、bundle status 或多级依赖链均失败封闭,完整成对链可确定性恢复;
407
+ - **A-76**:`--receipt-bundle` 保持只读且不创建 task store,四份 schema/store 版本不变,package/README/example/release test 统一到 `1.3.1`,不弱化 A-01 至 A-73。
408
+
409
+ 完整 Gate 已满足:A-01 至 A-76、B0-01/B0-02、CLI 与发布工件共 `82/82`。正式 CLI 路径已覆盖 receipt/bundle 精确配对、严格工件验证、自身 digest、确定性重建、篡改与过期 baseline,以及完整/不完整多级依赖链;只读与 schema/store 兼容性继续成立。详细协议以 [18-BRANCH-AWARE-STAGED-CONTEXT-DESIGN.md](./18-BRANCH-AWARE-STAGED-CONTEXT-DESIGN.md) 第 18 节为准。随后经独立发布授权完成 `v1.3.1`、公共 npm 发布、registry 字节一致性与安装冒烟验证;发布授权已消耗。
410
+
411
+ ## 17. `1.4.0` AI Takeover & Health Closure 验收(已本地实现并通过)
412
+
413
+ `docs/20` 冻结的 A-77 至 A-90 已全部落为独立顶层测试,覆盖 uninitialized/partial/invalid/initialized 状态、AI Entry preview/create/update/remove、区域外字节保留、marker/digest 所有权、同路径 source drift、Projection Lock 1/2 延迟迁移、CAS/条件恢复、Exchange 2、manifest、setup 收口与不继承对话的 Host fixture。
414
+
415
+ 完整 `npm run check` 结果为 96/96:新增 14 项,既有 82 项无删减、跳过或弱化。生产源码仍为零第三方依赖,无 Provider、Agent Runtime、Git、网络、dependency install、telemetry、self-update、业务代码写入、测试执行、scheduler 或 daemon。`status.health: clean` 只证明 Project Context 治理层健康。
416
+
417
+ ## 18. `1.5.0` Evidence Feedback Protocol 验收(已本地实现并通过)
418
+
419
+ `docs/21` 冻结的 A-91 至 A-100 已全部落为独立顶层测试:严格输入与隐私载体拒绝、确定性 bundle/digest、六种 Project Context 状态零写入采样、项目身份与正文结构排除、32/48 KiB 规范 UTF-8 预算、只记录不执行的 reproduction、永久人工转交、Exchange/capabilities 3、package-only migration manifest 和永久边界回归。
420
+
421
+ 完整 `npm run check` 结果为 106/106:新增 10 项,既有 96 项无删除、跳过或弱化。输出永远是 `human-review-required`,没有 upload、destination、write、Provider、Agent Runtime、Git、网络、dependency install、telemetry、业务代码写入、测试执行、scheduler 或 daemon。验收只使用隔离临时 fixture;真实项目、打包与发布未授权也未执行。
422
+
423
+ ## 19. `1.6.0` Target Upgrade Protocol 验收(已本地实现并通过)
424
+
425
+ `docs/22` 冻结的 A-101 至 A-114 已全部落为独立顶层测试:Manifest schema 2 严格性与运行时 registry 绑定、三个精确历史基线、初始化/健康阻断、Assessment 确定性、单步 Plan、preview/显式写、assessment/plan/target CAS、所有权与 renderer、注入失败/条件恢复、短期协议兼容分类、三类 rollback 语义、context 隔离、capabilities/exchange 4 及端到端 Host 边界。
426
+
427
+ 完整 `npm run check` 结果为 120/120:新增 14 项,既有 106 项无删除、跳过或弱化。验证只使用隔离临时 fixture;生产源码仍无第三方依赖、Provider、Agent Runtime、包管理器、Git、网络、项目测试执行、业务代码写入、自动批准、自动升级、自动回滚或发布行为。`coreMigration: complete` 仍固定要求 Host 完成 dependency/lockfile、项目测试或 CI 与独立新窗口验收。
@@ -2,7 +2,7 @@
2
2
 
3
3
  > 权威说明:本文是支持性设计文档;当前唯一规范真源是 [00-PRODUCT-CONSTITUTION.md](./00-PRODUCT-CONSTITUTION.md)。
4
4
 
5
- 状态:`frontend-project-context@1.2.0` 已发布到官方公共 npm;69 项验收、候选包完整性和 registry 安装均已独立验证
5
+ 状态:`frontend-project-context@1.6.0` 已本地实现并通过 120/120;官方公共 npm 仍为已核验的 `1.3.1`,`1.6.0` 发布未授权
6
6
  适用项目:`dtg-frontend-delivery-agent`
7
7
  本文记录产品如何交付、安装、共享、升级和验证;它不自行授权打包、registry、Git 或发布操作。
8
8
 
@@ -43,12 +43,12 @@ CI 安装项目锁定的依赖版本并执行只读检查。CI 不依赖机器
43
43
  面向 Node.js 前端项目,推荐支持包管理器的一次性运行方式,例如:
44
44
 
45
45
  ```bash
46
- npx frontend-project-context@1.2.0 setup --project . --id PROJECT_ID --name "Project Name" --json
47
- pnpm dlx frontend-project-context@1.2.0 setup --project . --id PROJECT_ID --name "Project Name" --json
48
- bunx frontend-project-context@1.2.0 setup --project . --id PROJECT_ID --name "Project Name" --json
46
+ npx frontend-project-context@1.3.1 setup --project . --id PROJECT_ID --name "Project Name" --json
47
+ pnpm dlx frontend-project-context@1.3.1 setup --project . --id PROJECT_ID --name "Project Name" --json
48
+ bunx frontend-project-context@1.3.1 setup --project . --id PROJECT_ID --name "Project Name" --json
49
49
  ```
50
50
 
51
- 以上 `1.2.0` 一次性命令现已可从官方公共 npm 使用,`latest` 已独立核验为 `1.2.0`。包名冻结为 `frontend-project-context`,可执行文件名为 `project-context`,CLI 合同以 [04-PROGRAM-DESIGN.md](./04-PROGRAM-DESIGN.md) 为准。
51
+ 以上 `1.3.1` 一次性命令现已可从官方公共 npm 使用,`latest` 已独立核验为 `1.3.1`。包名冻结为 `frontend-project-context`,可执行文件名为 `project-context`,CLI 合同以 [04-PROGRAM-DESIGN.md](./04-PROGRAM-DESIGN.md) 为准。
52
52
 
53
53
  `setup` 初始化入口只负责:
54
54
 
@@ -65,7 +65,7 @@ bunx frontend-project-context@1.2.0 setup --project . --id PROJECT_ID --name "Pr
65
65
  初始化后,DTG 应作为项目开发依赖被锁定,例如:
66
66
 
67
67
  ```bash
68
- pnpm add -D frontend-project-context@1.2.0
68
+ pnpm add -D frontend-project-context@1.3.1
69
69
  ```
70
70
 
71
71
  选择项目内安装而不是全局安装,原因是:
@@ -211,3 +211,33 @@ IDE 插件可以在未来提供状态提示、冲突解释和可视化配置,
211
211
  本地 A-01 至 A-63、B0-01/B0-02、CLI、schema 与发布工件共 69/69 项通过。Contract reader 1/2、proposal/source/projection lock schema 1、renderer 3 与 Dashboard View Model 3 保持兼容,`1.1.0 → 1.2.0` 无 store migration。
212
212
 
213
213
  用户于 2026-09-09 明确进入 `1.2.0` 发布流程。发布候选 prepack 69/69 通过,包含 54 个文件、解包大小 570621 bytes;本地 tarball 与官方 registry 返回的 tarball 逐字节一致,SHA-1 均为 `f70774673df16e2d4d1ceed84df663b5bf76260e`。`fushanyx1` 于 `2026-09-09T09:34:06.552Z` 完成 public 发布,`latest` 指向 `1.2.0`;从 registry 安装后的 help、capabilities、init 与 clean check 冒烟均通过。`v1.2.0` 指向冻结候选提交 `c991187c4dfd094d9cff5a4e15516fb25d74d803`。本次发布授权已经消耗,后续发布或扩大产品边界仍需新的明确授权。
214
+
215
+ ## 12. `1.3.0` Branch-aware Staged Context 正式发布状态
216
+
217
+ `1.3.0` 新增可选 Task Context Plan、Stage Receipt、只读 `stage-context`、只读 `integration-review` 与四份公开 schema,不改变 Project Contract、既有 store 或永久权限边界。发布候选 prepack 79/79 通过,包含 62 个文件、解包大小 653373 bytes;本地候选与官方 registry tarball 逐字节一致,SHA-1 均为 `b33d3c3616b556096e85168b8da79cc7abfccd21`。`fushanyx1` 于 `2026-09-10T04:41:48.107Z` 完成 public 发布,`latest` 指向 `1.3.0`;从 registry 安装后的 help、capabilities、init 与 clean check 冒烟均通过。`v1.3.0` 指向冻结候选提交 `5591d70eb0ccca1daa9cdb3a5eaa9cbcbd50d560`。
218
+
219
+ 发布后复核确认,不可覆盖的 `1.3.0` tarball 中 README 安装命令和 `examples/package.json` 仍固定 `1.2.0`。这不影响包版本、运行时命令或 schema,但属于消费端发布质量缺陷;仓库已修正为 `1.3.0`。
220
+
221
+ 正式调用链审查还确认 `1.3.0` 对 receipt `inputBundleDigest` 的校验没有接入 `stage-context` 与 `integration-review`,错误 digest 可错误地解锁依赖 stage。该协议正确性缺陷与 consumer pins 缺陷已在 `1.3.1` 中完成合并修复并公开发布。
222
+
223
+ ## 13. `1.3.1` Receipt Binding 与 Consumer Pins 修复正式发布状态
224
+
225
+ `1.3.1` 候选来自提交 `59561df74b827e14a233b8ac63a7155ba4a34b6b`,prepack 82/82 通过,包含 62 个文件、压缩大小 193586 bytes、解包大小 691194 bytes;SHA-1 为 `2e5e2ff79e21cb2ba784a47f4d48def650128b22`,integrity 为 `sha512-h5lGzOoaZbv3Cq4uqmWnX3NfWbMKwBtslQEfrSUFYcXD+Nf0TAhMSwi1WRoIgXGsnqOT9Ps2IpVqcG/umv3QGg==`。`fushanyx1` 于 `2026-09-10T08:43:47.783Z` 完成 public 发布,`latest` 指向 `1.3.1`;从 registry 重新下载的 tarball 与候选逐字节一致,安装后的版本、help 与 capabilities 冒烟通过。`v1.3.1` 精确指向冻结候选提交。
226
+
227
+ ## 14. `1.4.0` 本地实现与延迟迁移状态
228
+
229
+ `1.4.0` 已完成只读 status、区域型 AI Entry、Projection Lock schema 1/2、Exchange Protocol 2 和最小 migration manifest 的本地实现。旧项目安装新包后不会立即改写 store;只有首次成功 `publish-entry --write` 才将 projection lock 延迟转为 schema 2。精确可读/可写版本、consumer change、验收命令和回退约束由包根 `migration-manifest.json` 固定。
230
+
231
+ 实现 Gate 为 96/96 本地隔离测试通过。这不等于 npm 发布、公开 registry 验证或真实 Host/目标项目验证;这些外部操作需新的独立授权。
232
+
233
+ ## 15. `1.5.0` 本地 Evidence Feedback Protocol 状态
234
+
235
+ `1.5.0` 新增只读 `evidence` 与 Evidence Input/Bundle schema 1,并把 Exchange Protocol/capabilities 升至 3。Evidence Bundle 只输出 stdout、永不上传且始终需要人工复核;本版本不修改 store 或 renderer。`migration-manifest.json` 同时声明从公开基线 `1.3.1` 和本地能力基线 `1.4.0` 升级,本版本 `writes` 为空、rollback class 为 `package-only`,并保留从 `1.3.1` 直达时继承的 AI Entry/projection-lock 延迟迁移说明。
236
+
237
+ 实现 Gate 为 106/106 本地隔离测试通过。没有执行候选打包、真实 Host/目标项目验证、Git、网络或 npm 发布;这些仍需要新的独立授权。
238
+
239
+ ## 16. `1.6.0` 本地 Target Upgrade Protocol 状态
240
+
241
+ `1.6.0` 新增只读 `upgrade-check`、`upgrade-plan` 与默认 preview 的 `upgrade-apply`,公开 Migration Manifest schema 2 和三份升级工件 schema 1。依赖/lockfile 切换仍由 Host 在外部完成;工具只评估当前 Project Context store、受管 AI Entry/projection 与 manifest 声明的协议兼容面,并在精确 `--write` 下执行一份 plan 展示的一个已编译、产品自有单元。
242
+
243
+ 实现 Gate 为 120/120 本地隔离测试通过。capabilities/Exchange Protocol 为 4,Action Plan/Review Bundle 仍为 2,现有 store/renderer 目标版本不变。`coreMigration: complete` 不等于依赖、CI、新窗口或发布完成。没有执行候选打包、真实 Host/目标项目升级、Git、网络、包管理器或 npm 发布;这些仍需要新的独立授权。