owlrunkit 0.18.3 → 0.19.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 (59) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +223 -52
  3. package/docs/architecture/OWLCODA_RUNKIT_0184_EXTERNAL_DELIVERY_INTAKE_PRODUCT_DECISION_20260812.md +209 -0
  4. package/docs/architecture/OWLCODA_RUNKIT_0190_CONSOLIDATED_DAILY_USE_PRODUCT_DECISION_20260812.md +97 -0
  5. package/docs/architecture/OWLCODA_RUNKIT_USAGE_MODE_SELECTION_PRODUCT_DECISION_20260811.md +8 -7
  6. package/docs/architecture/OWLCODA_RUN_KIT_CONTRACT_V0_2.md +57 -0
  7. package/integrations/codex/skills/owlcoda-runkit/SKILL.md +133 -77
  8. package/integrations/codex/skills/owlcoda-runkit/assets/templates/config.json +3 -3
  9. package/integrations/codex/skills/owlcoda-runkit/references/contract-v0.2.md +57 -0
  10. package/package.json +1 -1
  11. package/packages/attest/README.md +9 -5
  12. package/packages/attest/consumer-surface-v2.json +263 -0
  13. package/packages/attest/distribution-manifest-v1.json +14 -1
  14. package/packages/attest/schemas/quick-verification-receipt-v3.schema.json +244 -0
  15. package/packages/attest/schemas/workspace-snapshot-v2.schema.json +114 -0
  16. package/packages/attest/src/dependency-environment.mjs +128 -0
  17. package/packages/attest/src/index.mjs +1 -0
  18. package/packages/attest/src/quick-receipt-contract.mjs +205 -12
  19. package/packages/attest/src/quick.mjs +45 -4
  20. package/packages/attest/src/workspace-snapshot.mjs +143 -7
  21. package/registry-release-policy-v1.json +5 -5
  22. package/sbom.spdx.json +5 -5
  23. package/scripts/runkit-contract/assurance-router.mjs +25 -6
  24. package/scripts/runkit-contract/core-contract.mjs +29 -1
  25. package/scripts/runkit-contract/efficiency-metrics.mjs +559 -0
  26. package/scripts/runkit-contract/evidence-store.mjs +130 -0
  27. package/scripts/runkit-contract/onboarding-bootstrap.mjs +685 -0
  28. package/scripts/runkit-contract/onboarding-doctor.mjs +3 -2
  29. package/scripts/runkit-contract/outcome-presentation.mjs +171 -0
  30. package/scripts/runkit-contract/profile-onboarding.mjs +285 -17
  31. package/scripts/runkit-contract/project-cli-resolver.mjs +29 -5
  32. package/scripts/runkit-contract/project-external-delivery.mjs +707 -0
  33. package/scripts/runkit-contract/quick-evidence-reuse.mjs +590 -0
  34. package/scripts/runkit-contract/quick-isolation.mjs +314 -0
  35. package/scripts/runkit-contract/quick-metrics.mjs +51 -3
  36. package/scripts/runkit-contract/quick-receipt.mjs +31 -1
  37. package/scripts/runkit-contract/quick-verify.mjs +217 -26
  38. package/scripts/runkit-contract/quick-workspace-snapshot.mjs +1 -0
  39. package/scripts/runkit-contract/runkit-bootstrap.mjs +7 -1
  40. package/scripts/runkit-contract/runkit-cli.mjs +602 -152
  41. package/scripts/runkit-contract/runtime-transition.mjs +478 -0
  42. package/scripts/runkit-contract/schemas/assurance-route-v2.schema.json +26 -0
  43. package/scripts/runkit-contract/schemas/efficiency-event-v1.schema.json +56 -0
  44. package/scripts/runkit-contract/schemas/efficiency-metrics-v1.schema.json +220 -0
  45. package/scripts/runkit-contract/schemas/external-runtime-report-v1.schema.json +125 -0
  46. package/scripts/runkit-contract/schemas/onboarding-bootstrap-plan-v1.schema.json +168 -0
  47. package/scripts/runkit-contract/schemas/onboarding-bootstrap-receipt-v1.schema.json +130 -0
  48. package/scripts/runkit-contract/schemas/outcome-summary-v1.schema.json +83 -0
  49. package/scripts/runkit-contract/schemas/profile-detection-v3.schema.json +170 -0
  50. package/scripts/runkit-contract/schemas/quick-evidence-reuse-plan-v1.schema.json +59 -0
  51. package/scripts/runkit-contract/schemas/quick-evidence-reuse-receipt-v1.schema.json +79 -0
  52. package/scripts/runkit-contract/schemas/runtime-transition-receipt-v1.schema.json +185 -0
  53. package/scripts/runkit-contract/schemas/team-project-event-v3.schema.json +146 -0
  54. package/scripts/runkit-contract/schemas/team-project-event-v4.schema.json +142 -0
  55. package/scripts/runkit-contract/schemas/team-project-status-v2.schema.json +85 -0
  56. package/scripts/runkit-contract/schemas/usage-mode-recommendation-v2.schema.json +136 -0
  57. package/scripts/runkit-contract/team-project.mjs +1172 -22
  58. package/scripts/runkit-contract/usage-mode.mjs +28 -7
  59. package/scripts/runkit-contract/verification-envelope.mjs +15 -18
@@ -79,16 +79,26 @@ import {
79
79
  import { buildInspectSummary, formatInspectHuman } from "./inspect-presentation.mjs";
80
80
  import { attestQuickReceiptDetails } from "./quick-attest.mjs";
81
81
  import { readLocalQuickMetrics } from "./quick-metrics.mjs";
82
+ import { runQuickEvidenceReuse } from "./quick-evidence-reuse.mjs";
82
83
  import { runQuickVerification } from "./quick-verify.mjs";
84
+ import {
85
+ formatQuickOutcomeHumanV1,
86
+ projectQuickOutcomeV1,
87
+ } from "./outcome-presentation.mjs";
88
+ import {
89
+ formatEfficiencyMetricsHumanV1,
90
+ readEfficiencyMetricsV1,
91
+ recordEfficiencyEventV1,
92
+ } from "./efficiency-metrics.mjs";
93
+ import { verifyRuntimeTransitionReceipt } from "./runtime-transition.mjs";
83
94
  import { runRepairExecution } from "./repair-execution.mjs";
84
95
  import {
85
96
  exportOfflineReceipt,
86
97
  importOfflineReceipt,
87
98
  } from "./offline-store.mjs";
88
99
  import {
89
- applyDetectedProfilesV2,
90
- detectProfiles,
91
- detectProfilesV2,
100
+ applyDetectedProfilesV3,
101
+ detectProfilesV3,
92
102
  reconcileProfilesV2,
93
103
  resolveProfilesImpact,
94
104
  validateProfiles,
@@ -102,11 +112,11 @@ import {
102
112
  } from "./fleet-discovery.mjs";
103
113
  import {
104
114
  RUNKIT_RISK_CATEGORIES,
105
- routeRunKitAssuranceV1,
115
+ routeRunKitAssuranceV2,
106
116
  } from "./assurance-router.mjs";
107
117
  import {
108
- formatUsageModeHumanV1,
109
- recommendUsageModeV1,
118
+ formatUsageModeHumanV2,
119
+ recommendUsageModeV2,
110
120
  } from "./usage-mode.mjs";
111
121
  import { deriveHumanStatusFromInspectV1 } from "./human-status.mjs";
112
122
  import {
@@ -139,6 +149,11 @@ import {
139
149
  readProfileLauncherReadiness,
140
150
  runDoctor,
141
151
  } from "./onboarding-doctor.mjs";
152
+ import {
153
+ applyOnboardingBootstrapV1,
154
+ formatOnboardingBootstrapHumanV1,
155
+ planOnboardingBootstrapV1,
156
+ } from "./onboarding-bootstrap.mjs";
142
157
  import {
143
158
  formatAdoptionHuman,
144
159
  runRegistryAdoption,
@@ -147,100 +162,125 @@ import { OFFICIAL_NPM_REGISTRY } from "./registry-adoption-gate.mjs";
147
162
  import {
148
163
  appendTeamProjectEventV1,
149
164
  assignTeamProjectV1,
150
- buildTeamProjectTakeoverV1,
165
+ buildTeamProjectTakeoverV2,
151
166
  checkpointTeamProjectV1,
152
167
  closeTeamProjectVerificationV1,
153
168
  deferTeamProjectVerificationV1,
154
- formatTeamProjectStatusHumanV1,
155
- formatTeamProjectTakeoverHumanV1,
169
+ formatTeamProjectStatusHumanV2,
170
+ formatTeamProjectTakeoverHumanV2,
156
171
  handoffTeamProjectV1,
157
172
  initializeTeamProjectV1,
158
173
  integrateTeamProjectV1,
159
174
  openTeamProjectDecisionV1,
160
- readTeamProjectStatusV1,
175
+ readTeamProjectStatusV2,
161
176
  rejectAndReturnTeamProjectV1,
177
+ reopenUpstreamTeamProjectV1,
162
178
  resolveTeamProjectDecisionV1,
179
+ transferTeamProjectV1,
163
180
  } from "./team-project.mjs";
164
181
  import {
165
182
  formatTeamProjectSuccessorHumanV1,
166
183
  successorTeamProjectV1,
167
184
  } from "./team-project-successor.mjs";
185
+ import {
186
+ captureTargetWorkspaceSnapshotV1,
187
+ importExternalDeliveryV1,
188
+ } from "./project-external-delivery.mjs";
168
189
 
169
190
  const TOP_LEVEL_HELP = `OwlRunKit ${CORE_VERSION}
170
191
 
171
192
  Usage:
172
- owlrunkit <command> [options]
193
+ npx --no-install owlrunkit <command> [options]
173
194
 
174
195
  Start here:
175
- owlrunkit mode recommend --workspace .
176
- owlrunkit doctor --workspace .
177
- owlrunkit profiles detect --workspace . --dry-run
178
- owlrunkit profiles detect --workspace . --apply
179
- owlrunkit assurance route --workspace . --request <risk-facts.json>
180
- owlrunkit adopt --workspace . --exact owlrunkit@${CORE_VERSION}
196
+ npx --no-install owlrunkit bootstrap --workspace . --exact owlrunkit@${CORE_VERSION} --dry-run
197
+ npx --no-install owlrunkit mode recommend --workspace .
198
+ npx --no-install owlrunkit doctor --workspace .
199
+ npx --no-install owlrunkit profiles detect --workspace . --dry-run
200
+ npx --no-install owlrunkit adopt --workspace . --exact owlrunkit@${CORE_VERSION}
181
201
  Quick Verification
182
- owlrunkit quick-verify --workspace . -- <command> [args...]
202
+ npx --no-install owlrunkit quick-verify --workspace . -- <command> [args...]
203
+ npx --no-install owlrunkit quick-reuse --workspace . --base-receipt <receipt> --allow-path <path> --dry-run|--apply -- <delta-command>
204
+ npx --no-install owlrunkit quick-runtime-verify --workspace . --receipt <runtime-transition.json>
183
205
  Low-risk, source-bound reusable evidence without writer leases or acceptance.
184
206
 
185
207
  Formal Delivery
186
- owlrunkit formal <start|check|finish> --workspace . --run-id <id> [...]
208
+ npx --no-install owlrunkit formal <start|check|finish> --workspace . --run-id <id> [...]
187
209
  Use for multi-writer, permissions, security, funds, irreversible change,
188
210
  uncertain rollback, schema/data migration, or explicit Formal acceptance.
189
-
190
211
  Frozen dirty source
191
- owlrunkit candidate <freeze|verify|materialize> --workspace . [...]
212
+ npx --no-install owlrunkit candidate <freeze|verify|materialize> --workspace . [...]
192
213
 
193
214
  Two-stage deployment
194
- owlrunkit deployment prepare --workspace . --run-id <accepted-run> --artifact <file> --media-type <type> --owner-decision <decision-v1.json> --output <receipt>
195
- owlrunkit deployment execute --workspace . [--resume] --prepare <receipt> --owner-decision <decision-v1.json> --owner-authority <signed-v2.json> --manifest <remote.json>
215
+ npx --no-install owlrunkit deployment prepare --workspace . --run-id <accepted-run> --artifact <file> --media-type <type> --owner-decision <decision-v1.json> --output <receipt>
216
+ npx --no-install owlrunkit deployment execute --workspace . [--resume] --prepare <receipt> --owner-decision <decision-v1.json> --owner-authority <signed-v2.json> --manifest <remote.json>
196
217
 
197
218
  Fleet and status
198
- owlrunkit fleet <register-root|inspect-registry> [options]
199
- owlrunkit fleet replace-registry --request <file> --receipt <file> [--dry-run]
200
- owlrunkit fleet rollback-registry --receipt <file> --rollback-receipt <file>
201
- owlrunkit fleet discover; owlrunkit status --workspace .
219
+ npx --no-install owlrunkit fleet <register-root|inspect-registry> [options]
220
+ npx --no-install owlrunkit fleet replace-registry --request <file> --receipt <file> [--dry-run]
221
+ npx --no-install owlrunkit fleet rollback-registry --receipt <file> --rollback-receipt <file>
222
+ npx --no-install owlrunkit fleet discover; npx --no-install owlrunkit status --workspace .
202
223
 
203
224
  Agent team projects
204
- owlrunkit project <init|assign|checkpoint|handoff|reject-and-return|decision|verification|capture|status|takeover|successor> [options]
225
+ npx --no-install owlrunkit project <init|assign|checkpoint|handoff|reject-and-return|reopen-upstream|transfer|decision|verification|capture|target-snapshot|import-delivery|status|takeover|successor> [options]
205
226
  Durable Agent work, dependencies, decisions, gates, progress, and handoffs.
206
227
  Core successor
207
- owlrunkit core-successor <plan|apply|resume> --workspace . [...]
228
+ npx --no-install owlrunkit core-successor <plan|apply|resume> --workspace . [...]
208
229
 
209
230
  Other onboarding commands:
210
- owlrunkit profiles validate --workspace .; owlrunkit profiles impact --workspace . --changed <path>
211
- owlrunkit inspect --workspace . --json
231
+ npx --no-install owlrunkit profiles validate --workspace .; npx --no-install owlrunkit profiles impact --workspace . --changed <path>
232
+ npx --no-install owlrunkit inspect --workspace . --json
212
233
  Formal accepted does not grant Git or release authority; Quick cannot become Formal.
213
234
  `;
214
235
 
215
236
  const COMMAND_HELP = Object.freeze({
237
+ init: `Usage:
238
+ npx --no-install owlrunkit init --workspace <directory> [--json]
239
+
240
+ Initializes the project-owned RunKit Core and control directory. For a complete
241
+ first-time onboarding transaction, use bootstrap after installing the exact
242
+ project-local package. Initialization grants no Git, release, deployment, or
243
+ business authority.
244
+ `,
245
+ bootstrap: `Usage:
246
+ npx --no-install owlrunkit bootstrap --workspace <directory>
247
+ --exact owlrunkit@${CORE_VERSION} (--dry-run | --apply)
248
+ [--skill-root <installed-skill-directory>] [--json]
249
+
250
+ Preflights or atomically completes Core initialization, profile reconciliation,
251
+ validation, exact registry adoption, and doctor readback. Failed apply restores
252
+ the governed preimage and retains a failure receipt. Shared Skill drift is
253
+ diagnosed only; bootstrap never silently refreshes user or fleet Skills and
254
+ grants no Git, release, deployment, production, or business authority.
255
+ `,
216
256
  adopt: `Usage:
217
- owlrunkit adopt --workspace <directory> --exact owlrunkit@${CORE_VERSION}
257
+ npx --no-install owlrunkit adopt --workspace <directory> --exact owlrunkit@${CORE_VERSION}
218
258
  [--registry <url>] [--timeout-ms <milliseconds>] [--json]
219
259
 
220
260
  Verifies the exact registry release against the project-local install and writes
221
261
  project-owned adoption evidence. It grants no Git or release authority.
222
262
  `,
223
263
  assurance: `Usage:
224
- owlrunkit assurance route --workspace <directory> --request <risk-facts.json>
264
+ npx --no-install owlrunkit assurance route --workspace <directory> --request <risk-facts.json>
225
265
 
226
266
  Selects none, Quick, or Formal from structured risk facts. It does not grant
227
267
  repository, release, deployment, or destructive authority.
228
268
  `,
229
269
  "assurance route": `Usage:
230
- owlrunkit assurance route --workspace <directory> --request <risk-facts.json>
270
+ npx --no-install owlrunkit assurance route --workspace <directory> --request <risk-facts.json>
231
271
 
232
272
  Required:
233
273
  --request <file> Structured assurance risk facts.
234
274
  `,
235
275
  mode: `Usage:
236
- owlrunkit mode recommend --workspace <directory> [risk facts]
237
- owlrunkit mode status --workspace <directory> [--json]
276
+ npx --no-install owlrunkit mode recommend --workspace <directory> [risk facts]
277
+ npx --no-install owlrunkit mode status --workspace <directory> [--json]
238
278
 
239
279
  Selects continuity and assurance independently. Recommendation and status are
240
280
  read-only and grant no Git, release, deployment, production, or business authority.
241
281
  `,
242
282
  "mode recommend": `Usage:
243
- owlrunkit mode recommend --workspace <directory>
283
+ npx --no-install owlrunkit mode recommend --workspace <directory>
244
284
  [--requested-mode auto|off|light|managed|formal]
245
285
  [--needs-evidence] [--exact-command-count <count>] [--writer-count <count>]
246
286
  [--cross-session] [--long-running] [--interruption-recovery]
@@ -254,207 +294,274 @@ Returns one user mode plus the independent continuity and assurance selections.
254
294
  Persisted mode preferences are not part of this release.
255
295
  `,
256
296
  "mode status": `Usage:
257
- owlrunkit mode status --workspace <directory> [--json]
297
+ npx --no-install owlrunkit mode status --workspace <directory> [--json]
258
298
 
259
299
  Reads the current mode preference source without creating project state.
260
300
  `,
261
301
  "quick-attest": `Usage:
262
- owlrunkit quick-attest --workspace <directory> --receipt <receipt.json> [--json]
302
+ npx --no-install owlrunkit quick-attest --workspace <directory> --receipt <receipt.json> [--json]
263
303
 
264
304
  Attests one Quick Receipt against its bound materials and current workspace.
265
305
  It never grants repository or business authority.
266
306
  `,
267
307
  "quick-verify": `Usage:
268
- owlrunkit quick-verify --workspace <directory> [--stdin-file <file>] [--attest] [--json]
308
+ npx --no-install owlrunkit quick-verify --workspace <directory>
309
+ [--isolate] [--dependency-root <directory>] [--bind-ignored <relative-path> ...]
310
+ [--stdin-file <file>] [--capture-runtime] [--attest] [--json]
269
311
  -- <executable> [args...]
270
312
 
271
313
  Runs one exact command, saves source-bound stdout/stderr and a Quick receipt,
272
314
  and returns a bounded head/tail output summary. --stdin-file copies and hash-binds
273
315
  up to 1 MiB of exact stdin bytes in the receipt store. --attest immediately
274
316
  attests the saved receipt without merging Quick and attestation semantics.
317
+ --isolate runs a Git-visible source copy in a disposable cache environment.
318
+ --dependency-root binds and projects an existing dependency environment without
319
+ installing anything. Ignored workspace bytes are bound only by explicit,
320
+ repeatable --bind-ignored literal paths.
321
+ --capture-runtime sets OWLRUNKIT_RUNTIME_REPORT for the exact command and binds
322
+ one strict command-reported external transition without conflating it with
323
+ workspace mutation. Missing or inconsistent runtime truth fails closed while
324
+ retaining the ordinary Quick receipt.
275
325
  Quick evidence is not Formal acceptance and grants no repository or business authority.
326
+ `,
327
+ "quick-runtime-verify": `Usage:
328
+ npx --no-install owlrunkit quick-runtime-verify --workspace <directory>
329
+ --receipt <runtime-transition.json> [--json]
330
+
331
+ Verifies the companion runtime-transition receipt, Quick receipt, command report,
332
+ and bound material bytes. It does not independently re-observe the external
333
+ runtime and grants no Git, release, deployment, production, or business authority.
276
334
  `,
277
335
  "quick-metrics": `Usage:
278
- owlrunkit quick-metrics --workspace <directory> --local [--verbose] [--json]
336
+ npx --no-install owlrunkit quick-metrics --workspace <directory> [--local] [--verbose] [--json]
279
337
 
280
338
  Returns aggregate local-only Quick counts with no telemetry or network access.
281
339
  --verbose additionally lists the receipt paths used for the aggregation.
340
+ `,
341
+ efficiency: `Usage:
342
+ npx --no-install owlrunkit efficiency status --workspace <directory> [--verbose] [--json]
343
+ npx --no-install owlrunkit efficiency record --workspace <directory>
344
+ --event-id <id> --at <ISO-UTC>
345
+ --kind workflow_started|false_block_confirmed|manual_intervention|acceptable_result_reached
346
+ --workflow-id <id> --summary <text> [--evidence <ref>...] [--json]
347
+
348
+ Reads project-local evidence only. False blocks and manual interventions are
349
+ counted only when explicitly recorded; receipt counts are not a value metric.
350
+ It grants no Git, release, deployment, production, or business authorization.
351
+ `,
352
+ "efficiency record": `Usage:
353
+ npx --no-install owlrunkit efficiency record --workspace <directory>
354
+ --event-id <id> --at <ISO-UTC>
355
+ --kind workflow_started|false_block_confirmed|manual_intervention|acceptable_result_reached
356
+ --workflow-id <id> --summary <text> [--evidence <ref>...] [--json]
357
+
358
+ Creates one immutable, project-local observation. Recording friction grants no
359
+ Git, release, deployment, production, or business authorization.
360
+ `,
361
+ "efficiency status": `Usage:
362
+ npx --no-install owlrunkit efficiency status --workspace <directory> [--verbose] [--json]
363
+
364
+ Reports local evidence about RunKit friction without telemetry or network use.
365
+ It grants no Git, release, deployment, production, or business authorization.
366
+ `,
367
+ "quick-reuse": `Usage:
368
+ npx --no-install owlrunkit quick-reuse --workspace <directory>
369
+ --base-receipt <receipt.json> --allow-path <literal-path> [--allow-path <literal-path> ...]
370
+ (--dry-run | --apply) [--stdin-file <file>] [--json]
371
+ -- <exact-delta-command> [args...]
372
+
373
+ Verifies that every current candidate delta is explicitly allowed. --dry-run
374
+ runs no command and writes no receipt. --apply runs only the exact delta gate
375
+ through Quick and records an additive evidence-reuse receipt. Reuse remains
376
+ non-Formal and grants no Git, release, deployment, production, or business authority.
282
377
  `,
283
378
  fleet: `Usage:
284
- owlrunkit fleet register-root --fleet-root <directory>
285
- owlrunkit fleet inspect-registry [--registry <file>]
286
- owlrunkit fleet replace-registry --request <file> --receipt <file> [--registry <file>] [--dry-run]
287
- owlrunkit fleet rollback-registry --receipt <file> --rollback-receipt <file> [--registry <file>]
288
- owlrunkit fleet discover [--fleet-root <directory>] [--fleet-manifest <file>]
379
+ npx --no-install owlrunkit fleet register-root --fleet-root <directory>
380
+ npx --no-install owlrunkit fleet inspect-registry [--registry <file>]
381
+ npx --no-install owlrunkit fleet replace-registry --request <file> --receipt <file> [--registry <file>] [--dry-run]
382
+ npx --no-install owlrunkit fleet rollback-registry --receipt <file> --rollback-receipt <file> [--registry <file>]
383
+ npx --no-install owlrunkit fleet discover [--fleet-root <directory>] [--fleet-manifest <file>]
289
384
  `,
290
385
  "fleet register-root": `Usage:
291
- owlrunkit fleet register-root --fleet-root <directory>
386
+ npx --no-install owlrunkit fleet register-root --fleet-root <directory>
292
387
 
293
388
  Registers one durable fleet coverage root for later no-argument discovery.
294
389
  `,
295
390
  "fleet inspect-registry": `Usage:
296
- owlrunkit fleet inspect-registry [--registry <file>]
391
+ npx --no-install owlrunkit fleet inspect-registry [--registry <file>]
297
392
 
298
393
  Reads the exact registry bytes, hashes, roots, and membership without mutation.
299
394
  `,
300
395
  "fleet replace-registry": `Usage:
301
- owlrunkit fleet replace-registry --request <file> --receipt <file>
396
+ npx --no-install owlrunkit fleet replace-registry --request <file> --receipt <file>
302
397
  [--registry <file>] [--dry-run]
303
398
 
304
399
  Atomically replaces a registry from an exact preimage and evidence-bound fleet
305
400
  membership. Coverage reduction requires explicit exclusion evidence.
306
401
  `,
307
402
  "fleet rollback-registry": `Usage:
308
- owlrunkit fleet rollback-registry --receipt <replacement-receipt.json>
403
+ npx --no-install owlrunkit fleet rollback-registry --receipt <replacement-receipt.json>
309
404
  --rollback-receipt <file> [--registry <file>]
310
405
 
311
406
  Restores the exact preimage recorded by a replacement receipt.
312
407
  `,
313
408
  "fleet discover": `Usage:
314
- owlrunkit fleet discover [--fleet-root <directory>] [--fleet-manifest <file>]
409
+ npx --no-install owlrunkit fleet discover [--fleet-root <directory>] [--fleet-manifest <file>]
315
410
  [--workspace-root <directory>]
316
411
 
317
412
  With no source option, discovers the complete fleet inside registered roots.
318
413
  `,
319
414
  profiles: `Usage:
320
- owlrunkit profiles detect --workspace <directory> [--dry-run | --apply]
321
- owlrunkit profiles reconcile --workspace <directory> (--dry-run | --apply)
322
- owlrunkit profiles validate --workspace <directory>
323
- owlrunkit profiles impact --workspace <directory> --changed <path>
415
+ npx --no-install owlrunkit profiles detect --workspace <directory> [--dry-run | --apply]
416
+ npx --no-install owlrunkit profiles reconcile --workspace <directory> (--dry-run | --apply)
417
+ npx --no-install owlrunkit profiles validate --workspace <directory>
418
+ npx --no-install owlrunkit profiles impact --workspace <directory> --changed <path>
324
419
  `,
325
420
  "profiles detect": `Usage:
326
- owlrunkit profiles detect --workspace <directory> [--dry-run | --apply]
421
+ npx --no-install owlrunkit profiles detect --workspace <directory> [--dry-run | --apply]
327
422
 
328
423
  --dry-run reports deterministic candidates. --apply atomically adopts only a
329
424
  high-confidence unambiguous profile.
330
425
  `,
331
426
  "profiles reconcile": `Usage:
332
- owlrunkit profiles reconcile --workspace <directory> (--dry-run | --apply)
427
+ npx --no-install owlrunkit profiles reconcile --workspace <directory> (--dry-run | --apply)
333
428
 
334
429
  --dry-run previews deterministic additions and command updates without writing.
335
430
  --apply atomically updates profiles.json and writes a hash-bound migration receipt.
336
431
  `,
337
432
  formal: `Usage:
338
- owlrunkit formal start --workspace <directory> --run-id <id> [...]
339
- owlrunkit formal check --workspace <directory> --run-id <id> -- <command>
340
- owlrunkit formal finish --workspace <directory> --run-id <id>
433
+ npx --no-install owlrunkit formal start --workspace <directory> --run-id <id> [...]
434
+ npx --no-install owlrunkit formal check --workspace <directory> --run-id <id> -- <command>
435
+ npx --no-install owlrunkit formal finish --workspace <directory> --run-id <id>
341
436
  `,
342
437
  "formal start": `Usage:
343
- owlrunkit formal start --workspace <directory> --run-id <id>
438
+ npx --no-install owlrunkit formal start --workspace <directory> --run-id <id>
344
439
  --goal <goal.json> --work-item <id> --owned-path <path>
345
440
 
346
441
  Creates the execution and exact writer lease.
347
442
  `,
348
443
  "formal check": `Usage:
349
- owlrunkit formal check --workspace <directory> --run-id <id>
444
+ npx --no-install owlrunkit formal check --workspace <directory> --run-id <id>
350
445
  --work-item <id> --check-id <id> --envelope <verification-envelope.json>
351
- owlrunkit formal check --workspace <directory> --run-id <id>
446
+ npx --no-install owlrunkit formal check --workspace <directory> --run-id <id>
352
447
  --work-item <id> --check-id <id> --cwd <directory> -- <built-in-command> [args...]
353
448
 
354
449
  Verification Envelopes admit real project commands only when file, network,
355
450
  process, environment, output, timeout, and cleanup constraints are enforced.
356
451
  `,
357
452
  "formal finish": `Usage:
358
- owlrunkit formal finish --workspace <directory> --run-id <id>
453
+ npx --no-install owlrunkit formal finish --workspace <directory> --run-id <id>
359
454
 
360
455
  Runs the final source, evidence, permission, closeout, and lease-release path.
361
456
  `,
362
457
  candidate: `Usage:
363
- owlrunkit candidate freeze --workspace <directory> --run-id <id>
458
+ npx --no-install owlrunkit candidate freeze --workspace <directory> --run-id <id>
364
459
  --from-lease <id> --candidate-id <id>
365
- owlrunkit candidate verify --workspace <directory> --candidate <file>
366
- owlrunkit candidate materialize --workspace <directory> --candidate <file>
460
+ npx --no-install owlrunkit candidate verify --workspace <directory> --candidate <file>
461
+ npx --no-install owlrunkit candidate materialize --workspace <directory> --candidate <file>
367
462
  --target-workspace <directory>
368
463
  `,
369
464
  "candidate freeze": `Usage:
370
- owlrunkit candidate freeze --workspace <directory> --run-id <id>
465
+ npx --no-install owlrunkit candidate freeze --workspace <directory> --run-id <id>
371
466
  --from-lease <id> --candidate-id <id>
372
467
 
373
468
  Freezes the exact dirty source manifest, including deletions and renames.
374
469
  `,
375
470
  "candidate verify": `Usage:
376
- owlrunkit candidate verify --workspace <directory> --candidate <file>
471
+ npx --no-install owlrunkit candidate verify --workspace <directory> --candidate <file>
377
472
  `,
378
473
  "candidate materialize": `Usage:
379
- owlrunkit candidate materialize --workspace <directory> --candidate <file>
474
+ npx --no-install owlrunkit candidate materialize --workspace <directory> --candidate <file>
380
475
  --target-workspace <directory>
381
476
  `,
382
477
  deployment: `Usage:
383
- owlrunkit deployment prepare --workspace <directory> --run-id <accepted-run>
478
+ npx --no-install owlrunkit deployment prepare --workspace <directory> --run-id <accepted-run>
384
479
  --artifact <file> --media-type <type> --owner-decision <decision-v1.json> --output <receipt>
385
- owlrunkit deployment execute --workspace <directory> --prepare <receipt>
480
+ npx --no-install owlrunkit deployment execute --workspace <directory> --prepare <receipt>
386
481
  --owner-decision <decision-v1.json> --owner-authority <signed-v2.json> --manifest <remote.json> [--resume]
387
482
  `,
388
483
  "deployment prepare": `Usage:
389
- owlrunkit deployment prepare --workspace <directory> --run-id <accepted-run>
484
+ npx --no-install owlrunkit deployment prepare --workspace <directory> --run-id <accepted-run>
390
485
  --artifact <file> --media-type <type> --owner-decision <decision-v1.json> --output <receipt>
391
486
  `,
392
487
  "deployment execute": `Usage:
393
- owlrunkit deployment execute --workspace <directory> --prepare <receipt>
488
+ npx --no-install owlrunkit deployment execute --workspace <directory> --prepare <receipt>
394
489
  --owner-decision <decision-v1.json> --owner-authority <signed-v2.json> --manifest <remote.json> [--resume]
395
490
 
396
491
  The default happy path creates and closes the deployment child, goal, lease,
397
492
  profile, preflight, lineage, and result. --request is an advanced legacy path.
398
493
  `,
399
494
  "core-successor": `Usage:
400
- owlrunkit core-successor plan --workspace <directory> --plan-id <id> [...]
401
- owlrunkit core-successor apply --workspace <directory> --plan <file>
495
+ npx --no-install owlrunkit core-successor plan --workspace <directory> --plan-id <id> [...]
496
+ npx --no-install owlrunkit core-successor apply --workspace <directory> --plan <file>
402
497
  --owner-authority <signed-v2.json> --receipt-id <id>
403
- owlrunkit core-successor resume --workspace <directory> --plan <file>
498
+ npx --no-install owlrunkit core-successor resume --workspace <directory> --plan <file>
404
499
  --owner-authority <signed-v2.json> [...]
405
500
  `,
406
501
  "core-successor plan": `Usage:
407
- owlrunkit core-successor plan --workspace <directory> --plan-id <id>
502
+ npx --no-install owlrunkit core-successor plan --workspace <directory> --plan-id <id>
408
503
  --run-id <id> --from-lease <id> --candidate-id <id>
409
504
  [--fleet-root <directory> | --fleet-manifest <file>]
410
505
  `,
411
506
  "core-successor apply": `Usage:
412
- owlrunkit core-successor apply --workspace <directory> --plan <file>
507
+ npx --no-install owlrunkit core-successor apply --workspace <directory> --plan <file>
413
508
  --owner-authority <signed-v2.json> --receipt-id <id>
414
509
  `,
415
510
  "core-successor resume": `Usage:
416
- owlrunkit core-successor resume --workspace <directory> --plan <file>
511
+ npx --no-install owlrunkit core-successor resume --workspace <directory> --plan <file>
417
512
  --owner-authority <signed-v2.json> [--from-receipt <file>]
418
513
  `,
419
514
  status: `Usage:
420
- owlrunkit status --workspace <directory> [--json]
515
+ npx --no-install owlrunkit status --workspace <directory> [--json]
421
516
 
422
517
  Shows completed milestones, current state, remaining gates, and the next allowed
423
518
  action without granting any authority.
424
519
  `,
425
520
  project: `Usage:
426
- owlrunkit project init --workspace <directory> --definition <project.json>
427
- owlrunkit project assign --workspace <directory> --assignment-id <id> --at <ISO-UTC> --work-item <id> --agent <id>
521
+ npx --no-install owlrunkit project init --workspace <directory> --definition <project.json>
522
+ npx --no-install owlrunkit project assign --workspace <directory> --assignment-id <id> --at <ISO-UTC> --work-item <id> --agent <id>
428
523
  [--supersedes <current-assignment-id>] [--execution-run-id <id> --execution-work-item <id>] [--json]
429
- owlrunkit project handoff --workspace <directory> --handoff-id <id> --at <ISO-UTC>
524
+ npx --no-install owlrunkit project handoff --workspace <directory> --handoff-id <id> --at <ISO-UTC>
430
525
  --assignment-id <current> --work-item <id> --from-agent <id> --to-agent <id>
431
526
  --summary <text> --next <text> --evidence <ref> [--evidence <ref> ...] [--json]
432
- owlrunkit project reject-and-return --workspace <directory> --rework-id <id> --at <ISO-UTC>
527
+ npx --no-install owlrunkit project reject-and-return --workspace <directory> --rework-id <id> --at <ISO-UTC>
433
528
  --work-item <failed-id> --reviewer-agent <id> --to-agent <id>
434
529
  --reason <text> --next <text> --evidence <ref> [--evidence <ref> ...] [--json]
435
- owlrunkit project decision --workspace <directory> --open --decision-id <id> --at <ISO-UTC>
530
+ npx --no-install owlrunkit project reopen-upstream --workspace <directory> --reopen-id <id> --at <ISO-UTC>
531
+ --upstream-work-item <completed-id> --trigger-work-item <downstream-id>
532
+ --reviewer-agent <id> --to-agent <id> --reason <text> --next <text>
533
+ --evidence <ref> [--evidence <ref> ...] [--json]
534
+ npx --no-install owlrunkit project transfer --workspace <directory> --transfer-id <id> --at <ISO-UTC>
535
+ --assignment-id <current> --work-item <id> --from-agent <id> --to-agent <id>
536
+ --state <active|waiting_dependency|waiting_decision|verifying|ready_to_integrate>
537
+ --summary <text> [--completed-units <nonnegative-int>]
538
+ --evidence <ref> [--evidence <ref> ...] [--blocker <ref> ...]
539
+ [--decision <id> ...] --next <text> [--source-fingerprint <sha256>] [--json]
540
+ npx --no-install owlrunkit project decision --workspace <directory> --open --decision-id <id> --at <ISO-UTC>
436
541
  --title <text> --question <text> --owner-agent <id>
437
542
  [--blocking-work-item <id> ...] --option <text> [--option <text> ...] [--json]
438
- owlrunkit project decision --workspace <directory> --resolve --decision-id <id> --at <ISO-UTC>
543
+ npx --no-install owlrunkit project decision --workspace <directory> --resolve --decision-id <id> --at <ISO-UTC>
439
544
  --resolution <text> --rationale <text> --evidence <ref> [--evidence <ref> ...] [--json]
440
- owlrunkit project checkpoint --workspace <directory> --checkpoint-id <id> --at <ISO-UTC>
545
+ npx --no-install owlrunkit project checkpoint --workspace <directory> --checkpoint-id <id> --at <ISO-UTC>
441
546
  --assignment-id <current> --work-item <id>
442
547
  --state <active|waiting_dependency|waiting_decision|verifying|ready_to_integrate|completed|failed>
443
548
  --summary <text> [--completed-units <nonnegative-int>]
444
549
  [--evidence <ref> ...] [--blocker <ref> ...] [--decision <id> ...]
445
550
  [--next <text>] [--source-fingerprint <sha256>] [--json]
446
- owlrunkit project verification --workspace <directory> --defer --verification-id <id> --at <ISO-UTC>
551
+ npx --no-install owlrunkit project verification --workspace <directory> --defer --verification-id <id> --at <ISO-UTC>
447
552
  --work-item <id> --owner-agent <id> --check <check-id> [--check <check-id> ...]
448
553
  --reason <text> --due-gate <gate-id> [--json]
449
- owlrunkit project verification --workspace <directory> --close --verification-id <id> --at <ISO-UTC>
554
+ npx --no-install owlrunkit project verification --workspace <directory> --close --verification-id <id> --at <ISO-UTC>
450
555
  --disposition <verified|no_longer_required> --summary <text>
451
556
  [--evidence <ref> ...] [--decision <resolved-decision-id> ...] [--json]
452
- owlrunkit project integrate --workspace <directory> --gate <gate-id> --at <ISO-UTC>
557
+ npx --no-install owlrunkit project integrate --workspace <directory> --gate <gate-id> --at <ISO-UTC>
453
558
  --summary <text> --evidence <ref> [--evidence <ref> ...] [--json]
454
- owlrunkit project <checkpoint|handoff|decision|verification|integrate|capture> --workspace <directory> --request <event.json>
455
- owlrunkit project status --workspace <directory> [--json]
456
- owlrunkit project takeover --workspace <directory> --agent <id> [--json]
457
- owlrunkit project successor --workspace <directory> --transition-id <id> --at <ISO-UTC>
559
+ npx --no-install owlrunkit project <checkpoint|handoff|decision|verification|integrate|capture> --workspace <directory> --request <event.json>
560
+ npx --no-install owlrunkit project target-snapshot --workspace <controller> --snapshot-id <id> --at <ISO-UTC> --work-item <id> --target-workspace <frozen-worktree> --dry-run|--apply
561
+ npx --no-install owlrunkit project import-delivery --workspace <controller> --delivery-id <id> --at <ISO-UTC> --assignment-id <current> --work-item <id> --producer <id> --target-workspace <frozen-worktree> --packet <delivery-packet.json> --dry-run|--apply
562
+ npx --no-install owlrunkit project status --workspace <directory> [--json]
563
+ npx --no-install owlrunkit project takeover --workspace <directory> --agent <id> [--json]
564
+ npx --no-install owlrunkit project successor --workspace <directory> --transition-id <id> --at <ISO-UTC>
458
565
  --definition <project.json> --reason <text> [--json]
459
566
 
460
567
  Project status is derived from durable work items, Agent assignments,
@@ -462,7 +569,7 @@ dependencies, decisions, checkpoints, integration gates, and evidence refs.
462
569
  No self-reported percentage is accepted.
463
570
  `,
464
571
  "project checkpoint": `Usage:
465
- owlrunkit project checkpoint --workspace <directory> --checkpoint-id <id> --at <ISO-UTC>
572
+ npx --no-install owlrunkit project checkpoint --workspace <directory> --checkpoint-id <id> --at <ISO-UTC>
466
573
  --assignment-id <current> --work-item <id>
467
574
  --state <active|waiting_dependency|waiting_decision|verifying|ready_to_integrate|completed|failed>
468
575
  --summary <text> [--completed-units <nonnegative-int>]
@@ -471,27 +578,83 @@ No self-reported percentage is accepted.
471
578
 
472
579
  Measured WorkItems require --completed-units on every checkpoint. A completed
473
580
  checkpoint must use the WorkItem's declared total. Example:
474
- owlrunkit project checkpoint --workspace . --checkpoint-id checkpoint-x --at 2026-08-11T00:00:00.000Z --assignment-id assign-x --work-item x --state completed --summary 'Completed x.' --completed-units 5 --evidence receipt:quick
581
+ npx --no-install owlrunkit project checkpoint --workspace . --checkpoint-id checkpoint-x --at 2026-08-11T00:00:00.000Z --assignment-id assign-x --work-item x --state completed --summary 'Completed x.' --completed-units 5 --evidence receipt:quick
582
+ `,
583
+ "project assign": `Usage:
584
+ npx --no-install owlrunkit project assign --workspace <directory>
585
+ --assignment-id <id> --at <ISO-UTC> --work-item <id> --agent <id>
586
+ [--supersedes <current-assignment-id>]
587
+ [--execution-run-id <id> --execution-work-item <id>] [--json]
588
+
589
+ Assigns one current WorkItem owner without granting Git, release, deployment,
590
+ production, business, or other authorization.
475
591
  `,
476
592
  "project reject-and-return": `Usage:
477
- owlrunkit project reject-and-return --workspace <directory> --rework-id <id> --at <ISO-UTC>
593
+ npx --no-install owlrunkit project reject-and-return --workspace <directory> --rework-id <id> --at <ISO-UTC>
478
594
  --work-item <failed-id> --reviewer-agent <id> --to-agent <id>
479
595
  --reason <text> --next <text> --evidence <ref> [--evidence <ref> ...] [--json]
480
596
 
481
597
  Atomically records the rejection and opens a new assigned rework attempt. The
482
598
  failed attempt remains immutable and evidence-linked. This action does not
483
- grant Git, release, deployment, production, or business authority.
599
+ grant Git, release, deployment, production, or business authority.
600
+ `,
601
+ "project reopen-upstream": `Usage:
602
+ npx --no-install owlrunkit project reopen-upstream --workspace <directory>
603
+ --reopen-id <id> --at <ISO-UTC> --upstream-work-item <completed-id>
604
+ --trigger-work-item <transitive-downstream-id> --reviewer-agent <id>
605
+ --to-agent <id> --reason <text> --next <text>
606
+ --evidence <ref> [--evidence <ref> ...] [--json]
607
+
608
+ Invalidates stale completion truth for the upstream WorkItem and every transitive
609
+ downstream WorkItem, then creates a new upstream assignment. Passed integration
610
+ gates remain immutable. No Git, release, deployment, production, or business
611
+ authority is granted.
612
+ `,
613
+ "project transfer": `Usage:
614
+ npx --no-install owlrunkit project transfer --workspace <directory>
615
+ --transfer-id <id> --at <ISO-UTC> --assignment-id <current>
616
+ --work-item <id> --from-agent <id> --to-agent <id>
617
+ --state <active|waiting_dependency|waiting_decision|verifying|ready_to_integrate>
618
+ --summary <text> [--completed-units <nonnegative-int>]
619
+ --evidence <ref> [--evidence <ref> ...] [--blocker <ref> ...]
620
+ [--decision <id> ...] --next <text> [--source-fingerprint <sha256>] [--json]
621
+
622
+ Atomically records checkpoint, handoff, and successor-assignment facts inside one
623
+ immutable Event V4 envelope. Terminal WorkItems cannot transfer. No Git, release,
624
+ deployment, production, or business authority is granted.
625
+ `,
626
+ "project target-snapshot": `Usage:
627
+ npx --no-install owlrunkit project target-snapshot --workspace <controller>
628
+ --snapshot-id <id> --at <ISO-UTC> --work-item <id>
629
+ --target-workspace <frozen-worktree> [--allowed-path <path> ...]
630
+ --dry-run|--apply [--json]
631
+
632
+ Captures target HEAD and the visible dirty overlay into the controller project.
633
+ It does not write the target worktree or grant Git, release, deployment,
634
+ production, business, or other authorization.
635
+ `,
636
+ "project import-delivery": `Usage:
637
+ npx --no-install owlrunkit project import-delivery --workspace <controller>
638
+ --delivery-id <id> --at <ISO-UTC> --assignment-id <current>
639
+ --work-item <id> --producer <id> --target-workspace <frozen-worktree>
640
+ --packet <delivery-packet.json> [--entry-snapshot <id>]
641
+ --dry-run|--apply [--json]
642
+
643
+ Verifies the external DeliveryPacket against the read-only target and records
644
+ candidate identity in Project Driver only with --apply. Without an entry
645
+ snapshot it reports candidate_only and does not claim entry-to-candidate proof.
646
+ No Git, release, deployment, production, business, or other authorization is granted.
484
647
  `,
485
648
  "project status": `Usage:
486
- owlrunkit project status --workspace <directory> [--json]
649
+ npx --no-install owlrunkit project status --workspace <directory> [--json]
487
650
  `,
488
651
  "project takeover": `Usage:
489
- owlrunkit project takeover --workspace <directory> --agent <id> [--json]
652
+ npx --no-install owlrunkit project takeover --workspace <directory> --agent <id> [--json]
490
653
 
491
654
  Builds a read-only blank-session recovery packet for one Agent.
492
655
  `,
493
656
  "project successor": `Usage:
494
- owlrunkit project successor --workspace <directory> --transition-id <id> --at <ISO-UTC>
657
+ npx --no-install owlrunkit project successor --workspace <directory> --transition-id <id> --at <ISO-UTC>
495
658
  --definition <project.json> --reason <text> [--json]
496
659
 
497
660
  Archives one derived-completed active project and installs one fresh active
@@ -509,6 +672,17 @@ function withHumanOutput(result, humanOutput) {
509
672
  return result;
510
673
  }
511
674
 
675
+ function presentQuickOutcome(result, json) {
676
+ const presented = {
677
+ ...result,
678
+ outcome: projectQuickOutcomeV1(result),
679
+ authorizationGranted: false,
680
+ };
681
+ return json === true
682
+ ? presented
683
+ : withHumanOutput(presented, formatQuickOutcomeHumanV1(presented.outcome));
684
+ }
685
+
512
686
  function shellCommandToken(value) {
513
687
  const text = String(value);
514
688
  return /^[A-Za-z0-9_@%+=:,./-]+$/u.test(text)
@@ -525,7 +699,7 @@ function correctedCheckpointCommand(argv, completedUnits) {
525
699
  "--completed-units",
526
700
  String(completedUnits),
527
701
  );
528
- return `owlrunkit ${corrected.map(shellCommandToken).join(" ")}`;
702
+ return `npx --no-install owlrunkit ${corrected.map(shellCommandToken).join(" ")}`;
529
703
  }
530
704
 
531
705
  function formatTeamProjectAssignmentHuman(result) {
@@ -572,6 +746,64 @@ function formatTeamProjectReworkHuman(result) {
572
746
  ].join("\n");
573
747
  }
574
748
 
749
+ function formatTeamProjectUpstreamReopenHuman(result) {
750
+ const disposition = result.resumed ? "Resumed" : "Reopened";
751
+ return [
752
+ `${disposition} upstream WorkItem ${result.upstreamWorkItemId} for Agent ${result.toAgentId}.`,
753
+ `Invalidated completion: ${result.invalidatedWorkItemIds.join(", ")}`,
754
+ `Project next: ${result.nextAction ?? "none"}${result.nextActorId ? ` (owner ${result.nextActorId})` : ""}`,
755
+ "Git/release/deployment/business authority: not granted.",
756
+ "",
757
+ ].join("\n");
758
+ }
759
+
760
+ function formatTeamProjectTransferHuman(result) {
761
+ const disposition = result.resumed ? "Resumed" : "Transferred";
762
+ return [
763
+ `${disposition} WorkItem ${result.workItemId} from Agent ${result.fromAgentId} to Agent ${result.toAgentId}.`,
764
+ `New assignment: ${result.assignmentId}; immutable facts: ${result.factRefs.length}`,
765
+ `Project next: ${result.nextAction ?? "none"}${result.nextActorId ? ` (owner ${result.nextActorId})` : ""}`,
766
+ "Git/release/deployment/business authority: not granted.",
767
+ "",
768
+ ].join("\n");
769
+ }
770
+
771
+ function formatTargetSnapshotHuman(result) {
772
+ return [
773
+ result.persisted
774
+ ? `Captured target snapshot ${result.snapshotId}.`
775
+ : `Previewed target snapshot ${result.snapshotId}; nothing persisted.`,
776
+ `Target: ${result.targetWorkspaceRef}`,
777
+ `HEAD: ${result.targetHead}`,
778
+ `Allowed paths: ${result.allowedPaths.join(", ")}`,
779
+ "Target write: no; authorization granted: no.",
780
+ "",
781
+ ].join("\n");
782
+ }
783
+
784
+ function formatExternalDeliveryHuman(result) {
785
+ if (result.status === "external_delivery_rejected") {
786
+ return [
787
+ `Rejected external delivery ${result.deliveryId}.`,
788
+ `Out-of-scope source: ${result.overlay?.outOfScopeSourcePaths?.join(", ") || "none"}`,
789
+ "Nothing was added to Project Driver; authorization granted: no.",
790
+ "",
791
+ ].join("\n");
792
+ }
793
+ return [
794
+ result.persisted
795
+ ? `Imported external delivery ${result.deliveryId}.`
796
+ : `Previewed external delivery ${result.deliveryId}; nothing persisted.`,
797
+ `Candidate: ${result.deliveryCandidateFingerprint}`,
798
+ `Overlay: ${result.overlay.status}`,
799
+ `Tool cache changes: ${result.overlay.toolCachePaths.join(", ") || "none"}`,
800
+ `Dependency environment changes: ${result.overlay.dependencyEnvironmentPaths.join(", ") || "none"}`,
801
+ `Not proven: ${result.notProven.join(" ")}`,
802
+ "Target write: no; authorization granted: no.",
803
+ "",
804
+ ].join("\n");
805
+ }
806
+
575
807
  function formatTeamProjectDecisionHuman(result) {
576
808
  const disposition = result.resumed
577
809
  ? "Resumed"
@@ -669,18 +901,18 @@ function onboardingProjection(root, recovery = null) {
669
901
  const steps = [
670
902
  {
671
903
  id: "doctor",
672
- command: "owlrunkit doctor --workspace .",
904
+ command: "npx --no-install owlrunkit doctor --workspace .",
673
905
  },
674
906
  ...(!profilesReady
675
907
  ? [{
676
908
  id: "profiles_detect",
677
- command: "owlrunkit profiles detect --workspace . --dry-run",
909
+ command: "npx --no-install owlrunkit profiles detect --workspace . --dry-run",
678
910
  }]
679
911
  : []),
680
912
  ...(!adoptionReady
681
913
  ? [{
682
914
  id: "adopt_or_start",
683
- command: `owlrunkit adopt --workspace . --exact owlrunkit@${CORE_VERSION} or owlrunkit start`,
915
+ command: `npx --no-install owlrunkit adopt --workspace . --exact owlrunkit@${CORE_VERSION} or npx --no-install owlrunkit start`,
684
916
  }]
685
917
  : []),
686
918
  ];
@@ -1378,9 +1610,9 @@ async function initialize(options) {
1378
1610
  `Initialized OwlRunKit ${result.core.coreVersion} in ${result.runtimeRoot}`,
1379
1611
  "",
1380
1612
  "Next:",
1381
- "1. owlrunkit doctor --workspace .",
1382
- "2. owlrunkit profiles detect --workspace . --dry-run",
1383
- `3. owlrunkit adopt --workspace . --exact owlrunkit@${CORE_VERSION} or owlrunkit start`,
1613
+ "1. npx --no-install owlrunkit doctor --workspace .",
1614
+ "2. npx --no-install owlrunkit profiles detect --workspace . --dry-run",
1615
+ `3. npx --no-install owlrunkit adopt --workspace . --exact owlrunkit@${CORE_VERSION} or npx --no-install owlrunkit start`,
1384
1616
  "",
1385
1617
  ].join("\n"),
1386
1618
  );
@@ -1680,7 +1912,7 @@ function inspect(options) {
1680
1912
  const onboarding = onboardingProjection(root, recovery);
1681
1913
  const projectDefinitionPath = runtimePath(root, "project", "definition.json");
1682
1914
  const projectDriver = pathEntryExists(projectDefinitionPath)
1683
- ? readTeamProjectStatusV1({ workspaceRoot: root })
1915
+ ? readTeamProjectStatusV2({ workspaceRoot: root })
1684
1916
  : null;
1685
1917
  const summary = buildInspectSummary(result, {
1686
1918
  maintenanceNextAction: onboarding.maintenanceNextAction ?? null,
@@ -1908,9 +2140,10 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
1908
2140
  const separatorIndex = rest.indexOf("--");
1909
2141
  const acceptsExactCommand = command === "verify"
1910
2142
  || command === "quick-verify"
2143
+ || command === "quick-reuse"
1911
2144
  || (command === "formal" && rest[0] === "check");
1912
2145
  if (separatorIndex >= 0 && !acceptsExactCommand) {
1913
- throw new Error("Only verify, quick-verify, and formal check accept an exact command after --.");
2146
+ throw new Error("Only verify, quick-verify, quick-reuse, and formal check accept an exact command after --.");
1914
2147
  }
1915
2148
  const optionValues = separatorIndex >= 0 ? rest.slice(0, separatorIndex) : rest;
1916
2149
  const commandArgv = separatorIndex >= 0 ? rest.slice(separatorIndex + 1) : [];
@@ -1920,6 +2153,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
1920
2153
  "core-successor",
1921
2154
  "delivery",
1922
2155
  "deployment",
2156
+ "efficiency",
1923
2157
  "fleet",
1924
2158
  "formal",
1925
2159
  "lease",
@@ -1948,6 +2182,10 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
1948
2182
  const options = parseOptions(nested ? nestedOptions : optionValues, {
1949
2183
  multi: command === "mode"
1950
2184
  ? ["risk-category"]
2185
+ : command === "quick-verify"
2186
+ ? ["bind-ignored"]
2187
+ : command === "quick-reuse"
2188
+ ? ["allow-path"]
1951
2189
  : command === "profiles" && action === "impact"
1952
2190
  ? ["changed"]
1953
2191
  : (command === "fleet" && action === "discover")
@@ -1957,10 +2195,16 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
1957
2195
  || command === "start"
1958
2196
  || (command === "formal" && action === "start")
1959
2197
  ? ["owned-path"]
2198
+ : command === "project" && action === "target-snapshot"
2199
+ ? ["allowed-path"]
1960
2200
  : command === "project" && action === "handoff"
1961
2201
  ? ["evidence"]
1962
2202
  : command === "project" && action === "reject-and-return"
1963
2203
  ? ["evidence"]
2204
+ : command === "project" && action === "reopen-upstream"
2205
+ ? ["evidence"]
2206
+ : command === "project" && action === "transfer"
2207
+ ? ["evidence", "blocker", "decision"]
1964
2208
  : command === "project" && action === "integrate"
1965
2209
  ? ["evidence"]
1966
2210
  : command === "project" && action === "verification"
@@ -1969,6 +2213,8 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
1969
2213
  ? ["evidence", "blocker", "decision"]
1970
2214
  : command === "project" && action === "decision"
1971
2215
  ? ["blocking-work-item", "option", "evidence"]
2216
+ : command === "efficiency" && action === "record"
2217
+ ? ["evidence"]
1972
2218
  : [],
1973
2219
  boolean: command === "mode" && action === "recommend"
1974
2220
  ? [
@@ -1994,12 +2240,16 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
1994
2240
  ? ["json", "verbose", "history"]
1995
2241
  : command === "init"
1996
2242
  ? ["json"]
2243
+ : command === "bootstrap"
2244
+ ? ["json", "dry-run", "apply"]
1997
2245
  : command === "project" && action === "decision"
1998
2246
  ? ["json", "open", "resolve"]
1999
2247
  : command === "project" && action === "verification"
2000
2248
  ? ["json", "defer", "close"]
2001
- : command === "project" && new Set(["assign", "handoff", "reject-and-return", "checkpoint", "integrate", "status", "takeover", "successor"]).has(action)
2249
+ : command === "project" && new Set(["assign", "handoff", "reject-and-return", "reopen-upstream", "transfer", "checkpoint", "integrate", "status", "takeover", "successor"]).has(action)
2002
2250
  ? ["json"]
2251
+ : command === "project" && new Set(["target-snapshot", "import-delivery"]).has(action)
2252
+ ? ["json", "dry-run", "apply"]
2003
2253
  : command === "doctor" || command === "adopt" || command === "status"
2004
2254
  ? ["json"]
2005
2255
  : command === "profiles"
@@ -2013,14 +2263,43 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2013
2263
  : command === "deployment" && action === "execute"
2014
2264
  ? ["resume"]
2015
2265
  : command === "quick-verify"
2016
- ? ["json", "attest"]
2266
+ ? ["json", "attest", "isolate", "capture-runtime"]
2267
+ : command === "quick-reuse"
2268
+ ? ["json", "dry-run", "apply"]
2269
+ : command === "quick-runtime-verify"
2270
+ ? ["json"]
2017
2271
  : command === "quick-attest"
2018
2272
  ? ["json"]
2019
2273
  : command === "quick-metrics"
2020
2274
  ? ["json", "local", "verbose"]
2275
+ : command === "efficiency" && action === "record"
2276
+ ? ["json"]
2277
+ : command === "efficiency" && action === "status"
2278
+ ? ["json", "verbose"]
2021
2279
  : [],
2022
2280
  });
2023
2281
  if (command === "init") return await initialize(options);
2282
+ if (command === "bootstrap") {
2283
+ if (options.apply === true && options["dry-run"] === true) {
2284
+ throw new Error("bootstrap accepts either --apply or --dry-run, not both.");
2285
+ }
2286
+ if (options.apply !== true && options["dry-run"] !== true) {
2287
+ throw new Error("bootstrap requires --dry-run or --apply.");
2288
+ }
2289
+ const input = {
2290
+ workspaceRoot: requireOption(options, "workspace"),
2291
+ exactSpec: requireOption(options, "exact"),
2292
+ ...(options["skill-root"] === undefined
2293
+ ? {}
2294
+ : { skillRoot: options["skill-root"] }),
2295
+ };
2296
+ const result = options.apply === true
2297
+ ? await applyOnboardingBootstrapV1(input)
2298
+ : await planOnboardingBootstrapV1(input);
2299
+ return options.json === true
2300
+ ? result
2301
+ : withHumanOutput(result, formatOnboardingBootstrapHumanV1(result));
2302
+ }
2024
2303
  if (command === "doctor") {
2025
2304
  const timeoutMs = options["timeout-ms"] === undefined
2026
2305
  ? 1_500
@@ -2050,10 +2329,10 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2050
2329
  }
2051
2330
  if (command === "assurance") {
2052
2331
  if (action !== "route") {
2053
- throw new Error("Usage: owlrunkit assurance route --request <risk-facts.json>");
2332
+ throw new Error("Usage: npx --no-install owlrunkit assurance route --request <risk-facts.json>");
2054
2333
  }
2055
2334
  const requestPath = realpathSync(requireOption(options, "request"));
2056
- return routeRunKitAssuranceV1(readJson(requestPath));
2335
+ return routeRunKitAssuranceV2(readJson(requestPath));
2057
2336
  }
2058
2337
  if (command === "mode") {
2059
2338
  const root = workspace(options);
@@ -2080,7 +2359,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2080
2359
  "risk-category",
2081
2360
  "json",
2082
2361
  ]);
2083
- const recommendation = recommendUsageModeV1({
2362
+ const recommendation = recommendUsageModeV2({
2084
2363
  workspaceRoot: root,
2085
2364
  requestedMode: options["requested-mode"] ?? "auto",
2086
2365
  needsDurableEvidence: options["needs-evidence"] === true,
@@ -2109,11 +2388,11 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2109
2388
  });
2110
2389
  return options.json === true
2111
2390
  ? recommendation
2112
- : withHumanOutput(recommendation, formatUsageModeHumanV1(recommendation));
2391
+ : withHumanOutput(recommendation, formatUsageModeHumanV2(recommendation));
2113
2392
  }
2114
2393
  if (action === "status") {
2115
2394
  assertOnlyOptions(options, ["workspace", "json"]);
2116
- const recommendation = recommendUsageModeV1({
2395
+ const recommendation = recommendUsageModeV2({
2117
2396
  workspaceRoot: root,
2118
2397
  requestedMode: "auto",
2119
2398
  needsDurableEvidence: false,
@@ -2142,9 +2421,9 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2142
2421
  };
2143
2422
  return options.json === true
2144
2423
  ? status
2145
- : withHumanOutput(status, formatUsageModeHumanV1(status));
2424
+ : withHumanOutput(status, formatUsageModeHumanV2(status));
2146
2425
  }
2147
- throw new Error("Usage: owlrunkit mode <recommend|status> --workspace <directory>");
2426
+ throw new Error("Usage: npx --no-install owlrunkit mode <recommend|status> --workspace <directory>");
2148
2427
  }
2149
2428
  if (command === "fleet") {
2150
2429
  if (action === "register-root") {
@@ -2187,7 +2466,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2187
2466
  };
2188
2467
  }
2189
2468
  if (action !== "discover") {
2190
- throw new Error("Usage: owlrunkit fleet <register-root|inspect-registry|replace-registry|rollback-registry|discover>");
2469
+ throw new Error("Usage: npx --no-install owlrunkit fleet <register-root|inspect-registry|replace-registry|rollback-registry|discover>");
2191
2470
  }
2192
2471
  const discovered = await discoverFleet({
2193
2472
  fleetRoots: options["fleet-root"] ?? null,
@@ -2259,7 +2538,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2259
2538
  });
2260
2539
  }
2261
2540
  throw new Error(
2262
- "Usage: owlrunkit core-successor <plan|apply|resume> [options]",
2541
+ "Usage: npx --no-install owlrunkit core-successor <plan|apply|resume> [options]",
2263
2542
  );
2264
2543
  }
2265
2544
  if (command === "deployment") {
@@ -2692,7 +2971,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2692
2971
  };
2693
2972
  }
2694
2973
  }
2695
- throw new Error("Usage: owlrunkit deployment <prepare|execute> [options]");
2974
+ throw new Error("Usage: npx --no-install owlrunkit deployment <prepare|execute> [options]");
2696
2975
  }
2697
2976
  if (command === "formal") {
2698
2977
  if (action === "start") {
@@ -2774,7 +3053,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2774
3053
  authorizationGranted: false,
2775
3054
  };
2776
3055
  }
2777
- throw new Error("Usage: owlrunkit formal <start|check|finish> [options]");
3056
+ throw new Error("Usage: npx --no-install owlrunkit formal <start|check|finish> [options]");
2778
3057
  }
2779
3058
  if (command === "candidate") {
2780
3059
  if (action === "freeze") {
@@ -2814,7 +3093,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2814
3093
  targetWorkspaceRoot: requireOption(options, "target-workspace"),
2815
3094
  });
2816
3095
  }
2817
- throw new Error("Usage: owlrunkit candidate <freeze|verify|materialize> [options]");
3096
+ throw new Error("Usage: npx --no-install owlrunkit candidate <freeze|verify|materialize> [options]");
2818
3097
  }
2819
3098
  if (command === "start") return startExecution(options);
2820
3099
  if (command === "plan") {
@@ -2857,6 +3136,15 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2857
3136
  "workspace", "rework-id", "at", "work-item", "reviewer-agent",
2858
3137
  "to-agent", "reason", "next", "evidence", "json",
2859
3138
  ],
3139
+ "reopen-upstream": [
3140
+ "workspace", "reopen-id", "at", "upstream-work-item", "trigger-work-item",
3141
+ "reviewer-agent", "to-agent", "reason", "next", "evidence", "json",
3142
+ ],
3143
+ transfer: [
3144
+ "workspace", "transfer-id", "at", "assignment-id", "work-item",
3145
+ "from-agent", "to-agent", "state", "summary", "completed-units",
3146
+ "evidence", "blocker", "decision", "next", "source-fingerprint", "json",
3147
+ ],
2860
3148
  decision: [
2861
3149
  "workspace", "request", "open", "resolve", "decision-id", "at", "title",
2862
3150
  "question", "owner-agent", "blocking-work-item", "option", "resolution",
@@ -2874,6 +3162,15 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2874
3162
  ],
2875
3163
  integrate: ["workspace", "request", "gate", "at", "summary", "evidence", "json"],
2876
3164
  capture: ["workspace", "request"],
3165
+ "target-snapshot": [
3166
+ "workspace", "snapshot-id", "at", "work-item", "target-workspace",
3167
+ "allowed-path", "dry-run", "apply", "json",
3168
+ ],
3169
+ "import-delivery": [
3170
+ "workspace", "delivery-id", "at", "assignment-id", "work-item",
3171
+ "producer", "target-workspace", "packet", "entry-snapshot",
3172
+ "dry-run", "apply", "json",
3173
+ ],
2877
3174
  status: ["workspace", "json"],
2878
3175
  takeover: ["workspace", "agent", "json"],
2879
3176
  successor: ["workspace", "transition-id", "at", "definition", "reason", "json"],
@@ -2888,6 +3185,43 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2888
3185
  definition: readJson(realpathSync(requireOption(options, "definition"))),
2889
3186
  });
2890
3187
  }
3188
+ if (action === "target-snapshot") {
3189
+ if ((options.apply === true) === (options["dry-run"] === true)) {
3190
+ throw new Error("project target-snapshot requires exactly one of --dry-run or --apply.");
3191
+ }
3192
+ const captured = captureTargetWorkspaceSnapshotV1({
3193
+ controllerWorkspaceRoot: root,
3194
+ snapshotId: requireOption(options, "snapshot-id"),
3195
+ occurredAt: requireOption(options, "at"),
3196
+ workItemId: requireOption(options, "work-item"),
3197
+ targetWorkspaceRoot: requireOption(options, "target-workspace"),
3198
+ allowedPaths: options["allowed-path"],
3199
+ apply: options.apply === true,
3200
+ });
3201
+ return options.json === true
3202
+ ? captured
3203
+ : withHumanOutput(captured, formatTargetSnapshotHuman(captured));
3204
+ }
3205
+ if (action === "import-delivery") {
3206
+ if ((options.apply === true) === (options["dry-run"] === true)) {
3207
+ throw new Error("project import-delivery requires exactly one of --dry-run or --apply.");
3208
+ }
3209
+ const imported = importExternalDeliveryV1({
3210
+ controllerWorkspaceRoot: root,
3211
+ deliveryId: requireOption(options, "delivery-id"),
3212
+ occurredAt: requireOption(options, "at"),
3213
+ assignmentId: requireOption(options, "assignment-id"),
3214
+ workItemId: requireOption(options, "work-item"),
3215
+ producerId: requireOption(options, "producer"),
3216
+ targetWorkspaceRoot: requireOption(options, "target-workspace"),
3217
+ packetPath: requireOption(options, "packet"),
3218
+ entrySnapshotId: options["entry-snapshot"] ?? null,
3219
+ apply: options.apply === true,
3220
+ });
3221
+ return options.json === true
3222
+ ? imported
3223
+ : withHumanOutput(imported, formatExternalDeliveryHuman(imported));
3224
+ }
2891
3225
  if (action === "assign") {
2892
3226
  const directAssignmentFields = [
2893
3227
  "assignment-id",
@@ -2905,9 +3239,13 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2905
3239
  throw new Error("--request cannot be combined with direct assignment fields.");
2906
3240
  }
2907
3241
  if (options.request !== undefined) {
3242
+ const requestedEvent = readJson(realpathSync(requireOption(options, "request")));
3243
+ if (requestedEvent?.type !== "agent_assigned") {
3244
+ throw new Error("Project assign request only accepts type=agent_assigned.");
3245
+ }
2908
3246
  return appendTeamProjectEventV1({
2909
3247
  workspaceRoot: root,
2910
- event: readJson(realpathSync(requireOption(options, "request"))),
3248
+ event: requestedEvent,
2911
3249
  });
2912
3250
  }
2913
3251
  const assigned = assignTeamProjectV1({
@@ -2943,9 +3281,13 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2943
3281
  throw new Error("--request cannot be combined with direct handoff fields.");
2944
3282
  }
2945
3283
  if (options.request !== undefined) {
3284
+ const requestedEvent = readJson(realpathSync(requireOption(options, "request")));
3285
+ if (requestedEvent?.type !== "handoff_recorded") {
3286
+ throw new Error("Project handoff request only accepts type=handoff_recorded.");
3287
+ }
2946
3288
  return appendTeamProjectEventV1({
2947
3289
  workspaceRoot: root,
2948
- event: readJson(realpathSync(requireOption(options, "request"))),
3290
+ event: requestedEvent,
2949
3291
  });
2950
3292
  }
2951
3293
  const handedOff = handoffTeamProjectV1({
@@ -2980,6 +3322,55 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2980
3322
  ? returned
2981
3323
  : withHumanOutput(returned, formatTeamProjectReworkHuman(returned));
2982
3324
  }
3325
+ if (action === "reopen-upstream") {
3326
+ const evidenceRefs = options.evidence ?? [];
3327
+ if (evidenceRefs.length === 0) {
3328
+ throw new Error("Project reopen-upstream requires at least one --evidence.");
3329
+ }
3330
+ const reopened = reopenUpstreamTeamProjectV1({
3331
+ workspaceRoot: root,
3332
+ reopenId: requireOption(options, "reopen-id"),
3333
+ occurredAt: requireOption(options, "at"),
3334
+ upstreamWorkItemId: requireOption(options, "upstream-work-item"),
3335
+ triggerWorkItemId: requireOption(options, "trigger-work-item"),
3336
+ reviewerAgentId: requireOption(options, "reviewer-agent"),
3337
+ toAgentId: requireOption(options, "to-agent"),
3338
+ reason: requireOption(options, "reason"),
3339
+ nextAction: requireOption(options, "next"),
3340
+ evidenceRefs,
3341
+ });
3342
+ return options.json === true
3343
+ ? reopened
3344
+ : withHumanOutput(reopened, formatTeamProjectUpstreamReopenHuman(reopened));
3345
+ }
3346
+ if (action === "transfer") {
3347
+ const evidenceRefs = options.evidence ?? [];
3348
+ if (evidenceRefs.length === 0) {
3349
+ throw new Error("Project transfer requires at least one --evidence.");
3350
+ }
3351
+ const transferred = transferTeamProjectV1({
3352
+ workspaceRoot: root,
3353
+ transferId: requireOption(options, "transfer-id"),
3354
+ occurredAt: requireOption(options, "at"),
3355
+ assignmentId: requireOption(options, "assignment-id"),
3356
+ workItemId: requireOption(options, "work-item"),
3357
+ fromAgentId: requireOption(options, "from-agent"),
3358
+ toAgentId: requireOption(options, "to-agent"),
3359
+ state: requireOption(options, "state"),
3360
+ summary: requireOption(options, "summary"),
3361
+ completedUnits: options["completed-units"] === undefined
3362
+ ? undefined
3363
+ : Number(options["completed-units"]),
3364
+ evidenceRefs,
3365
+ blockerRefs: options.blocker ?? [],
3366
+ decisionRefs: options.decision ?? [],
3367
+ nextAction: requireOption(options, "next"),
3368
+ sourceFingerprint: options["source-fingerprint"],
3369
+ });
3370
+ return options.json === true
3371
+ ? transferred
3372
+ : withHumanOutput(transferred, formatTeamProjectTransferHuman(transferred));
3373
+ }
2983
3374
  if (action === "decision") {
2984
3375
  const directDecisionFields = [
2985
3376
  "open",
@@ -3002,9 +3393,16 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3002
3393
  throw new Error("--request cannot be combined with direct decision fields.");
3003
3394
  }
3004
3395
  if (options.request !== undefined) {
3396
+ const requestedEvent = readJson(realpathSync(requireOption(options, "request")));
3397
+ if (!new Set(["decision_opened", "decision_resolved"])
3398
+ .has(requestedEvent?.type)) {
3399
+ throw new Error(
3400
+ "Project decision request only accepts type=decision_opened or decision_resolved.",
3401
+ );
3402
+ }
3005
3403
  return appendTeamProjectEventV1({
3006
3404
  workspaceRoot: root,
3007
- event: readJson(realpathSync(requireOption(options, "request"))),
3405
+ event: requestedEvent,
3008
3406
  });
3009
3407
  }
3010
3408
  if (options.open === options.resolve) {
@@ -3205,7 +3603,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3205
3603
  } catch (error) {
3206
3604
  if (error instanceof Error
3207
3605
  && error.message === "Measured work item checkpoint requires completedUnits.") {
3208
- const projectStatus = readTeamProjectStatusV1({ workspaceRoot: root });
3606
+ const projectStatus = readTeamProjectStatusV2({ workspaceRoot: root });
3209
3607
  const workItem = projectStatus.workItems.find((row) => row.workItemId === workItemId);
3210
3608
  const suggestedUnits = state === "completed"
3211
3609
  ? workItem?.progress.total
@@ -3257,25 +3655,31 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3257
3655
  : withHumanOutput(integrated, formatTeamProjectIntegrationHuman(integrated));
3258
3656
  }
3259
3657
  if (new Set(["checkpoint", "capture"]).has(action)) {
3658
+ const requestedEvent = readJson(realpathSync(requireOption(options, "request")));
3659
+ if (requestedEvent?.type === "source_delivery_imported") {
3660
+ throw new Error(
3661
+ "External source delivery events require verified intake; use project import-delivery.",
3662
+ );
3663
+ }
3260
3664
  return appendTeamProjectEventV1({
3261
3665
  workspaceRoot: root,
3262
- event: readJson(realpathSync(requireOption(options, "request"))),
3666
+ event: requestedEvent,
3263
3667
  });
3264
3668
  }
3265
3669
  if (action === "status") {
3266
- const status = readTeamProjectStatusV1({ workspaceRoot: root });
3670
+ const status = readTeamProjectStatusV2({ workspaceRoot: root });
3267
3671
  return options.json === true
3268
3672
  ? status
3269
- : withHumanOutput(status, formatTeamProjectStatusHumanV1(status));
3673
+ : withHumanOutput(status, formatTeamProjectStatusHumanV2(status));
3270
3674
  }
3271
3675
  if (action === "takeover") {
3272
- const takeover = buildTeamProjectTakeoverV1({
3676
+ const takeover = buildTeamProjectTakeoverV2({
3273
3677
  workspaceRoot: root,
3274
3678
  agentId: requireOption(options, "agent"),
3275
3679
  });
3276
3680
  return options.json === true
3277
3681
  ? takeover
3278
- : withHumanOutput(takeover, formatTeamProjectTakeoverHumanV1(takeover));
3682
+ : withHumanOutput(takeover, formatTeamProjectTakeoverHumanV2(takeover));
3279
3683
  }
3280
3684
  if (action === "successor") {
3281
3685
  const successor = successorTeamProjectV1({
@@ -3290,7 +3694,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3290
3694
  ? successor
3291
3695
  : withHumanOutput(successor, formatTeamProjectSuccessorHumanV1(successor));
3292
3696
  }
3293
- throw new Error("Usage: owlrunkit project <init|assign|checkpoint|handoff|reject-and-return|decision|verification|integrate|capture|status|takeover|successor> [options]");
3697
+ throw new Error("Usage: npx --no-install owlrunkit project <init|assign|checkpoint|handoff|reject-and-return|reopen-upstream|transfer|decision|verification|integrate|capture|target-snapshot|import-delivery|status|takeover|successor> [options]");
3294
3698
  }
3295
3699
  if (command === "profiles") {
3296
3700
  const root = requireOption(options, "workspace");
@@ -3298,12 +3702,10 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3298
3702
  if (options.apply === true && options["dry-run"] === true) {
3299
3703
  throw new Error("profiles detect accepts either --apply or --dry-run, not both.");
3300
3704
  }
3301
- if (options["dry-run"] === true) {
3302
- return detectProfiles({ workspaceRoot: root });
3303
- }
3304
- const detection = detectProfilesV2({ workspaceRoot: root });
3705
+ if (options["dry-run"] === true) return detectProfilesV3({ workspaceRoot: root });
3706
+ const detection = detectProfilesV3({ workspaceRoot: root });
3305
3707
  return options.apply === true
3306
- ? applyDetectedProfilesV2({ workspaceRoot: root, detection })
3708
+ ? applyDetectedProfilesV3({ workspaceRoot: root, detection })
3307
3709
  : detection;
3308
3710
  }
3309
3711
  if (action === "reconcile") {
@@ -3324,7 +3726,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3324
3726
  if (changedPaths.length === 0) throw new Error("profiles impact requires --changed.");
3325
3727
  return resolveProfilesImpact({ workspaceRoot: root, changedPaths });
3326
3728
  }
3327
- throw new Error("Usage: owlrunkit profiles <detect|reconcile|validate|impact> [options]");
3729
+ throw new Error("Usage: npx --no-install owlrunkit profiles <detect|reconcile|validate|impact> [options]");
3328
3730
  }
3329
3731
  if (command === "lease") {
3330
3732
  const root = workspace(options);
@@ -3380,24 +3782,55 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3380
3782
  workspaceRoot: workspace(options),
3381
3783
  commandArgv,
3382
3784
  stdinFile: options["stdin-file"],
3785
+ isolate: options.isolate === true,
3786
+ dependencyRoot: options["dependency-root"],
3787
+ ignoredPaths: options["bind-ignored"] ?? [],
3788
+ captureRuntime: options["capture-runtime"] === true,
3383
3789
  });
3384
3790
  if (options.attest !== true || typeof verification.receiptPath !== "string") {
3385
- return verification;
3791
+ return presentQuickOutcome(verification, options.json === true);
3386
3792
  }
3387
3793
  const details = attestQuickReceiptDetails({
3388
3794
  receiptPath: verification.receiptPath,
3389
3795
  workspaceRoot: workspace(options),
3390
3796
  });
3391
- return {
3797
+ return presentQuickOutcome({
3392
3798
  ...verification,
3393
3799
  exitCode: details.exitCode === 0 ? verification.exitCode : details.exitCode,
3394
3800
  attestationDecision: details.attestation.decision,
3395
3801
  attestation: details.attestation,
3396
- nextAllowedAction: details.attestation.decision === "GO"
3397
- ? "consume_attestation"
3398
- : "inspect_attestation_issues",
3802
+ nextAllowedAction: verification.status === "quick_verification_runtime_truth_invalid"
3803
+ ? verification.nextAllowedAction
3804
+ : details.attestation.decision === "GO"
3805
+ ? "consume_attestation"
3806
+ : "inspect_attestation_issues",
3399
3807
  authorizationGranted: false,
3400
- };
3808
+ }, options.json === true);
3809
+ }
3810
+ if (command === "quick-runtime-verify") {
3811
+ return verifyRuntimeTransitionReceipt({
3812
+ workspaceRoot: workspace(options),
3813
+ receiptPath: requireOption(options, "receipt"),
3814
+ });
3815
+ }
3816
+ if (command === "quick-reuse") {
3817
+ if (options.apply === true && options["dry-run"] === true) {
3818
+ throw new Error("quick-reuse accepts either --apply or --dry-run, not both.");
3819
+ }
3820
+ if (options.apply !== true && options["dry-run"] !== true) {
3821
+ throw new Error("quick-reuse requires --dry-run or --apply.");
3822
+ }
3823
+ if (commandArgv.length === 0) {
3824
+ throw new Error("quick-reuse requires an exact delta command after --.");
3825
+ }
3826
+ return runQuickEvidenceReuse({
3827
+ workspaceRoot: workspace(options),
3828
+ baseReceiptPath: requireOption(options, "base-receipt"),
3829
+ allowedPaths: options["allow-path"] ?? [],
3830
+ commandArgv,
3831
+ stdinFile: options["stdin-file"],
3832
+ apply: options.apply === true,
3833
+ });
3401
3834
  }
3402
3835
  if (command === "quick-attest") {
3403
3836
  const details = attestQuickReceiptDetails({
@@ -3419,9 +3852,6 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3419
3852
  };
3420
3853
  }
3421
3854
  if (command === "quick-metrics") {
3422
- if (options.local !== true) {
3423
- throw new Error("Quick metrics requires --local; network telemetry is not available.");
3424
- }
3425
3855
  const local = readLocalQuickMetrics(workspace(options), {
3426
3856
  verbose: options.verbose === true,
3427
3857
  });
@@ -3431,6 +3861,26 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3431
3861
  networkRequests: 0,
3432
3862
  };
3433
3863
  }
3864
+ if (command === "efficiency" && action === "record") {
3865
+ return recordEfficiencyEventV1({
3866
+ workspaceRoot: workspace(options),
3867
+ eventId: requireOption(options, "event-id"),
3868
+ occurredAt: requireOption(options, "at"),
3869
+ kind: requireOption(options, "kind"),
3870
+ workflowId: requireOption(options, "workflow-id"),
3871
+ summary: requireOption(options, "summary"),
3872
+ evidenceRefs: options.evidence ?? [],
3873
+ });
3874
+ }
3875
+ if (command === "efficiency" && action === "status") {
3876
+ const metrics = readEfficiencyMetricsV1({
3877
+ workspaceRoot: workspace(options),
3878
+ verbose: options.verbose === true,
3879
+ });
3880
+ return options.json === true
3881
+ ? metrics
3882
+ : withHumanOutput(metrics, formatEfficiencyMetricsHumanV1(metrics));
3883
+ }
3434
3884
  if (command === "repair") {
3435
3885
  return runRepairExecution({
3436
3886
  workspaceRoot: workspace(options),
@@ -3487,7 +3937,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3487
3937
  return withControlTransaction(root, () => closeout(options));
3488
3938
  }
3489
3939
  if (command === "finish") return finishExecution(options);
3490
- throw new Error("Usage: owlrunkit <init|doctor|adopt|mode|assurance|fleet|profiles|project|status|formal|candidate|deployment|core-successor|start|verify|repair|offline-export|offline-import|quick-verify|quick-attest|quick-metrics|finish|plan|inspect|lease|delivery|coverage-adopt|resume|verify-plan|resource-preflight|snapshot|visual-smoke|finalize|ready-for-commit|closeout> [options]");
3940
+ throw new Error("Usage: npx --no-install owlrunkit <bootstrap|init|doctor|adopt|mode|assurance|fleet|profiles|project|status|formal|candidate|deployment|core-successor|start|verify|repair|offline-export|offline-import|quick-verify|quick-reuse|quick-runtime-verify|quick-attest|quick-metrics|efficiency|finish|plan|inspect|lease|delivery|coverage-adopt|resume|verify-plan|resource-preflight|snapshot|visual-smoke|finalize|ready-for-commit|closeout> [options]");
3491
3941
  } catch (error) {
3492
3942
  return {
3493
3943
  status: "invalid_input",
@@ -3512,7 +3962,7 @@ if (isDirectExecution(import.meta.url)) {
3512
3962
  ? parseOptions(argv.slice(1), { boolean: ["json", "verbose", "history"] })
3513
3963
  : null;
3514
3964
  const humanInspect = inspectOptions !== null && inspectOptions.json !== true;
3515
- const onboardingHumanCommand = new Set(["init", "doctor", "adopt", "profiles"]).has(argv[0]);
3965
+ const onboardingHumanCommand = new Set(["bootstrap", "init", "doctor", "adopt", "profiles"]).has(argv[0]);
3516
3966
  const interactiveOnboarding = onboardingHumanCommand
3517
3967
  && !argv.includes("--json")
3518
3968
  && process.stdout.isTTY === true;