@planu/cli 8.5.1 → 8.6.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 +6 -0
- package/README.md +12 -4
- package/dist/sdd-engine/completion-guard.js +2 -3
- package/dist/sdd-engine/contracts.d.ts +172 -0
- package/dist/sdd-engine/contracts.js +235 -10
- package/dist/sdd-engine/evidence-checkpoints.d.ts +6 -0
- package/dist/sdd-engine/evidence-checkpoints.js +280 -0
- package/dist/sdd-engine/evidence-journal.d.ts +25 -0
- package/dist/sdd-engine/evidence-journal.js +326 -0
- package/dist/sdd-engine/feature-manifest.d.ts +2 -1
- package/dist/sdd-engine/host-rule-pack.d.ts +4 -0
- package/dist/sdd-engine/host-rule-pack.js +112 -55
- package/dist/sdd-engine/host-skill-reader.d.ts +8 -1
- package/dist/sdd-engine/host-skill-reader.js +73 -0
- package/dist/sdd-engine/resume-history.d.ts +35 -3
- package/dist/sdd-engine/resume-history.js +242 -13
- package/dist/sdd-engine/resume-views.d.ts +6 -6
- package/dist/sdd-engine/resume-views.js +222 -78
- package/dist/sdd-engine/task-content.d.ts +2 -1
- package/dist/sdd-engine/tools/compact-result.d.ts +35 -5
- package/dist/sdd-engine/tools/compact-result.js +279 -2
- package/dist/sdd-engine/tools/execution-tools.js +17 -5
- package/dist/sdd-engine/tools/workspace-tools.js +80 -51
- package/dist/sdd-engine/trinity-structure.d.ts +2 -2
- package/dist/sdd-engine/verification-inputs.d.ts +2 -1
- package/dist/sdd-engine/verification-policy.d.ts +2 -1
- package/dist/sdd-engine/verification-preflight.d.ts +2 -2
- package/dist/sdd-engine/verification-receipts.d.ts +2 -2
- package/dist/sdd-engine/verification-runner.d.ts +2 -1
- package/dist/types/completion.d.ts +168 -3
- package/dist/types/resume-views.d.ts +220 -2
- package/dist/types/sdd-engine.d.ts +47 -110
- package/dist/types/verification.d.ts +0 -10
- package/package.json +5 -5
- package/templates/AGENTS.md +2 -0
- package/templates/host/planu-sdd.md +2 -0
- package/templates/skills/preflight-guardian.md +4 -0
- package/templates/skills/reconciler.md +6 -0
- package/templates/skills/spec-architect.md +44 -0
- package/templates/skills/spec-executor.md +6 -0
- package/templates/skills/verification-auditor.md +6 -0
- package/dist/sdd-engine/tools/format-result.d.ts +0 -3
- package/dist/sdd-engine/tools/format-result.js +0 -22
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { ScopedVerificationCompletionContext } from '../types/completion.js';
|
|
1
2
|
import type { SddResult, CompleteTaskResult } from '../types/sdd-engine.js';
|
|
2
|
-
import type { ScopedVerificationRun, ScopedPolicy,
|
|
3
|
+
import type { ScopedVerificationRun, ScopedPolicy, ScopedVerificationRunnerOptions, ScopedVerificationRunnerTiming } from '../types/verification.js';
|
|
3
4
|
export declare function runScopedVerification(options: ScopedVerificationRunnerOptions, timing?: ScopedVerificationRunnerTiming): Promise<ScopedVerificationRun>;
|
|
4
5
|
export declare class ScopedVerificationCoordinator {
|
|
5
6
|
private readonly policy;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { KeyObject } from 'node:crypto';
|
|
2
|
+
import type { BigIntStats } from 'node:fs';
|
|
3
|
+
import type { SddLockFile, ErrorCode, TrinityIssue, FilePermission, VerificationGate, VerificationReceipt, SddResult, CompleteTaskResult, CheckpointJournalReference } from './sdd-engine.js';
|
|
4
|
+
import type { ScopedVerificationSnapshot, ScopedTaskSelector } from './verification.js';
|
|
2
5
|
export type CompletionFailureReason = 'guard_present' | 'contract_drift' | 'cancelled' | 'persistence_uncertain';
|
|
3
6
|
export interface PhysicalIdentity {
|
|
4
7
|
dev: number;
|
|
@@ -21,7 +24,7 @@ export interface GuardRecord {
|
|
|
21
24
|
host: string;
|
|
22
25
|
nonce: string;
|
|
23
26
|
startedAt: string;
|
|
24
|
-
operation: 'complete' | 'patch' | 'lock';
|
|
27
|
+
operation: 'complete' | 'patch' | 'lock' | 'checkpoint';
|
|
25
28
|
phase: 'running' | 'persisting';
|
|
26
29
|
featureDev: number;
|
|
27
30
|
featureIno: number;
|
|
@@ -42,7 +45,7 @@ export interface CompletionSnapshot {
|
|
|
42
45
|
digest: string;
|
|
43
46
|
}
|
|
44
47
|
export interface CompletionLeaseOptions {
|
|
45
|
-
operation?: 'complete' | 'patch' | 'lock';
|
|
48
|
+
operation?: 'complete' | 'patch' | 'lock' | 'checkpoint';
|
|
46
49
|
workspaceRoot?: string;
|
|
47
50
|
}
|
|
48
51
|
export interface CompletionSnapshotOptions {
|
|
@@ -81,4 +84,166 @@ export interface PreflightReadSnapshot {
|
|
|
81
84
|
artifacts: Partial<Record<'spec.md' | 'plan.md' | 'tasks.md' | '.lock', ArtifactCapture | undefined>>;
|
|
82
85
|
locked?: CompletionSnapshot;
|
|
83
86
|
}
|
|
87
|
+
export type VerificationInputCategory = 'candidate' | 'observed';
|
|
88
|
+
export type VerificationInputReason = 'receipt_input_unavailable' | 'receipt_input_drift' | 'cancelled';
|
|
89
|
+
export interface InputRequest {
|
|
90
|
+
category: VerificationInputCategory;
|
|
91
|
+
path: string;
|
|
92
|
+
allowAbsent: boolean;
|
|
93
|
+
}
|
|
94
|
+
interface WalkBase {
|
|
95
|
+
directories: readonly BigIntStats[];
|
|
96
|
+
absolute: string;
|
|
97
|
+
}
|
|
98
|
+
export type Walk = WalkBase & ({
|
|
99
|
+
state: 'absent';
|
|
100
|
+
} | {
|
|
101
|
+
state: 'present';
|
|
102
|
+
stat: BigIntStats;
|
|
103
|
+
});
|
|
104
|
+
export type InputCapture = {
|
|
105
|
+
request: InputRequest;
|
|
106
|
+
walk: WalkBase & {
|
|
107
|
+
state: 'absent';
|
|
108
|
+
};
|
|
109
|
+
} | {
|
|
110
|
+
request: InputRequest;
|
|
111
|
+
walk: WalkBase & {
|
|
112
|
+
state: 'present';
|
|
113
|
+
stat: BigIntStats;
|
|
114
|
+
};
|
|
115
|
+
rawSha256: string;
|
|
116
|
+
mode: number;
|
|
117
|
+
};
|
|
118
|
+
export interface WorkspaceRoot {
|
|
119
|
+
canonical: string;
|
|
120
|
+
stat: BigIntStats;
|
|
121
|
+
}
|
|
122
|
+
export interface VerificationInputSnapshot {
|
|
123
|
+
workspaceSha256: string;
|
|
124
|
+
candidateSha256: string;
|
|
125
|
+
observedSha256: string;
|
|
126
|
+
root: WorkspaceRoot;
|
|
127
|
+
workspaceRoot: string;
|
|
128
|
+
inputs: readonly InputCapture[];
|
|
129
|
+
}
|
|
130
|
+
export interface TaskBlock {
|
|
131
|
+
id: string;
|
|
132
|
+
explicitId: string | undefined;
|
|
133
|
+
legacyId: string | undefined;
|
|
134
|
+
ordinal: number;
|
|
135
|
+
lineIndex: number;
|
|
136
|
+
lines: string[];
|
|
137
|
+
}
|
|
138
|
+
export interface TaskParseAccumulator {
|
|
139
|
+
totalTasks: number;
|
|
140
|
+
completedTasks: number;
|
|
141
|
+
activeTaskIndex: number;
|
|
142
|
+
activeTaskId: string;
|
|
143
|
+
activeTaskTitle: string;
|
|
144
|
+
activeTaskLines: string[];
|
|
145
|
+
isCapturingActive: boolean;
|
|
146
|
+
}
|
|
147
|
+
export interface ManifestEntry {
|
|
148
|
+
rawPath: string;
|
|
149
|
+
permission: FilePermission;
|
|
150
|
+
line: number;
|
|
151
|
+
}
|
|
152
|
+
export interface PolicySourceFrame {
|
|
153
|
+
path: string;
|
|
154
|
+
root: boolean;
|
|
155
|
+
kind: 'object' | 'array';
|
|
156
|
+
indent: number;
|
|
157
|
+
nextArrayIndex: number;
|
|
158
|
+
}
|
|
159
|
+
export interface ReceiptPolicyText {
|
|
160
|
+
locations?: ReadonlyMap<string, number>;
|
|
161
|
+
text: string | null | undefined;
|
|
162
|
+
line?: number;
|
|
163
|
+
}
|
|
164
|
+
export interface ReceiptCandidate {
|
|
165
|
+
path: string;
|
|
166
|
+
requiredFrom: number;
|
|
167
|
+
}
|
|
168
|
+
export interface ReceiptTaskPolicy {
|
|
169
|
+
taskId: string;
|
|
170
|
+
gates: readonly VerificationGate[];
|
|
171
|
+
observed: readonly string[];
|
|
172
|
+
observedBaselineSha256: string;
|
|
173
|
+
command: string;
|
|
174
|
+
ordinal: number;
|
|
175
|
+
lineIndex: number;
|
|
176
|
+
}
|
|
177
|
+
export type ReceiptPolicyResult = {
|
|
178
|
+
status: 'none';
|
|
179
|
+
} | {
|
|
180
|
+
status: 'invalid';
|
|
181
|
+
taskId?: string;
|
|
182
|
+
issue?: TrinityIssue;
|
|
183
|
+
} | {
|
|
184
|
+
status: 'ready';
|
|
185
|
+
publicKey: KeyObject;
|
|
186
|
+
candidates: readonly ReceiptCandidate[];
|
|
187
|
+
tasks: ReadonlyMap<string, ReceiptTaskPolicy>;
|
|
188
|
+
};
|
|
189
|
+
export interface SignedVerificationReceipt {
|
|
190
|
+
receipt: VerificationReceipt;
|
|
191
|
+
message: readonly string[];
|
|
192
|
+
signature: Buffer;
|
|
193
|
+
}
|
|
194
|
+
export type ScopedSnapshotResult = SddResult<ScopedVerificationSnapshot>;
|
|
195
|
+
export interface ScopedVerificationCompletionContext {
|
|
196
|
+
readonly tasksPath: string;
|
|
197
|
+
readonly taskId: string;
|
|
198
|
+
readonly workspaceRoot: string;
|
|
199
|
+
readonly selectTask: ScopedTaskSelector;
|
|
200
|
+
readonly signal?: AbortSignal;
|
|
201
|
+
readonly commit: (snapshot: ScopedVerificationSnapshot, output: string, signal: AbortSignal) => Promise<SddResult<CompleteTaskResult>>;
|
|
202
|
+
}
|
|
203
|
+
export interface CheckpointCapability {
|
|
204
|
+
uid: number;
|
|
205
|
+
noFollow: number;
|
|
206
|
+
}
|
|
207
|
+
export interface CheckpointJournalIdentity {
|
|
208
|
+
dev: number;
|
|
209
|
+
ino: number;
|
|
210
|
+
mode: number;
|
|
211
|
+
uid: number;
|
|
212
|
+
nlink: number;
|
|
213
|
+
ctimeMs: number;
|
|
214
|
+
birthtimeMs: number;
|
|
215
|
+
}
|
|
216
|
+
export interface CheckpointJournalCapture {
|
|
217
|
+
reference: CheckpointJournalReference | null;
|
|
218
|
+
identity: CheckpointJournalIdentity | null;
|
|
219
|
+
size: number;
|
|
220
|
+
bytesSha256: string;
|
|
221
|
+
}
|
|
222
|
+
export interface CheckpointRootProjection {
|
|
223
|
+
canonical: string;
|
|
224
|
+
dev: string;
|
|
225
|
+
ino: string;
|
|
226
|
+
mode: string;
|
|
227
|
+
uid: string;
|
|
228
|
+
gid: string;
|
|
229
|
+
}
|
|
230
|
+
export interface CheckpointDirectoryIdentity {
|
|
231
|
+
dev: number;
|
|
232
|
+
ino: number;
|
|
233
|
+
mode: number;
|
|
234
|
+
uid: number;
|
|
235
|
+
}
|
|
236
|
+
export interface CheckpointStablePhysical {
|
|
237
|
+
root: CheckpointRootProjection;
|
|
238
|
+
directories: (CheckpointDirectoryIdentity & {
|
|
239
|
+
directory: string;
|
|
240
|
+
})[];
|
|
241
|
+
}
|
|
242
|
+
export interface CheckpointWriteState {
|
|
243
|
+
start(): void;
|
|
244
|
+
reset(): void;
|
|
245
|
+
started(): boolean;
|
|
246
|
+
}
|
|
247
|
+
export type CheckpointFailureReason = 'checkpoint_input_invalid' | 'checkpoint_requires_lock' | 'checkpoint_requires_active_task' | 'checkpoint_context_stale' | 'checkpoint_path_unsafe' | 'checkpoint_history_invalid' | 'checkpoint_sequence_exhausted' | 'guard_present' | 'persistence_uncertain' | 'cancelled' | 'checkpoint_unavailable';
|
|
248
|
+
export {};
|
|
84
249
|
//# sourceMappingURL=completion.d.ts.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ScopedPolicy } from './verification.js';
|
|
2
|
+
import type { WorkspaceRoot, CompletionSnapshot, VerificationInputSnapshot, CheckpointCapability, PreflightReadSnapshot } from './completion.js';
|
|
3
|
+
import type { HostSkillReadCause, HostSkillReadResult, CheckpointReported, CheckpointJournalReference, ExecutionDetailCursor, EvidenceHistoryCursor, SddResult, ActiveTaskResult, ActiveTaskDetails, FilePermission, PreflightAction, RelockHistoryCursor, VerificationEvidence, VerificationPreflight } from './sdd-engine.js';
|
|
2
4
|
export interface PreflightAssessment {
|
|
3
5
|
preflight: VerificationPreflight;
|
|
4
6
|
evidence?: VerificationEvidence;
|
|
@@ -51,5 +53,221 @@ export interface RelockHistoryPage {
|
|
|
51
53
|
records: RelockHistoryRecord[];
|
|
52
54
|
nextCursor: RelockHistoryCursor | null;
|
|
53
55
|
}
|
|
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';
|
|
56
|
+
export type CompactFailureReason = 'unlocked' | 'detail_cursor_invalid' | 'detail_cursor_stale' | 'journal_cursor_invalid' | 'journal_cursor_stale' | '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';
|
|
57
|
+
export interface EvidenceCheckpointRecord {
|
|
58
|
+
version: 1;
|
|
59
|
+
seq: number;
|
|
60
|
+
recordedAt: string;
|
|
61
|
+
previousSha256: string | null;
|
|
62
|
+
context: {
|
|
63
|
+
featureId: string;
|
|
64
|
+
taskId: string;
|
|
65
|
+
snapshotSha256: string;
|
|
66
|
+
contract: NonNullable<ResumeCheckpoint['contract']>;
|
|
67
|
+
candidate: ResumeCheckpoint['candidate'];
|
|
68
|
+
candidateState: 'captured' | 'not_configured' | 'unavailable';
|
|
69
|
+
};
|
|
70
|
+
reported: CheckpointReported & {
|
|
71
|
+
provenance: 'caller_reported';
|
|
72
|
+
certification: 'none';
|
|
73
|
+
};
|
|
74
|
+
recordSha256: string;
|
|
75
|
+
}
|
|
76
|
+
export interface CheckpointPrepared {
|
|
77
|
+
root: WorkspaceRoot;
|
|
78
|
+
snapshot: CompletionSnapshot;
|
|
79
|
+
assessment: PreflightAssessment;
|
|
80
|
+
context: EvidenceCheckpointRecord['context'];
|
|
81
|
+
}
|
|
82
|
+
export interface CompactCore {
|
|
83
|
+
root: WorkspaceRoot;
|
|
84
|
+
snapshot: PreflightReadSnapshot;
|
|
85
|
+
summary: {
|
|
86
|
+
current: SddResult<ActiveTaskResult>;
|
|
87
|
+
progress: {
|
|
88
|
+
total: number;
|
|
89
|
+
completed: number;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
active: ActiveTaskDetails | null;
|
|
93
|
+
}
|
|
94
|
+
export interface CompactCapture extends CompactCore {
|
|
95
|
+
assessment?: PreflightAssessment;
|
|
96
|
+
authority: string | null;
|
|
97
|
+
journal: CheckpointJournalReference | null;
|
|
98
|
+
records: EvidenceCheckpointRecord[];
|
|
99
|
+
}
|
|
100
|
+
export interface ExecutionDetailPage {
|
|
101
|
+
version: 1;
|
|
102
|
+
featureId: string;
|
|
103
|
+
snapshotSha256: string;
|
|
104
|
+
journalSnapshotSha256: string | null;
|
|
105
|
+
section: ExecutionDetailCursor['section'];
|
|
106
|
+
contentSha256: string;
|
|
107
|
+
totalBytes: number;
|
|
108
|
+
offset: number;
|
|
109
|
+
text: string;
|
|
110
|
+
nextCursor: ExecutionDetailCursor | null;
|
|
111
|
+
}
|
|
112
|
+
export interface EvidenceHistoryPage {
|
|
113
|
+
version: 1;
|
|
114
|
+
featureId: string;
|
|
115
|
+
snapshotSha256: string;
|
|
116
|
+
journal: CheckpointJournalReference | null;
|
|
117
|
+
records: EvidenceCheckpointRecord[];
|
|
118
|
+
nextCursor: EvidenceHistoryCursor | null;
|
|
119
|
+
}
|
|
120
|
+
export interface RelockTransition {
|
|
121
|
+
index: number;
|
|
122
|
+
kind: 'contract_change' | 'identical_contract_reseal' | 'legacy_unknown';
|
|
123
|
+
changedArtifacts: ('spec' | 'plan' | 'tasks')[];
|
|
124
|
+
reasonSha256: string;
|
|
125
|
+
recordSha256: string;
|
|
126
|
+
}
|
|
127
|
+
export interface ExecutionWindow {
|
|
128
|
+
version: 1;
|
|
129
|
+
featureId: string;
|
|
130
|
+
status: ResumeCheckpoint['status'];
|
|
131
|
+
progress: ResumeCheckpoint['progress'];
|
|
132
|
+
task: ResumeCheckpoint['task'];
|
|
133
|
+
snapshotSha256: string | null;
|
|
134
|
+
contract: ResumeCheckpoint['contract'];
|
|
135
|
+
candidate: ResumeCheckpoint['candidate'];
|
|
136
|
+
verification: {
|
|
137
|
+
readiness: ResumeCheckpoint['readiness'];
|
|
138
|
+
integration: ResumeCheckpoint['integration'];
|
|
139
|
+
nextAction: ResumeCheckpoint['nextAction'];
|
|
140
|
+
gateCounts: {
|
|
141
|
+
valid: number;
|
|
142
|
+
missing: number;
|
|
143
|
+
rejected: number;
|
|
144
|
+
};
|
|
145
|
+
blockerReasons: VerificationPreflight['blockers'][number]['reason'][];
|
|
146
|
+
};
|
|
147
|
+
scope: {
|
|
148
|
+
declaredEntries: number;
|
|
149
|
+
create: number;
|
|
150
|
+
modify: number;
|
|
151
|
+
delete: number;
|
|
152
|
+
readOnly: number;
|
|
153
|
+
manifestSha256: string;
|
|
154
|
+
writes: ExecutionDetailCursor | null;
|
|
155
|
+
reads: ExecutionDetailCursor | null;
|
|
156
|
+
} | null;
|
|
157
|
+
taskDetail: ExecutionDetailCursor | null;
|
|
158
|
+
verificationDetail: ExecutionDetailCursor | null;
|
|
159
|
+
delta: {
|
|
160
|
+
basis: 'none' | 'latest_recorded_checkpoint';
|
|
161
|
+
contract: DeltaState;
|
|
162
|
+
candidate: DeltaState;
|
|
163
|
+
observed: DeltaState;
|
|
164
|
+
pathDiff: 'unavailable';
|
|
165
|
+
};
|
|
166
|
+
journal: {
|
|
167
|
+
state: 'absent' | 'available';
|
|
168
|
+
count: number;
|
|
169
|
+
reference: CheckpointJournalReference | null;
|
|
170
|
+
last: {
|
|
171
|
+
seq: number;
|
|
172
|
+
recordSha256: string;
|
|
173
|
+
kind: CheckpointReported['kind'];
|
|
174
|
+
outcome: CheckpointReported['outcome'];
|
|
175
|
+
cause: CheckpointReported['cause'];
|
|
176
|
+
provenance: 'caller_reported';
|
|
177
|
+
certification: 'none';
|
|
178
|
+
} | null;
|
|
179
|
+
firstCursor: EvidenceHistoryCursor | null;
|
|
180
|
+
};
|
|
181
|
+
relocks: {
|
|
182
|
+
count: number;
|
|
183
|
+
firstCursor: RelockHistoryCursor | null;
|
|
184
|
+
latestTransition: RelockTransition | null;
|
|
185
|
+
} | null;
|
|
186
|
+
}
|
|
187
|
+
export type DeltaState = 'same' | 'changed' | 'unavailable';
|
|
188
|
+
export interface ScopeSections {
|
|
189
|
+
entries: {
|
|
190
|
+
path: string;
|
|
191
|
+
permission: FilePermission;
|
|
192
|
+
}[];
|
|
193
|
+
writes: {
|
|
194
|
+
path: string;
|
|
195
|
+
permission: FilePermission;
|
|
196
|
+
}[];
|
|
197
|
+
reads: {
|
|
198
|
+
path: string;
|
|
199
|
+
permission: FilePermission;
|
|
200
|
+
}[];
|
|
201
|
+
texts: Record<ExecutionDetailCursor['section'], string>;
|
|
202
|
+
}
|
|
203
|
+
export interface ExecutionReadContext {
|
|
204
|
+
tasksPath: string;
|
|
205
|
+
workspaceRoot: string;
|
|
206
|
+
capability: CheckpointCapability;
|
|
207
|
+
scopedPolicy?: ScopedPolicy;
|
|
208
|
+
signal?: AbortSignal;
|
|
209
|
+
}
|
|
210
|
+
export type ResumePresentation = Pick<ResumeCheckpoint, 'status' | 'task' | 'readiness' | 'integration' | 'blockers' | 'nextAction'>;
|
|
211
|
+
export type ResumeHistory = ResumeCheckpoint['history'];
|
|
212
|
+
export type SetupHost = 'claude' | 'cursor' | 'codex' | 'gemini';
|
|
213
|
+
export interface SetupRow {
|
|
214
|
+
host: SetupHost;
|
|
215
|
+
role: string;
|
|
216
|
+
path: string;
|
|
217
|
+
referenceVersion: string;
|
|
218
|
+
referenceSha256: string | null;
|
|
219
|
+
installedSha256: string | null;
|
|
220
|
+
installedVersion: 'unverified';
|
|
221
|
+
status: 'match' | 'missing' | 'different' | 'unreadable' | 'reference_unavailable';
|
|
222
|
+
cause: HostSkillReadCause | 'content_mismatch' | 'reference_unavailable' | null;
|
|
223
|
+
proposedAction: 'none' | 'create_on_authorized_setup' | 'replace_on_authorized_setup' | 'inspect_path' | 'inspect_installation';
|
|
224
|
+
}
|
|
225
|
+
export interface SetupDiagnostics {
|
|
226
|
+
version: 1;
|
|
227
|
+
server: {
|
|
228
|
+
version: string;
|
|
229
|
+
tools: readonly string[];
|
|
230
|
+
count: 9;
|
|
231
|
+
scope: 'server_registration';
|
|
232
|
+
};
|
|
233
|
+
client: {
|
|
234
|
+
name: string;
|
|
235
|
+
version: string;
|
|
236
|
+
source: 'initialize';
|
|
237
|
+
provenance: 'client_reported';
|
|
238
|
+
} | null;
|
|
239
|
+
clientMetadataCause?: 'unavailable' | 'invalid' | 'over_limit';
|
|
240
|
+
effectiveMcpCatalogue: 'unverified';
|
|
241
|
+
skillCatalogue: 'unverified';
|
|
242
|
+
bundledVersion: string;
|
|
243
|
+
baseline: 'available' | 'unavailable';
|
|
244
|
+
selectedHost: SetupHost | 'all';
|
|
245
|
+
hosts?: {
|
|
246
|
+
host: SetupHost;
|
|
247
|
+
expectedRoles: 9;
|
|
248
|
+
matched: number;
|
|
249
|
+
missing: number;
|
|
250
|
+
different: number;
|
|
251
|
+
unreadable: number;
|
|
252
|
+
nextAction: string;
|
|
253
|
+
}[];
|
|
254
|
+
rows?: SetupRow[];
|
|
255
|
+
setup: {
|
|
256
|
+
operation: 'sdd_init_workspace';
|
|
257
|
+
scope: 'project';
|
|
258
|
+
force: false;
|
|
259
|
+
existingCurrentAgents: 'preserve';
|
|
260
|
+
authorization: 'required_for_setup';
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
export interface HostScanTarget {
|
|
264
|
+
slug: string;
|
|
265
|
+
relative: string;
|
|
266
|
+
}
|
|
267
|
+
export interface HostScanRow extends HostScanTarget {
|
|
268
|
+
referenceSha256: string | null;
|
|
269
|
+
installedSha256: string | null;
|
|
270
|
+
read: HostSkillReadResult;
|
|
271
|
+
matches: boolean;
|
|
272
|
+
}
|
|
55
273
|
//# sourceMappingURL=resume-views.d.ts.map
|
|
@@ -1,79 +1,9 @@
|
|
|
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
1
|
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
2
|
export interface TrinityIssue {
|
|
56
3
|
artifact: 'spec.md' | 'plan.md' | 'tasks.md';
|
|
57
4
|
rule: TrinityRule;
|
|
58
5
|
line?: number;
|
|
59
6
|
}
|
|
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
7
|
export interface ReceiptSealFailure {
|
|
78
8
|
ok: false;
|
|
79
9
|
code: 'ERR_TRINITY_INCOMPLETE';
|
|
@@ -92,11 +22,6 @@ export type VerificationReceipt = Omit<VerificationEvidence, 'gates'> & {
|
|
|
92
22
|
evidenceSha256: string;
|
|
93
23
|
signature: string;
|
|
94
24
|
};
|
|
95
|
-
export interface SignedVerificationReceipt {
|
|
96
|
-
receipt: VerificationReceipt;
|
|
97
|
-
message: readonly string[];
|
|
98
|
-
signature: Buffer;
|
|
99
|
-
}
|
|
100
25
|
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
26
|
export type ReceiptSetResult = {
|
|
102
27
|
ok: true;
|
|
@@ -131,31 +56,6 @@ export interface ReceiptSetAssessment {
|
|
|
131
56
|
gates: GateAssessment[];
|
|
132
57
|
blockers: PreflightBlocker[];
|
|
133
58
|
}
|
|
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
|
-
};
|
|
159
59
|
export type ArtifactType = 'spec' | 'plan' | 'tasks';
|
|
160
60
|
export type FilePermission = 'CREATE' | 'MODIFY' | 'READ_ONLY' | 'DELETE';
|
|
161
61
|
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';
|
|
@@ -180,13 +80,44 @@ export interface InitWorkspaceInput {
|
|
|
180
80
|
}
|
|
181
81
|
export interface ListFeaturesInput {
|
|
182
82
|
status_filter?: 'all' | 'planning' | 'executing' | 'done';
|
|
83
|
+
view?: 'setup_diagnostics';
|
|
84
|
+
host?: 'all' | 'claude' | 'cursor' | 'codex' | 'gemini';
|
|
183
85
|
}
|
|
184
86
|
export interface CreateFeatureInput {
|
|
185
87
|
id?: string;
|
|
186
88
|
title: string;
|
|
187
89
|
}
|
|
90
|
+
export interface CheckpointJournalReference {
|
|
91
|
+
snapshotSha256: string;
|
|
92
|
+
headSha256: string;
|
|
93
|
+
count: number;
|
|
94
|
+
}
|
|
95
|
+
export interface CheckpointReported {
|
|
96
|
+
kind: 'smoke' | 'required_gate' | 'review' | 'progress';
|
|
97
|
+
outcome: 'pass' | 'fail' | 'pending' | 'blocked' | 'skipped' | 'partial';
|
|
98
|
+
cause: 'implementation_checkpoint' | 'check_passed' | 'check_failed' | 'required_evidence_pending' | 'evidence_invalidated' | 'environment_blocked' | 'review_requested' | 'review_passed' | 'review_failed' | 'contract_change_proposed';
|
|
99
|
+
gateId: string | null;
|
|
100
|
+
evidenceSha256: string | null;
|
|
101
|
+
reviewRefSha256: string | null;
|
|
102
|
+
}
|
|
103
|
+
export interface EvidenceCheckpointInput {
|
|
104
|
+
version: 1;
|
|
105
|
+
expectedSnapshotSha256: string;
|
|
106
|
+
expectedJournal: CheckpointJournalReference | null;
|
|
107
|
+
reported: CheckpointReported;
|
|
108
|
+
}
|
|
109
|
+
export interface EvidenceCheckpointResult {
|
|
110
|
+
version: 1;
|
|
111
|
+
seq: number;
|
|
112
|
+
recordSha256: string;
|
|
113
|
+
journal: CheckpointJournalReference;
|
|
114
|
+
certification: 'none';
|
|
115
|
+
}
|
|
188
116
|
export interface LockSpecInput {
|
|
189
117
|
feature_id: string;
|
|
118
|
+
operation?: 'lock' | 'evidence_checkpoint';
|
|
119
|
+
task_id?: string;
|
|
120
|
+
checkpoint?: EvidenceCheckpointInput;
|
|
190
121
|
relock?: boolean;
|
|
191
122
|
reason?: string;
|
|
192
123
|
}
|
|
@@ -203,9 +134,24 @@ export interface RelockHistoryCursor {
|
|
|
203
134
|
snapshotSha256: string;
|
|
204
135
|
startIndex: number;
|
|
205
136
|
}
|
|
137
|
+
export interface ExecutionDetailCursor {
|
|
138
|
+
snapshotSha256: string;
|
|
139
|
+
journalSnapshotSha256: string | null;
|
|
140
|
+
section: 'write_scope' | 'read_scope' | 'active_task' | 'verification';
|
|
141
|
+
offset: number;
|
|
142
|
+
contentSha256: string;
|
|
143
|
+
}
|
|
144
|
+
export interface EvidenceHistoryCursor {
|
|
145
|
+
snapshotSha256: string;
|
|
146
|
+
journalSnapshotSha256: string;
|
|
147
|
+
headSha256: string;
|
|
148
|
+
startSeq: number;
|
|
149
|
+
}
|
|
206
150
|
export interface GetActiveTaskInput {
|
|
207
151
|
feature_id: string;
|
|
208
|
-
view?: 'verification_preflight' | 'resume' | 'relock_history';
|
|
152
|
+
view?: 'verification_preflight' | 'resume' | 'relock_history' | 'execution_window' | 'execution_detail' | 'evidence_history';
|
|
153
|
+
execution_cursor?: ExecutionDetailCursor;
|
|
154
|
+
evidence_cursor?: EvidenceHistoryCursor;
|
|
209
155
|
history_cursor?: RelockHistoryCursor;
|
|
210
156
|
verification_receipts?: Record<string, unknown>[];
|
|
211
157
|
}
|
|
@@ -276,15 +222,6 @@ export interface CompleteTaskResult {
|
|
|
276
222
|
receiptSetSha256: string;
|
|
277
223
|
};
|
|
278
224
|
}
|
|
279
|
-
export interface TaskParseAccumulator {
|
|
280
|
-
totalTasks: number;
|
|
281
|
-
completedTasks: number;
|
|
282
|
-
activeTaskIndex: number;
|
|
283
|
-
activeTaskId: string;
|
|
284
|
-
activeTaskTitle: string;
|
|
285
|
-
activeTaskLines: string[];
|
|
286
|
-
isCapturingActive: boolean;
|
|
287
|
-
}
|
|
288
225
|
export interface FeatureSummary {
|
|
289
226
|
id: string;
|
|
290
227
|
status: 'planning' | 'executing' | 'done';
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { SddResult, CompleteTaskResult } from './sdd-engine.js';
|
|
2
1
|
export type VerificationPolicyInput = Readonly<{
|
|
3
2
|
version: 1;
|
|
4
3
|
mode: 'disabled';
|
|
@@ -48,7 +47,6 @@ export type ScopedTaskSelector = (content: string) => ScopedTaskSelection | null
|
|
|
48
47
|
export type ScopedPolicy = Extract<VerificationPolicy, {
|
|
49
48
|
mode: 'scoped';
|
|
50
49
|
}>;
|
|
51
|
-
export type ScopedSnapshotResult = SddResult<ScopedVerificationSnapshot>;
|
|
52
50
|
export interface ScopedVerificationRun {
|
|
53
51
|
readonly ok: boolean;
|
|
54
52
|
readonly exitCode: number | null;
|
|
@@ -72,12 +70,4 @@ export interface ScopedVerificationRunnerTiming {
|
|
|
72
70
|
readonly pollIntervalMs?: number;
|
|
73
71
|
}
|
|
74
72
|
export type VerificationGroupState = 'absent' | 'present' | 'unknown';
|
|
75
|
-
export interface ScopedVerificationCompletionContext {
|
|
76
|
-
readonly tasksPath: string;
|
|
77
|
-
readonly taskId: string;
|
|
78
|
-
readonly workspaceRoot: string;
|
|
79
|
-
readonly selectTask: ScopedTaskSelector;
|
|
80
|
-
readonly signal?: AbortSignal;
|
|
81
|
-
readonly commit: (snapshot: ScopedVerificationSnapshot, output: string, signal: AbortSignal) => Promise<SddResult<CompleteTaskResult>>;
|
|
82
|
-
}
|
|
83
73
|
//# sourceMappingURL=verification.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planu/cli",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.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",
|
|
@@ -86,17 +86,17 @@
|
|
|
86
86
|
"happy-dom": "^21.0.4",
|
|
87
87
|
"husky": "^9.1.7",
|
|
88
88
|
"jiti": "2.7.0",
|
|
89
|
-
"knip": "^6.
|
|
89
|
+
"knip": "^6.45.1",
|
|
90
90
|
"lint-staged": "^17.6.0",
|
|
91
91
|
"madge": "^8.0.0",
|
|
92
|
-
"prettier": "^3.
|
|
92
|
+
"prettier": "^3.10.1",
|
|
93
93
|
"qrcode": "1.5.4",
|
|
94
94
|
"secretlint": "^13.1.0",
|
|
95
95
|
"tsc-alias": "^1.9.10",
|
|
96
96
|
"type-coverage": "^2.31.2",
|
|
97
97
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
98
|
-
"typescript-eslint": "^8.72.
|
|
99
|
-
"vite": "^8.3.
|
|
98
|
+
"typescript-eslint": "^8.72.2",
|
|
99
|
+
"vite": "^8.3.8",
|
|
100
100
|
"vitest": "^5.1.0"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|