@nimiplatform/nimi-coding 0.3.0 → 0.3.1

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1
4
+
5
+ - Made `validate-spec-governance --scope all` fail closed on the canonical spec tree before running project-configured checks.
6
+
3
7
  ## 0.3.0
4
8
 
5
9
  - Hard-cut the package to methodology, spec construction, managed projections, and deterministic validation.
@@ -1,4 +1,7 @@
1
+ import path from "node:path";
2
+
1
3
  import { localize } from "../lib/ui.mjs";
4
+ import { buildValidatorCliReport, validateSpecTree } from "../lib/validators.mjs";
2
5
  import { loadGovernanceConfig, requireProfile } from "../lib/internal/governance/config.mjs";
3
6
  import { runCommand } from "../lib/internal/governance/runner.mjs";
4
7
 
@@ -94,6 +97,23 @@ export async function runValidateSpecGovernance(args) {
94
97
  return 2;
95
98
  }
96
99
 
100
+ if (parsed.options.scope === "all") {
101
+ if (governance.config.specGovernance.canonicalRoot !== ".nimi/spec") {
102
+ process.stderr.write(localize(
103
+ "nimicoding validate-spec-governance refused: spec_governance.canonical_root must be .nimi/spec.\n",
104
+ "nimicoding validate-spec-governance 已拒绝:spec_governance.canonical_root 必须为 .nimi/spec。\n",
105
+ ));
106
+ return 2;
107
+ }
108
+ const canonicalRoot = path.resolve(process.cwd(), ".nimi/spec");
109
+ const treeReport = await validateSpecTree(canonicalRoot, { projectRoot: process.cwd() });
110
+ if (!treeReport.ok) {
111
+ const cliReport = buildValidatorCliReport("validate-spec-tree", canonicalRoot, treeReport);
112
+ process.stdout.write(`${JSON.stringify(cliReport, null, 2)}\n`);
113
+ return 1;
114
+ }
115
+ }
116
+
97
117
  let failed = false;
98
118
  for (const scope of scopeResolution.scopes) {
99
119
  const commands = governance.config.specGovernance.validateCommands[scope] || [];
package/cli/constants.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export const VERSION = "0.3.0";
1
+ export const VERSION = "0.3.1";
2
2
  export const PACKAGE_NAME = "@nimiplatform/nimi-coding";
3
3
  export const BOOTSTRAP_CONTRACT_ID = "nimicoding.bootstrap";
4
4
  export const BOOTSTRAP_CONTRACT_VERSION = 2;
@@ -1,6 +1,6 @@
1
1
  version: 2
2
2
  initialized_by: "@nimiplatform/nimi-coding"
3
- cli_version: "0.3.0"
3
+ cli_version: "0.3.1"
4
4
  bootstrap_contract: "nimicoding.bootstrap"
5
5
  bootstrap_contract_version: 2
6
6
  profile: governance
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nimiplatform/nimi-coding",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "private": false,
5
5
  "description": "AI-native methodology, spec construction, and deterministic governance validation.",
6
6
  "license": "MIT",