owlrunkit 0.18.4 → 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 (49) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +102 -4
  3. package/docs/architecture/OWLCODA_RUNKIT_0190_CONSOLIDATED_DAILY_USE_PRODUCT_DECISION_20260812.md +97 -0
  4. package/docs/architecture/OWLCODA_RUN_KIT_CONTRACT_V0_2.md +57 -0
  5. package/integrations/codex/skills/owlcoda-runkit/SKILL.md +28 -4
  6. package/integrations/codex/skills/owlcoda-runkit/assets/templates/config.json +3 -3
  7. package/integrations/codex/skills/owlcoda-runkit/references/contract-v0.2.md +57 -0
  8. package/package.json +1 -1
  9. package/packages/attest/README.md +9 -5
  10. package/packages/attest/consumer-surface-v2.json +263 -0
  11. package/packages/attest/distribution-manifest-v1.json +9 -1
  12. package/packages/attest/schemas/quick-verification-receipt-v3.schema.json +244 -0
  13. package/packages/attest/schemas/workspace-snapshot-v2.schema.json +114 -0
  14. package/packages/attest/src/dependency-environment.mjs +128 -0
  15. package/packages/attest/src/index.mjs +1 -0
  16. package/packages/attest/src/quick-receipt-contract.mjs +202 -9
  17. package/packages/attest/src/quick.mjs +40 -4
  18. package/packages/attest/src/workspace-snapshot.mjs +133 -6
  19. package/registry-release-policy-v1.json +5 -5
  20. package/sbom.spdx.json +5 -5
  21. package/scripts/runkit-contract/core-contract.mjs +21 -1
  22. package/scripts/runkit-contract/efficiency-metrics.mjs +559 -0
  23. package/scripts/runkit-contract/evidence-store.mjs +130 -0
  24. package/scripts/runkit-contract/onboarding-bootstrap.mjs +685 -0
  25. package/scripts/runkit-contract/onboarding-doctor.mjs +2 -1
  26. package/scripts/runkit-contract/outcome-presentation.mjs +171 -0
  27. package/scripts/runkit-contract/profile-onboarding.mjs +22 -2
  28. package/scripts/runkit-contract/project-cli-resolver.mjs +23 -5
  29. package/scripts/runkit-contract/quick-evidence-reuse.mjs +590 -0
  30. package/scripts/runkit-contract/quick-isolation.mjs +314 -0
  31. package/scripts/runkit-contract/quick-metrics.mjs +51 -3
  32. package/scripts/runkit-contract/quick-receipt.mjs +31 -1
  33. package/scripts/runkit-contract/quick-verify.mjs +216 -25
  34. package/scripts/runkit-contract/quick-workspace-snapshot.mjs +1 -0
  35. package/scripts/runkit-contract/runkit-bootstrap.mjs +1 -0
  36. package/scripts/runkit-contract/runkit-cli.mjs +330 -18
  37. package/scripts/runkit-contract/runtime-transition.mjs +478 -0
  38. package/scripts/runkit-contract/schemas/efficiency-event-v1.schema.json +56 -0
  39. package/scripts/runkit-contract/schemas/efficiency-metrics-v1.schema.json +220 -0
  40. package/scripts/runkit-contract/schemas/external-runtime-report-v1.schema.json +125 -0
  41. package/scripts/runkit-contract/schemas/onboarding-bootstrap-plan-v1.schema.json +168 -0
  42. package/scripts/runkit-contract/schemas/onboarding-bootstrap-receipt-v1.schema.json +130 -0
  43. package/scripts/runkit-contract/schemas/outcome-summary-v1.schema.json +83 -0
  44. package/scripts/runkit-contract/schemas/quick-evidence-reuse-plan-v1.schema.json +59 -0
  45. package/scripts/runkit-contract/schemas/quick-evidence-reuse-receipt-v1.schema.json +79 -0
  46. package/scripts/runkit-contract/schemas/runtime-transition-receipt-v1.schema.json +185 -0
  47. package/scripts/runkit-contract/schemas/team-project-event-v4.schema.json +142 -0
  48. package/scripts/runkit-contract/team-project.mjs +704 -16
  49. package/scripts/runkit-contract/verification-envelope.mjs +15 -18
@@ -79,7 +79,18 @@ 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,
@@ -138,6 +149,11 @@ import {
138
149
  readProfileLauncherReadiness,
139
150
  runDoctor,
140
151
  } from "./onboarding-doctor.mjs";
152
+ import {
153
+ applyOnboardingBootstrapV1,
154
+ formatOnboardingBootstrapHumanV1,
155
+ planOnboardingBootstrapV1,
156
+ } from "./onboarding-bootstrap.mjs";
141
157
  import {
142
158
  formatAdoptionHuman,
143
159
  runRegistryAdoption,
@@ -158,7 +174,9 @@ import {
158
174
  openTeamProjectDecisionV1,
159
175
  readTeamProjectStatusV2,
160
176
  rejectAndReturnTeamProjectV1,
177
+ reopenUpstreamTeamProjectV1,
161
178
  resolveTeamProjectDecisionV1,
179
+ transferTeamProjectV1,
162
180
  } from "./team-project.mjs";
163
181
  import {
164
182
  formatTeamProjectSuccessorHumanV1,
@@ -175,21 +193,21 @@ Usage:
175
193
  npx --no-install owlrunkit <command> [options]
176
194
 
177
195
  Start here:
196
+ npx --no-install owlrunkit bootstrap --workspace . --exact owlrunkit@${CORE_VERSION} --dry-run
178
197
  npx --no-install owlrunkit mode recommend --workspace .
179
198
  npx --no-install owlrunkit doctor --workspace .
180
199
  npx --no-install owlrunkit profiles detect --workspace . --dry-run
181
- npx --no-install owlrunkit profiles detect --workspace . --apply
182
- npx --no-install owlrunkit assurance route --workspace . --request <risk-facts.json>
183
200
  npx --no-install owlrunkit adopt --workspace . --exact owlrunkit@${CORE_VERSION}
184
201
  Quick Verification
185
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>
186
205
  Low-risk, source-bound reusable evidence without writer leases or acceptance.
187
206
 
188
207
  Formal Delivery
189
208
  npx --no-install owlrunkit formal <start|check|finish> --workspace . --run-id <id> [...]
190
209
  Use for multi-writer, permissions, security, funds, irreversible change,
191
210
  uncertain rollback, schema/data migration, or explicit Formal acceptance.
192
-
193
211
  Frozen dirty source
194
212
  npx --no-install owlrunkit candidate <freeze|verify|materialize> --workspace . [...]
195
213
 
@@ -204,7 +222,7 @@ Fleet and status
204
222
  npx --no-install owlrunkit fleet discover; npx --no-install owlrunkit status --workspace .
205
223
 
206
224
  Agent team projects
207
- npx --no-install owlrunkit project <init|assign|checkpoint|handoff|reject-and-return|decision|verification|capture|target-snapshot|import-delivery|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]
208
226
  Durable Agent work, dependencies, decisions, gates, progress, and handoffs.
209
227
  Core successor
210
228
  npx --no-install owlrunkit core-successor <plan|apply|resume> --workspace . [...]
@@ -216,6 +234,25 @@ Formal accepted does not grant Git or release authority; Quick cannot become For
216
234
  `;
217
235
 
218
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
+ `,
219
256
  adopt: `Usage:
220
257
  npx --no-install owlrunkit adopt --workspace <directory> --exact owlrunkit@${CORE_VERSION}
221
258
  [--registry <url>] [--timeout-ms <milliseconds>] [--json]
@@ -268,20 +305,75 @@ Attests one Quick Receipt against its bound materials and current workspace.
268
305
  It never grants repository or business authority.
269
306
  `,
270
307
  "quick-verify": `Usage:
271
- npx --no-install 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]
272
311
  -- <executable> [args...]
273
312
 
274
313
  Runs one exact command, saves source-bound stdout/stderr and a Quick receipt,
275
314
  and returns a bounded head/tail output summary. --stdin-file copies and hash-binds
276
315
  up to 1 MiB of exact stdin bytes in the receipt store. --attest immediately
277
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.
278
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.
279
334
  `,
280
335
  "quick-metrics": `Usage:
281
336
  npx --no-install owlrunkit quick-metrics --workspace <directory> [--local] [--verbose] [--json]
282
337
 
283
338
  Returns aggregate local-only Quick counts with no telemetry or network access.
284
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.
285
377
  `,
286
378
  fleet: `Usage:
287
379
  npx --no-install owlrunkit fleet register-root --fleet-root <directory>
@@ -435,6 +527,16 @@ action without granting any authority.
435
527
  npx --no-install owlrunkit project reject-and-return --workspace <directory> --rework-id <id> --at <ISO-UTC>
436
528
  --work-item <failed-id> --reviewer-agent <id> --to-agent <id>
437
529
  --reason <text> --next <text> --evidence <ref> [--evidence <ref> ...] [--json]
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]
438
540
  npx --no-install owlrunkit project decision --workspace <directory> --open --decision-id <id> --at <ISO-UTC>
439
541
  --title <text> --question <text> --owner-agent <id>
440
542
  [--blocking-work-item <id> ...] --option <text> [--option <text> ...] [--json]
@@ -494,7 +596,32 @@ production, business, or other authorization.
494
596
 
495
597
  Atomically records the rejection and opens a new assigned rework attempt. The
496
598
  failed attempt remains immutable and evidence-linked. This action does not
497
- 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.
498
625
  `,
499
626
  "project target-snapshot": `Usage:
500
627
  npx --no-install owlrunkit project target-snapshot --workspace <controller>
@@ -545,6 +672,17 @@ function withHumanOutput(result, humanOutput) {
545
672
  return result;
546
673
  }
547
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
+
548
686
  function shellCommandToken(value) {
549
687
  const text = String(value);
550
688
  return /^[A-Za-z0-9_@%+=:,./-]+$/u.test(text)
@@ -608,6 +746,28 @@ function formatTeamProjectReworkHuman(result) {
608
746
  ].join("\n");
609
747
  }
610
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
+
611
771
  function formatTargetSnapshotHuman(result) {
612
772
  return [
613
773
  result.persisted
@@ -1980,9 +2140,10 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
1980
2140
  const separatorIndex = rest.indexOf("--");
1981
2141
  const acceptsExactCommand = command === "verify"
1982
2142
  || command === "quick-verify"
2143
+ || command === "quick-reuse"
1983
2144
  || (command === "formal" && rest[0] === "check");
1984
2145
  if (separatorIndex >= 0 && !acceptsExactCommand) {
1985
- 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 --.");
1986
2147
  }
1987
2148
  const optionValues = separatorIndex >= 0 ? rest.slice(0, separatorIndex) : rest;
1988
2149
  const commandArgv = separatorIndex >= 0 ? rest.slice(separatorIndex + 1) : [];
@@ -1992,6 +2153,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
1992
2153
  "core-successor",
1993
2154
  "delivery",
1994
2155
  "deployment",
2156
+ "efficiency",
1995
2157
  "fleet",
1996
2158
  "formal",
1997
2159
  "lease",
@@ -2020,6 +2182,10 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2020
2182
  const options = parseOptions(nested ? nestedOptions : optionValues, {
2021
2183
  multi: command === "mode"
2022
2184
  ? ["risk-category"]
2185
+ : command === "quick-verify"
2186
+ ? ["bind-ignored"]
2187
+ : command === "quick-reuse"
2188
+ ? ["allow-path"]
2023
2189
  : command === "profiles" && action === "impact"
2024
2190
  ? ["changed"]
2025
2191
  : (command === "fleet" && action === "discover")
@@ -2035,6 +2201,10 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2035
2201
  ? ["evidence"]
2036
2202
  : command === "project" && action === "reject-and-return"
2037
2203
  ? ["evidence"]
2204
+ : command === "project" && action === "reopen-upstream"
2205
+ ? ["evidence"]
2206
+ : command === "project" && action === "transfer"
2207
+ ? ["evidence", "blocker", "decision"]
2038
2208
  : command === "project" && action === "integrate"
2039
2209
  ? ["evidence"]
2040
2210
  : command === "project" && action === "verification"
@@ -2043,6 +2213,8 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2043
2213
  ? ["evidence", "blocker", "decision"]
2044
2214
  : command === "project" && action === "decision"
2045
2215
  ? ["blocking-work-item", "option", "evidence"]
2216
+ : command === "efficiency" && action === "record"
2217
+ ? ["evidence"]
2046
2218
  : [],
2047
2219
  boolean: command === "mode" && action === "recommend"
2048
2220
  ? [
@@ -2068,11 +2240,13 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2068
2240
  ? ["json", "verbose", "history"]
2069
2241
  : command === "init"
2070
2242
  ? ["json"]
2243
+ : command === "bootstrap"
2244
+ ? ["json", "dry-run", "apply"]
2071
2245
  : command === "project" && action === "decision"
2072
2246
  ? ["json", "open", "resolve"]
2073
2247
  : command === "project" && action === "verification"
2074
2248
  ? ["json", "defer", "close"]
2075
- : 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)
2076
2250
  ? ["json"]
2077
2251
  : command === "project" && new Set(["target-snapshot", "import-delivery"]).has(action)
2078
2252
  ? ["json", "dry-run", "apply"]
@@ -2089,14 +2263,43 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2089
2263
  : command === "deployment" && action === "execute"
2090
2264
  ? ["resume"]
2091
2265
  : command === "quick-verify"
2092
- ? ["json", "attest"]
2266
+ ? ["json", "attest", "isolate", "capture-runtime"]
2267
+ : command === "quick-reuse"
2268
+ ? ["json", "dry-run", "apply"]
2269
+ : command === "quick-runtime-verify"
2270
+ ? ["json"]
2093
2271
  : command === "quick-attest"
2094
2272
  ? ["json"]
2095
2273
  : command === "quick-metrics"
2096
2274
  ? ["json", "local", "verbose"]
2275
+ : command === "efficiency" && action === "record"
2276
+ ? ["json"]
2277
+ : command === "efficiency" && action === "status"
2278
+ ? ["json", "verbose"]
2097
2279
  : [],
2098
2280
  });
2099
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
+ }
2100
2303
  if (command === "doctor") {
2101
2304
  const timeoutMs = options["timeout-ms"] === undefined
2102
2305
  ? 1_500
@@ -2933,6 +3136,15 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
2933
3136
  "workspace", "rework-id", "at", "work-item", "reviewer-agent",
2934
3137
  "to-agent", "reason", "next", "evidence", "json",
2935
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
+ ],
2936
3148
  decision: [
2937
3149
  "workspace", "request", "open", "resolve", "decision-id", "at", "title",
2938
3150
  "question", "owner-agent", "blocking-work-item", "option", "resolution",
@@ -3110,6 +3322,55 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3110
3322
  ? returned
3111
3323
  : withHumanOutput(returned, formatTeamProjectReworkHuman(returned));
3112
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
+ }
3113
3374
  if (action === "decision") {
3114
3375
  const directDecisionFields = [
3115
3376
  "open",
@@ -3433,7 +3694,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3433
3694
  ? successor
3434
3695
  : withHumanOutput(successor, formatTeamProjectSuccessorHumanV1(successor));
3435
3696
  }
3436
- throw new Error("Usage: npx --no-install owlrunkit project <init|assign|checkpoint|handoff|reject-and-return|decision|verification|integrate|capture|target-snapshot|import-delivery|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]");
3437
3698
  }
3438
3699
  if (command === "profiles") {
3439
3700
  const root = requireOption(options, "workspace");
@@ -3521,24 +3782,55 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3521
3782
  workspaceRoot: workspace(options),
3522
3783
  commandArgv,
3523
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,
3524
3789
  });
3525
3790
  if (options.attest !== true || typeof verification.receiptPath !== "string") {
3526
- return verification;
3791
+ return presentQuickOutcome(verification, options.json === true);
3527
3792
  }
3528
3793
  const details = attestQuickReceiptDetails({
3529
3794
  receiptPath: verification.receiptPath,
3530
3795
  workspaceRoot: workspace(options),
3531
3796
  });
3532
- return {
3797
+ return presentQuickOutcome({
3533
3798
  ...verification,
3534
3799
  exitCode: details.exitCode === 0 ? verification.exitCode : details.exitCode,
3535
3800
  attestationDecision: details.attestation.decision,
3536
3801
  attestation: details.attestation,
3537
- nextAllowedAction: details.attestation.decision === "GO"
3538
- ? "consume_attestation"
3539
- : "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",
3540
3807
  authorizationGranted: false,
3541
- };
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
+ });
3542
3834
  }
3543
3835
  if (command === "quick-attest") {
3544
3836
  const details = attestQuickReceiptDetails({
@@ -3569,6 +3861,26 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3569
3861
  networkRequests: 0,
3570
3862
  };
3571
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
+ }
3572
3884
  if (command === "repair") {
3573
3885
  return runRepairExecution({
3574
3886
  workspaceRoot: workspace(options),
@@ -3625,7 +3937,7 @@ export async function runCli(argv = process.argv.slice(2), runtimeHooks = {}) {
3625
3937
  return withControlTransaction(root, () => closeout(options));
3626
3938
  }
3627
3939
  if (command === "finish") return finishExecution(options);
3628
- throw new Error("Usage: npx --no-install 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]");
3629
3941
  } catch (error) {
3630
3942
  return {
3631
3943
  status: "invalid_input",
@@ -3650,7 +3962,7 @@ if (isDirectExecution(import.meta.url)) {
3650
3962
  ? parseOptions(argv.slice(1), { boolean: ["json", "verbose", "history"] })
3651
3963
  : null;
3652
3964
  const humanInspect = inspectOptions !== null && inspectOptions.json !== true;
3653
- const onboardingHumanCommand = new Set(["init", "doctor", "adopt", "profiles"]).has(argv[0]);
3965
+ const onboardingHumanCommand = new Set(["bootstrap", "init", "doctor", "adopt", "profiles"]).has(argv[0]);
3654
3966
  const interactiveOnboarding = onboardingHumanCommand
3655
3967
  && !argv.includes("--json")
3656
3968
  && process.stdout.isTTY === true;