@planu/cli 4.10.1 → 4.10.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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## [4.10.2] - 2026-07-02
2
+
3
+ ### Bug Fixes
4
+ - fix(SPEC-1105): preserve legacy spec ids during init migration
5
+
6
+
1
7
  ## [4.10.1] - 2026-07-01
2
8
 
3
9
  ### Bug Fixes
@@ -2,7 +2,7 @@
2
2
  // Detects old-format specs, extracts useful info, generates lean files, deletes obsolete files.
3
3
  import { readFile, readdir, stat } from 'node:fs/promises';
4
4
  import { atomicWriteFile } from '../safety/atomic-write-file.js';
5
- import { join } from 'node:path';
5
+ import { basename, join } from 'node:path';
6
6
  import { safeUnlink } from './git-aware-fs.js';
7
7
  import { parseFrontmatterLocal } from './frontmatter-parser.js';
8
8
  import { generateLeanSpecContent } from '../spec-format/lean-spec-generator.js';
@@ -324,6 +324,27 @@ function buildSpecFromMetadata(metadata, id, title, specStatus, estimation, spec
324
324
  impactAnalysis: null,
325
325
  };
326
326
  }
327
+ function normalizeSpecId(value) {
328
+ if (typeof value !== 'string') {
329
+ return null;
330
+ }
331
+ const trimmed = value.trim();
332
+ return /^SPEC-\d+$/.test(trimmed) ? trimmed : null;
333
+ }
334
+ function inferSpecIdFromDirectory(specDir) {
335
+ const match = /^(SPEC-\d+)(?:$|[-_])/.exec(basename(specDir));
336
+ return match?.[1] ?? null;
337
+ }
338
+ function inferSpecIdFromHeading(content) {
339
+ const match = /^#\s+(SPEC-\d+)(?:\b|[:\s—–-])/m.exec(content);
340
+ return match?.[1] ?? null;
341
+ }
342
+ function resolveSpecId(metadata, specDir, specContent) {
343
+ return (normalizeSpecId(metadata.id) ??
344
+ normalizeSpecId(metadata.spec_id) ??
345
+ inferSpecIdFromDirectory(specDir) ??
346
+ inferSpecIdFromHeading(specContent));
347
+ }
327
348
  /** Write a verified backup of a file before overwriting. Returns backup path. Throws on failure. */
328
349
  async function writeVerifiedBackup(filePath) {
329
350
  const content = await readFile(filePath, 'utf-8');
@@ -354,7 +375,10 @@ export async function migrateSpecToLean(specDir, projectPath) {
354
375
  }
355
376
  // Parse frontmatter
356
377
  const { metadata } = parseFrontmatterLocal(specContent);
357
- const id = typeof metadata.id === 'string' ? metadata.id : 'SPEC-000';
378
+ const id = resolveSpecId(metadata, specDir, specContent);
379
+ if (!id) {
380
+ return 'missing valid spec id';
381
+ }
358
382
  const title = typeof metadata.title === 'string' ? metadata.title : 'Untitled';
359
383
  const status = typeof metadata.status === 'string' ? metadata.status : 'draft';
360
384
  // Read old technical.md first (needed for estimation extraction)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planu/cli",
3
- "version": "4.10.1",
3
+ "version": "4.10.2",
4
4
  "description": "Planu — MCP Server for Spec Driven Development with native Rust acceleration for hot paths. Cross-platform (Linux/macOS/Windows, x64/arm64, glibc/musl).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,14 +34,14 @@
34
34
  "packageName": "@planu/core"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@planu/core-darwin-arm64": "4.10.1",
38
- "@planu/core-darwin-x64": "4.10.1",
39
- "@planu/core-linux-arm64-gnu": "4.10.1",
40
- "@planu/core-linux-arm64-musl": "4.10.1",
41
- "@planu/core-linux-x64-gnu": "4.10.1",
42
- "@planu/core-linux-x64-musl": "4.10.1",
43
- "@planu/core-win32-arm64-msvc": "4.10.1",
44
- "@planu/core-win32-x64-msvc": "4.10.1"
37
+ "@planu/core-darwin-arm64": "4.10.2",
38
+ "@planu/core-darwin-x64": "4.10.2",
39
+ "@planu/core-linux-arm64-gnu": "4.10.2",
40
+ "@planu/core-linux-arm64-musl": "4.10.2",
41
+ "@planu/core-linux-x64-gnu": "4.10.2",
42
+ "@planu/core-linux-x64-musl": "4.10.2",
43
+ "@planu/core-win32-arm64-msvc": "4.10.2",
44
+ "@planu/core-win32-x64-msvc": "4.10.2"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=24.0.0"
@@ -129,7 +129,7 @@
129
129
  ],
130
130
  "license": "SEE LICENSE IN LICENSE",
131
131
  "dependencies": {
132
- "@anthropic-ai/sdk": "^0.109.0",
132
+ "@anthropic-ai/sdk": "^0.110.0",
133
133
  "@modelcontextprotocol/sdk": "^1.29.0",
134
134
  "glob": "^13.0.6",
135
135
  "yaml": "^2.9.0",
@@ -177,7 +177,7 @@
177
177
  "@semantic-release/changelog": "^6.0.3",
178
178
  "@semantic-release/commit-analyzer": "^13.0.1",
179
179
  "@semantic-release/git": "^10.0.1",
180
- "@semantic-release/github": "^12.0.8",
180
+ "@semantic-release/github": "^12.0.9",
181
181
  "@semantic-release/npm": "^13.1.5",
182
182
  "@semantic-release/release-notes-generator": "^14.1.1",
183
183
  "@stryker-mutator/core": "^9.6.1",
@@ -194,7 +194,7 @@
194
194
  "happy-dom": "^20.10.6",
195
195
  "husky": "^9.1.7",
196
196
  "javascript-obfuscator": "^5.4.3",
197
- "knip": "^6.23.0",
197
+ "knip": "^6.24.0",
198
198
  "lint-staged": "^17.0.8",
199
199
  "madge": "^8.0.0",
200
200
  "prettier": "^3.9.4",
@@ -204,7 +204,7 @@
204
204
  "type-coverage": "^2.29.7",
205
205
  "typescript": "^6.0.3",
206
206
  "typescript-eslint": "^8.62.1",
207
- "vite": "^8.1.2",
207
+ "vite": "^8.1.3",
208
208
  "vitest": "^4.1.9",
209
209
  "vue": "^3.5.39"
210
210
  }
package/planu-native.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dev.planu.native",
3
3
  "displayName": "Planu Native Lightweight Surface",
4
- "version": "4.10.1",
4
+ "version": "4.10.2",
5
5
  "packageName": "@planu/cli",
6
6
  "modes": {
7
7
  "lightweight": {
package/planu-plugin.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dev.planu.cli",
3
3
  "displayName": "Planu — Spec Driven Development",
4
4
  "description": "Manage software specs, estimations, and autonomous SDD workflows. Language-agnostic MCP server for Claude Code.",
5
- "version": "4.10.1",
5
+ "version": "4.10.2",
6
6
  "icon": "assets/plugin/icon.svg",
7
7
  "command": [
8
8
  "npx",