@knpkv/herdr-work 0.5.3 → 0.7.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 (55) hide show
  1. package/README.md +103 -0
  2. package/dist/display-state.d.ts +10 -0
  3. package/dist/display-state.d.ts.map +1 -0
  4. package/dist/display-state.js +5 -0
  5. package/dist/display-state.js.map +1 -0
  6. package/dist/errors.d.ts +21 -0
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +12 -0
  9. package/dist/errors.js.map +1 -1
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +1 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/internal/legacy-lane-claim.d.ts +74 -0
  15. package/dist/internal/legacy-lane-claim.d.ts.map +1 -0
  16. package/dist/internal/legacy-lane-claim.js +81 -0
  17. package/dist/internal/legacy-lane-claim.js.map +1 -0
  18. package/dist/internal/session-index.d.ts +18 -0
  19. package/dist/internal/session-index.d.ts.map +1 -0
  20. package/dist/internal/session-index.js +23 -0
  21. package/dist/internal/session-index.js.map +1 -0
  22. package/dist/internal/terminal-reconcile.d.ts +31 -0
  23. package/dist/internal/terminal-reconcile.d.ts.map +1 -0
  24. package/dist/internal/terminal-reconcile.js +89 -0
  25. package/dist/internal/terminal-reconcile.js.map +1 -0
  26. package/dist/model.d.ts +939 -29
  27. package/dist/model.d.ts.map +1 -1
  28. package/dist/model.js +256 -7
  29. package/dist/model.js.map +1 -1
  30. package/dist/observed.d.ts +77 -0
  31. package/dist/observed.d.ts.map +1 -0
  32. package/dist/observed.js +240 -0
  33. package/dist/observed.js.map +1 -0
  34. package/dist/projection.d.ts +192 -12
  35. package/dist/projection.d.ts.map +1 -1
  36. package/dist/service.d.ts +121 -992
  37. package/dist/service.d.ts.map +1 -1
  38. package/dist/service.js +13 -3
  39. package/dist/service.js.map +1 -1
  40. package/dist/sql.d.ts.map +1 -1
  41. package/dist/sql.js +76 -3
  42. package/dist/sql.js.map +1 -1
  43. package/dist/store.d.ts +193 -11
  44. package/dist/store.d.ts.map +1 -1
  45. package/dist/store.js +768 -37
  46. package/dist/store.js.map +1 -1
  47. package/dist/view.d.ts.map +1 -1
  48. package/dist/view.js +169 -103
  49. package/dist/view.js.map +1 -1
  50. package/dist/work-triage.d.ts +72 -0
  51. package/dist/work-triage.d.ts.map +1 -0
  52. package/dist/work-triage.js +114 -0
  53. package/dist/work-triage.js.map +1 -0
  54. package/package.json +3 -3
  55. package/src/styles.css +229 -237
package/dist/model.d.ts CHANGED
@@ -9,8 +9,10 @@ export declare const WorkLaneOperationId: Schema.String;
9
9
  export type WorkLaneOperationId = typeof WorkLaneOperationId.Type;
10
10
  export declare const WorkCoordinatorSessionId: Schema.String;
11
11
  export type WorkCoordinatorSessionId = typeof WorkCoordinatorSessionId.Type;
12
- export declare const WorkState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
12
+ export declare const WorkState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
13
13
  export type WorkState = typeof WorkState.Type;
14
+ /** A goal in one of these states is finished: nothing may bind to it, link it, or move it back. */
15
+ export declare const isTerminalWorkState: (state: WorkState) => boolean;
14
16
  export declare const DeliveryStage: Schema.Literals<readonly ["local", "review", "pull_request", "merged", "deployed"]>;
15
17
  export type DeliveryStage = typeof DeliveryStage.Type;
16
18
  export declare const WorkOwner: Schema.Struct<{
@@ -110,7 +112,7 @@ export declare const WorkGoal: Schema.Struct<{
110
112
  readonly title: Schema.String;
111
113
  readonly summary: Schema.String;
112
114
  readonly detail: Schema.String;
113
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
115
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
114
116
  readonly owner: Schema.Struct<{
115
117
  readonly id: Schema.String;
116
118
  readonly name: Schema.String;
@@ -193,7 +195,7 @@ export declare const WorkGoalFamilyGroup: Schema.Struct<{
193
195
  readonly title: Schema.String;
194
196
  readonly summary: Schema.String;
195
197
  readonly detail: Schema.String;
196
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
198
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
197
199
  readonly owner: Schema.Struct<{
198
200
  readonly id: Schema.String;
199
201
  readonly name: Schema.String;
@@ -272,7 +274,7 @@ export declare const WorkGoalFamilyGroup: Schema.Struct<{
272
274
  readonly title: Schema.String;
273
275
  readonly summary: Schema.String;
274
276
  readonly detail: Schema.String;
275
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
277
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
276
278
  readonly owner: Schema.Struct<{
277
279
  readonly id: Schema.String;
278
280
  readonly name: Schema.String;
@@ -358,7 +360,7 @@ export declare const WorkGoalCheckpoint: Schema.Struct<{
358
360
  readonly title: Schema.String;
359
361
  readonly summary: Schema.String;
360
362
  readonly detail: Schema.String;
361
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
363
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
362
364
  readonly owner: Schema.Struct<{
363
365
  readonly id: Schema.String;
364
366
  readonly name: Schema.String;
@@ -563,6 +565,19 @@ export declare const WorkAgentBindingRequest: Schema.Struct<{
563
565
  readonly approvalJobId: Schema.String;
564
566
  readonly approvalActor: Schema.String;
565
567
  }>>;
568
+ /**
569
+ * Set when the reconciler admitted an observed worker without an approval:
570
+ * the same evidence as a prospective admission, credited to the observation
571
+ * that showed it.
572
+ */
573
+ readonly observedAdmission: Schema.optionalKey<Schema.Struct<{
574
+ readonly sessionId: Schema.String;
575
+ readonly workAssignment: Schema.String;
576
+ readonly baseHead: Schema.String;
577
+ readonly expectedAbsenceToken: Schema.String;
578
+ readonly actor: Schema.Literal<"reconciler">;
579
+ readonly observationId: Schema.String;
580
+ }>>;
566
581
  readonly existingGoalRecovery: Schema.optionalKey<Schema.Struct<{
567
582
  readonly sessionId: Schema.String;
568
583
  readonly workAssignment: Schema.String;
@@ -588,6 +603,12 @@ export declare const WorkAgentBindingRequest: Schema.Struct<{
588
603
  }>;
589
604
  export interface WorkAgentBindingRequest extends Schema.Schema.Type<typeof WorkAgentBindingRequest> {
590
605
  }
606
+ /**
607
+ * The admission evidence a binding was created with, whether an approved job
608
+ * (`prospectiveAdmission`) or the reconciler (`observedAdmission`) admitted it.
609
+ * Session, assignment and base-head checks read it so both kinds behave alike.
610
+ */
611
+ export declare const admissionEvidence: (request: WorkAgentBindingRequest) => WorkAgentBindingRequest["prospectiveAdmission"] | WorkAgentBindingRequest["observedAdmission"];
591
612
  /** Durable result of atomically binding a started worker to its Work goal. */
592
613
  export declare const WorkAgentBinding: Schema.Struct<{
593
614
  readonly version: Schema.Literal<"herdr.work.agent-binding.v1">;
@@ -614,6 +635,19 @@ export declare const WorkAgentBinding: Schema.Struct<{
614
635
  readonly approvalJobId: Schema.String;
615
636
  readonly approvalActor: Schema.String;
616
637
  }>>;
638
+ /**
639
+ * Set when the reconciler admitted an observed worker without an approval:
640
+ * the same evidence as a prospective admission, credited to the observation
641
+ * that showed it.
642
+ */
643
+ readonly observedAdmission: Schema.optionalKey<Schema.Struct<{
644
+ readonly sessionId: Schema.String;
645
+ readonly workAssignment: Schema.String;
646
+ readonly baseHead: Schema.String;
647
+ readonly expectedAbsenceToken: Schema.String;
648
+ readonly actor: Schema.Literal<"reconciler">;
649
+ readonly observationId: Schema.String;
650
+ }>>;
617
651
  readonly existingGoalRecovery: Schema.optionalKey<Schema.Struct<{
618
652
  readonly sessionId: Schema.String;
619
653
  readonly workAssignment: Schema.String;
@@ -684,7 +718,7 @@ export declare const WorkAgentBinding: Schema.Struct<{
684
718
  readonly title: Schema.String;
685
719
  readonly summary: Schema.String;
686
720
  readonly detail: Schema.String;
687
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
721
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
688
722
  readonly owner: Schema.Struct<{
689
723
  readonly id: Schema.String;
690
724
  readonly name: Schema.String;
@@ -784,7 +818,7 @@ export declare const WorkPullRequestLink: Schema.Struct<{
784
818
  readonly title: Schema.String;
785
819
  readonly summary: Schema.String;
786
820
  readonly detail: Schema.String;
787
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
821
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
788
822
  readonly owner: Schema.Struct<{
789
823
  readonly id: Schema.String;
790
824
  readonly name: Schema.String;
@@ -921,6 +955,19 @@ export declare const WorkPullRequestLink: Schema.Struct<{
921
955
  readonly approvalJobId: Schema.String;
922
956
  readonly approvalActor: Schema.String;
923
957
  }>>;
958
+ /**
959
+ * Set when the reconciler admitted an observed worker without an approval:
960
+ * the same evidence as a prospective admission, credited to the observation
961
+ * that showed it.
962
+ */
963
+ readonly observedAdmission: Schema.optionalKey<Schema.Struct<{
964
+ readonly sessionId: Schema.String;
965
+ readonly workAssignment: Schema.String;
966
+ readonly baseHead: Schema.String;
967
+ readonly expectedAbsenceToken: Schema.String;
968
+ readonly actor: Schema.Literal<"reconciler">;
969
+ readonly observationId: Schema.String;
970
+ }>>;
924
971
  readonly existingGoalRecovery: Schema.optionalKey<Schema.Struct<{
925
972
  readonly sessionId: Schema.String;
926
973
  readonly workAssignment: Schema.String;
@@ -991,7 +1038,7 @@ export declare const WorkPullRequestLink: Schema.Struct<{
991
1038
  readonly title: Schema.String;
992
1039
  readonly summary: Schema.String;
993
1040
  readonly detail: Schema.String;
994
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
1041
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
995
1042
  readonly owner: Schema.Struct<{
996
1043
  readonly id: Schema.String;
997
1044
  readonly name: Schema.String;
@@ -1204,7 +1251,7 @@ export declare const WorkAdmissionPreflight: Schema.TaggedUnion<{
1204
1251
  readonly title: Schema.String;
1205
1252
  readonly summary: Schema.String;
1206
1253
  readonly detail: Schema.String;
1207
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
1254
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
1208
1255
  readonly owner: Schema.Struct<{
1209
1256
  readonly id: Schema.String;
1210
1257
  readonly name: Schema.String;
@@ -1341,6 +1388,19 @@ export declare const WorkAdmissionPreflight: Schema.TaggedUnion<{
1341
1388
  readonly approvalJobId: Schema.String;
1342
1389
  readonly approvalActor: Schema.String;
1343
1390
  }>>;
1391
+ /**
1392
+ * Set when the reconciler admitted an observed worker without an approval:
1393
+ * the same evidence as a prospective admission, credited to the observation
1394
+ * that showed it.
1395
+ */
1396
+ readonly observedAdmission: Schema.optionalKey<Schema.Struct<{
1397
+ readonly sessionId: Schema.String;
1398
+ readonly workAssignment: Schema.String;
1399
+ readonly baseHead: Schema.String;
1400
+ readonly expectedAbsenceToken: Schema.String;
1401
+ readonly actor: Schema.Literal<"reconciler">;
1402
+ readonly observationId: Schema.String;
1403
+ }>>;
1344
1404
  readonly existingGoalRecovery: Schema.optionalKey<Schema.Struct<{
1345
1405
  readonly sessionId: Schema.String;
1346
1406
  readonly workAssignment: Schema.String;
@@ -1411,7 +1471,7 @@ export declare const WorkAdmissionPreflight: Schema.TaggedUnion<{
1411
1471
  readonly title: Schema.String;
1412
1472
  readonly summary: Schema.String;
1413
1473
  readonly detail: Schema.String;
1414
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
1474
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
1415
1475
  readonly owner: Schema.Struct<{
1416
1476
  readonly id: Schema.String;
1417
1477
  readonly name: Schema.String;
@@ -1558,6 +1618,48 @@ export declare const WorkProspectiveAdmission: Schema.Struct<{
1558
1618
  readonly approvalActor: Schema.String;
1559
1619
  }>;
1560
1620
  export type WorkProspectiveAdmission = typeof WorkProspectiveAdmission.Type;
1621
+ /**
1622
+ * An admission the reconciler makes without an approval, for a worker it
1623
+ * observed: the same fields as an approved admission, with the observation in
1624
+ * place of the job. The caller (hostd) has already checked what the store can't
1625
+ * see: the pane is on this host with lineage, and its worktree is the canonical
1626
+ * toplevel on the PR branch at the PR head with an origin equal to the PR's
1627
+ * repository. The store re-checks the absence evidence in its transaction.
1628
+ */
1629
+ export declare const WorkObservedAdmission: Schema.Struct<{
1630
+ readonly repository: Schema.String;
1631
+ readonly pullRequest: Schema.Number;
1632
+ readonly reviewUrl: Schema.String;
1633
+ readonly goalId: Schema.String;
1634
+ readonly laneId: Schema.String;
1635
+ readonly operationId: Schema.String;
1636
+ readonly expectedAbsenceToken: Schema.String;
1637
+ readonly head: Schema.String;
1638
+ readonly baseHead: Schema.String;
1639
+ readonly owner: Schema.Struct<{
1640
+ readonly id: Schema.String;
1641
+ readonly name: Schema.String;
1642
+ }>;
1643
+ readonly sessionId: Schema.String;
1644
+ readonly expectedWork: Schema.String;
1645
+ readonly worker: Schema.Struct<{
1646
+ readonly host: Schema.String;
1647
+ readonly agentId: Schema.String;
1648
+ readonly name: Schema.String;
1649
+ readonly paneId: Schema.String;
1650
+ readonly relationship: Schema.optionalKey<Schema.Struct<{
1651
+ readonly parentAgentId: Schema.String;
1652
+ readonly relation: Schema.Literals<readonly ["delegated", "pair", "review"]>;
1653
+ }>>;
1654
+ }>;
1655
+ readonly worktree: Schema.String;
1656
+ readonly branch: Schema.String;
1657
+ readonly title: Schema.String;
1658
+ readonly summary: Schema.String;
1659
+ readonly detail: Schema.String;
1660
+ readonly observationId: Schema.String;
1661
+ }>;
1662
+ export type WorkObservedAdmission = typeof WorkObservedAdmission.Type;
1561
1663
  /** Read-only evidence for a genuine, existing unlinked canonical goal. */
1562
1664
  export declare const WorkRecoveryTarget: Schema.Struct<{
1563
1665
  readonly repository: Schema.String;
@@ -1673,7 +1775,7 @@ export declare const WorkRecoveryPreflight: Schema.TaggedUnion<{
1673
1775
  readonly title: Schema.String;
1674
1776
  readonly summary: Schema.String;
1675
1777
  readonly detail: Schema.String;
1676
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
1778
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
1677
1779
  readonly owner: Schema.Struct<{
1678
1780
  readonly id: Schema.String;
1679
1781
  readonly name: Schema.String;
@@ -1810,6 +1912,19 @@ export declare const WorkRecoveryPreflight: Schema.TaggedUnion<{
1810
1912
  readonly approvalJobId: Schema.String;
1811
1913
  readonly approvalActor: Schema.String;
1812
1914
  }>>;
1915
+ /**
1916
+ * Set when the reconciler admitted an observed worker without an approval:
1917
+ * the same evidence as a prospective admission, credited to the observation
1918
+ * that showed it.
1919
+ */
1920
+ readonly observedAdmission: Schema.optionalKey<Schema.Struct<{
1921
+ readonly sessionId: Schema.String;
1922
+ readonly workAssignment: Schema.String;
1923
+ readonly baseHead: Schema.String;
1924
+ readonly expectedAbsenceToken: Schema.String;
1925
+ readonly actor: Schema.Literal<"reconciler">;
1926
+ readonly observationId: Schema.String;
1927
+ }>>;
1813
1928
  readonly existingGoalRecovery: Schema.optionalKey<Schema.Struct<{
1814
1929
  readonly sessionId: Schema.String;
1815
1930
  readonly workAssignment: Schema.String;
@@ -1880,7 +1995,7 @@ export declare const WorkRecoveryPreflight: Schema.TaggedUnion<{
1880
1995
  readonly title: Schema.String;
1881
1996
  readonly summary: Schema.String;
1882
1997
  readonly detail: Schema.String;
1883
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
1998
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
1884
1999
  readonly owner: Schema.Struct<{
1885
2000
  readonly id: Schema.String;
1886
2001
  readonly name: Schema.String;
@@ -2032,6 +2147,129 @@ export declare const WorkExistingGoalRecovery: Schema.Struct<{
2032
2147
  }>;
2033
2148
  export type WorkExistingGoalRecovery = typeof WorkExistingGoalRecovery.Type;
2034
2149
  /** The approved Fleet job supplies actor, job identity, and immutable hash. */
2150
+ /** An approved `work.abandon` job, with the approval the Fleet service persisted. */
2151
+ export declare const WorkGoalAbandonment: Schema.Struct<{
2152
+ readonly kind: Schema.Literal<"work.abandon">;
2153
+ readonly goalId: Schema.String;
2154
+ readonly owner: Schema.Struct<{
2155
+ readonly id: Schema.String;
2156
+ readonly name: Schema.String;
2157
+ }>;
2158
+ readonly reason: Schema.String;
2159
+ readonly expectedGoalEventId: Schema.String;
2160
+ readonly expectedGoalUpdatedAt: Schema.Number;
2161
+ readonly approvalJobId: Schema.String;
2162
+ readonly approvalActor: Schema.String;
2163
+ readonly approvalApprovedBy: Schema.String;
2164
+ readonly approvalApprovedAt: Schema.Number;
2165
+ readonly approvalHash: Schema.String;
2166
+ }>;
2167
+ export type WorkGoalAbandonment = typeof WorkGoalAbandonment.Type;
2168
+ /** Durable result of one abandonment: its checkpoint, identified by the approval job id. */
2169
+ export declare const WorkGoalAbandoned: Schema.Struct<{
2170
+ readonly abandonment: Schema.Struct<{
2171
+ readonly kind: Schema.Literal<"work.abandon">;
2172
+ readonly goalId: Schema.String;
2173
+ readonly owner: Schema.Struct<{
2174
+ readonly id: Schema.String;
2175
+ readonly name: Schema.String;
2176
+ }>;
2177
+ readonly reason: Schema.String;
2178
+ readonly expectedGoalEventId: Schema.String;
2179
+ readonly expectedGoalUpdatedAt: Schema.Number;
2180
+ readonly approvalJobId: Schema.String;
2181
+ readonly approvalActor: Schema.String;
2182
+ readonly approvalApprovedBy: Schema.String;
2183
+ readonly approvalApprovedAt: Schema.Number;
2184
+ readonly approvalHash: Schema.String;
2185
+ }>;
2186
+ readonly checkpoint: Schema.Struct<{
2187
+ readonly version: Schema.Literal<"herdr.work.event.v1">;
2188
+ readonly eventId: Schema.String;
2189
+ readonly occurredAt: Schema.Number;
2190
+ readonly goal: Schema.Struct<{
2191
+ readonly id: Schema.String;
2192
+ readonly title: Schema.String;
2193
+ readonly summary: Schema.String;
2194
+ readonly detail: Schema.String;
2195
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2196
+ readonly owner: Schema.Struct<{
2197
+ readonly id: Schema.String;
2198
+ readonly name: Schema.String;
2199
+ }>;
2200
+ readonly repository: Schema.Struct<{
2201
+ readonly repository: Schema.String;
2202
+ readonly branch: Schema.String;
2203
+ }>;
2204
+ readonly spend: Schema.NullOr<Schema.Struct<{
2205
+ readonly currency: Schema.String;
2206
+ readonly minorUnits: Schema.Number;
2207
+ }>>;
2208
+ readonly delivery: Schema.Literals<readonly ["local", "review", "pull_request", "merged", "deployed"]>;
2209
+ readonly blocker: Schema.NullOr<Schema.Struct<{
2210
+ readonly summary: Schema.String;
2211
+ readonly since: Schema.Number;
2212
+ }>>;
2213
+ readonly connectTarget: Schema.NullOr<Schema.Struct<{
2214
+ readonly host: Schema.String;
2215
+ readonly agentId: Schema.String;
2216
+ readonly url: Schema.String;
2217
+ }>>;
2218
+ readonly goalFamily: Schema.optionalKey<Schema.Struct<{
2219
+ readonly canonicalGoalId: Schema.String;
2220
+ readonly role: Schema.Literals<readonly ["canonical", "superseded"]>;
2221
+ }>>;
2222
+ readonly agentHierarchy: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
2223
+ readonly agent: Schema.Struct<{
2224
+ readonly host: Schema.String;
2225
+ readonly agentId: Schema.String;
2226
+ readonly name: Schema.String;
2227
+ readonly paneId: Schema.String;
2228
+ readonly relationship: Schema.optionalKey<Schema.Struct<{
2229
+ readonly parentAgentId: Schema.String;
2230
+ readonly relation: Schema.Literals<readonly ["delegated", "pair", "review"]>;
2231
+ }>>;
2232
+ }>;
2233
+ }>>>;
2234
+ readonly activity: Schema.optionalKey<Schema.$Array<Schema.Struct<{
2235
+ readonly id: Schema.String;
2236
+ readonly kind: Schema.Literals<readonly ["note", "status", "blocker", "request", "review", "shipment"]>;
2237
+ readonly summary: Schema.String;
2238
+ readonly occurredAt: Schema.Number;
2239
+ }>>>;
2240
+ readonly blockers: Schema.optionalKey<Schema.$Array<Schema.Struct<{
2241
+ readonly summary: Schema.String;
2242
+ readonly since: Schema.Number;
2243
+ }>>>;
2244
+ readonly requests: Schema.optionalKey<Schema.$Array<Schema.Struct<{
2245
+ readonly id: Schema.String;
2246
+ readonly summary: Schema.String;
2247
+ readonly state: Schema.Literals<readonly ["open", "approved", "rejected", "fulfilled"]>;
2248
+ readonly requestedAt: Schema.Number;
2249
+ readonly approvalTarget: Schema.NullOr<Schema.Struct<{
2250
+ readonly host: Schema.String;
2251
+ readonly jobId: Schema.String;
2252
+ readonly url: Schema.String;
2253
+ }>>;
2254
+ }>>>;
2255
+ readonly review: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
2256
+ readonly state: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
2257
+ readonly summary: Schema.NullOr<Schema.String>;
2258
+ readonly updatedAt: Schema.Number;
2259
+ readonly url: Schema.NullOr<Schema.String>;
2260
+ }>>>;
2261
+ readonly approvalTarget: Schema.optionalKey<Schema.NullOr<Schema.Struct<{
2262
+ readonly host: Schema.String;
2263
+ readonly jobId: Schema.String;
2264
+ readonly url: Schema.String;
2265
+ }>>>;
2266
+ readonly createdAt: Schema.Number;
2267
+ readonly updatedAt: Schema.Number;
2268
+ }>;
2269
+ }>;
2270
+ }>;
2271
+ export interface WorkGoalAbandoned extends Schema.Schema.Type<typeof WorkGoalAbandoned> {
2272
+ }
2035
2273
  export declare const WorkGoalReassignment: Schema.Struct<{
2036
2274
  readonly kind: Schema.Literal<"work.reassign">;
2037
2275
  readonly goalId: Schema.String;
@@ -2121,7 +2359,7 @@ export declare const WorkGoalReassigned: Schema.Struct<{
2121
2359
  readonly title: Schema.String;
2122
2360
  readonly summary: Schema.String;
2123
2361
  readonly detail: Schema.String;
2124
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
2362
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2125
2363
  readonly owner: Schema.Struct<{
2126
2364
  readonly id: Schema.String;
2127
2365
  readonly name: Schema.String;
@@ -2259,6 +2497,19 @@ export declare const WorkGoalReassigned: Schema.Struct<{
2259
2497
  readonly approvalJobId: Schema.String;
2260
2498
  readonly approvalActor: Schema.String;
2261
2499
  }>>;
2500
+ /**
2501
+ * Set when the reconciler admitted an observed worker without an approval:
2502
+ * the same evidence as a prospective admission, credited to the observation
2503
+ * that showed it.
2504
+ */
2505
+ readonly observedAdmission: Schema.optionalKey<Schema.Struct<{
2506
+ readonly sessionId: Schema.String;
2507
+ readonly workAssignment: Schema.String;
2508
+ readonly baseHead: Schema.String;
2509
+ readonly expectedAbsenceToken: Schema.String;
2510
+ readonly actor: Schema.Literal<"reconciler">;
2511
+ readonly observationId: Schema.String;
2512
+ }>>;
2262
2513
  readonly existingGoalRecovery: Schema.optionalKey<Schema.Struct<{
2263
2514
  readonly sessionId: Schema.String;
2264
2515
  readonly workAssignment: Schema.String;
@@ -2329,7 +2580,7 @@ export declare const WorkGoalReassigned: Schema.Struct<{
2329
2580
  readonly title: Schema.String;
2330
2581
  readonly summary: Schema.String;
2331
2582
  readonly detail: Schema.String;
2332
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
2583
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2333
2584
  readonly owner: Schema.Struct<{
2334
2585
  readonly id: Schema.String;
2335
2586
  readonly name: Schema.String;
@@ -2485,6 +2736,335 @@ export declare const WorkDispatchHandoff: Schema.Struct<{
2485
2736
  }>;
2486
2737
  export interface WorkDispatchHandoff extends Schema.Schema.Type<typeof WorkDispatchHandoff> {
2487
2738
  }
2739
+ /**
2740
+ * The key one subject's facts and failures are stored under, such as
2741
+ * `github:<owner>/<repo>#<n>` or `herdr:<host>/<agentId>`. Composite, so it is
2742
+ * bounded on its own rather than by `Identifier`.
2743
+ */
2744
+ export declare const WorkObservationSubject: Schema.String;
2745
+ /** CI status of a pull request's head, rolled up from its check runs and statuses. */
2746
+ export declare const WorkObservedChecks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
2747
+ export type WorkObservedChecks = typeof WorkObservedChecks.Type;
2748
+ /** A pull request as GitHub reported it. Facts only; never approval to act on it. */
2749
+ export declare const WorkPullRequestObservation: Schema.Struct<{
2750
+ readonly _tag: Schema.tag<"pull_request">;
2751
+ readonly repository: Schema.String;
2752
+ readonly pullRequest: Schema.Number;
2753
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
2754
+ readonly branch: Schema.String;
2755
+ readonly head: Schema.String;
2756
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
2757
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
2758
+ readonly closedAt: Schema.NullOr<Schema.Number>;
2759
+ }>;
2760
+ export interface WorkPullRequestObservation extends Schema.Schema.Type<typeof WorkPullRequestObservation> {
2761
+ }
2762
+ /** An agent pane as Herdr reported it; `gone` means the pane is no longer in the host's snapshot. */
2763
+ export declare const WorkAgentObservation: Schema.TaggedStruct<"agent", {
2764
+ readonly host: Schema.String;
2765
+ readonly agentId: Schema.String;
2766
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
2767
+ }>;
2768
+ export interface WorkAgentObservation extends Schema.Schema.Type<typeof WorkAgentObservation> {
2769
+ }
2770
+ /** A source that could not be read. It is reported, never turned into a fact about a goal. */
2771
+ export declare const WorkUnknownObservation: Schema.TaggedStruct<"unknown", {
2772
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
2773
+ readonly subject: Schema.String;
2774
+ readonly reason: Schema.String;
2775
+ }>;
2776
+ export interface WorkUnknownObservation extends Schema.Schema.Type<typeof WorkUnknownObservation> {
2777
+ }
2778
+ export declare const WorkObservation: Schema.Union<readonly [Schema.Struct<{
2779
+ readonly _tag: Schema.tag<"pull_request">;
2780
+ readonly repository: Schema.String;
2781
+ readonly pullRequest: Schema.Number;
2782
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
2783
+ readonly branch: Schema.String;
2784
+ readonly head: Schema.String;
2785
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
2786
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
2787
+ readonly closedAt: Schema.NullOr<Schema.Number>;
2788
+ }>, Schema.TaggedStruct<"agent", {
2789
+ readonly host: Schema.String;
2790
+ readonly agentId: Schema.String;
2791
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
2792
+ }>, Schema.TaggedStruct<"unknown", {
2793
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
2794
+ readonly subject: Schema.String;
2795
+ readonly reason: Schema.String;
2796
+ }>]>;
2797
+ export type WorkObservation = typeof WorkObservation.Type;
2798
+ /** One observation and when it was made. Observing the same facts again is a no-op. */
2799
+ export declare const WorkObservationEnvelope: Schema.Struct<{
2800
+ readonly observation: Schema.Union<readonly [Schema.Struct<{
2801
+ readonly _tag: Schema.tag<"pull_request">;
2802
+ readonly repository: Schema.String;
2803
+ readonly pullRequest: Schema.Number;
2804
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
2805
+ readonly branch: Schema.String;
2806
+ readonly head: Schema.String;
2807
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
2808
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
2809
+ readonly closedAt: Schema.NullOr<Schema.Number>;
2810
+ }>, Schema.TaggedStruct<"agent", {
2811
+ readonly host: Schema.String;
2812
+ readonly agentId: Schema.String;
2813
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
2814
+ }>, Schema.TaggedStruct<"unknown", {
2815
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
2816
+ readonly subject: Schema.String;
2817
+ readonly reason: Schema.String;
2818
+ }>]>;
2819
+ readonly observedAt: Schema.Number;
2820
+ }>;
2821
+ export interface WorkObservationEnvelope extends Schema.Schema.Type<typeof WorkObservationEnvelope> {
2822
+ }
2823
+ /**
2824
+ * A stored observation's id, and what `reconcile` accepts as confirmation of
2825
+ * it: lowercase hex of the SHA-256 of the UTF-8 bytes persisted in
2826
+ * `work_observed_facts.record`. That record is the JSON of the encoded
2827
+ * observation alone (a pull request's or an agent's fields, in schema field
2828
+ * order) with its case-insensitive identity, the repository or host,
2829
+ * ASCII-lowercased. `observedAt` is not an input, so the same facts read again
2830
+ * keep their id.
2831
+ */
2832
+ export declare const WorkObservationId: Schema.brand<Schema.String, "WorkObservationId">;
2833
+ export type WorkObservationId = typeof WorkObservationId.Type;
2834
+ /**
2835
+ * The latest stored fact for one subject. `observedAt` is when these exact
2836
+ * facts were first seen, so for a `gone` agent it is the time it went away;
2837
+ * `confirmedAt` is the last time a read returned them again.
2838
+ */
2839
+ export declare const WorkObservedFact: Schema.Struct<{
2840
+ readonly subject: Schema.String;
2841
+ readonly observationId: Schema.brand<Schema.String, "WorkObservationId">;
2842
+ readonly observedAt: Schema.Number;
2843
+ readonly confirmedAt: Schema.Number;
2844
+ readonly observation: Schema.Union<readonly [Schema.Struct<{
2845
+ readonly _tag: Schema.tag<"pull_request">;
2846
+ readonly repository: Schema.String;
2847
+ readonly pullRequest: Schema.Number;
2848
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
2849
+ readonly branch: Schema.String;
2850
+ readonly head: Schema.String;
2851
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
2852
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
2853
+ readonly closedAt: Schema.NullOr<Schema.Number>;
2854
+ }>, Schema.TaggedStruct<"agent", {
2855
+ readonly host: Schema.String;
2856
+ readonly agentId: Schema.String;
2857
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
2858
+ }>]>;
2859
+ }>;
2860
+ export interface WorkObservedFact extends Schema.Schema.Type<typeof WorkObservedFact> {
2861
+ }
2862
+ /**
2863
+ * The current run of failed reads for one subject. `since` is the first
2864
+ * failure of the run; a later failure keeps it, a good read newer than every
2865
+ * failure ends the run, and a good read inside it restarts the run at its
2866
+ * latest failure.
2867
+ */
2868
+ export declare const WorkObservedFailure: Schema.Struct<{
2869
+ readonly subject: Schema.String;
2870
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
2871
+ readonly reason: Schema.String;
2872
+ readonly since: Schema.Number;
2873
+ /** The latest failed read of the run; `source` and `reason` are from it. */
2874
+ readonly lastAt: Schema.Number;
2875
+ }>;
2876
+ export interface WorkObservedFailure extends Schema.Schema.Type<typeof WorkObservedFailure> {
2877
+ }
2878
+ /** The overlay keeps one latest fact per subject, within its own bounds; over them, the oldest facts go first. */
2879
+ /** How far ahead of the store's clock an observation may be stamped before it is skipped as stale. */
2880
+ export declare const workObservationMaxSkewMillis: number;
2881
+ export declare const workObservedFactMaxRecords = 4096;
2882
+ export declare const workObservedFactMaxBytes: number;
2883
+ /**
2884
+ * What `observe` did with one envelope: stored a new fact, found the same
2885
+ * facts already stored, skipped it as older than the stored fact, or reported
2886
+ * a source it could not read.
2887
+ */
2888
+ export declare const WorkObserveOutcome: Schema.TaggedUnion<{
2889
+ readonly stale: Schema.TaggedStruct<"stale", {
2890
+ readonly subject: Schema.String;
2891
+ }>;
2892
+ readonly stored: Schema.TaggedStruct<"stored", {
2893
+ readonly subject: Schema.String;
2894
+ readonly observationId: Schema.brand<Schema.String, "WorkObservationId">;
2895
+ }>;
2896
+ readonly unchanged: Schema.TaggedStruct<"unchanged", {
2897
+ readonly subject: Schema.String;
2898
+ readonly observationId: Schema.brand<Schema.String, "WorkObservationId">;
2899
+ }>;
2900
+ readonly unknown: Schema.TaggedStruct<"unknown", {
2901
+ readonly subject: Schema.String;
2902
+ readonly reason: Schema.String;
2903
+ }>;
2904
+ }>;
2905
+ export type WorkObserveOutcome = typeof WorkObserveOutcome.Type;
2906
+ export declare const WorkObserveReport: Schema.Struct<{
2907
+ readonly outcomes: Schema.$Array<Schema.TaggedUnion<{
2908
+ readonly stale: Schema.TaggedStruct<"stale", {
2909
+ readonly subject: Schema.String;
2910
+ }>;
2911
+ readonly stored: Schema.TaggedStruct<"stored", {
2912
+ readonly subject: Schema.String;
2913
+ readonly observationId: Schema.brand<Schema.String, "WorkObservationId">;
2914
+ }>;
2915
+ readonly unchanged: Schema.TaggedStruct<"unchanged", {
2916
+ readonly subject: Schema.String;
2917
+ readonly observationId: Schema.brand<Schema.String, "WorkObservationId">;
2918
+ }>;
2919
+ readonly unknown: Schema.TaggedStruct<"unknown", {
2920
+ readonly subject: Schema.String;
2921
+ readonly reason: Schema.String;
2922
+ }>;
2923
+ }>>;
2924
+ readonly evicted: Schema.Number;
2925
+ }>;
2926
+ export interface WorkObserveReport extends Schema.Schema.Type<typeof WorkObserveReport> {
2927
+ }
2928
+ /** History the reconciler always leaves free for owners and approvals. */
2929
+ export declare const workReconcilerHeadroom = 256;
2930
+ /**
2931
+ * What `reconcile` did for one goal whose pull request is observed merged or
2932
+ * closed: recorded it as finished, found it already recorded once by the
2933
+ * reconciler (it never stamps a goal twice, even after an owner reopens it),
2934
+ * or found a newer owner checkpoint than the one it planned from (it tries
2935
+ * again on the next run).
2936
+ */
2937
+ /**
2938
+ * What `reconcile` may act on: `confirmed` lists the pull request facts the
2939
+ * caller has just read and the store accepted, the `subject` and
2940
+ * `observationId` of each `stored` or `unchanged` outcome from that `observe`.
2941
+ * A read refused as stale, or one that failed, confirms nothing, so a fact
2942
+ * stored earlier (the pull request may since have reopened) is never acted on.
2943
+ */
2944
+ export declare const WorkReconcileOptions: Schema.Struct<{
2945
+ readonly confirmed: Schema.$Array<Schema.Struct<{
2946
+ readonly subject: Schema.String;
2947
+ readonly observationId: Schema.brand<Schema.String, "WorkObservationId">;
2948
+ }>>;
2949
+ }>;
2950
+ export interface WorkReconcileOptions extends Schema.Schema.Type<typeof WorkReconcileOptions> {
2951
+ }
2952
+ export declare const WorkReconcileOutcome: Schema.TaggedUnion<{
2953
+ readonly applied: Schema.TaggedStruct<"applied", {
2954
+ readonly goalId: Schema.String;
2955
+ readonly eventId: Schema.String;
2956
+ readonly state: Schema.Literals<readonly ["completed", "abandoned"]>;
2957
+ }>;
2958
+ readonly conflict: Schema.TaggedStruct<"conflict", {
2959
+ readonly goalId: Schema.String;
2960
+ }>;
2961
+ readonly recorded: Schema.TaggedStruct<"recorded", {
2962
+ readonly goalId: Schema.String;
2963
+ readonly eventId: Schema.String;
2964
+ }>;
2965
+ }>;
2966
+ export type WorkReconcileOutcome = typeof WorkReconcileOutcome.Type;
2967
+ /** What the Work tab shows for a goal: its recorded state, or a newer observed one. */
2968
+ export declare const WorkDisplayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2969
+ export type WorkDisplayState = typeof WorkDisplayState.Type;
2970
+ /** Observed facts overlaid on one goal at read time. Nothing here is goal history. */
2971
+ export declare const WorkGoalObserved: Schema.Struct<{
2972
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
2973
+ readonly fact: Schema.Struct<{
2974
+ readonly _tag: Schema.tag<"pull_request">;
2975
+ readonly repository: Schema.String;
2976
+ readonly pullRequest: Schema.Number;
2977
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
2978
+ readonly branch: Schema.String;
2979
+ readonly head: Schema.String;
2980
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
2981
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
2982
+ readonly closedAt: Schema.NullOr<Schema.Number>;
2983
+ }>;
2984
+ readonly observedAt: Schema.Number;
2985
+ readonly confirmedAt: Schema.Number;
2986
+ }>>;
2987
+ readonly agent: Schema.NullOr<Schema.Struct<{
2988
+ readonly fact: Schema.TaggedStruct<"agent", {
2989
+ readonly host: Schema.String;
2990
+ readonly agentId: Schema.String;
2991
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
2992
+ }>;
2993
+ readonly observedAt: Schema.Number;
2994
+ readonly confirmedAt: Schema.Number;
2995
+ }>>;
2996
+ /**
2997
+ * A source that can't currently be read for this goal; the oldest failing
2998
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
2999
+ * that subject last read successfully, null if it never has. A goal with no
3000
+ * pull request URL or no agent has no subject there, so no failure either.
3001
+ */
3002
+ readonly unknown: Schema.NullOr<Schema.Struct<{
3003
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
3004
+ readonly reason: Schema.String;
3005
+ readonly since: Schema.Number;
3006
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
3007
+ }>>;
3008
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3009
+ readonly stale: Schema.Boolean;
3010
+ }>;
3011
+ export interface WorkGoalObserved extends Schema.Schema.Type<typeof WorkGoalObserved> {
3012
+ }
3013
+ export declare const WorkGoalObservedEntry: Schema.Struct<{
3014
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
3015
+ readonly fact: Schema.Struct<{
3016
+ readonly _tag: Schema.tag<"pull_request">;
3017
+ readonly repository: Schema.String;
3018
+ readonly pullRequest: Schema.Number;
3019
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
3020
+ readonly branch: Schema.String;
3021
+ readonly head: Schema.String;
3022
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
3023
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
3024
+ readonly closedAt: Schema.NullOr<Schema.Number>;
3025
+ }>;
3026
+ readonly observedAt: Schema.Number;
3027
+ readonly confirmedAt: Schema.Number;
3028
+ }>>;
3029
+ readonly agent: Schema.NullOr<Schema.Struct<{
3030
+ readonly fact: Schema.TaggedStruct<"agent", {
3031
+ readonly host: Schema.String;
3032
+ readonly agentId: Schema.String;
3033
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
3034
+ }>;
3035
+ readonly observedAt: Schema.Number;
3036
+ readonly confirmedAt: Schema.Number;
3037
+ }>>;
3038
+ /**
3039
+ * A source that can't currently be read for this goal; the oldest failing
3040
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
3041
+ * that subject last read successfully, null if it never has. A goal with no
3042
+ * pull request URL or no agent has no subject there, so no failure either.
3043
+ */
3044
+ readonly unknown: Schema.NullOr<Schema.Struct<{
3045
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
3046
+ readonly reason: Schema.String;
3047
+ readonly since: Schema.Number;
3048
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
3049
+ }>>;
3050
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3051
+ readonly stale: Schema.Boolean;
3052
+ readonly goalId: Schema.String;
3053
+ }>;
3054
+ export interface WorkGoalObservedEntry extends Schema.Schema.Type<typeof WorkGoalObservedEntry> {
3055
+ }
3056
+ /**
3057
+ * Who wrote one goal activity, when it was not the goal's owner: the
3058
+ * reconciler (from an observed fact) or an approved Fleet job.
3059
+ */
3060
+ export declare const WorkActivityProvenance: Schema.Struct<{
3061
+ readonly goalId: Schema.String;
3062
+ readonly activityId: Schema.String;
3063
+ readonly provenance: Schema.Literals<readonly ["reconciler", "approval"]>;
3064
+ readonly approvalJobId: Schema.NullOr<Schema.String>;
3065
+ }>;
3066
+ export interface WorkActivityProvenance extends Schema.Schema.Type<typeof WorkActivityProvenance> {
3067
+ }
2488
3068
  export declare const WorkSnapshotWindow: Schema.Literals<readonly ["now", "day", "week", "month"]>;
2489
3069
  export type WorkSnapshotWindow = typeof WorkSnapshotWindow.Type;
2490
3070
  export declare const WorkSnapshot: Schema.Struct<{
@@ -2496,7 +3076,7 @@ export declare const WorkSnapshot: Schema.Struct<{
2496
3076
  readonly title: Schema.String;
2497
3077
  readonly summary: Schema.String;
2498
3078
  readonly detail: Schema.String;
2499
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3079
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2500
3080
  readonly owner: Schema.Struct<{
2501
3081
  readonly id: Schema.String;
2502
3082
  readonly name: Schema.String;
@@ -2577,7 +3157,7 @@ export declare const WorkSnapshot: Schema.Struct<{
2577
3157
  readonly title: Schema.String;
2578
3158
  readonly summary: Schema.String;
2579
3159
  readonly detail: Schema.String;
2580
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3160
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2581
3161
  readonly owner: Schema.Struct<{
2582
3162
  readonly id: Schema.String;
2583
3163
  readonly name: Schema.String;
@@ -2656,7 +3236,7 @@ export declare const WorkSnapshot: Schema.Struct<{
2656
3236
  readonly title: Schema.String;
2657
3237
  readonly summary: Schema.String;
2658
3238
  readonly detail: Schema.String;
2659
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3239
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2660
3240
  readonly owner: Schema.Struct<{
2661
3241
  readonly id: Schema.String;
2662
3242
  readonly name: Schema.String;
@@ -2731,6 +3311,72 @@ export declare const WorkSnapshot: Schema.Struct<{
2731
3311
  readonly updatedAt: Schema.Number;
2732
3312
  }>>;
2733
3313
  }>>>;
3314
+ /**
3315
+ * Observed facts per goal, merged at read time; only the `now` window
3316
+ * carries them, and only for goals something was observed about.
3317
+ */
3318
+ readonly observed: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3319
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
3320
+ readonly fact: Schema.Struct<{
3321
+ readonly _tag: Schema.tag<"pull_request">;
3322
+ readonly repository: Schema.String;
3323
+ readonly pullRequest: Schema.Number;
3324
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
3325
+ readonly branch: Schema.String;
3326
+ readonly head: Schema.String;
3327
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
3328
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
3329
+ readonly closedAt: Schema.NullOr<Schema.Number>;
3330
+ }>;
3331
+ readonly observedAt: Schema.Number;
3332
+ readonly confirmedAt: Schema.Number;
3333
+ }>>;
3334
+ readonly agent: Schema.NullOr<Schema.Struct<{
3335
+ readonly fact: Schema.TaggedStruct<"agent", {
3336
+ readonly host: Schema.String;
3337
+ readonly agentId: Schema.String;
3338
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
3339
+ }>;
3340
+ readonly observedAt: Schema.Number;
3341
+ readonly confirmedAt: Schema.Number;
3342
+ }>>;
3343
+ /**
3344
+ * A source that can't currently be read for this goal; the oldest failing
3345
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
3346
+ * that subject last read successfully, null if it never has. A goal with no
3347
+ * pull request URL or no agent has no subject there, so no failure either.
3348
+ */
3349
+ readonly unknown: Schema.NullOr<Schema.Struct<{
3350
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
3351
+ readonly reason: Schema.String;
3352
+ readonly since: Schema.Number;
3353
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
3354
+ }>>;
3355
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3356
+ readonly stale: Schema.Boolean;
3357
+ readonly goalId: Schema.String;
3358
+ }>>>;
3359
+ /**
3360
+ * How many goals' observed entries were left out to keep the snapshot within
3361
+ * the response budget; the most recently updated goals keep theirs.
3362
+ */
3363
+ readonly observedOmitted: Schema.optionalKey<Schema.Number>;
3364
+ /** Activities written by the reconciler or an approved job; only on `now`. */
3365
+ readonly activityProvenance: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3366
+ readonly goalId: Schema.String;
3367
+ readonly activityId: Schema.String;
3368
+ readonly provenance: Schema.Literals<readonly ["reconciler", "approval"]>;
3369
+ readonly approvalJobId: Schema.NullOr<Schema.String>;
3370
+ }>>>;
3371
+ /**
3372
+ * Goals whose non-owner activities are all in `activityProvenance`. In a
3373
+ * covered goal an activity missing from it is the owner's; a goal that isn't
3374
+ * covered has unknown provenance. Trimming to the response budget drops
3375
+ * whole goals, never single activities.
3376
+ */
3377
+ readonly activityProvenanceGoals: Schema.optionalKey<Schema.$Array<Schema.String>>;
3378
+ /** How many goals were left uncovered to keep the snapshot within the response budget. */
3379
+ readonly activityProvenanceOmitted: Schema.optionalKey<Schema.Number>;
2734
3380
  }>;
2735
3381
  export interface WorkSnapshot extends Schema.Schema.Type<typeof WorkSnapshot> {
2736
3382
  }
@@ -2745,7 +3391,7 @@ export declare const WorkSnapshots: Schema.Struct<{
2745
3391
  readonly title: Schema.String;
2746
3392
  readonly summary: Schema.String;
2747
3393
  readonly detail: Schema.String;
2748
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3394
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2749
3395
  readonly owner: Schema.Struct<{
2750
3396
  readonly id: Schema.String;
2751
3397
  readonly name: Schema.String;
@@ -2826,7 +3472,7 @@ export declare const WorkSnapshots: Schema.Struct<{
2826
3472
  readonly title: Schema.String;
2827
3473
  readonly summary: Schema.String;
2828
3474
  readonly detail: Schema.String;
2829
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3475
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2830
3476
  readonly owner: Schema.Struct<{
2831
3477
  readonly id: Schema.String;
2832
3478
  readonly name: Schema.String;
@@ -2905,7 +3551,7 @@ export declare const WorkSnapshots: Schema.Struct<{
2905
3551
  readonly title: Schema.String;
2906
3552
  readonly summary: Schema.String;
2907
3553
  readonly detail: Schema.String;
2908
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3554
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2909
3555
  readonly owner: Schema.Struct<{
2910
3556
  readonly id: Schema.String;
2911
3557
  readonly name: Schema.String;
@@ -2980,6 +3626,72 @@ export declare const WorkSnapshots: Schema.Struct<{
2980
3626
  readonly updatedAt: Schema.Number;
2981
3627
  }>>;
2982
3628
  }>>>;
3629
+ /**
3630
+ * Observed facts per goal, merged at read time; only the `now` window
3631
+ * carries them, and only for goals something was observed about.
3632
+ */
3633
+ readonly observed: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3634
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
3635
+ readonly fact: Schema.Struct<{
3636
+ readonly _tag: Schema.tag<"pull_request">;
3637
+ readonly repository: Schema.String;
3638
+ readonly pullRequest: Schema.Number;
3639
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
3640
+ readonly branch: Schema.String;
3641
+ readonly head: Schema.String;
3642
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
3643
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
3644
+ readonly closedAt: Schema.NullOr<Schema.Number>;
3645
+ }>;
3646
+ readonly observedAt: Schema.Number;
3647
+ readonly confirmedAt: Schema.Number;
3648
+ }>>;
3649
+ readonly agent: Schema.NullOr<Schema.Struct<{
3650
+ readonly fact: Schema.TaggedStruct<"agent", {
3651
+ readonly host: Schema.String;
3652
+ readonly agentId: Schema.String;
3653
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
3654
+ }>;
3655
+ readonly observedAt: Schema.Number;
3656
+ readonly confirmedAt: Schema.Number;
3657
+ }>>;
3658
+ /**
3659
+ * A source that can't currently be read for this goal; the oldest failing
3660
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
3661
+ * that subject last read successfully, null if it never has. A goal with no
3662
+ * pull request URL or no agent has no subject there, so no failure either.
3663
+ */
3664
+ readonly unknown: Schema.NullOr<Schema.Struct<{
3665
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
3666
+ readonly reason: Schema.String;
3667
+ readonly since: Schema.Number;
3668
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
3669
+ }>>;
3670
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3671
+ readonly stale: Schema.Boolean;
3672
+ readonly goalId: Schema.String;
3673
+ }>>>;
3674
+ /**
3675
+ * How many goals' observed entries were left out to keep the snapshot within
3676
+ * the response budget; the most recently updated goals keep theirs.
3677
+ */
3678
+ readonly observedOmitted: Schema.optionalKey<Schema.Number>;
3679
+ /** Activities written by the reconciler or an approved job; only on `now`. */
3680
+ readonly activityProvenance: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3681
+ readonly goalId: Schema.String;
3682
+ readonly activityId: Schema.String;
3683
+ readonly provenance: Schema.Literals<readonly ["reconciler", "approval"]>;
3684
+ readonly approvalJobId: Schema.NullOr<Schema.String>;
3685
+ }>>>;
3686
+ /**
3687
+ * Goals whose non-owner activities are all in `activityProvenance`. In a
3688
+ * covered goal an activity missing from it is the owner's; a goal that isn't
3689
+ * covered has unknown provenance. Trimming to the response budget drops
3690
+ * whole goals, never single activities.
3691
+ */
3692
+ readonly activityProvenanceGoals: Schema.optionalKey<Schema.$Array<Schema.String>>;
3693
+ /** How many goals were left uncovered to keep the snapshot within the response budget. */
3694
+ readonly activityProvenanceOmitted: Schema.optionalKey<Schema.Number>;
2983
3695
  }>;
2984
3696
  readonly day: Schema.Struct<{
2985
3697
  readonly window: Schema.Literals<readonly ["now", "day", "week", "month"]>;
@@ -2990,7 +3702,7 @@ export declare const WorkSnapshots: Schema.Struct<{
2990
3702
  readonly title: Schema.String;
2991
3703
  readonly summary: Schema.String;
2992
3704
  readonly detail: Schema.String;
2993
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3705
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2994
3706
  readonly owner: Schema.Struct<{
2995
3707
  readonly id: Schema.String;
2996
3708
  readonly name: Schema.String;
@@ -3071,7 +3783,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3071
3783
  readonly title: Schema.String;
3072
3784
  readonly summary: Schema.String;
3073
3785
  readonly detail: Schema.String;
3074
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3786
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3075
3787
  readonly owner: Schema.Struct<{
3076
3788
  readonly id: Schema.String;
3077
3789
  readonly name: Schema.String;
@@ -3150,7 +3862,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3150
3862
  readonly title: Schema.String;
3151
3863
  readonly summary: Schema.String;
3152
3864
  readonly detail: Schema.String;
3153
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3865
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3154
3866
  readonly owner: Schema.Struct<{
3155
3867
  readonly id: Schema.String;
3156
3868
  readonly name: Schema.String;
@@ -3225,6 +3937,72 @@ export declare const WorkSnapshots: Schema.Struct<{
3225
3937
  readonly updatedAt: Schema.Number;
3226
3938
  }>>;
3227
3939
  }>>>;
3940
+ /**
3941
+ * Observed facts per goal, merged at read time; only the `now` window
3942
+ * carries them, and only for goals something was observed about.
3943
+ */
3944
+ readonly observed: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3945
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
3946
+ readonly fact: Schema.Struct<{
3947
+ readonly _tag: Schema.tag<"pull_request">;
3948
+ readonly repository: Schema.String;
3949
+ readonly pullRequest: Schema.Number;
3950
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
3951
+ readonly branch: Schema.String;
3952
+ readonly head: Schema.String;
3953
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
3954
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
3955
+ readonly closedAt: Schema.NullOr<Schema.Number>;
3956
+ }>;
3957
+ readonly observedAt: Schema.Number;
3958
+ readonly confirmedAt: Schema.Number;
3959
+ }>>;
3960
+ readonly agent: Schema.NullOr<Schema.Struct<{
3961
+ readonly fact: Schema.TaggedStruct<"agent", {
3962
+ readonly host: Schema.String;
3963
+ readonly agentId: Schema.String;
3964
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
3965
+ }>;
3966
+ readonly observedAt: Schema.Number;
3967
+ readonly confirmedAt: Schema.Number;
3968
+ }>>;
3969
+ /**
3970
+ * A source that can't currently be read for this goal; the oldest failing
3971
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
3972
+ * that subject last read successfully, null if it never has. A goal with no
3973
+ * pull request URL or no agent has no subject there, so no failure either.
3974
+ */
3975
+ readonly unknown: Schema.NullOr<Schema.Struct<{
3976
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
3977
+ readonly reason: Schema.String;
3978
+ readonly since: Schema.Number;
3979
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
3980
+ }>>;
3981
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3982
+ readonly stale: Schema.Boolean;
3983
+ readonly goalId: Schema.String;
3984
+ }>>>;
3985
+ /**
3986
+ * How many goals' observed entries were left out to keep the snapshot within
3987
+ * the response budget; the most recently updated goals keep theirs.
3988
+ */
3989
+ readonly observedOmitted: Schema.optionalKey<Schema.Number>;
3990
+ /** Activities written by the reconciler or an approved job; only on `now`. */
3991
+ readonly activityProvenance: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3992
+ readonly goalId: Schema.String;
3993
+ readonly activityId: Schema.String;
3994
+ readonly provenance: Schema.Literals<readonly ["reconciler", "approval"]>;
3995
+ readonly approvalJobId: Schema.NullOr<Schema.String>;
3996
+ }>>>;
3997
+ /**
3998
+ * Goals whose non-owner activities are all in `activityProvenance`. In a
3999
+ * covered goal an activity missing from it is the owner's; a goal that isn't
4000
+ * covered has unknown provenance. Trimming to the response budget drops
4001
+ * whole goals, never single activities.
4002
+ */
4003
+ readonly activityProvenanceGoals: Schema.optionalKey<Schema.$Array<Schema.String>>;
4004
+ /** How many goals were left uncovered to keep the snapshot within the response budget. */
4005
+ readonly activityProvenanceOmitted: Schema.optionalKey<Schema.Number>;
3228
4006
  }>;
3229
4007
  readonly week: Schema.Struct<{
3230
4008
  readonly window: Schema.Literals<readonly ["now", "day", "week", "month"]>;
@@ -3235,7 +4013,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3235
4013
  readonly title: Schema.String;
3236
4014
  readonly summary: Schema.String;
3237
4015
  readonly detail: Schema.String;
3238
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
4016
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3239
4017
  readonly owner: Schema.Struct<{
3240
4018
  readonly id: Schema.String;
3241
4019
  readonly name: Schema.String;
@@ -3316,7 +4094,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3316
4094
  readonly title: Schema.String;
3317
4095
  readonly summary: Schema.String;
3318
4096
  readonly detail: Schema.String;
3319
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
4097
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3320
4098
  readonly owner: Schema.Struct<{
3321
4099
  readonly id: Schema.String;
3322
4100
  readonly name: Schema.String;
@@ -3395,7 +4173,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3395
4173
  readonly title: Schema.String;
3396
4174
  readonly summary: Schema.String;
3397
4175
  readonly detail: Schema.String;
3398
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
4176
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3399
4177
  readonly owner: Schema.Struct<{
3400
4178
  readonly id: Schema.String;
3401
4179
  readonly name: Schema.String;
@@ -3470,6 +4248,72 @@ export declare const WorkSnapshots: Schema.Struct<{
3470
4248
  readonly updatedAt: Schema.Number;
3471
4249
  }>>;
3472
4250
  }>>>;
4251
+ /**
4252
+ * Observed facts per goal, merged at read time; only the `now` window
4253
+ * carries them, and only for goals something was observed about.
4254
+ */
4255
+ readonly observed: Schema.optionalKey<Schema.$Array<Schema.Struct<{
4256
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
4257
+ readonly fact: Schema.Struct<{
4258
+ readonly _tag: Schema.tag<"pull_request">;
4259
+ readonly repository: Schema.String;
4260
+ readonly pullRequest: Schema.Number;
4261
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
4262
+ readonly branch: Schema.String;
4263
+ readonly head: Schema.String;
4264
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
4265
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
4266
+ readonly closedAt: Schema.NullOr<Schema.Number>;
4267
+ }>;
4268
+ readonly observedAt: Schema.Number;
4269
+ readonly confirmedAt: Schema.Number;
4270
+ }>>;
4271
+ readonly agent: Schema.NullOr<Schema.Struct<{
4272
+ readonly fact: Schema.TaggedStruct<"agent", {
4273
+ readonly host: Schema.String;
4274
+ readonly agentId: Schema.String;
4275
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
4276
+ }>;
4277
+ readonly observedAt: Schema.Number;
4278
+ readonly confirmedAt: Schema.Number;
4279
+ }>>;
4280
+ /**
4281
+ * A source that can't currently be read for this goal; the oldest failing
4282
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
4283
+ * that subject last read successfully, null if it never has. A goal with no
4284
+ * pull request URL or no agent has no subject there, so no failure either.
4285
+ */
4286
+ readonly unknown: Schema.NullOr<Schema.Struct<{
4287
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
4288
+ readonly reason: Schema.String;
4289
+ readonly since: Schema.Number;
4290
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
4291
+ }>>;
4292
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
4293
+ readonly stale: Schema.Boolean;
4294
+ readonly goalId: Schema.String;
4295
+ }>>>;
4296
+ /**
4297
+ * How many goals' observed entries were left out to keep the snapshot within
4298
+ * the response budget; the most recently updated goals keep theirs.
4299
+ */
4300
+ readonly observedOmitted: Schema.optionalKey<Schema.Number>;
4301
+ /** Activities written by the reconciler or an approved job; only on `now`. */
4302
+ readonly activityProvenance: Schema.optionalKey<Schema.$Array<Schema.Struct<{
4303
+ readonly goalId: Schema.String;
4304
+ readonly activityId: Schema.String;
4305
+ readonly provenance: Schema.Literals<readonly ["reconciler", "approval"]>;
4306
+ readonly approvalJobId: Schema.NullOr<Schema.String>;
4307
+ }>>>;
4308
+ /**
4309
+ * Goals whose non-owner activities are all in `activityProvenance`. In a
4310
+ * covered goal an activity missing from it is the owner's; a goal that isn't
4311
+ * covered has unknown provenance. Trimming to the response budget drops
4312
+ * whole goals, never single activities.
4313
+ */
4314
+ readonly activityProvenanceGoals: Schema.optionalKey<Schema.$Array<Schema.String>>;
4315
+ /** How many goals were left uncovered to keep the snapshot within the response budget. */
4316
+ readonly activityProvenanceOmitted: Schema.optionalKey<Schema.Number>;
3473
4317
  }>;
3474
4318
  readonly month: Schema.Struct<{
3475
4319
  readonly window: Schema.Literals<readonly ["now", "day", "week", "month"]>;
@@ -3480,7 +4324,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3480
4324
  readonly title: Schema.String;
3481
4325
  readonly summary: Schema.String;
3482
4326
  readonly detail: Schema.String;
3483
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
4327
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3484
4328
  readonly owner: Schema.Struct<{
3485
4329
  readonly id: Schema.String;
3486
4330
  readonly name: Schema.String;
@@ -3561,7 +4405,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3561
4405
  readonly title: Schema.String;
3562
4406
  readonly summary: Schema.String;
3563
4407
  readonly detail: Schema.String;
3564
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
4408
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3565
4409
  readonly owner: Schema.Struct<{
3566
4410
  readonly id: Schema.String;
3567
4411
  readonly name: Schema.String;
@@ -3640,7 +4484,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3640
4484
  readonly title: Schema.String;
3641
4485
  readonly summary: Schema.String;
3642
4486
  readonly detail: Schema.String;
3643
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
4487
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3644
4488
  readonly owner: Schema.Struct<{
3645
4489
  readonly id: Schema.String;
3646
4490
  readonly name: Schema.String;
@@ -3715,6 +4559,72 @@ export declare const WorkSnapshots: Schema.Struct<{
3715
4559
  readonly updatedAt: Schema.Number;
3716
4560
  }>>;
3717
4561
  }>>>;
4562
+ /**
4563
+ * Observed facts per goal, merged at read time; only the `now` window
4564
+ * carries them, and only for goals something was observed about.
4565
+ */
4566
+ readonly observed: Schema.optionalKey<Schema.$Array<Schema.Struct<{
4567
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
4568
+ readonly fact: Schema.Struct<{
4569
+ readonly _tag: Schema.tag<"pull_request">;
4570
+ readonly repository: Schema.String;
4571
+ readonly pullRequest: Schema.Number;
4572
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
4573
+ readonly branch: Schema.String;
4574
+ readonly head: Schema.String;
4575
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
4576
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
4577
+ readonly closedAt: Schema.NullOr<Schema.Number>;
4578
+ }>;
4579
+ readonly observedAt: Schema.Number;
4580
+ readonly confirmedAt: Schema.Number;
4581
+ }>>;
4582
+ readonly agent: Schema.NullOr<Schema.Struct<{
4583
+ readonly fact: Schema.TaggedStruct<"agent", {
4584
+ readonly host: Schema.String;
4585
+ readonly agentId: Schema.String;
4586
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
4587
+ }>;
4588
+ readonly observedAt: Schema.Number;
4589
+ readonly confirmedAt: Schema.Number;
4590
+ }>>;
4591
+ /**
4592
+ * A source that can't currently be read for this goal; the oldest failing
4593
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
4594
+ * that subject last read successfully, null if it never has. A goal with no
4595
+ * pull request URL or no agent has no subject there, so no failure either.
4596
+ */
4597
+ readonly unknown: Schema.NullOr<Schema.Struct<{
4598
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
4599
+ readonly reason: Schema.String;
4600
+ readonly since: Schema.Number;
4601
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
4602
+ }>>;
4603
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
4604
+ readonly stale: Schema.Boolean;
4605
+ readonly goalId: Schema.String;
4606
+ }>>>;
4607
+ /**
4608
+ * How many goals' observed entries were left out to keep the snapshot within
4609
+ * the response budget; the most recently updated goals keep theirs.
4610
+ */
4611
+ readonly observedOmitted: Schema.optionalKey<Schema.Number>;
4612
+ /** Activities written by the reconciler or an approved job; only on `now`. */
4613
+ readonly activityProvenance: Schema.optionalKey<Schema.$Array<Schema.Struct<{
4614
+ readonly goalId: Schema.String;
4615
+ readonly activityId: Schema.String;
4616
+ readonly provenance: Schema.Literals<readonly ["reconciler", "approval"]>;
4617
+ readonly approvalJobId: Schema.NullOr<Schema.String>;
4618
+ }>>>;
4619
+ /**
4620
+ * Goals whose non-owner activities are all in `activityProvenance`. In a
4621
+ * covered goal an activity missing from it is the owner's; a goal that isn't
4622
+ * covered has unknown provenance. Trimming to the response budget drops
4623
+ * whole goals, never single activities.
4624
+ */
4625
+ readonly activityProvenanceGoals: Schema.optionalKey<Schema.$Array<Schema.String>>;
4626
+ /** How many goals were left uncovered to keep the snapshot within the response budget. */
4627
+ readonly activityProvenanceOmitted: Schema.optionalKey<Schema.Number>;
3718
4628
  }>;
3719
4629
  }>;
3720
4630
  export interface WorkSnapshots extends Schema.Schema.Type<typeof WorkSnapshots> {