@planu/cli 8.2.20 → 8.4.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.
Files changed (47) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +118 -3
  3. package/dist/sdd-engine/completion-snapshot.d.ts +5 -1
  4. package/dist/sdd-engine/completion-snapshot.js +79 -2
  5. package/dist/sdd-engine/contracts.d.ts +6 -3
  6. package/dist/sdd-engine/contracts.js +30 -3
  7. package/dist/sdd-engine/feature-authority.d.ts +3 -1
  8. package/dist/sdd-engine/feature-authority.js +33 -1
  9. package/dist/sdd-engine/feature-manifest.d.ts +4 -5
  10. package/dist/sdd-engine/feature-manifest.js +206 -93
  11. package/dist/sdd-engine/host-rule-pack.d.ts +5 -0
  12. package/dist/sdd-engine/host-rule-pack.js +103 -43
  13. package/dist/sdd-engine/host-skill-reader.d.ts +6 -0
  14. package/dist/sdd-engine/host-skill-reader.js +187 -0
  15. package/dist/sdd-engine/lock-integrity.d.ts +3 -2
  16. package/dist/sdd-engine/lock-integrity.js +30 -18
  17. package/dist/sdd-engine/receipt-assessment.d.ts +12 -0
  18. package/dist/sdd-engine/receipt-assessment.js +223 -0
  19. package/dist/sdd-engine/server.js +2 -4
  20. package/dist/sdd-engine/task-content.d.ts +19 -1
  21. package/dist/sdd-engine/task-content.js +128 -3
  22. package/dist/sdd-engine/task-failures.d.ts +2 -0
  23. package/dist/sdd-engine/task-failures.js +34 -0
  24. package/dist/sdd-engine/task-window.d.ts +3 -4
  25. package/dist/sdd-engine/task-window.js +49 -79
  26. package/dist/sdd-engine/tools/execution-tools.d.ts +1 -11
  27. package/dist/sdd-engine/tools/execution-tools.js +86 -57
  28. package/dist/sdd-engine/tools/workspace-tools.d.ts +1 -1
  29. package/dist/sdd-engine/tools/workspace-tools.js +17 -9
  30. package/dist/sdd-engine/tools.d.ts +2 -1
  31. package/dist/sdd-engine/tools.js +4 -2
  32. package/dist/sdd-engine/trinity-structure.d.ts +25 -0
  33. package/dist/sdd-engine/trinity-structure.js +317 -0
  34. package/dist/sdd-engine/verification-inputs.d.ts +12 -0
  35. package/dist/sdd-engine/verification-inputs.js +302 -0
  36. package/dist/sdd-engine/verification-preflight.d.ts +4 -0
  37. package/dist/sdd-engine/verification-preflight.js +271 -0
  38. package/dist/sdd-engine/verification-receipts.d.ts +16 -0
  39. package/dist/sdd-engine/verification-receipts.js +98 -0
  40. package/dist/sdd-engine/workspace-root.d.ts +1 -0
  41. package/dist/sdd-engine/workspace-root.js +1 -0
  42. package/dist/types/completion.d.ts +9 -2
  43. package/dist/types/sdd-engine.d.ts +203 -0
  44. package/package.json +1 -1
  45. package/templates/AGENTS.md +9 -1
  46. package/templates/host/planu-sdd.md +9 -0
  47. package/templates/skills/spec-architect.md +1 -0
@@ -0,0 +1,98 @@
1
+ export { maxVerificationReceipts, gateIdPattern, taskIdPattern, featureIdPattern, sha256Schema, importReceiptPublicKey, validateVerificationReceiptSet, assessVerificationReceiptSet, } from './receipt-assessment.js';
2
+ import { validateVerificationReceiptSet } from './receipt-assessment.js';
3
+ import * as path from 'node:path';
4
+ import { captureCompletionSnapshot, persistCompletionSnapshot, revalidateCompletionSnapshot, } from './completion-snapshot.js';
5
+ import { hashArtifact } from './feature-authority.js';
6
+ import { activeTaskFromContent, markReceiptTaskVerified, remainingTaskCount, } from './task-content.js';
7
+ import { completionFailure, receiptFailure, unsupportedVerificationPlatform, verificationFailed, } from './task-failures.js';
8
+ import { captureVerificationInputs, captureVerificationRoot, revalidateVerificationInputs, } from './verification-inputs.js';
9
+ export async function captureReceiptEvidence(snapshot, workspaceRoot, policy, task, root, signal) {
10
+ if (path.resolve(snapshot.featDir, '../../..') !== root.canonical) {
11
+ return completionFailure('contract_drift');
12
+ }
13
+ const inputs = await captureVerificationInputs(workspaceRoot, policy.candidates, task, signal, root);
14
+ if (inputs.observedSha256 !== task.observedBaselineSha256) {
15
+ return receiptFailure('receipt_observed_baseline_drift', {
16
+ expectedSha256: task.observedBaselineSha256,
17
+ actualSha256: inputs.observedSha256,
18
+ });
19
+ }
20
+ return {
21
+ success: true,
22
+ data: {
23
+ inputs,
24
+ evidence: {
25
+ version: 1,
26
+ featureId: path.basename(snapshot.featDir),
27
+ taskId: task.taskId,
28
+ workspaceSha256: inputs.workspaceSha256,
29
+ lockSha256: hashArtifact(snapshot.lockContent),
30
+ candidateSha256: inputs.candidateSha256,
31
+ observedSha256: inputs.observedSha256,
32
+ gates: [...task.gates].sort((left, right) => left.id < right.id ? -1 : left.id === right.id ? 0 : 1),
33
+ },
34
+ },
35
+ };
36
+ }
37
+ export async function completeReceiptTask(snapshot, workspaceRoot, policy, task, receipts, lease, signal, timeoutMs, runVerification) {
38
+ const root = await captureVerificationRoot(workspaceRoot);
39
+ const locked = await captureCompletionSnapshot(snapshot.featDir, {
40
+ writable: true,
41
+ workspaceRoot: root.canonical,
42
+ });
43
+ if (locked.digest !== snapshot.digest) {
44
+ return completionFailure('contract_drift');
45
+ }
46
+ if (signal.aborted) {
47
+ return completionFailure('cancelled');
48
+ }
49
+ if (!['darwin', 'linux'].includes(process.platform)) {
50
+ return unsupportedVerificationPlatform();
51
+ }
52
+ const captured = await captureReceiptEvidence(locked, workspaceRoot, policy, task, root, signal);
53
+ if (!captured.success) {
54
+ return captured;
55
+ }
56
+ const { evidence, inputs } = captured.data;
57
+ const verified = validateVerificationReceiptSet(receipts, evidence, policy.publicKey);
58
+ if (!verified.ok) {
59
+ return receiptFailure(verified.reason, verified.gateId ? { gateId: verified.gateId } : {});
60
+ }
61
+ const recheck = () => revalidateVerificationInputs(inputs, signal);
62
+ await recheck();
63
+ await revalidateCompletionSnapshot(locked);
64
+ const run = await runVerification({
65
+ cwd: root.canonical,
66
+ command: task.command,
67
+ timeoutMs,
68
+ signal,
69
+ });
70
+ if (!run.cleanupComplete) {
71
+ lease.retain();
72
+ }
73
+ if (!run.ok || !run.cleanupComplete) {
74
+ return verificationFailed({ ...run, output: '' });
75
+ }
76
+ await recheck();
77
+ const summary = 'Integration PASS | Receipts SHA-256 ' + verified.receiptSetSha256;
78
+ const marked = markReceiptTaskVerified(locked.tasksContent, task.lineIndex, summary);
79
+ if (marked === undefined) {
80
+ return completionFailure('contract_drift');
81
+ }
82
+ await persistCompletionSnapshot(lease, locked, marked, signal, recheck);
83
+ const remainingTasks = remainingTaskCount(activeTaskFromContent(marked, () => null));
84
+ return {
85
+ success: true,
86
+ data: {
87
+ completedTaskId: task.taskId,
88
+ verificationSummary: summary,
89
+ remainingTasks,
90
+ verificationEvidenceSummary: {
91
+ version: 1,
92
+ gateCount: verified.gateCount,
93
+ receiptSetSha256: verified.receiptSetSha256,
94
+ },
95
+ },
96
+ };
97
+ }
98
+ //# sourceMappingURL=verification-receipts.js.map
@@ -13,4 +13,5 @@ export declare function readTextInsideWorkspace(workspaceRoot: string, absoluteP
13
13
  ok: false;
14
14
  reason: 'outside' | 'missing';
15
15
  }>;
16
+ export { readTextInsideWorkspaceDetailed } from './host-skill-reader.js';
16
17
  //# sourceMappingURL=workspace-root.d.ts.map
@@ -233,4 +233,5 @@ function unique(values) {
233
233
  }
234
234
  return out;
235
235
  }
236
+ export { readTextInsideWorkspaceDetailed } from './host-skill-reader.js';
236
237
  //# sourceMappingURL=workspace-root.js.map
@@ -1,4 +1,4 @@
1
- import type { SddLockFile, ErrorCode } from './sdd-engine.js';
1
+ import type { SddLockFile, ErrorCode, TrinityIssue } from './sdd-engine.js';
2
2
  export type CompletionFailureReason = 'guard_present' | 'contract_drift' | 'cancelled' | 'persistence_uncertain';
3
3
  export interface PhysicalIdentity {
4
4
  dev: number;
@@ -58,7 +58,8 @@ export type TrinityCompleteness = {
58
58
  code: ErrorCode;
59
59
  message: string;
60
60
  details?: {
61
- missing: string[];
61
+ missing?: string[];
62
+ issues?: TrinityIssue[];
62
63
  };
63
64
  };
64
65
  export type SealResult = {
@@ -74,4 +75,10 @@ export interface PreviousLock {
74
75
  previous?: SddLockFile;
75
76
  artifact?: ArtifactCapture;
76
77
  }
78
+ export interface PreflightReadSnapshot {
79
+ feature: string;
80
+ directories: AuthorityDirectory[];
81
+ artifacts: Partial<Record<'spec.md' | 'plan.md' | 'tasks.md' | '.lock', ArtifactCapture | undefined>>;
82
+ locked?: CompletionSnapshot;
83
+ }
77
84
  //# sourceMappingURL=completion.d.ts.map
@@ -1,3 +1,161 @@
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 type TrinityRule = 'out_of_scope' | 'error_matrix' | 'bdd' | 'frozen_dependencies' | 'manifest_path' | 'checkbox_task' | 'glob_delete' | 'protected_write' | 'receipt_policy_invalid' | 'artifact_missing' | 'artifact_unreadable';
55
+ export interface TrinityIssue {
56
+ artifact: 'spec.md' | 'plan.md' | 'tasks.md';
57
+ rule: TrinityRule;
58
+ line?: number;
59
+ }
60
+ export interface ManifestEntry {
61
+ rawPath: string;
62
+ permission: FilePermission;
63
+ line: number;
64
+ }
65
+ export interface PolicySourceFrame {
66
+ path: string;
67
+ root: boolean;
68
+ kind: 'object' | 'array';
69
+ indent: number;
70
+ nextArrayIndex: number;
71
+ }
72
+ export interface ReceiptPolicyText {
73
+ locations?: ReadonlyMap<string, number>;
74
+ text: string | null | undefined;
75
+ line?: number;
76
+ }
77
+ export interface ReceiptSealFailure {
78
+ ok: false;
79
+ code: 'ERR_TRINITY_INCOMPLETE';
80
+ message: string;
81
+ details: {
82
+ reason: 'receipt_policy_invalid';
83
+ taskId?: string;
84
+ issues: TrinityIssue[];
85
+ };
86
+ }
87
+ export type VerificationReceipt = Omit<VerificationEvidence, 'gates'> & {
88
+ gateId: string;
89
+ procedureSha256: string;
90
+ environmentSha256: string;
91
+ outcome: 'pass' | 'fail' | 'skipped' | 'partial';
92
+ evidenceSha256: string;
93
+ signature: string;
94
+ };
95
+ export interface SignedVerificationReceipt {
96
+ receipt: VerificationReceipt;
97
+ message: readonly string[];
98
+ signature: Buffer;
99
+ }
100
+ 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';
101
+ export type ReceiptSetResult = {
102
+ ok: true;
103
+ gateCount: number;
104
+ receiptSetSha256: string;
105
+ } | {
106
+ ok: false;
107
+ reason: ReceiptRejectionReason;
108
+ gateId?: string;
109
+ };
110
+ export interface GateAssessment {
111
+ gateId: string;
112
+ state: 'receipt_valid' | 'receipt_missing' | 'receipt_rejected';
113
+ reason?: ReceiptRejectionReason;
114
+ }
115
+ export type PreflightBlockerReason = ReceiptRejectionReason | 'unlocked' | 'command_missing' | 'platform_unsupported' | 'receipt_input_unavailable' | 'receipt_observed_baseline_drift' | 'receipt_scoped_unsupported' | 'receipt_not_configured';
116
+ interface PreflightBlocker {
117
+ reason: PreflightBlockerReason;
118
+ }
119
+ export type PreflightAction = 'fix_inputs' | 'review_observed_drift' | 'obtain_receipts' | 'use_supported_runtime' | 'review_lock' | 'restore_verification' | 'attempt_integration' | 'none';
120
+ export interface VerificationPreflight {
121
+ version: 1;
122
+ taskId: string | null;
123
+ status: 'blocked' | 'ready_to_attempt' | 'not_applicable';
124
+ gates: GateAssessment[];
125
+ blockers: PreflightBlocker[];
126
+ integration: 'not_run';
127
+ nextAction: PreflightAction;
128
+ }
129
+ export interface ReceiptSetAssessment {
130
+ result: ReceiptSetResult;
131
+ gates: GateAssessment[];
132
+ blockers: PreflightBlocker[];
133
+ }
134
+ export interface ReceiptTaskPolicy {
135
+ taskId: string;
136
+ gates: readonly VerificationGate[];
137
+ observed: readonly string[];
138
+ observedBaselineSha256: string;
139
+ command: string;
140
+ ordinal: number;
141
+ lineIndex: number;
142
+ }
143
+ export interface ReceiptCandidate {
144
+ path: string;
145
+ requiredFrom: number;
146
+ }
147
+ export type ReceiptPolicyResult = {
148
+ status: 'none';
149
+ } | {
150
+ status: 'invalid';
151
+ taskId?: string;
152
+ issue?: TrinityIssue;
153
+ } | {
154
+ status: 'ready';
155
+ publicKey: KeyObject;
156
+ candidates: readonly ReceiptCandidate[];
157
+ tasks: ReadonlyMap<string, ReceiptTaskPolicy>;
158
+ };
1
159
  export type ArtifactType = 'spec' | 'plan' | 'tasks';
2
160
  export type FilePermission = 'CREATE' | 'MODIFY' | 'READ_ONLY' | 'DELETE';
3
161
  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 +208,26 @@ export interface ApplyFilePatchInput {
50
208
  search_content: string;
51
209
  replace_content: string;
52
210
  }
211
+ export interface VerificationGate {
212
+ id: string;
213
+ procedureSha256: string;
214
+ environmentSha256: string;
215
+ }
216
+ export interface VerificationEvidence {
217
+ version: 1;
218
+ featureId: string;
219
+ taskId: string;
220
+ workspaceSha256: string;
221
+ lockSha256: string;
222
+ candidateSha256: string;
223
+ observedSha256: string;
224
+ gates: readonly VerificationGate[];
225
+ }
53
226
  export interface CompleteTaskInput {
54
227
  feature_id: string;
55
228
  task_id: string;
56
229
  verification_output?: string;
230
+ verification_receipts?: Record<string, unknown>[];
57
231
  }
58
232
  export interface ParsedManifest {
59
233
  allowedFiles: Map<string, FilePermission>;
@@ -82,11 +256,18 @@ export interface ActiveTaskResult {
82
256
  path: string;
83
257
  permission: FilePermission;
84
258
  }[];
259
+ verificationEvidence?: VerificationEvidence;
260
+ verificationPreflight?: VerificationPreflight;
85
261
  }
86
262
  export interface CompleteTaskResult {
87
263
  completedTaskId: string;
88
264
  verificationSummary: string;
89
265
  remainingTasks: number;
266
+ verificationEvidenceSummary?: {
267
+ version: 1;
268
+ gateCount: number;
269
+ receiptSetSha256: string;
270
+ };
90
271
  }
91
272
  export interface TaskParseAccumulator {
92
273
  totalTasks: number;
@@ -147,4 +328,26 @@ export interface ResolveSddWorkspaceInput {
147
328
  export interface SddWorkspaceHandle {
148
329
  resolve(): Promise<ResolvedSddWorkspace>;
149
330
  }
331
+ export type HostSkillReadCause = 'not_found' | 'access_denied' | 'unsafe_path' | 'invalid_content' | 'over_limit' | 'unstable' | 'read_failed';
332
+ export interface HostSkillIssue {
333
+ path: string;
334
+ status: 'missing' | 'different' | 'unreadable';
335
+ cause: HostSkillReadCause | 'content_mismatch';
336
+ }
337
+ export interface HostSkillDiagnostics {
338
+ version: 1;
339
+ bundledVersion: string;
340
+ baseline: 'available' | 'unavailable';
341
+ catalog: 'unverified';
342
+ issues: HostSkillIssue[];
343
+ nextAction: 'none' | 'review_project_setup' | 'inspect_unsafe_paths' | 'inspect_installation';
344
+ }
345
+ export type HostSkillReadResult = {
346
+ ok: true;
347
+ text: string;
348
+ } | {
349
+ ok: false;
350
+ cause: HostSkillReadCause;
351
+ };
352
+ export {};
150
353
  //# sourceMappingURL=sdd-engine.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planu/cli",
3
- "version": "8.2.20",
3
+ "version": "8.4.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",
@@ -5,7 +5,15 @@ 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
+
10
+ ## Read-only diagnostics
11
+
12
+ Use `sdd_list_features.hostSkills` to identify fixed installed role paths, causes and the bundled reference version. `catalog` stays `unverified` even when files match. An unavailable baseline requires inspecting the installation; unsafe paths require inspection before authorized setup. Project setup and client catalogue reload are explicit, separate actions.
13
+
14
+ For a rejected `sdd_lock_spec`, inspect `error.details.issues` for artifact, stable rule and optional 1-based original source line. Missing or ambiguous locations omit the line. Existing rejection codes and legacy details remain authoritative; rejection writes no lock. Do not automatically relock.
15
+
16
+ Before verification, request `sdd_get_active_task` with `view="verification_preflight"` and optional `verification_receipts`. Require `verificationPreflight.version=1`; older servers may ignore the view. Inspect per-gate states, aggregate blockers and `nextAction`. `ready_to_attempt` only permits attempting integration; runtime prerequisites and integration remain unverified. Preflight runs no command, consumes no grant, writes no artifact and issues no certificate. Keep the default task read and all nine tools unchanged.
9
17
 
10
18
  ## Delegation
11
19
 
@@ -6,6 +6,14 @@ The only SDD contract is `.sdd/features/{FEAT-*}/spec.md`, `plan.md`, and `tasks
6
6
 
7
7
  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
8
 
9
+ ## Read-only diagnostics
10
+
11
+ Use `sdd_list_features.hostSkills` to identify fixed installed role paths, causes and the bundled reference version. `catalog` stays `unverified` even when files match. An unavailable baseline requires inspecting the installation; unsafe paths require inspection before authorized setup. Project setup and client catalogue reload are explicit, separate actions.
12
+
13
+ For a rejected `sdd_lock_spec`, inspect `error.details.issues` for artifact, stable rule and optional 1-based original source line. Missing or ambiguous locations omit the line. Existing rejection codes and legacy details remain authoritative; rejection writes no lock. Do not automatically relock.
14
+
15
+ Before verification, request `sdd_get_active_task` with `view="verification_preflight"` and optional `verification_receipts`. Require `verificationPreflight.version=1`; older servers may ignore the view. Inspect per-gate states, aggregate blockers and `nextAction`. `ready_to_attempt` only permits attempting integration; runtime prerequisites and integration remain unverified. Preflight runs no command, consumes no grant, writes no artifact and issues no certificate. Keep the default task read and all nine tools unchanged.
16
+
9
17
  ## Delegation
10
18
 
11
19
  Delegate useful independent work within the active TASK through available native agents; keep trivial/dependent work sequential. Load the bounded protocol from `spec-executor.md` on demand; use `spec-architect.md` for workstream routing and `verification-auditor.md` for provenance checks. The parent alone applies canonical patches and certifies. Preserve all nine tools, lock, File Manifest, limits and protected-root controls; host capabilities grant no extra authority.
@@ -16,3 +24,4 @@ Delegate useful independent work within the active TASK through available native
16
24
  - 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
25
  - Quality lives in `.claude/skills/`, `.cursor/skills/`, `.agents/skills/`, and `.gemini/skills/`. Specs stay in `.sdd/features`. There is no validate MCP tool.
18
26
  - 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.
27
+ - 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.