@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
@@ -0,0 +1,240 @@
1
+ import { fleetResponseBodyMaxBytes } from "@knpkv/herdr-fleet";
2
+ import { Schema } from "effect";
3
+ import { WorkActivityProvenance, WorkGoalObservedEntry, WorkSnapshots } from "./model.js";
4
+ /**
5
+ * The subject a pull request's facts and failures are stored under. GitHub
6
+ * owner and repository names are case-insensitive (and ASCII), so they are
7
+ * lowercased: `Knpkv/npm` and `knpkv/npm` are one subject.
8
+ */
9
+ export const pullRequestSubject = (repository, pullRequest) => `github:${asciiLower(repository)}#${pullRequest}`;
10
+ /** The subject an agent's facts and failures are stored under; the host is case-insensitive. */
11
+ export const agentSubject = (host, agentId) => `herdr:${asciiLower(host)}/${agentId}`;
12
+ /**
13
+ * Lowercases ASCII letters only. Full Unicode lowercasing can lengthen a
14
+ * string (`İ` becomes two code units), which would push a bounded identity
15
+ * past its limit; hosts and GitHub names compare case-insensitively in ASCII.
16
+ */
17
+ export const asciiLower = (value) => value.replace(/[A-Z]/g, (letter) => letter.toLowerCase());
18
+ const githubSubject = /^github:([^#]+)#([1-9][0-9]*)$/;
19
+ const herdrSubject = /^herdr:([^/]+)\/(.+)$/;
20
+ /**
21
+ * The canonical form of a subject a failed read names, so it lands on the
22
+ * same row as that subject's facts; null when the subject does not belong to
23
+ * its source (a `github` failure must name `github:<repo>#<n>`, a `herdr`
24
+ * failure `herdr:<host>/<agentId>`). `git` subjects are kept as given.
25
+ */
26
+ export const canonicalSubject = (source, subject) => {
27
+ if (source === "git")
28
+ return subject;
29
+ if (source === "github") {
30
+ const match = githubSubject.exec(subject);
31
+ return match?.[1] === undefined || match[2] === undefined ? null : pullRequestSubject(match[1], Number(match[2]));
32
+ }
33
+ const match = herdrSubject.exec(subject);
34
+ return match?.[1] === undefined || match[2] === undefined ? null : agentSubject(match[1], match[2]);
35
+ };
36
+ /**
37
+ * The key one observation is stored under: one pull request, or one agent on
38
+ * one host. An `unknown` observation names the subject it failed to read, so
39
+ * a failure lands on the same subject as that subject's facts.
40
+ */
41
+ export const observationSubject = (observation) => {
42
+ switch (observation._tag) {
43
+ case "pull_request":
44
+ return pullRequestSubject(observation.repository, observation.pullRequest);
45
+ case "agent":
46
+ return agentSubject(observation.host, observation.agentId);
47
+ case "unknown":
48
+ return canonicalSubject(observation.source, observation.subject) ?? observation.subject;
49
+ }
50
+ };
51
+ /** An owner whose agent has been gone this long, on unfinished work, is flagged stale. */
52
+ export const staleOwnerAfterMillis = 24 * 60 * 60 * 1_000;
53
+ const terminalStates = new Set(["completed", "deployed", "abandoned"]);
54
+ const reviewUrl = /^https:\/\/github\.com\/([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)\/pull\/([1-9][0-9]*)$/;
55
+ /** The goal's own subjects: its pull request (from `review.url`) and its owner's agent (or connect target). */
56
+ const goalSubjects = (goal) => {
57
+ const match = reviewUrl.exec(goal.review?.url ?? "");
58
+ // Older goals carry only a connect target; it names the same agent.
59
+ const owner = goal.agentHierarchy?.agent ?? goal.connectTarget;
60
+ return {
61
+ agent: owner === undefined || owner === null ? null : agentSubject(owner.host, owner.agentId),
62
+ pullRequest: match?.[1] === undefined || match[2] === undefined
63
+ ? null
64
+ : pullRequestSubject(match[1], Number(match[2]))
65
+ };
66
+ };
67
+ /** The subject of the pull request a goal's `review.url` names, or null when it names none. */
68
+ export const goalPullRequestSubject = (goal) => goalSubjects(goal).pullRequest;
69
+ const terminalPullRequestState = (pullRequest) => pullRequest.state === "merged" ? "completed" : pullRequest.state === "closed" ? "abandoned" : null;
70
+ const agentState = (agent) => agent.status === "working" || agent.status === "blocked" ? agent.status : null;
71
+ const observeWith = (goal, facts, failures, now) => {
72
+ const subjects = goalSubjects(goal);
73
+ const pullRequestFact = subjects.pullRequest === null ? undefined : facts.get(subjects.pullRequest);
74
+ const agentFact = subjects.agent === null ? undefined : facts.get(subjects.agent);
75
+ const pullRequest = pullRequestFact?.observation._tag === "pull_request"
76
+ ? {
77
+ confirmedAt: pullRequestFact.confirmedAt,
78
+ fact: pullRequestFact.observation,
79
+ observedAt: pullRequestFact.observedAt
80
+ }
81
+ : null;
82
+ const agent = agentFact?.observation._tag === "agent"
83
+ ? { confirmedAt: agentFact.confirmedAt, fact: agentFact.observation, observedAt: agentFact.observedAt }
84
+ : null;
85
+ const unknown = [subjects.pullRequest, subjects.agent]
86
+ .flatMap((subject) => {
87
+ const failure = subject === null ? undefined : failures.get(subject);
88
+ return failure === undefined || subject === null ? [] : [{
89
+ lastGoodAt: facts.get(subject)?.confirmedAt ?? null,
90
+ reason: failure.reason,
91
+ since: failure.since,
92
+ source: failure.source
93
+ }];
94
+ })
95
+ .reduce((oldest, next) => oldest === null || next.since < oldest.since ? next : oldest, null);
96
+ const displayState = terminalStates.has(goal.state)
97
+ ? goal.state
98
+ : (pullRequest === null ? null : terminalPullRequestState(pullRequest.fact)) ??
99
+ (goal.state === "blocked" ? "blocked" : null) ??
100
+ (agent === null ? null : agentState(agent.fact)) ??
101
+ (pullRequest === null ? goal.state : "review");
102
+ const stale = !terminalStates.has(displayState) && agent !== null && agent.fact.status === "gone" &&
103
+ now - agent.observedAt > staleOwnerAfterMillis;
104
+ return { agent, displayState, pullRequest, stale, unknown };
105
+ };
106
+ const bySubject = (rows) => new Map(rows.map((row) => [row.subject, row]));
107
+ /**
108
+ * Overlays the latest observed facts and current read failures on one goal
109
+ * for display, matched through the goal's own subjects. Precedence: a
110
+ * recorded terminal state, then a terminal pull request, then the owner's
111
+ * blocker, then the agent's working/blocked status, then an open pull request
112
+ * (review), then the goal's own state. The goal itself is never changed.
113
+ */
114
+ export const observeGoal = (goal, facts, failures, now) => observeWith(goal, bySubject(facts), bySubject(failures), now);
115
+ /**
116
+ * The encoded size the overlay may bring a snapshot up to: the Fleet response
117
+ * limit less the newline the HTTP route appends after the JSON body.
118
+ */
119
+ export const workSnapshotBudgetBytes = fleetResponseBodyMaxBytes - "\n".length;
120
+ const utf8 = new TextEncoder();
121
+ const encodedBytes = (value) => utf8.encode(JSON.stringify(value)).byteLength;
122
+ const observedSomething = ({ agent, pullRequest, unknown }) => agent !== null || pullRequest !== null || unknown !== null;
123
+ /**
124
+ * Adds observed facts to the `now` window, for each goal something was
125
+ * observed about (`observed` is present, possibly empty, whenever it fits). Earlier windows are history and stay as recorded. Entries
126
+ * are kept in the window's goal order (most recently updated first) while the
127
+ * encoded snapshots stay within `maxBytes`; the rest are counted in
128
+ * `observedOmitted`, never silently dropped.
129
+ */
130
+ export const withObservedFacts = (snapshots, facts, failures, maxBytes) => {
131
+ // A snapshot at time t shows only what was known at t: facts first seen by
132
+ // then, with the last confirmation made by then (the first sighting, also a
133
+ // real read, when the latest is later), and failures whose latest failed
134
+ // read, and so their reason, was known by then.
135
+ const asOf = snapshots.observedAt;
136
+ const factMap = bySubject(facts.filter(({ observedAt }) => observedAt <= asOf).map((fact) => ({
137
+ ...fact,
138
+ confirmedAt: fact.confirmedAt <= asOf ? fact.confirmedAt : fact.observedAt
139
+ })));
140
+ const failureMap = bySubject(failures.filter(({ lastAt }) => lastAt <= asOf));
141
+ const candidates = snapshots.now.goals.flatMap((goal) => {
142
+ const observed = observeWith(goal, factMap, failureMap, snapshots.observedAt);
143
+ return observedSomething(observed) ? [{ goalId: goal.id, ...observed }] : [];
144
+ });
145
+ const encode = Schema.encodeSync(WorkSnapshots);
146
+ // Any overlay already on the snapshots is replaced, never added to.
147
+ const { observed: _previous, observedOmitted: _previousOmitted, ...bareNow } = snapshots.now;
148
+ const bare = { ...snapshots, now: bareNow };
149
+ const withEntries = (kept) => {
150
+ const omitted = candidates.length - kept.length;
151
+ const now = { ...bareNow, observed: kept };
152
+ return { ...bare, now: omitted === 0 ? now : { ...now, observedOmitted: omitted } };
153
+ };
154
+ // Estimate greedily, then check the real encoding and drop entries until it
155
+ // fits. `observed` is always present, empty when nothing was observed; if
156
+ // not even that fits, the snapshots carry no overlay keys at all, which a
157
+ // reader treats as "live state not available".
158
+ let used = encodedBytes(encode(bare)) + 64;
159
+ const kept = [];
160
+ for (const entry of candidates) {
161
+ const bytes = encodedBytes(Schema.encodeSync(WorkGoalObservedEntry)(entry)) + 1;
162
+ if (used + bytes > maxBytes)
163
+ break;
164
+ kept.push(entry);
165
+ used += bytes;
166
+ }
167
+ for (;;) {
168
+ const result = withEntries(kept);
169
+ if (encodedBytes(encode(result)) <= maxBytes)
170
+ return result;
171
+ if (kept.length === 0)
172
+ return bare;
173
+ kept.pop();
174
+ }
175
+ };
176
+ const sameActivity = (left, right) => left.id === right.id && left.kind === right.kind && left.summary === right.summary &&
177
+ left.occurredAt === right.occurredAt;
178
+ /** The reconciler's checkpoints, and their activities, use this id prefix. */
179
+ export const reconcilerEventPrefix = "reconciler.";
180
+ /**
181
+ * Adds who wrote each non-owner activity to the `now` window: the reconciler
182
+ * or an approved job. Goals are covered whole, in the window's goal order,
183
+ * while the encoded snapshots stay within `maxBytes`; `activityProvenanceGoals`
184
+ * names the covered ones, so a missing activity of a covered goal is the
185
+ * owner's and an uncovered goal is unknown, never guessed.
186
+ */
187
+ export const withActivityProvenance = (snapshots, approvals, reconcilerEvents, activityOrigins, maxBytes) => {
188
+ const reconciler = new Set(reconcilerEvents.map(({ eventId, goalId }) => `${goalId}\u0000${eventId}`));
189
+ const approvalJob = new Map(approvals.map(({ activityId, approvalJobId, goalId }) => [`${goalId}\u0000${activityId}`, approvalJobId]));
190
+ const encode = Schema.encodeSync(WorkSnapshots);
191
+ // Room for the three keys on top of the bare snapshots.
192
+ let used = encodedBytes(encode(snapshots)) + 128;
193
+ const provenance = [];
194
+ const covered = [];
195
+ for (const goal of snapshots.now.goals) {
196
+ const entries = (goal.activity ?? []).flatMap((activity) => {
197
+ // Authorship comes from what wrote the activity, never from its id alone,
198
+ // and holds only while the activity still reads exactly as written.
199
+ const key = `${goal.id}\u0000${activity.id}`;
200
+ const origin = activityOrigins.get(key);
201
+ if (origin === undefined || !sameActivity(origin.activity, activity))
202
+ return [];
203
+ const job = approvalJob.get(key);
204
+ // An approved operation writes its activity in its own checkpoint, whose
205
+ // event id is the activity id; any other origin is not its write.
206
+ if (job !== undefined && origin.eventId === activity.id) {
207
+ return [{ activityId: activity.id, approvalJobId: job, goalId: goal.id, provenance: "approval" }];
208
+ }
209
+ return reconciler.has(`${goal.id}\u0000${origin.eventId}`)
210
+ ? [{ activityId: activity.id, approvalJobId: null, goalId: goal.id, provenance: "reconciler" }]
211
+ : [];
212
+ });
213
+ const bytes = encodedBytes(goal.id) + 3 +
214
+ entries.reduce((sum, entry) => sum + encodedBytes(Schema.encodeSync(WorkActivityProvenance)(entry)) + 1, 0);
215
+ // Goals are covered in order; once one doesn't fit, the rest stay uncovered.
216
+ if (used + bytes > maxBytes)
217
+ break;
218
+ for (const entry of entries)
219
+ provenance.push(entry);
220
+ covered.push(goal.id);
221
+ used += bytes;
222
+ }
223
+ // Check the real encoding and uncover whole goals from the end until it
224
+ // fits; if not even empty lists fit, carry no provenance (all unknown).
225
+ for (;;) {
226
+ const uncovered = snapshots.now.goals.length - covered.length;
227
+ const now = {
228
+ ...snapshots.now,
229
+ activityProvenance: provenance.filter(({ goalId }) => covered.includes(goalId)),
230
+ activityProvenanceGoals: covered
231
+ };
232
+ const result = { ...snapshots, now: uncovered === 0 ? now : { ...now, activityProvenanceOmitted: uncovered } };
233
+ if (encodedBytes(encode(result)) <= maxBytes)
234
+ return result;
235
+ if (covered.length === 0)
236
+ return snapshots;
237
+ covered.pop();
238
+ }
239
+ };
240
+ //# sourceMappingURL=observed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"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AAM,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;QAC7D,MAAM,GAAG,GAAG;YACV,GAAG,SAAS,CAAC,GAAG;YAChB,kBAAkB,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC/E,uBAAuB,EAAE,OAAO;SACjC,CAAA;QACD,MAAM,MAAM,GAAG,EAAE,GAAG,SAAS,EAAE,GAAG,EAAE,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,yBAAyB,EAAE,SAAS,EAAE,EAAE,CAAA;QAC9G,IAAI,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,QAAQ;YAAE,OAAO,MAAM,CAAA;QAC3D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,SAAS,CAAA;QAC1C,OAAO,CAAC,GAAG,EAAE,CAAA;IACf,CAAC;AACH,CAAC,CAAA"}
@@ -12,7 +12,7 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
12
12
  readonly title: string;
13
13
  readonly summary: string;
14
14
  readonly detail: string;
15
- readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
15
+ readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
16
16
  readonly owner: {
17
17
  readonly id: string;
18
18
  readonly name: string;
@@ -93,7 +93,7 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
93
93
  readonly title: string;
94
94
  readonly summary: string;
95
95
  readonly detail: string;
96
- readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
96
+ readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
97
97
  readonly owner: {
98
98
  readonly id: string;
99
99
  readonly name: string;
@@ -172,7 +172,7 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
172
172
  readonly title: string;
173
173
  readonly summary: string;
174
174
  readonly detail: string;
175
- readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
175
+ readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
176
176
  readonly owner: {
177
177
  readonly id: string;
178
178
  readonly name: string;
@@ -247,6 +247,51 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
247
247
  readonly updatedAt: number;
248
248
  }[];
249
249
  }[];
250
+ readonly observed?: readonly {
251
+ readonly pullRequest: {
252
+ readonly fact: {
253
+ readonly _tag: "pull_request";
254
+ readonly repository: string;
255
+ readonly pullRequest: number;
256
+ readonly state: "closed" | "merged" | "open";
257
+ readonly branch: string;
258
+ readonly head: string;
259
+ readonly review: "approved" | "changes_requested" | "not_requested" | "requested";
260
+ readonly checks: "failing" | "none" | "passing" | "pending";
261
+ readonly closedAt: number | null;
262
+ };
263
+ readonly observedAt: number;
264
+ readonly confirmedAt: number;
265
+ } | null;
266
+ readonly agent: {
267
+ readonly fact: {
268
+ readonly _tag: "agent";
269
+ readonly host: string;
270
+ readonly agentId: string;
271
+ readonly status: "blocked" | "done" | "gone" | "idle" | "working";
272
+ };
273
+ readonly observedAt: number;
274
+ readonly confirmedAt: number;
275
+ } | null;
276
+ readonly unknown: {
277
+ readonly source: "git" | "github" | "herdr";
278
+ readonly reason: string;
279
+ readonly since: number;
280
+ readonly lastGoodAt: number | null;
281
+ } | null;
282
+ readonly displayState: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
283
+ readonly stale: boolean;
284
+ readonly goalId: string;
285
+ }[];
286
+ readonly observedOmitted?: number;
287
+ readonly activityProvenance?: readonly {
288
+ readonly goalId: string;
289
+ readonly activityId: string;
290
+ readonly provenance: "approval" | "reconciler";
291
+ readonly approvalJobId: string | null;
292
+ }[];
293
+ readonly activityProvenanceGoals?: readonly string[];
294
+ readonly activityProvenanceOmitted?: number;
250
295
  };
251
296
  readonly day: {
252
297
  readonly window: "day" | "month" | "now" | "week";
@@ -257,7 +302,7 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
257
302
  readonly title: string;
258
303
  readonly summary: string;
259
304
  readonly detail: string;
260
- readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
305
+ readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
261
306
  readonly owner: {
262
307
  readonly id: string;
263
308
  readonly name: string;
@@ -338,7 +383,7 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
338
383
  readonly title: string;
339
384
  readonly summary: string;
340
385
  readonly detail: string;
341
- readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
386
+ readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
342
387
  readonly owner: {
343
388
  readonly id: string;
344
389
  readonly name: string;
@@ -417,7 +462,7 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
417
462
  readonly title: string;
418
463
  readonly summary: string;
419
464
  readonly detail: string;
420
- readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
465
+ readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
421
466
  readonly owner: {
422
467
  readonly id: string;
423
468
  readonly name: string;
@@ -492,6 +537,51 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
492
537
  readonly updatedAt: number;
493
538
  }[];
494
539
  }[];
540
+ readonly observed?: readonly {
541
+ readonly pullRequest: {
542
+ readonly fact: {
543
+ readonly _tag: "pull_request";
544
+ readonly repository: string;
545
+ readonly pullRequest: number;
546
+ readonly state: "closed" | "merged" | "open";
547
+ readonly branch: string;
548
+ readonly head: string;
549
+ readonly review: "approved" | "changes_requested" | "not_requested" | "requested";
550
+ readonly checks: "failing" | "none" | "passing" | "pending";
551
+ readonly closedAt: number | null;
552
+ };
553
+ readonly observedAt: number;
554
+ readonly confirmedAt: number;
555
+ } | null;
556
+ readonly agent: {
557
+ readonly fact: {
558
+ readonly _tag: "agent";
559
+ readonly host: string;
560
+ readonly agentId: string;
561
+ readonly status: "blocked" | "done" | "gone" | "idle" | "working";
562
+ };
563
+ readonly observedAt: number;
564
+ readonly confirmedAt: number;
565
+ } | null;
566
+ readonly unknown: {
567
+ readonly source: "git" | "github" | "herdr";
568
+ readonly reason: string;
569
+ readonly since: number;
570
+ readonly lastGoodAt: number | null;
571
+ } | null;
572
+ readonly displayState: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
573
+ readonly stale: boolean;
574
+ readonly goalId: string;
575
+ }[];
576
+ readonly observedOmitted?: number;
577
+ readonly activityProvenance?: readonly {
578
+ readonly goalId: string;
579
+ readonly activityId: string;
580
+ readonly provenance: "approval" | "reconciler";
581
+ readonly approvalJobId: string | null;
582
+ }[];
583
+ readonly activityProvenanceGoals?: readonly string[];
584
+ readonly activityProvenanceOmitted?: number;
495
585
  };
496
586
  readonly week: {
497
587
  readonly window: "day" | "month" | "now" | "week";
@@ -502,7 +592,7 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
502
592
  readonly title: string;
503
593
  readonly summary: string;
504
594
  readonly detail: string;
505
- readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
595
+ readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
506
596
  readonly owner: {
507
597
  readonly id: string;
508
598
  readonly name: string;
@@ -583,7 +673,7 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
583
673
  readonly title: string;
584
674
  readonly summary: string;
585
675
  readonly detail: string;
586
- readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
676
+ readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
587
677
  readonly owner: {
588
678
  readonly id: string;
589
679
  readonly name: string;
@@ -662,7 +752,7 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
662
752
  readonly title: string;
663
753
  readonly summary: string;
664
754
  readonly detail: string;
665
- readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
755
+ readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
666
756
  readonly owner: {
667
757
  readonly id: string;
668
758
  readonly name: string;
@@ -737,6 +827,51 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
737
827
  readonly updatedAt: number;
738
828
  }[];
739
829
  }[];
830
+ readonly observed?: readonly {
831
+ readonly pullRequest: {
832
+ readonly fact: {
833
+ readonly _tag: "pull_request";
834
+ readonly repository: string;
835
+ readonly pullRequest: number;
836
+ readonly state: "closed" | "merged" | "open";
837
+ readonly branch: string;
838
+ readonly head: string;
839
+ readonly review: "approved" | "changes_requested" | "not_requested" | "requested";
840
+ readonly checks: "failing" | "none" | "passing" | "pending";
841
+ readonly closedAt: number | null;
842
+ };
843
+ readonly observedAt: number;
844
+ readonly confirmedAt: number;
845
+ } | null;
846
+ readonly agent: {
847
+ readonly fact: {
848
+ readonly _tag: "agent";
849
+ readonly host: string;
850
+ readonly agentId: string;
851
+ readonly status: "blocked" | "done" | "gone" | "idle" | "working";
852
+ };
853
+ readonly observedAt: number;
854
+ readonly confirmedAt: number;
855
+ } | null;
856
+ readonly unknown: {
857
+ readonly source: "git" | "github" | "herdr";
858
+ readonly reason: string;
859
+ readonly since: number;
860
+ readonly lastGoodAt: number | null;
861
+ } | null;
862
+ readonly displayState: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
863
+ readonly stale: boolean;
864
+ readonly goalId: string;
865
+ }[];
866
+ readonly observedOmitted?: number;
867
+ readonly activityProvenance?: readonly {
868
+ readonly goalId: string;
869
+ readonly activityId: string;
870
+ readonly provenance: "approval" | "reconciler";
871
+ readonly approvalJobId: string | null;
872
+ }[];
873
+ readonly activityProvenanceGoals?: readonly string[];
874
+ readonly activityProvenanceOmitted?: number;
740
875
  };
741
876
  readonly month: {
742
877
  readonly window: "day" | "month" | "now" | "week";
@@ -747,7 +882,7 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
747
882
  readonly title: string;
748
883
  readonly summary: string;
749
884
  readonly detail: string;
750
- readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
885
+ readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
751
886
  readonly owner: {
752
887
  readonly id: string;
753
888
  readonly name: string;
@@ -828,7 +963,7 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
828
963
  readonly title: string;
829
964
  readonly summary: string;
830
965
  readonly detail: string;
831
- readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
966
+ readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
832
967
  readonly owner: {
833
968
  readonly id: string;
834
969
  readonly name: string;
@@ -907,7 +1042,7 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
907
1042
  readonly title: string;
908
1043
  readonly summary: string;
909
1044
  readonly detail: string;
910
- readonly state: "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
1045
+ readonly state: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
911
1046
  readonly owner: {
912
1047
  readonly id: string;
913
1048
  readonly name: string;
@@ -982,6 +1117,51 @@ export declare const projectWorkSnapshots: (input: readonly WorkGoalCheckpoint[]
982
1117
  readonly updatedAt: number;
983
1118
  }[];
984
1119
  }[];
1120
+ readonly observed?: readonly {
1121
+ readonly pullRequest: {
1122
+ readonly fact: {
1123
+ readonly _tag: "pull_request";
1124
+ readonly repository: string;
1125
+ readonly pullRequest: number;
1126
+ readonly state: "closed" | "merged" | "open";
1127
+ readonly branch: string;
1128
+ readonly head: string;
1129
+ readonly review: "approved" | "changes_requested" | "not_requested" | "requested";
1130
+ readonly checks: "failing" | "none" | "passing" | "pending";
1131
+ readonly closedAt: number | null;
1132
+ };
1133
+ readonly observedAt: number;
1134
+ readonly confirmedAt: number;
1135
+ } | null;
1136
+ readonly agent: {
1137
+ readonly fact: {
1138
+ readonly _tag: "agent";
1139
+ readonly host: string;
1140
+ readonly agentId: string;
1141
+ readonly status: "blocked" | "done" | "gone" | "idle" | "working";
1142
+ };
1143
+ readonly observedAt: number;
1144
+ readonly confirmedAt: number;
1145
+ } | null;
1146
+ readonly unknown: {
1147
+ readonly source: "git" | "github" | "herdr";
1148
+ readonly reason: string;
1149
+ readonly since: number;
1150
+ readonly lastGoodAt: number | null;
1151
+ } | null;
1152
+ readonly displayState: "abandoned" | "blocked" | "completed" | "deployed" | "planned" | "review" | "working";
1153
+ readonly stale: boolean;
1154
+ readonly goalId: string;
1155
+ }[];
1156
+ readonly observedOmitted?: number;
1157
+ readonly activityProvenance?: readonly {
1158
+ readonly goalId: string;
1159
+ readonly activityId: string;
1160
+ readonly provenance: "approval" | "reconciler";
1161
+ readonly approvalJobId: string | null;
1162
+ }[];
1163
+ readonly activityProvenanceGoals?: readonly string[];
1164
+ readonly activityProvenanceOmitted?: number;
985
1165
  };
986
1166
  }, WorkProjectionError, never>;
987
1167
  //# sourceMappingURL=projection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../src/projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEjD,OAAO,EAEL,kBAAkB,EAMnB,MAAM,YAAY,CAAA;AAmHnB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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