@planu/cli 4.10.0 → 4.10.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 +6 -0
- package/dist/engine/project-graph/query.js +16 -1
- package/dist/engine/tdd-enforcer/stub-artifact-path.d.ts +2 -0
- package/dist/engine/tdd-enforcer/stub-artifact-path.js +7 -0
- package/dist/engine/tdd-enforcer/stub-generator.js +3 -2
- package/dist/engine/tdd-enforcer/tdd-gate.js +17 -14
- package/dist/tools/generate-execution-plan.js +4 -3
- package/package.json +9 -9
- package/planu-native.json +1 -1
- package/planu-plugin.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -145,11 +145,26 @@ export async function getProjectGraphFreshnessHint(args) {
|
|
|
145
145
|
if (!policy.enabled) {
|
|
146
146
|
return undefined;
|
|
147
147
|
}
|
|
148
|
-
|
|
148
|
+
let freshness = await getProjectGraphFreshness({
|
|
149
149
|
projectId,
|
|
150
150
|
projectPath: args.projectPath,
|
|
151
151
|
policy,
|
|
152
152
|
});
|
|
153
|
+
if (!freshness.exists ||
|
|
154
|
+
freshness.reason === 'source_changed' ||
|
|
155
|
+
freshness.reason === 'corrupt') {
|
|
156
|
+
try {
|
|
157
|
+
await buildProjectKnowledgeGraph({ projectId, projectPath: args.projectPath, policy });
|
|
158
|
+
freshness = await getProjectGraphFreshness({
|
|
159
|
+
projectId,
|
|
160
|
+
projectPath: args.projectPath,
|
|
161
|
+
policy,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
// status must stay non-blocking; fall back to the stale hint below.
|
|
166
|
+
}
|
|
167
|
+
}
|
|
153
168
|
if (!freshness.stale) {
|
|
154
169
|
return undefined;
|
|
155
170
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { hashProjectPath, projectDataDir } from '../../storage/base-store.js';
|
|
3
|
+
export function resolveTddStubArtifactPath(specId, projectPath) {
|
|
4
|
+
const projectId = hashProjectPath(projectPath);
|
|
5
|
+
return join(projectDataDir(projectId), 'handoffs', specId, 'test-stubs.ts');
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=stub-artifact-path.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// SPEC-452 — Generates TDD test stubs from spec acceptance criteria
|
|
2
2
|
import { readFile, writeFile, mkdir } from 'node:fs/promises';
|
|
3
|
-
import {
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { resolveTddStubArtifactPath } from './stub-artifact-path.js';
|
|
4
5
|
const SECTION_RE = /^###\s+(.+)$/;
|
|
5
6
|
function sanitizeTestName(text) {
|
|
6
7
|
return text.replace(/[`'"]/g, '').trim();
|
|
@@ -73,7 +74,7 @@ export async function generateTestStubs(specId, projectPath) {
|
|
|
73
74
|
return { specId, stubs: [], fileContent: '', outputPath: '' };
|
|
74
75
|
}
|
|
75
76
|
const fileContent = buildStubFileContent(specId, stubs);
|
|
76
|
-
const outputPath =
|
|
77
|
+
const outputPath = resolveTddStubArtifactPath(specId, projectPath);
|
|
77
78
|
await mkdir(dirname(outputPath), { recursive: true });
|
|
78
79
|
await writeFile(outputPath, fileContent, 'utf-8');
|
|
79
80
|
return { specId, stubs, fileContent, outputPath };
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
// SPEC-452 — TDD gates for status transitions
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
+
import { resolveTddStubArtifactPath } from './stub-artifact-path.js';
|
|
4
5
|
const TDD_STUB_MARKER = "expect.fail('TDD stub";
|
|
6
|
+
async function readExternalStubContent(specId, projectPath) {
|
|
7
|
+
try {
|
|
8
|
+
return await readFile(resolveTddStubArtifactPath(specId, projectPath), 'utf-8');
|
|
9
|
+
}
|
|
10
|
+
catch (err) {
|
|
11
|
+
if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
throw err;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
5
17
|
export async function checkTddReadiness(specId, projectPath) {
|
|
6
|
-
const specDir = join(projectPath, 'planu', 'specs');
|
|
7
18
|
const { glob } = await import('glob');
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
let stubCount = 0;
|
|
12
|
-
if (hasStubs && stubMatches[0]) {
|
|
13
|
-
const content = await readFile(stubMatches[0], 'utf-8');
|
|
14
|
-
stubCount = (content.match(/it\(/g) ?? []).length;
|
|
15
|
-
}
|
|
19
|
+
const stubContent = await readExternalStubContent(specId, projectPath);
|
|
20
|
+
const hasStubs = stubContent !== null;
|
|
21
|
+
const stubCount = stubContent === null ? 0 : (stubContent.match(/it\(/g) ?? []).length;
|
|
16
22
|
// Check for test files referencing this spec
|
|
17
23
|
const testsDir = join(projectPath, 'tests');
|
|
18
24
|
const testFiles = await glob(`${testsDir}/**/*.test.ts`);
|
|
@@ -37,13 +43,10 @@ export async function checkTddReadiness(specId, projectPath) {
|
|
|
37
43
|
return { hasStubs, stubCount, hasTestFiles, recommendation };
|
|
38
44
|
}
|
|
39
45
|
export async function checkTddCompletion(specId, projectPath) {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const stubMatches = await glob(`${specDir}/${specId}-*/test-stubs.ts`);
|
|
43
|
-
if (stubMatches.length === 0 || !stubMatches[0]) {
|
|
46
|
+
const content = await readExternalStubContent(specId, projectPath);
|
|
47
|
+
if (content === null) {
|
|
44
48
|
return { unresolvedStubs: 0, totalStubs: 0, resolvedPercentage: 100, pendingCriteria: [] };
|
|
45
49
|
}
|
|
46
|
-
const content = await readFile(stubMatches[0], 'utf-8');
|
|
47
50
|
const allStubs = content.match(/it\(/g) ?? [];
|
|
48
51
|
const unresolvedMatches = content.match(new RegExp(TDD_STUB_MARKER.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g')) ?? [];
|
|
49
52
|
const totalStubs = allStubs.length;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Phase logic lives in src/engine/execution-plan/phases.ts
|
|
4
4
|
// Mobile distribution lives in src/engine/execution-plan/mobile-distribution.ts
|
|
5
5
|
// Utilities live in src/engine/execution-plan/plan-utils.ts
|
|
6
|
-
import { writeFile } from 'node:fs/promises';
|
|
6
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
7
7
|
import { dirname, join } from 'node:path';
|
|
8
8
|
import { specStore, knowledgeStore, patternStore } from '../storage/index.js';
|
|
9
9
|
import { t, ti } from '../i18n/index.js';
|
|
@@ -12,6 +12,7 @@ import { generateSetupPhase, generateDataLayerPhase, generateBusinessLogicPhase,
|
|
|
12
12
|
import { generateMobileDistributionPhase, isMobileDistributionSpec, } from '../engine/execution-plan/mobile-distribution.js';
|
|
13
13
|
import { isDesktopReleaseSpec, generateDesktopDistributionPhase, } from '../engine/execution-plan/desktop-distribution.js';
|
|
14
14
|
import { determineCriticalPath, findParallelizable, readSpecContent, } from '../engine/execution-plan/plan-utils.js';
|
|
15
|
+
import { projectDataDir } from '../storage/base-store.js';
|
|
15
16
|
export async function handleGenerateExecutionPlan(args) {
|
|
16
17
|
const { specId, projectId } = args;
|
|
17
18
|
const spec = await specStore.getSpec(projectId, specId);
|
|
@@ -38,9 +39,9 @@ export async function handleGenerateExecutionPlan(args) {
|
|
|
38
39
|
const plan = { phases, totalSteps, criticalPath, parallelizable };
|
|
39
40
|
let planPath;
|
|
40
41
|
try {
|
|
41
|
-
|
|
42
|
-
planPath = join(planDir, 'PLAN.md');
|
|
42
|
+
planPath = join(projectDataDir(projectId), 'handoffs', specId, 'execution-plan.md');
|
|
43
43
|
const planContent = generatePlanMarkdown(plan, spec);
|
|
44
|
+
await mkdir(dirname(planPath), { recursive: true });
|
|
44
45
|
await writeFile(planPath, planContent, 'utf-8');
|
|
45
46
|
await specStore.updateSpec(projectId, specId, { planPath });
|
|
46
47
|
/* v8 ignore next 3 -- defensive: filesystem write failure during plan generation */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planu/cli",
|
|
3
|
-
"version": "4.10.
|
|
3
|
+
"version": "4.10.1",
|
|
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.
|
|
38
|
-
"@planu/core-darwin-x64": "4.10.
|
|
39
|
-
"@planu/core-linux-arm64-gnu": "4.10.
|
|
40
|
-
"@planu/core-linux-arm64-musl": "4.10.
|
|
41
|
-
"@planu/core-linux-x64-gnu": "4.10.
|
|
42
|
-
"@planu/core-linux-x64-musl": "4.10.
|
|
43
|
-
"@planu/core-win32-arm64-msvc": "4.10.
|
|
44
|
-
"@planu/core-win32-x64-msvc": "4.10.
|
|
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"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=24.0.0"
|
package/planu-native.json
CHANGED
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.
|
|
5
|
+
"version": "4.10.1",
|
|
6
6
|
"icon": "assets/plugin/icon.svg",
|
|
7
7
|
"command": [
|
|
8
8
|
"npx",
|