@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.
- package/build-info.json +13 -3
- package/dist/audit/audit-phase.d.ts +34 -1
- package/dist/audit/audit-phase.d.ts.map +1 -1
- package/dist/audit/audit-phase.js +92 -9
- package/dist/audit/audit-phase.js.map +1 -1
- package/dist/audit/audit-prompt.d.ts +174 -0
- package/dist/audit/audit-prompt.d.ts.map +1 -1
- package/dist/audit/audit-prompt.js +365 -2
- package/dist/audit/audit-prompt.js.map +1 -1
- package/dist/completion/review-coverage-shas.d.ts +49 -0
- package/dist/completion/review-coverage-shas.d.ts.map +1 -0
- package/dist/completion/review-coverage-shas.js +128 -0
- package/dist/completion/review-coverage-shas.js.map +1 -0
- package/dist/completion/review-exit-deps.d.ts +15 -2
- package/dist/completion/review-exit-deps.d.ts.map +1 -1
- package/dist/completion/review-exit-deps.js +9 -3
- package/dist/completion/review-exit-deps.js.map +1 -1
- package/dist/delivery/delivery-review-coverage.d.ts +216 -0
- package/dist/delivery/delivery-review-coverage.d.ts.map +1 -0
- package/dist/delivery/delivery-review-coverage.js +208 -0
- package/dist/delivery/delivery-review-coverage.js.map +1 -0
- package/dist/queries/focus-branch-work-evidence.d.ts +55 -0
- package/dist/queries/focus-branch-work-evidence.d.ts.map +1 -0
- package/dist/queries/focus-branch-work-evidence.js +65 -0
- package/dist/queries/focus-branch-work-evidence.js.map +1 -0
- package/dist/queries/focus-criteria-standing.d.ts +138 -0
- package/dist/queries/focus-criteria-standing.d.ts.map +1 -0
- package/dist/queries/focus-criteria-standing.js +98 -0
- package/dist/queries/focus-criteria-standing.js.map +1 -0
- package/dist/queries/focus-review-watermark.d.ts +35 -0
- package/dist/queries/focus-review-watermark.d.ts.map +1 -0
- package/dist/queries/focus-review-watermark.js +47 -0
- package/dist/queries/focus-review-watermark.js.map +1 -0
- package/dist/queries/focuses.d.ts +0 -9
- package/dist/queries/focuses.d.ts.map +1 -1
- package/dist/queries/focuses.js +0 -14
- package/dist/queries/focuses.js.map +1 -1
- package/dist/queries/shared.js +1 -1
- package/dist/queries/verification.d.ts +23 -25
- package/dist/queries/verification.d.ts.map +1 -1
- package/dist/queries/verification.js +66 -45
- package/dist/queries/verification.js.map +1 -1
- package/dist/resolvers/assembly-engine.d.ts +51 -0
- package/dist/resolvers/assembly-engine.d.ts.map +1 -1
- package/dist/resolvers/assembly-engine.js +10 -20
- package/dist/resolvers/assembly-engine.js.map +1 -1
- package/dist/resolvers/branch-work-arming.d.ts +133 -0
- package/dist/resolvers/branch-work-arming.d.ts.map +1 -0
- package/dist/resolvers/branch-work-arming.js +67 -0
- package/dist/resolvers/branch-work-arming.js.map +1 -0
- package/dist/resolvers/focus-criteria-standing.d.ts +24 -0
- package/dist/resolvers/focus-criteria-standing.d.ts.map +1 -0
- package/dist/resolvers/focus-criteria-standing.js +234 -0
- package/dist/resolvers/focus-criteria-standing.js.map +1 -0
- package/dist/resolvers/focus-review-coverage.d.ts +189 -0
- package/dist/resolvers/focus-review-coverage.d.ts.map +1 -0
- package/dist/resolvers/focus-review-coverage.js +516 -0
- package/dist/resolvers/focus-review-coverage.js.map +1 -0
- package/dist/resolvers/git-diff-against-base.d.ts.map +1 -1
- package/dist/resolvers/git-diff-against-base.js +11 -0
- package/dist/resolvers/git-diff-against-base.js.map +1 -1
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +7 -1
- package/dist/resolvers/index.js.map +1 -1
- package/dist/resolvers/reality-tree-snapshot.d.ts +9 -4
- package/dist/resolvers/reality-tree-snapshot.d.ts.map +1 -1
- package/dist/resolvers/reality-tree-snapshot.js +64 -17
- package/dist/resolvers/reality-tree-snapshot.js.map +1 -1
- package/dist/resolvers/shared/branch-fact-provenance.d.ts +258 -0
- package/dist/resolvers/shared/branch-fact-provenance.d.ts.map +1 -0
- package/dist/resolvers/shared/branch-fact-provenance.js +571 -0
- package/dist/resolvers/shared/branch-fact-provenance.js.map +1 -0
- package/dist/resolvers/shared/reality-tree-arrival.d.ts +71 -0
- package/dist/resolvers/shared/reality-tree-arrival.d.ts.map +1 -0
- package/dist/resolvers/shared/reality-tree-arrival.js +129 -0
- package/dist/resolvers/shared/reality-tree-arrival.js.map +1 -0
- package/dist/testing/fixtures/index.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,571 @@
|
|
|
1
|
+
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
+
// Pinned by: packages/daemon/src/resolvers/focus-review-coverage.test.ts,
|
|
3
|
+
// packages/daemon/src/resolvers/shared/branch-fact-provenance.test.ts
|
|
4
|
+
// PINNED-BY-END
|
|
5
|
+
/**
|
|
6
|
+
* FACT-LEVEL provenance for a focus branch: which DELIVERY produced each
|
|
7
|
+
* observed change, and whether that delivery has been reviewed.
|
|
8
|
+
*
|
|
9
|
+
* WHY IT EXISTS. A scoping pass reads the focus branch and observes FACTS --
|
|
10
|
+
* a hunk, a file, a behaviour. The delivery review-coverage partition tells it
|
|
11
|
+
* which DELIVERIES are reviewed; the diff tells it what CHANGED. Neither joins
|
|
12
|
+
* the two, so the pass was left to infer "which delivery produced this hunk?"
|
|
13
|
+
* from file paths and commit subjects -- exactly the inference chain the
|
|
14
|
+
* partition removes. Inferred wrong, residue of unreviewed work is anchored as
|
|
15
|
+
* a fresh sibling and the focus re-opens on work no reviewer judged.
|
|
16
|
+
*
|
|
17
|
+
* THE GRAIN, AND WHY. A fact is produced by exactly ONE commit, so the commit
|
|
18
|
+
* is the honest atom: its `Telora-Delivery` trailer is a durable per-commit
|
|
19
|
+
* attribution (it survives fast-forward and rebase, unlike branch topology).
|
|
20
|
+
* FILE grain is DERIVED by folding the commits that touched each path -- a
|
|
21
|
+
* pass observes "something in src/x.ts", not a sha. A file several deliveries
|
|
22
|
+
* touched SAYS SO and lists all of them; it never picks one.
|
|
23
|
+
*
|
|
24
|
+
* AND LINE GRAIN, BECAUSE A FILE ROW NEVER ANSWERS FOR A LINE. A file row says
|
|
25
|
+
* who TOUCHED the file. The shortcut "only one contributor, so every line is
|
|
26
|
+
* theirs" is FALSE for the commonest file there is, a pre-existing one: its
|
|
27
|
+
* untouched lines were written before the base, by nobody in this focus. A
|
|
28
|
+
* capped read manufactures the same false single-contributor file by the same
|
|
29
|
+
* arithmetic. Both are POSITIVE false attributions -- the one thing this
|
|
30
|
+
* module refuses everywhere else. So line grain is attempted for EVERY file
|
|
31
|
+
* present at the tip, read from `git blame`: the line is looked up, never
|
|
32
|
+
* reasoned about. And when a reviewed line was later rewritten by an
|
|
33
|
+
* unreviewed delivery the visible text is the unreviewed one's, so blame's
|
|
34
|
+
* "who last wrote this" also errs in the safe direction.
|
|
35
|
+
*
|
|
36
|
+
* A DELETION IS A FACT TOO, and the one blame cannot carry: the path is gone
|
|
37
|
+
* at the tip, so there is nothing there to blame. It is read from the log
|
|
38
|
+
* instead -- `--name-status` NAMES the removing commit (a `D`, or the old side
|
|
39
|
+
* of a rename) at no extra process -- which carries its delivery and review
|
|
40
|
+
* state like any other. A removed path thus costs no blame at all.
|
|
41
|
+
*
|
|
42
|
+
* THE COST, AND HOW IT IS BOUNDED. Blame is a per-file history walk, far
|
|
43
|
+
* dearer than the single batched `git log` the other grains share. The bound
|
|
44
|
+
* is the BUDGET, not a selection rule deciding which files are safe to leave
|
|
45
|
+
* unread: at most {@link BRANCH_FACT_BLAME_FILE_CAP} blames per reading --
|
|
46
|
+
* unchanged, so the worst case costs what it always did -- spent riskiest
|
|
47
|
+
* file first, and capped again per file when rendered. Every file the budget
|
|
48
|
+
* does not reach is DECLARED unattributed rather than quietly left out. The
|
|
49
|
+
* cheaper rule, letting a single-contributor file row answer for all its
|
|
50
|
+
* lines, is the WRONG trade this paragraph exists to refuse.
|
|
51
|
+
*
|
|
52
|
+
* FAIL CLOSED, NEVER GUESS. A commit whose trailer names no delivery of THIS
|
|
53
|
+
* focus is UNATTRIBUTED -- rendered explicitly as such and counted as
|
|
54
|
+
* UNREVIEWED. So is a merge, an unreadable window, and every commit past the
|
|
55
|
+
* read cap. The same rule holds one level down: a line whose producing commit
|
|
56
|
+
* is outside the read window, an unreadable blame, a file past the blame cap,
|
|
57
|
+
* a removal whose commit cannot be named, and a reading that never descended
|
|
58
|
+
* to line grain are each rendered as UNATTRIBUTED rather than omitted. The one
|
|
59
|
+
* direction this module must never fail in is calling unreviewed work reviewed.
|
|
60
|
+
*
|
|
61
|
+
* @module resolvers/shared/branch-fact-provenance
|
|
62
|
+
*/
|
|
63
|
+
import { execFileSync } from 'node:child_process';
|
|
64
|
+
import { DELIVERY_TRAILER_KEY, classifyTrailerValue } from './git-diff.js';
|
|
65
|
+
// -- Reading ----------------------------------------------------------------
|
|
66
|
+
const FIELD_SEP = '\x1f';
|
|
67
|
+
const RECORD_SEP = '\x1e';
|
|
68
|
+
const GIT_READ = {
|
|
69
|
+
maxBuffer: 10 * 1024 * 1024,
|
|
70
|
+
encoding: 'utf-8',
|
|
71
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* The most commits one window read classifies. Past it the read stops and the
|
|
75
|
+
* rendering SAYS the listing is incomplete -- an unlisted commit is not
|
|
76
|
+
* silently absent, it is declared unattributable for this pass.
|
|
77
|
+
*/
|
|
78
|
+
export const BRANCH_FACT_COMMIT_CAP = 500;
|
|
79
|
+
/**
|
|
80
|
+
* One `--name-status` line, folded into the commit's touched and removed sets.
|
|
81
|
+
* A rename compresses two facts -- the new path exists, the old one does NOT --
|
|
82
|
+
* so it is expanded back into both: "where did this file go?" asks the old one.
|
|
83
|
+
*/
|
|
84
|
+
function foldStatusLine(line, files, removed) {
|
|
85
|
+
const [status = '', first = '', second] = line.split('\t').map((p) => p.trim());
|
|
86
|
+
if (status === '' || first === '')
|
|
87
|
+
return;
|
|
88
|
+
if (second !== undefined && second !== '') {
|
|
89
|
+
files.push(first, second);
|
|
90
|
+
if (status.startsWith('R'))
|
|
91
|
+
removed.push(first);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
files.push(first);
|
|
95
|
+
if (status.startsWith('D'))
|
|
96
|
+
removed.push(first);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Pure: parse the batched `git log` output {@link readBranchCommitFacts} reads.
|
|
100
|
+
* Each record is `RS <sha> FS <subject> FS <parents> FS <trailer values> FS`
|
|
101
|
+
* followed by git's `--name-status` list. Separators are control characters no
|
|
102
|
+
* commit subject or path contains, so a multi-line trailer block cannot be
|
|
103
|
+
* mistaken for the next field.
|
|
104
|
+
*/
|
|
105
|
+
export function parseBranchCommitFacts(output) {
|
|
106
|
+
const facts = [];
|
|
107
|
+
for (const record of output.split(RECORD_SEP)) {
|
|
108
|
+
if (record.trim() === '')
|
|
109
|
+
continue;
|
|
110
|
+
const [sha = '', subject = '', parents = '', trailers = '', paths = ''] = record.split(FIELD_SEP);
|
|
111
|
+
const cleanSha = sha.replace(/^\n+/, '').trim();
|
|
112
|
+
if (cleanSha === '')
|
|
113
|
+
continue;
|
|
114
|
+
const trailer = trailers.split('\n').map((l) => l.trim()).find((l) => l !== '') ?? '';
|
|
115
|
+
const files = [];
|
|
116
|
+
const removedFiles = [];
|
|
117
|
+
for (const line of paths.split('\n'))
|
|
118
|
+
if (line.trim() !== '')
|
|
119
|
+
foldStatusLine(line, files, removedFiles);
|
|
120
|
+
facts.push({ sha: cleanSha, subject: subject.trim(), trailer, files, removedFiles,
|
|
121
|
+
parentCount: parents.trim().split(/\s+/).filter((p) => p !== '').length });
|
|
122
|
+
}
|
|
123
|
+
return facts;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Every commit in `<base>..<tip>` of the repository at `repoPath`, with its
|
|
127
|
+
* trailer and the paths it touched -- ONE git process for the whole window.
|
|
128
|
+
*
|
|
129
|
+
* Commits come back NEWEST FIRST (git log's order); the fold that decides
|
|
130
|
+
* whether a path is deleted AT THE TIP depends on it.
|
|
131
|
+
*
|
|
132
|
+
* Merges are INCLUDED (unlike the review-window read, which drops them): a
|
|
133
|
+
* merge that carries no trailer must appear as an unattributed fact rather than
|
|
134
|
+
* vanish, because a fact the mapping omits reads to the pass as a fact with no
|
|
135
|
+
* provenance question to ask.
|
|
136
|
+
*
|
|
137
|
+
* `repoPath` need not be a checkout of the branch -- `git log <ref>` reads refs,
|
|
138
|
+
* so the daemon's main repo path answers for a focus that has no live worktree.
|
|
139
|
+
* Returns null when git fails, so a caller can tell UNREADABLE from EMPTY.
|
|
140
|
+
*/
|
|
141
|
+
export function readBranchCommitFacts(repoPath, base, tip, cap = BRANCH_FACT_COMMIT_CAP) {
|
|
142
|
+
const repo = (repoPath ?? '').trim();
|
|
143
|
+
const from = (base ?? '').trim();
|
|
144
|
+
const to = (tip ?? '').trim();
|
|
145
|
+
if (repo === '' || from === '' || to === '')
|
|
146
|
+
return null;
|
|
147
|
+
try {
|
|
148
|
+
const out = execFileSync('git', [
|
|
149
|
+
'log',
|
|
150
|
+
`--max-count=${cap}`,
|
|
151
|
+
// --name-status, not --name-only: the status letter turns a DELETION
|
|
152
|
+
// into an attributable fact, and it costs no extra process.
|
|
153
|
+
'--name-status',
|
|
154
|
+
`--format=${RECORD_SEP}%H${FIELD_SEP}%s${FIELD_SEP}%P${FIELD_SEP}`
|
|
155
|
+
+ `%(trailers:key=${DELIVERY_TRAILER_KEY},valueonly)${FIELD_SEP}`,
|
|
156
|
+
`${from}..${to}`,
|
|
157
|
+
'--',
|
|
158
|
+
], { cwd: repo, ...GIT_READ });
|
|
159
|
+
return parseBranchCommitFacts(out);
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// -- The join ---------------------------------------------------------------
|
|
166
|
+
/** Attribute ONE commit. Every path that is not a known delivery fails closed. */
|
|
167
|
+
function attributeCommit(fact, byId) {
|
|
168
|
+
const head = { sha: fact.sha, subject: fact.subject, files: fact.files, removedFiles: fact.removedFiles ?? [] };
|
|
169
|
+
const unowned = { deliveryId: null, deliveryName: null, reviewState: 'unreviewed' };
|
|
170
|
+
const attribution = classifyTrailerValue(fact.trailer);
|
|
171
|
+
if (attribution.kind === 'delivery') {
|
|
172
|
+
const owner = byId.get(attribution.deliveryId);
|
|
173
|
+
if (owner) {
|
|
174
|
+
return { ...head, deliveryId: owner.id, deliveryName: owner.name, unattributed: null,
|
|
175
|
+
foreignDeliveryId: null, reviewState: owner.reviewed ? 'reviewed' : 'unreviewed' };
|
|
176
|
+
}
|
|
177
|
+
return { ...head, ...unowned, unattributed: 'foreign_delivery', foreignDeliveryId: attribution.deliveryId };
|
|
178
|
+
}
|
|
179
|
+
let reason;
|
|
180
|
+
if (attribution.kind === 'sentinel')
|
|
181
|
+
reason = 'non_delivery_commit';
|
|
182
|
+
else if (attribution.kind === 'unattributed_capture')
|
|
183
|
+
reason = 'unattributed_capture';
|
|
184
|
+
else
|
|
185
|
+
reason = fact.parentCount >= 2 ? 'merge_commit' : 'no_trailer';
|
|
186
|
+
return { ...head, ...unowned, unattributed: reason, foreignDeliveryId: null };
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Fold the attributed commits into per-path rows, path-sorted for stability.
|
|
190
|
+
* `commits` must be in git log order (NEWEST FIRST), as the reader returns it:
|
|
191
|
+
* the first commit seen for a path is the LAST to touch it, and whether THAT
|
|
192
|
+
* one removed it settles the tip state -- a delete then a re-add is not gone.
|
|
193
|
+
*/
|
|
194
|
+
function foldFiles(commits, capped) {
|
|
195
|
+
const acc = new Map();
|
|
196
|
+
for (const commit of commits) {
|
|
197
|
+
for (const path of commit.files) {
|
|
198
|
+
let entry = acc.get(path);
|
|
199
|
+
if (!entry) {
|
|
200
|
+
entry = { ids: [], names: [], hasUnattributed: false, allReviewed: true,
|
|
201
|
+
removedBySha: commit.removedFiles.includes(path) ? commit.sha : null };
|
|
202
|
+
acc.set(path, entry);
|
|
203
|
+
}
|
|
204
|
+
if (commit.deliveryId) {
|
|
205
|
+
if (!entry.ids.includes(commit.deliveryId)) {
|
|
206
|
+
entry.ids.push(commit.deliveryId);
|
|
207
|
+
entry.names.push(commit.deliveryName ?? commit.deliveryId);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
entry.hasUnattributed = true;
|
|
212
|
+
}
|
|
213
|
+
if (commit.reviewState !== 'reviewed')
|
|
214
|
+
entry.allReviewed = false;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return [...acc.entries()]
|
|
218
|
+
.map(([path, e]) => ({
|
|
219
|
+
path, deliveryIds: e.ids, deliveryNames: e.names, hasUnattributed: e.hasUnattributed,
|
|
220
|
+
listingIncomplete: capped, removedBySha: e.removedBySha,
|
|
221
|
+
// Each condition is stated rather than one implying the others: an
|
|
222
|
+
// unattributed contributor must never read as reviewed even if a future
|
|
223
|
+
// edit changes what reviewState an unattributed commit carries, and a
|
|
224
|
+
// capped read cannot prove the contributors it DID see are all of them.
|
|
225
|
+
reviewState: e.allReviewed && !e.hasUnattributed && !capped ? 'reviewed' : 'unreviewed',
|
|
226
|
+
}))
|
|
227
|
+
.sort((a, b) => a.path.localeCompare(b.path));
|
|
228
|
+
}
|
|
229
|
+
/** Pure: join a read window to the focus's deliveries. */
|
|
230
|
+
export function attributeBranchFacts(facts, deliveries, window) {
|
|
231
|
+
const byId = new Map(deliveries.map((d) => [d.id, d]));
|
|
232
|
+
const commits = facts.map((f) => attributeCommit(f, byId));
|
|
233
|
+
const capped = window.capped ?? false;
|
|
234
|
+
return {
|
|
235
|
+
base: window.base, tip: window.tip, commits, capped, files: foldFiles(commits, capped),
|
|
236
|
+
// Line grain is a SECOND, dearer read (one blame per file), so this pure
|
|
237
|
+
// join does not perform it. Null, not [], because "not asked" must not
|
|
238
|
+
// read as "asked, nothing to resolve" -- see the field's comment.
|
|
239
|
+
lines: null,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* The most files one reading blames. Blame walks a file's history, so this is
|
|
244
|
+
* the module's dearest read; past the cap a file is DECLARED unattributed at
|
|
245
|
+
* line grain, never blamed or silently skipped. Unchanged from when only
|
|
246
|
+
* ambiguous files were blamed: widening the SELECTION to every live file did
|
|
247
|
+
* not widen the worst case, only which files the budget reaches first.
|
|
248
|
+
*/
|
|
249
|
+
export const BRANCH_FACT_BLAME_FILE_CAP = 40;
|
|
250
|
+
/** Group header of `git blame --incremental`: `<sha> <orig> <final> <count>`. */
|
|
251
|
+
const BLAME_GROUP_HEADER = /^([0-9a-f]{40}) \d+ (\d+) (\d+)$/;
|
|
252
|
+
/**
|
|
253
|
+
* Pure: parse `git blame --incremental` output into tip-ordered runs.
|
|
254
|
+
*
|
|
255
|
+
* `--incremental` over porcelain because it emits ONLY the run headers and
|
|
256
|
+
* per-commit metadata -- never the file's content -- so the read costs the
|
|
257
|
+
* same for a 10-line file and a 10000-line one. Every non-header line
|
|
258
|
+
* (author, summary, `previous`, `boundary`, `filename`) is metadata and is
|
|
259
|
+
* ignored; git repeats a header-only block for a commit it already described,
|
|
260
|
+
* which is why the parse keys on the header shape alone.
|
|
261
|
+
*/
|
|
262
|
+
export function parseBlameRanges(output) {
|
|
263
|
+
const ranges = [];
|
|
264
|
+
for (const line of output.split('\n')) {
|
|
265
|
+
const match = BLAME_GROUP_HEADER.exec(line.trim());
|
|
266
|
+
if (!match)
|
|
267
|
+
continue;
|
|
268
|
+
const sha = match[1] ?? '';
|
|
269
|
+
const startLine = Number(match[2] ?? '0');
|
|
270
|
+
const lineCount = Number(match[3] ?? '0');
|
|
271
|
+
if (sha === '' || !Number.isFinite(startLine) || startLine < 1)
|
|
272
|
+
continue;
|
|
273
|
+
ranges.push({ sha, startLine, lineCount: Math.max(lineCount, 1) });
|
|
274
|
+
}
|
|
275
|
+
return ranges.sort((a, b) => a.startLine - b.startLine);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Blame ONE path at `tip` in the repository at `repoPath`. Move/copy detection
|
|
279
|
+
* (`-C`, `-M`) is deliberately NOT enabled: it would name the commit a line
|
|
280
|
+
* came FROM in another file, not the one that put the line where the pass is
|
|
281
|
+
* reading it -- plausible and wrong is worse here than no attribution at all.
|
|
282
|
+
* Returns null on any git failure, which the caller renders as a declared gap.
|
|
283
|
+
*/
|
|
284
|
+
export function readFileBlameRanges(repoPath, tip, path) {
|
|
285
|
+
const repo = (repoPath ?? '').trim();
|
|
286
|
+
const rev = (tip ?? '').trim();
|
|
287
|
+
if (repo === '' || rev === '' || path === '')
|
|
288
|
+
return null;
|
|
289
|
+
try {
|
|
290
|
+
return parseBlameRanges(execFileSync('git', ['blame', '--incremental', rev, '--', path], { cwd: repo, ...GIT_READ }));
|
|
291
|
+
}
|
|
292
|
+
catch {
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* The paths to spend the blame budget on, riskiest first. EVERY file still
|
|
298
|
+
* present at the tip is a candidate: the rule this replaced blamed only
|
|
299
|
+
* multi-contributor files and let a single-contributor file row answer for all
|
|
300
|
+
* its lines -- false for a pre-existing file, whose untouched lines predate the
|
|
301
|
+
* base, and false again whenever a capped read hid the other contributors. A
|
|
302
|
+
* path the window's newest touch REMOVED is excluded instead: blame cannot read
|
|
303
|
+
* it, and the log already attributed its removal.
|
|
304
|
+
*
|
|
305
|
+
* The ORDER is what the cost bound rests on now. A contributor is a delivery,
|
|
306
|
+
* "at least one unattributed commit", or "the read was capped, so there may be
|
|
307
|
+
* more"; above one, a wrong answer is dearest (a reviewed and an unreviewed
|
|
308
|
+
* delivery in one file), so those go first and an exhausted budget leaves the
|
|
309
|
+
* CHEAPEST facts declared rather than the dearest guessed.
|
|
310
|
+
*/
|
|
311
|
+
export function selectBlamePaths(files) {
|
|
312
|
+
const contributors = (f) => f.deliveryIds.length + (f.hasUnattributed ? 1 : 0) + (f.listingIncomplete ? 1 : 0);
|
|
313
|
+
const live = files.filter((f) => f.removedBySha === null);
|
|
314
|
+
return [
|
|
315
|
+
...live.filter((f) => contributors(f) > 1),
|
|
316
|
+
...live.filter((f) => contributors(f) <= 1),
|
|
317
|
+
].map((f) => f.path);
|
|
318
|
+
}
|
|
319
|
+
/** Join ONE sha to its classified commit. Fails closed on a miss. */
|
|
320
|
+
function attributeSha(sha, bySha) {
|
|
321
|
+
const producer = bySha.get(sha);
|
|
322
|
+
// A sha the window read never classified produced its fact BEFORE the base
|
|
323
|
+
// (or past the commit cap). It is not this focus's residue to claim, and
|
|
324
|
+
// guessing the nearest delivery is exactly the inference this module
|
|
325
|
+
// removes -- so it is unattributed, and therefore unreviewed.
|
|
326
|
+
if (!producer) {
|
|
327
|
+
return { deliveryId: null, deliveryName: null, reviewState: 'unreviewed', unattributed: 'outside_read_window' };
|
|
328
|
+
}
|
|
329
|
+
// Taken from the COMMIT row rather than recomputed, so one commit can never
|
|
330
|
+
// read reviewed at line grain and unreviewed at commit grain.
|
|
331
|
+
const { deliveryId, deliveryName, reviewState, unattributed } = producer;
|
|
332
|
+
return { deliveryId, deliveryName, reviewState, unattributed };
|
|
333
|
+
}
|
|
334
|
+
/** Join one blame run to the commit that produced it. */
|
|
335
|
+
function attributeRange(range, bySha) {
|
|
336
|
+
const endLine = range.startLine + range.lineCount - 1;
|
|
337
|
+
return { startLine: range.startLine, endLine, sha: range.sha, ...attributeSha(range.sha, bySha) };
|
|
338
|
+
}
|
|
339
|
+
/** The removal fact for a path gone at the tip -- read from the log, not blamed. */
|
|
340
|
+
function deletionLines(file, bySha) {
|
|
341
|
+
const sha = file.removedBySha ?? '';
|
|
342
|
+
return { path: file.path, ranges: [], gap: 'deleted_at_tip', deletion: { sha, ...attributeSha(sha, bySha) } };
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Attach line grain: EVERY path the window touched gets a row -- blame runs
|
|
346
|
+
* for a live path (up to `fileCap` of them), the removing commit for a path
|
|
347
|
+
* gone at the tip, or the declared gap standing in for either. Nothing is left
|
|
348
|
+
* out, because a file the table omits is one whose lines the pass answers for
|
|
349
|
+
* from the file row -- the false claim this grain exists to prevent.
|
|
350
|
+
*
|
|
351
|
+
* Pure but for `readBlame`, the single injected seam -- so a test can drive
|
|
352
|
+
* the REAL git reader against a real repository, and a caller with no
|
|
353
|
+
* repository leaves line grain unattached (null) rather than fabricate one.
|
|
354
|
+
*/
|
|
355
|
+
export function attributeLineGrain(provenance, readBlame, fileCap = BRANCH_FACT_BLAME_FILE_CAP) {
|
|
356
|
+
const bySha = new Map(provenance.commits.map((c) => [c.sha, c]));
|
|
357
|
+
// Deleted paths are answered first and free: their fact is the removal, and
|
|
358
|
+
// they spend none of the budget the live paths compete for.
|
|
359
|
+
const deleted = provenance.files.filter((f) => f.removedBySha !== null).map((f) => deletionLines(f, bySha));
|
|
360
|
+
const blamed = selectBlamePaths(provenance.files).map((path, index) => {
|
|
361
|
+
if (index >= fileCap)
|
|
362
|
+
return { path, ranges: [], gap: 'over_file_cap', deletion: null };
|
|
363
|
+
let runs;
|
|
364
|
+
try {
|
|
365
|
+
runs = readBlame(path);
|
|
366
|
+
}
|
|
367
|
+
catch {
|
|
368
|
+
runs = null;
|
|
369
|
+
}
|
|
370
|
+
if (runs === null)
|
|
371
|
+
return { path, ranges: [], gap: 'blame_unreadable', deletion: null };
|
|
372
|
+
return { path, ranges: runs.map((r) => attributeRange(r, bySha)), gap: null, deletion: null };
|
|
373
|
+
});
|
|
374
|
+
// Path-sorted for the reader, though the BUDGET above was spent in risk
|
|
375
|
+
// order: the table is looked up by path, not read top to bottom.
|
|
376
|
+
return { ...provenance, lines: [...deleted, ...blamed].sort((a, b) => a.path.localeCompare(b.path)) };
|
|
377
|
+
}
|
|
378
|
+
// -- Rendering --------------------------------------------------------------
|
|
379
|
+
/** Sub-section heading, shared by the reading and the unavailable line. */
|
|
380
|
+
export const PROVENANCE_HEADING = '### Fact provenance (which delivery produced each observed change?)';
|
|
381
|
+
/** How many commit / file rows are listed before the rest are declared unlisted. */
|
|
382
|
+
const MAX_RENDERED_COMMITS = 150;
|
|
383
|
+
const MAX_RENDERED_FILES = 250;
|
|
384
|
+
/** Human phrasing for each unattributable shape, stated in the row itself. */
|
|
385
|
+
const UNATTRIBUTED_PHRASE = {
|
|
386
|
+
no_trailer: 'no `Telora-Delivery` trailer on the commit',
|
|
387
|
+
merge_commit: 'a merge commit -- it carries no trailer and git lists no files for it',
|
|
388
|
+
non_delivery_commit: '`Telora-Delivery: none` -- declared housekeeping, owned by no delivery',
|
|
389
|
+
unattributed_capture: '`Telora-Delivery: unattributed` -- real work whose delivery the daemon could not name',
|
|
390
|
+
foreign_delivery: 'its trailer names a delivery that is NOT one of this focus\'s',
|
|
391
|
+
outside_read_window: 'its producing commit is outside the read window -- it predates the base, or the read stopped at its commit cap',
|
|
392
|
+
};
|
|
393
|
+
/** The standing reading rule. Stated before the rows so truncation cannot drop it. */
|
|
394
|
+
const PROVENANCE_RULE = [
|
|
395
|
+
'**Attribution is read, never guessed.** Each fact you observe on this branch was produced by',
|
|
396
|
+
'exactly one COMMIT, so the commit\'s attribution is the fact\'s. Look the fact up below; do NOT',
|
|
397
|
+
'infer its producing delivery from a file path, a subject line, or which delivery "sounds like"',
|
|
398
|
+
'it. **UNATTRIBUTED means UNREVIEWED**: a commit this mapping cannot tie to a delivery of this',
|
|
399
|
+
'focus has no known producing delivery, so the hold applies to it exactly as it does to residue',
|
|
400
|
+
'of an unreviewed delivery. A FILE row names every delivery that TOUCHED the file; it never',
|
|
401
|
+
'answers for a LINE, not even when it names exactly one, because a file that existed before this',
|
|
402
|
+
'window began carries lines no delivery of this focus wrote. For a line, read the line table.',
|
|
403
|
+
];
|
|
404
|
+
/** One commit row: sha, subject, and either its delivery or why it has none. */
|
|
405
|
+
function renderCommitRow(commit) {
|
|
406
|
+
const sha = `\`${commit.sha.slice(0, 12)}\``;
|
|
407
|
+
const subject = commit.subject === '' ? '_(no subject)_' : commit.subject;
|
|
408
|
+
if (commit.deliveryId) {
|
|
409
|
+
const state = commit.reviewState === 'reviewed' ? 'REVIEWED' : 'UNREVIEWED';
|
|
410
|
+
return `- ${sha} ${subject} -- **${commit.deliveryName}** (\`${commit.deliveryId}\`) -- ${state}`;
|
|
411
|
+
}
|
|
412
|
+
const reason = commit.unattributed ? UNATTRIBUTED_PHRASE[commit.unattributed] : 'reason unrecorded';
|
|
413
|
+
const foreign = commit.foreignDeliveryId ? ` (\`${commit.foreignDeliveryId}\`)` : '';
|
|
414
|
+
return `- ${sha} ${subject} -- **UNATTRIBUTED** -- ${reason}${foreign} -- treat as UNREVIEWED`;
|
|
415
|
+
}
|
|
416
|
+
/** One file row: every delivery that touched it, never a chosen one. */
|
|
417
|
+
function renderFileRow(file) {
|
|
418
|
+
const state = file.reviewState === 'reviewed' ? 'REVIEWED' : 'UNREVIEWED';
|
|
419
|
+
const owners = file.deliveryIds.map((id, i) => `**${file.deliveryNames[i]}** (\`${id}\`)`);
|
|
420
|
+
// Said in the ROW, not only in the banner: a pass looking one path up never
|
|
421
|
+
// reads the banner, and the cap is what manufactures a false single owner.
|
|
422
|
+
const partialRead = file.listingIncomplete ? ' -- the read was CAPPED, so this list may be MISSING contributors' : '';
|
|
423
|
+
const removed = file.removedBySha ? ` -- DELETED at the tip by \`${file.removedBySha.slice(0, 12)}\`` : '';
|
|
424
|
+
if (owners.length === 0) {
|
|
425
|
+
return `- \`${file.path}\` -- **UNATTRIBUTED** -- no commit touching it names a delivery of this focus`
|
|
426
|
+
+ `${removed}${partialRead} -- ${state}`;
|
|
427
|
+
}
|
|
428
|
+
const multi = owners.length > 1 ? ' -- touched by MORE THAN ONE delivery' : '';
|
|
429
|
+
const partial = file.hasUnattributed ? ' -- AND by at least one UNATTRIBUTED commit' : '';
|
|
430
|
+
return `- \`${file.path}\` -- touched by ${owners.join(', ')}${multi}${partial}${removed}${partialRead} -- ${state}`;
|
|
431
|
+
}
|
|
432
|
+
/** Render up to `cap` rows, declaring the remainder unlisted rather than omitting it. */
|
|
433
|
+
function renderCapped(rows, cap, render, noun) {
|
|
434
|
+
if (rows.length === 0)
|
|
435
|
+
return ['_None._'];
|
|
436
|
+
const lines = rows.slice(0, cap).map(render);
|
|
437
|
+
if (rows.length > cap) {
|
|
438
|
+
lines.push(`- _...and ${rows.length - cap} further ${noun} not listed (the section caps at ${cap}). `
|
|
439
|
+
+ `A fact in an unlisted ${noun.replace(/s$/, '')} is UNATTRIBUTED by this reading -- treat it as UNREVIEWED._`);
|
|
440
|
+
}
|
|
441
|
+
return lines;
|
|
442
|
+
}
|
|
443
|
+
/** Sub-heading for the line table. EVERY file the window touched appears under it. */
|
|
444
|
+
const LINE_GRAIN_HEADING = '#### Lines (which delivery produced each LINE, and each deletion?)';
|
|
445
|
+
/** How many ranges ONE file lists before the rest are declared unlisted. */
|
|
446
|
+
const MAX_RENDERED_RANGES = 40;
|
|
447
|
+
/** How to read the line table -- stated before the rows, so truncation keeps it. */
|
|
448
|
+
const LINE_GRAIN_RULE = [
|
|
449
|
+
'EVERY file the window touched is listed here, single-contributor files included: a file row',
|
|
450
|
+
'above says who TOUCHED the file, never who wrote a given line, and a file that existed before',
|
|
451
|
+
'the base carries lines no delivery of this focus produced. Line numbers are at the branch TIP,',
|
|
452
|
+
'and a range names the commit that LAST wrote those lines; a range whose commit is outside the',
|
|
453
|
+
'read window is UNATTRIBUTED -- those are the pre-base lines, and they are UNREVIEWED. A path',
|
|
454
|
+
'gone at the tip carries the commit that DELETED it. A file the blame budget did not reach says',
|
|
455
|
+
'so, and every line in it is UNATTRIBUTED -- as is any line you cannot find here.',
|
|
456
|
+
];
|
|
457
|
+
/** Why a file has no ranges -- stated in the row, never omitted. */
|
|
458
|
+
const LINE_GAP_PHRASE = {
|
|
459
|
+
// Reached only when the removal itself could not be named; a named removal
|
|
460
|
+
// renders its own row, with the deleting commit's delivery on it.
|
|
461
|
+
deleted_at_tip: 'the path is gone at the tip and this reading could not name the commit that removed it',
|
|
462
|
+
blame_unreadable: 'git could not blame it at the tip (renamed away on this branch, or binary)',
|
|
463
|
+
over_file_cap: `the reading blames at most ${BRANCH_FACT_BLAME_FILE_CAP} files and this one is past that cap`,
|
|
464
|
+
};
|
|
465
|
+
/** One range row: the span, its commit, and either its delivery or why it has none. */
|
|
466
|
+
function renderLineRangeRow(range) {
|
|
467
|
+
const span = range.startLine === range.endLine
|
|
468
|
+
? `line ${range.startLine}`
|
|
469
|
+
: `lines ${range.startLine}-${range.endLine}`;
|
|
470
|
+
const sha = `\`${range.sha.slice(0, 12)}\``;
|
|
471
|
+
if (range.deliveryId) {
|
|
472
|
+
const state = range.reviewState === 'reviewed' ? 'REVIEWED' : 'UNREVIEWED';
|
|
473
|
+
return ` - ${span} -- ${sha} -- **${range.deliveryName}** (\`${range.deliveryId}\`) -- ${state}`;
|
|
474
|
+
}
|
|
475
|
+
const reason = range.unattributed ? UNATTRIBUTED_PHRASE[range.unattributed] : 'reason unrecorded';
|
|
476
|
+
return ` - ${span} -- ${sha} -- **UNATTRIBUTED** -- ${reason} -- treat as UNREVIEWED`;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* A path DELETED at the tip: the removal IS the fact, rendered like any other
|
|
480
|
+
* -- the commit that made it, its delivery, its review state. Declaring it
|
|
481
|
+
* merely "unavailable" strands a fact whose owner is perfectly well known.
|
|
482
|
+
*/
|
|
483
|
+
function renderDeletionRow(path, deletion) {
|
|
484
|
+
const state = deletion.reviewState === 'reviewed' ? 'REVIEWED' : 'UNREVIEWED';
|
|
485
|
+
const reason = deletion.unattributed ? UNATTRIBUTED_PHRASE[deletion.unattributed] : 'reason unrecorded';
|
|
486
|
+
const who = deletion.deliveryId ? `**${deletion.deliveryName}** (\`${deletion.deliveryId}\`)` : `**UNATTRIBUTED** -- ${reason}`;
|
|
487
|
+
return `- \`${path}\` -- **DELETED at the tip** -- \`${deletion.sha.slice(0, 12)}\` -- ${who} -- ${state}`
|
|
488
|
+
+ ' -- the deletion is the fact here; the file has no lines at the tip';
|
|
489
|
+
}
|
|
490
|
+
/** One file: its ranges, its deletion, or the declared gap that stands in. */
|
|
491
|
+
function renderFileLines(file) {
|
|
492
|
+
if (file.deletion)
|
|
493
|
+
return [renderDeletionRow(file.path, file.deletion)];
|
|
494
|
+
if (file.gap) {
|
|
495
|
+
return [
|
|
496
|
+
`- \`${file.path}\` -- **LINE GRAIN UNAVAILABLE** -- ${LINE_GAP_PHRASE[file.gap]} -- `
|
|
497
|
+
+ 'every line in it is UNATTRIBUTED by this reading; treat as UNREVIEWED',
|
|
498
|
+
];
|
|
499
|
+
}
|
|
500
|
+
if (file.ranges.length === 0) {
|
|
501
|
+
return [`- \`${file.path}\` -- blame reported no lines (the file is empty at the tip)`];
|
|
502
|
+
}
|
|
503
|
+
const rows = file.ranges.slice(0, MAX_RENDERED_RANGES).map(renderLineRangeRow);
|
|
504
|
+
if (file.ranges.length > MAX_RENDERED_RANGES) {
|
|
505
|
+
rows.push(` - _...and ${file.ranges.length - MAX_RENDERED_RANGES} further ranges in this file not listed `
|
|
506
|
+
+ `(one file lists at most ${MAX_RENDERED_RANGES}). A line you cannot find above is UNATTRIBUTED `
|
|
507
|
+
+ 'by this reading -- treat it as UNREVIEWED._');
|
|
508
|
+
}
|
|
509
|
+
return [`- \`${file.path}\``, ...rows];
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* The line table. The three states are kept apart on purpose: ranges, "line
|
|
513
|
+
* grain ran and nothing was ambiguous", and "line grain never ran" -- the last
|
|
514
|
+
* of which must not borrow the second's reassuring wording.
|
|
515
|
+
*/
|
|
516
|
+
function renderLineGrain(provenance) {
|
|
517
|
+
const lines = [LINE_GRAIN_HEADING, ''];
|
|
518
|
+
if (provenance.lines === null) {
|
|
519
|
+
lines.push('**NOT ESTABLISHED** -- this reading did not descend to line grain, so NO line in any file above', 'can be tied to a producing delivery, whatever its file row lists. Treat every line as', 'UNATTRIBUTED and therefore UNREVIEWED.');
|
|
520
|
+
return lines;
|
|
521
|
+
}
|
|
522
|
+
lines.push(...LINE_GRAIN_RULE, '');
|
|
523
|
+
if (provenance.lines.length === 0) {
|
|
524
|
+
lines.push('_This window touched no file, so there is no line or deletion to attribute._');
|
|
525
|
+
return lines;
|
|
526
|
+
}
|
|
527
|
+
for (const file of provenance.lines.slice(0, MAX_RENDERED_FILES))
|
|
528
|
+
lines.push(...renderFileLines(file));
|
|
529
|
+
if (provenance.lines.length > MAX_RENDERED_FILES) {
|
|
530
|
+
lines.push(`- _...and ${provenance.lines.length - MAX_RENDERED_FILES} further files not listed (the table caps at `
|
|
531
|
+
+ `${MAX_RENDERED_FILES}). Every line in an unlisted file is UNATTRIBUTED by this reading -- treat it as UNREVIEWED._`);
|
|
532
|
+
}
|
|
533
|
+
return lines;
|
|
534
|
+
}
|
|
535
|
+
/** Render the mapping. Never returns an empty string. */
|
|
536
|
+
export function renderBranchFactProvenance(provenance) {
|
|
537
|
+
const lines = [
|
|
538
|
+
PROVENANCE_HEADING,
|
|
539
|
+
'',
|
|
540
|
+
`Basis: every commit in \`${provenance.base}..${provenance.tip}\`, attributed by its `
|
|
541
|
+
+ '`Telora-Delivery` trailer and joined to the partition above for its review state.',
|
|
542
|
+
'',
|
|
543
|
+
...PROVENANCE_RULE,
|
|
544
|
+
'',
|
|
545
|
+
];
|
|
546
|
+
if (provenance.capped) {
|
|
547
|
+
lines.push(`> **INCOMPLETE** -- the read hit its ${BRANCH_FACT_COMMIT_CAP}-commit cap, so commits older than `
|
|
548
|
+
+ 'the ones below are absent, and EVERY file row below may be missing contributors. A fact you '
|
|
549
|
+
+ 'cannot find here is UNATTRIBUTED.', '');
|
|
550
|
+
}
|
|
551
|
+
lines.push(`#### Commits (${provenance.commits.length})`, '', ...renderCapped(provenance.commits, MAX_RENDERED_COMMITS, renderCommitRow, 'commits'), '', `#### Files touched (${provenance.files.length})`, '', ...renderCapped(provenance.files, MAX_RENDERED_FILES, renderFileRow, 'files'), '', ...renderLineGrain(provenance));
|
|
552
|
+
return lines.join('\n');
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Render the EXPLICIT unavailable block. Rendered instead of nothing on every
|
|
556
|
+
* failure, because an absent mapping reads as "there was nothing to attribute".
|
|
557
|
+
*/
|
|
558
|
+
export function renderBranchFactProvenanceUnavailable(reason) {
|
|
559
|
+
return [
|
|
560
|
+
PROVENANCE_HEADING,
|
|
561
|
+
'',
|
|
562
|
+
'**NOT AVAILABLE -- no fact on this branch can be attributed to a producing delivery.**',
|
|
563
|
+
`Reason: ${reason}`,
|
|
564
|
+
'',
|
|
565
|
+
'No commit, file or LINE on this branch has a known producing delivery in this reading.',
|
|
566
|
+
'This is NOT the same as "the branch carries no facts". Treat EVERY fact you observe as',
|
|
567
|
+
'UNATTRIBUTED and therefore UNREVIEWED: hold it rather than anchoring it, and anchor only a',
|
|
568
|
+
'genuinely new root cause, declared as the anchoring round requires.',
|
|
569
|
+
].join('\n');
|
|
570
|
+
}
|
|
571
|
+
//# sourceMappingURL=branch-fact-provenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branch-fact-provenance.js","sourceRoot":"","sources":["../../../src/resolvers/shared/branch-fact-provenance.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,0EAA0E;AAC1E,wEAAwE;AACxE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAsH3E,8EAA8E;AAE9E,MAAM,SAAS,GAAG,MAAM,CAAC;AACzB,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,QAAQ,GAAG;IACf,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;IAC3B,QAAQ,EAAE,OAAgB;IAC1B,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAA+B;CAChE,CAAC;AAEF;;;;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