@planu/cli 8.6.0 → 8.7.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.
@@ -1,7 +1,7 @@
1
1
  import type { KeyObject } from 'node:crypto';
2
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';
3
+ import type { SddLockFile, ErrorCode, TrinityIssue, FilePermission, VerificationGate, VerificationReceipt, SddResult, CompleteTaskResult, CheckpointJournalReference, VerificationPreflight } from './sdd-engine.js';
4
+ import type { ScopedVerificationSnapshot, ScopedTaskSelector, ScopedTaskSelection, VerificationBudgetDiagnostic } from './verification.js';
5
5
  export type CompletionFailureReason = 'guard_present' | 'contract_drift' | 'cancelled' | 'persistence_uncertain';
6
6
  export interface PhysicalIdentity {
7
7
  dev: number;
@@ -245,5 +245,20 @@ export interface CheckpointWriteState {
245
245
  started(): boolean;
246
246
  }
247
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
+ type VerificationBudgetStateReason = 'verification_in_progress' | 'verification_grant_consumed' | 'verification_grant_quarantined';
249
+ export type VerificationBudgetReader = (taskId: string) => VerificationBudgetStateReason | null | undefined;
250
+ export type ScopedVerificationPinCapture = Pick<ScopedVerificationSnapshot, 'workspaceRoot' | 'tasksPath' | 'taskId' | 'specContent' | 'planContent' | 'tasksContent' | 'lockContent'>;
251
+ export type ScopedVerificationTaskPinCheck = (selected: ScopedTaskSelection | null) => SddResult<string>;
252
+ export interface VerificationBudgetContext {
253
+ readonly tasksPath: string;
254
+ readonly workspaceRoot: string;
255
+ readonly root: WorkspaceRoot;
256
+ readonly snapshot: PreflightReadSnapshot;
257
+ readonly selected: ScopedTaskSelection | null;
258
+ readonly preflight: VerificationPreflight;
259
+ }
260
+ export type BudgetDeniedReason = Extract<VerificationBudgetDiagnostic, {
261
+ admission: 'denied';
262
+ }>['reason'];
248
263
  export {};
249
264
  //# sourceMappingURL=completion.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { ScopedPolicy } from './verification.js';
1
+ import type { ScopedPolicy, VerificationBudgetDiagnostic } from './verification.js';
2
2
  import type { WorkspaceRoot, CompletionSnapshot, VerificationInputSnapshot, CheckpointCapability, PreflightReadSnapshot } from './completion.js';
3
3
  import type { HostSkillReadCause, HostSkillReadResult, CheckpointReported, CheckpointJournalReference, ExecutionDetailCursor, EvidenceHistoryCursor, SddResult, ActiveTaskResult, ActiveTaskDetails, FilePermission, PreflightAction, RelockHistoryCursor, VerificationEvidence, VerificationPreflight } from './sdd-engine.js';
4
4
  export interface PreflightAssessment {
@@ -7,6 +7,7 @@ export interface PreflightAssessment {
7
7
  inputs?: VerificationInputSnapshot;
8
8
  }
9
9
  export interface ResumeCheckpoint {
10
+ budget?: VerificationBudgetDiagnostic;
10
11
  version: 1;
11
12
  featureId: string;
12
13
  status: 'active' | 'unlocked' | 'complete' | 'no_tasks';
@@ -1,3 +1,4 @@
1
+ import type { VerificationBudgetDiagnostic, VerificationProcessEvidence } from './verification.js';
1
2
  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';
2
3
  export interface TrinityIssue {
3
4
  artifact: 'spec.md' | 'plan.md' | 'tasks.md';
@@ -37,12 +38,13 @@ export interface GateAssessment {
37
38
  state: 'receipt_valid' | 'receipt_missing' | 'receipt_rejected';
38
39
  reason?: ReceiptRejectionReason;
39
40
  }
40
- export type PreflightBlockerReason = ReceiptRejectionReason | 'unlocked' | 'command_missing' | 'platform_unsupported' | 'receipt_input_unavailable' | 'receipt_observed_baseline_drift' | 'receipt_scoped_unsupported' | 'receipt_not_configured';
41
+ export type PreflightBlockerReason = ReceiptRejectionReason | 'unlocked' | 'command_missing' | 'platform_unsupported' | 'receipt_input_unavailable' | 'receipt_observed_baseline_drift' | 'receipt_scoped_unsupported' | 'receipt_not_configured' | 'verification_policy_mismatch' | 'verification_policy_workspace_mismatch' | 'verification_state_unavailable' | 'verification_in_progress' | 'verification_grant_consumed' | 'verification_grant_quarantined';
41
42
  interface PreflightBlocker {
42
43
  reason: PreflightBlockerReason;
43
44
  }
44
- export type PreflightAction = 'fix_inputs' | 'review_observed_drift' | 'obtain_receipts' | 'use_supported_runtime' | 'review_lock' | 'restore_verification' | 'attempt_integration' | 'none';
45
+ export type PreflightAction = 'fix_inputs' | 'review_observed_drift' | 'obtain_receipts' | 'use_supported_runtime' | 'review_lock' | 'review_verification_policy' | 'restore_verification' | 'attempt_integration' | 'none';
45
46
  export interface VerificationPreflight {
47
+ budget?: VerificationBudgetDiagnostic;
46
48
  version: 1;
47
49
  taskId: string | null;
48
50
  status: 'blocked' | 'ready_to_attempt' | 'not_applicable';
@@ -213,6 +215,7 @@ export interface ActiveTaskResult {
213
215
  verificationPreflight?: VerificationPreflight;
214
216
  }
215
217
  export interface CompleteTaskResult {
218
+ verificationProcess?: VerificationProcessEvidence;
216
219
  completedTaskId: string;
217
220
  verificationSummary: string;
218
221
  remainingTasks: number;
@@ -70,4 +70,31 @@ export interface ScopedVerificationRunnerTiming {
70
70
  readonly pollIntervalMs?: number;
71
71
  }
72
72
  export type VerificationGroupState = 'absent' | 'present' | 'unknown';
73
+ export type VerificationBudgetDiagnostic = Readonly<{
74
+ version: 1;
75
+ admission: 'default';
76
+ effectiveTimeoutMs: 180000;
77
+ reason: 'default_policy' | 'outside_scoped_grant';
78
+ }> | Readonly<{
79
+ version: 1;
80
+ admission: 'scoped';
81
+ effectiveTimeoutMs: number;
82
+ reason: 'trusted_startup_match';
83
+ }> | Readonly<{
84
+ version: 1;
85
+ admission: 'denied';
86
+ effectiveTimeoutMs: null;
87
+ reason: 'no_active_task' | 'unlocked' | 'command_missing' | 'platform_unsupported' | 'receipt_scoped_unsupported' | 'verification_policy_mismatch' | 'verification_policy_workspace_mismatch' | 'verification_state_unavailable' | 'verification_in_progress' | 'verification_grant_consumed' | 'verification_grant_quarantined';
88
+ }>;
89
+ export interface VerificationProcessEvidence {
90
+ readonly version: 1;
91
+ readonly timeoutMs: number;
92
+ readonly timedOut: boolean;
93
+ readonly cancelled: boolean;
94
+ readonly exitCode: number | null;
95
+ readonly signal: NodeJS.Signals | null;
96
+ readonly cleanupComplete: boolean;
97
+ readonly cleanupScope: 'owned_process_group';
98
+ readonly fixturePostconditions: 'unknown';
99
+ }
73
100
  //# sourceMappingURL=verification.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planu/cli",
3
- "version": "8.6.0",
3
+ "version": "8.7.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",
@@ -21,6 +21,10 @@ If `history` is null, follow `nextAction` without requesting history. If `histor
21
21
 
22
22
  For supported connections, inspect `sdd_list_features` with `view="setup_diagnostics"` and an optional fixed `host`; server registration, installed file hashes and client-reported identity do not prove the host-effective catalogue. Reload the client catalogue only when needed. For a locked task use `execution_window`, follow its `execution_detail` cursors and `evidence_history` pages; reread the window when a cursor is stale. These views are non-certifying. Explicitly record an already observed attempt with `sdd_lock_spec(operation="evidence_checkpoint")` only after inspecting the selected connection’s advertised input schema for `operation`, `checkpoint` and `task_id` and confirming a supporting engine version. The global 8.5.1 server does not gain new inputs from source edits: never probe an unknown mutation, or fall back to lock/relock, because old schemas may strip fields and seal instead. Report unsupported capability. The journal retains only explicitly recorded observations; failures are not recorded automatically. Its caller-reported outcome is not certification; the server captures identity and eligible digests. Preserve uncertain guards for operator review.
23
23
 
24
+ Before attempting completion, request a fresh explicit `verification_preflight` or `resume` and require `budget.version=1`; absence is unavailable, never a grant. An older producer may omit it. The observation is advisory, not a reservation or grant. `execution_window` and `execution_detail` are not decorated with budget and cannot substitute for that fresh request. When a verification process actually ran, its `verificationProcess` reports the effective timeout, outcome and owned process group cleanup; `fixturePostconditions` remains `unknown`. Group cleanup alone does not prove fixture safety. These diagnostics do not record attempts automatically or authorize policy changes, retries or extra time. Reconcile uncertain state before acting.
25
+
26
+ Effective MODIFY (including CREATE with a nonempty search) requires a regular single-link target with strict UTF-8; ownership is checked where the platform provides getuid. Stable safe internal symlinks remain supported. A write, truncate, sync or close failure may leave partial changes; inspect before retrying. Checks do not guarantee protection against a hostile same-UID process inserting a link after the final check.
27
+
24
28
  ## Delegation
25
29
 
26
30
  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.
@@ -20,6 +20,10 @@ If `history` is null, follow `nextAction` without requesting history. If `histor
20
20
 
21
21
  For supported connections, inspect `sdd_list_features` with `view="setup_diagnostics"` and an optional fixed `host`; server registration, installed file hashes and client-reported identity do not prove the host-effective catalogue. Reload the client catalogue only when needed. For a locked task use `execution_window`, follow its `execution_detail` cursors and `evidence_history` pages; reread the window when a cursor is stale. These views are non-certifying. Explicitly record an already observed attempt with `sdd_lock_spec(operation="evidence_checkpoint")` only after inspecting the selected connection’s advertised input schema for `operation`, `checkpoint` and `task_id` and confirming a supporting engine version. The global 8.5.1 server does not gain new inputs from source edits: never probe an unknown mutation, or fall back to lock/relock, because old schemas may strip fields and seal instead. Report unsupported capability. The journal retains only explicitly recorded observations; failures are not recorded automatically. Its caller-reported outcome is not certification; the server captures identity and eligible digests. Preserve uncertain guards for operator review.
22
22
 
23
+ Before attempting completion, request a fresh explicit `verification_preflight` or `resume` and require `budget.version=1`; absence is unavailable, never a grant. An older producer may omit it. The observation is advisory, not a reservation or grant. `execution_window` and `execution_detail` are not decorated with budget and cannot substitute for that fresh request. When a verification process actually ran, its `verificationProcess` reports the effective timeout, outcome and owned process group cleanup; `fixturePostconditions` remains `unknown`. Group cleanup alone does not prove fixture safety. These diagnostics do not record attempts automatically or authorize policy changes, retries or extra time. Reconcile uncertain state before acting.
24
+
25
+ Effective MODIFY (including CREATE with a nonempty search) requires a regular single-link target with strict UTF-8; ownership is checked where the platform provides getuid. Stable safe internal symlinks remain supported. A write, truncate, sync or close failure may leave partial changes; inspect before retrying. Checks do not guarantee protection against a hostile same-UID process inserting a link after the final check.
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.