@nimiplatform/nimi-coding 0.2.1 → 0.2.2
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 +8 -0
- package/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/cli/constants.mjs +1 -1
- package/cli/lib/handoff.mjs +12 -3
- package/cli/lib/internal/doctor-finalize.mjs +32 -11
- package/cli/lib/internal/doctor-format.mjs +3 -2
- package/config/bootstrap.yaml +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to `@nimiplatform/nimi-coding` are tracked here.
|
|
|
4
4
|
|
|
5
5
|
This project follows semantic versioning for published npm releases.
|
|
6
6
|
|
|
7
|
+
## 0.2.2
|
|
8
|
+
|
|
9
|
+
- Fixed v2 doctor lifecycle/readiness derivation so host projects using the
|
|
10
|
+
class-filtered surface model no longer depend on legacy `.nimi/spec/_meta`
|
|
11
|
+
carriers or `.nimi/spec/bootstrap-state.yaml`.
|
|
12
|
+
- Fixed v2 handoff readiness for `doc_spec_audit` so it can run when the
|
|
13
|
+
canonical tree is present but the local generation audit still needs repair.
|
|
14
|
+
|
|
7
15
|
## 0.2.1
|
|
8
16
|
|
|
9
17
|
- Added the `gate_registry` table family for product-owned release gate
|
package/README.md
CHANGED
|
@@ -314,7 +314,7 @@ repository itself keeps the package-owned source directly under
|
|
|
314
314
|
|
|
315
315
|
```bash
|
|
316
316
|
pnpm install
|
|
317
|
-
pnpm test # runs the node:test suite (
|
|
317
|
+
pnpm test # runs the node:test suite (331 tests at 0.2.2)
|
|
318
318
|
pnpm check:pack # npm pack --dry-run
|
|
319
319
|
pnpm check:ci # test + pack + CLI help/version smoke
|
|
320
320
|
```
|
package/README.zh-CN.md
CHANGED
|
@@ -256,7 +256,7 @@ Nimi Coding 坐在你已经用的 AI host *底下*。它是让 AI 做完的工
|
|
|
256
256
|
|
|
257
257
|
```bash
|
|
258
258
|
pnpm install
|
|
259
|
-
pnpm test # 跑 node:test 套件(0.2.
|
|
259
|
+
pnpm test # 跑 node:test 套件(0.2.2 共 331 用例)
|
|
260
260
|
pnpm check:pack # npm pack --dry-run
|
|
261
261
|
pnpm check:ci # test + pack + CLI help/version smoke
|
|
262
262
|
```
|
package/cli/constants.mjs
CHANGED
package/cli/lib/handoff.mjs
CHANGED
|
@@ -72,13 +72,16 @@ function commandRuleAllowsCurrentState(rule, doctorResult) {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
function evaluateSkillReadiness(skillId, doctorResult) {
|
|
75
|
-
|
|
75
|
+
const usesV2SurfaceModel = doctorResult.specGenerationInputs?.mode === "class_filtered";
|
|
76
|
+
const canBypassV2GlobalHandoffGate = usesV2SurfaceModel
|
|
77
|
+
&& ["spec_reconstruction", "doc_spec_audit"].includes(skillId);
|
|
78
|
+
|
|
79
|
+
if (!doctorResult.ok || (!doctorResult.handoffReadiness.ok && !canBypassV2GlobalHandoffGate)) {
|
|
76
80
|
return {
|
|
77
81
|
ok: false,
|
|
78
82
|
reason: "Bootstrap or handoff validation is failing; repair doctor errors before exporting handoff payloads",
|
|
79
83
|
};
|
|
80
84
|
}
|
|
81
|
-
const usesV2SurfaceModel = doctorResult.specGenerationInputs?.mode === "class_filtered";
|
|
82
85
|
if (usesV2SurfaceModel && (doctorResult.commandGating?.entries ?? []).length === 0) {
|
|
83
86
|
if (skillId === "spec_reconstruction") {
|
|
84
87
|
return {
|
|
@@ -86,6 +89,12 @@ function evaluateSkillReadiness(skillId, doctorResult) {
|
|
|
86
89
|
reason: "Projects may delegate spec reconstruction to an external AI host when canonical tree work is needed",
|
|
87
90
|
};
|
|
88
91
|
}
|
|
92
|
+
if (skillId === "doc_spec_audit" && doctorResult.canonicalTree?.requiredFilesValid === true) {
|
|
93
|
+
return {
|
|
94
|
+
ok: true,
|
|
95
|
+
reason: "Skill prerequisites are satisfied by the current project-local truth",
|
|
96
|
+
};
|
|
97
|
+
}
|
|
89
98
|
if (doctorResult.canonicalTree?.requiredFilesValid === true && doctorResult.specGenerationAudit?.ok === true) {
|
|
90
99
|
return {
|
|
91
100
|
ok: true,
|
|
@@ -338,7 +347,7 @@ export async function buildHandoffPayload(projectRoot, skillId) {
|
|
|
338
347
|
},
|
|
339
348
|
runtimeOwner: doctorResult.delegatedContracts.runtimeOwner,
|
|
340
349
|
triggerMode: doctorResult.delegatedContracts.triggerMode,
|
|
341
|
-
handoffReady:
|
|
350
|
+
handoffReady: readiness.ok,
|
|
342
351
|
skill: {
|
|
343
352
|
id: skillId,
|
|
344
353
|
required: expectedSkill.required === "true",
|
|
@@ -37,6 +37,24 @@ import {
|
|
|
37
37
|
|
|
38
38
|
const PACKAGE_REPO_ROOT = fileURLToPath(new URL("../../..", import.meta.url));
|
|
39
39
|
|
|
40
|
+
function deriveV2LifecycleState(bootstrapSurface) {
|
|
41
|
+
const treeReady = bootstrapSurface.canonicalTree.requiredFilesValid === true;
|
|
42
|
+
const benchmarkMode = bootstrapSurface.specGenerationInputs?.benchmarkMode
|
|
43
|
+
?? bootstrapSurface.blueprintReference?.mode
|
|
44
|
+
?? "none";
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
mode: "class_filtered",
|
|
48
|
+
treeState: treeReady ? "canonical_tree_ready" : "canonical_tree_in_progress",
|
|
49
|
+
authorityMode: "surface_class_validated",
|
|
50
|
+
blueprintMode: benchmarkMode,
|
|
51
|
+
reconstructionRequired: !treeReady,
|
|
52
|
+
readyForAiReconstruction: !treeReady,
|
|
53
|
+
cutoverReadiness: {},
|
|
54
|
+
activeAuthorityRoot: bootstrapSurface.specGenerationInputs?.canonicalTargetRoot ?? ".nimi/spec",
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
40
58
|
export async function finalizeDoctorState(projectRoot, bootstrapSurface, delegatedSurface) {
|
|
41
59
|
const checks = [...bootstrapSurface.checks, ...delegatedSurface.checks];
|
|
42
60
|
const usesV2SurfaceModel = bootstrapSurface.specGenerationInputs?.mode === "class_filtered";
|
|
@@ -264,7 +282,19 @@ export async function finalizeDoctorState(projectRoot, bootstrapSurface, delegat
|
|
|
264
282
|
}
|
|
265
283
|
|
|
266
284
|
const hasErrors = checks.some((check) => check.severity === "error");
|
|
267
|
-
const
|
|
285
|
+
const lifecycleState = usesV2SurfaceModel
|
|
286
|
+
? deriveV2LifecycleState(bootstrapSurface)
|
|
287
|
+
: {
|
|
288
|
+
mode: bootstrapSurface.bootstrapStateContract.mode,
|
|
289
|
+
treeState: bootstrapSurface.bootstrapStateContract.treeState,
|
|
290
|
+
authorityMode: bootstrapSurface.bootstrapStateContract.authorityMode,
|
|
291
|
+
blueprintMode: bootstrapSurface.bootstrapStateContract.blueprintMode,
|
|
292
|
+
reconstructionRequired: bootstrapSurface.bootstrapStateContract.reconstructionRequired,
|
|
293
|
+
readyForAiReconstruction: bootstrapSurface.bootstrapStateContract.readyForAiReconstruction,
|
|
294
|
+
cutoverReadiness: bootstrapSurface.bootstrapStateContract.cutoverReadiness,
|
|
295
|
+
activeAuthorityRoot: bootstrapSurface.bootstrapStateContract.activeAuthorityRoot,
|
|
296
|
+
};
|
|
297
|
+
const reconstructionRequired = lifecycleState.reconstructionRequired === true;
|
|
268
298
|
|
|
269
299
|
const handoffReadiness = {
|
|
270
300
|
ok: delegatedSurface.handoffContextOk
|
|
@@ -355,16 +385,7 @@ export async function finalizeDoctorState(projectRoot, bootstrapSurface, delegat
|
|
|
355
385
|
id: bootstrapSurface.bootstrapCompatibility.contractId,
|
|
356
386
|
version: bootstrapSurface.bootstrapCompatibility.contractVersion,
|
|
357
387
|
},
|
|
358
|
-
lifecycleState
|
|
359
|
-
mode: bootstrapSurface.bootstrapStateContract.mode,
|
|
360
|
-
treeState: bootstrapSurface.bootstrapStateContract.treeState,
|
|
361
|
-
authorityMode: bootstrapSurface.bootstrapStateContract.authorityMode,
|
|
362
|
-
blueprintMode: bootstrapSurface.bootstrapStateContract.blueprintMode,
|
|
363
|
-
reconstructionRequired: bootstrapSurface.bootstrapStateContract.reconstructionRequired,
|
|
364
|
-
readyForAiReconstruction: bootstrapSurface.bootstrapStateContract.readyForAiReconstruction,
|
|
365
|
-
cutoverReadiness: bootstrapSurface.bootstrapStateContract.cutoverReadiness,
|
|
366
|
-
activeAuthorityRoot: bootstrapSurface.bootstrapStateContract.activeAuthorityRoot,
|
|
367
|
-
},
|
|
388
|
+
lifecycleState,
|
|
368
389
|
specTreeModel: bootstrapSurface.specTreeModel,
|
|
369
390
|
specGenerationInputs: bootstrapSurface.specGenerationInputs,
|
|
370
391
|
canonicalTree: bootstrapSurface.canonicalTree,
|
|
@@ -64,7 +64,7 @@ const DOCTOR_NEXT_STEP_TRANSLATIONS = new Map([
|
|
|
64
64
|
["Repair the failing bootstrap checks, then rerun `nimicoding doctor`.", "修复失败的 bootstrap 检查项,然后重新运行 `nimicoding doctor`。"],
|
|
65
65
|
["Use an external AI host to reconstruct the declared canonical tree under `.nimi/spec`.", "使用外部 AI host 重建声明的 `.nimi/spec` canonical tree。"],
|
|
66
66
|
["Run `nimicoding blueprint-audit --write-local` after canonical tree generation when a benchmark blueprint is declared.", "当声明了 benchmark blueprint 且 canonical tree 生成完成后,运行 `nimicoding blueprint-audit --write-local`。"],
|
|
67
|
-
["Run `nimicoding validate-spec-audit` after generating
|
|
67
|
+
["Run `nimicoding validate-spec-audit` after generating the local spec generation audit for the canonical tree.", "为 canonical tree 生成本地 spec generation audit 后,运行 `nimicoding validate-spec-audit`。"],
|
|
68
68
|
["Run `nimicoding handoff --skill doc_spec_audit` and close out the result locally when the audit is complete.", "运行 `nimicoding handoff --skill doc_spec_audit`,并在审计完成后于本地 closeout 结果。"],
|
|
69
69
|
["Keep runtime ownership delegated; do not assume local skill installation or self-hosting.", "保持 runtime ownership 为 delegated;不要假设本地 skill 安装或 self-hosting。"],
|
|
70
70
|
["If you want a constrained external execution host, select one in `.nimi/config/host-adapter.yaml`.", "如果你希望使用受约束的外部执行 host,请在 `.nimi/config/host-adapter.yaml` 中选择一个。"],
|
|
@@ -86,6 +86,7 @@ function summarizeDoctorState(result) {
|
|
|
86
86
|
const blockingChecks = result.checks.filter((check) => check.severity === "error");
|
|
87
87
|
const warningChecks = result.checks.filter((check) => check.severity === "warn");
|
|
88
88
|
const importantInfoChecks = result.checks.filter((check) => check.severity === "info").slice(0, 2);
|
|
89
|
+
const usesV2SurfaceModel = result.specGenerationInputs?.mode === "class_filtered";
|
|
89
90
|
|
|
90
91
|
const bootstrapState = !result.bootstrapPresent
|
|
91
92
|
? localize("missing", "缺失")
|
|
@@ -93,7 +94,7 @@ function summarizeDoctorState(result) {
|
|
|
93
94
|
? localize("ready", "就绪")
|
|
94
95
|
: localize("needs attention", "需要关注");
|
|
95
96
|
|
|
96
|
-
const canonicalTreeState = !result.specTreeModel?.ok
|
|
97
|
+
const canonicalTreeState = !usesV2SurfaceModel && !result.specTreeModel?.ok
|
|
97
98
|
? localize("invalid", "无效")
|
|
98
99
|
: !result.canonicalTree.requiredFilesValid
|
|
99
100
|
? localize("incomplete", "未完成")
|
package/config/bootstrap.yaml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nimiplatform/nimi-coding",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "AI-native coding governance toolkit for bootstrapping .nimi/** into arbitrary projects.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"provenance": true
|
|
23
23
|
},
|
|
24
24
|
"bin": {
|
|
25
|
-
"nimicoding": "
|
|
25
|
+
"nimicoding": "bin/nimicoding.mjs"
|
|
26
26
|
},
|
|
27
27
|
"packageManager": "pnpm@10.32.1",
|
|
28
28
|
"engines": {
|