opencode-swarm 7.160.1 → 7.161.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 (94) hide show
  1. package/.opencode/skills/critic-gate/SKILL.md +8 -1
  2. package/.opencode/skills/execute/SKILL.md +4 -3
  3. package/.opencode/skills/phase-wrap/SKILL.md +2 -0
  4. package/.opencode/skills/running-tests/SKILL.md +6 -0
  5. package/.opencode/skills/swarm-implement/SKILL.md +2 -0
  6. package/.opencode/skills/swarm-pr-review/SKILL.md +1 -0
  7. package/dist/agents/architect.d.ts +1 -1
  8. package/dist/background/delegation-lifecycle.d.ts +374 -0
  9. package/dist/background/pending-delegations.d.ts +6 -0
  10. package/dist/build/command-resolution.d.ts +13 -0
  11. package/dist/build/discovery.d.ts +11 -4
  12. package/dist/cli/{coder-settlement-678ccmnf.js → coder-settlement-nayk1bbf.js} +8 -8
  13. package/dist/cli/{config-doctor-fr8dfrt2.js → config-doctor-b1w7yvcs.js} +2 -2
  14. package/dist/cli/{core-4j1hbhey.js → core-whesnhpf.js} +1 -1
  15. package/dist/cli/{curation-policy-47przjwg.js → curation-policy-ej9xc0cd.js} +5 -5
  16. package/dist/cli/{curator-85d97240.js → curator-1rzb285s.js} +31 -31
  17. package/dist/cli/{curator-llm-factory-s9s4s0q3.js → curator-llm-factory-bqfkaq6y.js} +31 -31
  18. package/dist/cli/{dispatch-7r46tfr9.js → dispatch-q4v8x2pk.js} +1 -1
  19. package/dist/cli/{evidence-summary-service-9dyt2kzh.js → evidence-summary-service-ma8drpv5.js} +13 -13
  20. package/dist/cli/{gate-evidence-a6paafg8.js → gate-evidence-7eh82zs0.js} +5 -5
  21. package/dist/cli/{guardrail-explain-4a2xdtew.js → guardrail-explain-em2mqz9a.js} +32 -32
  22. package/dist/cli/{guardrail-log-27nkntrx.js → guardrail-log-845tfrwb.js} +6 -6
  23. package/dist/cli/{guardrail-reset-xn7k3hn8.js → guardrail-reset-091xw53a.js} +31 -31
  24. package/dist/cli/{hive-promoter-k57j3kp6.js → hive-promoter-kx8t5em3.js} +31 -31
  25. package/dist/cli/{index-zpzvpybn.js → index-14dgnwmh.js} +2 -2
  26. package/dist/cli/{index-nj6rmyeh.js → index-3146wmgv.js} +352 -149
  27. package/dist/cli/{index-wccdm7jv.js → index-3cxfqdpv.js} +4 -4
  28. package/dist/cli/{index-e1ygmd4q.js → index-52f67bbh.js} +33 -33
  29. package/dist/cli/{index-gjx53y3c.js → index-54jznpq7.js} +1 -1
  30. package/dist/cli/{index-7h2armwf.js → index-7619tk9a.js} +2 -2
  31. package/dist/cli/{index-7v0ex0jt.js → index-7qera0f6.js} +2 -2
  32. package/dist/cli/{index-v8dsmee1.js → index-93pf824c.js} +3 -3
  33. package/dist/cli/{index-drqvph47.js → index-ambz0ryy.js} +4 -4
  34. package/dist/cli/{index-prv20xq6.js → index-c6zyqgpq.js} +1 -1
  35. package/dist/cli/{index-nnzdayvk.js → index-d1h4sf8f.js} +6 -6
  36. package/dist/cli/{index-7ezv5j23.js → index-d8st72j7.js} +1 -1
  37. package/dist/cli/{index-nk498mx6.js → index-dq41vsf9.js} +2 -2
  38. package/dist/cli/{index-m84z3aa8.js → index-et1jpj6z.js} +3 -3
  39. package/dist/cli/{index-bqxffayb.js → index-etdtfhhv.js} +1 -1
  40. package/dist/cli/{index-m1cw9fsh.js → index-f4dmccpd.js} +8 -8
  41. package/dist/cli/{index-znf683sm.js → index-f5axf6vq.js} +1 -1
  42. package/dist/cli/{index-dke4wzkn.js → index-fx3em0dr.js} +17 -1
  43. package/dist/cli/{index-98jmggma.js → index-gkv7s4xy.js} +8 -8
  44. package/dist/cli/{index-f72612zc.js → index-h6wtxzvm.js} +1 -1
  45. package/dist/cli/{index-mmr96pwr.js → index-k55td019.js} +1 -1
  46. package/dist/cli/{index-61c3d769.js → index-mbktm1ah.js} +7 -4
  47. package/dist/cli/{index-jszabr0r.js → index-mj6ndvee.js} +4 -4
  48. package/dist/cli/{index-b5adxpy6.js → index-nqbqkx4c.js} +1 -1
  49. package/dist/cli/{index-8c9qzpy7.js → index-q8hm27yj.js} +7 -1
  50. package/dist/cli/{index-zdv914xa.js → index-qjge2m9r.js} +81 -74
  51. package/dist/cli/{index-j3ss86kf.js → index-s33ee2w3.js} +1 -1
  52. package/dist/cli/{index-z0bxbb9g.js → index-t81fmfjj.js} +4 -4
  53. package/dist/cli/{index-pkz91fwm.js → index-trmqq4wm.js} +2 -2
  54. package/dist/cli/{index-dq93ar40.js → index-w9g58t3j.js} +5 -5
  55. package/dist/cli/{index-ny0g8fdg.js → index-wrtgyvre.js} +5 -5
  56. package/dist/cli/{index-qc53dfzh.js → index-xy0e0r5f.js} +1 -1
  57. package/dist/cli/{index-pqjcyj0p.js → index-y0ra2v4w.js} +3 -3
  58. package/dist/cli/{index-497a3hhj.js → index-y14mwbk8.js} +3 -3
  59. package/dist/cli/{index-7npz9n4s.js → index-zkgrayya.js} +1 -1
  60. package/dist/cli/index.js +31 -31
  61. package/dist/cli/{knowledge-escalator-3q2x34cg.js → knowledge-escalator-9eqpsbw5.js} +12 -12
  62. package/dist/cli/{knowledge-events-5y34w84b.js → knowledge-events-a8r4ej12.js} +10 -10
  63. package/dist/cli/{knowledge-link-xezm8hr3.js → knowledge-link-8knefv8x.js} +4 -4
  64. package/dist/cli/{knowledge-store-fqv89q5k.js → knowledge-store-ydzeppv7.js} +5 -5
  65. package/dist/cli/{knowledge-validator-fsdx14tk.js → knowledge-validator-mnv58he9.js} +7 -7
  66. package/dist/cli/{pending-delegations-6ae7wy5q.js → pending-delegations-9mwmrwwm.js} +6 -4
  67. package/dist/cli/{pr-review-reentry-authorization-986tk381.js → pr-review-reentry-authorization-h1ssfq37.js} +31 -31
  68. package/dist/cli/{pr-subscriptions-asjevc5p.js → pr-subscriptions-3zwthnan.js} +4 -4
  69. package/dist/cli/{runner-wsdcy2d6.js → runner-fzgkd6m1.js} +5 -5
  70. package/dist/cli/{scan-cursor-shn926r6.js → scan-cursor-5rmaqw2t.js} +6 -6
  71. package/dist/cli/{schema-98tdb9h0.js → schema-72vpr9xy.js} +1 -1
  72. package/dist/cli/{scope-persistence-cn34xnwr.js → scope-persistence-39mwns79.js} +8 -8
  73. package/dist/cli/{skill-generator-kck7087c.js → skill-generator-9aay0t53.js} +14 -14
  74. package/dist/cli/{telemetry-gpr9s3sm.js → telemetry-cmbjv240.js} +1 -1
  75. package/dist/cli/{worktree-collision-ownership-6b3kshcv.js → worktree-collision-ownership-ybhktnq4.js} +4 -4
  76. package/dist/cli/{worktree-isolation-he01qhss.js → worktree-isolation-w8ett6bs.js} +31 -31
  77. package/dist/config/evidence-schema.d.ts +20 -2
  78. package/dist/config/schema.d.ts +7 -7
  79. package/dist/hooks/delegate-ack-collector.d.ts +74 -0
  80. package/dist/hooks/knowledge-injector.d.ts +12 -1
  81. package/dist/index.js +280 -279
  82. package/dist/lang/default-backend.d.ts +1 -13
  83. package/dist/learning/admission.d.ts +2 -2
  84. package/dist/memory/schema.d.ts +3 -3
  85. package/dist/observability/catalog.d.ts +2 -2
  86. package/dist/prm/types.d.ts +9 -0
  87. package/dist/telemetry.d.ts +9 -1
  88. package/dist/tools/build-check.d.ts +4 -0
  89. package/dist/tools/repo-graph/retrieval-router.d.ts +57 -0
  90. package/dist/tools/repo-graph.d.ts +2 -0
  91. package/dist/tools/repo-map.d.ts +202 -0
  92. package/dist/tools/search.d.ts +2 -2
  93. package/dist/tools/test-runner.d.ts +2 -0
  94. package/package.json +1 -1
@@ -14,7 +14,7 @@ import {
14
14
  startHeartbeatTracking,
15
15
  stopHeartbeatTracking,
16
16
  telemetry
17
- } from "./index-dke4wzkn.js";
17
+ } from "./index-fx3em0dr.js";
18
18
  import"./index-bpmtbmy9.js";
19
19
  import"./index-a76rekgs.js";
20
20
  export {
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  scanDelegationFallbacksForRecovery,
12
12
  scanDelegationsForRecovery
13
- } from "./index-61c3d769.js";
13
+ } from "./index-mbktm1ah.js";
14
14
  import"./index-ddszzne4.js";
15
15
  import"./index-dtn0pne5.js";
16
16
  import"./index-z6xqpmqg.js";
@@ -22,12 +22,12 @@ import {
22
22
  resolveGitExecutable
23
23
  } from "./index-9e6fdz2h.js";
24
24
  import"./index-4rhhvd1a.js";
25
- import"./index-mmr96pwr.js";
25
+ import"./index-k55td019.js";
26
26
  import"./index-zjygnfay.js";
27
- import"./index-b5adxpy6.js";
27
+ import"./index-nqbqkx4c.js";
28
28
  import"./index-dh5q6z7y.js";
29
29
  import"./index-ed5ykebp.js";
30
- import"./index-dke4wzkn.js";
30
+ import"./index-fx3em0dr.js";
31
31
  import"./index-7g4c7s5r.js";
32
32
  import"./index-bpmtbmy9.js";
33
33
  import"./index-zgwm4ryv.js";
@@ -21,65 +21,65 @@ import {
21
21
  sanitizeWorktreeTaskId,
22
22
  standardWorktreeByCallID,
23
23
  standardWorktreeSerializationSessions
24
- } from "./index-zdv914xa.js";
25
- import"./index-j3ss86kf.js";
26
- import"./index-m84z3aa8.js";
27
- import"./index-f72612zc.js";
28
- import"./index-m1cw9fsh.js";
29
- import"./index-nk498mx6.js";
24
+ } from "./index-qjge2m9r.js";
25
+ import"./index-s33ee2w3.js";
26
+ import"./index-et1jpj6z.js";
27
+ import"./index-h6wtxzvm.js";
28
+ import"./index-f4dmccpd.js";
29
+ import"./index-dq41vsf9.js";
30
30
  import"./index-txdagbh7.js";
31
31
  import"./index-134d35c1.js";
32
- import"./index-nj6rmyeh.js";
33
- import"./index-v8dsmee1.js";
34
- import"./index-ny0g8fdg.js";
35
- import"./index-7v0ex0jt.js";
32
+ import"./index-3146wmgv.js";
33
+ import"./index-93pf824c.js";
34
+ import"./index-wrtgyvre.js";
35
+ import"./index-7qera0f6.js";
36
36
  import"./index-70ha9e09.js";
37
37
  import"./index-c8s9a3zh.js";
38
38
  import"./index-9ss2m4rs.js";
39
- import"./index-497a3hhj.js";
39
+ import"./index-y14mwbk8.js";
40
40
  import"./index-zsrtt42s.js";
41
- import"./index-dq93ar40.js";
41
+ import"./index-w9g58t3j.js";
42
42
  import"./index-3f7hqtgg.js";
43
43
  import"./index-awjx0wgk.js";
44
- import"./index-jszabr0r.js";
45
- import"./index-znf683sm.js";
44
+ import"./index-mj6ndvee.js";
45
+ import"./index-f5axf6vq.js";
46
46
  import"./index-rtry5xyf.js";
47
- import"./index-z0bxbb9g.js";
48
- import"./index-qc53dfzh.js";
49
- import"./index-61c3d769.js";
47
+ import"./index-t81fmfjj.js";
48
+ import"./index-xy0e0r5f.js";
49
+ import"./index-mbktm1ah.js";
50
50
  import"./index-ddszzne4.js";
51
- import"./index-drqvph47.js";
52
- import"./index-pqjcyj0p.js";
53
- import"./index-7h2armwf.js";
51
+ import"./index-ambz0ryy.js";
52
+ import"./index-y0ra2v4w.js";
53
+ import"./index-7619tk9a.js";
54
54
  import"./index-556ja8an.js";
55
55
  import"./index-4fwbbad3.js";
56
56
  import"./index-b43rt5ph.js";
57
57
  import"./index-q7sjgr1y.js";
58
- import"./index-nnzdayvk.js";
59
- import"./index-98jmggma.js";
58
+ import"./index-d1h4sf8f.js";
59
+ import"./index-gkv7s4xy.js";
60
60
  import {
61
61
  resolveWorktreeIsolationConfig
62
- } from "./index-pkz91fwm.js";
63
- import"./index-8c9qzpy7.js";
62
+ } from "./index-trmqq4wm.js";
63
+ import"./index-q8hm27yj.js";
64
64
  import"./index-n832052r.js";
65
65
  import"./index-dtn0pne5.js";
66
66
  import"./index-z6xqpmqg.js";
67
67
  import"./index-r3mvsbtq.js";
68
- import"./index-bqxffayb.js";
69
- import"./index-7npz9n4s.js";
68
+ import"./index-etdtfhhv.js";
69
+ import"./index-zkgrayya.js";
70
70
  import"./index-9e6fdz2h.js";
71
71
  import"./index-4rhhvd1a.js";
72
- import"./index-mmr96pwr.js";
72
+ import"./index-k55td019.js";
73
73
  import"./index-c9zp4xwc.js";
74
74
  import"./index-zjygnfay.js";
75
75
  import"./index-ae75rja9.js";
76
- import"./index-prv20xq6.js";
77
- import"./index-7ezv5j23.js";
76
+ import"./index-c6zyqgpq.js";
77
+ import"./index-d8st72j7.js";
78
78
  import"./index-bk5tah7q.js";
79
- import"./index-b5adxpy6.js";
79
+ import"./index-nqbqkx4c.js";
80
80
  import"./index-dh5q6z7y.js";
81
81
  import"./index-ed5ykebp.js";
82
- import"./index-dke4wzkn.js";
82
+ import"./index-fx3em0dr.js";
83
83
  import"./index-7g4c7s5r.js";
84
84
  import"./index-bpmtbmy9.js";
85
85
  import"./index-zgwm4ryv.js";
@@ -4,11 +4,11 @@ export declare const EVIDENCE_MAX_PATCH_BYTES: number;
4
4
  export declare const EVIDENCE_MAX_TASK_BYTES: number;
5
5
  export declare const EvidenceTypeSchema: z.ZodEnum<{
6
6
  note: "note";
7
+ test: "test";
7
8
  diff: "diff";
8
9
  secretscan: "secretscan";
9
10
  quality_budget: "quality_budget";
10
11
  placeholder: "placeholder";
11
- test: "test";
12
12
  build: "build";
13
13
  review: "review";
14
14
  approval: "approval";
@@ -35,11 +35,11 @@ export declare const BaseEvidenceSchema: z.ZodObject<{
35
35
  task_id: z.ZodString;
36
36
  type: z.ZodEnum<{
37
37
  note: "note";
38
+ test: "test";
38
39
  diff: "diff";
39
40
  secretscan: "secretscan";
40
41
  quality_budget: "quality_budget";
41
42
  placeholder: "placeholder";
42
- test: "test";
43
43
  build: "build";
44
44
  review: "review";
45
45
  approval: "approval";
@@ -497,6 +497,12 @@ export declare const BuildEvidenceSchema: z.ZodObject<{
497
497
  runs_count: z.ZodNumber;
498
498
  failed_count: z.ZodNumber;
499
499
  skipped_reason: z.ZodOptional<z.ZodString>;
500
+ environment_unavailable: z.ZodOptional<z.ZodArray<z.ZodObject<{
501
+ ecosystem: z.ZodString;
502
+ reason: z.ZodString;
503
+ code: z.ZodLiteral<"environment_unavailable">;
504
+ required_commands: z.ZodOptional<z.ZodArray<z.ZodString>>;
505
+ }, z.core.$strip>>>;
500
506
  }, z.core.$strip>;
501
507
  export type BuildEvidence = z.infer<typeof BuildEvidenceSchema>;
502
508
  export declare const QualityBudgetEvidenceSchema: z.ZodObject<{
@@ -1012,6 +1018,12 @@ export declare const EvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1012
1018
  runs_count: z.ZodNumber;
1013
1019
  failed_count: z.ZodNumber;
1014
1020
  skipped_reason: z.ZodOptional<z.ZodString>;
1021
+ environment_unavailable: z.ZodOptional<z.ZodArray<z.ZodObject<{
1022
+ ecosystem: z.ZodString;
1023
+ reason: z.ZodString;
1024
+ code: z.ZodLiteral<"environment_unavailable">;
1025
+ required_commands: z.ZodOptional<z.ZodArray<z.ZodString>>;
1026
+ }, z.core.$strip>>>;
1015
1027
  }, z.core.$strip>, z.ZodObject<{
1016
1028
  task_id: z.ZodString;
1017
1029
  timestamp: z.ZodString;
@@ -1520,6 +1532,12 @@ export declare const EvidenceBundleSchema: z.ZodObject<{
1520
1532
  runs_count: z.ZodNumber;
1521
1533
  failed_count: z.ZodNumber;
1522
1534
  skipped_reason: z.ZodOptional<z.ZodString>;
1535
+ environment_unavailable: z.ZodOptional<z.ZodArray<z.ZodObject<{
1536
+ ecosystem: z.ZodString;
1537
+ reason: z.ZodString;
1538
+ code: z.ZodLiteral<"environment_unavailable">;
1539
+ required_commands: z.ZodOptional<z.ZodArray<z.ZodString>>;
1540
+ }, z.core.$strip>>>;
1523
1541
  }, z.core.$strip>, z.ZodObject<{
1524
1542
  task_id: z.ZodString;
1525
1543
  timestamp: z.ZodString;
@@ -659,9 +659,9 @@ export declare const ApplyPatchConfigSchema: z.ZodObject<{
659
659
  }, z.core.$strict>;
660
660
  export type ApplyPatchConfig = z.infer<typeof ApplyPatchConfigSchema>;
661
661
  export declare const AutomationModeSchema: z.ZodEnum<{
662
+ hybrid: "hybrid";
662
663
  auto: "auto";
663
664
  manual: "manual";
664
- hybrid: "hybrid";
665
665
  }>;
666
666
  export type AutomationMode = z.infer<typeof AutomationModeSchema>;
667
667
  export declare const AutomationCapabilitiesSchema: z.ZodObject<{
@@ -675,9 +675,9 @@ export declare const AutomationCapabilitiesSchema: z.ZodObject<{
675
675
  export type AutomationCapabilities = z.infer<typeof AutomationCapabilitiesSchema>;
676
676
  declare const AutomationConfigSchemaBase: z.ZodObject<{
677
677
  mode: z.ZodDefault<z.ZodEnum<{
678
+ hybrid: "hybrid";
678
679
  auto: "auto";
679
680
  manual: "manual";
680
- hybrid: "hybrid";
681
681
  }>>;
682
682
  capabilities: z.ZodDefault<z.ZodObject<{
683
683
  plan_sync: z.ZodDefault<z.ZodBoolean>;
@@ -1148,9 +1148,9 @@ export declare const AgentAuthorityRuleSchema: z.ZodObject<{
1148
1148
  blockedPrefix: z.ZodOptional<z.ZodArray<z.ZodString>>;
1149
1149
  allowedPrefix: z.ZodOptional<z.ZodArray<z.ZodString>>;
1150
1150
  blockedZones: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1151
+ test: "test";
1151
1152
  docs: "docs";
1152
1153
  production: "production";
1153
- test: "test";
1154
1154
  config: "config";
1155
1155
  generated: "generated";
1156
1156
  build: "build";
@@ -1169,9 +1169,9 @@ export declare const AuthorityConfigSchema: z.ZodObject<{
1169
1169
  blockedPrefix: z.ZodOptional<z.ZodArray<z.ZodString>>;
1170
1170
  allowedPrefix: z.ZodOptional<z.ZodArray<z.ZodString>>;
1171
1171
  blockedZones: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1172
+ test: "test";
1172
1173
  docs: "docs";
1173
1174
  production: "production";
1174
- test: "test";
1175
1175
  config: "config";
1176
1176
  generated: "generated";
1177
1177
  build: "build";
@@ -2106,9 +2106,9 @@ export declare const PluginConfigSchema: z.ZodObject<{
2106
2106
  blockedPrefix: z.ZodOptional<z.ZodArray<z.ZodString>>;
2107
2107
  allowedPrefix: z.ZodOptional<z.ZodArray<z.ZodString>>;
2108
2108
  blockedZones: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2109
+ test: "test";
2109
2110
  docs: "docs";
2110
2111
  production: "production";
2111
- test: "test";
2112
2112
  config: "config";
2113
2113
  generated: "generated";
2114
2114
  build: "build";
@@ -2234,7 +2234,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
2234
2234
  fuzzy_match_context_aware: z.ZodDefault<z.ZodBoolean>;
2235
2235
  }, z.core.$strict>>;
2236
2236
  automation: z.ZodOptional<z.ZodType<{
2237
- mode: "auto" | "manual" | "hybrid";
2237
+ mode: "hybrid" | "auto" | "manual";
2238
2238
  capabilities: {
2239
2239
  plan_sync: boolean;
2240
2240
  phase_preflight: boolean;
@@ -2244,7 +2244,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
2244
2244
  decision_drift_detection: boolean;
2245
2245
  };
2246
2246
  }, unknown, z.core.$ZodTypeInternals<{
2247
- mode: "auto" | "manual" | "hybrid";
2247
+ mode: "hybrid" | "auto" | "manual";
2248
2248
  capabilities: {
2249
2249
  plan_sync: boolean;
2250
2250
  phase_preflight: boolean;
@@ -21,6 +21,11 @@
21
21
  * Stateless by design: it re-parses the prompt rather than relying on
22
22
  * cross-hook mutable state, so it is safe under parallel delegations. Fail-open:
23
23
  * never throws, never blocks.
24
+ *
25
+ * Issue #2045: the reconciliation itself lives in {@link reconcileShownDirectives}
26
+ * so lane collections (`collectLaneDelegateAcks`, keyed by the lane session's
27
+ * durable `delegate_directive` memberships) and Task collections share ONE
28
+ * implementation — not a second lifecycle copy.
24
29
  */
25
30
  export interface DelegateAckInput {
26
31
  tool: unknown;
@@ -59,6 +64,44 @@ export interface CollectDelegateAcksResult {
59
64
  detail: string;
60
65
  };
61
66
  }
67
+ /** A directive proven shown to a delegate, with the priority it was shown at. */
68
+ export interface ShownDirective {
69
+ id: string;
70
+ priority: string;
71
+ }
72
+ export interface ReconcileShownDirectivesParams {
73
+ directory: string;
74
+ /** Directives proven shown (anti-spoofing scope); never trust the ack list. */
75
+ shown: readonly ShownDirective[];
76
+ /**
77
+ * Retrieval trace the directives were shown under. `undefined` marks a
78
+ * legacy unverifiable prompt (pre-#1849): no receipt validation, no
79
+ * terminals, no fabricated trace.
80
+ */
81
+ traceId?: string;
82
+ transcript: string;
83
+ agent: string;
84
+ /** Host session the shown-set membership is bound to (V2 authority). */
85
+ sessionId: string;
86
+ taskId?: string;
87
+ /**
88
+ * Replay mode (issue #2045 crash recovery): the AUTHORITATIVE receipts
89
+ * (validator/ledger-committed ACK terminals, unacknowledged-critical
90
+ * violations) still run — the ledger dedupes them — but the audit-only
91
+ * `unacknowledged` NON-critical observation is exactly-once-at-emit (it
92
+ * bypasses the ledger and would double-append on replay).
93
+ */
94
+ replay?: boolean;
95
+ }
96
+ /**
97
+ * Shared reconciliation core (issue #2045): reconcile a proven-shown directive
98
+ * set against the ack markers in a transcript. Used by the Task
99
+ * `tool.execute.after` adapter (shown-set parsed from the delegation prompt)
100
+ * and by lane terminal observations (shown-set from the receipt ledger's
101
+ * session-bound `delegate_directive` memberships). Returns a summary of what
102
+ * was emitted. Never throws.
103
+ */
104
+ export declare function reconcileShownDirectives(params: ReconcileShownDirectivesParams): Promise<CollectDelegateAcksResult>;
62
105
  /**
63
106
  * Core reconciliation used by both the runtime hook and tests. Returns a summary
64
107
  * of what was emitted. Never throws.
@@ -71,6 +114,37 @@ export declare function collectDelegateAcks(params: {
71
114
  sessionId?: string;
72
115
  taskId?: string;
73
116
  }): Promise<CollectDelegateAcksResult>;
117
+ export interface CollectLaneDelegateAcksResult extends CollectDelegateAcksResult {
118
+ /**
119
+ * Phases recorded on the lane session's `delegate_directive` memberships
120
+ * (issue #2045). The reviewer verdict reconciliation windows by this phase.
121
+ */
122
+ phases: string[];
123
+ }
124
+ /**
125
+ * Lane-side delegate-ack reconciliation (issue #2045). Task delegations are
126
+ * reconciled by the `tool.execute.after` hook; lane outputs never pass through
127
+ * that hook, so this variant derives the proven-shown set from the receipt
128
+ * ledger's session-bound `delegate_directive` memberships — the durable record
129
+ * of exactly what the transform-path injector displayed to the lane session —
130
+ * and runs the SAME shared core. Idempotent per trace: replayed settlements
131
+ * hit the validator's idempotency, never double terminals.
132
+ *
133
+ * `sessionId` MUST be the lane SUBAGENT session id (memberships bind to the
134
+ * child session); a parent-session id queries zero rows by design.
135
+ */
136
+ export declare function collectLaneDelegateAcks(params: {
137
+ directory: string;
138
+ sessionId: string;
139
+ agent: string;
140
+ transcript: string;
141
+ /**
142
+ * Replay mode (issue #2045 crash recovery): set by the lifecycle module's
143
+ * duplicate-settle path so the ledger-committed receipts still close while
144
+ * the audit-only non-critical observation stays exactly-once-at-emit.
145
+ */
146
+ replay?: boolean;
147
+ }): Promise<CollectLaneDelegateAcksResult>;
74
148
  /**
75
149
  * `tool.execute.after` adapter. Reconciles delegate acks for a completed Task.
76
150
  */
@@ -18,13 +18,24 @@ import type { DirectivePriority, KnowledgeConfig, MessageWithParts } from './kno
18
18
  import { searchKnowledge } from './search-knowledge.js';
19
19
  /** Marker that uniquely identifies the delegate directive block in a transcript. */
20
20
  export declare const DELEGATE_DIRECTIVE_BLOCK_TAG = "<delegate_knowledge_directives>";
21
+ /**
22
+ * Issue #2045: hard ceiling for the delegate directive block. The configured
23
+ * `inject_char_budget` (default 2,000) governs the effective budget, but a
24
+ * delegate block may never exceed this cap even when the budget is configured
25
+ * higher — lane and Task delegations share the same bound.
26
+ */
27
+ export declare const DELEGATE_INJECT_HARD_CHAR_CAP = 2000;
21
28
  /**
22
29
  * Render a sanitized, deterministic `<delegate_knowledge_directives>` block for
23
30
  * a delegated subagent (Change 1, Task 1.3). Entries are sorted by priority
24
31
  * (critical first) then ID so the block is stable across runs and prompt caches
25
32
  * remain warm. Returns null when there are no entries (no empty wrapper).
33
+ *
34
+ * Issue #2045: `charBudget` (when provided) trims WHOLE records from the end —
35
+ * mirroring the architect block's trim loop — so the delegate injection can
36
+ * never exceed the configured ceiling / hard cap.
26
37
  */
27
- export declare function buildDelegateDirectiveBlock(entries: RankedEntry[], cfg: KnowledgeConfig, traceId?: string): string | null;
38
+ export declare function buildDelegateDirectiveBlock(entries: RankedEntry[], cfg: KnowledgeConfig, traceId?: string, charBudget?: number): string | null;
28
39
  /** A directive that was rendered into a delegate block, recovered by parsing. */
29
40
  export interface ShownDelegateDirective {
30
41
  id: string;