@rosthq/cli 0.7.94 → 0.7.96

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/dist/index.js CHANGED
@@ -41569,6 +41569,7 @@ var compassImportOutputSchema = external_exports.object({
41569
41569
  citations: external_exports.number().int().nonnegative()
41570
41570
  }).strict();
41571
41571
  var goalStatusSchema = external_exports.enum(["on", "off", "done", "dropped"]);
41572
+ var goalStatusSourceSchema = external_exports.enum(["human", "agent", "rollup", "signal"]);
41572
41573
  var goalListInputSchema = external_exports.object({
41573
41574
  cycle_id: uuidSchema9.optional(),
41574
41575
  seat_id: uuidSchema9.optional()
@@ -41584,7 +41585,7 @@ var goalSummarySchema = external_exports.object({
41584
41585
  parent_goal_id: uuidSchema9.nullable(),
41585
41586
  title: external_exports.string(),
41586
41587
  status: goalStatusSchema,
41587
- status_source: external_exports.enum(["human", "agent", "rollup"])
41588
+ status_source: goalStatusSourceSchema
41588
41589
  }).strict();
41589
41590
  var goalListOutputSchema = external_exports.object({
41590
41591
  goals: external_exports.array(goalSummarySchema)
@@ -41604,7 +41605,7 @@ var goalMutationOutputSchema = external_exports.object({
41604
41605
  parent_goal_id: uuidSchema9.nullable(),
41605
41606
  title: external_exports.string(),
41606
41607
  status: goalStatusSchema,
41607
- status_source: external_exports.enum(["human", "agent", "rollup"])
41608
+ status_source: goalStatusSourceSchema
41608
41609
  }).strict();
41609
41610
  var goalUpdateInputSchema = external_exports.object({
41610
41611
  goal_id: uuidSchema9,
@@ -41655,7 +41656,6 @@ var goalListAtRiskOutputSchema = external_exports.object({
41655
41656
  goals: external_exports.array(goalAtRiskSchema)
41656
41657
  }).strict();
41657
41658
  var goalSignalStateSchema = external_exports.enum(["ok", "risk", "crit", "pending"]);
41658
- var goalStatusSourceSchema = external_exports.enum(["human", "agent", "rollup", "signal"]);
41659
41659
  var goalMeasurableRoleSchema = external_exports.enum(["drives_status", "informs"]);
41660
41660
  var goalDriverAnchorSchema = external_exports.object({
41661
41661
  // The closed period being anchored on (an ISO date / period label — free-form so a
@@ -43438,7 +43438,11 @@ var fleetDigestAgentSchema = fleetOverviewRowSchema.extend({
43438
43438
  spend_7d_usd: external_exports.string(),
43439
43439
  spend_30d_usd: external_exports.string(),
43440
43440
  cost_drift_percent: external_exports.number().int().nullable(),
43441
- health_status: external_exports.enum(["needs_review", "stale", "setup_gap", "awaiting_data", "awaiting_data_overdue", "healthy"]),
43441
+ // DER-1905: "idle" added cadence-aware grading now distinguishes an
43442
+ // on-demand agent with nothing pending (idle, neutral) from a scheduled
43443
+ // agent that missed its cron (stale, alarming). Purely additive to this
43444
+ // enum; no other field on this schema changed.
43445
+ health_status: external_exports.enum(["needs_review", "stale", "idle", "setup_gap", "awaiting_data", "awaiting_data_overdue", "healthy"]),
43442
43446
  health_reasons: external_exports.array(external_exports.string()),
43443
43447
  recent_failed_runs: external_exports.array(fleetDigestRunSchema),
43444
43448
  unresolved_errors: external_exports.array(fleetDigestErrorSchema),
@@ -43509,8 +43513,11 @@ var seatRunDetailSchema = seatRunSchema.extend({
43509
43513
  task_id: uuidSchema14.nullable(),
43510
43514
  work_order_id: uuidSchema14.nullable(),
43511
43515
  transcript_ref: external_exports.string(),
43512
- input_tokens: external_exports.number().int().nonnegative(),
43513
- output_tokens: external_exports.number().int().nonnegative(),
43516
+ // DER-1913: null = usage UNKNOWN — a Codex / read-status / timeout / spawn-error
43517
+ // runner turn reports no model-usage envelope, so the run records no token count.
43518
+ // Never coerced to a fabricated 0; surfaces (CLI/MCP/UI) render it as unknown.
43519
+ input_tokens: external_exports.number().int().nonnegative().nullable(),
43520
+ output_tokens: external_exports.number().int().nonnegative().nullable(),
43514
43521
  outcome: external_exports.record(external_exports.string(), external_exports.unknown()),
43515
43522
  error_logs: external_exports.array(seatRunErrorLogSchema),
43516
43523
  skill_activations: external_exports.array(external_exports.object({
@@ -44829,8 +44836,44 @@ var secretGrantListOutputSchema = external_exports.object({
44829
44836
  grants: external_exports.array(secretGrantSummarySchema)
44830
44837
  }).strict();
44831
44838
 
44832
- // ../../packages/protocol/src/software-factory.ts
44839
+ // ../../packages/protocol/src/gate.ts
44833
44840
  var uuid11 = external_exports.string().uuid();
44841
+ var gateDecisionSchema = external_exports.enum(["approve", "reject"]);
44842
+ var gateSubjectKindSchema = external_exports.enum(["prototype", "deliverable", "artifact"]);
44843
+ var gateDecideInputSchema = external_exports.object({
44844
+ subject_kind: gateSubjectKindSchema,
44845
+ subject_id: uuid11,
44846
+ artifact_ref: external_exports.object({
44847
+ // The deep link to the artifact (a prototype URL). Agent-supplied and rendered as a
44848
+ // clickable link in the operator's Home band, so it is constrained to an http(s)
44849
+ // URL or a relative in-app path — a `javascript:`/`data:` href would be a
44850
+ // stored-XSS-via-link vector (conservative-by-default, invariant #10).
44851
+ href: external_exports.string().min(1).max(2048).refine(
44852
+ (value) => value.startsWith("/") || /^https?:\/\//i.test(value),
44853
+ "href must be a relative path or an http(s) URL"
44854
+ ),
44855
+ label: external_exports.string().min(1).max(200)
44856
+ }).strict(),
44857
+ // The digest the gate is bound to. On approval the current artifact digest must
44858
+ // still match (a changed artifact is a stale gate — re-draft required).
44859
+ artifact_digest: external_exports.string().min(1).max(200),
44860
+ decision: gateDecisionSchema,
44861
+ ask: external_exports.string().min(1).max(400),
44862
+ consequence: external_exports.string().min(1).max(600),
44863
+ unblocked_targets: external_exports.array(external_exports.string().min(1).max(200)).max(20).default([]),
44864
+ rationale: external_exports.string().max(4e3).optional()
44865
+ }).strict();
44866
+ var gateDecideOutputSchema = external_exports.object({
44867
+ decision_id: uuid11.nullable(),
44868
+ subject_id: uuid11,
44869
+ artifact_digest: external_exports.string(),
44870
+ decision: gateDecisionSchema,
44871
+ decided_by: uuid11,
44872
+ gate_status: external_exports.enum(["approved", "rejected"])
44873
+ });
44874
+
44875
+ // ../../packages/protocol/src/software-factory.ts
44876
+ var uuid12 = external_exports.string().uuid();
44834
44877
  var SOFTWARE_PHASE_VALUES = [
44835
44878
  "intake",
44836
44879
  "discovery_scoping",
@@ -44941,7 +44984,7 @@ var softwareConfigValueKindSchema = external_exports.enum(["plain", "secret_ref"
44941
44984
  var softwareCredentialRequestStatusSchema = external_exports.enum(["pending", "fulfilled", "rejected", "canceled"]);
44942
44985
  var softwareSecretAccessOperationSchema = external_exports.enum(["use", "vercel_env_sync", "test_execution"]);
44943
44986
  var softwareProjectSummarySchema = external_exports.object({
44944
- id: uuid11,
44987
+ id: uuid12,
44945
44988
  name: external_exports.string().min(1),
44946
44989
  slug: external_exports.string().min(1),
44947
44990
  base_branch: external_exports.string().min(1),
@@ -44995,7 +45038,7 @@ var softwarePhaseSchedulerStateSchema = external_exports.object({
44995
45038
  ]).nullable(),
44996
45039
  message: external_exports.string(),
44997
45040
  remediation_href: external_exports.string().nullable(),
44998
- work_order_id: uuid11.nullable()
45041
+ work_order_id: uuid12.nullable()
44999
45042
  });
45000
45043
  var softwareDispatchHoldReasonSchema = external_exports.enum([
45001
45044
  "dependency",
@@ -45019,7 +45062,7 @@ var softwareDispatchPreviewRunnerRequirementSchema = external_exports.object({
45019
45062
  }).strict();
45020
45063
  var softwareDispatchPreviewItemSchema = external_exports.object({
45021
45064
  kind: external_exports.enum(["changeset", "task"]),
45022
- id: uuid11,
45065
+ id: uuid12,
45023
45066
  ordinal: external_exports.number().int().positive(),
45024
45067
  title: external_exports.string(),
45025
45068
  changeset_ordinal: external_exports.number().int().positive().nullable(),
@@ -45046,7 +45089,7 @@ var softwareTouchSetCollisionSchema = external_exports.object({
45046
45089
  overlap: external_exports.array(external_exports.string()).min(1)
45047
45090
  }).strict();
45048
45091
  var softwareCrossRequestCollisionGroupSchema = external_exports.object({
45049
- software_project_id: uuid11,
45092
+ software_project_id: uuid12,
45050
45093
  requests: external_exports.array(softwareTouchSetRefSchema),
45051
45094
  collisions: external_exports.array(softwareTouchSetCollisionSchema),
45052
45095
  unknown: external_exports.array(softwareTouchSetRefSchema)
@@ -45080,8 +45123,8 @@ var softwareDispatchPreviewSchema = external_exports.object({
45080
45123
  grooming_reason: external_exports.string().nullable()
45081
45124
  }).strict();
45082
45125
  var softwareBuildRequestSummarySchema = external_exports.object({
45083
- id: uuid11,
45084
- software_project_id: uuid11,
45126
+ id: uuid12,
45127
+ software_project_id: uuid12,
45085
45128
  title: external_exports.string(),
45086
45129
  source_channel: softwareSourceChannelSchema,
45087
45130
  source_ref: external_exports.string().nullable(),
@@ -45097,7 +45140,7 @@ var softwareBuildRequestSummarySchema = external_exports.object({
45097
45140
  scheduler_state: softwarePhaseSchedulerStateSchema.nullable()
45098
45141
  });
45099
45142
  var softwarePhaseRunSummarySchema = external_exports.object({
45100
- id: uuid11,
45143
+ id: uuid12,
45101
45144
  phase: softwarePhaseSchema,
45102
45145
  status: softwarePhaseRunStatusSchema,
45103
45146
  attempt_no: external_exports.number().int(),
@@ -45107,17 +45150,17 @@ var softwarePhaseRunSummarySchema = external_exports.object({
45107
45150
  scheduler_state: softwarePhaseSchedulerStateSchema.nullable()
45108
45151
  });
45109
45152
  var softwareGateSummarySchema = external_exports.object({
45110
- id: uuid11,
45153
+ id: uuid12,
45111
45154
  gate_type: softwareGateTypeSchema,
45112
45155
  status: external_exports.enum(["pending", "approved", "rejected", "held"]),
45113
- phase_run_id: uuid11.nullable(),
45114
- resolved_by_user_id: uuid11.nullable(),
45156
+ phase_run_id: uuid12.nullable(),
45157
+ resolved_by_user_id: uuid12.nullable(),
45115
45158
  rationale: external_exports.string().nullable(),
45116
45159
  created_at: external_exports.string()
45117
45160
  });
45118
45161
  var softwareChangesetSummarySchema = external_exports.object({
45119
- id: uuid11,
45120
- build_request_id: uuid11,
45162
+ id: uuid12,
45163
+ build_request_id: uuid12,
45121
45164
  ordinal: external_exports.number().int(),
45122
45165
  title: external_exports.string(),
45123
45166
  split_criterion: softwareChangesetSplitCriterionSchema,
@@ -45131,10 +45174,10 @@ var softwareChangesetSummarySchema = external_exports.object({
45131
45174
  created_at: external_exports.string()
45132
45175
  });
45133
45176
  var softwareTaskSummarySchema = external_exports.object({
45134
- id: uuid11,
45135
- build_request_id: uuid11,
45136
- changeset_id: uuid11,
45137
- plan_version_id: uuid11,
45177
+ id: uuid12,
45178
+ build_request_id: uuid12,
45179
+ changeset_id: uuid12,
45180
+ plan_version_id: uuid12,
45138
45181
  ordinal: external_exports.number().int(),
45139
45182
  task_key: external_exports.string(),
45140
45183
  title: external_exports.string(),
@@ -45173,8 +45216,8 @@ var softwarePlanArtifactSummarySchema = external_exports.object({
45173
45216
  changesets: external_exports.array(softwarePlanArtifactChangesetSummarySchema).default([])
45174
45217
  });
45175
45218
  var softwarePlanVersionSummarySchema = external_exports.object({
45176
- id: uuid11,
45177
- build_request_id: uuid11,
45219
+ id: uuid12,
45220
+ build_request_id: uuid12,
45178
45221
  version_no: external_exports.number().int(),
45179
45222
  status: softwarePlanVersionStatusSchema,
45180
45223
  summary: external_exports.string().nullable(),
@@ -45185,37 +45228,37 @@ var softwarePlanVersionSummarySchema = external_exports.object({
45185
45228
  answer: external_exports.string()
45186
45229
  })).default([]),
45187
45230
  planning_artifact: softwarePlanArtifactSummarySchema.nullable(),
45188
- created_by_seat_id: uuid11.nullable(),
45231
+ created_by_seat_id: uuid12.nullable(),
45189
45232
  created_at: external_exports.string()
45190
45233
  });
45191
45234
  var softwarePlanConformanceFindingSummarySchema = external_exports.object({
45192
- id: uuid11,
45193
- build_request_id: uuid11,
45194
- changeset_id: uuid11.nullable(),
45195
- phase_run_id: uuid11.nullable(),
45196
- plan_version_id: uuid11.nullable(),
45235
+ id: uuid12,
45236
+ build_request_id: uuid12,
45237
+ changeset_id: uuid12.nullable(),
45238
+ phase_run_id: uuid12.nullable(),
45239
+ plan_version_id: uuid12.nullable(),
45197
45240
  severity: softwareConformanceSeveritySchema,
45198
45241
  category: softwareConformanceCategorySchema,
45199
45242
  summary: external_exports.string(),
45200
45243
  detail: external_exports.string().nullable(),
45201
45244
  status: softwareConformanceStatusSchema,
45202
- accepted_by_decision_id: uuid11.nullable(),
45245
+ accepted_by_decision_id: uuid12.nullable(),
45203
45246
  resolved_at: external_exports.string().nullable(),
45204
45247
  created_at: external_exports.string()
45205
45248
  });
45206
45249
  var softwareAuthorityProfileSummarySchema = external_exports.object({
45207
- id: uuid11,
45208
- software_project_id: uuid11.nullable(),
45250
+ id: uuid12,
45251
+ software_project_id: uuid12.nullable(),
45209
45252
  name: external_exports.string(),
45210
45253
  preset: softwareAuthorityPresetSchema,
45211
45254
  is_default: external_exports.boolean(),
45212
45255
  created_at: external_exports.string()
45213
45256
  });
45214
45257
  var softwareSecretGrantSummarySchema = external_exports.object({
45215
- id: uuid11,
45216
- software_project_id: uuid11,
45258
+ id: uuid12,
45259
+ software_project_id: uuid12,
45217
45260
  environment: softwareEnvironmentSchema,
45218
- seat_id: uuid11,
45261
+ seat_id: uuid12,
45219
45262
  action: external_exports.string(),
45220
45263
  key_name: external_exports.string(),
45221
45264
  vault_ref: external_exports.string(),
@@ -45224,8 +45267,8 @@ var softwareSecretGrantSummarySchema = external_exports.object({
45224
45267
  revoked_at: external_exports.string().nullable()
45225
45268
  });
45226
45269
  var softwareConfigEntrySummarySchema = external_exports.object({
45227
- id: uuid11,
45228
- software_project_id: uuid11,
45270
+ id: uuid12,
45271
+ software_project_id: uuid12,
45229
45272
  environment: softwareEnvironmentSchema,
45230
45273
  key_name: external_exports.string(),
45231
45274
  value_kind: softwareConfigValueKindSchema,
@@ -45235,20 +45278,20 @@ var softwareConfigEntrySummarySchema = external_exports.object({
45235
45278
  updated_at: external_exports.string()
45236
45279
  });
45237
45280
  var softwareCredentialRequestSummarySchema = external_exports.object({
45238
- id: uuid11,
45239
- software_project_id: uuid11,
45281
+ id: uuid12,
45282
+ software_project_id: uuid12,
45240
45283
  environment: softwareEnvironmentSchema,
45241
- requested_by_seat_id: uuid11,
45284
+ requested_by_seat_id: uuid12,
45242
45285
  action: external_exports.string(),
45243
45286
  key_name: external_exports.string(),
45244
45287
  reason: external_exports.string().nullable(),
45245
45288
  status: softwareCredentialRequestStatusSchema,
45246
- approval_task_id: uuid11.nullable(),
45289
+ approval_task_id: uuid12.nullable(),
45247
45290
  created_at: external_exports.string()
45248
45291
  });
45249
45292
  var softwareCapacityObservationSummarySchema = external_exports.object({
45250
- id: uuid11,
45251
- runner_id: uuid11,
45293
+ id: uuid12,
45294
+ runner_id: uuid12,
45252
45295
  observed_at: external_exports.string(),
45253
45296
  os: external_exports.string().nullable(),
45254
45297
  cpu_count: external_exports.number().int().nullable(),
@@ -45264,7 +45307,7 @@ var softwareRequestCreateInputSchema = external_exports.object({
45264
45307
  // this schema) enforces that exactly one resolves, with an actionable error
45265
45308
  // when neither is given or neither matches — keeping this shape a plain
45266
45309
  // `z.object` so JSON-schema/CLI-flag projection stays simple (no `.refine`).
45267
- software_project_id: uuid11.optional(),
45310
+ software_project_id: uuid12.optional(),
45268
45311
  project: external_exports.string().trim().min(1).max(200).optional(),
45269
45312
  // Untrusted display text (ADR-0018 §5) — bounded, never treated as an instruction.
45270
45313
  title: external_exports.string().trim().min(1).max(500),
@@ -45276,11 +45319,11 @@ var softwareRequestCreateInputSchema = external_exports.object({
45276
45319
  automation_mode: softwareAutomationModeSchema.optional()
45277
45320
  }).strict();
45278
45321
  var softwareRequestCreateOutputSchema = external_exports.object({
45279
- build_request_id: uuid11,
45280
- software_project_id: uuid11,
45322
+ build_request_id: uuid12,
45323
+ software_project_id: uuid12,
45281
45324
  status: softwareRequestStatusSchema,
45282
45325
  current_phase: softwarePhaseSchema,
45283
- phase_run_id: uuid11,
45326
+ phase_run_id: uuid12,
45284
45327
  scheduler_state: softwarePhaseSchedulerStateSchema
45285
45328
  });
45286
45329
  var softwareRequestListInputSchema = external_exports.object({
@@ -45290,7 +45333,7 @@ var softwareRequestListOutputSchema = external_exports.object({
45290
45333
  requests: external_exports.array(softwareBuildRequestSummarySchema)
45291
45334
  });
45292
45335
  var softwareRequestShowInputSchema = external_exports.object({
45293
- build_request_id: uuid11
45336
+ build_request_id: uuid12
45294
45337
  }).strict();
45295
45338
  var softwareRequestShowOutputSchema = external_exports.object({
45296
45339
  request: softwareBuildRequestSummarySchema,
@@ -45304,51 +45347,51 @@ var softwareRequestShowOutputSchema = external_exports.object({
45304
45347
  });
45305
45348
  var softwareRequestLifecycleReason = external_exports.string().trim().min(1).max(2e3);
45306
45349
  var softwareRequestPauseInputSchema = external_exports.object({
45307
- build_request_id: uuid11,
45350
+ build_request_id: uuid12,
45308
45351
  reason: softwareRequestLifecycleReason.optional()
45309
45352
  }).strict();
45310
45353
  var softwareRequestCancelInputSchema = external_exports.object({
45311
- build_request_id: uuid11,
45354
+ build_request_id: uuid12,
45312
45355
  reason: softwareRequestLifecycleReason.optional()
45313
45356
  }).strict();
45314
45357
  var softwareRequestResumeInputSchema = external_exports.object({
45315
- build_request_id: uuid11,
45358
+ build_request_id: uuid12,
45316
45359
  reason: softwareRequestLifecycleReason.optional(),
45317
45360
  termination_bound: softwareTerminationBoundSchema.optional()
45318
45361
  }).strict();
45319
45362
  var softwareRequestLifecycleOutputSchema = external_exports.object({
45320
- build_request_id: uuid11,
45363
+ build_request_id: uuid12,
45321
45364
  status: softwareRequestStatusSchema,
45322
45365
  current_phase: softwarePhaseSchema,
45323
- phase_run_id: uuid11.nullable(),
45324
- work_order_id: uuid11.nullable(),
45325
- resume_from_task_id: uuid11.nullable()
45366
+ phase_run_id: uuid12.nullable(),
45367
+ work_order_id: uuid12.nullable(),
45368
+ resume_from_task_id: uuid12.nullable()
45326
45369
  });
45327
45370
  var softwarePhaseAdvanceInputSchema = external_exports.object({
45328
- build_request_id: uuid11,
45371
+ build_request_id: uuid12,
45329
45372
  to_phase: softwarePhaseSchema,
45330
- owning_seat_id: uuid11.optional(),
45373
+ owning_seat_id: uuid12.optional(),
45331
45374
  note: external_exports.string().max(2e3).optional()
45332
45375
  }).strict();
45333
45376
  var softwarePhaseAdvanceOutputSchema = external_exports.object({
45334
- build_request_id: uuid11,
45377
+ build_request_id: uuid12,
45335
45378
  from_phase: softwarePhaseSchema,
45336
45379
  to_phase: softwarePhaseSchema,
45337
- phase_run_id: uuid11
45380
+ phase_run_id: uuid12
45338
45381
  });
45339
45382
  var softwareGateDecideInputSchema = external_exports.object({
45340
- gate_id: uuid11,
45383
+ gate_id: uuid12,
45341
45384
  decision: softwareGateDecisionSchema,
45342
45385
  rationale: external_exports.string().max(4e3).optional()
45343
45386
  }).strict();
45344
45387
  var softwareGateDecideOutputSchema = external_exports.object({
45345
- gate_id: uuid11,
45388
+ gate_id: uuid12,
45346
45389
  status: external_exports.enum(["approved", "rejected"]),
45347
- resolved_by_user_id: uuid11,
45348
- decision_id: uuid11.nullable()
45390
+ resolved_by_user_id: uuid12,
45391
+ decision_id: uuid12.nullable()
45349
45392
  });
45350
45393
  var softwareDispatchSerializeInputSchema = external_exports.object({
45351
- build_request_id: uuid11,
45394
+ build_request_id: uuid12,
45352
45395
  // The task that must run FIRST (the dependency target).
45353
45396
  before_task_key: external_exports.string().trim().min(1).max(200),
45354
45397
  // The task that gains the depends_on edge and runs AFTER `before_task_key`.
@@ -45359,45 +45402,45 @@ var softwareDispatchSerializeInputSchema = external_exports.object({
45359
45402
  path: ["after_task_key"]
45360
45403
  });
45361
45404
  var softwareDispatchSerializeOutputSchema = external_exports.object({
45362
- build_request_id: uuid11,
45405
+ build_request_id: uuid12,
45363
45406
  before_task_key: external_exports.string(),
45364
45407
  after_task_key: external_exports.string(),
45365
45408
  // false when the edge already existed (idempotent no-op) — still a valid, audited call.
45366
45409
  edge_added: external_exports.boolean(),
45367
- decision_id: uuid11.nullable(),
45368
- event_id: uuid11.nullable()
45410
+ decision_id: uuid12.nullable(),
45411
+ event_id: uuid12.nullable()
45369
45412
  }).strict();
45370
45413
  var forgeClarificationAnswer = external_exports.object({
45371
45414
  question: external_exports.string().trim().min(1).max(2e3),
45372
45415
  answer: external_exports.string().trim().min(1).max(4e3)
45373
45416
  }).strict();
45374
45417
  var softwareRequestAnswerClarificationInputSchema = external_exports.object({
45375
- build_request_id: uuid11,
45418
+ build_request_id: uuid12,
45376
45419
  answers: external_exports.array(forgeClarificationAnswer).min(1).max(50),
45377
45420
  // The planner marks the plan ready once its questions are resolved; the human/COS can
45378
45421
  // signal that here. Default false keeps the plan in needs_clarification.
45379
45422
  mark_ready_for_plan_review: external_exports.boolean().default(false)
45380
45423
  }).strict();
45381
45424
  var softwareRequestAnswerClarificationOutputSchema = external_exports.object({
45382
- build_request_id: uuid11,
45383
- plan_version_id: uuid11,
45425
+ build_request_id: uuid12,
45426
+ plan_version_id: uuid12,
45384
45427
  status: softwarePlanVersionStatusSchema,
45385
45428
  answered_count: external_exports.number().int()
45386
45429
  });
45387
45430
  var softwarePlanApproveInputSchema = external_exports.object({
45388
- build_request_id: uuid11,
45431
+ build_request_id: uuid12,
45389
45432
  rationale: external_exports.string().trim().min(1).max(4e3).optional()
45390
45433
  }).strict();
45391
45434
  var softwarePlanRejectInputSchema = external_exports.object({
45392
- build_request_id: uuid11,
45435
+ build_request_id: uuid12,
45393
45436
  // A rejection must say why (it routes the request back to discovery/scoping).
45394
45437
  rationale: external_exports.string().trim().min(1).max(4e3)
45395
45438
  }).strict();
45396
45439
  var softwarePlanDecisionOutputSchema = external_exports.object({
45397
- build_request_id: uuid11,
45398
- plan_version_id: uuid11,
45440
+ build_request_id: uuid12,
45441
+ plan_version_id: uuid12,
45399
45442
  status: external_exports.enum(["approved", "rejected"]),
45400
- decision_id: uuid11,
45443
+ decision_id: uuid12,
45401
45444
  current_phase: softwarePhaseSchema
45402
45445
  });
45403
45446
  var forgeConformanceFindingInput = external_exports.object({
@@ -45405,41 +45448,41 @@ var forgeConformanceFindingInput = external_exports.object({
45405
45448
  category: softwareConformanceCategorySchema.default("other"),
45406
45449
  summary: external_exports.string().trim().min(1).max(2e3),
45407
45450
  detail: external_exports.string().trim().min(1).max(8e3).optional(),
45408
- changeset_id: uuid11.optional(),
45409
- plan_version_id: uuid11.optional()
45451
+ changeset_id: uuid12.optional(),
45452
+ plan_version_id: uuid12.optional()
45410
45453
  }).strict();
45411
45454
  var softwareConformanceRecordFindingsInputSchema = external_exports.object({
45412
- build_request_id: uuid11,
45413
- phase_run_id: uuid11.optional(),
45455
+ build_request_id: uuid12,
45456
+ phase_run_id: uuid12.optional(),
45414
45457
  findings: external_exports.array(forgeConformanceFindingInput).min(1).max(50)
45415
45458
  }).strict();
45416
45459
  var softwareConformanceRecordFindingsOutputSchema = external_exports.object({
45417
- build_request_id: uuid11,
45460
+ build_request_id: uuid12,
45418
45461
  recorded_count: external_exports.number().int(),
45419
- finding_ids: external_exports.array(uuid11),
45462
+ finding_ids: external_exports.array(uuid12),
45420
45463
  open_finding_count: external_exports.number().int()
45421
45464
  }).strict();
45422
45465
  var softwareConformanceResolveFindingInputSchema = external_exports.object({
45423
- build_request_id: uuid11,
45424
- finding_ids: external_exports.array(uuid11).min(1).max(50),
45466
+ build_request_id: uuid12,
45467
+ finding_ids: external_exports.array(uuid12).min(1).max(50),
45425
45468
  // The re-review run that verified the fix — provenance only (rides into the append-only audit
45426
45469
  // event; the finding row's resolution state is the durable transition).
45427
- phase_run_id: uuid11.optional()
45470
+ phase_run_id: uuid12.optional()
45428
45471
  }).strict();
45429
45472
  var softwareConformanceResolveFindingOutputSchema = external_exports.object({
45430
- build_request_id: uuid11,
45473
+ build_request_id: uuid12,
45431
45474
  resolved_count: external_exports.number().int(),
45432
- resolved_finding_ids: external_exports.array(uuid11),
45475
+ resolved_finding_ids: external_exports.array(uuid12),
45433
45476
  open_finding_count: external_exports.number().int()
45434
45477
  }).strict();
45435
45478
  var softwareAuthorityProfileListInputSchema = external_exports.object({
45436
- software_project_id: uuid11.nullable().optional()
45479
+ software_project_id: uuid12.nullable().optional()
45437
45480
  }).strict();
45438
45481
  var softwareAuthorityProfileListOutputSchema = external_exports.object({
45439
45482
  profiles: external_exports.array(softwareAuthorityProfileSummarySchema)
45440
45483
  });
45441
45484
  var softwareAuthorityProfileCreateInputSchema = external_exports.object({
45442
- software_project_id: uuid11.nullable().optional(),
45485
+ software_project_id: uuid12.nullable().optional(),
45443
45486
  name: external_exports.string().trim().min(1).max(120),
45444
45487
  preset: softwareAuthorityPresetSchema.default("read_only"),
45445
45488
  // A closed capability map (booleans by capability key). Never derived from
@@ -45448,77 +45491,77 @@ var softwareAuthorityProfileCreateInputSchema = external_exports.object({
45448
45491
  is_default: external_exports.boolean().optional()
45449
45492
  }).strict();
45450
45493
  var softwareAuthorityProfileCreateOutputSchema = external_exports.object({
45451
- profile_id: uuid11,
45494
+ profile_id: uuid12,
45452
45495
  name: external_exports.string(),
45453
45496
  preset: softwareAuthorityPresetSchema
45454
45497
  });
45455
45498
  var softwareAuthorityGrantInputSchema = external_exports.object({
45456
- software_project_id: uuid11,
45457
- seat_id: uuid11,
45458
- authority_profile_id: uuid11
45499
+ software_project_id: uuid12,
45500
+ seat_id: uuid12,
45501
+ authority_profile_id: uuid12
45459
45502
  }).strict();
45460
45503
  var softwareAuthorityGrantOutputSchema = external_exports.object({
45461
- grant_id: uuid11,
45462
- software_project_id: uuid11,
45463
- seat_id: uuid11,
45464
- authority_profile_id: uuid11,
45504
+ grant_id: uuid12,
45505
+ software_project_id: uuid12,
45506
+ seat_id: uuid12,
45507
+ authority_profile_id: uuid12,
45465
45508
  status: softwareGrantStatusSchema
45466
45509
  });
45467
45510
  var softwareAuthorityRevokeInputSchema = external_exports.object({
45468
- grant_id: uuid11
45511
+ grant_id: uuid12
45469
45512
  }).strict();
45470
45513
  var softwareAuthorityRevokeOutputSchema = external_exports.object({
45471
- grant_id: uuid11,
45514
+ grant_id: uuid12,
45472
45515
  status: softwareGrantStatusSchema
45473
45516
  });
45474
45517
  var softwareSecretRequestInputSchema = external_exports.object({
45475
- software_project_id: uuid11,
45518
+ software_project_id: uuid12,
45476
45519
  environment: softwareEnvironmentSchema,
45477
- seat_id: uuid11,
45520
+ seat_id: uuid12,
45478
45521
  action: softwareSecretActionSchema,
45479
45522
  key_name: softwareSecretKeyNameSchema,
45480
45523
  reason: external_exports.string().max(2e3).optional()
45481
45524
  }).strict();
45482
45525
  var softwareSecretRequestOutputSchema = external_exports.object({
45483
45526
  requested: external_exports.literal(true),
45484
- credential_request_id: uuid11,
45485
- approval_task_id: uuid11,
45486
- software_project_id: uuid11,
45527
+ credential_request_id: uuid12,
45528
+ approval_task_id: uuid12,
45529
+ software_project_id: uuid12,
45487
45530
  environment: softwareEnvironmentSchema,
45488
- seat_id: uuid11,
45531
+ seat_id: uuid12,
45489
45532
  key_name: external_exports.string()
45490
45533
  });
45491
45534
  var softwareSecretGrantInputSchema = external_exports.object({
45492
- software_project_id: uuid11,
45535
+ software_project_id: uuid12,
45493
45536
  environment: softwareEnvironmentSchema,
45494
- seat_id: uuid11,
45537
+ seat_id: uuid12,
45495
45538
  action: softwareSecretActionSchema,
45496
45539
  key_name: softwareSecretKeyNameSchema,
45497
45540
  // POINTER only. The vault ref shape refinement rejects any raw-secret value.
45498
45541
  vault_ref: softwareVaultRefSchema
45499
45542
  }).strict();
45500
45543
  var softwareSecretGrantOutputSchema = external_exports.object({
45501
- grant_id: uuid11,
45544
+ grant_id: uuid12,
45502
45545
  key_name: external_exports.string(),
45503
45546
  environment: softwareEnvironmentSchema,
45504
45547
  status: softwareGrantStatusSchema
45505
45548
  });
45506
45549
  var softwareSecretRevokeInputSchema = external_exports.object({
45507
- grant_id: uuid11
45550
+ grant_id: uuid12
45508
45551
  }).strict();
45509
45552
  var softwareSecretRevokeOutputSchema = external_exports.object({
45510
- grant_id: uuid11,
45553
+ grant_id: uuid12,
45511
45554
  status: softwareGrantStatusSchema
45512
45555
  });
45513
45556
  var softwareConfigListInputSchema = external_exports.object({
45514
- software_project_id: uuid11.nullable().optional(),
45557
+ software_project_id: uuid12.nullable().optional(),
45515
45558
  environment: softwareEnvironmentSchema.nullable().optional()
45516
45559
  }).strict();
45517
45560
  var softwareConfigListOutputSchema = external_exports.object({
45518
45561
  entries: external_exports.array(softwareConfigEntrySummarySchema)
45519
45562
  });
45520
45563
  var softwareConfigSetInputSchema = external_exports.object({
45521
- software_project_id: uuid11,
45564
+ software_project_id: uuid12,
45522
45565
  environment: softwareEnvironmentSchema,
45523
45566
  key_name: softwareSecretKeyNameSchema,
45524
45567
  value_kind: softwareConfigValueKindSchema,
@@ -45538,24 +45581,24 @@ var softwareConfigSetInputSchema = external_exports.object({
45538
45581
  }
45539
45582
  });
45540
45583
  var softwareConfigSetOutputSchema = external_exports.object({
45541
- config_entry_id: uuid11,
45542
- software_project_id: uuid11,
45584
+ config_entry_id: uuid12,
45585
+ software_project_id: uuid12,
45543
45586
  environment: softwareEnvironmentSchema,
45544
45587
  key_name: external_exports.string(),
45545
45588
  value_kind: softwareConfigValueKindSchema,
45546
45589
  has_secret_ref: external_exports.boolean()
45547
45590
  });
45548
45591
  var softwareSecretRequestListInputSchema = external_exports.object({
45549
- software_project_id: uuid11.nullable().optional(),
45592
+ software_project_id: uuid12.nullable().optional(),
45550
45593
  status: softwareCredentialRequestStatusSchema.nullable().optional()
45551
45594
  }).strict();
45552
45595
  var softwareSecretRequestListOutputSchema = external_exports.object({
45553
45596
  requests: external_exports.array(softwareCredentialRequestSummarySchema)
45554
45597
  });
45555
45598
  var softwareSecretUseInputSchema = external_exports.object({
45556
- software_project_id: uuid11,
45599
+ software_project_id: uuid12,
45557
45600
  environment: softwareEnvironmentSchema,
45558
- seat_id: uuid11,
45601
+ seat_id: uuid12,
45559
45602
  action: softwareSecretActionSchema,
45560
45603
  key_name: softwareSecretKeyNameSchema,
45561
45604
  operation: softwareSecretAccessOperationSchema.default("use")
@@ -45566,12 +45609,12 @@ var softwareSecretUseOutputSchema = external_exports.object({
45566
45609
  key_name: external_exports.string(),
45567
45610
  environment: softwareEnvironmentSchema,
45568
45611
  operation: softwareSecretAccessOperationSchema,
45569
- access_log_id: uuid11,
45570
- missing_request_id: uuid11.nullable(),
45612
+ access_log_id: uuid12,
45613
+ missing_request_id: uuid12.nullable(),
45571
45614
  redacted_summary: external_exports.record(external_exports.string(), external_exports.unknown())
45572
45615
  });
45573
45616
  var softwareCapacityListInputSchema = external_exports.object({
45574
- runner_id: uuid11.nullable().optional(),
45617
+ runner_id: uuid12.nullable().optional(),
45575
45618
  limit: external_exports.number().int().positive().max(200).optional()
45576
45619
  }).strict();
45577
45620
  var softwareCapacityListOutputSchema = external_exports.object({
@@ -45626,9 +45669,9 @@ var forgeTrustedControlSchema = external_exports.object({
45626
45669
  automation_mode: softwareAutomationModeSchema,
45627
45670
  inferred_risk: softwareRiskLevelSchema,
45628
45671
  risk_ceiling: softwareRiskLevelSchema.nullable().default(null),
45629
- authority_profile_ids: external_exports.array(uuid11).max(50).default([]),
45672
+ authority_profile_ids: external_exports.array(uuid12).max(50).default([]),
45630
45673
  active_secret_grant_count: external_exports.number().int().nonnegative().max(1e3).default(0),
45631
- pending_gate_ids: external_exports.array(uuid11).max(50).default([])
45674
+ pending_gate_ids: external_exports.array(uuid12).max(50).default([])
45632
45675
  }).strict();
45633
45676
  var forgeSeatSkillSchema = external_exports.object({
45634
45677
  slug: external_exports.string().trim().min(1).max(200),
@@ -45637,9 +45680,9 @@ var forgeSeatSkillSchema = external_exports.object({
45637
45680
  }).strict();
45638
45681
  var forgeRuntimeContextPacketSchema = external_exports.object({
45639
45682
  schema_version: external_exports.literal(1),
45640
- phase_run_id: uuid11,
45641
- build_request_id: uuid11,
45642
- software_project_id: uuid11,
45683
+ phase_run_id: uuid12,
45684
+ build_request_id: uuid12,
45685
+ software_project_id: uuid12,
45643
45686
  phase: softwarePhaseSchema,
45644
45687
  request_status: softwareRequestStatusSchema,
45645
45688
  project: external_exports.object({
@@ -45648,7 +45691,7 @@ var forgeRuntimeContextPacketSchema = external_exports.object({
45648
45691
  }).strict(),
45649
45692
  scheduler: external_exports.object({
45650
45693
  lease_model: external_exports.literal("work_order_claim_heartbeat"),
45651
- runner_id: uuid11,
45694
+ runner_id: uuid12,
45652
45695
  max_runner_sessions: external_exports.number().int().positive().max(8),
45653
45696
  model_account_state: external_exports.string().min(1).max(80),
45654
45697
  account_alias: external_exports.string().min(1).max(200).nullable()
@@ -45732,7 +45775,7 @@ var runnerTurnReportSchema = external_exports.object({
45732
45775
  var softwareDeveloperTeamInstallInputSchema = external_exports.object({
45733
45776
  // The human-accountable steward seat for the installed team. Agent seats created
45734
45777
  // by the template chain through this seat so no agent occupancy can be orphaned.
45735
- steward_seat_id: uuid11,
45778
+ steward_seat_id: uuid12,
45736
45779
  // Optional project scope for authority grants. Authority profile presets are
45737
45780
  // installed tenant-wide either way; grants are project-scoped only when supplied.
45738
45781
  // DER-1241: `.nullable()` too — this command is human-confirmed, so its input is
@@ -45740,7 +45783,7 @@ var softwareDeveloperTeamInstallInputSchema = external_exports.object({
45740
45783
  // replay; an empty project round-trips as JSON `null`, which a bare `.optional()`
45741
45784
  // rejects (→ "Command input failed schema validation"). Matches the sibling
45742
45785
  // software-factory schemas that already use `.nullable().optional()`.
45743
- software_project_id: uuid11.nullable().optional(),
45786
+ software_project_id: uuid12.nullable().optional(),
45744
45787
  assign_skills: external_exports.boolean().default(true),
45745
45788
  // DER-1264: the install auto-staffs live agents at a pr_only, observe-first
45746
45789
  // posture. If the tenant's company autonomy ceiling (`agent_policy`) is MORE
@@ -45760,34 +45803,34 @@ var softwareDeveloperTeamInstallInputSchema = external_exports.object({
45760
45803
  }).strict();
45761
45804
  var softwareDeveloperTeamSeatSummarySchema = external_exports.object({
45762
45805
  role: softwareDeveloperTeamRoleSchema,
45763
- seat_id: uuid11,
45806
+ seat_id: uuid12,
45764
45807
  name: external_exports.string(),
45765
- charter_version_id: uuid11,
45808
+ charter_version_id: uuid12,
45766
45809
  created: external_exports.boolean()
45767
45810
  });
45768
45811
  var softwareDeveloperTeamSkillSummarySchema = external_exports.object({
45769
45812
  slug: external_exports.string(),
45770
- skill_id: uuid11,
45771
- skill_version_id: uuid11,
45772
- assigned_seat_ids: external_exports.array(uuid11)
45813
+ skill_id: uuid12,
45814
+ skill_version_id: uuid12,
45815
+ assigned_seat_ids: external_exports.array(uuid12)
45773
45816
  });
45774
45817
  var softwareDeveloperTeamAuthorityProfileSummarySchema = external_exports.object({
45775
45818
  preset: softwareAuthorityPresetSchema,
45776
- profile_id: uuid11,
45819
+ profile_id: uuid12,
45777
45820
  name: external_exports.string()
45778
45821
  });
45779
45822
  var softwareDeveloperTeamAuthorityGrantSummarySchema = external_exports.object({
45780
45823
  role: softwareDeveloperTeamRoleSchema,
45781
- software_project_id: uuid11,
45782
- seat_id: uuid11,
45783
- authority_profile_id: uuid11,
45784
- grant_id: uuid11,
45824
+ software_project_id: uuid12,
45825
+ seat_id: uuid12,
45826
+ authority_profile_id: uuid12,
45827
+ grant_id: uuid12,
45785
45828
  created: external_exports.boolean()
45786
45829
  });
45787
45830
  var softwareDeveloperTeamOccupancySummarySchema = external_exports.object({
45788
45831
  role: softwareDeveloperTeamRoleSchema,
45789
- seat_id: uuid11,
45790
- agent_id: uuid11,
45832
+ seat_id: uuid12,
45833
+ agent_id: uuid12,
45791
45834
  template_slug: external_exports.string(),
45792
45835
  status: external_exports.literal("live"),
45793
45836
  // false when a live agent already occupied the seat (idempotent re-install).
@@ -45807,7 +45850,7 @@ var softwareDeveloperTeamTokenBudgetSummarySchema = external_exports.object({
45807
45850
  set_by_install: external_exports.boolean()
45808
45851
  });
45809
45852
  var softwareDeveloperTeamGithubPolicySummarySchema = external_exports.object({
45810
- software_project_id: uuid11,
45853
+ software_project_id: uuid12,
45811
45854
  automation_mode_ceiling: softwareAutomationModeSchema,
45812
45855
  // false when a pre-existing policy was preserved (not created by this install).
45813
45856
  created: external_exports.boolean()
@@ -45835,8 +45878,8 @@ var softwareDeveloperTeamUninstallInputSchema = external_exports.object({
45835
45878
  }).strict();
45836
45879
  var softwareDeveloperTeamDecommissionedAgentSchema = external_exports.object({
45837
45880
  role: softwareDeveloperTeamRoleSchema.nullable(),
45838
- seat_id: uuid11,
45839
- agent_id: uuid11
45881
+ seat_id: uuid12,
45882
+ agent_id: uuid12
45840
45883
  });
45841
45884
  var softwareDeveloperTeamUninstallOutputSchema = external_exports.object({
45842
45885
  torn_down: external_exports.boolean(),
@@ -45986,8 +46029,8 @@ var forgeMemoryDraftArtifact = external_exports.object({
45986
46029
  follow_up_items: forgeArtifactList
45987
46030
  }).strict();
45988
46031
  var softwareGithubAutomationPolicyInputSchema = external_exports.object({
45989
- software_project_id: uuid11,
45990
- authority_profile_id: uuid11.nullable().optional(),
46032
+ software_project_id: uuid12,
46033
+ authority_profile_id: uuid12.nullable().optional(),
45991
46034
  automation_mode_ceiling: softwareAutomationModeSchema.default("plan_only"),
45992
46035
  allowed_actions: external_exports.array(softwareGithubActionSchema).max(20),
45993
46036
  // DER-1233: the element schema is a single FLATTENED enum (the union of the
@@ -46023,12 +46066,12 @@ var softwareGithubInstallationConnectInputSchema = external_exports.object({
46023
46066
  repositories: external_exports.array(softwareGithubConnectedRepositoryInputSchema).min(1).max(200)
46024
46067
  }).strict();
46025
46068
  var softwareGithubInstallationConnectOutputSchema = external_exports.object({
46026
- github_installation_id: uuid11,
46069
+ github_installation_id: uuid12,
46027
46070
  repositories_connected: external_exports.number().int().nonnegative()
46028
46071
  });
46029
46072
  var softwareGithubRepositoryBindMappingSchema = external_exports.object({
46030
46073
  repository_id: external_exports.number().int().positive(),
46031
- software_project_id: uuid11
46074
+ software_project_id: uuid12
46032
46075
  }).strict();
46033
46076
  var softwareGithubInstallationBindInputSchema = external_exports.object({
46034
46077
  app_slug: external_exports.string().trim().min(1).max(120).default("rost-forge"),
@@ -46036,7 +46079,7 @@ var softwareGithubInstallationBindInputSchema = external_exports.object({
46036
46079
  bindings: external_exports.array(softwareGithubRepositoryBindMappingSchema).min(1).max(100)
46037
46080
  }).strict();
46038
46081
  var softwareGithubInstallationBindOutputSchema = external_exports.object({
46039
- github_installation_id: uuid11,
46082
+ github_installation_id: uuid12,
46040
46083
  repositories_bound: external_exports.number().int().nonnegative()
46041
46084
  });
46042
46085
  var softwareGithubRepositoryUnbindInputSchema = external_exports.object({
@@ -46057,12 +46100,12 @@ var softwareGithubInstallationRepositoryViewSchema = external_exports.object({
46057
46100
  private: external_exports.boolean(),
46058
46101
  default_branch: external_exports.string(),
46059
46102
  status: external_exports.enum(["connected", "active"]),
46060
- software_project_id: uuid11.nullable(),
46103
+ software_project_id: uuid12.nullable(),
46061
46104
  software_project_name: external_exports.string().nullable(),
46062
46105
  software_project_slug: external_exports.string().nullable()
46063
46106
  });
46064
46107
  var softwareGithubInstallationViewSchema = external_exports.object({
46065
- id: uuid11,
46108
+ id: uuid12,
46066
46109
  installation_id: external_exports.number().int().positive(),
46067
46110
  account_login: external_exports.string(),
46068
46111
  account_id: external_exports.number().int().positive(),
@@ -46074,17 +46117,17 @@ var softwareGithubInstallationListOutputSchema = external_exports.object({
46074
46117
  installations: external_exports.array(softwareGithubInstallationViewSchema)
46075
46118
  });
46076
46119
  var softwareGithubAutomationPolicyUpsertOutputSchema = external_exports.object({
46077
- policy_id: uuid11,
46078
- software_project_id: uuid11,
46120
+ policy_id: uuid12,
46121
+ software_project_id: uuid12,
46079
46122
  automation_mode_ceiling: softwareAutomationModeSchema,
46080
46123
  max_risk: softwareRiskLevelSchema.nullable()
46081
46124
  });
46082
46125
  var softwareGithubInstallationTokenCreateInputSchema = external_exports.object({
46083
- software_project_id: uuid11,
46126
+ software_project_id: uuid12,
46084
46127
  repository_id: external_exports.number().int().positive(),
46085
46128
  requested_actions: external_exports.array(softwareGithubActionSchema).min(1).max(20),
46086
46129
  requested_automation_mode: softwareAutomationModeSchema.default("plan_only"),
46087
- seat_id: uuid11.optional()
46130
+ seat_id: uuid12.optional()
46088
46131
  }).strict();
46089
46132
  var softwareGithubInstallationTokenCreateOutputSchema = external_exports.object({
46090
46133
  installation_id: external_exports.number().int().positive(),
@@ -46121,13 +46164,13 @@ var softwareVercelConnectionConnectInputSchema = external_exports.object({
46121
46164
  scopes: external_exports.array(external_exports.string().trim().min(1).max(120)).max(40).default([])
46122
46165
  }).strict();
46123
46166
  var softwareVercelConnectionConnectOutputSchema = external_exports.object({
46124
- vercel_connection_id: uuid11,
46167
+ vercel_connection_id: uuid12,
46125
46168
  account_id: external_exports.string(),
46126
46169
  team_id: external_exports.string().nullable()
46127
46170
  });
46128
46171
  var softwareVercelProjectLinkInputSchema = external_exports.object({
46129
- software_project_id: uuid11,
46130
- vercel_connection_id: uuid11,
46172
+ software_project_id: uuid12,
46173
+ vercel_connection_id: uuid12,
46131
46174
  vercel_project_id: external_exports.string().trim().min(1).max(200),
46132
46175
  vercel_project_name: external_exports.string().trim().min(1).max(255),
46133
46176
  framework: external_exports.string().trim().min(1).max(120).nullable().optional(),
@@ -46136,12 +46179,12 @@ var softwareVercelProjectLinkInputSchema = external_exports.object({
46136
46179
  git_repository: external_exports.record(external_exports.string().min(1), external_exports.unknown()).default({})
46137
46180
  }).strict();
46138
46181
  var softwareVercelProjectLinkOutputSchema = external_exports.object({
46139
- vercel_project_link_id: uuid11,
46140
- software_project_id: uuid11,
46182
+ vercel_project_link_id: uuid12,
46183
+ software_project_id: uuid12,
46141
46184
  vercel_project_id: external_exports.string()
46142
46185
  });
46143
46186
  var softwareVercelConnectionViewSchema = external_exports.object({
46144
- id: uuid11,
46187
+ id: uuid12,
46145
46188
  account_id: external_exports.string(),
46146
46189
  account_name: external_exports.string().nullable(),
46147
46190
  team_id: external_exports.string().nullable(),
@@ -46152,11 +46195,11 @@ var softwareVercelConnectionViewSchema = external_exports.object({
46152
46195
  connected_at: external_exports.string()
46153
46196
  });
46154
46197
  var softwareVercelProjectLinkViewSchema = external_exports.object({
46155
- id: uuid11,
46156
- software_project_id: uuid11,
46198
+ id: uuid12,
46199
+ software_project_id: uuid12,
46157
46200
  software_project_name: external_exports.string(),
46158
46201
  software_project_slug: external_exports.string(),
46159
- vercel_connection_id: uuid11,
46202
+ vercel_connection_id: uuid12,
46160
46203
  vercel_project_id: external_exports.string(),
46161
46204
  vercel_project_name: external_exports.string(),
46162
46205
  framework: external_exports.string().nullable(),
@@ -46170,16 +46213,16 @@ var softwareVercelProjectListOutputSchema = external_exports.object({
46170
46213
  project_links: external_exports.array(softwareVercelProjectLinkViewSchema)
46171
46214
  });
46172
46215
  var softwareVercelDeployPreviewInputSchema = external_exports.object({
46173
- software_project_id: uuid11,
46216
+ software_project_id: uuid12,
46174
46217
  commit_sha: external_exports.string().trim().regex(/^[A-Fa-f0-9]{7,64}$/),
46175
46218
  git_ref: external_exports.string().trim().min(1).max(255),
46176
- build_request_id: uuid11.optional(),
46177
- phase_run_id: uuid11.optional(),
46178
- seat_id: uuid11.optional(),
46219
+ build_request_id: uuid12.optional(),
46220
+ phase_run_id: uuid12.optional(),
46221
+ seat_id: uuid12.optional(),
46179
46222
  required_secret_keys: external_exports.array(external_exports.string().trim().min(1).max(200)).max(25).default([])
46180
46223
  }).strict();
46181
46224
  var softwareVercelDeployPreviewOutputSchema = external_exports.object({
46182
- vercel_deployment_record_id: uuid11,
46225
+ vercel_deployment_record_id: uuid12,
46183
46226
  deployment_id: external_exports.string(),
46184
46227
  deployment_url: external_exports.string().nullable(),
46185
46228
  commit_sha: external_exports.string(),
@@ -46187,18 +46230,18 @@ var softwareVercelDeployPreviewOutputSchema = external_exports.object({
46187
46230
  });
46188
46231
 
46189
46232
  // ../../packages/protocol/src/software-factory-events.ts
46190
- var uuid12 = external_exports.string().uuid();
46233
+ var uuid13 = external_exports.string().uuid();
46191
46234
  var softwareFactoryPhaseRunCompletedEventSchema = external_exports.object({
46192
- tenantId: uuid12,
46193
- phaseRunId: uuid12,
46194
- buildRequestId: uuid12.nullish(),
46235
+ tenantId: uuid13,
46236
+ phaseRunId: uuid13,
46237
+ buildRequestId: uuid13.nullish(),
46195
46238
  status: external_exports.enum(["passed", "failed"]),
46196
46239
  idempotencyKey: external_exports.string().min(1).optional()
46197
46240
  }).strict();
46198
46241
  var softwareFactoryBudgetExhaustedEventSchema = external_exports.object({
46199
- tenantId: uuid12,
46200
- phaseRunId: uuid12,
46201
- buildRequestId: uuid12,
46242
+ tenantId: uuid13,
46243
+ phaseRunId: uuid13,
46244
+ buildRequestId: uuid13,
46202
46245
  reason: external_exports.string().min(1),
46203
46246
  idempotencyKey: external_exports.string().min(1).optional()
46204
46247
  }).strict();
@@ -48388,7 +48431,7 @@ External connectors are being rolled out provider by provider, conservatively (r
48388
48431
  order: 48,
48389
48432
  title: "CLI and MCP installation guide",
48390
48433
  summary: "Install the public CLI, register remote token-backed MCP clients, and find the full command and tool catalog.",
48391
- version: "2026-07-16.8",
48434
+ version: "2026-07-16.9",
48392
48435
  public: true,
48393
48436
  audiences: ["human", "cli", "mcp", "in_app_agent"],
48394
48437
  stages: ["company_setup", "staffing"],
@@ -49232,6 +49275,7 @@ Seat-scoped MCP tokens expose the operating protocol below. The server still che
49232
49275
  | \`rost_list_brokered_secret_grants\` | \`secret_grant.list\` | List the seat's own brokered secret grants. Returns egress allowlist metadata only (host, path prefix, methods, scope, status), never the vault ref or any secret. | Seat | Call with {} (an agent is server-pinned to its own seat). |
49233
49276
  | \`rost_record_forge_conformance_findings\` | \`software_factory.conformance.record_findings\` | A Forge review seat (plan conformance, security, or QA) records structured findings as reviewer evidence. Set \`changeset_id\` on a finding that targets a specific changeset. Open findings route the request back to implementation; accepting a gap remains a separate human gate. Requires the seat's signed manifest grant. | Seat | Call with \`{"build_request_id":"<request-id>","findings":[{"severity":"major","category":"scope_gap","summary":"Missing migration verification","changeset_id":"<changeset-id>"}]}\`. |
49234
49277
  | \`rost_resolve_forge_conformance_finding\` | \`software_factory.conformance.resolve_finding\` | A Forge review seat marks a prior open finding resolved after re-reviewing the changeset and verifying it is fixed (reviewer verification, not human gap-acceptance). A resolved finding stops routing the request back to implementation, so the recycle loop converges. Requires the seat's signed manifest grant. | Seat | Call with \`{"build_request_id":"<request-id>","finding_ids":["<finding-id>"]}\`. |
49278
+ | \`rost_decide_a_conversational_gate\` | \`gate.decide\` | A seat agent DRAFTS a conversational gate approval bound to an artifact digest; the call stages a pending confirmation and a human owner/admin CONFIRMS it via /approvals (invariant #7 \u2014 an agent drafts, never self-decides). A stale artifact digest (the artifact changed since the gate was drafted) re-blocks and refuses. | Seat (draft; owner/admin decides) | Call with \`{"subject_kind":"artifact","subject_id":"<id>","artifact_ref":{"href":"<url>","label":"<label>"},"artifact_digest":"sha256:<digest>","decision":"approve","ask":"Ship it?","consequence":"Unblocks implementation."}\`; the seat-agent caller receives a confirmation handoff and the owner/admin decides. |
49235
49279
 
49236
49280
  ### MCP operation resources
49237
49281
 
@@ -52520,6 +52564,7 @@ var COMMAND_MANIFEST = [
52520
52564
  { "id": "friction.resolve", "namespace": "friction", "action": "resolve", "title": "Resolve Friction issue", "description": 'Resolve an issue with a root cause. In the default "ids" resolution_mode this also creates a remediation follow-up task; "already_fixed" records only the root cause (no follow-up task). Always records a human decision (decided_by) in the same transaction.', "requiredScope": "tenant_admin", "confirmation": "human_required", "exposeOverMcp": true, "fields": [{ "name": "issue_id", "flag": "issue-id", "type": "string", "required": true }, { "name": "resolution_mode", "flag": "resolution-mode", "type": "enum", "required": false, "enumValues": ["ids", "already_fixed"] }, { "name": "root_cause", "flag": "root-cause", "type": "string", "required": true }, { "name": "owner_seat_id", "flag": "owner-seat-id", "type": "string", "required": false }, { "name": "task_title", "flag": "task-title", "type": "string", "required": false }, { "name": "task_description", "flag": "task-description", "type": "string", "required": false }, { "name": "done_by", "flag": "done-by", "type": "string", "required": false }, { "name": "resolving_seat_id", "flag": "resolving-seat-id", "type": "string", "required": false }], "hasComplexInput": false, "help": "Resolve an issue with a root cause and remediation task; resolution is a human decision." },
52521
52565
  { "id": "friction.stale_candidates", "namespace": "friction", "action": "stale_candidates", "title": "Find stale friction", "description": "List open or diagnosing Friction issues whose linked remediation task has already shipped, making them high-confidence candidates for bulk resolution, with per-row evidence. Read-only \u2014 it never resolves anything.", "requiredScope": "tenant", "confirmation": "none", "exposeOverMcp": true, "fields": [{ "name": "stale_after_days", "flag": "stale-after-days", "type": "integer", "required": false }, { "name": "limit", "flag": "limit", "type": "integer", "required": false }], "hasComplexInput": false, "help": "List open or diagnosing issues whose remediation task already shipped \u2014 high-confidence candidates for a bulk close-the-loop pass. Read-only." },
52522
52566
  { "id": "friction.update_status", "namespace": "friction", "action": "update_status", "title": "Update Friction issue status", "description": "Move a non-terminal issue between open and diagnosing. Terminal issues (resolved/dropped) cannot be reopened here.", "requiredScope": "tenant", "confirmation": "none", "exposeOverMcp": true, "fields": [{ "name": "issue_id", "flag": "issue-id", "type": "string", "required": true }, { "name": "status", "flag": "status", "type": "enum", "required": true, "enumValues": ["open", "diagnosing"] }], "hasComplexInput": false, "help": "Move a non-terminal issue between open and diagnosing while it is being worked." },
52567
+ { "id": "gate.decide", "namespace": "gate", "action": "decide", "title": "Decide a conversational gate", "description": "A human approves or rejects a conversational gate bound to an artifact digest (a prototype URL, deliverable, or artifact). The agent drafts the decision and the human confirms it; the resolver is always a human (invariant #7). On approval the artifact must be unchanged since the gate was drafted \u2014 a stale digest re-blocks. Requires confirmation.", "requiredScope": "tenant", "confirmation": "human_required", "exposeOverMcp": true, "fields": [{ "name": "subject_kind", "flag": "subject-kind", "type": "enum", "required": true, "enumValues": ["prototype", "deliverable", "artifact"] }, { "name": "subject_id", "flag": "subject-id", "type": "string", "required": true }, { "name": "artifact_digest", "flag": "artifact-digest", "type": "string", "required": true }, { "name": "decision", "flag": "decision", "type": "enum", "required": true, "enumValues": ["approve", "reject"] }, { "name": "ask", "flag": "ask", "type": "string", "required": true }, { "name": "consequence", "flag": "consequence", "type": "string", "required": true }, { "name": "unblocked_targets", "flag": "unblocked-targets", "type": "array", "required": false, "itemType": "string" }, { "name": "rationale", "flag": "rationale", "type": "string", "required": false }], "hasComplexInput": true, "help": "A human approves or rejects a conversational gate bound to an artifact digest; the agent drafts, the human confirms (invariant #7)." },
52523
52568
  { "id": "goal.bind_measurable", "namespace": "goal", "action": "bind_measurable", "title": "Bind a Signal to a Cascade goal", "description": "Bind a measurable to a goal. Role defaults to 'informs' \u2014 a conservative informative indicator allowed at any goal level (many per goal) that never changes goal status. Role 'drives_status' makes it the goal's status driver: allowed only on a childless seat goal or milestone, at most one per goal, requires a second_anchor (a prior closed period + expected value confirming the Signal matched the books), and auto-status starts OFF until a steward opts in with goal.set_auto_status. Binding a driver over an existing informs binding of the same Signal promotes it. Binding is human-gated.", "requiredScope": "seat", "confirmation": "human_required", "exposeOverMcp": true, "fields": [{ "name": "goal_id", "flag": "goal-id", "type": "string", "required": true }, { "name": "measurable_id", "flag": "measurable-id", "type": "string", "required": true }, { "name": "role", "flag": "role", "type": "enum", "required": false, "enumValues": ["drives_status", "informs"] }], "hasComplexInput": true, "help": "Bind a Signal to a goal. Defaults to role informs (a conservative indicator at any level that never changes status); pass role drives_status with a second_anchor (a prior closed period + expected value confirming the Signal matched the books) to make it a childless leaf goal's status driver \u2014 this promotes an existing informs binding (auto-status starts OFF until a steward opts in)." },
52524
52569
  { "id": "goal.create", "namespace": "goal", "action": "create", "title": "Create Cascade goal", "description": "Create a cycle goal under an existing objective. The parent chain must terminate at a Compass objective in the same cycle (enforced server-side).", "requiredScope": "tenant", "confirmation": "none", "exposeOverMcp": true, "fields": [{ "name": "cycle_id", "flag": "cycle-id", "type": "string", "required": true }, { "name": "seat_id", "flag": "seat-id", "type": "string", "required": true }, { "name": "parent_goal_id", "flag": "parent-goal-id", "type": "string", "required": true }, { "name": "title", "flag": "title", "type": "string", "required": true }, { "name": "definition_of_done", "flag": "definition-of-done", "type": "string", "required": true }, { "name": "status", "flag": "status", "type": "enum", "required": false, "enumValues": ["on", "off"] }], "hasComplexInput": false, "help": "Create cycle goals under an existing objective; the parent chain must terminate at a Compass objective." },
52525
52570
  { "id": "goal.drop", "namespace": "goal", "action": "drop", "title": "Drop Cascade goal", "description": "Drop (retire) a goal by setting status to dropped. Dropping retires the commitment, so it is human-gated. The row is retained for audit (never deleted).", "requiredScope": "tenant_admin", "confirmation": "human_required", "exposeOverMcp": true, "fields": [{ "name": "goal_id", "flag": "goal-id", "type": "string", "required": true }], "hasComplexInput": false, "help": "Drop a goal to retire a commitment; the goal is retained for audit and dropping is human-gated." },
@@ -56345,7 +56390,8 @@ function parseSemver2(value) {
56345
56390
  // src/runner-serve.ts
56346
56391
  import { execFile as execFileCallback5, spawn } from "node:child_process";
56347
56392
  import { createHash as createHash2 } from "node:crypto";
56348
- import { chmod as chmod2, mkdir as mkdir5, readFile as readFile5, rename, rm as rm5, statfs, writeFile as writeFile5 } from "node:fs/promises";
56393
+ import { constants as fsConstants2 } from "node:fs";
56394
+ import { access as access3, chmod as chmod2, mkdir as mkdir5, readFile as readFile5, rename, rm as rm5, statfs, writeFile as writeFile5 } from "node:fs/promises";
56349
56395
  import { cpus, homedir as homedir4, hostname as hostname3, platform, totalmem, tmpdir as tmpdir2 } from "node:os";
56350
56396
  import path7 from "node:path";
56351
56397
  import { setTimeout as sleep3 } from "node:timers/promises";
@@ -57661,11 +57707,43 @@ function resolveSandboxPosture(env, homeDir) {
57661
57707
  function resolveSandboxNetworkFlag(env) {
57662
57708
  return parseSandboxNetwork(env.RUNNER_SANDBOX_NETWORK).allowNetwork ? "allow" : "deny";
57663
57709
  }
57710
+ var CAPABILITY_PROBE_TIMEOUT_MS = 1e4;
57711
+ function classifyProbeError(err) {
57712
+ if (!err || typeof err !== "object") {
57713
+ return "absent";
57714
+ }
57715
+ const candidate = err;
57716
+ const message = typeof candidate.message === "string" ? candidate.message.toLowerCase() : "";
57717
+ if (candidate.code === "ENOENT" || message.includes("not found")) {
57718
+ return "absent";
57719
+ }
57720
+ if (candidate.killed === true || candidate.code === "ETIMEDOUT" || candidate.signal === "SIGTERM") {
57721
+ return "present_slow";
57722
+ }
57723
+ return "absent";
57724
+ }
57725
+ async function isResolvableOnPath(command) {
57726
+ const dirs = (process.env.PATH ?? "").split(path7.delimiter).filter((dir) => dir.length > 0);
57727
+ const suffixes = process.platform === "win32" ? (process.env.PATHEXT ?? ".EXE;.CMD;.BAT;.COM").split(";").filter((ext) => ext.length > 0) : [""];
57728
+ for (const dir of dirs) {
57729
+ for (const suffix of suffixes) {
57730
+ try {
57731
+ await access3(path7.join(dir, `${command}${suffix}`), fsConstants2.X_OK);
57732
+ return true;
57733
+ } catch {
57734
+ }
57735
+ }
57736
+ }
57737
+ return false;
57738
+ }
57664
57739
  async function probe(command) {
57665
57740
  try {
57666
- const { stdout, stderr } = await execFile5(command, ["--version"], { timeout: 1500 });
57741
+ const { stdout, stderr } = await execFile5(command, ["--version"], { timeout: CAPABILITY_PROBE_TIMEOUT_MS });
57667
57742
  return { installed: true, version: (stdout || stderr).trim() || null, auth_state: "ready" };
57668
- } catch {
57743
+ } catch (err) {
57744
+ if (classifyProbeError(err) === "present_slow" && await isResolvableOnPath(command)) {
57745
+ return { installed: true, version: null, auth_state: "unknown" };
57746
+ }
57669
57747
  return { installed: false, version: null, auth_state: "unknown" };
57670
57748
  }
57671
57749
  }
@@ -57701,7 +57779,7 @@ async function probeClaude() {
57701
57779
  }
57702
57780
  async function probeClaudeStreamJsonInterface() {
57703
57781
  try {
57704
- const { stdout, stderr } = await execFile5("claude", ["--help"], { timeout: 1500, maxBuffer: 1024 * 1024 });
57782
+ const { stdout, stderr } = await execFile5("claude", ["--help"], { timeout: CAPABILITY_PROBE_TIMEOUT_MS, maxBuffer: 1024 * 1024 });
57705
57783
  return supportsClaudeStreamJsonInterface(`${stdout ?? ""}
57706
57784
  ${stderr ?? ""}`);
57707
57785
  } catch {
@@ -57713,7 +57791,7 @@ function supportsClaudeStreamJsonInterface(helpText2) {
57713
57791
  }
57714
57792
  async function probeGit() {
57715
57793
  try {
57716
- const { stdout, stderr } = await execFile5("git", ["--version"], { timeout: 1500 });
57794
+ const { stdout, stderr } = await execFile5("git", ["--version"], { timeout: CAPABILITY_PROBE_TIMEOUT_MS });
57717
57795
  const raw = (stdout || stderr).trim();
57718
57796
  return { installed: true, version: /(\d+\.\d+(?:\.\d+)?)/.exec(raw)?.[1] ?? (raw || null) };
57719
57797
  } catch {
@@ -57722,7 +57800,7 @@ async function probeGit() {
57722
57800
  }
57723
57801
  async function probeGh() {
57724
57802
  try {
57725
- const { stdout, stderr } = await execFile5("gh", ["--version"], { timeout: 1500 });
57803
+ const { stdout, stderr } = await execFile5("gh", ["--version"], { timeout: CAPABILITY_PROBE_TIMEOUT_MS });
57726
57804
  const raw = (stdout || stderr).trim().split("\n")[0]?.trim() ?? "";
57727
57805
  const authenticated = await probeGhAuth();
57728
57806
  return { installed: true, version: /(\d+\.\d+\.\d+)/.exec(raw)?.[1] ?? (raw || null), authenticated };
@@ -57848,6 +57926,11 @@ async function executeClaimedUnit(fetchImpl, appUrl2, state, config2, io, runtim
57848
57926
  summary: capResultSummary(result.summary),
57849
57927
  log_ref: input.logRef(id),
57850
57928
  model: (turnRuntime ?? runtime) === "codex" ? "codex-cli" : "claude-cli",
57929
+ // DER-1915: token usage lifted from the claude JSON envelope (extractClaudeUsage), sent for
57930
+ // BOTH kinds when present — never defaulted to 0 (see RunnerTurnResult.inputTokens/outputTokens).
57931
+ // Both result routes (work-orders and turn-executions) accept these snake_case fields.
57932
+ ...result.inputTokens != null ? { input_tokens: result.inputTokens } : {},
57933
+ ...result.outputTokens != null ? { output_tokens: result.outputTokens } : {},
57851
57934
  // Artifact-bearing result fields (T1.5) — only sent when the harness produced them, so
57852
57935
  // the result route's `.strict()` schema still accepts a plain read-status report.
57853
57936
  ...result.prUrl ? { pr_url: result.prUrl } : {},
@@ -57981,9 +58064,14 @@ function resolveTurnPlan(input) {
57981
58064
  ],
57982
58065
  codexSandbox: execution.local_tools === "workspace_write" ? "workspace-write" : "read-only",
57983
58066
  // Forge build/review turns emit a structured JSON envelope (reusing the AICOS
57984
- // --output-format json pattern) so their summary is a real contract, not a stdout
57985
- // slice; read_status AND seat_work (DER-1333) turns keep free-form text status.
57986
- outputFormat: execution.profile === "forge_build" || execution.profile === "forge_review" ? "json" : "text",
58067
+ // --output-format json pattern) so their summary is a real contract, not a stdout slice.
58068
+ // DER-1915: seat_work ALSO uses the JSON envelope now, purely so its usage block
58069
+ // (extractClaudeUsage) is reportable the DER-1333 intent (a free-form status summary,
58070
+ // not a structured contract) is unchanged, because `extractRunnerSummary` unwraps the
58071
+ // envelope down to the model's own `result` text either way; json just adds parseable
58072
+ // metadata (usage, session_id) alongside it. Only read_status (a read-only status stub,
58073
+ // not a real MCP turn) still uses plain text.
58074
+ outputFormat: execution.profile === "forge_build" || execution.profile === "forge_review" || execution.profile === "seat_work" ? "json" : "text",
57987
58075
  // Only a Forge workspace grants a repo cwd; a needs_repo contract with no prepared
57988
58076
  // workspace (broker/clone failed upstream) falls back to tmpdir rather than a bad cwd.
57989
58077
  repoDir: execution.needs_repo ? input.repoDir : null,
@@ -58664,11 +58752,21 @@ function runModelProcess(input) {
58664
58752
  let err = "";
58665
58753
  const timer = setTimeout(() => {
58666
58754
  killProcessTree(child);
58755
+ const seconds = Math.round(input.timeoutMs / 1e3);
58667
58756
  const partial2 = scrubTranscriptSessionIds(redactForLog((out || err || "").trim()));
58757
+ let transcriptBody = partial2;
58758
+ if (transcriptBody.length === 0) {
58759
+ const redactedErr = scrubTranscriptSessionIds(redactForLog(err.trim()));
58760
+ transcriptBody = `turn timed out after ${seconds}s; no model output was captured before the process was killed.`;
58761
+ if (redactedErr.length > 0) {
58762
+ transcriptBody += `
58763
+ ${redactedErr}`;
58764
+ }
58765
+ }
58668
58766
  finish({
58669
58767
  ok: false,
58670
- summary: `turn timed out after ${Math.round(input.timeoutMs / 1e3)}s`,
58671
- ...partial2.length > 0 ? { transcript: partial2.slice(0, MAX_TRANSCRIPT_CHARS) } : {}
58768
+ summary: `turn timed out after ${seconds}s`,
58769
+ transcript: transcriptBody.slice(0, MAX_TRANSCRIPT_CHARS)
58672
58770
  });
58673
58771
  }, input.timeoutMs);
58674
58772
  child.stdout.on("data", (data) => {
@@ -58683,18 +58781,30 @@ function runModelProcess(input) {
58683
58781
  const redacted = redactForLog(rawOutput);
58684
58782
  const evidence = input.collectEvidence && code === 0 ? extractRunnerEvidence(rawOutput) : [];
58685
58783
  const planArtifact = input.collectEvidence && code === 0 ? extractForgePlanArtifact(rawOutput) : void 0;
58784
+ const transcriptSource = !input.collectEvidence && redacted.trim().startsWith("{") ? extractRunnerSummary(redacted) : redacted;
58686
58785
  finish({
58687
58786
  ok: code === 0,
58688
58787
  summary: extractRunnerSummary(redacted).slice(0, 12e3),
58689
- transcript: scrubTranscriptSessionIds(redacted).slice(0, MAX_TRANSCRIPT_CHARS),
58788
+ transcript: scrubTranscriptSessionIds(transcriptSource).slice(0, MAX_TRANSCRIPT_CHARS),
58690
58789
  ...evidence.length > 0 ? { evidence } : {},
58691
58790
  ...input.expectSessionEnvelope ? extractClaudeSessionId(rawOutput) : {},
58692
- ...planArtifact ? { planArtifact } : {}
58791
+ ...planArtifact ? { planArtifact } : {},
58792
+ // DER-1915: attempt the token-usage extraction for BOTH work_order and turn_execution
58793
+ // kinds (unlike the session id, which is scoped to expectSessionEnvelope/resume) — a
58794
+ // Forge build/review work order runs claude with the same JSON envelope and its usage
58795
+ // is just as reportable. Safe to attempt unconditionally: non-JSON/no-usage output
58796
+ // yields {}, never a fabricated zero.
58797
+ ...extractClaudeUsage(rawOutput)
58693
58798
  });
58694
58799
  });
58695
58800
  child.on("error", (error51) => {
58696
58801
  clearTimeout(timer);
58697
- finish({ ok: false, summary: `spawn error: ${redactForLog(error51.message)}` });
58802
+ const message = redactForLog(error51.message);
58803
+ finish({
58804
+ ok: false,
58805
+ summary: `spawn error: ${message}`,
58806
+ transcript: `spawn error: ${message}`.slice(0, MAX_TRANSCRIPT_CHARS)
58807
+ });
58698
58808
  });
58699
58809
  });
58700
58810
  }
@@ -58814,6 +58924,30 @@ function extractClaudeSessionId(output) {
58814
58924
  return {};
58815
58925
  }
58816
58926
  }
58927
+ function extractClaudeUsage(output) {
58928
+ const trimmed = output.trim();
58929
+ if (!trimmed.startsWith("{")) {
58930
+ return {};
58931
+ }
58932
+ try {
58933
+ const parsed = JSON.parse(trimmed);
58934
+ const usage2 = parsed.usage;
58935
+ if (!usage2 || typeof usage2 !== "object" || Array.isArray(usage2)) {
58936
+ return {};
58937
+ }
58938
+ const record2 = usage2;
58939
+ const result = {};
58940
+ if (typeof record2.input_tokens === "number" && Number.isFinite(record2.input_tokens) && record2.input_tokens >= 0) {
58941
+ result.inputTokens = Math.floor(record2.input_tokens);
58942
+ }
58943
+ if (typeof record2.output_tokens === "number" && Number.isFinite(record2.output_tokens) && record2.output_tokens >= 0) {
58944
+ result.outputTokens = Math.floor(record2.output_tokens);
58945
+ }
58946
+ return result;
58947
+ } catch {
58948
+ return {};
58949
+ }
58950
+ }
58817
58951
  function runtimeSessionKey(state, workOrder) {
58818
58952
  const seatId = extractSeatId(workOrder);
58819
58953
  const userId = extractTurnUserId(workOrder);