specrails-core 5.3.0 → 5.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/agent-runtime/capabilities.d.ts +27 -0
  2. package/dist/agent-runtime/capabilities.js +73 -0
  3. package/dist/agent-runtime/capabilities.js.map +1 -0
  4. package/dist/agent-runtime/cli-executor.d.ts +9 -0
  5. package/dist/agent-runtime/cli-executor.js +100 -30
  6. package/dist/agent-runtime/cli-executor.js.map +1 -1
  7. package/dist/agent-runtime/cli.d.ts +1 -0
  8. package/dist/agent-runtime/cli.js +59 -11
  9. package/dist/agent-runtime/cli.js.map +1 -1
  10. package/dist/agent-runtime/codex-schema.d.ts +4 -0
  11. package/dist/agent-runtime/codex-schema.js +31 -0
  12. package/dist/agent-runtime/codex-schema.js.map +1 -0
  13. package/dist/agent-runtime/config.d.ts +4 -0
  14. package/dist/agent-runtime/config.js +110 -9
  15. package/dist/agent-runtime/config.js.map +1 -1
  16. package/dist/agent-runtime/core-host.d.ts +9 -1
  17. package/dist/agent-runtime/core-host.js +55 -20
  18. package/dist/agent-runtime/core-host.js.map +1 -1
  19. package/dist/agent-runtime/efficiency-summary.d.ts +67 -0
  20. package/dist/agent-runtime/efficiency-summary.js +52 -0
  21. package/dist/agent-runtime/efficiency-summary.js.map +1 -0
  22. package/dist/agent-runtime/efficiency-types.d.ts +60 -0
  23. package/dist/agent-runtime/efficiency-types.js +8 -0
  24. package/dist/agent-runtime/efficiency-types.js.map +1 -0
  25. package/dist/agent-runtime/efficiency.d.ts +5 -0
  26. package/dist/agent-runtime/efficiency.js +35 -0
  27. package/dist/agent-runtime/efficiency.js.map +1 -0
  28. package/dist/agent-runtime/evaluation-corpus.d.ts +13 -0
  29. package/dist/agent-runtime/evaluation-corpus.js +8 -0
  30. package/dist/agent-runtime/evaluation-corpus.js.map +1 -0
  31. package/dist/agent-runtime/evaluation.d.ts +43 -0
  32. package/dist/agent-runtime/evaluation.js +171 -0
  33. package/dist/agent-runtime/evaluation.js.map +1 -0
  34. package/dist/agent-runtime/executor-types.d.ts +35 -2
  35. package/dist/agent-runtime/executor-types.js.map +1 -1
  36. package/dist/agent-runtime/executors.d.ts +1 -0
  37. package/dist/agent-runtime/executors.js +4 -0
  38. package/dist/agent-runtime/executors.js.map +1 -1
  39. package/dist/agent-runtime/graph/artifacts.d.ts +8 -22
  40. package/dist/agent-runtime/graph/artifacts.js +99 -73
  41. package/dist/agent-runtime/graph/artifacts.js.map +1 -1
  42. package/dist/agent-runtime/graph/nodes.d.ts +3 -0
  43. package/dist/agent-runtime/graph/nodes.js +73 -26
  44. package/dist/agent-runtime/graph/nodes.js.map +1 -1
  45. package/dist/agent-runtime/graph/roles.d.ts +4 -1
  46. package/dist/agent-runtime/graph/roles.js +100 -36
  47. package/dist/agent-runtime/graph/roles.js.map +1 -1
  48. package/dist/agent-runtime/graph/state.d.ts +8 -0
  49. package/dist/agent-runtime/graph/state.js.map +1 -1
  50. package/dist/agent-runtime/index.d.ts +7 -1
  51. package/dist/agent-runtime/index.js +7 -1
  52. package/dist/agent-runtime/index.js.map +1 -1
  53. package/dist/agent-runtime/kimi-acp.d.ts +4 -0
  54. package/dist/agent-runtime/kimi-acp.js +20 -9
  55. package/dist/agent-runtime/kimi-acp.js.map +1 -1
  56. package/dist/agent-runtime/openai-executor.d.ts +8 -0
  57. package/dist/agent-runtime/openai-executor.js +28 -10
  58. package/dist/agent-runtime/openai-executor.js.map +1 -1
  59. package/dist/agent-runtime/openspec-tool-server.d.ts +1 -0
  60. package/dist/agent-runtime/openspec-tool-server.js +37 -0
  61. package/dist/agent-runtime/openspec-tool-server.js.map +1 -0
  62. package/dist/agent-runtime/openspec.d.ts +123 -0
  63. package/dist/agent-runtime/openspec.js +263 -0
  64. package/dist/agent-runtime/openspec.js.map +1 -0
  65. package/dist/agent-runtime/prompts.d.ts +5 -1
  66. package/dist/agent-runtime/prompts.js +59 -40
  67. package/dist/agent-runtime/prompts.js.map +1 -1
  68. package/dist/agent-runtime/provider-diagnostic.d.ts +2 -0
  69. package/dist/agent-runtime/provider-diagnostic.js +25 -0
  70. package/dist/agent-runtime/provider-diagnostic.js.map +1 -0
  71. package/dist/agent-runtime/repository-context.d.ts +25 -0
  72. package/dist/agent-runtime/repository-context.js +100 -0
  73. package/dist/agent-runtime/repository-context.js.map +1 -0
  74. package/dist/agent-runtime/review-context.d.ts +14 -0
  75. package/dist/agent-runtime/review-context.js +41 -0
  76. package/dist/agent-runtime/review-context.js.map +1 -0
  77. package/dist/agent-runtime/role-routing.d.ts +10 -0
  78. package/dist/agent-runtime/role-routing.js +29 -0
  79. package/dist/agent-runtime/role-routing.js.map +1 -0
  80. package/dist/agent-runtime/role-state.d.ts +19 -0
  81. package/dist/agent-runtime/role-state.js +24 -0
  82. package/dist/agent-runtime/role-state.js.map +1 -0
  83. package/dist/agent-runtime/runtime-identity.d.ts +11 -0
  84. package/dist/agent-runtime/runtime-identity.js +33 -0
  85. package/dist/agent-runtime/runtime-identity.js.map +1 -0
  86. package/dist/agent-runtime/tool-event.d.ts +3 -0
  87. package/dist/agent-runtime/tool-event.js +24 -0
  88. package/dist/agent-runtime/tool-event.js.map +1 -0
  89. package/dist/agent-runtime/verification-plan.d.ts +55 -0
  90. package/dist/agent-runtime/verification-plan.js +206 -0
  91. package/dist/agent-runtime/verification-plan.js.map +1 -0
  92. package/dist/agent-runtime/workflow-types.d.ts +17 -1
  93. package/dist/agent-runtime/workflow.js +28 -1
  94. package/dist/agent-runtime/workflow.js.map +1 -1
  95. package/dist/agent-runtime/workspace-tools.d.ts +4 -0
  96. package/dist/agent-runtime/workspace-tools.js +182 -20
  97. package/dist/agent-runtime/workspace-tools.js.map +1 -1
  98. package/dist/installer/phases/scaffold.js +39 -109
  99. package/dist/installer/phases/scaffold.js.map +1 -1
  100. package/dist/installer/runtime/pipeline-state.d.ts +142 -1
  101. package/dist/installer/runtime/pipeline-state.js +477 -28
  102. package/dist/installer/runtime/pipeline-state.js.map +1 -1
  103. package/docs/agent-runtime-efficiency.md +65 -0
  104. package/docs/agent-runtime.md +86 -15
  105. package/integration-contract.json +2 -1
  106. package/package.json +5 -2
  107. package/schemas/agent-runtime.schema.json +25 -3
  108. package/schemas/fixtures/runtime-efficiency-summary.v1.json +790 -0
  109. package/templates/codex-skills/batch-implement/SKILL.md +33 -58
  110. package/templates/codex-skills/implement/SKILL.md +21 -124
  111. package/templates/codex-skills/retry/SKILL.md +8 -34
  112. package/templates/commands/specrails/batch-implement.md +21 -16
  113. package/templates/commands/specrails/implement.md +17 -276
  114. package/templates/commands/specrails/retry.md +6 -34
  115. package/templates/gemini-commands/batch-implement.toml +34 -28
  116. package/templates/gemini-commands/implement.toml +34 -55
  117. package/templates/gemini-commands/retry.toml +10 -16
@@ -28,7 +28,19 @@ export interface PipelineContext {
28
28
  };
29
29
  specs: PipelineSpec[];
30
30
  }
31
+ export interface HostCheckPolicy {
32
+ reuse?: 'never' | 'snapshot-local';
33
+ inputs?: string[];
34
+ deterministic?: boolean;
35
+ readOnly?: boolean;
36
+ toolchainInputs?: string[];
37
+ independentGroup?: string;
38
+ resources?: string[];
39
+ }
31
40
  export interface VerificationCommand {
41
+ key?: string;
42
+ label?: string;
43
+ policy?: HostCheckPolicy;
32
44
  repositoryId: string;
33
45
  command: string;
34
46
  args: string[];
@@ -42,6 +54,7 @@ export interface VerificationRequest {
42
54
  kind: 'full' | 'scoped';
43
55
  commands: VerificationCommand[];
44
56
  unverified?: boolean;
57
+ planHash?: string;
45
58
  }
46
59
  export interface CommandReceipt {
47
60
  repositoryId: string;
@@ -56,13 +69,32 @@ export interface CommandReceipt {
56
69
  exitCode: number;
57
70
  durationMs: number;
58
71
  output: string;
72
+ checkDefinitionHash?: string;
73
+ checkDefinition?: VerificationCommand;
74
+ disposition?: 'executed' | 'reused' | 'not-run';
75
+ reusedFrom?: string;
76
+ reuseReason?: string;
77
+ snapshot?: VerificationSnapshot;
78
+ pending?: boolean;
79
+ evidenceId?: string;
80
+ stdout?: string;
81
+ stderr?: string;
82
+ outputTruncated?: boolean;
83
+ key?: string;
84
+ label?: string;
85
+ configuredTimeoutMs?: number;
86
+ appliedTimeoutMs?: number;
87
+ deadline?: number;
88
+ outcome?: 'passed' | 'failed' | 'cancelled' | 'timed-out' | 'interrupted';
59
89
  }
60
90
  export interface VerificationReceipt {
61
91
  id: string;
62
92
  kind: 'full' | 'scoped';
63
93
  scopeHash: string;
64
94
  candidateHash: string;
95
+ planHash?: string;
65
96
  commands: CommandReceipt[];
97
+ notRunEvidenceIds?: string[];
66
98
  completedAt: string;
67
99
  valid: boolean;
68
100
  reason?: string;
@@ -102,6 +134,7 @@ export interface AcceptanceReceipt extends AcceptanceReport {
102
134
  candidateHash: string;
103
135
  artifactHash: string;
104
136
  recordedAt: string;
137
+ planHash?: string;
105
138
  }
106
139
  export interface PipelineCompletion {
107
140
  implementation: 'complete' | 'incomplete';
@@ -130,6 +163,13 @@ export interface PipelineState {
130
163
  createdAt: string;
131
164
  updatedAt: string;
132
165
  phases: Record<PipelinePhase, PhaseRecord>;
166
+ verificationPlan?: {
167
+ hash: string;
168
+ files: Array<{
169
+ path: string;
170
+ hash: string;
171
+ }>;
172
+ };
133
173
  verification?: VerificationReceipt;
134
174
  acceptance?: AcceptanceReceipt;
135
175
  archivePath?: string;
@@ -156,8 +196,23 @@ export interface PreviewFile {
156
196
  export declare function verificationEnvironment(env: NodeJS.ProcessEnv, overrides?: Record<string, string>, platform?: NodeJS.Platform): NodeJS.ProcessEnv;
157
197
  export declare function validatePipelineContext(input: unknown): PipelineContext;
158
198
  export declare function pipelineStateDirectory(context: PipelineContext): string;
199
+ export interface CandidateManifest {
200
+ schemaVersion: 1;
201
+ scopeHash: string;
202
+ repositories: Array<{
203
+ id: string;
204
+ path: string;
205
+ files: Array<[string, string]>;
206
+ }>;
207
+ }
208
+ export declare function candidateManifest(state: PipelineState): CandidateManifest;
159
209
  export declare function fingerprintCandidate(state: PipelineState): string;
160
210
  export declare function initializePipeline(contextInput: unknown, change: string): PipelineState;
211
+ /** Host-owned binding, including immutable harness bytes outside the candidate. */
212
+ export declare function bindVerificationPlan(contextInput: PipelineContext, hash: string, files: Array<{
213
+ path: string;
214
+ hash: string;
215
+ }>): void;
161
216
  declare function inspectReceipt(state: PipelineState, env?: NodeJS.ProcessEnv): {
162
217
  valid: boolean;
163
218
  reasons: string[];
@@ -187,6 +242,8 @@ export declare function inspectPipeline(contextInput: unknown): {
187
242
  verification: ReturnType<typeof inspectReceipt>;
188
243
  acceptance: ReturnType<typeof inspectAcceptance>;
189
244
  completion: PipelineCompletion;
245
+ planHash?: string;
246
+ candidateHash: string;
190
247
  };
191
248
  /**
192
249
  * Native executables retain structured argv; Windows script shims need cmd.
@@ -200,11 +257,95 @@ export declare function verificationInvocation(command: string, args: string[],
200
257
  args: string[];
201
258
  windowsVerbatimArguments?: boolean;
202
259
  };
203
- export declare function verifyPipeline(contextInput: unknown, raw: unknown, log?: (text: string) => void, signal?: AbortSignal): Promise<VerificationReceipt>;
260
+ /** Shared persisted-output/provider diagnostic redaction; preserves line structure. */
261
+ export declare function redactRuntimeText(text: string, env?: NodeJS.ProcessEnv): string;
262
+ export interface VerificationSnapshot {
263
+ eligible: boolean;
264
+ reason: string;
265
+ inputHash?: string;
266
+ toolchainHash?: string;
267
+ }
268
+ /** Host opt-in is a declaration of determinism, not inferred hermeticity. */
269
+ export declare function verificationSnapshot(context: PipelineContext, command: VerificationCommand): VerificationSnapshot;
270
+ /** Contiguous waves preserve baseline order; an uncertain check is a barrier. */
271
+ export declare function verificationWaves<T extends VerificationCommand>(commands: T[], maxConcurrency?: number): T[][];
272
+ export declare function verifyPipeline(contextInput: unknown, raw: unknown, log?: (text: string) => void, signal?: AbortSignal, options?: {
273
+ deadline?: number;
274
+ maxConcurrency?: number;
275
+ onEvidence?: (kind: 'check-started' | 'check-finished' | 'check-reused' | 'check-invalidated', payload: Record<string, string | number | null>) => Promise<void>;
276
+ }): Promise<VerificationReceipt>;
204
277
  /** Validate a check plan without creating state or executing commands. */
205
278
  export declare function validateVerificationRequest(contextInput: unknown, raw: unknown): void;
206
279
  export declare function preparePreview(contextInput: unknown, raw: unknown): PipelineState;
207
280
  export declare function applyPreview(contextInput: unknown, verificationRequest: unknown, log?: (text: string) => void): Promise<VerificationReceipt>;
208
281
  export declare function runPipelineCommand(flags: Record<string, string | boolean>, positionals: string[]): Promise<number>;
209
282
  export declare function runPipelineCli(argv: string[]): Promise<number>;
283
+ export interface VerificationEvidenceQuery {
284
+ id?: string;
285
+ section?: 'summary' | 'stdout' | 'stderr' | 'source';
286
+ sourceId?: string;
287
+ cursor?: string;
288
+ limit?: number;
289
+ }
290
+ /** Historical read: no live repository validation, source execution or lifecycle mutation. */
291
+ export declare function readVerificationEvidence(context: Pick<PipelineContext, 'backlogRoot' | 'runId'>, query?: VerificationEvidenceQuery): {
292
+ nextCursor?: string | undefined;
293
+ schemaVersion: number;
294
+ available: boolean;
295
+ items: Record<string, unknown>[];
296
+ truncated: boolean;
297
+ } | {
298
+ schemaVersion: number;
299
+ available: boolean;
300
+ items: {
301
+ sources: {
302
+ id: string;
303
+ displayPath: string;
304
+ byteCount: number;
305
+ hash: string;
306
+ }[];
307
+ schemaVersion: 1;
308
+ runId: string;
309
+ id: string;
310
+ checkId: string;
311
+ repositoryId: string;
312
+ label: string;
313
+ origin: string[];
314
+ required: true;
315
+ disposition: "executed" | "reused" | "not-run";
316
+ reusedFrom?: string;
317
+ status: "passed" | "failed" | "cancelled" | "interrupted" | "unavailable";
318
+ reuseReason?: string;
319
+ recordedAt: string;
320
+ execution: {
321
+ command: string;
322
+ args: string[];
323
+ cwd: string;
324
+ configuredTimeoutMs: number | null;
325
+ appliedTimeoutMs: number | null;
326
+ deadline: number | null;
327
+ outcome: string | null;
328
+ };
329
+ planHash: string;
330
+ candidateHash: string;
331
+ executionId: string;
332
+ exitCode: number | null;
333
+ durationMs: number | null;
334
+ outputTruncated: boolean;
335
+ stdoutBytes: number;
336
+ stderrBytes: number;
337
+ stdoutHash: string;
338
+ stderrHash: string;
339
+ }[];
340
+ truncated: boolean;
341
+ } | {
342
+ nextCursor?: string | undefined;
343
+ schemaVersion: number;
344
+ available: boolean;
345
+ text: string;
346
+ byteCount: number;
347
+ totalBytes: number;
348
+ truncated: boolean;
349
+ items?: undefined;
350
+ };
210
351
  export {};