@wrongstack/core 0.273.0 → 0.274.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/{agent-bridge-BZ2enORi.d.ts → agent-bridge-DFo21wmY.d.ts} +1 -1
  2. package/dist/{agent-subagent-runner-ehb4xGvd.d.ts → agent-subagent-runner-BwmkIDEd.d.ts} +7 -7
  3. package/dist/{brain-BxN2k2HP.d.ts → brain-gfZX3the.d.ts} +11 -5
  4. package/dist/{provider-model-resolve-DFd3IPpw.d.ts → codex-catalog-CooZ6mOl.d.ts} +47 -4
  5. package/dist/{compactor-72ug-ZRB.d.ts → compactor-riTOds0f.d.ts} +1 -1
  6. package/dist/{config-C8IYxlO8.d.ts → config-BxcrDzri.d.ts} +60 -4
  7. package/dist/{context-Dw55zZ_Q.d.ts → context-DERiLofu.d.ts} +60 -1
  8. package/dist/coordination/index.d.ts +27 -16
  9. package/dist/coordination/index.js +1641 -1398
  10. package/dist/coordination/index.js.map +1 -1
  11. package/dist/defaults/index.d.ts +26 -26
  12. package/dist/defaults/index.js +2154 -1466
  13. package/dist/defaults/index.js.map +1 -1
  14. package/dist/execution/index.d.ts +15 -15
  15. package/dist/execution/index.js +77 -9
  16. package/dist/execution/index.js.map +1 -1
  17. package/dist/execution/prompt-enhancer.d.ts +1 -1
  18. package/dist/extension/index.d.ts +6 -6
  19. package/dist/{global-mailbox-C9dsc9Y_.d.ts → global-mailbox-Cr8TW4t_.d.ts} +1 -1
  20. package/dist/{goal-preamble-NhflDjYb.d.ts → goal-preamble-CEhROp1e.d.ts} +9 -9
  21. package/dist/{goal-store-Cx363x7Z.d.ts → goal-store-xNSVxmpV.d.ts} +1 -1
  22. package/dist/hq/index.d.ts +5 -5
  23. package/dist/{index-B7fHDt0B.d.ts → index-00KPKAlm.d.ts} +5 -5
  24. package/dist/{index-BbVprU-9.d.ts → index-pDBSBE1r.d.ts} +2 -2
  25. package/dist/index.d.ts +72 -45
  26. package/dist/index.js +2840 -1769
  27. package/dist/index.js.map +1 -1
  28. package/dist/infrastructure/index.d.ts +6 -6
  29. package/dist/kernel/index.d.ts +11 -11
  30. package/dist/kernel/index.js.map +1 -1
  31. package/dist/{mcp-servers-B6fSRNC1.d.ts → mcp-servers-BIwRiOxe.d.ts} +3 -3
  32. package/dist/models/index.d.ts +5 -5
  33. package/dist/models/index.js +40 -2
  34. package/dist/models/index.js.map +1 -1
  35. package/dist/{models-registry-4C6Wr91w.d.ts → models-registry-8OorW51H.d.ts} +1 -1
  36. package/dist/{multi-agent-coordinator-q1skFeNP.d.ts → multi-agent-coordinator-CNx48Zoz.d.ts} +1 -1
  37. package/dist/{null-fleet-bus-C9rrgQwc.d.ts → null-fleet-bus-B4ZUJYL6.d.ts} +6 -6
  38. package/dist/observability/index.d.ts +2 -2
  39. package/dist/{parallel-eternal-engine-CtXly2Sf.d.ts → parallel-eternal-engine-rsIclDqO.d.ts} +9 -9
  40. package/dist/{path-resolver-Bim6G5Jz.d.ts → path-resolver-BqU-fwzD.d.ts} +3 -3
  41. package/dist/{permission-CC7XFYWG.d.ts → permission-Dgs3v-Xq.d.ts} +1 -1
  42. package/dist/{permission-policy-cYR4RJmw.d.ts → permission-policy-Dtht2k0e.d.ts} +2 -2
  43. package/dist/{pipeline-CNVKuQDQ.d.ts → pipeline-B-dpCFYS.d.ts} +2 -2
  44. package/dist/{plan-templates-C4wXMmiM.d.ts → plan-templates-B7MxyY2o.d.ts} +58 -5
  45. package/dist/{provider-runner-BpM0mdBE.d.ts → provider-runner-DrmpBE5l.d.ts} +3 -3
  46. package/dist/{retry-policy-BV7nzeAd.d.ts → retry-policy-hYxsm10a.d.ts} +1 -1
  47. package/dist/sdd/index.d.ts +12 -10
  48. package/dist/sdd/index.js +7 -0
  49. package/dist/sdd/index.js.map +1 -1
  50. package/dist/{secret-vault-eMBKfheR.d.ts → secret-vault-DnqIFhPF.d.ts} +1 -1
  51. package/dist/security/index.d.ts +5 -5
  52. package/dist/{selector-C4ORTOid.d.ts → selector-D21RjDIg.d.ts} +1 -1
  53. package/dist/{session-event-bridge-CeNpUL9w.d.ts → session-event-bridge-Dt54CTvq.d.ts} +1 -1
  54. package/dist/{session-reader-BepLSnGL.d.ts → session-reader-CceH13Kq.d.ts} +5 -4
  55. package/dist/storage/index.d.ts +46 -12
  56. package/dist/storage/index.js +2281 -1476
  57. package/dist/storage/index.js.map +1 -1
  58. package/dist/tools/index.d.ts +2 -2
  59. package/dist/types/index.d.ts +19 -19
  60. package/dist/types/index.js +162 -42
  61. package/dist/types/index.js.map +1 -1
  62. package/dist/utils/index.d.ts +2 -2
  63. package/dist/{worktree-manager-BDuXTaWL.d.ts → worktree-manager-DUfBbKzk.d.ts} +1 -1
  64. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { M as ModelsRegistry, a as ModelsDevPayload, R as ResolvedProvider, b as ResolvedModel, W as WireFamily } from './config-C8IYxlO8.js';
1
+ import { M as ModelsRegistry, a as ModelsDevPayload, R as ResolvedProvider, b as ResolvedModel, W as WireFamily } from './config-BxcrDzri.js';
2
2
 
3
3
  interface DefaultModelsRegistryOptions {
4
4
  cacheFile: string;
@@ -1,4 +1,4 @@
1
- import { S as SubagentConfig, M as MultiAgentCoordinator, c as MultiAgentConfig, d as SubagentRunner, F as FleetBus, e as SpawnResult, T as TaskSpec, a as BridgeMessage, A as AgentBridge, C as CoordinatorStatus, f as TaskResult } from './agent-subagent-runner-ehb4xGvd.js';
1
+ import { S as SubagentConfig, M as MultiAgentCoordinator, c as MultiAgentConfig, d as SubagentRunner, F as FleetBus, e as SpawnResult, T as TaskSpec, a as BridgeMessage, A as AgentBridge, C as CoordinatorStatus, f as TaskResult } from './agent-subagent-runner-BwmkIDEd.js';
2
2
  import { EventEmitter } from 'node:events';
3
3
 
4
4
  /**
@@ -1,12 +1,12 @@
1
- import { A as AgentPhase, b as AgentDefinition, a as DefaultMultiAgentCoordinator, D as DispatchClassifier } from './multi-agent-coordinator-q1skFeNP.js';
2
- import { F as FleetBus, i as FleetUsage, S as SubagentConfig, j as FleetUsageAggregator, f as TaskResult, C as CoordinatorStatus, T as TaskSpec, c as MultiAgentConfig, d as SubagentRunner } from './agent-subagent-runner-ehb4xGvd.js';
3
- import { b as SessionWriter, T as Tool, k as SessionStore } from './context-Dw55zZ_Q.js';
4
- import { B as BrainArbiter, E as EventBus } from './brain-BxN2k2HP.js';
1
+ import { A as AgentPhase, b as AgentDefinition, a as DefaultMultiAgentCoordinator, D as DispatchClassifier } from './multi-agent-coordinator-CNx48Zoz.js';
2
+ import { F as FleetBus, i as FleetUsage, S as SubagentConfig, j as FleetUsageAggregator, f as TaskResult, C as CoordinatorStatus, T as TaskSpec, c as MultiAgentConfig, d as SubagentRunner } from './agent-subagent-runner-BwmkIDEd.js';
3
+ import { b as SessionWriter, T as Tool, k as SessionStore } from './context-DERiLofu.js';
4
+ import { B as BrainArbiter, E as EventBus } from './brain-gfZX3the.js';
5
5
  import { EventEmitter } from 'node:events';
6
6
  import { L as Logger } from './logger-B63L5bTg.js';
7
7
  import { D as DirectorStateSnapshot } from './director-state-BfeCUbmk.js';
8
- import { d as ModelMatrixEntry } from './config-C8IYxlO8.js';
9
- import { I as InMemoryAgentBridge } from './agent-bridge-BZ2enORi.js';
8
+ import { d as ModelMatrixEntry } from './config-BxcrDzri.js';
9
+ import { I as InMemoryAgentBridge } from './agent-bridge-DFo21wmY.js';
10
10
 
11
11
  /**
12
12
  * Alert levels the Director can emit when a collab session needs attention.
@@ -1,6 +1,6 @@
1
1
  import { M as MetricsSink, d as MetricLabels, f as MetricsSnapshot, H as HealthRegistry, a as HealthCheck, A as AggregateHealth, T as Tracer, S as Span } from '../observability-D-HZN_mF.js';
2
- import { E as EventBus } from '../brain-BxN2k2HP.js';
3
- import '../context-Dw55zZ_Q.js';
2
+ import { E as EventBus } from '../brain-gfZX3the.js';
3
+ import '../context-DERiLofu.js';
4
4
 
5
5
  /**
6
6
  * In-memory metrics sink. Suitable for embedded use, tests, and /metrics
@@ -1,12 +1,12 @@
1
- import { g as ProviderError, C as Context, T as Tool, r as ToolUseBlock, s as ToolResultBlock } from './context-Dw55zZ_Q.js';
2
- import { R as RetryPolicy, E as ErrorHandler, a as RecoveryDecision } from './retry-policy-BV7nzeAd.js';
3
- import { C as Compactor, a as CompactReport } from './compactor-72ug-ZRB.js';
4
- import { M as ModelsRegistry, C as Config } from './config-C8IYxlO8.js';
5
- import { T as ToolExecutorOptions, a as ToolExecutorStrategy, b as ToolBatchResult } from './index-B7fHDt0B.js';
6
- import { g as Agent, h as AgentFactory } from './agent-subagent-runner-ehb4xGvd.js';
7
- import { B as BrainArbiter, E as EventBus } from './brain-BxN2k2HP.js';
8
- import { J as JournalEntry } from './goal-store-Cx363x7Z.js';
9
- import { D as DispatchClassifier, a as DefaultMultiAgentCoordinator } from './multi-agent-coordinator-q1skFeNP.js';
1
+ import { g as ProviderError, C as Context, T as Tool, r as ToolUseBlock, s as ToolResultBlock } from './context-DERiLofu.js';
2
+ import { R as RetryPolicy, E as ErrorHandler, a as RecoveryDecision } from './retry-policy-hYxsm10a.js';
3
+ import { C as Compactor, a as CompactReport } from './compactor-riTOds0f.js';
4
+ import { M as ModelsRegistry, C as Config } from './config-BxcrDzri.js';
5
+ import { T as ToolExecutorOptions, a as ToolExecutorStrategy, b as ToolBatchResult } from './index-00KPKAlm.js';
6
+ import { g as Agent, h as AgentFactory } from './agent-subagent-runner-BwmkIDEd.js';
7
+ import { B as BrainArbiter, E as EventBus } from './brain-gfZX3the.js';
8
+ import { J as JournalEntry } from './goal-store-xNSVxmpV.js';
9
+ import { D as DispatchClassifier, a as DefaultMultiAgentCoordinator } from './multi-agent-coordinator-CNx48Zoz.js';
10
10
 
11
11
  declare class DefaultRetryPolicy implements RetryPolicy {
12
12
  shouldRetry(err: Error | ProviderError, attempt: number): boolean;
@@ -1,6 +1,6 @@
1
- import { E as EventBus } from './brain-BxN2k2HP.js';
2
- import { M as ModelsRegistry, b as ResolvedModel } from './config-C8IYxlO8.js';
3
- import { e as TokenCounter, U as Usage, f as CacheStats } from './context-Dw55zZ_Q.js';
1
+ import { E as EventBus } from './brain-gfZX3the.js';
2
+ import { M as ModelsRegistry, b as ResolvedModel } from './config-BxcrDzri.js';
3
+ import { e as TokenCounter, U as Usage, f as CacheStats } from './context-DERiLofu.js';
4
4
  import { P as PathResolver } from './path-resolver-CPRj4bFY.js';
5
5
 
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { T as Tool, C as Context, h as Permission } from './context-Dw55zZ_Q.js';
1
+ import { T as Tool, C as Context, h as Permission } from './context-DERiLofu.js';
2
2
 
3
3
  interface SecretScrubber {
4
4
  scrub(text: string): string;
@@ -1,6 +1,6 @@
1
- import { T as Tool, C as Context } from './context-Dw55zZ_Q.js';
1
+ import { T as Tool, C as Context } from './context-DERiLofu.js';
2
2
  import { I as InputReader } from './input-reader-E-ffP2ee.js';
3
- import { P as PermissionPolicy, a as PermissionDecision } from './permission-CC7XFYWG.js';
3
+ import { P as PermissionPolicy, a as PermissionDecision } from './permission-Dgs3v-Xq.js';
4
4
 
5
5
  interface PermissionPolicyOptions {
6
6
  trustFile: string;
@@ -1,6 +1,6 @@
1
- import { T as Tool, q as TextBlock, i as ContentBlock } from './context-Dw55zZ_Q.js';
1
+ import { T as Tool, q as TextBlock, i as ContentBlock } from './context-DERiLofu.js';
2
2
  import { a as MailboxAgentStatus } from './mailbox-types-Ct2hJq0P.js';
3
- import { H as HookEvent, f as HookMatcher, I as InProcessHook, S as ShellHook, g as HookEntry } from './config-C8IYxlO8.js';
3
+ import { H as HookEvent, f as HookMatcher, I as InProcessHook, S as ShellHook, g as HookEntry } from './config-BxcrDzri.js';
4
4
 
5
5
  /** Model capabilities relevant to prompt composition. */
6
6
  interface ModelCapabilities {
@@ -1,9 +1,9 @@
1
- import { E as EventBus, M as MemoryScope, b as MemoryEntry, c as MemoryStore, d as MemoryRelevanceContext, S as ScoredEntry } from './brain-BxN2k2HP.js';
2
- import { S as SecretScrubber } from './permission-CC7XFYWG.js';
3
- import { k as SessionStore, j as SessionMetadata, b as SessionWriter, u as ResumedSession, v as SessionData, w as SessionSummary, i as ContentBlock, S as SessionEvent, x as TodoItem, y as ConversationState } from './context-Dw55zZ_Q.js';
4
- import { A as AttachmentStore, a as AddAttachmentInput, b as AttachmentRef, c as Attachment } from './session-reader-BepLSnGL.js';
1
+ import { E as EventBus, M as MemoryScope, b as MemoryEntry, c as MemoryStore, d as MemoryRelevanceContext, S as ScoredEntry } from './brain-gfZX3the.js';
2
+ import { S as SecretScrubber } from './permission-Dgs3v-Xq.js';
3
+ import { k as SessionStore, j as SessionMetadata, b as SessionWriter, u as ResumedSession, v as SessionData, S as SessionEvent, w as SessionSummary, i as ContentBlock, x as TodoItem, y as ConversationState } from './context-DERiLofu.js';
4
+ import { A as AttachmentStore, a as AddAttachmentInput, b as AttachmentRef, c as Attachment } from './session-reader-CceH13Kq.js';
5
5
  import { W as WstackPaths } from './wstack-paths-BqkDAkoh.js';
6
- import { j as ConfigStore, C as Config, k as ConfigLoader, l as SyncConfig } from './config-C8IYxlO8.js';
6
+ import { j as ConfigStore, C as Config, k as ConfigLoader, l as SyncConfig } from './config-BxcrDzri.js';
7
7
  import { S as SecretVault } from './secret-vault-BAKpgFw_.js';
8
8
 
9
9
  interface SessionStoreOptions {
@@ -36,6 +36,7 @@ declare class DefaultSessionStore implements SessionStore {
36
36
  */
37
37
  private readonly _loadCache;
38
38
  private _indexCache;
39
+ private readonly shardManifestCache;
39
40
  private static readonly LOAD_CACHE_MAX_ENTRIES;
40
41
  private static readonly LIST_SCAN_CONCURRENCY;
41
42
  constructor(opts: SessionStoreOptions);
@@ -51,6 +52,9 @@ declare class DefaultSessionStore implements SessionStore {
51
52
  private get indexFile();
52
53
  /** Join session ID to its absolute path within the store directory. */
53
54
  private sessionPath;
55
+ private shardManifestPath;
56
+ private shardKeyForSessionId;
57
+ private invalidateShardManifestBySessionId;
54
58
  /**
55
59
  * Ensure the directory implied by the session ID exists. When the ID
56
60
  * contains a date prefix like `2026-06-06/...`, this creates the date
@@ -60,7 +64,51 @@ declare class DefaultSessionStore implements SessionStore {
60
64
  create(meta: Omit<SessionMetadata, 'startedAt'>): Promise<SessionWriter>;
61
65
  resume(id: string): Promise<ResumedSession>;
62
66
  load(id: string): Promise<SessionData>;
67
+ /**
68
+ * Streaming search over a session's JSONL. Walks the file once, parses
69
+ * each event lazily, and yields only the events that match `predicate`.
70
+ * Stops as soon as `opts.limit` matches are collected.
71
+ *
72
+ * Why this exists: `load()` parses the entire file into memory and
73
+ * rebuilds `messages`/`toolCallEnds` for every caller. `search()` only
74
+ * needs to know which events contain matching text — a per-line
75
+ * predicate is enough. The full parse work (and the `_loadCache` poll)
76
+ * is wasted in that case.
77
+ *
78
+ * Memory: O(hits) regardless of file size. Disk: one linear scan,
79
+ * terminated at `limit` if the caller asked for one.
80
+ *
81
+ * Errors: missing file yields []. Corrupt lines are skipped (same
82
+ * policy as `load()`). Aborting via `signal` rejects with `AbortError`.
83
+ */
84
+ searchEvents(id: string, predicate: (event: SessionEvent, eventIndex: number, ts: string) => boolean, opts?: {
85
+ limit?: number | undefined;
86
+ signal?: AbortSignal | undefined;
87
+ }): Promise<Array<{
88
+ event: SessionEvent;
89
+ eventIndex: number;
90
+ ts: string;
91
+ }>>;
63
92
  list(limit?: number): Promise<SessionSummary[]>;
93
+ /**
94
+ * List sessions matching filter criteria, using the cached index.
95
+ * Filters are applied BEFORE sorting and slicing, so the caller gets
96
+ * exactly `limit` matching sessions — not a slice of a larger fetch.
97
+ *
98
+ * This avoids the DefaultSessionReader pattern of fetching 1000 sessions
99
+ * then linear-filtering: the index is already in memory (readIndex
100
+ * caches it), and the filter runs over the cached array without any
101
+ * additional disk I/O.
102
+ */
103
+ listFiltered(criteria: {
104
+ since?: string | undefined;
105
+ until?: string | undefined;
106
+ provider?: string | undefined;
107
+ model?: string | undefined;
108
+ minTokens?: number | undefined;
109
+ titleContains?: string | undefined;
110
+ limit?: number | undefined;
111
+ }): Promise<SessionSummary[]>;
64
112
  private indexAppendCount;
65
113
  private static readonly COMPACT_EVERY;
66
114
  /** Append a session summary to the index. */
@@ -84,6 +132,9 @@ declare class DefaultSessionStore implements SessionStore {
84
132
  */
85
133
  rebuildIndex(): Promise<number>;
86
134
  private listFromDirectoryScan;
135
+ private collectShardKeys;
136
+ private readOrBuildShardManifest;
137
+ private collectSessionFilesInShard;
87
138
  private collectSessionFiles;
88
139
  /** Recursively collect session IDs from date-shard subdirectories.
89
140
  * IDs include the date-prefix path (e.g. "2026-06-06/17-46-57Z_…").
@@ -365,11 +416,13 @@ declare class DefaultConfigLoader implements ConfigLoader {
365
416
  private readonly extraSources;
366
417
  private readonly events;
367
418
  private readonly traceId;
419
+ private readonly jsonCache;
368
420
  constructor(opts: ConfigLoaderOptions);
369
421
  load(opts?: {
370
422
  cliFlags?: Partial<Config> | undefined;
371
423
  cwd?: string | undefined;
372
424
  }): Promise<Config>;
425
+ private ensureGlobalDefaults;
373
426
  /**
374
427
  * Persist a sync config to ~/.wrongstack/sync.json, with the token encrypted
375
428
  * by the vault (if provided). The file is isolated from the main config
@@ -1,8 +1,8 @@
1
- import { E as EventBus } from './brain-BxN2k2HP.js';
1
+ import { E as EventBus } from './brain-gfZX3the.js';
2
2
  import { L as Logger } from './logger-B63L5bTg.js';
3
3
  import { T as Tracer } from './observability-D-HZN_mF.js';
4
- import { P as Provider, c as Request, C as Context, d as Response } from './context-Dw55zZ_Q.js';
5
- import { R as RetryPolicy } from './retry-policy-BV7nzeAd.js';
4
+ import { P as Provider, c as Request, C as Context, d as Response } from './context-DERiLofu.js';
5
+ import { R as RetryPolicy } from './retry-policy-hYxsm10a.js';
6
6
 
7
7
  /**
8
8
  * Options passed to a ProviderRunner when calling the provider.
@@ -1,4 +1,4 @@
1
- import { C as Context, d as Response, g as ProviderError } from './context-Dw55zZ_Q.js';
1
+ import { C as Context, d as Response, g as ProviderError } from './context-DERiLofu.js';
2
2
 
3
3
  type RecoveryDecision = {
4
4
  /**
@@ -1,17 +1,17 @@
1
1
  import { h as Specification, S as SpecAnalysis, g as SpecValidationResult, e as SpecStatus, f as SpecTemplate, b as SpecRequirement } from '../spec-TBi3Jr6T.js';
2
2
  import { d as TaskGraph, e as TaskNode, i as TaskFilter, j as TaskSort, c as TaskProgress, T as TaskType, a as TaskPriority } from '../task-graph-u1q9Jkyk.js';
3
- import { E as EventBus, B as BrainArbiter } from '../brain-BxN2k2HP.js';
4
- import { D as DoneCondition, g as Agent, h as AgentFactory, f as TaskResult } from '../agent-subagent-runner-ehb4xGvd.js';
5
- import { W as WorktreeManager } from '../worktree-manager-BDuXTaWL.js';
6
- import '../context-Dw55zZ_Q.js';
7
- import '../index-B7fHDt0B.js';
3
+ import { E as EventBus, B as BrainArbiter } from '../brain-gfZX3the.js';
4
+ import { D as DoneCondition, g as Agent, h as AgentFactory, f as TaskResult } from '../agent-subagent-runner-BwmkIDEd.js';
5
+ import { W as WorktreeManager } from '../worktree-manager-DUfBbKzk.js';
6
+ import '../context-DERiLofu.js';
7
+ import '../index-00KPKAlm.js';
8
8
  import '../logger-B63L5bTg.js';
9
- import '../pipeline-CNVKuQDQ.js';
9
+ import '../pipeline-B-dpCFYS.js';
10
10
  import '../mailbox-types-Ct2hJq0P.js';
11
- import '../config-C8IYxlO8.js';
11
+ import '../config-BxcrDzri.js';
12
12
  import '../observability-D-HZN_mF.js';
13
- import '../permission-CC7XFYWG.js';
14
- import '../retry-policy-BV7nzeAd.js';
13
+ import '../permission-Dgs3v-Xq.js';
14
+ import '../retry-policy-hYxsm10a.js';
15
15
 
16
16
  declare class SpecParser {
17
17
  parse(content: string): Specification;
@@ -1590,7 +1590,7 @@ declare class SddBoardProjector {
1590
1590
 
1591
1591
  /**
1592
1592
  * Control surface over a live SDD run, exposed to every steering surface
1593
- * (TUI, CLI-hosted webui in-process; standalone webui via a control file the
1593
+ * (TUI, CLI-hosted WebUI in-process; standalone WebUI via a control file the
1594
1594
  * run drains). The run itself stays CLI-owned — this is the only sanctioned
1595
1595
  * way to pause / retry / reassign from outside the run loop.
1596
1596
  */
@@ -1671,6 +1671,8 @@ interface SddInterviewSnapshot {
1671
1671
  sessionId: string;
1672
1672
  phase: AISpecPhase;
1673
1673
  title: string;
1674
+ /** The operator's original goal prompt (verbatim). `title` is a short heading. */
1675
+ goal: string;
1674
1676
  questionCount: number;
1675
1677
  minQuestions: number;
1676
1678
  maxQuestions: number;
package/dist/sdd/index.js CHANGED
@@ -2139,6 +2139,9 @@ function buildQuestioningPrompt(session, min, max) {
2139
2139
  "- Adapt based on previous answers",
2140
2140
  "- Cover: scope, constraints, edge cases, integrations, security, performance as relevant",
2141
2141
  "- When you have enough info, respond with the full specification in JSON format",
2142
+ "- This is a planning interview: respond with TEXT ONLY (a question, or the spec JSON).",
2143
+ " Do NOT write or edit files, and do NOT run shell/terminal commands \u2014 the code is",
2144
+ " written later, after the plan is approved.",
2142
2145
  "",
2143
2146
  `**Question budget:** ${budget}/${max} remaining`,
2144
2147
  `**Minimum required:** ${remaining > 0 ? remaining : "met"}`
@@ -2206,6 +2209,9 @@ function buildImplementationPrompt(session) {
2206
2209
  "",
2207
2210
  "**Instructions for AI:**",
2208
2211
  "Generate a detailed implementation plan for this specification.",
2212
+ "This is a PLANNING step \u2014 describe the plan and emit the task JSON as TEXT. Do NOT",
2213
+ "create or edit files and do NOT run shell/terminal commands here; the tasks you list",
2214
+ "are executed later, one by one, after you approve them.",
2209
2215
  "Include:",
2210
2216
  "1. Architecture decisions",
2211
2217
  "2. File structure changes",
@@ -2791,6 +2797,7 @@ var SddInterviewDriver = class {
2791
2797
  sessionId: s.id,
2792
2798
  phase: s.phase,
2793
2799
  title: s.title,
2800
+ goal: s.userIntent || s.title,
2794
2801
  questionCount: s.questionCount,
2795
2802
  minQuestions: this.minQuestions,
2796
2803
  maxQuestions: this.maxQuestions,