@planu/cli 8.4.0 → 8.5.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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## [8.5.1] - 2026-11-07
2
+
3
+ - Refresh the reviewed development tooling and advisory resolutions while preserving the Node floor, TypeScript compiler/library aliases, nine tools and finite package contract.
4
+ - Pin pnpm 12.18.0 and reject implicit installations before scripts or exec commands; require an explicit frozen installation.
5
+ - Check stable freshness before the existing pre-push gates and use changed-declaration advisory checks at pre-commit, with one bounded query window and owned process cleanup.
6
+ - Keep Node types on the stable 22.x branch, preserve alias registry identities and fail closed when evidence is unavailable. Repository overrides do not become downstream consumer policy.
7
+
8
+ ## [8.5.0] - 2026-11-07
9
+
10
+ - Add the explicit `resume` checkpoint and `relock_history` views to `sdd_get_active_task`, preserving the ordinary task and preflight responses and all nine tools.
11
+ - Bound each handler-produced compact text to 8,192 UTF-8 bytes. Resume identifies the captured task, progress, current evidence and pending integration; history exposes at most eight descending references per page tied to the captured lock.
12
+ - Preserve original history and receipt inputs. Read-only evidence is not certification: neither view runs verification, writes artifacts, acquires a lease or changes locked authority or budgets.
13
+ - Synchronize package, host guidance and EN/ES/PT website facts for compact resumption.
14
+
1
15
  ## [8.4.0] - 2026-11-07
2
16
 
3
17
  - Diagnose installed host roles through `sdd_list_features`: fixed paths, concrete causes, bundled reference version and safe next action. The host catalogue remains unverified.
package/README.md CHANGED
@@ -138,14 +138,14 @@ The reviewed operator procedure is in the repository guide `docs/verification-bu
138
138
 
139
139
  ## Read-only diagnostics
140
140
 
141
- The existing nine tools expose additive diagnostics in 8.4.0; an ordinary `sdd_get_active_task` request keeps its previous response shape.
141
+ The existing nine tools expose additive diagnostics since 8.4.0; 8.5.0 adds compact resume and history views. An ordinary `sdd_get_active_task` request keeps its previous response shape.
142
142
 
143
143
  `sdd_list_features` includes `hostSkills`. For example, a missing installed role can produce this field (other installed files match the available bundled reference):
144
144
 
145
145
  ```json
146
146
  {
147
147
  "version": 1,
148
- "bundledVersion": "8.4.0",
148
+ "bundledVersion": "8.5.1",
149
149
  "baseline": "available",
150
150
  "catalog": "unverified",
151
151
  "issues": [{
@@ -177,7 +177,7 @@ Request preflight explicitly through `sdd_get_active_task`:
177
177
  {"feature_id":"FEAT-EXAMPLE","view":"verification_preflight"}
178
178
  ```
179
179
 
180
- Optionally supply `verification_receipts` with the signed receipt array described below. Receipts require this view. For an opted-in task with one required gate named `contents`, no supplied receipts and otherwise available inputs, `data.verificationPreflight` is:
180
+ Optionally supply `verification_receipts` with the signed receipt array described below. Receipts require an explicit `verification_preflight` or `resume` view. For an opted-in task with one required gate named `contents`, no supplied receipts and otherwise available inputs, `data.verificationPreflight` is:
181
181
 
182
182
  ```json
183
183
  {
@@ -195,6 +195,31 @@ Check `version: 1` on the requested response: an older server may ignore optiona
195
195
 
196
196
  `ready_to_attempt` with `attempt_integration` means these read-only checks passed for the current candidate. Runtime prerequisites, write access and integration remain unverified. `not_applicable` means a locked feature has no active task. Preflight runs no command, consumes no grant, writes no artifact and issues no certificate; setup, relock and completion remain explicit actions.
197
197
 
198
+ ### Resume a task from one compact checkpoint
199
+
200
+ ```json
201
+ {"feature_id":"FEAT-EXAMPLE","view":"resume"}
202
+ ```
203
+
204
+ Require `data.resume.version=1`: older servers may ignore the requested view. The checkpoint identifies task and progress, captured contract hashes, candidate and observed-input digests when available, per-gate evidence, blockers, pending integration and a safe next action. Read the ordinary active task next to obtain its authorized body and File Manifest. Optional `verification_receipts` are checked against that captured candidate; observed receipts are not certification. Missing evidence is pending and does not prove a verifier never ran. `candidate:null` does not establish successful checks. Integration remains `pending` for an active task; the compact read never certifies it.
205
+
206
+ `history_cursor` is accepted only with `view="relock_history"`. If `history` is null, follow `nextAction` without requesting history. If `history.firstCursor` is null, there are no records; do not request history. Otherwise use the checkpoint's `history.firstCursor` as `history_cursor` with `view="relock_history"`, then follow `data.relockHistory.nextCursor` until null. Require `data.relockHistory.version=1`. Pages contain at most eight records in descending zero-based storage-index order. A stale cursor requires rereading the checkpoint; never silently continue with a different lock. Empty history has no cursor. Resume references the history without loading reasons or the full task; malformed selected history fails without a partial page.
207
+
208
+ Every handler-produced compact result, including controlled failures, contains exactly one `content[0].text` of at most 8,192 UTF-8 bytes and no `structuredContent` or auxiliary content. SDK/JSON-RPC validation before handler dispatch is a separate boundary. Neither compact view executes verification, consumes a grant, writes an artifact, acquires a lease or issues a certificate. Guard presence never proves an owner stopped. Locks, File Manifest authority, receipt inputs, stored history and verification budgets remain unchanged.
209
+
210
+ For an authorized reader holding the original `.lock` bytes, the exact digest calculations are:
211
+
212
+ ```js
213
+ import { createHash } from 'node:crypto';
214
+ const sha256 = (value) => createHash('sha256').update(value).digest('hex');
215
+ const lockSha256 = sha256(rawLockBytes);
216
+ const record = JSON.parse(rawLockBytes.toString('utf8')).relockHistory[index];
217
+ const recordSha256 = sha256(Buffer.from(JSON.stringify(record), 'utf8'));
218
+ const reasonSha256 = sha256(Buffer.from(record.reason, 'utf8'));
219
+ ```
220
+
221
+ `recordSha256` hashes the complete parsed record, including extra fields. ECMAScript JSON parse/stringify normalization applies: numeric-key ordering, normalized numbers and escapes, and last duplicate key wins. Raw byte identity belongs to `lockSha256`. Node UTF-8 encoding replaces lone UTF-16 surrogates with U+FFFD, so `reasonSha256` is not a unique UTF-16-string identity; record and raw-lock hashes retain their separate correspondence. Hashes reference stored bytes, not the author or provenance of historical actions. Original reasons and records remain in the lock.
222
+
198
223
  ## Reusable verification receipts
199
224
 
200
225
  Opt in by adding a level-two `Verification Receipts v1` heading to the locked plan, followed by a single JSON fence with the policy formatted using `JSON.stringify(policy, null, 2)`. It contains:
@@ -298,14 +323,26 @@ src/
298
323
 
299
324
  ## Development
300
325
 
326
+ Use the exact `packageManager` pin in package.json (pnpm 12.18.0) and Node 24.22.1 for repository verification. The public runtime floor remains Node >=22.13.0. Install explicitly before running a project command:
327
+
301
328
  ```bash
302
- pnpm install
329
+ pnpm install --frozen-lockfile
303
330
  pnpm build
304
331
  pnpm typecheck
305
332
  pnpm lint
306
333
  pnpm test tests/sdd-engine
334
+ pnpm check:deps:fresh
335
+ pnpm validate
307
336
  ```
308
337
 
338
+ `verifyDepsBeforeRun: error` makes `pnpm run`, shorthand scripts and `pnpm exec` reject missing or stale installations instead of installing implicitly. After an authorized declaration or lock change, reconcile the reviewed files and run the explicit frozen installation; do not bypass the policy or substitute the TypeScript 6 library for the TypeScript 7 build compiler.
339
+
340
+ For an agent maintenance loop, read the active locked task, make only its manifest-authorized changes, run its exact verification command, review the evidence and let the parent certify. Before pushing, the existing hook runs freshness once before all quality gates. Pre-commit inspects only changed dependency declarations and their attributable direct-root advisories; it performs no installation.
341
+
342
+ `pnpm check:deps:fresh` exits 0 for complete current evidence, 1 for stable direct dependency drift, or 3 when registry, installed-state, process or metadata evidence is unavailable. It compares installed versions with published stable latest, including exact pins and npm aliases. Only the declared `@types/node` branch stays on the greatest stable 22.x version; a global newer major does not replace that branch, while a new 22.x patch is drift. Keep release-age settings unchanged and retain unavailable evidence instead of treating it as current.
343
+
344
+ Workspace overrides protect this repository's resolved graph. They are not shipped as dependency policy for downstream consumers of `@planu/cli`; consumers must review their own installed graph and advisories.
345
+
309
346
  MCP:
310
347
 
311
348
  ```bash
@@ -329,7 +366,7 @@ See the [Planu Proprietary Free-Use License](LICENSE) and [planu.dev/license](ht
329
366
  "mcpServers": {
330
367
  "planu": {
331
368
  "command": "npx",
332
- "args": ["-y", "@planu/cli@8.4.0"],
369
+ "args": ["-y", "@planu/cli@8.5.1"],
333
370
  "cwd": ".",
334
371
  "env": {
335
372
  "PLANU_WORKSPACE": "."
@@ -74,8 +74,16 @@ export declare const ApplyFilePatchInputSchema: z.ZodObject<{
74
74
  }, z.core.$strip>;
75
75
  export declare const GetActiveTaskInputSchema: z.ZodObject<{
76
76
  feature_id: z.ZodString;
77
- view: z.ZodOptional<z.ZodLiteral<"verification_preflight">>;
77
+ view: z.ZodOptional<z.ZodEnum<{
78
+ relock_history: "relock_history";
79
+ resume: "resume";
80
+ verification_preflight: "verification_preflight";
81
+ }>>;
78
82
  verification_receipts: z.ZodOptional<z.ZodArray<z.ZodPreprocess<z.ZodObject<{}, z.core.$loose>, unknown>>>;
83
+ history_cursor: z.ZodOptional<z.ZodPreprocess<z.ZodObject<{
84
+ snapshotSha256: z.ZodString;
85
+ startIndex: z.ZodNumber;
86
+ }, z.core.$strip>, unknown>>;
79
87
  }, z.core.$strip>;
80
88
  export declare const CompleteTaskInputSchema: z.ZodObject<{
81
89
  feature_id: z.ZodString;
@@ -69,14 +69,39 @@ const VerificationReceiptsInputSchema = z
69
69
  .min(1, { error: 'Invalid verification receipt array length.' })
70
70
  .max(32, { error: 'Invalid verification receipt array length.' })
71
71
  .optional();
72
+ const HistoryCursorShape = z.strictObject({
73
+ snapshotSha256: z.string().regex(/^[a-f0-9]{64}$/u),
74
+ startIndex: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
75
+ });
76
+ // Sanitize before SDK validation can echo arbitrary unknown cursor keys.
77
+ const HistoryCursorInputSchema = z.preprocess((input) => {
78
+ const parsed = HistoryCursorShape.safeParse(input);
79
+ return parsed.success ? parsed.data : { snapshotSha256: '0'.repeat(64), startIndex: -1 };
80
+ }, z.object({
81
+ snapshotSha256: z.string().regex(/^[a-f0-9]{64}$/u),
82
+ startIndex: z.number().int().min(-1).max(Number.MAX_SAFE_INTEGER),
83
+ }));
72
84
  export const GetActiveTaskInputSchema = z
73
85
  .object({
74
86
  feature_id: FeatureIdSchema,
75
- view: z.literal('verification_preflight', { error: 'Invalid active task view.' }).optional(),
87
+ view: z
88
+ .enum(['verification_preflight', 'resume', 'relock_history'], {
89
+ error: 'Invalid active task view.',
90
+ })
91
+ .optional(),
76
92
  verification_receipts: VerificationReceiptsInputSchema,
93
+ history_cursor: HistoryCursorInputSchema.optional(),
77
94
  })
78
95
  .superRefine((input, context) => {
79
- if (input.verification_receipts !== undefined && input.view !== 'verification_preflight') {
96
+ if (input.history_cursor !== undefined && input.view !== 'relock_history') {
97
+ context.addIssue({
98
+ code: 'custom',
99
+ message: 'History cursor requires the history view.',
100
+ path: ['history_cursor'],
101
+ });
102
+ }
103
+ if (input.verification_receipts !== undefined &&
104
+ !['verification_preflight', 'resume'].includes(input.view ?? '')) {
80
105
  context.addIssue({
81
106
  code: 'custom',
82
107
  message: 'Verification receipts require the verification_preflight view.',
@@ -20,6 +20,10 @@ For a rejected \`sdd_lock_spec\`, inspect \`error.details.issues\` for artifact,
20
20
 
21
21
  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.
22
22
 
23
+ To resume, request \`sdd_get_active_task\` with \`view="resume"\` and optional \`verification_receipts\`; require \`data.resume.version=1\` before using its task, progress, candidate, observed-input digests, gates, pending integration and \`nextAction\`. Then use the ordinary active-task read for its authorized body and File Manifest. Unsupplied evidence is pending; observed receipts are not certification. Neither compact view runs verification, writes artifacts or grants permission.
24
+
25
+ If \`history\` is null, follow \`nextAction\` without requesting history. If \`history.firstCursor\` is null, there are no records; do not request history. Otherwise use \`view="relock_history"\` with the checkpoint's \`history.firstCursor\` as \`history_cursor\`, then each \`nextCursor\`, to read at most eight descending records per page. \`history_cursor\` is accepted only with \`view="relock_history"\`. Stop when \`nextCursor\` is null. Require \`data.relockHistory.version=1\`; stale cursors require rereading the checkpoint. Each handler-produced compact result has exactly one text block of at most 8,192 UTF-8 bytes, without \`structuredContent\`; SDK validation before dispatch is a separate boundary. History digests reference the original unmodified lock; they do not attest historical actions. Preserve guards, locked authority and verification budgets.
26
+
23
27
  ## Delegation
24
28
 
25
29
  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.
@@ -0,0 +1,6 @@
1
+ import type { RelockHistoryPage } from '../types/resume-views.js';
2
+ import type { RelockHistoryCursor, SddResult } from '../types/sdd-engine.js';
3
+ export declare function getRelockHistory(tasksPath: string, workspaceRoot: string, cursor?: RelockHistoryCursor, signal?: AbortSignal): Promise<SddResult<{
4
+ relockHistory: RelockHistoryPage;
5
+ }>>;
6
+ //# sourceMappingURL=resume-history.d.ts.map
@@ -0,0 +1,117 @@
1
+ import * as path from 'node:path';
2
+ import { CompletionGuardError, hashArtifact } from './feature-authority.js';
3
+ import { captureVerificationRoot } from './verification-inputs.js';
4
+ import { assertGuardAbsent, captureReadSnapshot, revalidateReadSnapshot, } from './verification-preflight.js';
5
+ import { compactFailure, compactReadError } from './tools/compact-result.js';
6
+ const hashPattern = /^[a-f0-9]{64}$/u;
7
+ class InvalidHistoryError extends Error {
8
+ }
9
+ function historyRecords(lockContent) {
10
+ const raw = JSON.parse(lockContent);
11
+ const history = raw.relockHistory;
12
+ if (history !== undefined && !Array.isArray(history)) {
13
+ throw new InvalidHistoryError();
14
+ }
15
+ return Array.isArray(history) ? history : [];
16
+ }
17
+ function validTimestamp(value) {
18
+ return (typeof value === 'string' &&
19
+ value.length <= 27 &&
20
+ Number.isFinite(Date.parse(value)) &&
21
+ new Date(value).toISOString() === value);
22
+ }
23
+ function cursorFailure(cursor, count, digest) {
24
+ if (!cursor) {
25
+ return undefined;
26
+ }
27
+ if (!Number.isSafeInteger(cursor.startIndex) ||
28
+ cursor.startIndex < 0 ||
29
+ !hashPattern.test(cursor.snapshotSha256) ||
30
+ count === 0) {
31
+ return compactFailure('history_cursor_invalid', 'ERR_INVALID_SLICE');
32
+ }
33
+ if (cursor.snapshotSha256 !== digest) {
34
+ return compactFailure('history_cursor_stale', 'ERR_INVALID_SLICE');
35
+ }
36
+ return cursor.startIndex >= count
37
+ ? compactFailure('history_cursor_invalid', 'ERR_INVALID_SLICE')
38
+ : undefined;
39
+ }
40
+ function projectRecord(record, index) {
41
+ if (typeof record !== 'object' || record === null || Array.isArray(record)) {
42
+ throw new InvalidHistoryError();
43
+ }
44
+ const fields = record;
45
+ const { lockedAt, specHash, planHash, tasksHash, reason } = fields;
46
+ if (!validTimestamp(lockedAt) ||
47
+ typeof specHash !== 'string' ||
48
+ !hashPattern.test(specHash) ||
49
+ typeof planHash !== 'string' ||
50
+ !hashPattern.test(planHash) ||
51
+ (tasksHash !== undefined && (typeof tasksHash !== 'string' || !hashPattern.test(tasksHash))) ||
52
+ typeof reason !== 'string') {
53
+ throw new InvalidHistoryError();
54
+ }
55
+ return {
56
+ index,
57
+ lockedAt,
58
+ specHash,
59
+ planHash,
60
+ ...(typeof tasksHash === 'string' ? { tasksHash } : {}),
61
+ // Complete parsed record: ECMAScript JSON normalization, including extra fields.
62
+ recordSha256: hashArtifact(JSON.stringify(record)),
63
+ // Node UTF-8 encoding intentionally normalizes lone surrogates to U+FFFD.
64
+ reasonSha256: hashArtifact(reason),
65
+ };
66
+ }
67
+ function selectPage(history, startIndex) {
68
+ const records = [];
69
+ for (let index = startIndex; index >= Math.max(0, startIndex - 7); index--) {
70
+ records.push(projectRecord(history[index], index));
71
+ }
72
+ return records;
73
+ }
74
+ function assertReadActive(signal) {
75
+ if (signal?.aborted) {
76
+ throw new CompletionGuardError('cancelled', 'Compact read was cancelled.');
77
+ }
78
+ }
79
+ export async function getRelockHistory(tasksPath, workspaceRoot, cursor, signal) {
80
+ try {
81
+ assertReadActive(signal);
82
+ const root = await captureVerificationRoot(workspaceRoot);
83
+ const snapshot = await captureReadSnapshot(path.dirname(tasksPath), root);
84
+ await assertGuardAbsent(snapshot.feature);
85
+ if (!snapshot.locked) {
86
+ await revalidateReadSnapshot(snapshot, root, workspaceRoot);
87
+ assertReadActive(signal);
88
+ return compactFailure('unlocked', 'ERR_SPEC_NOT_LOCKED');
89
+ }
90
+ const locked = snapshot.locked;
91
+ const history = historyRecords(locked.lockContent);
92
+ const startIndex = cursor?.startIndex ?? history.length - 1;
93
+ const invalid = cursorFailure(cursor, history.length, locked.digest);
94
+ if (invalid) {
95
+ return invalid;
96
+ }
97
+ const records = history.length ? selectPage(history, startIndex) : [];
98
+ const relockHistory = {
99
+ version: 1,
100
+ featureId: path.basename(snapshot.feature),
101
+ lockSha256: hashArtifact(locked.lockContent),
102
+ count: history.length,
103
+ records,
104
+ nextCursor: startIndex >= 8 ? { snapshotSha256: locked.digest, startIndex: startIndex - 8 } : null,
105
+ };
106
+ assertReadActive(signal);
107
+ await revalidateReadSnapshot(snapshot, root, workspaceRoot);
108
+ assertReadActive(signal);
109
+ return { success: true, data: { relockHistory } };
110
+ }
111
+ catch (error) {
112
+ return error instanceof InvalidHistoryError
113
+ ? compactFailure('history_invalid')
114
+ : compactReadError(error);
115
+ }
116
+ }
117
+ //# sourceMappingURL=resume-history.js.map
@@ -0,0 +1,9 @@
1
+ import type { ResumeCheckpoint } from '../types/resume-views.js';
2
+ import type { SddResult, SddWorkspaceHandle } from '../types/sdd-engine.js';
3
+ import type { ScopedPolicy, VerificationPolicy } from '../types/verification.js';
4
+ import { formatCompactResult } from './tools/compact-result.js';
5
+ export declare function getResumeCheckpoint(tasksPath: string, workspaceRoot: string, extractCommand: (markdown: string) => string | null, receipts?: unknown, scopedPolicy?: ScopedPolicy, signal?: AbortSignal): Promise<SddResult<{
6
+ resume: ResumeCheckpoint;
7
+ }>>;
8
+ export declare function getResumeToolResult(rawArgs: unknown, workspace: SddWorkspaceHandle, policy?: VerificationPolicy, signal?: AbortSignal): Promise<ReturnType<typeof formatCompactResult>>;
9
+ //# sourceMappingURL=resume-views.d.ts.map
@@ -0,0 +1,149 @@
1
+ import * as path from 'node:path';
2
+ import { getRelockHistory } from './resume-history.js';
3
+ import { GetActiveTaskInputSchema } from './contracts.js';
4
+ import { verificationCommand } from './task-window.js';
5
+ import { homeFallbackFailure } from './workspace-root.js';
6
+ import { CompletionGuardError, hashArtifact } from './feature-authority.js';
7
+ import { summarizeTaskContent } from './task-content.js';
8
+ import { captureVerificationRoot } from './verification-inputs.js';
9
+ import { assertGuardAbsent, assessVerificationPreflight, captureReadSnapshot, revalidateReadSnapshot, } from './verification-preflight.js';
10
+ import { compactFailure, compactReadError, formatCompactResult } from './tools/compact-result.js';
11
+ class InvalidResumeHistoryError extends Error {
12
+ }
13
+ function contractReference(snapshot) {
14
+ const locked = snapshot.locked;
15
+ return locked
16
+ ? {
17
+ specSha256: hashArtifact(locked.specContent),
18
+ planSha256: hashArtifact(locked.planContent),
19
+ tasksSha256: hashArtifact(locked.tasksContent),
20
+ lockSha256: hashArtifact(locked.lockContent),
21
+ }
22
+ : null;
23
+ }
24
+ function historyReference(snapshot) {
25
+ const locked = snapshot.locked;
26
+ if (!locked) {
27
+ return null;
28
+ }
29
+ const raw = JSON.parse(locked.lockContent);
30
+ const history = raw.relockHistory;
31
+ if (history !== undefined && !Array.isArray(history)) {
32
+ throw new InvalidResumeHistoryError();
33
+ }
34
+ const count = Array.isArray(history) ? history.length : 0;
35
+ return {
36
+ count,
37
+ lockSha256: hashArtifact(locked.lockContent),
38
+ firstCursor: count ? { snapshotSha256: locked.digest, startIndex: count - 1 } : null,
39
+ };
40
+ }
41
+ function checkpoint(snapshot, summary, assessment) {
42
+ const presentation = checkpointPresentation(snapshot, summary, assessment);
43
+ const evidence = assessment?.evidence;
44
+ return {
45
+ version: 1,
46
+ featureId: path.basename(snapshot.feature),
47
+ progress: summary.progress,
48
+ ...presentation,
49
+ contract: contractReference(snapshot),
50
+ candidate: evidence
51
+ ? {
52
+ workspaceSha256: evidence.workspaceSha256,
53
+ candidateSha256: evidence.candidateSha256,
54
+ observedSha256: evidence.observedSha256,
55
+ }
56
+ : null,
57
+ gates: assessment?.preflight.gates ?? [],
58
+ history: historyReference(snapshot),
59
+ };
60
+ }
61
+ function checkpointStatus(snapshot, summary) {
62
+ if (!snapshot.locked) {
63
+ return 'unlocked';
64
+ }
65
+ if (!summary.progress.total) {
66
+ return 'no_tasks';
67
+ }
68
+ return summary.current.success && summary.current.data.activeTask ? 'active' : 'complete';
69
+ }
70
+ function checkpointPresentation(snapshot, summary, assessment) {
71
+ const status = checkpointStatus(snapshot, summary);
72
+ const active = summary.current.success ? summary.current.data.activeTask : null;
73
+ if (status === 'active' && active && assessment) {
74
+ return {
75
+ status,
76
+ task: { id: active.taskId, index: active.taskIndex },
77
+ readiness: assessment.preflight.status,
78
+ integration: 'pending',
79
+ blockers: assessment.preflight.blockers,
80
+ nextAction: assessment.preflight.nextAction,
81
+ };
82
+ }
83
+ return {
84
+ status,
85
+ task: null,
86
+ readiness: status === 'unlocked' ? 'blocked' : 'not_applicable',
87
+ integration: 'not_applicable',
88
+ blockers: status === 'unlocked' ? [{ reason: 'unlocked' }] : [],
89
+ nextAction: status === 'unlocked' ? 'review_lock' : status === 'no_tasks' ? 'inspect_tasks' : 'none',
90
+ };
91
+ }
92
+ function validIdentifier(id) {
93
+ return id.length <= 128 && /^[A-Z0-9_-]+$/u.test(id);
94
+ }
95
+ export async function getResumeCheckpoint(tasksPath, workspaceRoot, extractCommand, receipts, scopedPolicy, signal) {
96
+ try {
97
+ const root = await captureVerificationRoot(workspaceRoot);
98
+ const snapshot = await captureReadSnapshot(path.dirname(tasksPath), root);
99
+ await assertGuardAbsent(snapshot.feature);
100
+ const summary = summarizeTaskContent(snapshot.artifacts['tasks.md']?.content ?? '', extractCommand);
101
+ const active = summary.current.success ? summary.current.data.activeTask : null;
102
+ if (!validIdentifier(path.basename(snapshot.feature)) ||
103
+ (active && !validIdentifier(active.taskId))) {
104
+ return compactFailure('compact_identifier_invalid');
105
+ }
106
+ const assessment = snapshot.locked && active
107
+ ? await assessVerificationPreflight(snapshot.locked, root, workspaceRoot, active, receipts, scopedPolicy, signal)
108
+ : undefined;
109
+ const resume = checkpoint(snapshot, summary, assessment);
110
+ if (signal?.aborted) {
111
+ throw new CompletionGuardError('cancelled', 'Compact read was cancelled.');
112
+ }
113
+ await revalidateReadSnapshot(snapshot, root, workspaceRoot);
114
+ if (signal?.aborted) {
115
+ return compactFailure('cancelled', 'ERR_VERIFICATION_FAILED');
116
+ }
117
+ return { success: true, data: { resume } };
118
+ }
119
+ catch (error) {
120
+ return error instanceof InvalidResumeHistoryError
121
+ ? compactFailure('history_invalid')
122
+ : compactReadError(error);
123
+ }
124
+ }
125
+ export async function getResumeToolResult(rawArgs, workspace, policy, signal) {
126
+ try {
127
+ const parsed = GetActiveTaskInputSchema.safeParse(rawArgs);
128
+ if (!parsed.success) {
129
+ return formatCompactResult(compactFailure('compact_input_invalid'));
130
+ }
131
+ const args = parsed.data;
132
+ if (!validIdentifier(args.feature_id)) {
133
+ return formatCompactResult(compactFailure('compact_identifier_invalid'));
134
+ }
135
+ const resolved = await workspace.resolve();
136
+ if (homeFallbackFailure(resolved, 'sdd_get_active_task')) {
137
+ return formatCompactResult(compactFailure('workspace_unresolved', 'ERR_WORKSPACE_UNRESOLVED'));
138
+ }
139
+ const tasksPath = path.join(resolved.sddDir, 'features', args.feature_id, 'tasks.md');
140
+ if (args.view === 'relock_history') {
141
+ return formatCompactResult(await getRelockHistory(tasksPath, resolved.workspaceRoot, args.history_cursor, signal));
142
+ }
143
+ return formatCompactResult(await getResumeCheckpoint(tasksPath, resolved.workspaceRoot, verificationCommand, args.verification_receipts, policy?.mode === 'scoped' ? policy : undefined, signal));
144
+ }
145
+ catch (error) {
146
+ return formatCompactResult(compactReadError(error));
147
+ }
148
+ }
149
+ //# sourceMappingURL=resume-views.js.map
@@ -1,5 +1,12 @@
1
1
  import type { ActiveTaskResult, FeatureSummary, SddResult, TaskBlock } from '../types/sdd-engine.js';
2
2
  export declare function activeTaskFromContent(content: string, extractCommand: (markdown: string) => string | null): SddResult<ActiveTaskResult>;
3
+ export declare function summarizeTaskContent(content: string, extractCommand: (markdown: string) => string | null): {
4
+ current: SddResult<ActiveTaskResult>;
5
+ progress: {
6
+ total: number;
7
+ completed: number;
8
+ };
9
+ };
3
10
  export declare function taskBlocks(content: string): TaskBlock[];
4
11
  export declare function markTaskVerified(lines: string[], taskId: string, cleanOutput: string): string[] | null;
5
12
  export declare function markReceiptTaskVerified(content: string, lineIndex: number, summary: string): string | undefined;
@@ -1,6 +1,13 @@
1
1
  const UNLOCKED_CARD = { locked: false, trinity: 'unlocked', manifest: [] };
2
2
  export function activeTaskFromContent(content, extractCommand) {
3
- return buildActiveTaskResult(parseTasks(content.split('\n')), extractCommand);
3
+ return summarizeTaskContent(content, extractCommand).current;
4
+ }
5
+ export function summarizeTaskContent(content, extractCommand) {
6
+ const acc = parseTasks(content.split('\n'));
7
+ return {
8
+ current: buildActiveTaskResult(acc, extractCommand),
9
+ progress: { total: acc.totalTasks, completed: acc.completedTasks },
10
+ };
4
11
  }
5
12
  function buildActiveTaskResult(acc, extractCommand) {
6
13
  if (acc.totalTasks === 0) {
@@ -0,0 +1,6 @@
1
+ import type { ErrorCode, SddResult, ToolResult } from '../../types/sdd-engine.js';
2
+ import type { CompactFailureReason } from '../../types/resume-views.js';
3
+ export declare function compactFailure(reason: CompactFailureReason, code?: ErrorCode): SddResult<never>;
4
+ export declare function compactReadError(error: unknown): SddResult<never>;
5
+ export declare function formatCompactResult<T>(result: SddResult<T>): ToolResult;
6
+ //# sourceMappingURL=compact-result.d.ts.map
@@ -0,0 +1,66 @@
1
+ import { CompletionGuardError } from '../feature-authority.js';
2
+ import { VerificationInputError } from '../verification-inputs.js';
3
+ const actions = {
4
+ unlocked: 'review_lock',
5
+ history_cursor_stale: 'reread_checkpoint',
6
+ history_cursor_invalid: 'reread_checkpoint',
7
+ workspace_unresolved: 'inspect_workspace',
8
+ guard_present: 'wait_for_guard',
9
+ persistence_uncertain: 'inspect_recovery',
10
+ contract_drift: 'reread_checkpoint',
11
+ tasks_missing: 'inspect_tasks',
12
+ artifact_unavailable: 'inspect_artifacts',
13
+ history_invalid: 'inspect_artifacts',
14
+ compact_identifier_invalid: 'inspect_tasks',
15
+ compact_input_invalid: 'fix_inputs',
16
+ compact_response_too_large: 'inspect_artifacts',
17
+ cancelled: 'retry_read',
18
+ };
19
+ export function compactFailure(reason, code = 'ERR_INVALID_ARTIFACT') {
20
+ return {
21
+ success: false,
22
+ error: {
23
+ code,
24
+ message: 'Compact task read is unavailable; follow the bounded next action.',
25
+ trigger: 'sdd_get_active_task',
26
+ details: { reason, nextAction: actions[reason] },
27
+ },
28
+ };
29
+ }
30
+ export function compactReadError(error) {
31
+ if (error instanceof VerificationInputError && error.reason === 'cancelled') {
32
+ return compactFailure('cancelled', 'ERR_VERIFICATION_FAILED');
33
+ }
34
+ if (error instanceof VerificationInputError && error.reason === 'receipt_input_drift') {
35
+ return compactFailure('contract_drift', 'ERR_SPEC_DRIFT');
36
+ }
37
+ if (!(error instanceof CompletionGuardError)) {
38
+ return compactFailure('artifact_unavailable');
39
+ }
40
+ if (error.code === 'ERR_PERMISSION_VIOLATION') {
41
+ return compactFailure('artifact_unavailable', error.code);
42
+ }
43
+ if (error.code === 'ERR_INVALID_ARTIFACT') {
44
+ return compactFailure('artifact_unavailable', error.code);
45
+ }
46
+ if (error.code === 'ERR_TASK_NOT_FOUND') {
47
+ return compactFailure('tasks_missing', error.code);
48
+ }
49
+ switch (error.reason) {
50
+ case 'guard_present':
51
+ case 'persistence_uncertain':
52
+ case 'cancelled':
53
+ return compactFailure(error.reason, 'ERR_VERIFICATION_FAILED');
54
+ case 'contract_drift':
55
+ return compactFailure('contract_drift', 'ERR_SPEC_DRIFT');
56
+ }
57
+ return compactFailure('artifact_unavailable');
58
+ }
59
+ export function formatCompactResult(result) {
60
+ const text = JSON.stringify(result);
61
+ if (Buffer.byteLength(text, 'utf8') > 8192) {
62
+ return formatCompactResult(compactFailure('compact_response_too_large'));
63
+ }
64
+ return { content: [{ type: 'text', text }], ...(!result.success ? { isError: true } : {}) };
65
+ }
66
+ //# sourceMappingURL=compact-result.js.map
@@ -9,6 +9,7 @@ import { captureReceiptEvidence } from '../verification-receipts.js';
9
9
  import { captureVerificationRoot, checkReceiptPatchTarget, revalidateVerificationInputs, } from '../verification-inputs.js';
10
10
  import { completionError, completionFailure, patchMutationError } from '../task-failures.js';
11
11
  import { formatResult } from './format-result.js';
12
+ import { getResumeToolResult } from '../resume-views.js';
12
13
  import { acquireCompletionLease, inspectCompletionGuard } from '../completion-guard.js';
13
14
  import { captureCompletionSnapshot, revalidateCompletionSnapshot } from '../completion-snapshot.js';
14
15
  import { homeFallbackFailure, readTextInsideWorkspace } from '../workspace-root.js';
@@ -17,7 +18,7 @@ export function registerExecutionTools(server, workspace, policy) {
17
18
  const taskWindow = new TaskWindowManager(policy);
18
19
  registerReadArtifactTool(server, workspace);
19
20
  registerReadFileSliceTool(server, workspace);
20
- registerGetActiveTaskTool(server, workspace, taskWindow);
21
+ registerGetActiveTaskTool(server, workspace, taskWindow, policy);
21
22
  registerApplyPatchTool(server, workspace);
22
23
  registerCompleteTaskTool(server, workspace, taskWindow);
23
24
  return taskWindow;
@@ -64,11 +65,16 @@ function registerReadFileSliceTool(server, workspace) {
64
65
  return executeReadFileSlice(resolved.workspaceRoot, args.path, args.start_line, args.end_line);
65
66
  });
66
67
  }
67
- function registerGetActiveTaskTool(server, workspace, taskWindow) {
68
+ function registerGetActiveTaskTool(server, workspace, taskWindow, policy) {
68
69
  server.registerTool('sdd_get_active_task', {
69
- description: 'Delivers exclusively the active task (Single Task Window). Zero future backlog.',
70
+ description: 'Returns only the active task. For fast resumption use view="resume"; use "relock_history" with history_cursor for older lock references, or "verification_preflight" to inspect evidence. Compact views are read-only and do not certify work.',
70
71
  inputSchema: GetActiveTaskInputSchema.shape,
71
72
  }, async (rawArgs, extra) => {
73
+ if (rawArgs.view === 'resume' ||
74
+ rawArgs.view === 'relock_history' ||
75
+ rawArgs.history_cursor !== undefined) {
76
+ return getResumeToolResult(rawArgs, workspace, policy, extra.signal);
77
+ }
72
78
  const args = GetActiveTaskInputSchema.parse(rawArgs);
73
79
  const resolved = await workspace.resolve();
74
80
  const homeError = homeFallbackFailure(resolved, 'sdd_get_active_task');
@@ -1,4 +1,11 @@
1
- import type { ActiveTaskResult, SddResult } from '../types/sdd-engine.js';
1
+ import type { PreflightAssessment } from '../types/resume-views.js';
2
+ import type { ActiveTaskDetails, ActiveTaskResult, SddResult, WorkspaceRoot } from '../types/sdd-engine.js';
3
+ import type { CompletionSnapshot, PreflightReadSnapshot } from '../types/completion.js';
2
4
  import type { ScopedPolicy } from '../types/verification.js';
5
+ /** The same captured authority can be assessed by other read views without selecting again. */
6
+ export declare function assessVerificationPreflight(snapshot: CompletionSnapshot, root: WorkspaceRoot, workspaceRoot: string, active: ActiveTaskDetails | null, receipts?: unknown, scopedPolicy?: ScopedPolicy, signal?: AbortSignal): Promise<PreflightAssessment>;
7
+ export declare function captureReadSnapshot(feature: string, root: WorkspaceRoot): Promise<PreflightReadSnapshot>;
8
+ export declare function revalidateReadSnapshot(snapshot: PreflightReadSnapshot, root: WorkspaceRoot, workspaceRoot: string): Promise<void>;
9
+ export declare function assertGuardAbsent(feature: string): Promise<void>;
3
10
  export declare function getVerificationPreflight(tasksPath: string, workspaceRoot: string, extractCommand: (markdown: string) => string | null, receipts?: unknown, scopedPolicy?: ScopedPolicy, signal?: AbortSignal): Promise<SddResult<ActiveTaskResult>>;
4
11
  //# sourceMappingURL=verification-preflight.d.ts.map
@@ -66,9 +66,9 @@ function taskBlockers(active, task) {
66
66
  return reasons;
67
67
  }
68
68
  /** The same captured authority can be assessed by other read views without selecting again. */
69
- async function assessVerificationPreflight(snapshot, root, workspaceRoot, active, receipts, scopedPolicy, signal) {
69
+ export async function assessVerificationPreflight(snapshot, root, workspaceRoot, active, receipts, scopedPolicy, signal) {
70
70
  if (!active) {
71
- return report(null, [], [], false);
71
+ return { preflight: report(null, [], [], false) };
72
72
  }
73
73
  const policy = parseVerificationReceiptPolicy(path.basename(snapshot.featDir), snapshot.planContent, snapshot.tasksContent);
74
74
  if (policy.status === 'invalid') {
@@ -80,7 +80,7 @@ async function assessVerificationPreflight(snapshot, root, workspaceRoot, active
80
80
  if (receipts !== undefined) {
81
81
  reasons.push('receipt_not_configured');
82
82
  }
83
- return report(active.taskId, reasons);
83
+ return { preflight: report(active.taskId, reasons) };
84
84
  }
85
85
  if (scopedPolicy && (await isScopedVerificationFeature(scopedPolicy, snapshot.featDir))) {
86
86
  reasons.push('receipt_scoped_unsupported');
@@ -91,15 +91,19 @@ async function assessVerificationPreflight(snapshot, root, workspaceRoot, active
91
91
  if (captured.error.details?.reason !== 'receipt_observed_baseline_drift') {
92
92
  throw new CompletionGuardError('contract_drift', 'Preflight authority changed.');
93
93
  }
94
- return report(active.taskId, [...reasons, 'receipt_observed_baseline_drift']);
94
+ return { preflight: report(active.taskId, [...reasons, 'receipt_observed_baseline_drift']) };
95
95
  }
96
96
  const assessed = assessVerificationReceiptSet(receipts, captured.data.evidence, policy.publicKey);
97
97
  await revalidateVerificationInputs(captured.data.inputs, signal);
98
- return report(active.taskId, [...reasons, ...assessed.blockers.map(({ reason }) => reason)], assessed.gates);
98
+ return {
99
+ preflight: report(active.taskId, [...reasons, ...assessed.blockers.map(({ reason }) => reason)], assessed.gates),
100
+ evidence: captured.data.evidence,
101
+ inputs: captured.data.inputs,
102
+ };
99
103
  }
100
104
  catch (error) {
101
105
  if (error instanceof VerificationInputError && error.reason === 'receipt_input_unavailable') {
102
- return report(active.taskId, [...reasons, 'receipt_input_unavailable']);
106
+ return { preflight: report(active.taskId, [...reasons, 'receipt_input_unavailable']) };
103
107
  }
104
108
  throw error;
105
109
  }
@@ -122,7 +126,7 @@ async function requiredTaskArtifact(feature) {
122
126
  }
123
127
  return task;
124
128
  }
125
- async function captureReadSnapshot(feature, root) {
129
+ export async function captureReadSnapshot(feature, root) {
126
130
  try {
127
131
  const locked = await captureCompletionSnapshot(feature, {
128
132
  workspaceRoot: root.canonical,
@@ -157,7 +161,7 @@ async function captureReadSnapshot(feature, root) {
157
161
  }
158
162
  return { feature: canonical, directories, artifacts };
159
163
  }
160
- async function revalidateReadSnapshot(snapshot, root, workspaceRoot) {
164
+ export async function revalidateReadSnapshot(snapshot, root, workspaceRoot) {
161
165
  if (snapshot.locked) {
162
166
  await revalidateCompletionSnapshot(snapshot.locked);
163
167
  }
@@ -184,7 +188,7 @@ async function revalidateReadSnapshot(snapshot, root, workspaceRoot) {
184
188
  }
185
189
  await assertGuardAbsent(snapshot.feature);
186
190
  }
187
- async function assertGuardAbsent(feature) {
191
+ export async function assertGuardAbsent(feature) {
188
192
  const guard = await inspectCompletionGuard(feature);
189
193
  if (guard) {
190
194
  throw new CompletionGuardError(guard.reason, 'Preflight authority is guarded.', 'ERR_VERIFICATION_FAILED');
@@ -244,7 +248,7 @@ export async function getVerificationPreflight(tasksPath, workspaceRoot, extract
244
248
  activeTask: receiptActiveTask(snapshot.locked, current.data.activeTask),
245
249
  };
246
250
  const verificationPreflight = snapshot.locked
247
- ? await assessVerificationPreflight(snapshot.locked, root, workspaceRoot, data.activeTask, receipts, scopedPolicy, signal)
251
+ ? (await assessVerificationPreflight(snapshot.locked, root, workspaceRoot, data.activeTask, receipts, scopedPolicy, signal)).preflight
248
252
  : report(data.activeTask?.taskId ?? null, ['unlocked']);
249
253
  if (signal?.aborted) {
250
254
  throw new CompletionGuardError('cancelled', 'Preflight was cancelled.');
@@ -0,0 +1,55 @@
1
+ import type { PreflightAction, RelockHistoryCursor, VerificationEvidence, VerificationInputSnapshot, VerificationPreflight } from './sdd-engine.js';
2
+ export interface PreflightAssessment {
3
+ preflight: VerificationPreflight;
4
+ evidence?: VerificationEvidence;
5
+ inputs?: VerificationInputSnapshot;
6
+ }
7
+ export interface ResumeCheckpoint {
8
+ version: 1;
9
+ featureId: string;
10
+ status: 'active' | 'unlocked' | 'complete' | 'no_tasks';
11
+ progress: {
12
+ total: number;
13
+ completed: number;
14
+ };
15
+ task: {
16
+ id: string;
17
+ index: number;
18
+ } | null;
19
+ contract: {
20
+ specSha256: string;
21
+ planSha256: string;
22
+ tasksSha256: string;
23
+ lockSha256: string;
24
+ } | null;
25
+ candidate: Pick<VerificationEvidence, 'workspaceSha256' | 'candidateSha256' | 'observedSha256'> | null;
26
+ gates: VerificationPreflight['gates'];
27
+ readiness: VerificationPreflight['status'];
28
+ integration: 'pending' | 'not_applicable';
29
+ blockers: VerificationPreflight['blockers'];
30
+ nextAction: PreflightAction | 'inspect_tasks';
31
+ history: {
32
+ count: number;
33
+ lockSha256: string;
34
+ firstCursor: RelockHistoryCursor | null;
35
+ } | null;
36
+ }
37
+ export interface RelockHistoryRecord {
38
+ index: number;
39
+ lockedAt: string;
40
+ specHash: string;
41
+ planHash: string;
42
+ tasksHash?: string;
43
+ recordSha256: string;
44
+ reasonSha256: string;
45
+ }
46
+ export interface RelockHistoryPage {
47
+ version: 1;
48
+ featureId: string;
49
+ lockSha256: string;
50
+ count: number;
51
+ records: RelockHistoryRecord[];
52
+ nextCursor: RelockHistoryCursor | null;
53
+ }
54
+ export type CompactFailureReason = 'unlocked' | 'history_cursor_stale' | 'history_cursor_invalid' | 'workspace_unresolved' | 'guard_present' | 'persistence_uncertain' | 'contract_drift' | 'tasks_missing' | 'artifact_unavailable' | 'history_invalid' | 'compact_identifier_invalid' | 'compact_input_invalid' | 'compact_response_too_large' | 'cancelled';
55
+ //# sourceMappingURL=resume-views.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=resume-views.js.map
@@ -199,8 +199,15 @@ export interface ReadFileSliceInput {
199
199
  start_line: number;
200
200
  end_line: number;
201
201
  }
202
+ export interface RelockHistoryCursor {
203
+ snapshotSha256: string;
204
+ startIndex: number;
205
+ }
202
206
  export interface GetActiveTaskInput {
203
207
  feature_id: string;
208
+ view?: 'verification_preflight' | 'resume' | 'relock_history';
209
+ history_cursor?: RelockHistoryCursor;
210
+ verification_receipts?: Record<string, unknown>[];
204
211
  }
205
212
  export interface ApplyFilePatchInput {
206
213
  feature_id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planu/cli",
3
- "version": "8.4.0",
3
+ "version": "8.5.1",
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",
@@ -74,30 +74,30 @@
74
74
  "@commitlint/cli": "^21.2.4",
75
75
  "@commitlint/config-conventional": "^21.2.4",
76
76
  "@eslint/js": "^10.0.1",
77
- "@secretlint/secretlint-rule-no-homedir": "^13.0.7",
78
- "@secretlint/secretlint-rule-preset-recommend": "^13.0.7",
77
+ "@secretlint/secretlint-rule-no-homedir": "^13.1.0",
78
+ "@secretlint/secretlint-rule-preset-recommend": "^13.1.0",
79
79
  "@types/node": "^22.20.5",
80
80
  "@typescript/native": "npm:typescript@^7.0.2",
81
- "@vitest/coverage-v8": "^5.0.5",
82
- "eslint": "10.13.0",
81
+ "@vitest/coverage-v8": "^5.1.0",
82
+ "eslint": "10.14.0",
83
83
  "eslint-config-prettier": "^10.1.8",
84
84
  "eslint-import-resolver-typescript": "^4.4.5",
85
85
  "eslint-plugin-import": "^2.32.0",
86
86
  "happy-dom": "^21.0.4",
87
87
  "husky": "^9.1.7",
88
88
  "jiti": "2.7.0",
89
- "knip": "^6.42.1",
89
+ "knip": "^6.44.1",
90
90
  "lint-staged": "^17.6.0",
91
91
  "madge": "^8.0.0",
92
92
  "prettier": "^3.9.10",
93
93
  "qrcode": "1.5.4",
94
- "secretlint": "^13.0.7",
95
- "tsc-alias": "^1.9.8",
96
- "type-coverage": "^2.30.4",
94
+ "secretlint": "^13.1.0",
95
+ "tsc-alias": "^1.9.10",
96
+ "type-coverage": "^2.31.2",
97
97
  "typescript": "npm:@typescript/typescript6@^6.0.2",
98
- "typescript-eslint": "^8.72.0",
99
- "vite": "^8.3.4",
100
- "vitest": "^5.0.5"
98
+ "typescript-eslint": "^8.72.1",
99
+ "vite": "^8.3.6",
100
+ "vitest": "^5.1.0"
101
101
  },
102
102
  "scripts": {
103
103
  "check:tool-registration": "bash scripts/check-tool-registration.sh",
@@ -15,6 +15,10 @@ For a rejected `sdd_lock_spec`, inspect `error.details.issues` for artifact, sta
15
15
 
16
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.
17
17
 
18
+ To resume, request `sdd_get_active_task` with `view="resume"` and optional `verification_receipts`; require `data.resume.version=1` before using its task, progress, candidate, observed-input digests, gates, pending integration and `nextAction`. Then use the ordinary active-task read for its authorized body and File Manifest. Unsupplied evidence is pending; observed receipts are not certification. Neither compact view runs verification, writes artifacts or grants permission.
19
+
20
+ If `history` is null, follow `nextAction` without requesting history. If `history.firstCursor` is null, there are no records; do not request history. Otherwise use `view="relock_history"` with the checkpoint's `history.firstCursor` as `history_cursor`, then each `nextCursor`, to read at most eight descending records per page. `history_cursor` is accepted only with `view="relock_history"`. Stop when `nextCursor` is null. Require `data.relockHistory.version=1`; stale cursors require rereading the checkpoint. Each handler-produced compact result has exactly one text block of at most 8,192 UTF-8 bytes, without `structuredContent`; SDK validation before dispatch is a separate boundary. History digests reference the original unmodified lock; they do not attest historical actions. Preserve guards, locked authority and verification budgets.
21
+
18
22
  ## Delegation
19
23
 
20
24
  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.
@@ -14,6 +14,10 @@ For a rejected `sdd_lock_spec`, inspect `error.details.issues` for artifact, sta
14
14
 
15
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
16
 
17
+ To resume, request `sdd_get_active_task` with `view="resume"` and optional `verification_receipts`; require `data.resume.version=1` before using its task, progress, candidate, observed-input digests, gates, pending integration and `nextAction`. Then use the ordinary active-task read for its authorized body and File Manifest. Unsupplied evidence is pending; observed receipts are not certification. Neither compact view runs verification, writes artifacts or grants permission.
18
+
19
+ If `history` is null, follow `nextAction` without requesting history. If `history.firstCursor` is null, there are no records; do not request history. Otherwise use `view="relock_history"` with the checkpoint's `history.firstCursor` as `history_cursor`, then each `nextCursor`, to read at most eight descending records per page. `history_cursor` is accepted only with `view="relock_history"`. Stop when `nextCursor` is null. Require `data.relockHistory.version=1`; stale cursors require rereading the checkpoint. Each handler-produced compact result has exactly one text block of at most 8,192 UTF-8 bytes, without `structuredContent`; SDK validation before dispatch is a separate boundary. History digests reference the original unmodified lock; they do not attest historical actions. Preserve guards, locked authority and verification budgets.
20
+
17
21
  ## Delegation
18
22
 
19
23
  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.