@telora/daemon 0.22.137 → 0.22.146

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 (78) hide show
  1. package/build-info.json +13 -3
  2. package/dist/audit/audit-phase.d.ts +34 -1
  3. package/dist/audit/audit-phase.d.ts.map +1 -1
  4. package/dist/audit/audit-phase.js +92 -9
  5. package/dist/audit/audit-phase.js.map +1 -1
  6. package/dist/audit/audit-prompt.d.ts +174 -0
  7. package/dist/audit/audit-prompt.d.ts.map +1 -1
  8. package/dist/audit/audit-prompt.js +365 -2
  9. package/dist/audit/audit-prompt.js.map +1 -1
  10. package/dist/completion/review-coverage-shas.d.ts +49 -0
  11. package/dist/completion/review-coverage-shas.d.ts.map +1 -0
  12. package/dist/completion/review-coverage-shas.js +128 -0
  13. package/dist/completion/review-coverage-shas.js.map +1 -0
  14. package/dist/completion/review-exit-deps.d.ts +15 -2
  15. package/dist/completion/review-exit-deps.d.ts.map +1 -1
  16. package/dist/completion/review-exit-deps.js +9 -3
  17. package/dist/completion/review-exit-deps.js.map +1 -1
  18. package/dist/delivery/delivery-review-coverage.d.ts +216 -0
  19. package/dist/delivery/delivery-review-coverage.d.ts.map +1 -0
  20. package/dist/delivery/delivery-review-coverage.js +208 -0
  21. package/dist/delivery/delivery-review-coverage.js.map +1 -0
  22. package/dist/queries/focus-branch-work-evidence.d.ts +55 -0
  23. package/dist/queries/focus-branch-work-evidence.d.ts.map +1 -0
  24. package/dist/queries/focus-branch-work-evidence.js +65 -0
  25. package/dist/queries/focus-branch-work-evidence.js.map +1 -0
  26. package/dist/queries/focus-criteria-standing.d.ts +138 -0
  27. package/dist/queries/focus-criteria-standing.d.ts.map +1 -0
  28. package/dist/queries/focus-criteria-standing.js +98 -0
  29. package/dist/queries/focus-criteria-standing.js.map +1 -0
  30. package/dist/queries/focus-review-watermark.d.ts +35 -0
  31. package/dist/queries/focus-review-watermark.d.ts.map +1 -0
  32. package/dist/queries/focus-review-watermark.js +47 -0
  33. package/dist/queries/focus-review-watermark.js.map +1 -0
  34. package/dist/queries/focuses.d.ts +0 -9
  35. package/dist/queries/focuses.d.ts.map +1 -1
  36. package/dist/queries/focuses.js +0 -14
  37. package/dist/queries/focuses.js.map +1 -1
  38. package/dist/queries/shared.js +1 -1
  39. package/dist/queries/verification.d.ts +23 -25
  40. package/dist/queries/verification.d.ts.map +1 -1
  41. package/dist/queries/verification.js +66 -45
  42. package/dist/queries/verification.js.map +1 -1
  43. package/dist/resolvers/assembly-engine.d.ts +51 -0
  44. package/dist/resolvers/assembly-engine.d.ts.map +1 -1
  45. package/dist/resolvers/assembly-engine.js +10 -20
  46. package/dist/resolvers/assembly-engine.js.map +1 -1
  47. package/dist/resolvers/branch-work-arming.d.ts +133 -0
  48. package/dist/resolvers/branch-work-arming.d.ts.map +1 -0
  49. package/dist/resolvers/branch-work-arming.js +67 -0
  50. package/dist/resolvers/branch-work-arming.js.map +1 -0
  51. package/dist/resolvers/focus-criteria-standing.d.ts +24 -0
  52. package/dist/resolvers/focus-criteria-standing.d.ts.map +1 -0
  53. package/dist/resolvers/focus-criteria-standing.js +234 -0
  54. package/dist/resolvers/focus-criteria-standing.js.map +1 -0
  55. package/dist/resolvers/focus-review-coverage.d.ts +189 -0
  56. package/dist/resolvers/focus-review-coverage.d.ts.map +1 -0
  57. package/dist/resolvers/focus-review-coverage.js +516 -0
  58. package/dist/resolvers/focus-review-coverage.js.map +1 -0
  59. package/dist/resolvers/git-diff-against-base.d.ts.map +1 -1
  60. package/dist/resolvers/git-diff-against-base.js +11 -0
  61. package/dist/resolvers/git-diff-against-base.js.map +1 -1
  62. package/dist/resolvers/index.d.ts.map +1 -1
  63. package/dist/resolvers/index.js +7 -1
  64. package/dist/resolvers/index.js.map +1 -1
  65. package/dist/resolvers/reality-tree-snapshot.d.ts +9 -4
  66. package/dist/resolvers/reality-tree-snapshot.d.ts.map +1 -1
  67. package/dist/resolvers/reality-tree-snapshot.js +64 -17
  68. package/dist/resolvers/reality-tree-snapshot.js.map +1 -1
  69. package/dist/resolvers/shared/branch-fact-provenance.d.ts +258 -0
  70. package/dist/resolvers/shared/branch-fact-provenance.d.ts.map +1 -0
  71. package/dist/resolvers/shared/branch-fact-provenance.js +571 -0
  72. package/dist/resolvers/shared/branch-fact-provenance.js.map +1 -0
  73. package/dist/resolvers/shared/reality-tree-arrival.d.ts +71 -0
  74. package/dist/resolvers/shared/reality-tree-arrival.d.ts.map +1 -0
  75. package/dist/resolvers/shared/reality-tree-arrival.js +129 -0
  76. package/dist/resolvers/shared/reality-tree-arrival.js.map +1 -0
  77. package/dist/testing/fixtures/index.js +1 -1
  78. package/package.json +2 -2
@@ -0,0 +1,516 @@
1
+ // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
+ // Pinned by: packages/daemon/src/completion/review-coverage-seam.test.ts,
3
+ // packages/daemon/src/resolvers/focus-review-coverage.test.ts
4
+ // PINNED-BY-END
5
+ import { execFileSync } from 'node:child_process';
6
+ import { registerSourceResolver } from './assembly-engine.js';
7
+ import { renderUnrecordedBranchWorkHold, signalUnrecordedBranchWorkHold, } from './branch-work-arming.js';
8
+ import { getFocusDeliveries, getLatestCompletedFocusReview } from '../queries/focuses.js';
9
+ import { setBranchWorkDeliveryIds } from '../queries/focus-branch-work-evidence.js';
10
+ import { fetchInjectionBundles } from './shared/loop.js';
11
+ import { resolveGitTrailerCommitSet } from './shared/git-diff.js';
12
+ import { BRANCH_FACT_COMMIT_CAP, attributeBranchFacts, attributeLineGrain, readBranchCommitFacts, readFileBlameRanges, renderBranchFactProvenance, renderBranchFactProvenanceUnavailable, } from './shared/branch-fact-provenance.js';
13
+ import { classifyDeliveryReviewCoverage, } from '../delivery/delivery-review-coverage.js';
14
+ import { createLogger } from '../shell/log.js';
15
+ const log = createLogger({ module: 'assembly-engine' });
16
+ /**
17
+ * focus.review_coverage
18
+ *
19
+ * The focus's deliveries PARTITIONED BY REVIEW STATE -- reviewed, unreviewed,
20
+ * no-work-yet -- each named with its injection anchor, and the whole reading
21
+ * carrying the basis it stands on (the coverage watermark and the last
22
+ * completed review's completion time).
23
+ *
24
+ * WHY A SCOPING PASS NEEDS THIS. An audit pass reads the focus branch and sees
25
+ * FACTS: files, behaviours, commits. Round 5 of its prompt then anchors one
26
+ * remediation delivery per injection. Without this section the pass cannot tell
27
+ * whether a fact it just observed came from a delivery a reviewer has looked at
28
+ * or from one still in flight -- so residue of unreviewed work gets anchored as
29
+ * a fresh sibling and the focus grows a backlog with no floor: it re-opens on
30
+ * new work while the pass that produced the work is never judged.
31
+ *
32
+ * AND THE JOIN, NOT JUST THE PARTITION. A partition of DELIVERIES sitting beside
33
+ * a diff of CHANGES leaves the pass to work out which delivery produced which
34
+ * hunk -- the very inference this section exists to remove. So the reading also
35
+ * carries a FACT-LEVEL provenance mapping (commit -> delivery -> review state,
36
+ * and file -> the delivery or deliveries that touched it), built from the
37
+ * durable `Telora-Delivery` trailer by
38
+ * `resolvers/shared/branch-fact-provenance.ts`. A fact it cannot tie to one of
39
+ * this focus's deliveries is rendered UNATTRIBUTED and counted UNREVIEWED; it
40
+ * is never attributed on a guess.
41
+ *
42
+ * READ FROM THE REPOSITORY, NOT FROM A CHECKOUT. The branch reads resolve
43
+ * against `context.worktreePath` when the assembly has one and against
44
+ * `config.repoPath` otherwise. `git log <ref>` reads refs, not the working
45
+ * tree, so a focus with no live worktree -- the audit pass, which assembles
46
+ * with `worktreePath: null` -- still gets a real reading instead of a
47
+ * uniformly-pessimistic one that carries no information at all.
48
+ *
49
+ * FAILS SOFT, NEVER SILENT. Every failure path renders an EXPLICIT failure
50
+ * line. A silently absent section reads to the pass as "there is no unreviewed
51
+ * work here", which is the exact inversion this resolver exists to prevent.
52
+ *
53
+ * The classification rules are NOT re-derived here: they are
54
+ * `delivery/delivery-review-coverage.ts`, the Node mirror of the Deno module
55
+ * the product-api create gate runs, held in agreement by
56
+ * `delivery-review-coverage-parity.test.ts`. So the state this section reports
57
+ * is the same state that gate will enforce.
58
+ */
59
+ /** Section heading, shared by the rendered reading and the failure line. */
60
+ export const REVIEW_COVERAGE_HEADING = '## Delivery review coverage (has a reviewer seen this delivery\'s work?)';
61
+ /** How far an injection statement is quoted in an anchor label. */
62
+ const ANCHOR_STATEMENT_CHARS = 80;
63
+ // ── Pure rendering ───────────────────────────────────────────────────
64
+ /** The basis block. Always rendered -- including when the basis is "none yet". */
65
+ function renderBasis(basis) {
66
+ const watermark = basis.reviewedThroughSha
67
+ ? `\`${basis.reviewedThroughSha}\``
68
+ : '_none -- no review has ever COMPLETED on this focus_';
69
+ const reviewedAt = basis.latestCompletedReviewAt
70
+ ? basis.latestCompletedReviewAt
71
+ : '_none -- no completed focus review exists_';
72
+ const resolutionNote = {
73
+ no_review_yet: 'Merge-commit coverage was not computed: with no completed review there is no covered range.',
74
+ resolved: 'Merge-commit coverage was resolved by ancestry against the watermark commit in the focus repository.',
75
+ no_repo: 'Merge-commit coverage could NOT be computed (no repository path on this assembly), so every merged delivery below is reported UNREVIEWED -- fail closed, not a finding.',
76
+ watermark_unresolvable: 'Merge-commit coverage could NOT be computed (the watermark commit does not resolve in the repository), so every merged delivery below is reported UNREVIEWED -- fail closed, not a finding.',
77
+ };
78
+ return [
79
+ '**Basis of this reading.**',
80
+ `- Review coverage watermark (\`product_focuses.reviewed_through_sha\`): ${watermark}`,
81
+ `- Last COMPLETED focus review finished at: ${reviewedAt}`,
82
+ `- ${resolutionNote[basis.shaResolution]}`,
83
+ ];
84
+ }
85
+ /** One partition, with an explicit `_None._` rather than an omitted heading. */
86
+ function renderPartition(heading, rows) {
87
+ const lines = [`### ${heading} (${rows.length})`, ''];
88
+ if (rows.length === 0) {
89
+ lines.push('_None._');
90
+ return lines;
91
+ }
92
+ for (const row of rows) {
93
+ const status = row.executionStatus ? `\`${row.executionStatus}\`` : '`(no status)`';
94
+ const anchor = row.anchor ? row.anchor : 'not anchored to an injection';
95
+ lines.push(`- **${row.name}** (\`${row.id}\`) -- status ${status} -- ${anchor} -- basis: \`${row.reason}\``);
96
+ }
97
+ return lines;
98
+ }
99
+ /** The closing reading rule. The full instruction lives in the audit prompt. */
100
+ const READING_RULE = [
101
+ '**How to read this.** A fact you observe in the focus branch was produced by one of these',
102
+ 'deliveries -- the provenance mapping below says WHICH, per commit and per file. Residue of an',
103
+ 'UNREVIEWED delivery is not new information -- the review that has not happened yet is where it',
104
+ 'belongs -- so put it on that delivery rather than anchoring a new one. Anchor only what is a',
105
+ 'genuinely new root cause, and declare it (see the anchoring round).',
106
+ ];
107
+ /**
108
+ * Render the partitioned reading, with the fact-level provenance mapping
109
+ * appended. `provenance` is ALWAYS a rendered block -- the reading or the
110
+ * explicit NOT AVAILABLE line -- never an empty string, so the partition is
111
+ * never presented without saying how to join a fact to it.
112
+ */
113
+ export function renderFocusReviewCoverage(rows, basis, provenance) {
114
+ const lines = [REVIEW_COVERAGE_HEADING, '', ...renderBasis(basis), ''];
115
+ if (rows.length === 0) {
116
+ lines.push('_This focus carries no deliveries yet, so NO fact on the branch can be attributed to one._', '', provenance);
117
+ return lines.join('\n');
118
+ }
119
+ const bucket = (c) => rows.filter((r) => r.coverage === c);
120
+ lines.push(...renderPartition('UNREVIEWED -- no completed review has covered this work', bucket('unreviewed')), '', ...renderPartition('REVIEWED -- a completed focus review covered this work', bucket('reviewed')), '', ...renderPartition('NO WORK YET -- nothing that could be residue', bucket('no_work_yet')), '', ...READING_RULE, '', provenance);
121
+ return lines.join('\n');
122
+ }
123
+ /**
124
+ * Render the EXPLICIT failure line. Rendered instead of nothing on every read
125
+ * failure, because an absent section reads as "no unreviewed work".
126
+ */
127
+ export function renderFocusReviewCoverageFailure(reason) {
128
+ return [
129
+ REVIEW_COVERAGE_HEADING,
130
+ '',
131
+ '**READ FAILED -- the review state of this focus is UNKNOWN.**',
132
+ `Reason: ${reason}`,
133
+ '',
134
+ 'This section could not be computed, which is NOT the same as "nothing is unreviewed".',
135
+ 'Treat EVERY delivery on this focus as UNREVIEWED: hold residue rather than anchoring it,',
136
+ 'and anchor only a genuinely new root cause, declared as the anchoring round requires.',
137
+ ].join('\n');
138
+ }
139
+ const GIT_OPTS = {
140
+ maxBuffer: 1024 * 1024,
141
+ encoding: 'utf-8',
142
+ stdio: ['ignore', 'pipe', 'pipe'],
143
+ };
144
+ function gitSucceeds(args, cwd) {
145
+ try {
146
+ execFileSync('git', args, { ...GIT_OPTS, cwd });
147
+ return true;
148
+ }
149
+ catch {
150
+ return false;
151
+ }
152
+ }
153
+ /**
154
+ * The focus's coverage watermark, and whether the focus row was found at all.
155
+ *
156
+ * `queries/focus-discovery.js` is reached through a DEFERRED dynamic import, not
157
+ * a static one. A static import would put it (and its zod validation chain) in
158
+ * the module graph of `resolvers/index.js`, which several resolver tests load
159
+ * while holding a partial `mock.module` over `queries/shared.js` -- under the
160
+ * tsx mock loader a partial namespace makes every unlisted export of the mocked
161
+ * module a load-time SyntaxError for anything that imports it. Deferring the
162
+ * import keeps that chain out of every test that does not actually run this
163
+ * resolver, which is the documented escape (see packages/daemon/CLAUDE.md on
164
+ * the mock-loader quirk, and `listener-auto-advance.ts` for the same move).
165
+ */
166
+ async function readReviewedThroughSha(context) {
167
+ const { getActiveFocuses } = await import('../queries/focus-discovery.js');
168
+ const focuses = await getActiveFocuses(context.organizationId, context.productId);
169
+ const row = focuses.find((f) => f.focus_id === context.focusId);
170
+ if (!row)
171
+ return { found: false, sha: null, branchName: null };
172
+ return { found: true, sha: row.reviewed_through_sha, branchName: row.branch_name };
173
+ }
174
+ /** Anchor labels keyed by injection node id; best-effort (an empty map degrades to ids). */
175
+ async function readAnchorLabels(injectionIds) {
176
+ const labels = new Map();
177
+ if (injectionIds.length === 0)
178
+ return labels;
179
+ const bundles = await fetchInjectionBundles(injectionIds);
180
+ for (const [id, bundle] of bundles) {
181
+ const statement = bundle.injection.statement.trim();
182
+ const quoted = statement.length > ANCHOR_STATEMENT_CHARS
183
+ ? `${statement.slice(0, ANCHOR_STATEMENT_CHARS)}...`
184
+ : statement;
185
+ labels.set(id, `anchored to injection #${bundle.injection.seq} "${quoted}"`);
186
+ }
187
+ return labels;
188
+ }
189
+ /**
190
+ * The PRODUCTION wiring: the real queries, a real git process, and the real
191
+ * evidence writes. Exported because the binding itself is a failure mode --
192
+ * swap `persistBranchWork` for a no-op and every behavioural test below stays
193
+ * green while the create gate goes blind -- so the cross-runtime seam test
194
+ * (`completion/review-coverage-seam.test.ts`) drives THESE, replacing only the
195
+ * DB reads and the transport under the production write.
196
+ */
197
+ export const defaultFocusReviewCoverageDeps = {
198
+ getFocusDeliveries,
199
+ getReviewedThroughSha: readReviewedThroughSha,
200
+ getLatestCompletedReviewAt: async (focusId) => (await getLatestCompletedFocusReview(focusId))?.completedAt ?? null,
201
+ getAnchorLabels: readAnchorLabels,
202
+ isAncestor: (repoPath, sha, tip) => gitSucceeds(['merge-base', '--is-ancestor', sha, tip], repoPath),
203
+ commitResolves: (repoPath, sha) => gitSucceeds(['rev-parse', '--verify', '--quiet', `${sha}^{commit}`], repoPath),
204
+ hasBranchCommits: (repoPath, ref, deliveryId) => resolveGitTrailerCommitSet(repoPath, ref, deliveryId).length > 0,
205
+ readBranchFacts: (repoPath, base, ref) => readBranchCommitFacts(repoPath, base, ref, BRANCH_FACT_COMMIT_CAP),
206
+ readBlameRanges: (repoPath, tip, path) => readFileBlameRanges(repoPath, tip, path),
207
+ persistBranchWork: setBranchWorkDeliveryIds,
208
+ };
209
+ /**
210
+ * The merge shas the completed review covered: each delivery's merge commit
211
+ * that is an ANCESTOR of the watermark. Ancestry (rather than a rev-list of the
212
+ * whole range) is asked per delivery because the range's base is not a fact
213
+ * this resolver owns, and a delivery merged before the base moved would be
214
+ * missed by a range walk. Every unresolvable input yields a SMALLER covered set
215
+ * -- fail closed.
216
+ */
217
+ function resolveCoveredShas(repoPath, watermark, mergeShas, deps) {
218
+ if (!watermark || watermark.trim() === '')
219
+ return { covered: [], resolution: 'no_review_yet' };
220
+ if (!repoPath)
221
+ return { covered: [], resolution: 'no_repo' };
222
+ if (!deps.commitResolves(repoPath, watermark)) {
223
+ return { covered: [], resolution: 'watermark_unresolvable' };
224
+ }
225
+ const covered = mergeShas.filter((sha) => deps.isAncestor(repoPath, sha, watermark));
226
+ return { covered, resolution: 'resolved' };
227
+ }
228
+ /**
229
+ * WHERE the branch reads run and WHICH ref they read.
230
+ *
231
+ * `git log <ref>` / `merge-base --is-ancestor` read REFS, not a working tree,
232
+ * so an assembly with no worktree (the audit pass) can still read the focus's
233
+ * branch out of the daemon's main repository. The ref is the focus's pinned
234
+ * `branch_name` when it has one; with a worktree and no pinned name, that
235
+ * worktree's `HEAD` is the branch by construction. Null ref = nothing to read.
236
+ */
237
+ export function resolveBranchReadTarget(context, branchName) {
238
+ const repoPath = context.worktreePath ?? (context.config.repoPath || null);
239
+ const pinned = (branchName ?? '').trim();
240
+ const ref = pinned !== '' ? pinned : (context.worktreePath ? 'HEAD' : null);
241
+ return { repoPath, ref };
242
+ }
243
+ /**
244
+ * Classify ONE delivery, consulting the branch for committed work only when
245
+ * that evidence could change the answer.
246
+ *
247
+ * The branch reading is POSITIVE-ONLY now (see `resolveBranchWorkEvidence`):
248
+ * finding a trailer-bearing commit makes a row work-bearing, and finding none
249
+ * establishes nothing at all. So the only row a trailer search can move is one
250
+ * the classifier already calls `no_work_yet` on its own columns, and that is
251
+ * the only row that pays for a git call -- which is CHEAPER than the rule it
252
+ * replaces, not merely different, because the cancelled rows that used to be
253
+ * probed for an emptiness proof are now held on their own.
254
+ *
255
+ * And it keeps the pass and the gate reading the same state. The gate sees the
256
+ * reading this pass persists; a `true` here is exactly what it will find, and
257
+ * a non-`true` leaves the row where the columns already put it, which is
258
+ * exactly where the gate leaves it too.
259
+ */
260
+ function classifyWithBranchEvidence(input, focus, probeBranch) {
261
+ const onItsOwnColumns = classifyDeliveryReviewCoverage(input, focus);
262
+ if (onItsOwnColumns.coverage !== 'no_work_yet')
263
+ return onItsOwnColumns;
264
+ if (probeBranch(input.id) !== true)
265
+ return onItsOwnColumns;
266
+ return classifyDeliveryReviewCoverage({ ...input, hasCommittedWork: true }, focus);
267
+ }
268
+ /** Classify every delivery and attach its anchor label. */
269
+ function classifyDeliveries(deliveries, focus, anchorLabels, probeBranch) {
270
+ return deliveries.map((d) => {
271
+ const { coverage, reason } = classifyWithBranchEvidence({
272
+ id: d.id,
273
+ name: d.name,
274
+ executionStatus: d.executionStatus,
275
+ mergeCommitSha: d.mergeCommitSha,
276
+ // Not carried on the daemon's delivery wire shape -- and never consulted
277
+ // by the classifier (see its field doc), so its absence decides nothing.
278
+ autoApprovedAt: undefined,
279
+ updatedAt: d.updatedAt,
280
+ iterationCount: d.iterationCount,
281
+ }, focus, probeBranch);
282
+ const injectionId = typeof d.injectionId === 'string' && d.injectionId.length > 0 ? d.injectionId : null;
283
+ const anchor = injectionId
284
+ ? anchorLabels.get(injectionId) ?? `anchored to injection \`${injectionId}\``
285
+ : null;
286
+ return { id: d.id, name: d.name, executionStatus: d.executionStatus, coverage, reason, anchor };
287
+ });
288
+ }
289
+ function makeBranchWorkEvidence(target, deps) {
290
+ const { repoPath, ref } = target;
291
+ const found = [];
292
+ let unreadable = false;
293
+ // Does the ref resolve at all? Asked at most once, and asked BEFORE any
294
+ // trailer search, because that search swallows git errors as an empty set
295
+ // (`resolveGitTrailerCommitSet`): against an unresolvable ref it would
296
+ // answer "looked, found none" for every delivery, which is the one answer
297
+ // that releases the carve-out. Resolved lazily so a focus with no at-stake
298
+ // row pays for no git call, and memoized so the probe and `resolved()`
299
+ // cannot disagree about the same ref.
300
+ let refResolves = null;
301
+ const refReadable = () => {
302
+ if (!repoPath || !ref)
303
+ return false;
304
+ if (refResolves === null)
305
+ refResolves = deps.commitResolves(repoPath, ref);
306
+ return refResolves;
307
+ };
308
+ const probe = (deliveryId) => {
309
+ // No repository or no ref, nothing to search. UNDEFINED rather than false
310
+ // because the two are different facts, even though neither releases
311
+ // anything: `false` says a repository was searched, and this pass will go
312
+ // on to WRITE what it searched. Nobody looked, so nobody may record a
313
+ // search.
314
+ if (!repoPath || !ref || !refReadable())
315
+ return undefined;
316
+ try {
317
+ const hit = deps.hasBranchCommits(repoPath, ref, deliveryId);
318
+ if (hit)
319
+ found.push(deliveryId);
320
+ return hit;
321
+ }
322
+ catch (err) {
323
+ log.warn(`focus.review_coverage: branch evidence unreadable for ${deliveryId}: ${err.message}`);
324
+ unreadable = true;
325
+ return undefined;
326
+ }
327
+ };
328
+ const resolved = () => {
329
+ if (!repoPath || !ref || unreadable)
330
+ return null;
331
+ return refReadable() ? found : null;
332
+ };
333
+ return { probe, resolved };
334
+ }
335
+ /**
336
+ * Hand the resolved evidence to the gate that cannot derive it -- and when that
337
+ * hand-off fails, say so instead of rendering a reading the gate cannot back.
338
+ *
339
+ * Written HERE rather than at review exit because this is the moment the fact
340
+ * is both true and needed: the scoping pass reads this section and then
341
+ * anchors deliveries through the create gate, so persisting at the read makes
342
+ * the gate enforce the state the pass was shown.
343
+ *
344
+ * THE FAILURE IS NOT BEST-EFFORT. It was, and that was the defect: a write
345
+ * that threw was logged and swallowed, and the pass still got a normal
346
+ * create-capable reading naming residue the gate had never been told about.
347
+ * A rendering concern may be best-effort; an ENFORCEMENT INPUT may not. So a
348
+ * failure returns a REASON and the caller renders the explicit unknown-state
349
+ * section in place of the partitioned reading.
350
+ *
351
+ * AND THERE IS NO SECOND WRITE. There used to be: a failed reading was
352
+ * followed by a clear-to-unknown, so a previous pass's answer could not go on
353
+ * speaking for a reading that never arrived. That compensation is gone, and
354
+ * its removal is the FIX rather than a simplification of it. It only ever
355
+ * made sense while a stored empty reading could RELEASE a hold; now that a
356
+ * stored reading is positive-only (`resolveBranchWorkEvidence`), clearing the
357
+ * column WITHDRAWS holds and adds none, so on a failed write it is the one
358
+ * action that could make things worse. Leaving the stored reading in place is
359
+ * now the conservative act, and it needs no write at all -- which matters,
360
+ * because the failure this path runs in is precisely the one where no write
361
+ * lands.
362
+ *
363
+ * AND ONE OF THE TWO FAILURES DISARMS THE PASS. A failed write that proved
364
+ * nothing costs the gate nothing. A failed write that proved a delivery's
365
+ * committed work costs it a hold it can never derive for itself, so that case
366
+ * raises the arming SIGNAL on this assembly run and no create-capable pass
367
+ * runs this cycle -- see `packages/daemon/src/resolvers/branch-work-arming.ts`.
368
+ * The signal, not the reason text, is the decision: the text it returns lands
369
+ * in a prompt beside content other parties author, so anything that read the
370
+ * decision back out of that prompt could be told it by a delivery name.
371
+ *
372
+ * Returns null when there is nothing to report.
373
+ */
374
+ async function persistBranchWorkEvidence(context, resolved, deps) {
375
+ const focusId = context.focusId;
376
+ // Unaskable: leave whatever an earlier, readable pass recorded. Overwriting
377
+ // it with this pass's empty list would withdraw holds on evidence that has
378
+ // not gone away.
379
+ if (resolved === null)
380
+ return null;
381
+ try {
382
+ await deps.persistBranchWork(focusId, resolved);
383
+ return null;
384
+ }
385
+ catch (err) {
386
+ const message = err.message;
387
+ log.warn(`focus.review_coverage: branch work evidence not persisted for ${focusId}: ${message}`);
388
+ // A non-empty resolved set is the case the gate cannot recover from on its
389
+ // own. Every id in it came off `classifyWithBranchEvidence`, which probes
390
+ // ONLY rows the classifier already calls `no_work_yet` -- so each one is a
391
+ // delivery the create gate will release, on columns indistinguishable from
392
+ // a focus whose branch is clean. The daemon proved otherwise and cannot say
393
+ // so, which makes this an ARMING decision rather than a rendering one; see
394
+ // `packages/daemon/src/resolvers/branch-work-arming.ts` for why no rule at
395
+ // the gate can take it instead.
396
+ if (resolved.length > 0) {
397
+ signalUnrecordedBranchWorkHold(context.signals, { provedDeliveryIds: resolved, cause: message });
398
+ return renderUnrecordedBranchWorkHold(resolved, message);
399
+ }
400
+ // Nothing was proved, so the failed write withheld no hold from the gate:
401
+ // it would have overwritten a stored reading with the same emptiness the
402
+ // gate already reads as silence. The section still states the unknown --
403
+ // this pass cannot vouch for what it did not manage to look up -- but the
404
+ // pass stays armed, because holding it here would hold every clean focus
405
+ // for the duration of an outage, which is the freeze.
406
+ return (`the branch committed-work evidence this reading resolved could NOT be handed to the ` +
407
+ `delivery-create gate (${message}). That gate holds on the absence of evidence and never ` +
408
+ `RELEASES on a stored reading, so nothing this pass proved has been turned into a release ` +
409
+ `-- but any committed work it FOUND is not in the gate's view either, so do not read a ` +
410
+ `create that succeeds as a statement that the branch is clean.`);
411
+ }
412
+ }
413
+ /**
414
+ * Resolve the section. Exported (with an injectable deps seam) so tests drive
415
+ * it without registering a module mock.
416
+ */
417
+ export async function resolveFocusReviewCoverage(context, deps = defaultFocusReviewCoverageDeps) {
418
+ let deliveries;
419
+ let watermark;
420
+ let latestCompletedReviewAt;
421
+ try {
422
+ [deliveries, watermark, latestCompletedReviewAt] = await Promise.all([
423
+ deps.getFocusDeliveries(context.focusId),
424
+ deps.getReviewedThroughSha(context),
425
+ deps.getLatestCompletedReviewAt(context.focusId),
426
+ ]);
427
+ }
428
+ catch (err) {
429
+ const message = err.message;
430
+ log.warn(`focus.review_coverage: read failed: ${message}`);
431
+ return renderFocusReviewCoverageFailure(`the review-state read failed (${message})`);
432
+ }
433
+ if (!watermark.found) {
434
+ log.warn(`focus.review_coverage: focus ${context.focusId} not returned by the active-focus read`);
435
+ return renderFocusReviewCoverageFailure('the focus row was not returned by the active-focus read, so its review coverage ' +
436
+ 'watermark could not be read');
437
+ }
438
+ const { repoPath, ref } = resolveBranchReadTarget(context, watermark.branchName);
439
+ const mergeShas = deliveries
440
+ .map((d) => (typeof d.mergeCommitSha === 'string' ? d.mergeCommitSha.trim() : ''))
441
+ .filter((sha) => sha !== '');
442
+ const { covered, resolution } = resolveCoveredShas(repoPath, watermark.sha, mergeShas, deps);
443
+ let anchorLabels = new Map();
444
+ try {
445
+ const injectionIds = deliveries
446
+ .map((d) => d.injectionId)
447
+ .filter((id) => typeof id === 'string' && id.length > 0);
448
+ anchorLabels = await deps.getAnchorLabels(injectionIds);
449
+ }
450
+ catch (err) {
451
+ // An unreadable anchor label costs a NAME, not a coverage fact: the rows
452
+ // fall back to the raw injection id and the reading stands.
453
+ log.warn(`focus.review_coverage: anchor labels unreadable: ${err.message}`);
454
+ }
455
+ const evidence = makeBranchWorkEvidence({ repoPath, ref }, deps);
456
+ const rows = classifyDeliveries(deliveries, {
457
+ reviewedThroughSha: watermark.sha,
458
+ latestCompletedReviewAt,
459
+ coveredShas: covered,
460
+ }, anchorLabels, evidence.probe);
461
+ const evidenceFailure = await persistBranchWorkEvidence(context, evidence.resolved(), deps);
462
+ // The reading below is only honest while the gate can enforce it. It cannot,
463
+ // so the section states the unknown instead of implying a hold that is not
464
+ // there -- the same rule every other read failure here already follows.
465
+ if (evidenceFailure !== null)
466
+ return renderFocusReviewCoverageFailure(evidenceFailure);
467
+ return renderFocusReviewCoverage(rows, {
468
+ reviewedThroughSha: watermark.sha,
469
+ latestCompletedReviewAt,
470
+ shaResolution: resolution,
471
+ }, resolveFactProvenance(rows, { repoPath, ref, base: context.config.integrationBranch }, deps));
472
+ }
473
+ /**
474
+ * Build the fact-level provenance block from the SAME classified rows the
475
+ * partition rendered, so a delivery's review state cannot differ between the
476
+ * two halves of one section. Every path returns a rendered block: an
477
+ * unreadable branch renders the explicit NOT AVAILABLE line, never nothing.
478
+ */
479
+ function resolveFactProvenance(rows, target, deps) {
480
+ if (!target.repoPath) {
481
+ return renderBranchFactProvenanceUnavailable('no repository path on this assembly, so the focus branch could not be read');
482
+ }
483
+ if (!target.ref) {
484
+ return renderBranchFactProvenanceUnavailable('this focus pins no git branch (`product_focuses.branch_name` is null) and the assembly has '
485
+ + 'no worktree, so there is no ref to read its commits from');
486
+ }
487
+ const base = (target.base ?? '').trim();
488
+ if (base === '') {
489
+ return renderBranchFactProvenanceUnavailable('the product declares no integration branch, so the branch window has no base to read against');
490
+ }
491
+ let facts;
492
+ try {
493
+ facts = deps.readBranchFacts(target.repoPath, base, target.ref);
494
+ }
495
+ catch (err) {
496
+ facts = null;
497
+ log.warn(`focus.review_coverage: branch fact read threw: ${err.message}`);
498
+ }
499
+ if (facts === null) {
500
+ return renderBranchFactProvenanceUnavailable(`git could not read \`${base}..${target.ref}\` in ${target.repoPath} (an unfetched or rewritten ref, `
501
+ + 'or an unreadable repository)');
502
+ }
503
+ const provenance = attributeBranchFacts(facts, rows.map((r) => ({ id: r.id, name: r.name, reviewed: r.coverage === 'reviewed' })), { base, tip: target.ref, capped: facts.length >= BRANCH_FACT_COMMIT_CAP });
504
+ // Descend to LINE grain for the files more than one contributor touched: a
505
+ // file a reviewed and an unreviewed delivery both touched cannot answer
506
+ // "whose line is this?" at file grain. Locals because TS drops the
507
+ // null-narrowing of target.repoPath / target.ref inside the closure.
508
+ const repoPath = target.repoPath;
509
+ const tip = target.ref;
510
+ return renderBranchFactProvenance(attributeLineGrain(provenance, (path) => deps.readBlameRanges(repoPath, tip, path)));
511
+ }
512
+ /** Register this module's resolver(s). Called from initResolvers() -- not an import side effect. */
513
+ export function registerFocusReviewCoverageResolver() {
514
+ registerSourceResolver('focus.review_coverage', async (context) => resolveFocusReviewCoverage(context));
515
+ }
516
+ //# sourceMappingURL=focus-review-coverage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus-review-coverage.js","sourceRoot":"","sources":["../../src/resolvers/focus-review-coverage.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0EAA0E;AAC1E,gEAAgE;AAChE,gBAAgB;AAEhB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EA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AAG,SAAS,MAAM,CAAC,QAAQ,mCAAmC;cACpG,8BAA8B,CACjC,CAAC;IACJ,CAAC;IACD,MAAM,UAAU,GAAG,oBAAoB,CACrC,KAAK,EACL,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC,CAAC,EAClF,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,sBAAsB,EAAE,CAC1E,CAAC;IACF,2EAA2E;IAC3E,wEAAwE;IACxE,mEAAmE;IACnE,qEAAqE;IACrE,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACjC,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IACvB,OAAO,0BAA0B,CAC/B,kBAAkB,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,CACpF,CAAC;AACJ,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,mCAAmC;IACjD,sBAAsB,CAAC,uBAAuB,EAAE,KAAK,EAAE,OAAwB,EAAmB,EAAE,CAClG,0BAA0B,CAAC,OAAO,CAAC,CAAC,CAAC;AACzC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"git-diff-against-base.d.ts","sourceRoot":"","sources":["../../src/resolvers/git-diff-against-base.ts"],"names":[],"mappings":"AAwJA;;;;;;;;GAQG;AACH,oGAAoG;AACpG,wBAAgB,kCAAkC,IAAI,IAAI,CAgBzD"}
1
+ {"version":3,"file":"git-diff-against-base.d.ts","sourceRoot":"","sources":["../../src/resolvers/git-diff-against-base.ts"],"names":[],"mappings":"AAwJA;;;;;;;;GAQG;AACH,oGAAoG;AACpG,wBAAgB,kCAAkC,IAAI,IAAI,CA2BzD"}
@@ -128,6 +128,17 @@ function renderOwnScopedDiff(baseBranch, foreign, own) {
128
128
  /** Register this module's resolver(s). Called from initResolvers() -- not an import side effect. */
129
129
  export function registerGitDiffAgainstBaseResolver() {
130
130
  registerSourceResolver('git.diff_against_base', async (context) => {
131
+ // NOTE (2026-09-18) -- this branch is TAKEN on every AUDIT pass, not just
132
+ // in error. `audit/audit-phase.ts` assembles with `worktreePath: null`, so
133
+ // this resolver is INERT there: the audit recipe lists
134
+ // `git.diff_against_base` and it contributes nothing. The scoping pass
135
+ // therefore observes NO diff facts at all, and any fact-level provenance
136
+ // attached HERE would be attached to a section that never renders for it.
137
+ // That is why the commit/file -> delivery -> review-state mapping lives in
138
+ // the `focus.review_coverage` section, built by
139
+ // `resolvers/shared/branch-fact-provenance.ts`: it reads the focus branch
140
+ // by REF out of the repo path, so it renders with or without a worktree.
141
+ // Do not add it here expecting the audit pass to see it.
131
142
  if (!context.worktreePath) {
132
143
  log.warn('git.diff_against_base: no worktree path available');
133
144
  return '';
@@ -1 +1 @@
1
- {"version":3,"file":"git-diff-against-base.js","sourceRoot":"","sources":["../../src/resolvers/git-diff-against-base.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,gFAAgF;AAChF,gBAAgB;AAEhB,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,EACL,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACxB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,mBAAmB,EACnB,uBAAuB,EACvB,4BAA4B,GAG7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,iBAAiB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ACzB,iCAAiC,EACjC,6BAA6B,EAC7B,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,kCAAkC,EAClC,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACpI,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,cAAc,EACd,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolvers/index.ts"],"names":[],"mappings":"AAyHA;;;;;;;;;GASG;AACH,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAgBxC;AAGD,OAAO,EACL,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,+BAA+B,EAC/B,gBAAgB,EAChB,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,EACvB,yBAAyB,EACzB,iCAAiC,EACjC,6BAA6B,EAC7B,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,kCAAkC,EAClC,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACpI,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,cAAc,EACd,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC"}
@@ -1,6 +1,8 @@
1
1
  // PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
2
2
  // Pinned by: packages/daemon/src/queries/focus-needs-injection.test.ts,
3
- // packages/daemon/src/resolvers/focus-endpoint-catalog.test.ts
3
+ // packages/daemon/src/resolvers/focus-criteria-standing.test.ts,
4
+ // packages/daemon/src/resolvers/focus-endpoint-catalog.test.ts,
5
+ // packages/daemon/src/resolvers/focus-review-coverage.test.ts
4
6
  // PINNED-BY-END
5
7
  /**
6
8
  * Barrel for the Context Assembly Engine source resolvers.
@@ -61,6 +63,8 @@ import { registerRealityTreeSnapshotResolver } from './reality-tree-snapshot.js'
61
63
  import { registerPrdPersonaResolver } from './prd-persona.js';
62
64
  import { registerPrdContextResolver } from './prd-context.js';
63
65
  import { registerFocusEndpointCatalogResolver } from './focus-endpoint-catalog.js';
66
+ import { registerFocusReviewCoverageResolver } from './focus-review-coverage.js';
67
+ import { registerFocusCriteriaStandingResolver } from './focus-criteria-standing.js';
64
68
  import { registerLinearLinkedIssuesResolver } from './linear-linked-issues.js';
65
69
  // ── Explicit registration ─────────────────────────────────────────────
66
70
  /** All register functions, in the order they historically registered. */
@@ -103,6 +107,8 @@ const REGISTER_FUNCTIONS = [
103
107
  registerPrdPersonaResolver,
104
108
  registerPrdContextResolver,
105
109
  registerFocusEndpointCatalogResolver,
110
+ registerFocusReviewCoverageResolver,
111
+ registerFocusCriteriaStandingResolver,
106
112
  registerLinearLinkedIssuesResolver,
107
113
  ];
108
114
  let initialized = false;