frontend-project-context 1.6.0 → 1.7.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.
- package/CHANGELOG.md +22 -0
- package/README.md +92 -46
- package/UPGRADING.md +22 -1
- package/docs/05-ACCEPTANCE-CONTRACT.md +20 -1
- package/docs/08-INSTALLATION-AND-DISTRIBUTION.md +44 -21
- package/docs/14-FORMAL-RELEASE-READINESS.md +9 -5
- package/docs/19-POST-1.3.1-AI-TAKEOVER-EVIDENCE-AND-UPGRADE-PLAN.md +5 -5
- package/docs/20-PHASE-A-AI-TAKEOVER-AND-HEALTH-CLOSURE-DESIGN.md +11 -11
- package/docs/22-PHASE-C-TARGET-UPGRADE-PROTOCOL-DESIGN.md +4 -4
- package/docs/23-ADAPTIVE-BOUNDED-TASK-CONTEXT-DESIGN.md +432 -0
- package/docs/24-A130-REAL-HOST-TARGET-PROJECT-COMPARISON.md +210 -0
- package/docs/25-REAL-PROJECT-SOURCE-OF-TRUTH-MAINTENANCE-DESIGN.md +409 -0
- package/docs/26-A130-QUALITY-CLOSURE-AND-ADAPTIVE-DELIVERY-REPAIR-DESIGN.md +609 -0
- package/docs/README.md +22 -6
- package/docs/USER-AND-AI-OPERATION-MANUAL.md +73 -30
- package/examples/README.md +4 -4
- package/examples/package.json +1 -1
- package/migration-manifest.json +30 -8
- package/package.json +2 -2
- package/schemas/adaptive-context-bundle.schema.json +70 -0
- package/schemas/capabilities.schema.json +20 -6
- package/schemas/context-query.schema.json +69 -0
- package/schemas/coverage-audit.schema.json +32 -0
- package/schemas/evidence-bundle.schema.json +2 -2
- package/schemas/host-promotion-evidence.schema.json +33 -0
- package/schemas/migration-manifest.schema.json +3 -3
- package/schemas/migration-plan.schema.json +2 -2
- package/schemas/projection-lock.schema.json +1 -1
- package/schemas/routing-index.schema.json +58 -0
- package/schemas/truth-reconciliation-input.schema.json +60 -0
- package/schemas/truth-reconciliation-review-bundle.schema.json +155 -0
- package/schemas/upgrade-assessment.schema.json +2 -2
- package/schemas/upgrade-result-bundle.schema.json +1 -1
- package/src/project-context/a130-evaluation.mjs +91 -0
- package/src/project-context/adaptive-context-schema.mjs +392 -0
- package/src/project-context/adaptive-context.mjs +547 -0
- package/src/project-context/ai-entry.mjs +9 -9
- package/src/project-context/assist.mjs +4 -2
- package/src/project-context/capabilities.mjs +18 -0
- package/src/project-context/checker.mjs +4 -3
- package/src/project-context/cli.mjs +40 -5
- package/src/project-context/contract-schema.mjs +1 -1
- package/src/project-context/discovery.mjs +7 -7
- package/src/project-context/exchange-schema.mjs +6 -5
- package/src/project-context/maintenance.mjs +2 -2
- package/src/project-context/migration-manifest.mjs +7 -5
- package/src/project-context/renderer.mjs +75 -1
- package/src/project-context/source-reader.mjs +63 -30
- package/src/project-context/task-context.mjs +14 -2
- package/src/project-context/truth-reconciliation-schema.mjs +488 -0
- package/src/project-context/truth-reconciliation.mjs +543 -0
- package/src/project-context/upgrade-schema.mjs +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.7.0 - Unreleased
|
|
4
|
+
|
|
5
|
+
- 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.
|
|
6
|
+
- Pin README, examples, and release acceptance to `frontend-project-context@1.7.0`; install the exact development dependency before persistent setup, fail closed when the local CLI is absent, and document fresh reinitialization without losing human-authored rules.
|
|
7
|
+
- Complete the reviewed docs/26 local repair: Context Query, Adaptive Context Bundle, Routing Index, Truth Reconciliation Input, and Truth Reconciliation Review Bundle are schema 2; selector, capabilities, and Exchange Protocol are version 2/7/7.
|
|
8
|
+
- Bind adaptive delivery to effective scope, task lineage, audited delivery items, monotonic expansion, and separate audit/delivery/read-target budgets; withhold all model content whenever task delivery is not ready.
|
|
9
|
+
- Add a task-only renderer that deduplicates shared items and omits source locators while leaving persistent renderer 3 and managed projection bytes unchanged.
|
|
10
|
+
- Add previous-Review-bound truth resolution contracts, structured human/external-fix paths, stable finding digests, and recomputed open/deferred/resolved/rejected outcomes without adding write authority.
|
|
11
|
+
- Pass A-130D-01 through A-130D-31, A-130T-01 through A-130T-10, and all existing regressions: 194/194 locally. Provider revalidation and release remain unauthorized.
|
|
12
|
+
- Initially add strict Host Promotion Evidence, Truth Reconciliation Input, and Truth Reconciliation Review Bundle schema 1 plus read-only `reconcile-truth` for current-baseline branch/source/item/subject collision review.
|
|
13
|
+
- Bind QA/preproduction evidence to Host-asserted code, source, artifact, acceptance-suite, and Project Context digests; separate reusable local evidence from required integration verification.
|
|
14
|
+
- Give every finding exact affected source/item/subject/scope sets, task-vs-existing-delivery blocking, human roles, deterministic preview invocations, and finite recomputation paths.
|
|
15
|
+
- Verify truth-reconciliation current source/item views against the live stores, block stale candidate snapshots, bind promotion evidence to the current acceptance suite and Project Context snapshots, and publish an exact Review Bundle schema.
|
|
16
|
+
- The initial truth-reconciliation slice upgraded capabilities and Exchange Protocol to 6 without changing stores or Action Plan/Review Bundle schemas; it passed A-131 through A-143, four protocol regressions, A-130R, and all then-existing regressions, 153/153 total.
|
|
17
|
+
- Add read-only `context-query` and `coverage-audit`, plus preview-by-default `index-context` whose only explicit write is a disposable derived Routing Index.
|
|
18
|
+
- Add Context Query, Adaptive Context Bundle, Routing Index, and Coverage Audit schema 1; upgrade capabilities and Exchange Protocol to 5 while existing store and Action/Review schemas remain unchanged.
|
|
19
|
+
- Hydrate all applicable policy/validation items, route fact/reference items by original task text/topics after scope narrowing, preserve provenance/conflict closures, and fail closed at hard UTF-8/read-target budgets.
|
|
20
|
+
- Separate registration coverage, Contract coverage, freshness, task health, and global health; reject stale indexes and digest-bind incremental expansion without resending prior bodies.
|
|
21
|
+
- Reuse source digest/body reads within one command and share the adaptive selector with `stage-context` without adding Provider, Agent Runtime, Git, network, dependency, business-code write, or automatic approval behavior.
|
|
22
|
+
- Establish the initial A-115 through A-129 local baseline at 135/135 before the later A-130R and truth-reconciliation expansion to 153/153.
|
|
23
|
+
- Repair the known A-130 input-envelope difference locally with a digest-bound `context-query --prompt` projection and deterministic complete-context fallback whenever the complete prompt is no larger than the review envelope. The authorized real Host/Provider revalidation reduced the adaptive first prompt to 5,283 bytes but still scored 7/8 against the full arm's 8/8; further remediation is required and release remains blocked.
|
|
24
|
+
|
|
3
25
|
## 1.6.0 - 2026-09-11
|
|
4
26
|
|
|
5
27
|
- Add read-only `upgrade-check` and `upgrade-plan`, plus preview-by-default `upgrade-apply` with explicit `--write` for one compiled product-owned migration unit.
|
package/README.md
CHANGED
|
@@ -32,33 +32,37 @@ 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.
|
|
35
|
+
npm install --save-dev frontend-project-context@1.7.0
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
The package has zero runtime dependencies.
|
|
39
39
|
|
|
40
|
-
`1.
|
|
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.
|
|
41
41
|
|
|
42
42
|
### Quick start
|
|
43
43
|
|
|
44
44
|
Every host can begin with one read-only status command, including before initialization:
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
|
|
47
|
+
npm exec --offline -- project-context status --project . --json
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
+
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
|
+
|
|
50
52
|
`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
53
|
|
|
52
54
|
```bash
|
|
53
|
-
|
|
55
|
+
npm exec --offline -- project-context publish-entry --project . --output AGENTS.md --write --json
|
|
54
56
|
```
|
|
55
57
|
|
|
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.
|
|
59
|
+
|
|
56
60
|
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
61
|
|
|
58
62
|
Let an existing Coding Agent prepare deterministic onboarding candidates:
|
|
59
63
|
|
|
60
64
|
```bash
|
|
61
|
-
|
|
65
|
+
npm exec --offline -- project-context setup \
|
|
62
66
|
--project . \
|
|
63
67
|
--id my-project \
|
|
64
68
|
--name "My Project" \
|
|
@@ -68,10 +72,12 @@ npx project-context setup \
|
|
|
68
72
|
|
|
69
73
|
`setup` creates only the three stores and a create-only proposal. It does not approve candidates or publish Agent files. Its JSON `artifacts` receipt reports the exact proposal path and whether it was previewed, created, or already unchanged. Read `summary`, `workUnits`, and `readTargets`, then review the exact proposed IDs.
|
|
70
74
|
|
|
75
|
+
`setup` is idempotent for an initialized project; it does not reset stores or translate already approved statements. Before an explicitly authorized fresh reinitialization, preserve every human-authored policy, validation description, manual source, and approval decision. Remove only a trusted managed AI Entry, clean up the exact disposable Project Context files externally, rerun setup from the installed package, then re-author and reapprove the preserved rules.
|
|
76
|
+
|
|
71
77
|
Register an explicit source:
|
|
72
78
|
|
|
73
79
|
```bash
|
|
74
|
-
|
|
80
|
+
npm exec --offline -- project-context register \
|
|
75
81
|
--project . \
|
|
76
82
|
--id source.package \
|
|
77
83
|
--kind file \
|
|
@@ -82,7 +88,7 @@ npx project-context register \
|
|
|
82
88
|
Propose a scoped contract item. This creates a reviewable proposal; it does not approve it:
|
|
83
89
|
|
|
84
90
|
```bash
|
|
85
|
-
|
|
91
|
+
npm exec --offline -- project-context propose \
|
|
86
92
|
--project . \
|
|
87
93
|
--id policy.ui-copy \
|
|
88
94
|
--kind policy \
|
|
@@ -99,7 +105,7 @@ npx project-context propose \
|
|
|
99
105
|
Approve only the item you reviewed:
|
|
100
106
|
|
|
101
107
|
```bash
|
|
102
|
-
|
|
108
|
+
npm exec --offline -- project-context approve \
|
|
103
109
|
--project . \
|
|
104
110
|
--proposal .project-context/policy.ui-copy.proposal.json \
|
|
105
111
|
--ids policy.ui-copy \
|
|
@@ -110,14 +116,25 @@ npx project-context approve \
|
|
|
110
116
|
Compile context for a target and check for drift:
|
|
111
117
|
|
|
112
118
|
```bash
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
npm exec --offline -- project-context context --project . --path src --locale en
|
|
120
|
+
npm exec --offline -- project-context check --project .
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
For task-sensitive routing, save a schema-1 Context Query with the current snapshots and run:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npm exec --offline -- project-context context-query --project . --input .project-context/context-query.json --json
|
|
127
|
+
npm exec --offline -- project-context context-query --project . --input .project-context/context-query.json --prompt
|
|
128
|
+
npm exec --offline -- project-context coverage-audit --project . --json
|
|
129
|
+
npm exec --offline -- project-context index-context --project . --json
|
|
115
130
|
```
|
|
116
131
|
|
|
132
|
+
`context-query --json` returns the auditable machine bundle. `--prompt` returns its digest-bound, model-facing Markdown projection without the deferred/review envelope. When the complete applicable Context is no larger than the machine review bundle, the projection deterministically falls back to the complete Context; otherwise it uses the selected evidence closure. `index-context` is read-only unless `--write` is explicit; its persisted output is disposable derived data.
|
|
133
|
+
|
|
117
134
|
After project sources or implementation paths change, create one read-only reconciliation work unit:
|
|
118
135
|
|
|
119
136
|
```bash
|
|
120
|
-
|
|
137
|
+
npm exec --offline -- project-context sync \
|
|
121
138
|
--project . \
|
|
122
139
|
--changed-path src/example.ts \
|
|
123
140
|
--json
|
|
@@ -128,13 +145,13 @@ npx project-context sync \
|
|
|
128
145
|
Discover the exchange contract without initializing the project:
|
|
129
146
|
|
|
130
147
|
```bash
|
|
131
|
-
|
|
148
|
+
npm exec --offline -- project-context capabilities --project . --json
|
|
132
149
|
```
|
|
133
150
|
|
|
134
151
|
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:
|
|
135
152
|
|
|
136
153
|
```bash
|
|
137
|
-
|
|
154
|
+
npm exec --offline -- project-context preflight \
|
|
138
155
|
--project . \
|
|
139
156
|
--plan .project-context/action-plan.json \
|
|
140
157
|
--json
|
|
@@ -145,7 +162,7 @@ npx project-context preflight \
|
|
|
145
162
|
For multi-stage feature work, a host can provide a Task Context Plan, prior Stage Receipts, and explicit changed-path signals. Compile only the requested stage:
|
|
146
163
|
|
|
147
164
|
```bash
|
|
148
|
-
|
|
165
|
+
npm exec --offline -- project-context stage-context \
|
|
149
166
|
--project . \
|
|
150
167
|
--plan task-context-plan.json \
|
|
151
168
|
--stage stage-render \
|
|
@@ -158,7 +175,7 @@ npx project-context stage-context \
|
|
|
158
175
|
Before an external merge, compare host-provided main/branch path signals with the plan, receipts, current Contract snapshots, and checker findings:
|
|
159
176
|
|
|
160
177
|
```bash
|
|
161
|
-
|
|
178
|
+
npm exec --offline -- project-context integration-review \
|
|
162
179
|
--project . \
|
|
163
180
|
--plan task-context-plan.json \
|
|
164
181
|
--receipt stage-understand.receipt.json \
|
|
@@ -175,7 +192,7 @@ Starting with `1.3.1`, every supplied Stage Receipt must have exactly one matchi
|
|
|
175
192
|
To turn an already-redacted local observation into a deterministic Evidence Bundle, keep the input JSON inside the project and run:
|
|
176
193
|
|
|
177
194
|
```bash
|
|
178
|
-
|
|
195
|
+
npm exec --offline -- project-context evidence --project . --input evidence-input.json --json
|
|
179
196
|
```
|
|
180
197
|
|
|
181
198
|
`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.
|
|
@@ -183,20 +200,20 @@ npx project-context evidence --project . --input evidence-input.json --json
|
|
|
183
200
|
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
201
|
|
|
185
202
|
```bash
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
203
|
+
npm exec --offline -- project-context upgrade-check --project . --from-version 1.5.0 --json > .project-context/upgrade-assessment.json
|
|
204
|
+
npm exec --offline -- project-context upgrade-plan --project . --assessment .project-context/upgrade-assessment.json --json > .project-context/migration-plan.json
|
|
205
|
+
npm exec --offline -- project-context upgrade-apply --project . --plan .project-context/migration-plan.json --json
|
|
206
|
+
npm exec --offline -- project-context upgrade-apply --project . --plan .project-context/migration-plan.json --write --json
|
|
190
207
|
```
|
|
191
208
|
|
|
192
209
|
`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
210
|
|
|
194
|
-
The package publishes
|
|
211
|
+
The package publishes twenty machine schemas, including 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 bundles, the four staged-context schemas, Context Query/Adaptive Context Bundle/Routing Index 2, and Coverage Audit 1.
|
|
195
212
|
|
|
196
213
|
Generate the read-only governance dashboard:
|
|
197
214
|
|
|
198
215
|
```bash
|
|
199
|
-
|
|
216
|
+
npm exec --offline -- project-context dashboard --project . > project-context-dashboard.html
|
|
200
217
|
```
|
|
201
218
|
|
|
202
219
|
The dashboard is a self-contained offline HTML file. The command writes only to stdout and does not open a browser or change the contract.
|
|
@@ -245,19 +262,23 @@ All commands are read-only unless that command explicitly includes `--write`. So
|
|
|
245
262
|
| `propose` | Author a fact, policy, reference, or validation description |
|
|
246
263
|
| `approve` | Explicitly approve selected proposal IDs |
|
|
247
264
|
| `context` | Compile approved context for one or more paths |
|
|
265
|
+
| `context-query` | Compile adaptive review JSON or its compact model-facing `--prompt` projection with complete-context fallback |
|
|
266
|
+
| `coverage-audit` | Audit declared registration coverage without claiming all project truth |
|
|
267
|
+
| `index-context` | Preview or explicitly persist a disposable routing index |
|
|
248
268
|
| `publish` | Write an owned AGENTS, Markdown, or Ruler projection |
|
|
249
269
|
| `check` | Detect stale sources, contracts, and projections |
|
|
250
270
|
| `sync` | Aggregate source drift, item impact, changed paths, and reconciliation work units |
|
|
251
271
|
| `preflight` | Validate an Action Plan and return a read-only grouped Review Bundle |
|
|
252
272
|
| `stage-context` | Rebuild receipt/bundle inputs and compile the explicitly requested stage within caller-provided byte/read-target budgets |
|
|
253
273
|
| `integration-review` | Review paired receipts/bundles, host path signals, baselines, and context-layer conflicts without Git |
|
|
274
|
+
| `reconcile-truth` | Reconcile explicit branch/promotion evidence against the current truth baseline without reading Git or CI |
|
|
254
275
|
| `dashboard` | Render the read-only governance dashboard |
|
|
255
276
|
| `review-source` | Review a changed source and its exact impact set |
|
|
256
277
|
| `accept-source-change` | Accept a pinned source digest and revoke affected approvals |
|
|
257
278
|
| `revise` / `deprecate` | Maintain contract items explicitly |
|
|
258
279
|
| `deprecate-source` | Retire an unreferenced source with an audit record |
|
|
259
280
|
|
|
260
|
-
Run `
|
|
281
|
+
Run `npm exec --offline -- project-context --help` for the complete command syntax.
|
|
261
282
|
|
|
262
283
|
### Documentation
|
|
263
284
|
|
|
@@ -273,6 +294,8 @@ Run `npx project-context --help` for the complete command syntax.
|
|
|
273
294
|
- [AI exchange boundary](./docs/17-AI-EXCHANGE-BOUNDARY-DESIGN.md)
|
|
274
295
|
- [Branch-aware staged context and handoff](./docs/18-BRANCH-AWARE-STAGED-CONTEXT-DESIGN.md)
|
|
275
296
|
- [Evidence Feedback Protocol](./docs/21-PHASE-B-EVIDENCE-FEEDBACK-PROTOCOL-DESIGN.md)
|
|
297
|
+
- [Real-project source-of-truth maintenance design](./docs/25-REAL-PROJECT-SOURCE-OF-TRUTH-MAINTENANCE-DESIGN.md)
|
|
298
|
+
- [A-130 quality closure and adaptive delivery repair](./docs/26-A130-QUALITY-CLOSURE-AND-ADAPTIVE-DELIVERY-REPAIR-DESIGN.md)
|
|
276
299
|
- [Upgrade notes](./UPGRADING.md)
|
|
277
300
|
|
|
278
301
|
## 中文
|
|
@@ -301,33 +324,37 @@ AI 编程工具通常只读取仓库的一部分,而项目约定分散在文
|
|
|
301
324
|
建议固定为开发依赖,让本地与 CI 使用同一版本:
|
|
302
325
|
|
|
303
326
|
```bash
|
|
304
|
-
npm install --save-dev frontend-project-context@1.
|
|
327
|
+
npm install --save-dev frontend-project-context@1.7.0
|
|
305
328
|
```
|
|
306
329
|
|
|
307
330
|
本包没有运行时第三方依赖。
|
|
308
331
|
|
|
309
|
-
`1.
|
|
332
|
+
`1.7.0` 是当前源码树描述的版本,累计包含 `1.4.0` 状态/接管、`1.5.0` 证据、`1.6.0` 目标升级、自适应有界任务上下文、真源裁定修复和中文人类可读项目语义。候选已通过本地 194 项回归;公开发布仍必须通过单独治理的 Host/Provider 与发布门槛。
|
|
310
333
|
|
|
311
334
|
### 快速开始
|
|
312
335
|
|
|
313
336
|
任何宿主都可以先运行同一条只读状态命令,包括尚未初始化的项目:
|
|
314
337
|
|
|
315
338
|
```bash
|
|
316
|
-
|
|
339
|
+
npm exec --offline -- project-context status --project . --json
|
|
317
340
|
```
|
|
318
341
|
|
|
342
|
+
以下所有 `npm exec --offline -- project-context` 命令都要求先安装上面的精确开发依赖。`--offline` 会在本地 CLI 缺失时失败封闭,避免从配置的 registry 下载无关的同名 `project-context` 包。
|
|
343
|
+
|
|
319
344
|
`status` 在不读取业务源码正文、不写项目文件的前提下分类 uninitialized、partial、invalid、attention、clean 和所有权冲突。初始化后,可把固定启动路由发布到根 `AGENTS.md` 的受管区域,同时完整保留区域外人工内容:
|
|
320
345
|
|
|
321
346
|
```bash
|
|
322
|
-
|
|
347
|
+
npm exec --offline -- project-context publish-entry --project . --output AGENTS.md --write --json
|
|
323
348
|
```
|
|
324
349
|
|
|
350
|
+
`1.7.0` 的 AI Entry renderer 3 默认用中文生成人类可读的项目规则,并只调用离线的项目本地 CLI;命令、marker、ID、JSON 字段和枚举继续保持稳定英文。既有 renderer 1/2 入口仍可读取,但会标记 stale,只有显式受管 republish 才会升级,不会自动重写。
|
|
351
|
+
|
|
325
352
|
使用相同 output 的 `remove-entry` 只移除可信受管区域。计划与 preview 都不含 `--write`,仍需人对精确路径授权。
|
|
326
353
|
|
|
327
354
|
让现有 Coding Agent 生成确定性的首次接入候选:
|
|
328
355
|
|
|
329
356
|
```bash
|
|
330
|
-
|
|
357
|
+
npm exec --offline -- project-context setup \
|
|
331
358
|
--project . \
|
|
332
359
|
--id my-project \
|
|
333
360
|
--name "My Project" \
|
|
@@ -337,10 +364,12 @@ npx project-context setup \
|
|
|
337
364
|
|
|
338
365
|
`setup` 只创建三个 store 和一份 create-only proposal,不会批准候选或发布 Agent 文件。JSON 中的 `artifacts` receipt 会返回精确 proposal 路径,以及 preview、create 或 unchanged 结果。先读取 `summary`、`workUnits` 和 `readTargets`,再审查具体 proposal ID。
|
|
339
366
|
|
|
367
|
+
`setup` 对已初始化项目是幂等操作,不会重置 store,也不会翻译已经批准的 statement。明确授权全新初始化前,必须先保留所有人工 policy、validation-description、手工 source 和批准决定;只移除可信受管 AI Entry,再由外部精确清理可丢弃的 Project Context 文件,使用已安装包重新 setup,最后重新录入并批准所保留的人工规则。
|
|
368
|
+
|
|
340
369
|
登记一个明确来源:
|
|
341
370
|
|
|
342
371
|
```bash
|
|
343
|
-
|
|
372
|
+
npm exec --offline -- project-context register \
|
|
344
373
|
--project . \
|
|
345
374
|
--id source.package \
|
|
346
375
|
--kind file \
|
|
@@ -351,7 +380,7 @@ npx project-context register \
|
|
|
351
380
|
提出一条带作用域的合同项。这里只生成待审 proposal,不会自动批准:
|
|
352
381
|
|
|
353
382
|
```bash
|
|
354
|
-
|
|
383
|
+
npm exec --offline -- project-context propose \
|
|
355
384
|
--project . \
|
|
356
385
|
--id policy.ui-copy \
|
|
357
386
|
--kind policy \
|
|
@@ -368,7 +397,7 @@ npx project-context propose \
|
|
|
368
397
|
人工审查后,只批准明确选中的 item:
|
|
369
398
|
|
|
370
399
|
```bash
|
|
371
|
-
|
|
400
|
+
npm exec --offline -- project-context approve \
|
|
372
401
|
--project . \
|
|
373
402
|
--proposal .project-context/policy.ui-copy.proposal.json \
|
|
374
403
|
--ids policy.ui-copy \
|
|
@@ -379,14 +408,25 @@ npx project-context approve \
|
|
|
379
408
|
为目标目录生成上下文,并检查漂移:
|
|
380
409
|
|
|
381
410
|
```bash
|
|
382
|
-
|
|
383
|
-
|
|
411
|
+
npm exec --offline -- project-context context --project . --path src --locale zh-CN
|
|
412
|
+
npm exec --offline -- project-context check --project .
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
需要按任务路由上下文时,把当前 snapshot 写入 schema 2 Context Query,再运行:
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
npm exec --offline -- project-context context-query --project . --input .project-context/context-query.json --json
|
|
419
|
+
npm exec --offline -- project-context context-query --project . --input .project-context/context-query.json --prompt
|
|
420
|
+
npm exec --offline -- project-context coverage-audit --project . --json
|
|
421
|
+
npm exec --offline -- project-context index-context --project . --json
|
|
384
422
|
```
|
|
385
423
|
|
|
424
|
+
`context-query --json` 返回可审计的机器 Bundle,`--prompt` 只返回与 digest 绑定的模型面向 Markdown,不把 deferred/review 包络或 source locator 发给模型。完整 Context 在 delivery soft threshold 内或不大于 adaptive 正文时优先;非 ready 交付 stdout 为空。`index-context` 默认只读;只有显式 `--write` 才保存可删除、可重建的派生索引。
|
|
425
|
+
|
|
386
426
|
项目来源或实现路径变化后,可一次生成只读的增量维护工作单元:
|
|
387
427
|
|
|
388
428
|
```bash
|
|
389
|
-
|
|
429
|
+
npm exec --offline -- project-context sync \
|
|
390
430
|
--project . \
|
|
391
431
|
--changed-path src/example.ts \
|
|
392
432
|
--json
|
|
@@ -397,13 +437,13 @@ npx project-context sync \
|
|
|
397
437
|
无需初始化项目即可查询双向交换协议:
|
|
398
438
|
|
|
399
439
|
```bash
|
|
400
|
-
|
|
440
|
+
npm exec --offline -- project-context capabilities --project . --json
|
|
401
441
|
```
|
|
402
442
|
|
|
403
443
|
外部 AI 宿主可使用返回的三个项目 snapshot 和十类 action 生成 Action Plan schema 2;schema-1 plan 仍可读取。把这份短生命周期计划保存在项目内,再生成只读 Review Bundle:
|
|
404
444
|
|
|
405
445
|
```bash
|
|
406
|
-
|
|
446
|
+
npm exec --offline -- project-context preflight \
|
|
407
447
|
--project . \
|
|
408
448
|
--plan .project-context/action-plan.json \
|
|
409
449
|
--json
|
|
@@ -414,7 +454,7 @@ npx project-context preflight \
|
|
|
414
454
|
多阶段功能开发中,宿主可以显式提供 Task Context Plan、前序 Stage Receipt 和 changed-path 信号,只编译当前指定阶段:
|
|
415
455
|
|
|
416
456
|
```bash
|
|
417
|
-
|
|
457
|
+
npm exec --offline -- project-context stage-context \
|
|
418
458
|
--project . \
|
|
419
459
|
--plan task-context-plan.json \
|
|
420
460
|
--stage stage-render \
|
|
@@ -427,7 +467,7 @@ npx project-context stage-context \
|
|
|
427
467
|
外部合并前,可把宿主提供的 main/branch 路径信号与 plan、receipt、当前 Contract snapshot 和 checker finding 一起进行只读审查:
|
|
428
468
|
|
|
429
469
|
```bash
|
|
430
|
-
|
|
470
|
+
npm exec --offline -- project-context integration-review \
|
|
431
471
|
--project . \
|
|
432
472
|
--plan task-context-plan.json \
|
|
433
473
|
--receipt stage-understand.receipt.json \
|
|
@@ -444,7 +484,7 @@ npx project-context integration-review \
|
|
|
444
484
|
要把一次已经脱敏的本地观察收敛为确定性 Evidence Bundle,请把输入 JSON 保持在项目内并运行:
|
|
445
485
|
|
|
446
486
|
```bash
|
|
447
|
-
|
|
487
|
+
npm exec --offline -- project-context evidence --project . --input evidence-input.json --json
|
|
448
488
|
```
|
|
449
489
|
|
|
450
490
|
`evidence` 只读取这份输入和 Project Context 健康元数据,不写文件,也不上传;项目身份、路径、来源正文、日志和 Contract value 按结构排除。两个 summary 仍是自由文本,因此所有 bundle 永远标记为 `human-review-required`,由人决定是否以及向谁转交。
|
|
@@ -452,20 +492,20 @@ npx project-context evidence --project . --input evidence-input.json --json
|
|
|
452
492
|
在人和 Host 已于产品边界外把依赖固定到精确目标版本后,可以评估产品自有迁移面,并生成一个 digest 绑定的工作单元:
|
|
453
493
|
|
|
454
494
|
```bash
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
495
|
+
npm exec --offline -- project-context upgrade-check --project . --from-version 1.5.0 --json > .project-context/upgrade-assessment.json
|
|
496
|
+
npm exec --offline -- project-context upgrade-plan --project . --assessment .project-context/upgrade-assessment.json --json > .project-context/migration-plan.json
|
|
497
|
+
npm exec --offline -- project-context upgrade-apply --project . --plan .project-context/migration-plan.json --json
|
|
498
|
+
npm exec --offline -- project-context upgrade-apply --project . --plan .project-context/migration-plan.json --write --json
|
|
459
499
|
```
|
|
460
500
|
|
|
461
501
|
`upgrade-check` 与 `upgrade-plan` 永久只读;`upgrade-apply` 默认 preview,只有显式 `--write` 才能执行该 plan 展示的一个已编译、产品自有单元。每个单元后必须重新 check/plan。即使 `coreMigration: complete`,Host 仍需核对依赖与 lockfile、运行项目测试或 CI,并用独立新窗口复核。产品不会执行包管理器、Git、网络、项目测试、业务写入、自动批准、回滚或发布。
|
|
462
502
|
|
|
463
|
-
npm
|
|
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。
|
|
464
504
|
|
|
465
505
|
生成只读治理看板:
|
|
466
506
|
|
|
467
507
|
```bash
|
|
468
|
-
|
|
508
|
+
npm exec --offline -- project-context dashboard --project . > project-context-dashboard.html
|
|
469
509
|
```
|
|
470
510
|
|
|
471
511
|
看板是一个可离线打开的自包含 HTML。命令只输出到 stdout,不会自动打开浏览器,也不会修改合同。
|
|
@@ -514,19 +554,23 @@ npx project-context dashboard --project . > project-context-dashboard.html
|
|
|
514
554
|
| `propose` | 创建 fact、policy、reference 或 validation-description |
|
|
515
555
|
| `approve` | 显式批准选中的 proposal ID |
|
|
516
556
|
| `context` | 为一个或多个路径编译已批准上下文 |
|
|
557
|
+
| `context-query` | 编译自适应审查 JSON,或生成带完整上下文回退的紧凑 `--prompt` 模型投影 |
|
|
558
|
+
| `coverage-audit` | 审计声明范围内的来源登记覆盖,不宣称发现全部项目真源 |
|
|
559
|
+
| `index-context` | 预览或显式保存可删除的派生路由索引 |
|
|
517
560
|
| `publish` | 写入仍归工具所有的 AGENTS、Markdown 或 Ruler 投影 |
|
|
518
561
|
| `check` | 检测来源、合同和投影漂移 |
|
|
519
562
|
| `sync` | 聚合来源漂移、item 影响、变化路径和维护工作单元 |
|
|
520
563
|
| `preflight` | 验证 Action Plan 并返回只读分组 Review Bundle |
|
|
521
564
|
| `stage-context` | 重建 receipt/bundle 输入,并在调用方字节/read-target 预算内编译显式指定的当前阶段 |
|
|
522
565
|
| `integration-review` | 不读取 Git,只读审查成对 receipt/bundle、路径信号、baseline 与上下文冲突 |
|
|
566
|
+
| `reconcile-truth` | 不读取 Git/CI,将显式分支与晋升证据对当前真源基线做只读重算 |
|
|
523
567
|
| `dashboard` | 生成只读治理看板 |
|
|
524
568
|
| `review-source` | 查看来源变化及精确影响集 |
|
|
525
569
|
| `accept-source-change` | 接受固定摘要并撤销受影响批准 |
|
|
526
570
|
| `revise` / `deprecate` | 显式维护合同项 |
|
|
527
571
|
| `deprecate-source` | 用审计记录退役已无引用的来源 |
|
|
528
572
|
|
|
529
|
-
运行 `
|
|
573
|
+
运行 `npm exec --offline -- project-context --help` 查看完整命令语法。
|
|
530
574
|
|
|
531
575
|
### 深入文档
|
|
532
576
|
|
|
@@ -542,6 +586,8 @@ npx project-context dashboard --project . > project-context-dashboard.html
|
|
|
542
586
|
- [AI 双向交换边界](./docs/17-AI-EXCHANGE-BOUNDARY-DESIGN.md)
|
|
543
587
|
- [分支感知的分阶段上下文与交接](./docs/18-BRANCH-AWARE-STAGED-CONTEXT-DESIGN.md)
|
|
544
588
|
- [Evidence Feedback Protocol](./docs/21-PHASE-B-EVIDENCE-FEEDBACK-PROTOCOL-DESIGN.md)
|
|
589
|
+
- [真实项目全量应用下的真源维护设计](./docs/25-REAL-PROJECT-SOURCE-OF-TRUTH-MAINTENANCE-DESIGN.md)
|
|
590
|
+
- [A-130 质量闭环与自适应交付协议修订](./docs/26-A130-QUALITY-CLOSURE-AND-ADAPTIVE-DELIVERY-REPAIR-DESIGN.md)
|
|
545
591
|
- [升级说明](./UPGRADING.md)
|
|
546
592
|
|
|
547
593
|
## License / 许可证
|
package/UPGRADING.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# 升级说明
|
|
2
2
|
|
|
3
|
+
## `1.6.0 → 1.7.0`(本地实现,未发布)
|
|
4
|
+
|
|
5
|
+
`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。
|
|
6
|
+
|
|
7
|
+
Migration Manifest 把 `1.6.0` 到中文 AI Entry renderer 3 的迁移记录为显式 `republish-ai-entry`。升级后应重新生成 capabilities、schema 2 Context Query/Adaptive Context Bundle/Truth Reconciliation 工件与 Coverage Audit;schema 1 Routing Index 可在内存中重建,schema 1 Adaptive Bundle/Truth Review 不得作为 previous 输入。既有 renderer 1/2 AI Entry 仍可读取但会报告 stale,工具只生成一个摘要绑定的 republish 单元,未经 `--write` 不修改 `AGENTS.md` 或 Projection Lock。这些派生、短生命周期或投影工件不得回写 Project Contract,也不授予任务执行权限。
|
|
8
|
+
|
|
9
|
+
目标项目必须先由 Host 把依赖精确固定到 `frontend-project-context@1.7.0`,再使用 `npm exec --offline -- project-context` 执行升级或初始化;不能用可能回退到 registry 同名包的 `npx project-context`。`setup` 不是 reset/翻译命令:需要全新初始化时,先外部留存人工规则并安全移除受管 Entry,再经明确授权清理精确 store,最后从已安装包重建和重新批准。
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
project-context upgrade-check --project . --from-version 1.6.0 --json
|
|
13
|
+
project-context index-context --project . --json
|
|
14
|
+
project-context index-context --project . --write --json
|
|
15
|
+
project-context coverage-audit --project . --json
|
|
16
|
+
project-context context-query --project . --input .project-context/context-query.json --json
|
|
17
|
+
project-context context-query --project . --input .project-context/context-query.json --prompt
|
|
18
|
+
project-context reconcile-truth --project . --input truth-reconciliation-input.json --json
|
|
19
|
+
project-context reconcile-truth --project . --input truth-reconciliation-resolution.json --previous-review truth-reconciliation-review.json --json
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`context-query --json` 返回可审计包络,`--prompt` 只返回 digest-bound 模型输入;默认只在当前证据闭包中校验相关来源,`strict-current` 或 `complete` 会回退到完整健康与覆盖审计。audit、delivery、read-target 预算独立,非 ready 交付不输出正文。`reconcile-truth` 严格核对 live source/item 基线、Project snapshots、acceptance suite 与 previous Review,只生成无权 Review Bundle。docs/26 本地实现和 194/194 回归已完成;历史真实 Host/Provider 复验仍因质量 7/8 对 8/8 而失败,新的 Provider 复验、Git 和发布仍未授权。
|
|
23
|
+
|
|
3
24
|
## `1.3.1 / 1.4.0 / 1.5.0 → 1.6.0`
|
|
4
25
|
|
|
5
26
|
`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 的目标版本不变。
|
|
@@ -31,7 +52,7 @@ assessment 与 plan 文件由 Host 保存到项目内 `.project-context/` 的非
|
|
|
31
52
|
|
|
32
53
|
只安装新包且未写 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
54
|
|
|
34
|
-
Action Plan 2 新增 `publish-ai-entry` 和 `remove-ai-entry`,但仍只是无权建议;Review Bundle 的 structured invocation 不含 `--write` 或 `--by`。`status.health: clean` 只证明 Project Context 治理层健康,不代表业务测试、Git
|
|
55
|
+
Action Plan 2 新增 `publish-ai-entry` 和 `remove-ai-entry`,但仍只是无权建议;Review Bundle 的 structured invocation 不含 `--write` 或 `--by`。`status.health: clean` 只证明 Project Context 治理层健康,不代表业务测试、Git 或发布状态。这些能力已随 `1.6.0` 发布到官方公共 npm,并完成候选/registry 逐字节一致性与全新安装复验。
|
|
35
56
|
|
|
36
57
|
## `1.3.0 → 1.3.1`
|
|
37
58
|
|
|
@@ -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-
|
|
5
|
+
> 状态:`A-01 through A-143, A-130R, A-130D-01 through A-130D-32, A-130T-01 through A-130T-10, protocol regressions, B0-01/B0-02, CLI, machine schemas, and release artifacts passed locally; 195 tests total. Bounded Host/Provider revalidation has not run and is not authorized. Public npm latest remains independently verified at 1.6.0; local 1.7.0 is release-blocked.`
|
|
6
6
|
|
|
7
7
|
## 1. 验收原则
|
|
8
8
|
|
|
@@ -425,3 +425,22 @@ A-39 是发布工件一致性验证,不扩展 Project Contract、CLI、schema
|
|
|
425
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
426
|
|
|
427
427
|
完整 `npm run check` 结果为 120/120:新增 14 项,既有 106 项无删除、跳过或弱化。验证只使用隔离临时 fixture;生产源码仍无第三方依赖、Provider、Agent Runtime、包管理器、Git、网络、项目测试执行、业务代码写入、自动批准、自动升级、自动回滚或发布行为。`coreMigration: complete` 仍固定要求 Host 完成 dependency/lockfile、项目测试或 CI 与独立新窗口验收。
|
|
428
|
+
|
|
429
|
+
## 20. `1.7.0` Adaptive Bounded Task Context 验收(本地自动验收通过,A-130 真实 Host 复验失败)
|
|
430
|
+
|
|
431
|
+
`docs/23` 的 A-115 至 A-129 已落为 15 个独立顶层测试:多层 policy/validation 必选、软/硬预算、冲突闭包、Routing Index 过期/缺失回退、相关 source drift、sibling warning、signal-bound/strict freshness、source read 去重、digest-bound 增量扩展、task/topic 路由、Registration Coverage、required-item oracle 和隔离效率门槛。
|
|
432
|
+
|
|
433
|
+
在 docs/26 统一修复前,本节初始实现的 `npm run check` 当时为 153/153:A-115 至 A-129、A-130R、A-131 至 A-143、四项 truth-protocol 回归及既有测试均无删除、跳过或弱化。第一次敌意路由 fixture 反证了“通用 path segment 可以直接作为语义命中”的实现解释,因此 selector 已修订为路径先约束 scope、原始 task text/topics 再选择 fact/reference。
|
|
434
|
+
|
|
435
|
+
A-130 于 `2026-09-12` 使用相同 Codex 模型、相同任务和只读 `dtg-tmc-pc` 执行首次对照,完整 Context 得到 8/8,Adaptive Context 得到 7/8。A-130R 随后分离审查 JSON 与模型 `--prompt`,并通过本地回归。获授权的同日真实 Host/Provider 复验重新运行两臂:完整臂仍为 8/8,自适应臂仍为 7/8,并再次对 `priceList[0]` 的既定方向语义产生假阳性;自适应首包虽从 14,466 降至 5,283 字节,但 input tokens、命令数、耗时与质量均未优于同轮完整臂。因此 A-130 严格复验失败。完整证据见 [24-A130-REAL-HOST-TARGET-PROJECT-COMPARISON.md](./24-A130-REAL-HOST-TARGET-PROJECT-COMPARISON.md)。153 项本地自动测试不因此改写为失败,但 `1.7.0` 发布继续被阻断。
|
|
436
|
+
|
|
437
|
+
## 21. `1.7.0` A-130 Quality Closure 与 Truth Resolution Closure(本地实现通过)
|
|
438
|
+
|
|
439
|
+
[26-A130-QUALITY-CLOSURE-AND-ADAPTIVE-DELIVERY-REPAIR-DESIGN.md](./26-A130-QUALITY-CLOSURE-AND-ADAPTIVE-DELIVERY-REPAIR-DESIGN.md) 冻结的 A-130D-01 至 A-130D-32 与 A-130T-01 至 A-130T-10 已全部落为独立顶层测试:
|
|
440
|
+
|
|
441
|
+
- A-130D 覆盖 oracle/输入语法有效性、scope 与 override、task lineage、schema 2 深层结构、targeted expansion、声明式 dependency、无 locator 的 task renderer、最终交付审计、withheld delivery、三类预算与 complete/adaptive 支配规则;
|
|
442
|
+
- A-130T 覆盖 finding digest、resolution contract、previous Review 绑定、Contract 与外部实现修复分流、deferred/open/rejected/resolved 终态和只读无权限边界;
|
|
443
|
+
- Context Query、Adaptive Context Bundle、Routing Index、Truth Reconciliation Input/Review Bundle 写 schema 2,selector 为 2,capabilities / Exchange Protocol 为 7;
|
|
444
|
+
- 持久 Contract、source/projection lock、Action Plan、Review Bundle 与 renderer 不迁移;核心不增加 Provider、Agent Runtime、Git、网络、业务代码写入或自动批准。
|
|
445
|
+
|
|
446
|
+
完整 `npm run check` 为 195/195,既有 153 项无删除、跳过或弱化。A-130D-32 新增人工 oracle digest 门,A-130D-18 收缩为 S 一对、L 三对并区分 fixture、因果不明与可重现产品缺陷。Project Context 自托管状态已回到 clean。这证明本地实现合同闭合,不替代有界 Host/Provider A-130-S/L 复验;该复验及发布仍需分别授权。
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 权威说明:本文是支持性设计文档;当前唯一规范真源是 [00-PRODUCT-CONSTITUTION.md](./00-PRODUCT-CONSTITUTION.md)。
|
|
4
4
|
|
|
5
|
-
状态:`frontend-project-context@1.
|
|
5
|
+
状态:`frontend-project-context@1.7.0` 发布前实现、195/195、真实 PC 初始化与 A-130 有界 Host/Provider 终验均已通过;发布已授权并正在执行,公开 registry 当前已核验基线仍为 `1.6.0`
|
|
6
6
|
适用项目:`dtg-frontend-delivery-agent`
|
|
7
7
|
本文记录产品如何交付、安装、共享、升级和验证;它不自行授权打包、registry、Git 或发布操作。
|
|
8
8
|
|
|
@@ -38,17 +38,34 @@ CI 安装项目锁定的依赖版本并执行只读检查。CI 不依赖机器
|
|
|
38
38
|
|
|
39
39
|
## 3. 推荐安装路径
|
|
40
40
|
|
|
41
|
-
### 3.1
|
|
41
|
+
### 3.1 正式安装:先固定项目开发依赖
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
持久初始化前,先把精确版本安装为项目开发依赖:
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
|
|
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
|
|
46
|
+
npm install --save-dev frontend-project-context@1.7.0
|
|
49
47
|
```
|
|
50
48
|
|
|
51
|
-
|
|
49
|
+
包名冻结为 `frontend-project-context`,可执行文件名为 `project-context`。安装必须先于持久 `setup`,使 discovery 登记的 `package.json` digest 已包含正式依赖,避免初始化完成后仅因补装工具而立即产生 `source-changed`。`1.7.0` 公开发布前,外部项目继续使用已发布且已独立核验的 `1.6.0`;候选源码中的 `1.7.0` 命令用于冻结将要进入该版本 tarball 的消费合同。
|
|
50
|
+
|
|
51
|
+
选择项目内安装而不是全局安装,原因是:
|
|
52
|
+
|
|
53
|
+
- 团队成员和 CI 使用相同版本;
|
|
54
|
+
- 不同项目可以独立升级;
|
|
55
|
+
- 依赖升级及生成物变化可以通过 Git diff 审查;
|
|
56
|
+
- 全局环境变化不会改变项目输出;
|
|
57
|
+
- 回滚项目版本时可以同步回滚 DTG 行为。
|
|
58
|
+
|
|
59
|
+
### 3.2 首次初始化:只运行已安装的本地 CLI
|
|
60
|
+
|
|
61
|
+
先确认本地包存在,再从本地依赖离线执行只读状态和 setup preview:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm exec --offline -- project-context status --project . --json
|
|
65
|
+
npm exec --offline -- project-context setup --project . --id PROJECT_ID --name "Project Name" --json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`--offline` 使本地 CLI 缺失时失败封闭,不允许 npm 临时下载无关的同名 `project-context` 包。确需一次性运行器时,只允许用精确包名和版本做零写 preview;任何 `setup --write` 前仍必须先完成项目内固定安装。
|
|
52
69
|
|
|
53
70
|
`setup` 初始化入口只负责:
|
|
54
71
|
|
|
@@ -60,23 +77,13 @@ bunx frontend-project-context@1.3.1 setup --project . --id PROJECT_ID --name "Pr
|
|
|
60
77
|
|
|
61
78
|
初始化不得自动访问网络、安装额外依赖、批准规范候选、生成投影或修改业务代码。
|
|
62
79
|
|
|
63
|
-
### 3.
|
|
80
|
+
### 3.3 明确授权的全新初始化
|
|
64
81
|
|
|
65
|
-
|
|
82
|
+
`setup` 对已初始化项目是幂等的,不是 reset 或翻译命令。需要用正式包重新初始化时,Host 必须先盘点并留存人工 policy、validation-description、manual source 和批准决定;用 `remove-entry` 只移除所有权可信的受管区域;再由人明确授权外部工具精确清理可丢弃的 `.project-context`;确认状态回到 `uninitialized` 后,按 3.1、3.2 顺序重建并重新批准所保留的人工语义。
|
|
66
83
|
|
|
67
|
-
|
|
68
|
-
pnpm add -D frontend-project-context@1.3.1
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
选择项目内安装而不是全局安装,原因是:
|
|
72
|
-
|
|
73
|
-
- 团队成员和 CI 使用相同版本;
|
|
74
|
-
- 不同项目可以独立升级;
|
|
75
|
-
- 依赖升级及生成物变化可以通过 Git diff 审查;
|
|
76
|
-
- 全局环境变化不会改变项目输出;
|
|
77
|
-
- 回滚项目版本时可以同步回滚 DTG 行为。
|
|
84
|
+
如果 `AGENTS.md` 既是人工 source 又承载 AI Entry,首次发布区域会按既有设计产生一次预期的 `source-changed`。Host 必须继续执行 `review-source → accept-source-change → reapprove → check/status`,不能把入口写入隐式当作 source acceptance。
|
|
78
85
|
|
|
79
|
-
### 3.
|
|
86
|
+
### 3.4 团队消费:静态投影随仓库分发
|
|
80
87
|
|
|
81
88
|
由 DTG 从唯一的 `Project Contract` 生成、且体积可控的静态 Agent 投影,默认应提交到仓库。
|
|
82
89
|
|
|
@@ -241,3 +248,19 @@ IDE 插件可以在未来提供状态提示、冲突解释和可视化配置,
|
|
|
241
248
|
`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
249
|
|
|
243
250
|
实现 Gate 为 120/120 本地隔离测试通过。capabilities/Exchange Protocol 为 4,Action Plan/Review Bundle 仍为 2,现有 store/renderer 目标版本不变。`coreMigration: complete` 不等于依赖、CI、新窗口或发布完成。没有执行候选打包、真实 Host/目标项目升级、Git、网络、包管理器或 npm 发布;这些仍需要新的独立授权。
|
|
251
|
+
|
|
252
|
+
## 17. `1.7.0` 真实 PC 包初始化验收
|
|
253
|
+
|
|
254
|
+
2026-09-14 在 `dtg-tmc-pc` 的隔离副本上执行了一次无网络、无 Provider、无 Git 写入的真实包消费验收。候选 tarball 版本为 `1.7.0`,共 99 个文件,解包约 1.3 MB;包的 prepack Gate 通过 195/195。精确工件摘要只记录在不进入 npm 包的 `PROJECT_STATE.json`,避免可分发文档引用自身 tarball 摘要形成自引用。
|
|
255
|
+
|
|
256
|
+
消费端使用安装后的项目本地 `project-context` 完成:
|
|
257
|
+
|
|
258
|
+
1. `status` 判定未初始化,`setup` preview 零写入;
|
|
259
|
+
2. `setup --write` 只创建 `.project-context` 和候选建议;
|
|
260
|
+
3. 人工授权审批 19 项从现有文件直接发现的客观事实与 `AGENTS.md` 引用;
|
|
261
|
+
4. `publish-entry --write` 仅追加中文受管区域,原有人工 `AGENTS.md` 字节保留;
|
|
262
|
+
5. 因 `AGENTS.md` 同时是已登记真源,按 3.3 的既定边界执行一次 `review-source → accept-source-change → approve --pending`,没有隐式批准;
|
|
263
|
+
6. `check` 返回空 findings,`status` 返回 `health: clean` 和 `ready-for-task`;
|
|
264
|
+
7. 针对 `src/components/flight/non-whitelist-confirm.vue` 与 `src/components/center/protocolPriceDialog.vue` 的真实行李展示任务,`context --locale zh-CN` 成功产生中文 Project Context Bundle。
|
|
265
|
+
|
|
266
|
+
原始 PC 仓库全程保持干净,没有写入业务代码、`AGENTS.md`、`package.json`、lockfile 或 `.project-context`。本次结果证明 `1.7.0` 候选包能在真实 PC 项目结构中完成初始化并进入正常任务路径。后续 A-130 有界 Host/Provider 终验已通过,见 `docs/24` 第 11 节;A-144 不属于本次发布范围。
|