@knpkv/herdr-work 0.5.3 → 0.6.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 +86 -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 +29 -0
  23. package/dist/internal/terminal-reconcile.d.ts.map +1 -0
  24. package/dist/internal/terminal-reconcile.js +79 -0
  25. package/dist/internal/terminal-reconcile.js.map +1 -0
  26. package/dist/model.d.ts +909 -29
  27. package/dist/model.d.ts.map +1 -1
  28. package/dist/model.js +236 -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 +687 -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,305 @@ 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
+ * The latest stored fact for one subject. `observedAt` is when these exact
2825
+ * facts were first seen, so for a `gone` agent it is the time it went away;
2826
+ * `confirmedAt` is the last time a read returned them again.
2827
+ */
2828
+ export declare const WorkObservedFact: Schema.Struct<{
2829
+ readonly subject: Schema.String;
2830
+ readonly observationId: Schema.String;
2831
+ readonly observedAt: Schema.Number;
2832
+ readonly confirmedAt: Schema.Number;
2833
+ readonly observation: Schema.Union<readonly [Schema.Struct<{
2834
+ readonly _tag: Schema.tag<"pull_request">;
2835
+ readonly repository: Schema.String;
2836
+ readonly pullRequest: Schema.Number;
2837
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
2838
+ readonly branch: Schema.String;
2839
+ readonly head: Schema.String;
2840
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
2841
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
2842
+ readonly closedAt: Schema.NullOr<Schema.Number>;
2843
+ }>, Schema.TaggedStruct<"agent", {
2844
+ readonly host: Schema.String;
2845
+ readonly agentId: Schema.String;
2846
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
2847
+ }>]>;
2848
+ }>;
2849
+ export interface WorkObservedFact extends Schema.Schema.Type<typeof WorkObservedFact> {
2850
+ }
2851
+ /**
2852
+ * The current run of failed reads for one subject. `since` is the first
2853
+ * failure of the run; a later failure keeps it, a good read newer than every
2854
+ * failure ends the run, and a good read inside it restarts the run at its
2855
+ * latest failure.
2856
+ */
2857
+ export declare const WorkObservedFailure: Schema.Struct<{
2858
+ readonly subject: Schema.String;
2859
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
2860
+ readonly reason: Schema.String;
2861
+ readonly since: Schema.Number;
2862
+ /** The latest failed read of the run; `source` and `reason` are from it. */
2863
+ readonly lastAt: Schema.Number;
2864
+ }>;
2865
+ export interface WorkObservedFailure extends Schema.Schema.Type<typeof WorkObservedFailure> {
2866
+ }
2867
+ /** The overlay keeps one latest fact per subject, within its own bounds; over them, the oldest facts go first. */
2868
+ /** How far ahead of the store's clock an observation may be stamped before it is skipped as stale. */
2869
+ export declare const workObservationMaxSkewMillis: number;
2870
+ export declare const workObservedFactMaxRecords = 4096;
2871
+ export declare const workObservedFactMaxBytes: number;
2872
+ /**
2873
+ * What `observe` did with one envelope: stored a new fact, found the same
2874
+ * facts already stored, skipped it as older than the stored fact, or reported
2875
+ * a source it could not read.
2876
+ */
2877
+ export declare const WorkObserveOutcome: Schema.TaggedUnion<{
2878
+ readonly stale: Schema.TaggedStruct<"stale", {
2879
+ readonly subject: Schema.String;
2880
+ }>;
2881
+ readonly stored: Schema.TaggedStruct<"stored", {
2882
+ readonly subject: Schema.String;
2883
+ }>;
2884
+ readonly unchanged: Schema.TaggedStruct<"unchanged", {
2885
+ readonly subject: Schema.String;
2886
+ }>;
2887
+ readonly unknown: Schema.TaggedStruct<"unknown", {
2888
+ readonly subject: Schema.String;
2889
+ readonly reason: Schema.String;
2890
+ }>;
2891
+ }>;
2892
+ export type WorkObserveOutcome = typeof WorkObserveOutcome.Type;
2893
+ export declare const WorkObserveReport: Schema.Struct<{
2894
+ readonly outcomes: Schema.$Array<Schema.TaggedUnion<{
2895
+ readonly stale: Schema.TaggedStruct<"stale", {
2896
+ readonly subject: Schema.String;
2897
+ }>;
2898
+ readonly stored: Schema.TaggedStruct<"stored", {
2899
+ readonly subject: Schema.String;
2900
+ }>;
2901
+ readonly unchanged: Schema.TaggedStruct<"unchanged", {
2902
+ readonly subject: Schema.String;
2903
+ }>;
2904
+ readonly unknown: Schema.TaggedStruct<"unknown", {
2905
+ readonly subject: Schema.String;
2906
+ readonly reason: Schema.String;
2907
+ }>;
2908
+ }>>;
2909
+ readonly evicted: Schema.Number;
2910
+ }>;
2911
+ export interface WorkObserveReport extends Schema.Schema.Type<typeof WorkObserveReport> {
2912
+ }
2913
+ /** History the reconciler always leaves free for owners and approvals. */
2914
+ export declare const workReconcilerHeadroom = 256;
2915
+ /**
2916
+ * What `reconcile` did for one goal whose pull request is observed merged or
2917
+ * closed: recorded it as finished, found it already recorded once by the
2918
+ * reconciler (it never stamps a goal twice, even after an owner reopens it),
2919
+ * or found a newer owner checkpoint than the one it planned from (it tries
2920
+ * again on the next run).
2921
+ */
2922
+ export declare const WorkReconcileOutcome: Schema.TaggedUnion<{
2923
+ readonly applied: Schema.TaggedStruct<"applied", {
2924
+ readonly goalId: Schema.String;
2925
+ readonly eventId: Schema.String;
2926
+ readonly state: Schema.Literals<readonly ["completed", "abandoned"]>;
2927
+ }>;
2928
+ readonly conflict: Schema.TaggedStruct<"conflict", {
2929
+ readonly goalId: Schema.String;
2930
+ }>;
2931
+ readonly recorded: Schema.TaggedStruct<"recorded", {
2932
+ readonly goalId: Schema.String;
2933
+ readonly eventId: Schema.String;
2934
+ }>;
2935
+ }>;
2936
+ export type WorkReconcileOutcome = typeof WorkReconcileOutcome.Type;
2937
+ /** What the Work tab shows for a goal: its recorded state, or a newer observed one. */
2938
+ export declare const WorkDisplayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2939
+ export type WorkDisplayState = typeof WorkDisplayState.Type;
2940
+ /** Observed facts overlaid on one goal at read time. Nothing here is goal history. */
2941
+ export declare const WorkGoalObserved: Schema.Struct<{
2942
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
2943
+ readonly fact: Schema.Struct<{
2944
+ readonly _tag: Schema.tag<"pull_request">;
2945
+ readonly repository: Schema.String;
2946
+ readonly pullRequest: Schema.Number;
2947
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
2948
+ readonly branch: Schema.String;
2949
+ readonly head: Schema.String;
2950
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
2951
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
2952
+ readonly closedAt: Schema.NullOr<Schema.Number>;
2953
+ }>;
2954
+ readonly observedAt: Schema.Number;
2955
+ readonly confirmedAt: Schema.Number;
2956
+ }>>;
2957
+ readonly agent: Schema.NullOr<Schema.Struct<{
2958
+ readonly fact: Schema.TaggedStruct<"agent", {
2959
+ readonly host: Schema.String;
2960
+ readonly agentId: Schema.String;
2961
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
2962
+ }>;
2963
+ readonly observedAt: Schema.Number;
2964
+ readonly confirmedAt: Schema.Number;
2965
+ }>>;
2966
+ /**
2967
+ * A source that can't currently be read for this goal; the oldest failing
2968
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
2969
+ * that subject last read successfully, null if it never has. A goal with no
2970
+ * pull request URL or no agent has no subject there, so no failure either.
2971
+ */
2972
+ readonly unknown: Schema.NullOr<Schema.Struct<{
2973
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
2974
+ readonly reason: Schema.String;
2975
+ readonly since: Schema.Number;
2976
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
2977
+ }>>;
2978
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2979
+ readonly stale: Schema.Boolean;
2980
+ }>;
2981
+ export interface WorkGoalObserved extends Schema.Schema.Type<typeof WorkGoalObserved> {
2982
+ }
2983
+ export declare const WorkGoalObservedEntry: Schema.Struct<{
2984
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
2985
+ readonly fact: Schema.Struct<{
2986
+ readonly _tag: Schema.tag<"pull_request">;
2987
+ readonly repository: Schema.String;
2988
+ readonly pullRequest: Schema.Number;
2989
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
2990
+ readonly branch: Schema.String;
2991
+ readonly head: Schema.String;
2992
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
2993
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
2994
+ readonly closedAt: Schema.NullOr<Schema.Number>;
2995
+ }>;
2996
+ readonly observedAt: Schema.Number;
2997
+ readonly confirmedAt: Schema.Number;
2998
+ }>>;
2999
+ readonly agent: Schema.NullOr<Schema.Struct<{
3000
+ readonly fact: Schema.TaggedStruct<"agent", {
3001
+ readonly host: Schema.String;
3002
+ readonly agentId: Schema.String;
3003
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
3004
+ }>;
3005
+ readonly observedAt: Schema.Number;
3006
+ readonly confirmedAt: Schema.Number;
3007
+ }>>;
3008
+ /**
3009
+ * A source that can't currently be read for this goal; the oldest failing
3010
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
3011
+ * that subject last read successfully, null if it never has. A goal with no
3012
+ * pull request URL or no agent has no subject there, so no failure either.
3013
+ */
3014
+ readonly unknown: Schema.NullOr<Schema.Struct<{
3015
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
3016
+ readonly reason: Schema.String;
3017
+ readonly since: Schema.Number;
3018
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
3019
+ }>>;
3020
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3021
+ readonly stale: Schema.Boolean;
3022
+ readonly goalId: Schema.String;
3023
+ }>;
3024
+ export interface WorkGoalObservedEntry extends Schema.Schema.Type<typeof WorkGoalObservedEntry> {
3025
+ }
3026
+ /**
3027
+ * Who wrote one goal activity, when it was not the goal's owner: the
3028
+ * reconciler (from an observed fact) or an approved Fleet job.
3029
+ */
3030
+ export declare const WorkActivityProvenance: Schema.Struct<{
3031
+ readonly goalId: Schema.String;
3032
+ readonly activityId: Schema.String;
3033
+ readonly provenance: Schema.Literals<readonly ["reconciler", "approval"]>;
3034
+ readonly approvalJobId: Schema.NullOr<Schema.String>;
3035
+ }>;
3036
+ export interface WorkActivityProvenance extends Schema.Schema.Type<typeof WorkActivityProvenance> {
3037
+ }
2488
3038
  export declare const WorkSnapshotWindow: Schema.Literals<readonly ["now", "day", "week", "month"]>;
2489
3039
  export type WorkSnapshotWindow = typeof WorkSnapshotWindow.Type;
2490
3040
  export declare const WorkSnapshot: Schema.Struct<{
@@ -2496,7 +3046,7 @@ export declare const WorkSnapshot: Schema.Struct<{
2496
3046
  readonly title: Schema.String;
2497
3047
  readonly summary: Schema.String;
2498
3048
  readonly detail: Schema.String;
2499
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3049
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2500
3050
  readonly owner: Schema.Struct<{
2501
3051
  readonly id: Schema.String;
2502
3052
  readonly name: Schema.String;
@@ -2577,7 +3127,7 @@ export declare const WorkSnapshot: Schema.Struct<{
2577
3127
  readonly title: Schema.String;
2578
3128
  readonly summary: Schema.String;
2579
3129
  readonly detail: Schema.String;
2580
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3130
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2581
3131
  readonly owner: Schema.Struct<{
2582
3132
  readonly id: Schema.String;
2583
3133
  readonly name: Schema.String;
@@ -2656,7 +3206,7 @@ export declare const WorkSnapshot: Schema.Struct<{
2656
3206
  readonly title: Schema.String;
2657
3207
  readonly summary: Schema.String;
2658
3208
  readonly detail: Schema.String;
2659
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3209
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2660
3210
  readonly owner: Schema.Struct<{
2661
3211
  readonly id: Schema.String;
2662
3212
  readonly name: Schema.String;
@@ -2731,6 +3281,72 @@ export declare const WorkSnapshot: Schema.Struct<{
2731
3281
  readonly updatedAt: Schema.Number;
2732
3282
  }>>;
2733
3283
  }>>>;
3284
+ /**
3285
+ * Observed facts per goal, merged at read time; only the `now` window
3286
+ * carries them, and only for goals something was observed about.
3287
+ */
3288
+ readonly observed: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3289
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
3290
+ readonly fact: Schema.Struct<{
3291
+ readonly _tag: Schema.tag<"pull_request">;
3292
+ readonly repository: Schema.String;
3293
+ readonly pullRequest: Schema.Number;
3294
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
3295
+ readonly branch: Schema.String;
3296
+ readonly head: Schema.String;
3297
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
3298
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
3299
+ readonly closedAt: Schema.NullOr<Schema.Number>;
3300
+ }>;
3301
+ readonly observedAt: Schema.Number;
3302
+ readonly confirmedAt: Schema.Number;
3303
+ }>>;
3304
+ readonly agent: Schema.NullOr<Schema.Struct<{
3305
+ readonly fact: Schema.TaggedStruct<"agent", {
3306
+ readonly host: Schema.String;
3307
+ readonly agentId: Schema.String;
3308
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
3309
+ }>;
3310
+ readonly observedAt: Schema.Number;
3311
+ readonly confirmedAt: Schema.Number;
3312
+ }>>;
3313
+ /**
3314
+ * A source that can't currently be read for this goal; the oldest failing
3315
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
3316
+ * that subject last read successfully, null if it never has. A goal with no
3317
+ * pull request URL or no agent has no subject there, so no failure either.
3318
+ */
3319
+ readonly unknown: Schema.NullOr<Schema.Struct<{
3320
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
3321
+ readonly reason: Schema.String;
3322
+ readonly since: Schema.Number;
3323
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
3324
+ }>>;
3325
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3326
+ readonly stale: Schema.Boolean;
3327
+ readonly goalId: Schema.String;
3328
+ }>>>;
3329
+ /**
3330
+ * How many goals' observed entries were left out to keep the snapshot within
3331
+ * the response budget; the most recently updated goals keep theirs.
3332
+ */
3333
+ readonly observedOmitted: Schema.optionalKey<Schema.Number>;
3334
+ /** Activities written by the reconciler or an approved job; only on `now`. */
3335
+ readonly activityProvenance: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3336
+ readonly goalId: Schema.String;
3337
+ readonly activityId: Schema.String;
3338
+ readonly provenance: Schema.Literals<readonly ["reconciler", "approval"]>;
3339
+ readonly approvalJobId: Schema.NullOr<Schema.String>;
3340
+ }>>>;
3341
+ /**
3342
+ * Goals whose non-owner activities are all in `activityProvenance`. In a
3343
+ * covered goal an activity missing from it is the owner's; a goal that isn't
3344
+ * covered has unknown provenance. Trimming to the response budget drops
3345
+ * whole goals, never single activities.
3346
+ */
3347
+ readonly activityProvenanceGoals: Schema.optionalKey<Schema.$Array<Schema.String>>;
3348
+ /** How many goals were left uncovered to keep the snapshot within the response budget. */
3349
+ readonly activityProvenanceOmitted: Schema.optionalKey<Schema.Number>;
2734
3350
  }>;
2735
3351
  export interface WorkSnapshot extends Schema.Schema.Type<typeof WorkSnapshot> {
2736
3352
  }
@@ -2745,7 +3361,7 @@ export declare const WorkSnapshots: Schema.Struct<{
2745
3361
  readonly title: Schema.String;
2746
3362
  readonly summary: Schema.String;
2747
3363
  readonly detail: Schema.String;
2748
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3364
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2749
3365
  readonly owner: Schema.Struct<{
2750
3366
  readonly id: Schema.String;
2751
3367
  readonly name: Schema.String;
@@ -2826,7 +3442,7 @@ export declare const WorkSnapshots: Schema.Struct<{
2826
3442
  readonly title: Schema.String;
2827
3443
  readonly summary: Schema.String;
2828
3444
  readonly detail: Schema.String;
2829
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3445
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2830
3446
  readonly owner: Schema.Struct<{
2831
3447
  readonly id: Schema.String;
2832
3448
  readonly name: Schema.String;
@@ -2905,7 +3521,7 @@ export declare const WorkSnapshots: Schema.Struct<{
2905
3521
  readonly title: Schema.String;
2906
3522
  readonly summary: Schema.String;
2907
3523
  readonly detail: Schema.String;
2908
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3524
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2909
3525
  readonly owner: Schema.Struct<{
2910
3526
  readonly id: Schema.String;
2911
3527
  readonly name: Schema.String;
@@ -2980,6 +3596,72 @@ export declare const WorkSnapshots: Schema.Struct<{
2980
3596
  readonly updatedAt: Schema.Number;
2981
3597
  }>>;
2982
3598
  }>>>;
3599
+ /**
3600
+ * Observed facts per goal, merged at read time; only the `now` window
3601
+ * carries them, and only for goals something was observed about.
3602
+ */
3603
+ readonly observed: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3604
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
3605
+ readonly fact: Schema.Struct<{
3606
+ readonly _tag: Schema.tag<"pull_request">;
3607
+ readonly repository: Schema.String;
3608
+ readonly pullRequest: Schema.Number;
3609
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
3610
+ readonly branch: Schema.String;
3611
+ readonly head: Schema.String;
3612
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
3613
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
3614
+ readonly closedAt: Schema.NullOr<Schema.Number>;
3615
+ }>;
3616
+ readonly observedAt: Schema.Number;
3617
+ readonly confirmedAt: Schema.Number;
3618
+ }>>;
3619
+ readonly agent: Schema.NullOr<Schema.Struct<{
3620
+ readonly fact: Schema.TaggedStruct<"agent", {
3621
+ readonly host: Schema.String;
3622
+ readonly agentId: Schema.String;
3623
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
3624
+ }>;
3625
+ readonly observedAt: Schema.Number;
3626
+ readonly confirmedAt: Schema.Number;
3627
+ }>>;
3628
+ /**
3629
+ * A source that can't currently be read for this goal; the oldest failing
3630
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
3631
+ * that subject last read successfully, null if it never has. A goal with no
3632
+ * pull request URL or no agent has no subject there, so no failure either.
3633
+ */
3634
+ readonly unknown: Schema.NullOr<Schema.Struct<{
3635
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
3636
+ readonly reason: Schema.String;
3637
+ readonly since: Schema.Number;
3638
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
3639
+ }>>;
3640
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3641
+ readonly stale: Schema.Boolean;
3642
+ readonly goalId: Schema.String;
3643
+ }>>>;
3644
+ /**
3645
+ * How many goals' observed entries were left out to keep the snapshot within
3646
+ * the response budget; the most recently updated goals keep theirs.
3647
+ */
3648
+ readonly observedOmitted: Schema.optionalKey<Schema.Number>;
3649
+ /** Activities written by the reconciler or an approved job; only on `now`. */
3650
+ readonly activityProvenance: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3651
+ readonly goalId: Schema.String;
3652
+ readonly activityId: Schema.String;
3653
+ readonly provenance: Schema.Literals<readonly ["reconciler", "approval"]>;
3654
+ readonly approvalJobId: Schema.NullOr<Schema.String>;
3655
+ }>>>;
3656
+ /**
3657
+ * Goals whose non-owner activities are all in `activityProvenance`. In a
3658
+ * covered goal an activity missing from it is the owner's; a goal that isn't
3659
+ * covered has unknown provenance. Trimming to the response budget drops
3660
+ * whole goals, never single activities.
3661
+ */
3662
+ readonly activityProvenanceGoals: Schema.optionalKey<Schema.$Array<Schema.String>>;
3663
+ /** How many goals were left uncovered to keep the snapshot within the response budget. */
3664
+ readonly activityProvenanceOmitted: Schema.optionalKey<Schema.Number>;
2983
3665
  }>;
2984
3666
  readonly day: Schema.Struct<{
2985
3667
  readonly window: Schema.Literals<readonly ["now", "day", "week", "month"]>;
@@ -2990,7 +3672,7 @@ export declare const WorkSnapshots: Schema.Struct<{
2990
3672
  readonly title: Schema.String;
2991
3673
  readonly summary: Schema.String;
2992
3674
  readonly detail: Schema.String;
2993
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3675
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
2994
3676
  readonly owner: Schema.Struct<{
2995
3677
  readonly id: Schema.String;
2996
3678
  readonly name: Schema.String;
@@ -3071,7 +3753,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3071
3753
  readonly title: Schema.String;
3072
3754
  readonly summary: Schema.String;
3073
3755
  readonly detail: Schema.String;
3074
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3756
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3075
3757
  readonly owner: Schema.Struct<{
3076
3758
  readonly id: Schema.String;
3077
3759
  readonly name: Schema.String;
@@ -3150,7 +3832,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3150
3832
  readonly title: Schema.String;
3151
3833
  readonly summary: Schema.String;
3152
3834
  readonly detail: Schema.String;
3153
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3835
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3154
3836
  readonly owner: Schema.Struct<{
3155
3837
  readonly id: Schema.String;
3156
3838
  readonly name: Schema.String;
@@ -3225,6 +3907,72 @@ export declare const WorkSnapshots: Schema.Struct<{
3225
3907
  readonly updatedAt: Schema.Number;
3226
3908
  }>>;
3227
3909
  }>>>;
3910
+ /**
3911
+ * Observed facts per goal, merged at read time; only the `now` window
3912
+ * carries them, and only for goals something was observed about.
3913
+ */
3914
+ readonly observed: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3915
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
3916
+ readonly fact: Schema.Struct<{
3917
+ readonly _tag: Schema.tag<"pull_request">;
3918
+ readonly repository: Schema.String;
3919
+ readonly pullRequest: Schema.Number;
3920
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
3921
+ readonly branch: Schema.String;
3922
+ readonly head: Schema.String;
3923
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
3924
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
3925
+ readonly closedAt: Schema.NullOr<Schema.Number>;
3926
+ }>;
3927
+ readonly observedAt: Schema.Number;
3928
+ readonly confirmedAt: Schema.Number;
3929
+ }>>;
3930
+ readonly agent: Schema.NullOr<Schema.Struct<{
3931
+ readonly fact: Schema.TaggedStruct<"agent", {
3932
+ readonly host: Schema.String;
3933
+ readonly agentId: Schema.String;
3934
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
3935
+ }>;
3936
+ readonly observedAt: Schema.Number;
3937
+ readonly confirmedAt: Schema.Number;
3938
+ }>>;
3939
+ /**
3940
+ * A source that can't currently be read for this goal; the oldest failing
3941
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
3942
+ * that subject last read successfully, null if it never has. A goal with no
3943
+ * pull request URL or no agent has no subject there, so no failure either.
3944
+ */
3945
+ readonly unknown: Schema.NullOr<Schema.Struct<{
3946
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
3947
+ readonly reason: Schema.String;
3948
+ readonly since: Schema.Number;
3949
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
3950
+ }>>;
3951
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3952
+ readonly stale: Schema.Boolean;
3953
+ readonly goalId: Schema.String;
3954
+ }>>>;
3955
+ /**
3956
+ * How many goals' observed entries were left out to keep the snapshot within
3957
+ * the response budget; the most recently updated goals keep theirs.
3958
+ */
3959
+ readonly observedOmitted: Schema.optionalKey<Schema.Number>;
3960
+ /** Activities written by the reconciler or an approved job; only on `now`. */
3961
+ readonly activityProvenance: Schema.optionalKey<Schema.$Array<Schema.Struct<{
3962
+ readonly goalId: Schema.String;
3963
+ readonly activityId: Schema.String;
3964
+ readonly provenance: Schema.Literals<readonly ["reconciler", "approval"]>;
3965
+ readonly approvalJobId: Schema.NullOr<Schema.String>;
3966
+ }>>>;
3967
+ /**
3968
+ * Goals whose non-owner activities are all in `activityProvenance`. In a
3969
+ * covered goal an activity missing from it is the owner's; a goal that isn't
3970
+ * covered has unknown provenance. Trimming to the response budget drops
3971
+ * whole goals, never single activities.
3972
+ */
3973
+ readonly activityProvenanceGoals: Schema.optionalKey<Schema.$Array<Schema.String>>;
3974
+ /** How many goals were left uncovered to keep the snapshot within the response budget. */
3975
+ readonly activityProvenanceOmitted: Schema.optionalKey<Schema.Number>;
3228
3976
  }>;
3229
3977
  readonly week: Schema.Struct<{
3230
3978
  readonly window: Schema.Literals<readonly ["now", "day", "week", "month"]>;
@@ -3235,7 +3983,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3235
3983
  readonly title: Schema.String;
3236
3984
  readonly summary: Schema.String;
3237
3985
  readonly detail: Schema.String;
3238
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
3986
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3239
3987
  readonly owner: Schema.Struct<{
3240
3988
  readonly id: Schema.String;
3241
3989
  readonly name: Schema.String;
@@ -3316,7 +4064,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3316
4064
  readonly title: Schema.String;
3317
4065
  readonly summary: Schema.String;
3318
4066
  readonly detail: Schema.String;
3319
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
4067
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3320
4068
  readonly owner: Schema.Struct<{
3321
4069
  readonly id: Schema.String;
3322
4070
  readonly name: Schema.String;
@@ -3395,7 +4143,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3395
4143
  readonly title: Schema.String;
3396
4144
  readonly summary: Schema.String;
3397
4145
  readonly detail: Schema.String;
3398
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
4146
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3399
4147
  readonly owner: Schema.Struct<{
3400
4148
  readonly id: Schema.String;
3401
4149
  readonly name: Schema.String;
@@ -3470,6 +4218,72 @@ export declare const WorkSnapshots: Schema.Struct<{
3470
4218
  readonly updatedAt: Schema.Number;
3471
4219
  }>>;
3472
4220
  }>>>;
4221
+ /**
4222
+ * Observed facts per goal, merged at read time; only the `now` window
4223
+ * carries them, and only for goals something was observed about.
4224
+ */
4225
+ readonly observed: Schema.optionalKey<Schema.$Array<Schema.Struct<{
4226
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
4227
+ readonly fact: Schema.Struct<{
4228
+ readonly _tag: Schema.tag<"pull_request">;
4229
+ readonly repository: Schema.String;
4230
+ readonly pullRequest: Schema.Number;
4231
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
4232
+ readonly branch: Schema.String;
4233
+ readonly head: Schema.String;
4234
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
4235
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
4236
+ readonly closedAt: Schema.NullOr<Schema.Number>;
4237
+ }>;
4238
+ readonly observedAt: Schema.Number;
4239
+ readonly confirmedAt: Schema.Number;
4240
+ }>>;
4241
+ readonly agent: Schema.NullOr<Schema.Struct<{
4242
+ readonly fact: Schema.TaggedStruct<"agent", {
4243
+ readonly host: Schema.String;
4244
+ readonly agentId: Schema.String;
4245
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
4246
+ }>;
4247
+ readonly observedAt: Schema.Number;
4248
+ readonly confirmedAt: Schema.Number;
4249
+ }>>;
4250
+ /**
4251
+ * A source that can't currently be read for this goal; the oldest failing
4252
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
4253
+ * that subject last read successfully, null if it never has. A goal with no
4254
+ * pull request URL or no agent has no subject there, so no failure either.
4255
+ */
4256
+ readonly unknown: Schema.NullOr<Schema.Struct<{
4257
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
4258
+ readonly reason: Schema.String;
4259
+ readonly since: Schema.Number;
4260
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
4261
+ }>>;
4262
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
4263
+ readonly stale: Schema.Boolean;
4264
+ readonly goalId: Schema.String;
4265
+ }>>>;
4266
+ /**
4267
+ * How many goals' observed entries were left out to keep the snapshot within
4268
+ * the response budget; the most recently updated goals keep theirs.
4269
+ */
4270
+ readonly observedOmitted: Schema.optionalKey<Schema.Number>;
4271
+ /** Activities written by the reconciler or an approved job; only on `now`. */
4272
+ readonly activityProvenance: Schema.optionalKey<Schema.$Array<Schema.Struct<{
4273
+ readonly goalId: Schema.String;
4274
+ readonly activityId: Schema.String;
4275
+ readonly provenance: Schema.Literals<readonly ["reconciler", "approval"]>;
4276
+ readonly approvalJobId: Schema.NullOr<Schema.String>;
4277
+ }>>>;
4278
+ /**
4279
+ * Goals whose non-owner activities are all in `activityProvenance`. In a
4280
+ * covered goal an activity missing from it is the owner's; a goal that isn't
4281
+ * covered has unknown provenance. Trimming to the response budget drops
4282
+ * whole goals, never single activities.
4283
+ */
4284
+ readonly activityProvenanceGoals: Schema.optionalKey<Schema.$Array<Schema.String>>;
4285
+ /** How many goals were left uncovered to keep the snapshot within the response budget. */
4286
+ readonly activityProvenanceOmitted: Schema.optionalKey<Schema.Number>;
3473
4287
  }>;
3474
4288
  readonly month: Schema.Struct<{
3475
4289
  readonly window: Schema.Literals<readonly ["now", "day", "week", "month"]>;
@@ -3480,7 +4294,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3480
4294
  readonly title: Schema.String;
3481
4295
  readonly summary: Schema.String;
3482
4296
  readonly detail: Schema.String;
3483
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
4297
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3484
4298
  readonly owner: Schema.Struct<{
3485
4299
  readonly id: Schema.String;
3486
4300
  readonly name: Schema.String;
@@ -3561,7 +4375,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3561
4375
  readonly title: Schema.String;
3562
4376
  readonly summary: Schema.String;
3563
4377
  readonly detail: Schema.String;
3564
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
4378
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3565
4379
  readonly owner: Schema.Struct<{
3566
4380
  readonly id: Schema.String;
3567
4381
  readonly name: Schema.String;
@@ -3640,7 +4454,7 @@ export declare const WorkSnapshots: Schema.Struct<{
3640
4454
  readonly title: Schema.String;
3641
4455
  readonly summary: Schema.String;
3642
4456
  readonly detail: Schema.String;
3643
- readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed"]>;
4457
+ readonly state: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
3644
4458
  readonly owner: Schema.Struct<{
3645
4459
  readonly id: Schema.String;
3646
4460
  readonly name: Schema.String;
@@ -3715,6 +4529,72 @@ export declare const WorkSnapshots: Schema.Struct<{
3715
4529
  readonly updatedAt: Schema.Number;
3716
4530
  }>>;
3717
4531
  }>>>;
4532
+ /**
4533
+ * Observed facts per goal, merged at read time; only the `now` window
4534
+ * carries them, and only for goals something was observed about.
4535
+ */
4536
+ readonly observed: Schema.optionalKey<Schema.$Array<Schema.Struct<{
4537
+ readonly pullRequest: Schema.NullOr<Schema.Struct<{
4538
+ readonly fact: Schema.Struct<{
4539
+ readonly _tag: Schema.tag<"pull_request">;
4540
+ readonly repository: Schema.String;
4541
+ readonly pullRequest: Schema.Number;
4542
+ readonly state: Schema.Literals<readonly ["open", "merged", "closed"]>;
4543
+ readonly branch: Schema.String;
4544
+ readonly head: Schema.String;
4545
+ readonly review: Schema.Literals<readonly ["not_requested", "requested", "changes_requested", "approved"]>;
4546
+ readonly checks: Schema.Literals<readonly ["none", "pending", "passing", "failing"]>;
4547
+ readonly closedAt: Schema.NullOr<Schema.Number>;
4548
+ }>;
4549
+ readonly observedAt: Schema.Number;
4550
+ readonly confirmedAt: Schema.Number;
4551
+ }>>;
4552
+ readonly agent: Schema.NullOr<Schema.Struct<{
4553
+ readonly fact: Schema.TaggedStruct<"agent", {
4554
+ readonly host: Schema.String;
4555
+ readonly agentId: Schema.String;
4556
+ readonly status: Schema.Literals<readonly ["idle", "working", "blocked", "done", "gone"]>;
4557
+ }>;
4558
+ readonly observedAt: Schema.Number;
4559
+ readonly confirmedAt: Schema.Number;
4560
+ }>>;
4561
+ /**
4562
+ * A source that can't currently be read for this goal; the oldest failing
4563
+ * run when both its pull request and its agent fail. `lastGoodAt` is when
4564
+ * that subject last read successfully, null if it never has. A goal with no
4565
+ * pull request URL or no agent has no subject there, so no failure either.
4566
+ */
4567
+ readonly unknown: Schema.NullOr<Schema.Struct<{
4568
+ readonly source: Schema.Literals<readonly ["github", "herdr", "git"]>;
4569
+ readonly reason: Schema.String;
4570
+ readonly since: Schema.Number;
4571
+ readonly lastGoodAt: Schema.NullOr<Schema.Number>;
4572
+ }>>;
4573
+ readonly displayState: Schema.Literals<readonly ["planned", "working", "blocked", "review", "deployed", "completed", "abandoned"]>;
4574
+ readonly stale: Schema.Boolean;
4575
+ readonly goalId: Schema.String;
4576
+ }>>>;
4577
+ /**
4578
+ * How many goals' observed entries were left out to keep the snapshot within
4579
+ * the response budget; the most recently updated goals keep theirs.
4580
+ */
4581
+ readonly observedOmitted: Schema.optionalKey<Schema.Number>;
4582
+ /** Activities written by the reconciler or an approved job; only on `now`. */
4583
+ readonly activityProvenance: Schema.optionalKey<Schema.$Array<Schema.Struct<{
4584
+ readonly goalId: Schema.String;
4585
+ readonly activityId: Schema.String;
4586
+ readonly provenance: Schema.Literals<readonly ["reconciler", "approval"]>;
4587
+ readonly approvalJobId: Schema.NullOr<Schema.String>;
4588
+ }>>>;
4589
+ /**
4590
+ * Goals whose non-owner activities are all in `activityProvenance`. In a
4591
+ * covered goal an activity missing from it is the owner's; a goal that isn't
4592
+ * covered has unknown provenance. Trimming to the response budget drops
4593
+ * whole goals, never single activities.
4594
+ */
4595
+ readonly activityProvenanceGoals: Schema.optionalKey<Schema.$Array<Schema.String>>;
4596
+ /** How many goals were left uncovered to keep the snapshot within the response budget. */
4597
+ readonly activityProvenanceOmitted: Schema.optionalKey<Schema.Number>;
3718
4598
  }>;
3719
4599
  }>;
3720
4600
  export interface WorkSnapshots extends Schema.Schema.Type<typeof WorkSnapshots> {