@planu/cli 5.7.16 → 5.7.17
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 +10 -0
- package/dist/.planu-build.json +1 -1
- package/dist/tools/package-handoff.js +30 -4
- package/dist/tools/validate.d.ts +1 -1
- package/dist/tools/validate.js +12 -7
- package/package.json +1 -1
- package/planu-plugin.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## [5.7.17] - 2026-09-04
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
- fix(handoff): degrade the handoff digest when a relative spec path has no project root (SPEC-1796)
|
|
5
|
+
- fix(validate): let a stage supply its own gate deadline so blast-radius keeps its budget (SPEC-1797)
|
|
6
|
+
- fix(handoff): resolve spec.specPath against project root before digesting
|
|
7
|
+
- fix(handoff): fold spec content into handoff job identity
|
|
8
|
+
- fix(release): give release pushes a hook-aware timeout budget (SPEC-1795)
|
|
9
|
+
|
|
10
|
+
|
|
1
11
|
## [5.7.16] - 2026-09-04
|
|
2
12
|
|
|
3
13
|
### Bug Fixes
|
package/dist/.planu-build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion":1,"commit":"
|
|
1
|
+
{"schemaVersion":1,"commit":"eaee88d4fafb9a457c4a32ace39b3666e4b30108"}
|
|
@@ -52,7 +52,9 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
52
52
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
53
53
|
});
|
|
54
54
|
import { createHash } from 'node:crypto';
|
|
55
|
-
import {
|
|
55
|
+
import { readFile } from 'node:fs/promises';
|
|
56
|
+
import { isAbsolute, resolve as resolvePath } from 'node:path';
|
|
57
|
+
import { specStore, knowledgeStore } from '../storage/index.js';
|
|
56
58
|
import { DurableJobRuntime, DurableJobNotFoundError, publicJobCursor, } from '../engine/execution/job-runtime.js';
|
|
57
59
|
import { schedulePackageHandoffJobExecution } from '../engine/execution/package-handoff-job-executor.js';
|
|
58
60
|
import { acquireLock, releaseLock } from '../engine/safety/cross-process-lock.js';
|
|
@@ -61,10 +63,33 @@ export { formatHandoff } from '../engine/handoff-format.js';
|
|
|
61
63
|
const SUBMISSION_LOCK_WAIT_MS = 5_000;
|
|
62
64
|
const SUBMISSION_LOCK_POLL_MS = 100;
|
|
63
65
|
const TERMINAL_RECOVERABLE_STATES = new Set(['failed', 'cancelled', 'dead-letter']);
|
|
64
|
-
function deriveOperationId(projectId, specId, specVersion) {
|
|
65
|
-
const digest = createHash('sha256')
|
|
66
|
+
function deriveOperationId(projectId, specId, specVersion, specContentDigest) {
|
|
67
|
+
const digest = createHash('sha256')
|
|
68
|
+
.update(`${projectId}|${specId}|${specVersion}|${specContentDigest}`)
|
|
69
|
+
.digest('hex');
|
|
66
70
|
return `handoff-${digest}`;
|
|
67
71
|
}
|
|
72
|
+
async function resolveProjectRoot(projectId, projectPath) {
|
|
73
|
+
if (projectPath) {
|
|
74
|
+
return projectPath;
|
|
75
|
+
}
|
|
76
|
+
const knowledge = await knowledgeStore.getKnowledge(projectId);
|
|
77
|
+
return knowledge?.projectPath;
|
|
78
|
+
}
|
|
79
|
+
async function digestSpecFile(projectId, projectPath, specPath) {
|
|
80
|
+
if (!specPath) {
|
|
81
|
+
return '';
|
|
82
|
+
}
|
|
83
|
+
if (isAbsolute(specPath)) {
|
|
84
|
+
return readFile(specPath).then((bytes) => createHash('sha256').update(bytes).digest('hex'), () => '');
|
|
85
|
+
}
|
|
86
|
+
const projectRoot = await resolveProjectRoot(projectId, projectPath);
|
|
87
|
+
if (!projectRoot) {
|
|
88
|
+
return '';
|
|
89
|
+
}
|
|
90
|
+
const absoluteSpecPath = resolvePath(projectRoot, specPath);
|
|
91
|
+
return readFile(absoluteSpecPath).then((bytes) => createHash('sha256').update(bytes).digest('hex'), () => '');
|
|
92
|
+
}
|
|
68
93
|
async function acquireSubmissionLock(projectId, operationId) {
|
|
69
94
|
const deadlineAt = Date.now() + SUBMISSION_LOCK_WAIT_MS;
|
|
70
95
|
while (Date.now() < deadlineAt) {
|
|
@@ -99,7 +124,8 @@ export async function handlePackageHandoff(args) {
|
|
|
99
124
|
};
|
|
100
125
|
}
|
|
101
126
|
const specVersion = spec.spec_version ?? '0.0.0';
|
|
102
|
-
const
|
|
127
|
+
const specContentDigest = await digestSpecFile(projectId, args.projectPath, spec.specPath);
|
|
128
|
+
const operationId = deriveOperationId(projectId, specId, specVersion, specContentDigest);
|
|
103
129
|
const submissionLock = await acquireSubmissionLock(projectId, operationId);
|
|
104
130
|
try {
|
|
105
131
|
const env_1 = { stack: [], error: void 0, hasError: false };
|
package/dist/tools/validate.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { ValidateInput, ToolResult, ContractSpec, ContractValidation } from
|
|
|
4
4
|
import type { ValidateWorkerProgress } from '../types/validate-worker.js';
|
|
5
5
|
export { validateContractCompliance };
|
|
6
6
|
export type { ContractSpec, ContractValidation };
|
|
7
|
-
export declare function createValidationStageRunner(onProgress?: (progress: ValidateWorkerProgress) => void): <T>(phase: string, command: string, work: () => T | Promise<T
|
|
7
|
+
export declare function createValidationStageRunner(onProgress?: (progress: ValidateWorkerProgress) => void): <T>(phase: string, command: string, work: () => T | Promise<T>, deadlineMs?: number) => Promise<T>;
|
|
8
8
|
/** Public MCP boundary: persist and acknowledge validation work without running it inline. */
|
|
9
9
|
export declare function handleValidate(args: ValidateInput): Promise<ToolResult>;
|
|
10
10
|
export declare function executeValidate(args: ValidateInput, server?: McpServer, onProgress?: (progress: ValidateWorkerProgress) => void): Promise<ToolResult>;
|
package/dist/tools/validate.js
CHANGED
|
@@ -90,16 +90,19 @@ import { createPendingValidationSubmission } from '../engine/validation/durable-
|
|
|
90
90
|
import { PROJECT_ID as CANONICAL_PROJECT_ID } from '../engine/validation/validation-receipt-codec.js';
|
|
91
91
|
import { acquireLock, releaseLock } from '../engine/safety/cross-process-lock.js';
|
|
92
92
|
import { getRuntimePolicy } from '../engine/runtime-policy.js';
|
|
93
|
+
import { PROCESS_TERMINATION_GRACE_MS, PROCESS_TREE_EXTINCTION_TIMEOUT_MS, PROCESS_CHILD_CLOSE_TIMEOUT_MS, } from '../engine/abortable-process-runner.js';
|
|
93
94
|
import { resolveValidationWorktree, ValidationWorktreeError, } from '../engine/validation/validation-worktree.js';
|
|
94
95
|
// Re-export for external use (SPEC-018)
|
|
95
96
|
export { validateContractCompliance };
|
|
96
97
|
const VALIDATION_GATE_TOTAL = 11;
|
|
97
98
|
const GATE_DEADLINE_EXEMPT_PHASES = new Set(['lint', 'compliance']);
|
|
98
|
-
|
|
99
|
+
const BLAST_RADIUS_TERMINATION_MARGIN_MS = PROCESS_TERMINATION_GRACE_MS +
|
|
100
|
+
PROCESS_TREE_EXTINCTION_TIMEOUT_MS +
|
|
101
|
+
PROCESS_CHILD_CLOSE_TIMEOUT_MS;
|
|
102
|
+
async function runWithGateDeadline(phase, command, work, deadlineMs = getRuntimePolicy().validation.perGateTimeoutMs) {
|
|
99
103
|
if (GATE_DEADLINE_EXEMPT_PHASES.has(phase)) {
|
|
100
104
|
return work();
|
|
101
105
|
}
|
|
102
|
-
const deadlineMs = getRuntimePolicy().validation.perGateTimeoutMs;
|
|
103
106
|
let timer;
|
|
104
107
|
const deadline = new Promise((_resolve, reject) => {
|
|
105
108
|
timer = setTimeout(() => {
|
|
@@ -180,7 +183,7 @@ function strictAuditsSuggestions(strictAuditsGate) {
|
|
|
180
183
|
export function createValidationStageRunner(onProgress) {
|
|
181
184
|
const startedAt = Date.now();
|
|
182
185
|
let completedGates = 0;
|
|
183
|
-
return async (phase, command, work) => {
|
|
186
|
+
return async (phase, command, work, deadlineMs) => {
|
|
184
187
|
const emit = (status) => {
|
|
185
188
|
onProgress?.({
|
|
186
189
|
phase,
|
|
@@ -194,7 +197,7 @@ export function createValidationStageRunner(onProgress) {
|
|
|
194
197
|
};
|
|
195
198
|
emit('running');
|
|
196
199
|
try {
|
|
197
|
-
const result = await runWithGateDeadline(phase, command, work);
|
|
200
|
+
const result = await runWithGateDeadline(phase, command, work, deadlineMs);
|
|
198
201
|
completedGates += 1;
|
|
199
202
|
emit('passed');
|
|
200
203
|
return result;
|
|
@@ -440,6 +443,8 @@ export async function executeValidate(args, server, onProgress) {
|
|
|
440
443
|
const auditedFiles = [...new Set(result.qualityIssues.map((i) => i.file))];
|
|
441
444
|
const codeState = await scanCodeForSpec(executionSpec, projectPath);
|
|
442
445
|
const reliabilityGate = await runStage('reliability', 'scripts/check-reliability-policies.mjs --json', () => runReliabilityGate(projectPath, codeState.affectedFiles));
|
|
446
|
+
const blastRadiusTimeoutMs = getRuntimePolicy().validation.blastRadiusTimeoutMs;
|
|
447
|
+
const integrationTimeoutMs = computeIntegrationTimeoutMs();
|
|
443
448
|
const blastRadiusGate = await runStage('blast-radius', "vitest related over the spec's affected source files", async () => {
|
|
444
449
|
const absoluteSpecPath = isAbsolute(executionSpec.specPath)
|
|
445
450
|
? executionSpec.specPath
|
|
@@ -449,11 +454,11 @@ export async function executeValidate(args, server, onProgress) {
|
|
|
449
454
|
...new Set([...collectDeclaredSpecFiles(raw), ...codeState.affectedFiles]),
|
|
450
455
|
];
|
|
451
456
|
return runBlastRadiusGate(projectPath, candidateFiles, {
|
|
452
|
-
timeoutMs:
|
|
453
|
-
integrationTimeoutMs
|
|
457
|
+
timeoutMs: blastRadiusTimeoutMs,
|
|
458
|
+
integrationTimeoutMs,
|
|
454
459
|
signal: getToolExecutionSignal(),
|
|
455
460
|
});
|
|
456
|
-
});
|
|
461
|
+
}, blastRadiusTimeoutMs + integrationTimeoutMs + BLAST_RADIUS_TERMINATION_MARGIN_MS);
|
|
457
462
|
const { conventionViolations, regressionDetected } = await runStage('conventions', 'validate project conventions', () => scanProjectConventions(projectId, projectPath));
|
|
458
463
|
const lintCheck = await runStage('lint', knowledge.lintCommand ?? 'pnpm lint', () => runLintCheck(projectPath, knowledge.lintCommand ?? null, {
|
|
459
464
|
projectId,
|
package/package.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": "5.7.
|
|
5
|
+
"version": "5.7.17",
|
|
6
6
|
"icon": "assets/plugin/icon.svg",
|
|
7
7
|
"command": ["npx", "@planu/cli@latest"],
|
|
8
8
|
"packageName": "@planu/cli",
|