@planu/cli 8.2.20 → 8.3.0
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 +5 -0
- package/README.md +58 -2
- package/dist/sdd-engine/completion-snapshot.d.ts +5 -1
- package/dist/sdd-engine/completion-snapshot.js +79 -2
- package/dist/sdd-engine/contracts.d.ts +1 -0
- package/dist/sdd-engine/contracts.js +14 -0
- package/dist/sdd-engine/feature-authority.d.ts +3 -1
- package/dist/sdd-engine/feature-authority.js +33 -1
- package/dist/sdd-engine/feature-manifest.d.ts +3 -1
- package/dist/sdd-engine/feature-manifest.js +207 -19
- package/dist/sdd-engine/host-rule-pack.js +1 -0
- package/dist/sdd-engine/lock-integrity.d.ts +2 -2
- package/dist/sdd-engine/lock-integrity.js +5 -1
- package/dist/sdd-engine/task-content.d.ts +8 -1
- package/dist/sdd-engine/task-content.js +100 -3
- package/dist/sdd-engine/task-failures.d.ts +2 -0
- package/dist/sdd-engine/task-failures.js +34 -0
- package/dist/sdd-engine/task-window.d.ts +2 -4
- package/dist/sdd-engine/task-window.js +41 -78
- package/dist/sdd-engine/tools/execution-tools.js +82 -29
- package/dist/sdd-engine/verification-inputs.d.ts +12 -0
- package/dist/sdd-engine/verification-inputs.js +302 -0
- package/dist/sdd-engine/verification-receipts.d.ts +24 -0
- package/dist/sdd-engine/verification-receipts.js +265 -0
- package/dist/types/sdd-engine.d.ts +132 -0
- package/package.json +1 -1
- package/templates/AGENTS.md +1 -1
- package/templates/host/planu-sdd.md +1 -0
- package/templates/skills/spec-architect.md +1 -0
|
@@ -1,3 +1,112 @@
|
|
|
1
|
+
import type { KeyObject } from 'node:crypto';
|
|
2
|
+
import type { BigIntStats } from 'node:fs';
|
|
3
|
+
export type VerificationInputCategory = 'candidate' | 'observed';
|
|
4
|
+
export type VerificationInputReason = 'receipt_input_unavailable' | 'receipt_input_drift' | 'cancelled';
|
|
5
|
+
export interface InputRequest {
|
|
6
|
+
category: VerificationInputCategory;
|
|
7
|
+
path: string;
|
|
8
|
+
allowAbsent: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface WalkBase {
|
|
11
|
+
directories: readonly BigIntStats[];
|
|
12
|
+
absolute: string;
|
|
13
|
+
}
|
|
14
|
+
export type Walk = WalkBase & ({
|
|
15
|
+
state: 'absent';
|
|
16
|
+
} | {
|
|
17
|
+
state: 'present';
|
|
18
|
+
stat: BigIntStats;
|
|
19
|
+
});
|
|
20
|
+
export type InputCapture = {
|
|
21
|
+
request: InputRequest;
|
|
22
|
+
walk: WalkBase & {
|
|
23
|
+
state: 'absent';
|
|
24
|
+
};
|
|
25
|
+
} | {
|
|
26
|
+
request: InputRequest;
|
|
27
|
+
walk: WalkBase & {
|
|
28
|
+
state: 'present';
|
|
29
|
+
stat: BigIntStats;
|
|
30
|
+
};
|
|
31
|
+
rawSha256: string;
|
|
32
|
+
mode: number;
|
|
33
|
+
};
|
|
34
|
+
export interface WorkspaceRoot {
|
|
35
|
+
canonical: string;
|
|
36
|
+
stat: BigIntStats;
|
|
37
|
+
}
|
|
38
|
+
export interface VerificationInputSnapshot {
|
|
39
|
+
workspaceSha256: string;
|
|
40
|
+
candidateSha256: string;
|
|
41
|
+
observedSha256: string;
|
|
42
|
+
root: WorkspaceRoot;
|
|
43
|
+
workspaceRoot: string;
|
|
44
|
+
inputs: readonly InputCapture[];
|
|
45
|
+
}
|
|
46
|
+
export interface TaskBlock {
|
|
47
|
+
id: string;
|
|
48
|
+
explicitId: string | undefined;
|
|
49
|
+
legacyId: string | undefined;
|
|
50
|
+
ordinal: number;
|
|
51
|
+
lineIndex: number;
|
|
52
|
+
lines: string[];
|
|
53
|
+
}
|
|
54
|
+
export interface ReceiptSealFailure {
|
|
55
|
+
ok: false;
|
|
56
|
+
code: 'ERR_TRINITY_INCOMPLETE';
|
|
57
|
+
message: string;
|
|
58
|
+
details: {
|
|
59
|
+
reason: 'receipt_policy_invalid';
|
|
60
|
+
taskId?: string;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export type VerificationReceipt = Omit<VerificationEvidence, 'gates'> & {
|
|
64
|
+
gateId: string;
|
|
65
|
+
procedureSha256: string;
|
|
66
|
+
environmentSha256: string;
|
|
67
|
+
outcome: 'pass' | 'fail' | 'skipped' | 'partial';
|
|
68
|
+
evidenceSha256: string;
|
|
69
|
+
signature: string;
|
|
70
|
+
};
|
|
71
|
+
export interface SignedVerificationReceipt {
|
|
72
|
+
receipt: VerificationReceipt;
|
|
73
|
+
message: readonly string[];
|
|
74
|
+
signature: Buffer;
|
|
75
|
+
}
|
|
76
|
+
export type ReceiptRejectionReason = 'receipt_malformed' | 'receipt_missing' | 'receipt_duplicate' | 'receipt_unexpected' | 'receipt_invalid_signature' | 'receipt_context_mismatch' | 'receipt_candidate_mismatch' | 'receipt_observed_mismatch' | 'receipt_procedure_mismatch' | 'receipt_environment_mismatch' | 'receipt_non_pass';
|
|
77
|
+
export type ReceiptSetResult = {
|
|
78
|
+
ok: true;
|
|
79
|
+
gateCount: number;
|
|
80
|
+
receiptSetSha256: string;
|
|
81
|
+
} | {
|
|
82
|
+
ok: false;
|
|
83
|
+
reason: ReceiptRejectionReason;
|
|
84
|
+
gateId?: string;
|
|
85
|
+
};
|
|
86
|
+
export interface ReceiptTaskPolicy {
|
|
87
|
+
taskId: string;
|
|
88
|
+
gates: readonly VerificationGate[];
|
|
89
|
+
observed: readonly string[];
|
|
90
|
+
observedBaselineSha256: string;
|
|
91
|
+
command: string;
|
|
92
|
+
ordinal: number;
|
|
93
|
+
lineIndex: number;
|
|
94
|
+
}
|
|
95
|
+
export interface ReceiptCandidate {
|
|
96
|
+
path: string;
|
|
97
|
+
requiredFrom: number;
|
|
98
|
+
}
|
|
99
|
+
export type ReceiptPolicyResult = {
|
|
100
|
+
status: 'none';
|
|
101
|
+
} | {
|
|
102
|
+
status: 'invalid';
|
|
103
|
+
taskId?: string;
|
|
104
|
+
} | {
|
|
105
|
+
status: 'ready';
|
|
106
|
+
publicKey: KeyObject;
|
|
107
|
+
candidates: readonly ReceiptCandidate[];
|
|
108
|
+
tasks: ReadonlyMap<string, ReceiptTaskPolicy>;
|
|
109
|
+
};
|
|
1
110
|
export type ArtifactType = 'spec' | 'plan' | 'tasks';
|
|
2
111
|
export type FilePermission = 'CREATE' | 'MODIFY' | 'READ_ONLY' | 'DELETE';
|
|
3
112
|
export type ErrorCode = 'ERR_FEATURE_NOT_FOUND' | 'ERR_FEATURE_ALREADY_EXISTS' | 'ERR_SPEC_NOT_LOCKED' | 'ERR_SPEC_ALREADY_LOCKED' | 'ERR_SPEC_DRIFT' | 'ERR_TASK_OUT_OF_SEQUENCE' | 'ERR_TASK_NOT_FOUND' | 'ERR_FILE_OUT_OF_MANIFEST' | 'ERR_PERMISSION_VIOLATION' | 'ERR_PATCH_FAILED' | 'ERR_INVALID_ARTIFACT' | 'ERR_INVALID_SLICE' | 'ERR_WORKSPACE_UNRESOLVED' | 'ERR_TRINITY_INCOMPLETE' | 'ERR_LOCK_REASON_REQUIRED' | 'ERR_VERIFICATION_MISSING' | 'ERR_VERIFICATION_FAILED';
|
|
@@ -50,10 +159,26 @@ export interface ApplyFilePatchInput {
|
|
|
50
159
|
search_content: string;
|
|
51
160
|
replace_content: string;
|
|
52
161
|
}
|
|
162
|
+
export interface VerificationGate {
|
|
163
|
+
id: string;
|
|
164
|
+
procedureSha256: string;
|
|
165
|
+
environmentSha256: string;
|
|
166
|
+
}
|
|
167
|
+
export interface VerificationEvidence {
|
|
168
|
+
version: 1;
|
|
169
|
+
featureId: string;
|
|
170
|
+
taskId: string;
|
|
171
|
+
workspaceSha256: string;
|
|
172
|
+
lockSha256: string;
|
|
173
|
+
candidateSha256: string;
|
|
174
|
+
observedSha256: string;
|
|
175
|
+
gates: readonly VerificationGate[];
|
|
176
|
+
}
|
|
53
177
|
export interface CompleteTaskInput {
|
|
54
178
|
feature_id: string;
|
|
55
179
|
task_id: string;
|
|
56
180
|
verification_output?: string;
|
|
181
|
+
verification_receipts?: Record<string, unknown>[];
|
|
57
182
|
}
|
|
58
183
|
export interface ParsedManifest {
|
|
59
184
|
allowedFiles: Map<string, FilePermission>;
|
|
@@ -82,11 +207,17 @@ export interface ActiveTaskResult {
|
|
|
82
207
|
path: string;
|
|
83
208
|
permission: FilePermission;
|
|
84
209
|
}[];
|
|
210
|
+
verificationEvidence?: VerificationEvidence;
|
|
85
211
|
}
|
|
86
212
|
export interface CompleteTaskResult {
|
|
87
213
|
completedTaskId: string;
|
|
88
214
|
verificationSummary: string;
|
|
89
215
|
remainingTasks: number;
|
|
216
|
+
verificationEvidenceSummary?: {
|
|
217
|
+
version: 1;
|
|
218
|
+
gateCount: number;
|
|
219
|
+
receiptSetSha256: string;
|
|
220
|
+
};
|
|
90
221
|
}
|
|
91
222
|
export interface TaskParseAccumulator {
|
|
92
223
|
totalTasks: number;
|
|
@@ -147,4 +278,5 @@ export interface ResolveSddWorkspaceInput {
|
|
|
147
278
|
export interface SddWorkspaceHandle {
|
|
148
279
|
resolve(): Promise<ResolvedSddWorkspace>;
|
|
149
280
|
}
|
|
281
|
+
export {};
|
|
150
282
|
//# sourceMappingURL=sdd-engine.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planu/cli",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "Planu — MCP server for Spec Driven Development. Planning and file operations on macOS/Linux/Windows; automated verification requires macOS/Linux (POSIX).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
package/templates/AGENTS.md
CHANGED
|
@@ -5,7 +5,7 @@ Canonical contract: `PLANU_V8_MANIFESTO.txt`.
|
|
|
5
5
|
|
|
6
6
|
## First use in this project
|
|
7
7
|
|
|
8
|
-
After the local client has registered the MCP server and the intended project is open, use `sdd_list_features` to inspect setup. A setup request authorizes `sdd_init_workspace(scope="project")` in that identified project; connecting or inspecting alone does not. Use the default `force=false` to preserve an existing current AGENTS.md. Read `.agents/skills/planu-preflight-guardian/SKILL.md` and the matching role immediately with `sdd_read_file_slice` before feature work. Initialization installs nine roles in four host formats. Matching files do not prove that the host has loaded them: a host/session catalog reload may be required, separately from restarting the MCP server. Do not promise automatic compliance by every client or model.
|
|
8
|
+
After the local client has registered the MCP server and the intended project is open, use `sdd_list_features` to inspect setup. A setup request authorizes `sdd_init_workspace(scope="project")` in that identified project; connecting or inspecting alone does not. Use the default `force=false` to preserve an existing current AGENTS.md. Read `.agents/skills/planu-preflight-guardian/SKILL.md` and the matching role immediately with `sdd_read_file_slice` before feature work. Initialization installs nine roles in four host formats. Matching files do not prove that the host has loaded them: a host/session catalog reload may be required, separately from restarting the MCP server. Do not promise automatic compliance by every client or model. For tasks using the locked receipt policy, take the current challenge from sdd_get_active_task. Obtain gate evidence from the operator-controlled issuer and pass the signed receipts to sdd_complete_task. The server still runs the task integration command. A changed observed baseline requires reviewed resolution.
|
|
9
9
|
|
|
10
10
|
## Delegation
|
|
11
11
|
|
|
@@ -16,3 +16,4 @@ Delegate useful independent work within the active TASK through available native
|
|
|
16
16
|
- If a pre-push, commitlint, or husky guard still requires `planu/specs/SPEC-*/spec.md`, that guard is the defect. Delete or rewrite it. Do not stub a SPEC file.
|
|
17
17
|
- Quality lives in `.claude/skills/`, `.cursor/skills/`, `.agents/skills/`, and `.gemini/skills/`. Specs stay in `.sdd/features`. There is no validate MCP tool.
|
|
18
18
|
- Agents must never grant themselves extra verification time or edit trusted launcher policy. Report budget failures for operator review; an approved startup grant does not change task or File Manifest authority.
|
|
19
|
+
- For tasks using the locked receipt policy, take the current challenge from sdd_get_active_task. Obtain gate evidence from the operator-controlled issuer and pass the signed receipts to sdd_complete_task. The server still runs the task integration command. A changed observed baseline requires reviewed resolution.
|
|
@@ -39,6 +39,7 @@ Your objective is to specify the smallest useful increment with deterministic, u
|
|
|
39
39
|
5. **Atomic Linear Tasks in `tasks.md`:**
|
|
40
40
|
- Break the selected increment into small, atomic, verifiable steps that contribute to its observable outcome. Internal tasks may be technical; small tasks alone do not establish a usable increment.
|
|
41
41
|
- The server runs each task's Verification and advances only on exit 0. Plan a command that succeeds when that task's own work is complete, using the files/state available at that point in the sequence.
|
|
42
|
+
- A receipt-policy task uses one `Verification (receipts v1):` line instead of a legacy Verification line. Match the explicit task ID to the reviewed policy in plan.md and retain the executable integration command.
|
|
42
43
|
- Verification contains literal executable syntax only. Put expected results, RED explanations and other prose in the task description, never as annotations appended to the command.
|
|
43
44
|
- Normally capture RED and implement the fix within one task that ends with a GREEN completion command. Do not put a necessarily failing test command before a later implementation task: the server cannot certify it or reach the fix.
|
|
44
45
|
- If a separate RED-only task is necessary, specify a checker that proves the intended acceptance failure, rejects syntax/setup/infrastructure errors and itself exits 0. Never ignore the result, use unconditional success or weaken assertions to advance.
|