frontend-project-context 1.7.0 → 1.8.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 (33) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +16 -9
  3. package/UPGRADING.md +8 -0
  4. package/docs/08-INSTALLATION-AND-DISTRIBUTION.md +23 -6
  5. package/docs/24-A130-REAL-HOST-TARGET-PROJECT-COMPARISON.md +1 -1
  6. package/docs/26-A130-QUALITY-CLOSURE-AND-ADAPTIVE-DELIVERY-REPAIR-DESIGN.md +1 -1
  7. package/docs/27-TEAM-SHARED-CONTEXT-DIRECTION-DISCUSSION.md +30 -0
  8. package/docs/28-REAL-PROJECT-ONBOARDING-CLOSURE-DESIGN.md +534 -0
  9. package/docs/AI-PROJECT-INITIALIZATION.md +89 -0
  10. package/docs/README.md +12 -0
  11. package/docs/USER-AND-AI-OPERATION-MANUAL.md +17 -13
  12. package/examples/README.md +2 -2
  13. package/examples/package.json +1 -1
  14. package/migration-manifest.json +19 -7
  15. package/package.json +2 -2
  16. package/schemas/capabilities.schema.json +23 -8
  17. package/schemas/evidence-bundle.schema.json +1 -1
  18. package/schemas/initialization-instruction.schema.json +60 -0
  19. package/schemas/migration-manifest.schema.json +3 -3
  20. package/schemas/migration-plan.schema.json +2 -2
  21. package/schemas/project-status.schema.json +5 -4
  22. package/schemas/upgrade-assessment.schema.json +2 -2
  23. package/schemas/upgrade-result-bundle.schema.json +1 -1
  24. package/src/project-context/ai-entry.mjs +8 -6
  25. package/src/project-context/capabilities.mjs +14 -0
  26. package/src/project-context/cli.mjs +15 -0
  27. package/src/project-context/contract-schema.mjs +1 -1
  28. package/src/project-context/exchange-schema.mjs +4 -4
  29. package/src/project-context/initialization-instruction.mjs +42 -0
  30. package/src/project-context/migration-manifest.mjs +3 -3
  31. package/src/project-context/project-status.mjs +14 -3
  32. package/src/project-context/project-store.mjs +27 -2
  33. package/src/project-context/upgrade-schema.mjs +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.8.0 - Unreleased
4
+
5
+ - Add the package-owned `docs/AI-PROJECT-INITIALIZATION.md` as the only normative Host initialization procedure and expose it through read-only `instructions --json|--prompt` plus capabilities discovery.
6
+ - Resolve and freeze `targetRoot`, forbid parent-project truth discovery and outside symlink evidence, and keep Provider, Agent Runtime, Git, network, package mutation, business-code writes, automatic approval, and publication outside the runtime.
7
+ - Upgrade capabilities / Exchange Protocol to 8, add initialization-instruction schema 1, and upgrade project-status to schema 2 with independent `contractReadiness` and `compile-task-context` routing.
8
+ - Upgrade AI Entry to renderer 4 so clean status still requires task/path context, actual item IDs/scopes/read targets, and fail-closed onboarding/context gaps before source development.
9
+ - Reuse create-only proposals, atomic multi-item `approveProposal`, managed-region CAS, final entry digest binding, and the existing scope compiler; add no new persistent store, universal apply command, or business-file writer.
10
+ - Add O-01 through O-12 deterministic local acceptance. Real-project memoryless Host acceptance and publication remain separate blocking gates.
11
+
3
12
  ## 1.7.0 - Unreleased
4
13
 
5
14
  - Generate human-readable AI Entry and discovery statements in Chinese while preserving English machine IDs, subjects, commands, markers, JSON fields, and enums; AI Entry renderer 3 also fixes the cross-platform offline project-local CLI invocation, while existing renderer 1/2 regions require an explicit owned republish instead of being silently rewritten.
package/README.md CHANGED
@@ -32,21 +32,24 @@ 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.7.0
35
+ npm install --save-dev frontend-project-context@1.8.0
36
36
  ```
37
37
 
38
38
  The package has zero runtime dependencies.
39
39
 
40
- `1.7.0` is the package release candidate in this source tree. It includes the cumulative `1.4.0` status/takeover, `1.5.0` evidence, `1.6.0` target-upgrade, Adaptive Bounded Task Context, truth-resolution repair, and Chinese human-readable project semantics. The candidate has passed all 194 local regressions; public release still requires the separately governed Host/Provider and release gates.
40
+ `1.8.0` is the Real Project Onboarding Closure release. It adds one package-owned Host initialization instruction, capabilities schema / Exchange Protocol 8, project-status schema 2 with independent Contract readiness, and AI Entry renderer 4. Local O-01 through O-12, the complete regression suite, and an isolated real-project memoryless Host acceptance form its release gate.
41
41
 
42
42
  ### Quick start
43
43
 
44
- Every host can begin with one read-only status command, including before initialization:
44
+ Every initializing Host begins by loading the package's single normative instruction and resolved target root:
45
45
 
46
46
  ```bash
47
+ npm exec --offline -- project-context instructions --project . --prompt
47
48
  npm exec --offline -- project-context status --project . --json
48
49
  ```
49
50
 
51
+ The only initialization procedure is [AI Project Initialization](./docs/AI-PROJECT-INITIALIZATION.md). The examples below document individual governance primitives; they are not a second initialization workflow and must not be composed in place of that instruction.
52
+
50
53
  All `npm exec --offline -- project-context` commands below require the exact development dependency installed above. `--offline` makes a missing local binary fail closed instead of downloading the unrelated `project-context` package from a configured registry.
51
54
 
52
55
  `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:
@@ -55,7 +58,7 @@ All `npm exec --offline -- project-context` commands below require the exact dev
55
58
  npm exec --offline -- project-context publish-entry --project . --output AGENTS.md --write --json
56
59
  ```
57
60
 
58
- The `1.7.0` AI Entry renderer 3 writes human-readable project guidance in Chinese and invokes only the offline project-local CLI while keeping commands, markers, IDs, JSON fields, and enums stable in English. Existing renderer-1/2 entries remain readable but become stale and require an explicit owned republish; no entry is rewritten automatically.
61
+ The `1.8.0` AI Entry renderer 4 requires every clean-state real task to compile task/path context and consume actual Contract item IDs, scopes, and read targets before source development. Existing renderer-1/2/3 entries remain readable but become stale and require an explicit owned republish; no entry is rewritten automatically.
59
62
 
60
63
  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.
61
64
 
@@ -324,21 +327,24 @@ AI 编程工具通常只读取仓库的一部分,而项目约定分散在文
324
327
  建议固定为开发依赖,让本地与 CI 使用同一版本:
325
328
 
326
329
  ```bash
327
- npm install --save-dev frontend-project-context@1.7.0
330
+ npm install --save-dev frontend-project-context@1.8.0
328
331
  ```
329
332
 
330
333
  本包没有运行时第三方依赖。
331
334
 
332
- `1.7.0` 是当前源码树描述的版本,累计包含 `1.4.0` 状态/接管、`1.5.0` 证据、`1.6.0` 目标升级、自适应有界任务上下文、真源裁定修复和中文人类可读项目语义。候选已通过本地 194 项回归;公开发布仍必须通过单独治理的 Host/Provider 与发布门槛。
335
+ `1.8.0` Real Project Onboarding Closure 正式版本:新增包内唯一 Host 初始化指令、capabilities schema / Exchange Protocol 8、带独立 Contract readiness 的 project-status schema 2,以及 AI Entry renderer 4。本地 O-01 至 O-12、完整回归与隔离真实项目的无历史 Host 接管共同构成发布门。
333
336
 
334
337
  ### 快速开始
335
338
 
336
- 任何宿主都可以先运行同一条只读状态命令,包括尚未初始化的项目:
339
+ 执行初始化的 Host 必须先读取包内唯一规范和 resolved targetRoot:
337
340
 
338
341
  ```bash
342
+ npm exec --offline -- project-context instructions --project . --prompt
339
343
  npm exec --offline -- project-context status --project . --json
340
344
  ```
341
345
 
346
+ 唯一初始化流程见 [AI Project Initialization](./docs/AI-PROJECT-INITIALIZATION.md)。下文命令只解释各治理原语,不构成另一套初始化步骤,也不能替代该指令由 Host 自行拼装流程。
347
+
342
348
  以下所有 `npm exec --offline -- project-context` 命令都要求先安装上面的精确开发依赖。`--offline` 会在本地 CLI 缺失时失败封闭,避免从配置的 registry 下载无关的同名 `project-context` 包。
343
349
 
344
350
  `status` 在不读取业务源码正文、不写项目文件的前提下分类 uninitialized、partial、invalid、attention、clean 和所有权冲突。初始化后,可把固定启动路由发布到根 `AGENTS.md` 的受管区域,同时完整保留区域外人工内容:
@@ -347,7 +353,7 @@ npm exec --offline -- project-context status --project . --json
347
353
  npm exec --offline -- project-context publish-entry --project . --output AGENTS.md --write --json
348
354
  ```
349
355
 
350
- `1.7.0` 的 AI Entry renderer 3 默认用中文生成人类可读的项目规则,并只调用离线的项目本地 CLI;命令、markerID、JSON 字段和枚举继续保持稳定英文。既有 renderer 1/2 入口仍可读取,但会标记 stale,只有显式受管 republish 才会升级,不会自动重写。
356
+ `1.8.0` 的 AI Entry renderer 4 要求 clean 状态下的真实任务先编译 task/path context,消费实际命中的 Contract item IDsscope read targets,之后才能进入源码。既有 renderer 1/2/3 入口仍可读取但会标记 stale,只有显式受管 republish 才会升级,不会自动重写。
351
357
 
352
358
  使用相同 output 的 `remove-entry` 只移除可信受管区域。计划与 preview 都不含 `--write`,仍需人对精确路径授权。
353
359
 
@@ -500,7 +506,7 @@ npm exec --offline -- project-context upgrade-apply --project . --plan .project-
500
506
 
501
507
  `upgrade-check` 与 `upgrade-plan` 永久只读;`upgrade-apply` 默认 preview,只有显式 `--write` 才能执行该 plan 展示的一个已编译、产品自有单元。每个单元后必须重新 check/plan。即使 `coreMigration: complete`,Host 仍需核对依赖与 lockfile、运行项目测试或 CI,并用独立新窗口复核。产品不会执行包管理器、Git、网络、项目测试、业务写入、自动批准、回滚或发布。
502
508
 
503
- npm 包包含二十份机器 schema,包括 capabilities 7、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、Context Query/Adaptive Context Bundle/Routing Index 2 与 Coverage Audit 1。
509
+ npm 包包含版本化机器 schema,包括 capabilities 8initialization instruction 1、project status 2、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、Context Query/Adaptive Context Bundle/Routing Index 2 与 Coverage Audit 1。
504
510
 
505
511
  生成只读治理看板:
506
512
 
@@ -545,6 +551,7 @@ npm exec --offline -- project-context dashboard --project . > project-context-da
545
551
 
546
552
  | 命令 | 用途 |
547
553
  | --- | --- |
554
+ | `instructions` | 读取包内唯一初始化指令并固定 resolved targetRoot |
548
555
  | `setup` | 聚合安全初始化、保守 discovery 和 Assist Bundle |
549
556
  | `capabilities` | 查询协议版本、schema、action kind、初始化状态和永久边界 |
550
557
  | `evidence` | 从项目内输入生成确定性、只读且需人工复核的 Evidence Bundle |
package/UPGRADING.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # 升级说明
2
2
 
3
+ ## `1.7.0 → 1.8.0`
4
+
5
+ `1.8.0` 新增只读 `instructions` 和唯一包内规范 `docs/AI-PROJECT-INITIALIZATION.md`;capabilities / Exchange Protocol 升至 8,新增 initialization-instruction schema 1;project-status 升至 schema 2,以 `contractReadiness` 独立区分 `not-initialized`、`contract-incomplete` 与 `contract-ready`;AI Entry 升至 renderer 4,clean 状态也必须先运行 task/path context 并消费实际 Contract。
6
+
7
+ Contract、source lock、proposal、projection lock 和普通 projection renderer 均不迁移。既有 AI Entry renderer 1/2/3 保持可读但会报告 stale;`upgrade-check --from-version 1.7.0` 可生成受当前 baseline 绑定的 `republish-ai-entry` 单元。初始化方法只以包内唯一指令为准;README、操作手册和 CLI help 只提供链接或发现入口。
8
+
9
+ 本地 O-01 至 O-12 和完整回归是实现门。升级或初始化后的真实无历史 Host 接管、目标项目访问、Provider、Git、网络与发布均不在本轮权限内。
10
+
3
11
  ## `1.6.0 → 1.7.0`(本地实现,未发布)
4
12
 
5
13
  `1.7.0` 新增只读 `context-query`、`coverage-audit`、`reconcile-truth`,以及默认 preview、只有显式 `--write` 才持久化可删除派生索引的 `index-context`。Context Query、Adaptive Context Bundle、Routing Index、Truth Reconciliation Input 与 Truth Reconciliation Review Bundle 当前写 schema 2,Coverage Audit 与 Host Promotion Evidence 保持 schema 1,capabilities / Exchange Protocol 升至 7;Contract、source lock、proposal、持久 renderer、Action Plan 与 Review Bundle 均不迁移。AI Entry 的人类可读文案改为中文,并固定 `npm exec --offline -- project-context` 的项目本地安全入口,renderer 从 1/2 升至 3;Projection Lock schema 仍为 2。
@@ -2,7 +2,7 @@
2
2
 
3
3
  > 权威说明:本文是支持性设计文档;当前唯一规范真源是 [00-PRODUCT-CONSTITUTION.md](./00-PRODUCT-CONSTITUTION.md)。
4
4
 
5
- 状态:`frontend-project-context@1.7.0` 发布前实现、195/195、真实 PC 初始化与 A-130 有界 Host/Provider 终验均已通过;发布已授权并正在执行,公开 registry 当前已核验基线仍为 `1.6.0`
5
+ 状态:`frontend-project-context@1.7.0` 已发布到 public npm,registry 工件逐字节匹配并完成全新项目回装初始化;195/195、真实 PC 初始化与 A-130 有界 Host/Provider 终验均通过
6
6
  适用项目:`dtg-frontend-delivery-agent`
7
7
  本文记录产品如何交付、安装、共享、升级和验证;它不自行授权打包、registry、Git 或发布操作。
8
8
 
@@ -43,10 +43,10 @@ CI 安装项目锁定的依赖版本并执行只读检查。CI 不依赖机器
43
43
  持久初始化前,先把精确版本安装为项目开发依赖:
44
44
 
45
45
  ```bash
46
- npm install --save-dev frontend-project-context@1.7.0
46
+ npm install --save-dev frontend-project-context@1.8.0
47
47
  ```
48
48
 
49
- 包名冻结为 `frontend-project-context`,可执行文件名为 `project-context`。安装必须先于持久 `setup`,使 discovery 登记的 `package.json` digest 已包含正式依赖,避免初始化完成后仅因补装工具而立即产生 `source-changed`。`1.7.0` 公开发布前,外部项目继续使用已发布且已独立核验的 `1.6.0`;候选源码中的 `1.7.0` 命令用于冻结将要进入该版本 tarball 的消费合同。
49
+ 包名冻结为 `frontend-project-context`,可执行文件名为 `project-context`。安装必须先于任何持久初始化写入,使 discovery 登记的 `package.json` digest 已包含正式依赖,避免补装工具后立即产生 `source-changed`。`1.8.0` 已通过本地 O-01 O-12、完整回归与隔离真实项目的无历史 Host 发布阻断验收。
50
50
 
51
51
  选择项目内安装而不是全局安装,原因是:
52
52
 
@@ -58,16 +58,18 @@ npm install --save-dev frontend-project-context@1.7.0
58
58
 
59
59
  ### 3.2 首次初始化:只运行已安装的本地 CLI
60
60
 
61
- 先确认本地包存在,再从本地依赖离线执行只读状态和 setup preview:
61
+ 先确认本地包存在,再从本地依赖读取唯一初始化指令:
62
62
 
63
63
  ```bash
64
+ npm exec --offline -- project-context instructions --project . --prompt
64
65
  npm exec --offline -- project-context status --project . --json
65
- npm exec --offline -- project-context setup --project . --id PROJECT_ID --name "Project Name" --json
66
66
  ```
67
67
 
68
+ 唯一流程正文是 [AI-PROJECT-INITIALIZATION.md](./AI-PROJECT-INITIALIZATION.md)。本文件只说明安装与分发,不复制另一套 Host 初始化步骤。
69
+
68
70
  `--offline` 使本地 CLI 缺失时失败封闭,不允许 npm 临时下载无关的同名 `project-context` 包。确需一次性运行器时,只允许用精确包名和版本做零写 preview;任何 `setup --write` 前仍必须先完成项目内固定安装。
69
71
 
70
- `setup` 初始化入口只负责:
72
+ 作为底层原语,`setup` 只负责:
71
73
 
72
74
  - 在内存中构造与 `init` 相同的空 store 并复用保守 discovery;
73
75
  - 输出包含候选、`readTargets` 和 `workUnits` 的 Assist Bundle;
@@ -264,3 +266,18 @@ IDE 插件可以在未来提供状态提示、冲突解释和可视化配置,
264
266
  7. 针对 `src/components/flight/non-whitelist-confirm.vue` 与 `src/components/center/protocolPriceDialog.vue` 的真实行李展示任务,`context --locale zh-CN` 成功产生中文 Project Context Bundle。
265
267
 
266
268
  原始 PC 仓库全程保持干净,没有写入业务代码、`AGENTS.md`、`package.json`、lockfile 或 `.project-context`。本次结果证明 `1.7.0` 候选包能在真实 PC 项目结构中完成初始化并进入正常任务路径。后续 A-130 有界 Host/Provider 终验已通过,见 `docs/24` 第 11 节;A-144 不属于本次发布范围。
269
+
270
+ ## 18. `1.7.0` public npm 发布与 registry 回装
271
+
272
+ `2026-09-14`,release commit `d5b6389` 与 tag `v1.7.0` 已推送,精确冻结的 99 文件 tarball 发布为 public npm 的 `frontend-project-context@1.7.0`。registry 的 `latest`、SHA-1 与 SHA-512 integrity 均指向该版本;重新下载后的 SHA-256 为 `42d83423d61831b4bf0d4b1bc39e29731e18acf181827abe699c60fb512fb4af`,与冻结候选逐字节一致。
273
+
274
+ 独立回装在全新临时项目中从 registry 安装精确 `1.7.0`,然后只使用安装后的 `npm exec --offline -- project-context`:
275
+
276
+ 1. capabilities 报告包版本 `1.7.0`、schema 7 与 Exchange Protocol 7;
277
+ 2. status 正确识别为 `uninitialized`,setup preview 零写入;
278
+ 3. setup write 后由人显式批准四项直接发现的客观事实;
279
+ 4. publish-entry 仅追加 renderer 3 受管区域;
280
+ 5. 对登记的 `AGENTS.md` 执行一次精确 source acceptance 与重审批;
281
+ 6. check 无 findings,status 为 `clean/ready-for-task`,正常中文任务 context 成功生成。
282
+
283
+ 发布工件、Git 与回装证据全部闭合,本次 release 权限已经消费。
@@ -1,6 +1,6 @@
1
1
  # 24 — A-130 真实 Host / 目标项目对照证据
2
2
 
3
- > 状态:`bounded-revalidation-passed; A-130-closed; 1.7.0-release-authorized`
3
+ > 状态:`bounded-revalidation-passed; A-130-closed; 1.7.0-published-and-registry-verified`
4
4
  >
5
5
  > 日期:`2026-09-12`
6
6
  >
@@ -2,7 +2,7 @@
2
2
 
3
3
  > 权威说明:本文冻结 A-130 两次真实 Host/Provider 失败后的下一轮设计、缺陷分类、实现边界与可证伪验收。产品身份和永久边界仍以 [00-PRODUCT-CONSTITUTION.md](./00-PRODUCT-CONSTITUTION.md) 为准;历史运行事实仍以 [24-A130-REAL-HOST-TARGET-PROJECT-COMPARISON.md](./24-A130-REAL-HOST-TARGET-PROJECT-COMPARISON.md) 为准。
4
4
  >
5
- > 状态:`design-implemented; local-195-of-195; bounded-provider-revalidation-passed; A-130-closed`
5
+ > 状态:`design-implemented; local-195-of-195; bounded-provider-revalidation-passed; A-130-closed; 1.7.0-published`
6
6
  >
7
7
  > 日期:`2026-09-12`
8
8
  >
@@ -0,0 +1,30 @@
1
+ # 27 — 未来方向讨论记录
2
+
3
+ > 日期:`2026-09-14`
4
+ >
5
+ > 状态:`discussion-only`
6
+ >
7
+ > 边界:本文只记录讨论已开启,不是设计、路线、实现计划或执行授权。
8
+
9
+ ## 讨论缘起
10
+
11
+ 基于《Stateful Agent 基础设施:Persistent KV 与增量上下文》,团队开始讨论 Stateful Agent、Persistent KV、增量上下文与当前自研项目可能的未来关系。
12
+
13
+ 原始材料:`/Users/fushan/fushanyx/知识库/AI/Stateful Agent基础设施-Persistent KV与增量上下文.md`
14
+
15
+ ## 当前讨论共识
16
+
17
+ Frontend Project Context 的核心意义是:
18
+
19
+ > 让团队共同拥有同一份项目上下文。
20
+
21
+ 项目事实、规则、来源和人工决定应属于项目与团队,不依附于某个人、某次对话或某一款 AI 工具。
22
+
23
+ Persistent KV 与增量上下文作为可继续讨论的远期方向,目前不进入产品设计或实现。
24
+
25
+ ## 当前阶段
26
+
27
+ - 产品开发先收口在 `1.7.0`。
28
+ - 当前主要关注真实项目应用和团队日常实用性。
29
+ - 后续方向保持开放讨论,需要时再单独重开。
30
+ - 本记录不改变产品宪法、`Project Contract` 或当前授权。