@astrosheep/keiyaku 4.6.11 → 4.6.13

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 (138) hide show
  1. package/build/plugins/claude/skills/keiyaku/SKILL.md +3 -1
  2. package/build/plugins/claude/skills/keiyaku-babysit/SKILL.md +1 -1
  3. package/build/plugins/claude/skills/keiyaku-bind/SKILL.md +3 -2
  4. package/build/plugins/claude/skills/keiyaku-workflow/SKILL.md +9 -8
  5. package/build/plugins/codex/skills/keiyaku/SKILL.md +3 -1
  6. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +1 -1
  7. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +3 -2
  8. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +9 -8
  9. package/build/plugins/opencode/skills/keiyaku/SKILL.md +3 -1
  10. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +1 -1
  11. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +3 -2
  12. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +9 -8
  13. package/build/skills/keiyaku/SKILL.md +3 -1
  14. package/build/skills/keiyaku-babysit/SKILL.md +1 -1
  15. package/build/skills/keiyaku-bind/SKILL.md +3 -2
  16. package/build/skills/keiyaku-workflow/SKILL.md +9 -8
  17. package/build/src/akuma/akuma-errors.d.ts +5 -0
  18. package/build/src/akuma/akuma-errors.js +9 -0
  19. package/build/src/akuma/akuma-owner.d.ts +14 -19
  20. package/build/src/akuma/akuma-owner.js +56 -54
  21. package/build/src/akuma/akuma-selection-execution.d.ts +5 -4
  22. package/build/src/akuma/akuma-selection-execution.js +59 -17
  23. package/build/src/akuma/akuma.d.ts +1 -2
  24. package/build/src/akuma/allowed.d.ts +2 -3
  25. package/build/src/akuma/allowed.js +1 -3
  26. package/build/src/akuma/body.js +17 -7
  27. package/build/src/akuma/call-initial-tell.d.ts +18 -0
  28. package/build/src/akuma/call-initial-tell.js +18 -0
  29. package/build/src/akuma/call-request.d.ts +20 -4
  30. package/build/src/akuma/heart/facts.d.ts +13 -0
  31. package/build/src/akuma/heart/facts.js +6 -0
  32. package/build/src/akuma/heart/index.d.ts +29 -14
  33. package/build/src/akuma/heart/index.js +75 -29
  34. package/build/src/akuma/heart/rows.d.ts +9 -2
  35. package/build/src/akuma/heart/rows.js +72 -11
  36. package/build/src/akuma/heart/storage.d.ts +2 -8
  37. package/build/src/akuma/heart/storage.js +13 -13
  38. package/build/src/akuma/heart/tells.d.ts +3 -1
  39. package/build/src/akuma/heart/tells.js +18 -2
  40. package/build/src/akuma/provider.d.ts +2 -4
  41. package/build/src/akuma/provider.js +29 -6
  42. package/build/src/akuma/providers/acp/core.js +23 -21
  43. package/build/src/akuma/providers/claude/index.js +0 -8
  44. package/build/src/akuma/providers/codex-app-server/index.js +9 -8
  45. package/build/src/akuma/providers/execution-environment.d.ts +1 -1
  46. package/build/src/akuma/providers/execution-environment.js +1 -0
  47. package/build/src/akuma/providers/opencode-sdk/events.js +111 -81
  48. package/build/src/akuma/providers/opencode-sdk/index.js +179 -150
  49. package/build/src/akuma/providers/opencode-sdk/native-http.js +7 -3
  50. package/build/src/akuma/providers/opencode-sdk/session.d.ts +5 -3
  51. package/build/src/akuma/providers/opencode-sdk/session.js +32 -27
  52. package/build/src/akuma/providers/paseo/index.js +0 -2
  53. package/build/src/akuma/providers/pi/index.js +23 -20
  54. package/build/src/akuma/selection-observation.d.ts +78 -9
  55. package/build/src/akuma/selection-owner-port.d.ts +2 -1
  56. package/build/src/akuma/selection-owner-port.js +6 -1
  57. package/build/src/akuma/selection-request.d.ts +1 -1
  58. package/build/src/akuma/selection-request.js +8 -3
  59. package/build/src/akuma/turn-drive.js +79 -48
  60. package/build/src/akuma-body.js +5 -3
  61. package/build/src/cli/commands/akuma-grammar.js +2 -2
  62. package/build/src/cli/commands/akuma.js +24 -16
  63. package/build/src/cli/commands/contract-grammar.d.ts +3 -7
  64. package/build/src/cli/commands/contract-grammar.js +12 -10
  65. package/build/src/cli/commands/contract-help.d.ts +3 -13
  66. package/build/src/cli/commands/contract-help.js +7 -16
  67. package/build/src/cli/commands/contract.js +19 -35
  68. package/build/src/cli/commands/debt.js +30 -29
  69. package/build/src/cli/parse.js +0 -1
  70. package/build/src/cli/render/akuma-activity.d.ts +36 -9
  71. package/build/src/cli/render/akuma-activity.js +142 -65
  72. package/build/src/cli/render/akuma.d.ts +6 -0
  73. package/build/src/cli/render/akuma.js +67 -24
  74. package/build/src/cli/render/catalog.js +0 -1
  75. package/build/src/cli/render/contract-observation.d.ts +16 -3
  76. package/build/src/cli/render/contract-observation.js +3 -0
  77. package/build/src/cli/render/contract.d.ts +2 -2
  78. package/build/src/cli/render/contract.js +4 -4
  79. package/build/src/cli/render/delivery-preview.d.ts +7 -0
  80. package/build/src/cli/render/{audit.js → delivery-preview.js} +29 -27
  81. package/build/src/cli/render/kanshi-akuma.d.ts +3 -1
  82. package/build/src/cli/render/kanshi-akuma.js +23 -8
  83. package/build/src/cli/render/kanshi.js +4 -1
  84. package/build/src/cli/render/receipt.js +3 -3
  85. package/build/src/cli/render/refusal.js +2 -2
  86. package/build/src/cli/render/terminal.d.ts +0 -1
  87. package/build/src/cli/render/terminal.js +1 -1
  88. package/build/src/cli/square-identity.d.ts +15 -0
  89. package/build/src/cli/square-identity.js +180 -0
  90. package/build/src/contract-worktree.js +1 -1
  91. package/build/src/core/verbs/placement.d.ts +2 -1
  92. package/build/src/core/verbs/placement.js +1 -1
  93. package/build/src/debt/context.d.ts +0 -5
  94. package/build/src/debt/context.js +32 -44
  95. package/build/src/git/process.d.ts +1 -0
  96. package/build/src/git/process.js +18 -1
  97. package/build/src/git/read-observation.js +2 -1
  98. package/build/src/git/scratch.d.ts +5 -1
  99. package/build/src/git/scratch.js +41 -12
  100. package/build/src/git/target-placement.d.ts +22 -4
  101. package/build/src/git/target-placement.js +44 -20
  102. package/build/src/index.d.ts +2 -2
  103. package/build/src/kanshi/read.js +187 -105
  104. package/build/src/kanshi/report.d.ts +5 -0
  105. package/build/src/library/address.d.ts +18 -4
  106. package/build/src/library/address.js +27 -6
  107. package/build/src/library/contract-address.d.ts +6 -0
  108. package/build/src/library/contract-address.js +12 -1
  109. package/build/src/library/contract-execution.d.ts +2 -2
  110. package/build/src/library/contract-execution.js +13 -17
  111. package/build/src/library/contract-operations.d.ts +59 -94
  112. package/build/src/library/contract-operations.js +23 -19
  113. package/build/src/library/contract-outcomes.d.ts +3 -3
  114. package/build/src/library/contract-settings.d.ts +1 -0
  115. package/build/src/library/contract-settings.js +1 -1
  116. package/build/src/library/invocation.d.ts +2 -2
  117. package/build/src/library/invocation.js +1 -1
  118. package/build/src/library/keiyaku.d.ts +2 -2
  119. package/build/src/library/keiyaku.js +2 -2
  120. package/build/src/library/outcome.d.ts +148 -268
  121. package/build/src/library/outcome.js +4 -8
  122. package/build/src/library/refusal.d.ts +2 -2
  123. package/build/src/library/refusal.js +2 -2
  124. package/build/src/plugin/runtime.js +15 -19
  125. package/build/src/protocol/{audit.d.ts → delivery-preview.d.ts} +62 -97
  126. package/build/src/protocol/delivery-preview.js +167 -0
  127. package/build/src/protocol/progress.d.ts +1 -1
  128. package/build/src/runtime/proc/run.js +22 -4
  129. package/build/src/runtime/proc/windows-launch.exe +0 -0
  130. package/build/src/verification/execution.d.ts +1 -1
  131. package/build/src/verification/execution.js +5 -3
  132. package/package.json +5 -2
  133. package/skills/keiyaku/SKILL.md +3 -1
  134. package/skills/keiyaku-babysit/SKILL.md +1 -1
  135. package/skills/keiyaku-bind/SKILL.md +3 -2
  136. package/skills/keiyaku-workflow/SKILL.md +9 -8
  137. package/build/src/cli/render/audit.d.ts +0 -7
  138. package/build/src/protocol/audit.js +0 -203
@@ -6,8 +6,8 @@ import type { WorldRoot } from "../world.js";
6
6
  import type { InvocationSnapshot } from "./invocation.js";
7
7
  import { reconciliationLagSchema } from "./reconcile.js";
8
8
  import { nukeConfirmationRefusalSchema, nukeConfirmationRequiredRefusalSchema, type OperationRefusals, type OperationRetries } from "./refusal.js";
9
- /** The seven Contract verbs, plus the World reset that shares the same envelope shape. */
10
- export type ContractVerb = "bind" | "amend" | "deliver" | "review" | "audit" | "arc" | "abandon";
9
+ /** Contract operation tags, including preview, sharing the invocation envelope with World reset. */
10
+ export type ContractVerb = "bind" | "amend" | "deliver" | "review" | "deliver-preview" | "arc" | "abandon";
11
11
  declare const reconciliationEffectSchema: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
12
12
  kind: z.ZodLiteral<"worktree">;
13
13
  path: z.ZodString;
@@ -7200,7 +7200,7 @@ declare const partialOutcomeEnvelopeSchema: z.ZodUnion<readonly [z.ZodUnion<read
7200
7200
  }>;
7201
7201
  required: z.ZodBoolean;
7202
7202
  }, z.core.$strict>>>;
7203
- operation: z.ZodLiteral<"audit">;
7203
+ operation: z.ZodLiteral<"deliver-preview">;
7204
7204
  head: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractHead, string>>>;
7205
7205
  value: z.ZodOptional<z.ZodType<{
7206
7206
  candidate?: {
@@ -7278,6 +7278,32 @@ declare const partialOutcomeEnvelopeSchema: z.ZodUnion<readonly [z.ZodUnion<read
7278
7278
  deletions: number;
7279
7279
  paths?: readonly string[] | undefined;
7280
7280
  };
7281
+ requirements: {
7282
+ gates: readonly {
7283
+ gate: import("../core/facts/types.js").Gate;
7284
+ current: {
7285
+ kind: "missing";
7286
+ } | {
7287
+ kind: "attested";
7288
+ verdict: "satisfied" | "unsatisfied";
7289
+ at: string;
7290
+ summary?: string | undefined;
7291
+ } | {
7292
+ kind: "stale";
7293
+ priorVerdict: "satisfied" | "unsatisfied";
7294
+ reason?: {
7295
+ kind: "candidate-content-changed";
7296
+ previousChange: import("../core/facts/types.js").ChangeId;
7297
+ currentChange: import("../core/facts/types.js").ChangeId;
7298
+ target?: string | undefined;
7299
+ } | undefined;
7300
+ };
7301
+ }[];
7302
+ unmetPrerequisites: readonly {
7303
+ contractId: ContractId;
7304
+ state: "abandoned" | "missing" | "active";
7305
+ }[];
7306
+ };
7281
7307
  diff?: string | undefined;
7282
7308
  } | undefined;
7283
7309
  verification?: {
@@ -7285,81 +7311,25 @@ declare const partialOutcomeEnvelopeSchema: z.ZodUnion<readonly [z.ZodUnion<read
7285
7311
  } | {
7286
7312
  kind: "undeclared";
7287
7313
  } | {
7288
- kind: "stopped";
7289
- stop: {
7290
- failure: "cancelled" | "unknown-exit";
7291
- stdout?: string | undefined;
7292
- stderr?: string | undefined;
7293
- truncated?: true | undefined;
7294
- } | {
7295
- failure: "spawn-error" | "candidate-unavailable";
7296
- diagnostic: string;
7297
- stdout?: string | undefined;
7298
- stderr?: string | undefined;
7299
- truncated?: true | undefined;
7300
- } | {
7301
- failure: "environment-failure";
7302
- diagnostic: string;
7303
- stdout?: string | undefined;
7304
- stderr?: string | undefined;
7305
- truncated?: true | undefined;
7306
- } | {
7307
- failure: "environment-failure";
7308
- name: string;
7309
- detail: {
7310
- kind: "exit";
7311
- code: number;
7312
- stdout: string;
7313
- stderr: string;
7314
- truncated: boolean;
7315
- } | {
7316
- kind: "timeout";
7317
- stdout?: string | undefined;
7318
- stderr?: string | undefined;
7319
- truncated?: boolean | undefined;
7320
- } | {
7321
- kind: "unknown-exit";
7322
- stdout?: string | undefined;
7323
- stderr?: string | undefined;
7324
- truncated?: boolean | undefined;
7325
- } | {
7326
- kind: "spawn-error";
7327
- diagnostic: string;
7328
- };
7329
- stdout?: string | undefined;
7330
- stderr?: string | undefined;
7331
- truncated?: true | undefined;
7332
- } | {
7333
- refusal: {
7334
- kind: "terminal" | "contract-missing";
7335
- contractId: ContractId;
7336
- } | {
7337
- kind: "verification-declaration-invalid";
7338
- contractId?: ContractId | undefined;
7339
- };
7340
- } | {
7341
- retry: {
7342
- kind: "publication-failed";
7343
- diagnostic: string;
7344
- } | {
7345
- kind: "exhausted" | "collision";
7346
- };
7347
- };
7348
- } | {
7349
- kind: "satisfied" | "unsatisfied";
7350
- passed: number;
7351
- total: number;
7352
- summary?: string | undefined;
7314
+ kind: "required";
7353
7315
  } | {
7354
7316
  entry: import("../core/facts/types.js").EntryUlid;
7355
7317
  verdict: "satisfied" | "unsatisfied";
7356
- kind: "reused";
7318
+ kind: "recorded";
7357
7319
  summary?: string | undefined;
7358
7320
  } | undefined;
7359
7321
  target?: {
7360
7322
  kind: "placeable";
7361
7323
  ref: string;
7362
7324
  head: import("../core/facts/types.js").SnapshotId;
7325
+ checkouts: readonly ({
7326
+ kind: "followable";
7327
+ path: string;
7328
+ } | {
7329
+ kind: "not-followable";
7330
+ path: string;
7331
+ diagnostic: string;
7332
+ })[];
7363
7333
  } | {
7364
7334
  kind: "moved";
7365
7335
  ref: string;
@@ -7484,6 +7454,32 @@ declare const partialOutcomeEnvelopeSchema: z.ZodUnion<readonly [z.ZodUnion<read
7484
7454
  deletions: number;
7485
7455
  paths?: readonly string[] | undefined;
7486
7456
  };
7457
+ requirements: {
7458
+ gates: readonly {
7459
+ gate: import("../core/facts/types.js").Gate;
7460
+ current: {
7461
+ kind: "missing";
7462
+ } | {
7463
+ kind: "attested";
7464
+ verdict: "satisfied" | "unsatisfied";
7465
+ at: string;
7466
+ summary?: string | undefined;
7467
+ } | {
7468
+ kind: "stale";
7469
+ priorVerdict: "satisfied" | "unsatisfied";
7470
+ reason?: {
7471
+ kind: "candidate-content-changed";
7472
+ previousChange: import("../core/facts/types.js").ChangeId;
7473
+ currentChange: import("../core/facts/types.js").ChangeId;
7474
+ target?: string | undefined;
7475
+ } | undefined;
7476
+ };
7477
+ }[];
7478
+ unmetPrerequisites: readonly {
7479
+ contractId: ContractId;
7480
+ state: "abandoned" | "missing" | "active";
7481
+ }[];
7482
+ };
7487
7483
  diff?: string | undefined;
7488
7484
  } | undefined;
7489
7485
  verification?: {
@@ -7491,81 +7487,25 @@ declare const partialOutcomeEnvelopeSchema: z.ZodUnion<readonly [z.ZodUnion<read
7491
7487
  } | {
7492
7488
  kind: "undeclared";
7493
7489
  } | {
7494
- kind: "stopped";
7495
- stop: {
7496
- failure: "cancelled" | "unknown-exit";
7497
- stdout?: string | undefined;
7498
- stderr?: string | undefined;
7499
- truncated?: true | undefined;
7500
- } | {
7501
- failure: "spawn-error" | "candidate-unavailable";
7502
- diagnostic: string;
7503
- stdout?: string | undefined;
7504
- stderr?: string | undefined;
7505
- truncated?: true | undefined;
7506
- } | {
7507
- failure: "environment-failure";
7508
- diagnostic: string;
7509
- stdout?: string | undefined;
7510
- stderr?: string | undefined;
7511
- truncated?: true | undefined;
7512
- } | {
7513
- failure: "environment-failure";
7514
- name: string;
7515
- detail: {
7516
- kind: "exit";
7517
- code: number;
7518
- stdout: string;
7519
- stderr: string;
7520
- truncated: boolean;
7521
- } | {
7522
- kind: "timeout";
7523
- stdout?: string | undefined;
7524
- stderr?: string | undefined;
7525
- truncated?: boolean | undefined;
7526
- } | {
7527
- kind: "unknown-exit";
7528
- stdout?: string | undefined;
7529
- stderr?: string | undefined;
7530
- truncated?: boolean | undefined;
7531
- } | {
7532
- kind: "spawn-error";
7533
- diagnostic: string;
7534
- };
7535
- stdout?: string | undefined;
7536
- stderr?: string | undefined;
7537
- truncated?: true | undefined;
7538
- } | {
7539
- refusal: {
7540
- kind: "terminal" | "contract-missing";
7541
- contractId: ContractId;
7542
- } | {
7543
- kind: "verification-declaration-invalid";
7544
- contractId?: ContractId | undefined;
7545
- };
7546
- } | {
7547
- retry: {
7548
- kind: "publication-failed";
7549
- diagnostic: string;
7550
- } | {
7551
- kind: "exhausted" | "collision";
7552
- };
7553
- };
7554
- } | {
7555
- kind: "satisfied" | "unsatisfied";
7556
- passed: number;
7557
- total: number;
7558
- summary?: string | undefined;
7490
+ kind: "required";
7559
7491
  } | {
7560
7492
  entry: import("../core/facts/types.js").EntryUlid;
7561
7493
  verdict: "satisfied" | "unsatisfied";
7562
- kind: "reused";
7494
+ kind: "recorded";
7563
7495
  summary?: string | undefined;
7564
7496
  } | undefined;
7565
7497
  target?: {
7566
7498
  kind: "placeable";
7567
7499
  ref: string;
7568
7500
  head: import("../core/facts/types.js").SnapshotId;
7501
+ checkouts: readonly ({
7502
+ kind: "followable";
7503
+ path: string;
7504
+ } | {
7505
+ kind: "not-followable";
7506
+ path: string;
7507
+ diagnostic: string;
7508
+ })[];
7569
7509
  } | {
7570
7510
  kind: "moved";
7571
7511
  ref: string;
@@ -11871,7 +11811,7 @@ declare const failureWireSchema: z.ZodObject<{
11871
11811
  }>;
11872
11812
  required: z.ZodBoolean;
11873
11813
  }, z.core.$strict>>>;
11874
- operation: z.ZodLiteral<"audit">;
11814
+ operation: z.ZodLiteral<"deliver-preview">;
11875
11815
  head: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ContractHead, string>>>;
11876
11816
  value: z.ZodOptional<z.ZodType<{
11877
11817
  candidate?: {
@@ -11949,6 +11889,32 @@ declare const failureWireSchema: z.ZodObject<{
11949
11889
  deletions: number;
11950
11890
  paths?: readonly string[] | undefined;
11951
11891
  };
11892
+ requirements: {
11893
+ gates: readonly {
11894
+ gate: import("../core/facts/types.js").Gate;
11895
+ current: {
11896
+ kind: "missing";
11897
+ } | {
11898
+ kind: "attested";
11899
+ verdict: "satisfied" | "unsatisfied";
11900
+ at: string;
11901
+ summary?: string | undefined;
11902
+ } | {
11903
+ kind: "stale";
11904
+ priorVerdict: "satisfied" | "unsatisfied";
11905
+ reason?: {
11906
+ kind: "candidate-content-changed";
11907
+ previousChange: import("../core/facts/types.js").ChangeId;
11908
+ currentChange: import("../core/facts/types.js").ChangeId;
11909
+ target?: string | undefined;
11910
+ } | undefined;
11911
+ };
11912
+ }[];
11913
+ unmetPrerequisites: readonly {
11914
+ contractId: ContractId;
11915
+ state: "abandoned" | "missing" | "active";
11916
+ }[];
11917
+ };
11952
11918
  diff?: string | undefined;
11953
11919
  } | undefined;
11954
11920
  verification?: {
@@ -11956,81 +11922,25 @@ declare const failureWireSchema: z.ZodObject<{
11956
11922
  } | {
11957
11923
  kind: "undeclared";
11958
11924
  } | {
11959
- kind: "stopped";
11960
- stop: {
11961
- failure: "cancelled" | "unknown-exit";
11962
- stdout?: string | undefined;
11963
- stderr?: string | undefined;
11964
- truncated?: true | undefined;
11965
- } | {
11966
- failure: "spawn-error" | "candidate-unavailable";
11967
- diagnostic: string;
11968
- stdout?: string | undefined;
11969
- stderr?: string | undefined;
11970
- truncated?: true | undefined;
11971
- } | {
11972
- failure: "environment-failure";
11973
- diagnostic: string;
11974
- stdout?: string | undefined;
11975
- stderr?: string | undefined;
11976
- truncated?: true | undefined;
11977
- } | {
11978
- failure: "environment-failure";
11979
- name: string;
11980
- detail: {
11981
- kind: "exit";
11982
- code: number;
11983
- stdout: string;
11984
- stderr: string;
11985
- truncated: boolean;
11986
- } | {
11987
- kind: "timeout";
11988
- stdout?: string | undefined;
11989
- stderr?: string | undefined;
11990
- truncated?: boolean | undefined;
11991
- } | {
11992
- kind: "unknown-exit";
11993
- stdout?: string | undefined;
11994
- stderr?: string | undefined;
11995
- truncated?: boolean | undefined;
11996
- } | {
11997
- kind: "spawn-error";
11998
- diagnostic: string;
11999
- };
12000
- stdout?: string | undefined;
12001
- stderr?: string | undefined;
12002
- truncated?: true | undefined;
12003
- } | {
12004
- refusal: {
12005
- kind: "terminal" | "contract-missing";
12006
- contractId: ContractId;
12007
- } | {
12008
- kind: "verification-declaration-invalid";
12009
- contractId?: ContractId | undefined;
12010
- };
12011
- } | {
12012
- retry: {
12013
- kind: "publication-failed";
12014
- diagnostic: string;
12015
- } | {
12016
- kind: "exhausted" | "collision";
12017
- };
12018
- };
12019
- } | {
12020
- kind: "satisfied" | "unsatisfied";
12021
- passed: number;
12022
- total: number;
12023
- summary?: string | undefined;
11925
+ kind: "required";
12024
11926
  } | {
12025
11927
  entry: import("../core/facts/types.js").EntryUlid;
12026
11928
  verdict: "satisfied" | "unsatisfied";
12027
- kind: "reused";
11929
+ kind: "recorded";
12028
11930
  summary?: string | undefined;
12029
11931
  } | undefined;
12030
11932
  target?: {
12031
11933
  kind: "placeable";
12032
11934
  ref: string;
12033
11935
  head: import("../core/facts/types.js").SnapshotId;
11936
+ checkouts: readonly ({
11937
+ kind: "followable";
11938
+ path: string;
11939
+ } | {
11940
+ kind: "not-followable";
11941
+ path: string;
11942
+ diagnostic: string;
11943
+ })[];
12034
11944
  } | {
12035
11945
  kind: "moved";
12036
11946
  ref: string;
@@ -12155,6 +12065,32 @@ declare const failureWireSchema: z.ZodObject<{
12155
12065
  deletions: number;
12156
12066
  paths?: readonly string[] | undefined;
12157
12067
  };
12068
+ requirements: {
12069
+ gates: readonly {
12070
+ gate: import("../core/facts/types.js").Gate;
12071
+ current: {
12072
+ kind: "missing";
12073
+ } | {
12074
+ kind: "attested";
12075
+ verdict: "satisfied" | "unsatisfied";
12076
+ at: string;
12077
+ summary?: string | undefined;
12078
+ } | {
12079
+ kind: "stale";
12080
+ priorVerdict: "satisfied" | "unsatisfied";
12081
+ reason?: {
12082
+ kind: "candidate-content-changed";
12083
+ previousChange: import("../core/facts/types.js").ChangeId;
12084
+ currentChange: import("../core/facts/types.js").ChangeId;
12085
+ target?: string | undefined;
12086
+ } | undefined;
12087
+ };
12088
+ }[];
12089
+ unmetPrerequisites: readonly {
12090
+ contractId: ContractId;
12091
+ state: "abandoned" | "missing" | "active";
12092
+ }[];
12093
+ };
12158
12094
  diff?: string | undefined;
12159
12095
  } | undefined;
12160
12096
  verification?: {
@@ -12162,81 +12098,25 @@ declare const failureWireSchema: z.ZodObject<{
12162
12098
  } | {
12163
12099
  kind: "undeclared";
12164
12100
  } | {
12165
- kind: "stopped";
12166
- stop: {
12167
- failure: "cancelled" | "unknown-exit";
12168
- stdout?: string | undefined;
12169
- stderr?: string | undefined;
12170
- truncated?: true | undefined;
12171
- } | {
12172
- failure: "spawn-error" | "candidate-unavailable";
12173
- diagnostic: string;
12174
- stdout?: string | undefined;
12175
- stderr?: string | undefined;
12176
- truncated?: true | undefined;
12177
- } | {
12178
- failure: "environment-failure";
12179
- diagnostic: string;
12180
- stdout?: string | undefined;
12181
- stderr?: string | undefined;
12182
- truncated?: true | undefined;
12183
- } | {
12184
- failure: "environment-failure";
12185
- name: string;
12186
- detail: {
12187
- kind: "exit";
12188
- code: number;
12189
- stdout: string;
12190
- stderr: string;
12191
- truncated: boolean;
12192
- } | {
12193
- kind: "timeout";
12194
- stdout?: string | undefined;
12195
- stderr?: string | undefined;
12196
- truncated?: boolean | undefined;
12197
- } | {
12198
- kind: "unknown-exit";
12199
- stdout?: string | undefined;
12200
- stderr?: string | undefined;
12201
- truncated?: boolean | undefined;
12202
- } | {
12203
- kind: "spawn-error";
12204
- diagnostic: string;
12205
- };
12206
- stdout?: string | undefined;
12207
- stderr?: string | undefined;
12208
- truncated?: true | undefined;
12209
- } | {
12210
- refusal: {
12211
- kind: "terminal" | "contract-missing";
12212
- contractId: ContractId;
12213
- } | {
12214
- kind: "verification-declaration-invalid";
12215
- contractId?: ContractId | undefined;
12216
- };
12217
- } | {
12218
- retry: {
12219
- kind: "publication-failed";
12220
- diagnostic: string;
12221
- } | {
12222
- kind: "exhausted" | "collision";
12223
- };
12224
- };
12225
- } | {
12226
- kind: "satisfied" | "unsatisfied";
12227
- passed: number;
12228
- total: number;
12229
- summary?: string | undefined;
12101
+ kind: "required";
12230
12102
  } | {
12231
12103
  entry: import("../core/facts/types.js").EntryUlid;
12232
12104
  verdict: "satisfied" | "unsatisfied";
12233
- kind: "reused";
12105
+ kind: "recorded";
12234
12106
  summary?: string | undefined;
12235
12107
  } | undefined;
12236
12108
  target?: {
12237
12109
  kind: "placeable";
12238
12110
  ref: string;
12239
12111
  head: import("../core/facts/types.js").SnapshotId;
12112
+ checkouts: readonly ({
12113
+ kind: "followable";
12114
+ path: string;
12115
+ } | {
12116
+ kind: "not-followable";
12117
+ path: string;
12118
+ diagnostic: string;
12119
+ })[];
12240
12120
  } | {
12241
12121
  kind: "moved";
12242
12122
  ref: string;
@@ -6,7 +6,7 @@ import { AuthorityCorruptionError } from "../core/facts/errors.js";
6
6
  import { contractHeadSchema } from "../git/identity.js";
7
7
  import { reconcileEffectSchema } from "../git/reconcile.js";
8
8
  import { worktreeWorkspaceSchema } from "../git/workspace.js";
9
- import { auditReportSchema } from "../protocol/audit.js";
9
+ import { deliveryPreviewReportSchema } from "../protocol/delivery-preview.js";
10
10
  import { completionEvidenceSchema } from "../protocol/completion.js";
11
11
  import { materializedConflictSchema } from "../protocol/deliver.js";
12
12
  import { contractIdSchema, deliverDataSchema, gateSchema } from "../protocol/operations.js";
@@ -90,10 +90,6 @@ function surface(surface, required) {
90
90
  return { surface, required };
91
91
  }
92
92
  function phasePending(operation, value) {
93
- if (operation === "audit") {
94
- const report = value;
95
- return report?.verification?.kind === "stopped" ? [surface("verification", true)] : [];
96
- }
97
93
  if (operation !== "review" && operation !== "deliver")
98
94
  return [];
99
95
  const concluded = value;
@@ -326,7 +322,7 @@ const partialValueSchemas = {
326
322
  amend: amendEvidenceSchema,
327
323
  deliver: partialDeliverySchema,
328
324
  review: reviewSchema,
329
- audit: auditReportSchema.partial(),
325
+ "deliver-preview": deliveryPreviewReportSchema.partial(),
330
326
  arc: z.object({}).strict(),
331
327
  abandon: z.object({}).strict(),
332
328
  };
@@ -341,7 +337,7 @@ const journalEntrySchema = z.unknown().transform((value, context) => {
341
337
  });
342
338
  const envelopeFieldsSchema = z
343
339
  .object({
344
- operation: z.enum(["bind", "amend", "deliver", "review", "audit", "arc", "abandon"]),
340
+ operation: z.enum(["bind", "amend", "deliver", "review", "deliver-preview", "arc", "abandon"]),
345
341
  contract: contractIdSchema.optional(),
346
342
  facts: z.array(journalEntrySchema).readonly(),
347
343
  effects: z.array(contractEffectSchema).readonly(),
@@ -430,7 +426,7 @@ const partialContractEnvelopeSchema = z.union([
430
426
  partialContractSchema("amend", partialValueSchemas.amend),
431
427
  partialContractSchema("deliver", partialValueSchemas.deliver),
432
428
  partialContractSchema("review", partialValueSchemas.review),
433
- partialContractSchema("audit", partialValueSchemas.audit),
429
+ partialContractSchema("deliver-preview", partialValueSchemas["deliver-preview"]),
434
430
  partialContractSchema("arc", partialValueSchemas.arc),
435
431
  partialContractSchema("abandon", partialValueSchemas.abandon),
436
432
  ]);
@@ -258,7 +258,7 @@ export declare const operationRetrySchemas: {
258
258
  kind: z.ZodLiteral<"owner-reason-unavailable">;
259
259
  diagnostic: z.ZodString;
260
260
  }, z.core.$strict>]>;
261
- readonly audit: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
261
+ readonly "deliver-preview": z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
262
262
  kind: z.ZodEnum<{
263
263
  exhausted: "exhausted";
264
264
  collision: "collision";
@@ -439,7 +439,7 @@ export declare const operationRefusalSchemas: {
439
439
  deletions: z.ZodNumber;
440
440
  }, z.core.$strict>;
441
441
  }, z.core.$strict>]>;
442
- readonly audit: z.ZodUnion<readonly [z.ZodObject<{
442
+ readonly "deliver-preview": z.ZodUnion<readonly [z.ZodObject<{
443
443
  kind: z.ZodEnum<{
444
444
  terminal: "terminal";
445
445
  "contract-missing": "contract-missing";
@@ -32,7 +32,7 @@ export const operationRetrySchemas = {
32
32
  amend: protocolTerminalSchema,
33
33
  deliver: keiyakuRetryReasonSchema,
34
34
  review: keiyakuRetryReasonSchema,
35
- audit: keiyakuRetryReasonSchema,
35
+ "deliver-preview": keiyakuRetryReasonSchema,
36
36
  arc: protocolTerminalSchema,
37
37
  abandon: protocolTerminalSchema,
38
38
  };
@@ -51,7 +51,7 @@ export const operationRefusalSchemas = {
51
51
  verificationDeclarationRefusalSchema,
52
52
  ]),
53
53
  review: z.union([activeContractRefusalSchema, worktreeMissingRefusalSchema, dirtyWorkspaceRefusalSchema]),
54
- audit: z.union([deliverRefusalSchema, verificationDeclarationRefusalSchema]),
54
+ "deliver-preview": z.union([deliverRefusalSchema, verificationDeclarationRefusalSchema]),
55
55
  arc: activeContractRefusalSchema,
56
56
  abandon: activeContractRefusalSchema,
57
57
  };
@@ -379,28 +379,24 @@ async function createPluginRuntime(input) {
379
379
  return Object.freeze({
380
380
  async emit(signal, reportDiagnostic = report) {
381
381
  const deadline = performance.now() + PLUGIN_ATTEMPT_TIMEOUT_MS;
382
- const activated = await boundedAttempt(async (cancellation) => {
383
- const handlers = await Promise.all(activations.map(async (activation, index) => {
384
- const activatedHandlers = await settleBefore(activation, cancellation);
385
- if (activatedHandlers !== ABORTED) {
386
- if (activatedHandlers.timedOut)
387
- reportPluginDiagnostic(reportDiagnostic, selected[index].id, "signal", timeoutError());
388
- return activatedHandlers.handlers;
382
+ const expiry = new AbortController();
383
+ const timer = setTimeout(() => expiry.abort(), PLUGIN_ATTEMPT_TIMEOUT_MS);
384
+ try {
385
+ await Promise.all(activations.map(async (activation, index) => {
386
+ const activated = await settleBefore(activation, expiry.signal);
387
+ if (activated === ABORTED || activated.timedOut) {
388
+ reportPluginDiagnostic(reportDiagnostic, selected[index].id, "signal", timeoutError());
389
+ if (activated === ABORTED)
390
+ return;
389
391
  }
390
- reportPluginDiagnostic(reportDiagnostic, selected[index].id, "signal", timeoutError());
391
- return [];
392
+ await Promise.all(activated.handlers
393
+ .filter((entry) => entry.kind === signal.kind)
394
+ .map((entry) => deliver(entry, signal, reportDiagnostic, Math.max(0, deadline - performance.now()))));
392
395
  }));
393
- return handlers.flat();
394
- });
395
- if (activated.kind === "failed") {
396
- reportPluginDiagnostic(reportDiagnostic, "runtime", "signal", activated.error);
397
- return;
398
396
  }
399
- if (activated.kind === "timed-out")
400
- return;
401
- await Promise.all(activated.value
402
- .filter((entry) => entry.kind === signal.kind)
403
- .map((entry) => deliver(entry, signal, reportDiagnostic, Math.max(0, deadline - performance.now()))));
397
+ finally {
398
+ clearTimeout(timer);
399
+ }
404
400
  },
405
401
  });
406
402
  }