@planu/cli 5.3.24 → 5.3.26
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 +15 -0
- package/README.md +1 -1
- package/dist/config/legacy-artifacts.json +26 -0
- package/dist/config/official-sdd-tools.d.ts +1 -1
- package/dist/config/official-sdd-tools.js +1 -0
- package/dist/config/registries/hosts/codex.json +2 -1
- package/dist/engine/planu-core.darwin-arm64.node.manifest.json +7 -7
- package/dist/engine/planu-core.darwin-arm64.node.sbom.json +4 -4
- package/dist/engine/planu-core.darwin-x64.node.manifest.json +7 -7
- package/dist/engine/planu-core.darwin-x64.node.sbom.json +4 -4
- package/dist/engine/planu-core.linux-arm64-gnu.node.manifest.json +7 -7
- package/dist/engine/planu-core.linux-arm64-gnu.node.sbom.json +4 -4
- package/dist/engine/planu-core.linux-arm64-musl.node.manifest.json +7 -7
- package/dist/engine/planu-core.linux-arm64-musl.node.sbom.json +4 -4
- package/dist/engine/planu-core.linux-x64-gnu.node.manifest.json +7 -7
- package/dist/engine/planu-core.linux-x64-gnu.node.sbom.json +4 -4
- package/dist/engine/planu-core.linux-x64-musl.node.manifest.json +7 -7
- package/dist/engine/planu-core.linux-x64-musl.node.sbom.json +4 -4
- package/dist/engine/planu-core.win32-arm64-msvc.node.manifest.json +7 -7
- package/dist/engine/planu-core.win32-arm64-msvc.node.sbom.json +4 -4
- package/dist/engine/planu-core.win32-x64-msvc.node.manifest.json +7 -7
- package/dist/engine/planu-core.win32-x64-msvc.node.sbom.json +4 -4
- package/dist/engine/safety/assert-within-project.d.ts +2 -0
- package/dist/engine/safety/assert-within-project.js +14 -0
- package/dist/engine/scope-boundaries/contradiction-checker.js +9 -3
- package/dist/engine/spec-format/read-technical-section.js +3 -2
- package/dist/engine/spec-format/unified-spec-builder.js +27 -0
- package/dist/engine/spec-migrator/index.d.ts +0 -1
- package/dist/engine/spec-migrator/index.js +0 -1
- package/dist/engine/spec-migrator/legacy-classifier.d.ts +4 -0
- package/dist/engine/spec-migrator/legacy-classifier.js +70 -0
- package/dist/engine/spec-migrator/planu-canonical-policy.js +14 -9
- package/dist/engine/spec-migrator/strict-planu-cleanup.d.ts +4 -2
- package/dist/engine/spec-migrator/strict-planu-cleanup.js +64 -53
- package/dist/storage/spec-store.js +6 -0
- package/dist/tools/export-spec.js +18 -15
- package/dist/tools/heal-spec-docs.js +15 -12
- package/dist/tools/init-project/git-setup.js +44 -40
- package/dist/tools/init-project/handler.js +2 -1
- package/dist/tools/init-project/migration-runner.d.ts +2 -1
- package/dist/tools/init-project/migration-runner.js +18 -5
- package/dist/tools/init-project/result-builder.js +9 -0
- package/dist/tools/list-specs.js +39 -0
- package/dist/tools/migrate-legacy-spec.d.ts +10 -0
- package/dist/tools/migrate-legacy-spec.js +133 -0
- package/dist/tools/register-spec-tools/analysis-tools.js +2 -0
- package/dist/tools/schema-generator-handler.js +3 -0
- package/dist/tools/schemas/output-schemas.d.ts +28 -0
- package/dist/tools/schemas/output-schemas.js +13 -0
- package/dist/tools/spec-export-handler.js +21 -8
- package/dist/tools/storage-bundle-handler.js +35 -4
- package/dist/types/project/planu-config.d.ts +3 -0
- package/dist/types/spec/core.d.ts +0 -7
- package/dist/types/spec-format.d.ts +17 -0
- package/package.json +9 -9
- package/planu-native.json +1 -1
- package/planu-plugin.json +3 -2
- package/dist/engine/spec-migrator/unified-migration.d.ts +0 -18
- package/dist/engine/spec-migrator/unified-migration.js +0 -105
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": "5.3.
|
|
5
|
+
"version": "5.3.26",
|
|
6
6
|
"icon": "assets/plugin/icon.svg",
|
|
7
7
|
"command": ["npx", "@planu/cli@latest"],
|
|
8
8
|
"packageName": "@planu/cli",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"resolve_feedback",
|
|
37
37
|
"sync_feedback",
|
|
38
38
|
"feedback_status",
|
|
39
|
-
"bump_spec_version"
|
|
39
|
+
"bump_spec_version",
|
|
40
|
+
"migrate_legacy_spec"
|
|
40
41
|
],
|
|
41
42
|
"resources": ["planu://specs/list", "planu://specs/{id}", "planu://project/status", "planu://roadmap"],
|
|
42
43
|
"prompts": ["create-spec-from-idea", "review-spec-readiness", "generate-implementation-plan"],
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { UnifiedMigrationResult } from '../../types/index.js';
|
|
2
|
-
export type { UnifiedMigrationResult };
|
|
3
|
-
/**
|
|
4
|
-
* Merge technical.md into spec.md under a `## Technical` section, then delete technical.md.
|
|
5
|
-
* Idempotent: skips if spec.md already contains `## Technical`.
|
|
6
|
-
*
|
|
7
|
-
* @param specDir Absolute path to the spec directory.
|
|
8
|
-
* @param projectPath Project root used for `safeUnlink` (git-aware deletion). Optional:
|
|
9
|
-
* when omitted, falls back to plain unlink.
|
|
10
|
-
*/
|
|
11
|
-
export declare function migrateToUnified(specDir: string, projectPath?: string): Promise<UnifiedMigrationResult>;
|
|
12
|
-
/** Migrate all SPEC-* dirs under projectPath to unified format. Best-effort: never throws. */
|
|
13
|
-
export declare function migrateAllSpecsToUnified(projectPath: string): Promise<{
|
|
14
|
-
mergedCount: number;
|
|
15
|
-
skippedCount: number;
|
|
16
|
-
errors: string[];
|
|
17
|
-
}>;
|
|
18
|
-
//# sourceMappingURL=unified-migration.d.ts.map
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// engine/spec-migrator/unified-migration.ts — Merge technical.md into spec.md (SPEC-630)
|
|
2
|
-
import { readFile } from 'node:fs/promises';
|
|
3
|
-
import { atomicWriteFile } from '../safety/atomic-write-file.js';
|
|
4
|
-
/** Write a verified backup of a file before overwriting. Returns backup path. Throws on failure. */
|
|
5
|
-
async function writeVerifiedBackup(filePath) {
|
|
6
|
-
const content = await readFile(filePath, 'utf-8');
|
|
7
|
-
const bkPath = `${filePath}.bak.${Date.now()}`;
|
|
8
|
-
await atomicWriteFile(bkPath, content);
|
|
9
|
-
const verify = await readFile(bkPath, 'utf-8');
|
|
10
|
-
if (verify !== content) {
|
|
11
|
-
throw new Error(`backup verify failed for ${filePath}: content mismatch`);
|
|
12
|
-
}
|
|
13
|
-
return bkPath;
|
|
14
|
-
}
|
|
15
|
-
import { join } from 'node:path';
|
|
16
|
-
import { safeUnlink } from './git-aware-fs.js';
|
|
17
|
-
/**
|
|
18
|
-
* Merge technical.md into spec.md under a `## Technical` section, then delete technical.md.
|
|
19
|
-
* Idempotent: skips if spec.md already contains `## Technical`.
|
|
20
|
-
*
|
|
21
|
-
* @param specDir Absolute path to the spec directory.
|
|
22
|
-
* @param projectPath Project root used for `safeUnlink` (git-aware deletion). Optional:
|
|
23
|
-
* when omitted, falls back to plain unlink.
|
|
24
|
-
*/
|
|
25
|
-
export async function migrateToUnified(specDir, projectPath) {
|
|
26
|
-
const specPath = join(specDir, 'spec.md');
|
|
27
|
-
const techPath = join(specDir, 'technical.md');
|
|
28
|
-
try {
|
|
29
|
-
const specContent = await readFile(specPath, 'utf-8');
|
|
30
|
-
if (/\n## Technical(\n|$)/.test(specContent)) {
|
|
31
|
-
try {
|
|
32
|
-
await readFile(techPath, 'utf-8');
|
|
33
|
-
if (projectPath) {
|
|
34
|
-
await safeUnlink(projectPath, techPath);
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
const { unlink } = await import('node:fs/promises');
|
|
38
|
-
await unlink(techPath);
|
|
39
|
-
}
|
|
40
|
-
return { specDir, merged: true, reason: 'already-unified' };
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
/* no residual technical.md */
|
|
44
|
-
}
|
|
45
|
-
return { specDir, merged: false, reason: 'already-unified' };
|
|
46
|
-
}
|
|
47
|
-
let techContent;
|
|
48
|
-
try {
|
|
49
|
-
techContent = await readFile(techPath, 'utf-8');
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
return { specDir, merged: false, reason: 'no-technical-md' };
|
|
53
|
-
}
|
|
54
|
-
// Strip YAML frontmatter block from technical.md before appending
|
|
55
|
-
const techBody = techContent.replace(/^---\n[\s\S]*?\n---\n/, '').trim();
|
|
56
|
-
const unified = `${specContent.trimEnd()}\n\n## Technical\n\n${techBody}\n`;
|
|
57
|
-
// SPEC-771: backup spec.md before overwriting (verified write-back)
|
|
58
|
-
try {
|
|
59
|
-
await writeVerifiedBackup(specPath);
|
|
60
|
-
}
|
|
61
|
-
catch (backupErr) {
|
|
62
|
-
return {
|
|
63
|
-
specDir,
|
|
64
|
-
merged: false,
|
|
65
|
-
reason: 'error',
|
|
66
|
-
error: `backup failed: ${String(backupErr)}`,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
// Write spec.md first, delete technical.md second — never leave both inconsistent
|
|
70
|
-
await atomicWriteFile(specPath, unified);
|
|
71
|
-
if (projectPath) {
|
|
72
|
-
await safeUnlink(projectPath, techPath);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
const { unlink } = await import('node:fs/promises');
|
|
76
|
-
await unlink(techPath);
|
|
77
|
-
}
|
|
78
|
-
return { specDir, merged: true, reason: 'ok' };
|
|
79
|
-
}
|
|
80
|
-
catch (err) {
|
|
81
|
-
return { specDir, merged: false, reason: 'error', error: String(err) };
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/** Migrate all SPEC-* dirs under projectPath to unified format. Best-effort: never throws. */
|
|
85
|
-
export async function migrateAllSpecsToUnified(projectPath) {
|
|
86
|
-
const { glob } = await import('glob');
|
|
87
|
-
const dirs = await glob(join(projectPath, 'planu/specs/SPEC-*'));
|
|
88
|
-
let mergedCount = 0;
|
|
89
|
-
let skippedCount = 0;
|
|
90
|
-
const errors = [];
|
|
91
|
-
for (const dir of dirs) {
|
|
92
|
-
const r = await migrateToUnified(dir, projectPath);
|
|
93
|
-
if (r.merged) {
|
|
94
|
-
mergedCount++;
|
|
95
|
-
}
|
|
96
|
-
else if (!r.error) {
|
|
97
|
-
skippedCount++;
|
|
98
|
-
}
|
|
99
|
-
if (r.error) {
|
|
100
|
-
errors.push(`${dir}: ${r.error}`);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return { mergedCount, skippedCount, errors };
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=unified-migration.js.map
|