opencode-swarm 7.139.4 → 7.139.6

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 (80) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +8 -101
  2. package/.opencode/skills/execute/SKILL.md +10 -9
  3. package/.opencode/skills/issue-ingest/SKILL.md +1 -1
  4. package/.opencode/skills/plan/SKILL.md +40 -97
  5. package/.opencode/skills/specify/SKILL.md +3 -89
  6. package/dist/agents/architect.d.ts +2 -3
  7. package/dist/cli/{config-doctor-whxr386t.js → config-doctor-7v9at76j.js} +3 -3
  8. package/dist/cli/{core-aj5g7an6.js → core-jtj9j6z5.js} +2 -2
  9. package/dist/cli/{curation-policy-anym2y3v.js → curation-policy-rbrx3kd2.js} +6 -6
  10. package/dist/cli/{curator-e8cvb55d.js → curator-bdc5hssa.js} +27 -27
  11. package/dist/cli/{curator-llm-factory-h9xbpgmw.js → curator-llm-factory-305cfcxz.js} +27 -27
  12. package/dist/cli/{evidence-summary-service-g82bsjqa.js → evidence-summary-service-nfdc1ht9.js} +9 -8
  13. package/dist/cli/{gate-evidence-72cgrvs2.js → gate-evidence-46qeyfc1.js} +4 -4
  14. package/dist/cli/{guardrail-explain-0be7msvq.js → guardrail-explain-w9rwgz4c.js} +28 -28
  15. package/dist/cli/{guardrail-log-9mm5443g.js → guardrail-log-4805jgj5.js} +4 -4
  16. package/dist/cli/{hive-promoter-nnzs5x1r.js → hive-promoter-jrd4pjb6.js} +27 -27
  17. package/dist/cli/{index-sd657fkp.js → index-1m1ksyqt.js} +1 -1
  18. package/dist/cli/{index-5azdnaty.js → index-1tw24kcp.js} +2 -2
  19. package/dist/cli/{index-pg84msyc.js → index-3fscvmfw.js} +3 -3
  20. package/dist/cli/{index-k41dn8me.js → index-68gh7p3t.js} +3 -3
  21. package/dist/cli/{index-e1k9vpqn.js → index-7qx874pn.js} +2 -2
  22. package/dist/cli/{index-jnfyxeap.js → index-8d2d7c6k.js} +4 -4
  23. package/dist/cli/{index-0e95eck5.js → index-a6v3kzyc.js} +5 -5
  24. package/dist/cli/{index-xmhhhjjw.js → index-adyxbmt5.js} +3 -3
  25. package/dist/cli/{index-xb1zq933.js → index-b6k9z88b.js} +1 -1
  26. package/dist/cli/{index-j77frjq8.js → index-b9rd29ge.js} +1 -1
  27. package/dist/cli/{index-6nzmp937.js → index-brh827g0.js} +442 -27
  28. package/dist/cli/{index-1kz6da87.js → index-d181x9zr.js} +2 -1
  29. package/dist/cli/{index-ejbcpbzp.js → index-ev72jrxc.js} +2 -2
  30. package/dist/cli/{index-s58vghgj.js → index-fjrt81db.js} +2 -2
  31. package/dist/cli/{index-6r522srn.js → index-h2waehqq.js} +1 -1
  32. package/dist/cli/{index-vyqd1hzm.js → index-h7ht03c4.js} +1529 -969
  33. package/dist/cli/{index-6z0a940s.js → index-hbnsmnb0.js} +2 -2
  34. package/dist/cli/{index-s0qc4gj6.js → index-hfvxhk4z.js} +1 -1
  35. package/dist/cli/{index-0xkjhgrf.js → index-jfjnn408.js} +1 -1
  36. package/dist/cli/{index-vfsqpcz6.js → index-k5z14rb1.js} +4 -4
  37. package/dist/cli/{index-6rxgb5r9.js → index-kbfsp07d.js} +16 -6
  38. package/dist/cli/{index-6vh6vrnk.js → index-m7xks4r4.js} +6 -6
  39. package/dist/cli/{index-5z2xps64.js → index-n0pja0qs.js} +2 -2
  40. package/dist/cli/{index-5s23pfsy.js → index-n3ppm2gt.js} +2 -2
  41. package/dist/cli/{index-4wjk296r.js → index-r4t92q32.js} +2 -2
  42. package/dist/cli/{index-33skgk1a.js → index-rs1f1bh0.js} +1 -1
  43. package/dist/cli/{index-rsrx77fg.js → index-ry0hgg3m.js} +3 -3
  44. package/dist/cli/{index-sa15nfgg.js → index-sfbwze80.js} +29 -29
  45. package/dist/cli/{index-gfmrw2f5.js → index-t94f72tb.js} +2 -2
  46. package/dist/cli/{index-9cdj4020.js → index-wv89xmbe.js} +2 -2
  47. package/dist/cli/{index-nrx08gcr.js → index-yyyk63kk.js} +2 -2
  48. package/dist/cli/index.js +27 -27
  49. package/dist/cli/{knowledge-escalator-a6z30y9p.js → knowledge-escalator-7z9vwqrk.js} +7 -7
  50. package/dist/cli/{knowledge-events-deq0ds8e.js → knowledge-events-vw2cdtnp.js} +5 -5
  51. package/dist/cli/{knowledge-link-bmbatt8s.js → knowledge-link-q46k9adx.js} +4 -4
  52. package/dist/cli/{knowledge-store-vdr19mnq.js → knowledge-store-ecv0qs7r.js} +5 -5
  53. package/dist/cli/{knowledge-validator-5hgacnrf.js → knowledge-validator-arppnzpb.js} +8 -8
  54. package/dist/cli/{pending-delegations-7ayryxbg.js → pending-delegations-qzrx38y9.js} +3 -3
  55. package/dist/cli/{pr-subscriptions-w5y08ebc.js → pr-subscriptions-5s59h4dd.js} +3 -3
  56. package/dist/cli/{runner-h7vmgkth.js → runner-y78d7ryb.js} +5 -5
  57. package/dist/cli/{scan-cursor-d6qcg9hr.js → scan-cursor-7740wg6r.js} +6 -6
  58. package/dist/cli/{schema-y1zekrag.js → schema-sajt4mcv.js} +2 -2
  59. package/dist/cli/{scope-persistence-tj6qway9.js → scope-persistence-dr1msqxw.js} +5 -5
  60. package/dist/cli/{skill-generator-bw8xhzzn.js → skill-generator-k8qz8ja5.js} +9 -9
  61. package/dist/cli/{telemetry-62cn5t24.js → telemetry-sc57xtb0.js} +1 -1
  62. package/dist/cli/{worktree-collision-ownership-hs5c2qzp.js → worktree-collision-ownership-7a8e6gr9.js} +3 -3
  63. package/dist/config/plan-schema.d.ts +2 -0
  64. package/dist/db/index.d.ts +1 -1
  65. package/dist/db/qa-gate-profile.d.ts +86 -2
  66. package/dist/db/task-checkpoint-receipt.d.ts +27 -0
  67. package/dist/index.js +394 -309
  68. package/dist/plan/manager.d.ts +4 -0
  69. package/dist/qa-gate/recovery.d.ts +6 -0
  70. package/dist/services/export-service.d.ts +2 -6
  71. package/dist/services/handoff-service.d.ts +2 -6
  72. package/dist/tools/checkpoint.d.ts +17 -7
  73. package/dist/tools/get-approved-plan.d.ts +8 -6
  74. package/dist/tools/get-qa-gate-profile.d.ts +7 -3
  75. package/dist/tools/phase-complete/gates/gate-helpers.d.ts +1 -0
  76. package/dist/tools/qa-gate-plan-identity.d.ts +28 -0
  77. package/dist/tools/save-plan.d.ts +3 -14
  78. package/dist/tools/set-qa-gates.d.ts +13 -8
  79. package/dist/tools/write-drift-evidence.d.ts +2 -0
  80. package/package.json +1 -1
@@ -9,16 +9,16 @@ import {
9
9
  sweepStale,
10
10
  unsubscribe,
11
11
  updateSnapshot
12
- } from "./index-0xkjhgrf.js";
12
+ } from "./index-jfjnn408.js";
13
13
  import"./index-k46me75h.js";
14
14
  import"./index-ee3x66a5.js";
15
15
  import"./index-ed5ykebp.js";
16
- import"./index-s0qc4gj6.js";
16
+ import"./index-hfvxhk4z.js";
17
17
  import"./index-7g4c7s5r.js";
18
18
  import"./index-4nt52yr9.js";
19
19
  import"./index-zgwm4ryv.js";
20
20
  import"./index-zjygnfay.js";
21
- import"./index-rsrx77fg.js";
21
+ import"./index-ry0hgg3m.js";
22
22
  import"./index-bpmtbmy9.js";
23
23
  import"./index-a76rekgs.js";
24
24
  export {
@@ -3,16 +3,16 @@ import {
3
3
  _internals,
4
4
  createModelEvaluationExecutor,
5
5
  runEvaluation
6
- } from "./index-sd657fkp.js";
7
- import"./index-nrx08gcr.js";
6
+ } from "./index-1m1ksyqt.js";
7
+ import"./index-yyyk63kk.js";
8
8
  import"./index-y8552snf.js";
9
- import"./index-6r522srn.js";
9
+ import"./index-h2waehqq.js";
10
10
  import"./index-ed5ykebp.js";
11
- import"./index-s0qc4gj6.js";
11
+ import"./index-hfvxhk4z.js";
12
12
  import"./index-7g4c7s5r.js";
13
13
  import"./index-4nt52yr9.js";
14
14
  import"./index-zgwm4ryv.js";
15
- import"./index-rsrx77fg.js";
15
+ import"./index-ry0hgg3m.js";
16
16
  import"./index-bpmtbmy9.js";
17
17
  import"./index-a76rekgs.js";
18
18
  export {
@@ -4,18 +4,18 @@ import {
4
4
  alreadyCuratedThisGeneration,
5
5
  claimNextScanBatch,
6
6
  getScanStatus
7
- } from "./index-9cdj4020.js";
8
- import"./index-6vh6vrnk.js";
7
+ } from "./index-wv89xmbe.js";
8
+ import"./index-m7xks4r4.js";
9
9
  import"./index-ae75rja9.js";
10
- import"./index-33skgk1a.js";
11
- import"./index-6r522srn.js";
10
+ import"./index-rs1f1bh0.js";
11
+ import"./index-h2waehqq.js";
12
12
  import"./index-ed5ykebp.js";
13
- import"./index-s0qc4gj6.js";
13
+ import"./index-hfvxhk4z.js";
14
14
  import"./index-7g4c7s5r.js";
15
15
  import"./index-4nt52yr9.js";
16
16
  import"./index-zgwm4ryv.js";
17
17
  import"./index-bk5tah7q.js";
18
- import"./index-rsrx77fg.js";
18
+ import"./index-ry0hgg3m.js";
19
19
  import"./index-bpmtbmy9.js";
20
20
  import"./index-a76rekgs.js";
21
21
  export {
@@ -96,8 +96,8 @@ import {
96
96
  resolveGeneratedAgentRole,
97
97
  resolveGuardrailsConfig,
98
98
  stripKnownSwarmPrefix
99
- } from "./index-5s23pfsy.js";
100
- import"./index-4wjk296r.js";
99
+ } from "./index-n3ppm2gt.js";
100
+ import"./index-r4t92q32.js";
101
101
  import"./index-zjygnfay.js";
102
102
  import"./index-bk5tah7q.js";
103
103
  import"./index-bpmtbmy9.js";
@@ -23,15 +23,15 @@ import {
23
23
  tombstoneScopeBinding,
24
24
  writeScopeBindingToDisk,
25
25
  writeScopeToDisk
26
- } from "./index-xmhhhjjw.js";
26
+ } from "./index-adyxbmt5.js";
27
27
  import"./index-556ja8an.js";
28
- import"./index-6rxgb5r9.js";
29
- import"./index-s0qc4gj6.js";
28
+ import"./index-kbfsp07d.js";
29
+ import"./index-hfvxhk4z.js";
30
30
  import"./index-7g4c7s5r.js";
31
31
  import"./index-4nt52yr9.js";
32
- import"./index-1kz6da87.js";
32
+ import"./index-d181x9zr.js";
33
33
  import"./index-zgwm4ryv.js";
34
- import"./index-rsrx77fg.js";
34
+ import"./index-ry0hgg3m.js";
35
35
  import"./index-bpmtbmy9.js";
36
36
  import"./index-a76rekgs.js";
37
37
  export {
@@ -33,23 +33,23 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-pg84msyc.js";
37
- import"./index-jnfyxeap.js";
38
- import"./index-5azdnaty.js";
36
+ } from "./index-3fscvmfw.js";
37
+ import"./index-8d2d7c6k.js";
38
+ import"./index-1tw24kcp.js";
39
39
  import"./index-rtry5xyf.js";
40
- import"./index-6vh6vrnk.js";
41
- import"./index-k41dn8me.js";
40
+ import"./index-m7xks4r4.js";
41
+ import"./index-68gh7p3t.js";
42
42
  import"./index-ae75rja9.js";
43
- import"./index-33skgk1a.js";
44
- import"./index-6r522srn.js";
43
+ import"./index-rs1f1bh0.js";
44
+ import"./index-h2waehqq.js";
45
45
  import"./index-ed5ykebp.js";
46
- import"./index-s0qc4gj6.js";
46
+ import"./index-hfvxhk4z.js";
47
47
  import"./index-7g4c7s5r.js";
48
48
  import"./index-4nt52yr9.js";
49
49
  import"./index-4rhhvd1a.js";
50
50
  import"./index-zgwm4ryv.js";
51
51
  import"./index-bk5tah7q.js";
52
- import"./index-rsrx77fg.js";
52
+ import"./index-ry0hgg3m.js";
53
53
  import"./index-bpmtbmy9.js";
54
54
  import"./index-a76rekgs.js";
55
55
  export {
@@ -13,7 +13,7 @@ import {
13
13
  startHeartbeatTracking,
14
14
  stopHeartbeatTracking,
15
15
  telemetry
16
- } from "./index-rsrx77fg.js";
16
+ } from "./index-ry0hgg3m.js";
17
17
  import"./index-bpmtbmy9.js";
18
18
  import"./index-a76rekgs.js";
19
19
  export {
@@ -10,18 +10,18 @@ import {
10
10
  import {
11
11
  scanDelegationFallbacksForRecovery,
12
12
  scanDelegationsForRecovery
13
- } from "./index-j77frjq8.js";
13
+ } from "./index-b9rd29ge.js";
14
14
  import"./index-k46me75h.js";
15
15
  import"./index-ee3x66a5.js";
16
16
  import"./index-ed5ykebp.js";
17
- import"./index-s0qc4gj6.js";
17
+ import"./index-hfvxhk4z.js";
18
18
  import"./index-7g4c7s5r.js";
19
19
  import {
20
20
  bunSpawn
21
21
  } from "./index-4nt52yr9.js";
22
22
  import"./index-zgwm4ryv.js";
23
23
  import"./index-zjygnfay.js";
24
- import"./index-rsrx77fg.js";
24
+ import"./index-ry0hgg3m.js";
25
25
  import"./index-bpmtbmy9.js";
26
26
  import"./index-a76rekgs.js";
27
27
 
@@ -5,6 +5,7 @@ export declare const ExecutionProfileSchema: z.ZodObject<{
5
5
  council_parallel: z.ZodDefault<z.ZodBoolean>;
6
6
  locked: z.ZodDefault<z.ZodBoolean>;
7
7
  auto_proceed: z.ZodDefault<z.ZodBoolean>;
8
+ commit_after_each_completed_task: z.ZodDefault<z.ZodBoolean>;
8
9
  }, z.core.$strip>;
9
10
  export type ExecutionProfile = z.infer<typeof ExecutionProfileSchema>;
10
11
  export declare const TaskStatusSchema: z.ZodEnum<{
@@ -171,6 +172,7 @@ export declare const PlanSchema: z.ZodObject<{
171
172
  council_parallel: z.ZodDefault<z.ZodBoolean>;
172
173
  locked: z.ZodDefault<z.ZodBoolean>;
173
174
  auto_proceed: z.ZodDefault<z.ZodBoolean>;
175
+ commit_after_each_completed_task: z.ZodDefault<z.ZodBoolean>;
174
176
  }, z.core.$strip>>;
175
177
  }, z.core.$strip>;
176
178
  export type Plan = z.infer<typeof PlanSchema>;
@@ -13,5 +13,5 @@
13
13
  */
14
14
  export { closeGlobalDb, getGlobalDb, runGlobalMigrations, } from './global-db.js';
15
15
  export { closeAllProjectDbs, closeProjectDb, getProjectDb, projectDbExists, projectDbPath, runProjectMigrations, } from './project-db.js';
16
- export { computeProfileHash, DEFAULT_QA_GATES, getEffectiveGates, getOrCreateProfile, getProfile, lockProfile, type QaGateProfile, type QaGates, setGates, } from './qa-gate-profile.js';
16
+ export { computeProfileHash, DEFAULT_QA_GATES, getEffectiveGates, getOrCreateProfile, getOrCreateProfileForIdentity, getProfile, getProfileForIdentity, getProfileLookupForIdentity, hasAnyProfileWithEnabledGate, lockProfile, lockProfileForIdentity, type QaGateProfile, type QaGateProfileIdentity, QaGateProfileIdentityUnboundError, type QaGateProfileLookupForIdentity, type QaGates, type SetGatesForIdentityOptions, setGates, setGatesForIdentity, } from './qa-gate-profile.js';
17
17
  export { loadDatabaseCtor } from './sqlite-loader.js';
@@ -14,12 +14,23 @@
14
14
  */
15
15
  export declare const _internals: {
16
16
  getProfile: typeof getProfile;
17
+ getProfileLookupForIdentity: typeof getProfileLookupForIdentity;
18
+ getProfileForIdentity: typeof getProfileForIdentity;
17
19
  getOrCreateProfile: typeof getOrCreateProfile;
20
+ getOrCreateProfileForIdentity: typeof getOrCreateProfileForIdentity;
18
21
  setGates: typeof setGates;
22
+ setGatesForIdentity: typeof setGatesForIdentity;
23
+ lockProfileForIdentity: typeof lockProfileForIdentity;
19
24
  getEffectiveGates: typeof getEffectiveGates;
20
25
  computeProfileHash: typeof computeProfileHash;
21
26
  hasAnyProfileWithEnabledGate: typeof hasAnyProfileWithEnabledGate;
22
27
  afterSetGatesRead: (profile: QaGateProfile) => void;
28
+ afterSetGatesForIdentityRead?: ((context: {
29
+ directory: string;
30
+ identity: QaGateProfileIdentity;
31
+ profileId: number;
32
+ storagePlanId: string;
33
+ }) => void) | undefined;
23
34
  };
24
35
  /**
25
36
  * QA gate flags. All eleven gates are tracked explicitly.
@@ -52,6 +63,40 @@ export interface QaGateProfile {
52
63
  gates: QaGates;
53
64
  locked_at: string | null;
54
65
  locked_by_snapshot_seq: number | null;
66
+ raw_swarm: string | null;
67
+ raw_title: string | null;
68
+ identity_hash: string | null;
69
+ }
70
+ export interface QaGateProfileIdentity {
71
+ swarm: string;
72
+ title: string;
73
+ planId: string;
74
+ identityHash: string;
75
+ }
76
+ export type QaGateProfileLookupForIdentity = {
77
+ kind: 'bound';
78
+ identity: QaGateProfileIdentity;
79
+ profile: QaGateProfile;
80
+ } | {
81
+ kind: 'unbound_legacy';
82
+ identity: QaGateProfileIdentity;
83
+ profile: QaGateProfile;
84
+ } | {
85
+ kind: 'missing';
86
+ identity: QaGateProfileIdentity;
87
+ };
88
+ export interface SetGatesForIdentityOptions {
89
+ projectType?: string;
90
+ allowLegacyAdoption?: boolean;
91
+ allowLegacyCollisionCreate?: boolean;
92
+ legacyAdoptionIdentity?: {
93
+ swarm: string;
94
+ title: string;
95
+ };
96
+ }
97
+ export declare class QaGateProfileIdentityUnboundError extends Error {
98
+ readonly identity: QaGateProfileIdentity;
99
+ constructor(identity: QaGateProfileIdentity);
55
100
  }
56
101
  /**
57
102
  * Fetch the profile for `planId` or return null if none exists.
@@ -64,6 +109,23 @@ export interface QaGateProfile {
64
109
  * `lockProfile`) continue to initialize the DB on demand.
65
110
  */
66
111
  export declare function getProfile(directory: string, planId: string): QaGateProfile | null;
112
+ /**
113
+ * Fetch the profile bound to an exact raw swarm/title pair.
114
+ *
115
+ * New profiles persist a collision-resistant identity hash plus the exact raw
116
+ * strings. Legacy rows created before those columns existed fall back to the
117
+ * readable plan_id only, preserving backward compatibility without allowing a
118
+ * bound exact identity to be mistaken for a different raw pair that sanitizes
119
+ * to the same legacy plan_id.
120
+ */
121
+ export declare function getProfileForIdentity(directory: string, identity: {
122
+ swarm: string;
123
+ title: string;
124
+ }): QaGateProfile | null;
125
+ export declare function getProfileLookupForIdentity(directory: string, identity: {
126
+ swarm: string;
127
+ title: string;
128
+ }): QaGateProfileLookupForIdentity;
67
129
  /**
68
130
  * Return true if any existing QA gate profile has `gate` enabled.
69
131
  *
@@ -74,8 +136,9 @@ export declare function getProfile(directory: string, planId: string): QaGatePro
74
136
  */
75
137
  export declare function hasAnyProfileWithEnabledGate(directory: string, gate: keyof QaGates): boolean;
76
138
  /**
77
- * Return the existing profile for `planId`, or create a new one seeded with
78
- * `DEFAULT_QA_GATES` plus the caller's initial gate selection if none exists.
139
+ * Return the existing profile for `planId`, or atomically create one seeded
140
+ * with `DEFAULT_QA_GATES` plus the caller's initial gate selection if none
141
+ * exists.
79
142
  *
80
143
  * `initialGates` is applied only by the winning INSERT. A caller that loses a
81
144
  * UNIQUE-index race receives the winner's profile unchanged and must still run
@@ -84,17 +147,38 @@ export declare function hasAnyProfileWithEnabledGate(directory: string, gate: ke
84
147
  * a way to loosen an already-persisted `true` gate.
85
148
  */
86
149
  export declare function getOrCreateProfile(directory: string, planId: string, projectType?: string, initialGates?: Partial<QaGates>): QaGateProfile;
150
+ /**
151
+ * Return the existing exact-identity profile, or atomically create one seeded
152
+ * with the exact raw swarm/title binding plus the initial gate selection.
153
+ *
154
+ * An unbound legacy row cannot prove which raw identity originally owned its
155
+ * readable plan_id. This create-only API therefore never adopts that row: it
156
+ * creates a collision-resistant `qa2-<identity-hash>` profile for the exact
157
+ * identity and leaves explicit legacy adoption to `setGatesForIdentity`.
158
+ */
159
+ export declare function getOrCreateProfileForIdentity(directory: string, identity: {
160
+ swarm: string;
161
+ title: string;
162
+ }, projectType?: string, initialGates?: Partial<QaGates>): QaGateProfile;
87
163
  /**
88
164
  * Update gates for `planId`. Gates can only be ratcheted tighter —
89
165
  * attempting to disable a currently-enabled gate throws. Throws if the
90
166
  * profile is locked.
91
167
  */
92
168
  export declare function setGates(directory: string, planId: string, gates: Partial<QaGates>): QaGateProfile;
169
+ export declare function setGatesForIdentity(directory: string, identity: {
170
+ swarm: string;
171
+ title: string;
172
+ }, gates: Partial<QaGates>, options?: SetGatesForIdentityOptions): QaGateProfile;
93
173
  /**
94
174
  * Lock the profile for `planId`, recording the snapshot seq that anchors it.
95
175
  * Idempotent: locking an already-locked profile returns it unchanged.
96
176
  */
97
177
  export declare function lockProfile(directory: string, planId: string, snapshotSeq: number): QaGateProfile;
178
+ export declare function lockProfileForIdentity(directory: string, identity: {
179
+ swarm: string;
180
+ title: string;
181
+ }, snapshotSeq: number): QaGateProfile;
98
182
  /**
99
183
  * Compute a SHA-256 hex digest over the stable identity of a profile.
100
184
  * Used by `get_approved_plan` for drift detection.
@@ -0,0 +1,27 @@
1
+ export type TaskCheckpointReceiptState = 'pending' | 'committed' | 'logged';
2
+ export interface TaskCheckpointReceiptRow {
3
+ plan_identity_hash: string;
4
+ task_id: string;
5
+ label: string;
6
+ state: TaskCheckpointReceiptState;
7
+ sha: string | null;
8
+ generation: number;
9
+ completion_active: number;
10
+ completion_ledger_seq: number | null;
11
+ created_at: string;
12
+ updated_at: string;
13
+ }
14
+ export interface TaskCompletionCheckpointDescriptor {
15
+ planIdentityHash: string;
16
+ taskId: string;
17
+ generation: number;
18
+ label: string;
19
+ subject: string;
20
+ }
21
+ export declare function buildTaskCompletionDescriptor(planIdentityHash: string, taskId: string, generation: number): TaskCompletionCheckpointDescriptor;
22
+ export declare function readTaskCheckpointReceipt(directory: string, planIdentityHash: string, taskId: string): TaskCheckpointReceiptRow | null;
23
+ export declare function ensureTaskCheckpointReceipt(directory: string, planIdentityHash: string, taskId: string, completionLedgerSeq: number): TaskCheckpointReceiptRow;
24
+ export declare function activateTaskCheckpointReceipt(directory: string, planIdentityHash: string, taskId: string): TaskCheckpointReceiptRow | null;
25
+ export declare function advanceTaskCheckpointReceiptGeneration(directory: string, planIdentityHash: string, taskId: string): TaskCheckpointReceiptRow | null;
26
+ export declare function repairTaskCheckpointReceiptForCompletion(directory: string, planIdentityHash: string, taskId: string): TaskCheckpointReceiptRow | null;
27
+ export declare function updateTaskCheckpointReceipt(directory: string, descriptor: TaskCompletionCheckpointDescriptor, state: TaskCheckpointReceiptState, sha: string | null): TaskCheckpointReceiptRow;