@cleocode/core 2026.11.9 → 2026.11.10
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/README.md +9 -9
- package/dist/.source-stamp.json +1 -1
- package/dist/build-provenance.json +2 -2
- package/dist/conduit/conduit-client.d.ts +1 -1
- package/dist/conduit/conduit-client.js +1 -1
- package/dist/conduit/factory.d.ts +1 -1
- package/dist/conduit/factory.js +1 -1
- package/dist/conduit/http-transport.d.ts +1 -1
- package/dist/conduit/http-transport.js +1 -1
- package/dist/conduit/local-transport.d.ts +1 -1
- package/dist/conduit/local-transport.js +1 -1
- package/dist/conduit/sse-transport.d.ts +1 -1
- package/dist/conduit/sse-transport.js +1 -1
- package/dist/crypto/credentials.d.ts +1 -1
- package/dist/crypto/credentials.js +1 -1
- package/dist/docs/build-provenance-graph.d.ts +1 -1
- package/dist/docs/build-provenance-graph.js +35 -39
- package/dist/docs/build-provenance-graph.js.map +1 -1
- package/dist/docs/docs-update.js +9 -1
- package/dist/docs/docs-update.js.map +1 -1
- package/dist/docs/doctor.js +46 -28
- package/dist/docs/doctor.js.map +1 -1
- package/dist/docs/lineage.js +70 -2
- package/dist/docs/lineage.js.map +1 -1
- package/dist/docs/modernize/guard.d.ts +10 -0
- package/dist/docs/modernize/guard.js +27 -0
- package/dist/docs/modernize/guard.js.map +1 -1
- package/dist/docs/modernize/restore.js +10 -2
- package/dist/docs/modernize/restore.js.map +1 -1
- package/dist/docs/modernize/store.d.ts +14 -0
- package/dist/docs/modernize/store.js +44 -0
- package/dist/docs/modernize/store.js.map +1 -1
- package/dist/docs/slug-rename.d.ts +29 -1
- package/dist/docs/slug-rename.js +41 -26
- package/dist/docs/slug-rename.js.map +1 -1
- package/dist/docs/supersede.d.ts +43 -0
- package/dist/docs/supersede.js +103 -0
- package/dist/docs/supersede.js.map +1 -1
- package/dist/docs/wikilinks.d.ts +8 -0
- package/dist/docs/wikilinks.js +23 -16
- package/dist/docs/wikilinks.js.map +1 -1
- package/dist/memory/decision-cross-link.d.ts +1 -1
- package/dist/memory/decision-cross-link.js +1 -1
- package/dist/release/ci-evidence.d.ts +2 -17
- package/dist/release/ci-evidence.js +122 -33
- package/dist/release/ci-evidence.js.map +1 -1
- package/dist/store/attachment-store.js +35 -0
- package/dist/store/attachment-store.js.map +1 -1
- package/dist/store/backup-sidecar.d.ts +5 -1
- package/dist/store/backup-sidecar.js +26 -1
- package/dist/store/backup-sidecar.js.map +1 -1
- package/dist/store/conduit-doc-history.d.ts +26 -1
- package/dist/store/conduit-doc-history.js +68 -11
- package/dist/store/conduit-doc-history.js.map +1 -1
- package/dist/store/open-cleo-db.d.ts +3 -5
- package/dist/store/open-cleo-db.js +68 -168
- package/dist/store/open-cleo-db.js.map +1 -1
- package/dist/store/recover-malformed-db.d.ts +34 -0
- package/dist/store/recover-malformed-db.js +408 -5
- package/dist/store/recover-malformed-db.js.map +1 -1
- package/dist/store/repair-store-salvage.js +5 -3
- package/dist/store/repair-store-salvage.js.map +1 -1
- package/dist/store/repair-store.js +28 -1
- package/dist/store/repair-store.js.map +1 -1
- package/dist/store/restore-marker.d.ts +5 -1
- package/dist/store/restore-marker.js +35 -1
- package/dist/store/restore-marker.js.map +1 -1
- package/dist/store/row-identity.d.ts +11 -0
- package/dist/store/row-identity.js +13 -0
- package/dist/store/row-identity.js.map +1 -1
- package/dist/store/schema/cleo-global/agent-registry.d.ts +2 -2
- package/dist/store/schema/cleo-global/agent-registry.js +2 -2
- package/dist/store/schema/cleo-global/index.d.ts +3 -3
- package/dist/store/schema/cleo-global/index.js +3 -3
- package/dist/store/schema/cleo-global/nexus.d.ts +2 -2
- package/dist/store/schema/cleo-global/nexus.js +2 -2
- package/dist/store/schema/cleo-global/services.d.ts +1 -1
- package/dist/store/schema/cleo-global/services.js +1 -1
- package/dist/store/schema/cleo-global/skills.d.ts +2 -2
- package/dist/store/schema/cleo-global/skills.js +2 -2
- package/dist/store/schema/cleo-global/telemetry.d.ts +2 -2
- package/dist/store/schema/cleo-global/telemetry.js +2 -2
- package/dist/store/schema/cleo-project/audit.d.ts +2 -2
- package/dist/store/schema/cleo-project/audit.js +2 -2
- package/dist/store/schema/cleo-project/conduit.d.ts +2 -2
- package/dist/store/schema/cleo-project/conduit.js +2 -2
- package/dist/store/schema/cleo-project/docs.d.ts +3 -3
- package/dist/store/schema/cleo-project/docs.js +3 -3
- package/dist/store/schema/cleo-project/index.d.ts +3 -3
- package/dist/store/schema/cleo-project/index.js +3 -3
- package/dist/store/schema/cleo-project/lifecycle.d.ts +2 -2
- package/dist/store/schema/cleo-project/lifecycle.js +2 -2
- package/dist/store/schema/cleo-project/nexus-graph.d.ts +1 -1
- package/dist/store/schema/cleo-project/nexus-graph.js +1 -1
- package/dist/store/schema/cleo-project/provenance-commits.d.ts +2 -2
- package/dist/store/schema/cleo-project/provenance-commits.js +2 -2
- package/dist/store/schema/cleo-project/provenance-rest.d.ts +2 -2
- package/dist/store/schema/cleo-project/provenance-rest.js +2 -2
- package/dist/store/schema/cleo-project/runtime.d.ts +2 -2
- package/dist/store/schema/cleo-project/runtime.js +2 -2
- package/dist/store/schema/cleo-project/tasks-core-batch2.d.ts +2 -2
- package/dist/store/schema/cleo-project/tasks-core-batch2.js +2 -2
- package/dist/store/schema/cleo-project/tasks-core.d.ts +2 -2
- package/dist/store/schema/cleo-project/tasks-core.js +2 -2
- package/dist/store/schema/cleo-shared/brain.d.ts +3 -3
- package/dist/store/schema/cleo-shared/brain.js +3 -3
- package/dist/store/sqlite-backup.js +54 -30
- package/dist/store/sqlite-backup.js.map +1 -1
- package/dist/store/sync/apply/applier.js +2 -1
- package/dist/store/sync/apply/applier.js.map +1 -1
- package/dist/store/table-classification.js +12 -0
- package/dist/store/table-classification.js.map +1 -1
- package/dist/system/backup.d.ts +2 -0
- package/dist/system/backup.js +16 -7
- package/dist/system/backup.js.map +1 -1
- package/dist/tasks/done-plan.js +5 -1
- package/dist/tasks/done-plan.js.map +1 -1
- package/migrations/README.md +56 -29
- package/package.json +13 -13
- package/schemas/project-context.schema.json +24 -3
- package/templates/CLEO-REFERENCE.md +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wikilinks.js","sourceRoot":"","sources":["../../src/docs/wikilinks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAA6B,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAiD3C
|
|
1
|
+
{"version":3,"file":"wikilinks.js","sourceRoot":"","sources":["../../src/docs/wikilinks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAA6B,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAiD3C;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,WAAmB;IAC/D,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC;IAC5E,MAAM,OAAO,GAAoB,EAAE,CAAC;IACpC,KAAK,MAAM,GAAG,IAAI,MAAM,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;QACxD,OAAO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AAE,CAAC,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;IAE7E,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC;IAC1E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACtB,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,QAAQ,EAAE,CAAC,CAAC,QAAQ;KACrB,CAAC,CAAC,CAAC;AACN,CAAC;AAED;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,GAAkB;IAC1C,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAAE,OAAO,EAAE,CAAC;QACtC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAClF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* rationale, then creates `affects` edges from the decision graph node to
|
|
6
6
|
* matching `file` / `symbol` nodes in brain_page_nodes. This implements
|
|
7
7
|
* the cross-substrate edge described in
|
|
8
|
-
* docs
|
|
8
|
+
* docs store `brain-synaptic-visualization` §3.2.
|
|
9
9
|
*
|
|
10
10
|
* All database operations are best-effort — they never throw or block the
|
|
11
11
|
* caller. Nodes for referenced files / symbols are upserted on demand so
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* rationale, then creates `affects` edges from the decision graph node to
|
|
6
6
|
* matching `file` / `symbol` nodes in brain_page_nodes. This implements
|
|
7
7
|
* the cross-substrate edge described in
|
|
8
|
-
* docs
|
|
8
|
+
* docs store `brain-synaptic-visualization` §3.2.
|
|
9
9
|
*
|
|
10
10
|
* All database operations are best-effort — they never throw or block the
|
|
11
11
|
* caller. Nodes for referenced files / symbols are upserted on demand so
|
|
@@ -58,9 +58,11 @@
|
|
|
58
58
|
* @task T12634
|
|
59
59
|
*/
|
|
60
60
|
import type { EvidenceAtom, EvidenceValidationContext } from '@cleocode/contracts';
|
|
61
|
+
import type { CiChecksConfig } from '@cleocode/contracts/project-context.js';
|
|
61
62
|
import type { ViewComponentPr } from '../tasks/component-pr.js';
|
|
62
63
|
import { type EvidenceRoots } from '../tasks/evidence.js';
|
|
63
64
|
import { type FetchGhBranchProtection, type PrAtomResolution, type RequiredCheckPinSpec } from './pr-evidence.js';
|
|
65
|
+
export type { CiChecksConfig } from '@cleocode/contracts/project-context.js';
|
|
64
66
|
/** One check on a commit: a job (check run) or a whole workflow run. */
|
|
65
67
|
export interface CommitCheck {
|
|
66
68
|
/** Check-run (job) name or workflow name. */
|
|
@@ -333,23 +335,6 @@ export declare function ciSatisfiesRemedy(root: string, opts?: {
|
|
|
333
335
|
* @task T12634
|
|
334
336
|
*/
|
|
335
337
|
export declare function readCiChecks(projectRoot: string): CiChecksConfig;
|
|
336
|
-
/** `evidence.ciChecks` as read from project context (T12634). */
|
|
337
|
-
export interface CiChecksConfig {
|
|
338
|
-
/** Required checks attesting testsPassed. */
|
|
339
|
-
tests?: string[];
|
|
340
|
-
/** Required checks attesting qaPassed. */
|
|
341
|
-
qa?: string[];
|
|
342
|
-
/**
|
|
343
|
-
* Job-name globs (`*` wildcard) that must each match at least one job run by
|
|
344
|
-
* the pinned workflows of that gate's checks, all `success`, before a `code`
|
|
345
|
-
* task's gate is attested — an aggregate that counts skipped jobs as a pass
|
|
346
|
-
* is not enough.
|
|
347
|
-
*/
|
|
348
|
-
jobs?: {
|
|
349
|
-
tests?: string[];
|
|
350
|
-
qa?: string[];
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
338
|
/**
|
|
354
339
|
* The package code roots (T14260): every path under them is code for CI's
|
|
355
340
|
* `code` change filter (so a template `.md` runs the unit shards) and for
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
import { execFileSync } from 'node:child_process';
|
|
61
61
|
import { readdirSync, readFileSync } from 'node:fs';
|
|
62
62
|
import { join } from 'node:path';
|
|
63
|
+
import { similarityScore } from '../docs/slug-similarity.js';
|
|
63
64
|
import { isGitWorkTree } from '../git/work-tree.js';
|
|
64
65
|
import { checkPrTaskLinkage, isDocumentArtifact, linkedPrChange, reviewedDirectiveLinkage, } from '../tasks/evidence.js';
|
|
65
66
|
import { ghQueryTimeoutMs, isGhCliAvailable } from './github-pr.js';
|
|
@@ -186,8 +187,19 @@ export function readCiChecks(projectRoot) {
|
|
|
186
187
|
const jobLists = typeof jobs === 'object' && jobs !== null
|
|
187
188
|
? jobs
|
|
188
189
|
: undefined;
|
|
189
|
-
const
|
|
190
|
-
|
|
190
|
+
const jobList = (value) => {
|
|
191
|
+
const globs = list(value);
|
|
192
|
+
if (globs)
|
|
193
|
+
return globs;
|
|
194
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
195
|
+
return undefined;
|
|
196
|
+
return {
|
|
197
|
+
pullRequest: list('pullRequest' in value ? value.pullRequest : undefined) ?? [],
|
|
198
|
+
push: list('push' in value ? value.push : undefined) ?? [],
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
const jobTests = jobList(jobLists?.tests);
|
|
202
|
+
const jobQa = jobList(jobLists?.qa);
|
|
191
203
|
return {
|
|
192
204
|
...(list(tests) ? { tests: list(tests) } : {}),
|
|
193
205
|
...(list(qa) ? { qa: list(qa) } : {}),
|
|
@@ -249,6 +261,34 @@ export function jobNameMatches(re, name) {
|
|
|
249
261
|
const expression = name.indexOf('${{');
|
|
250
262
|
return expression > 0 && re.test(name.slice(0, expression).trimEnd());
|
|
251
263
|
}
|
|
264
|
+
/** Exact runs take precedence; only a bare name without a run aliases matrix variants. */
|
|
265
|
+
function matchingJobRuns(glob, checks) {
|
|
266
|
+
const re = globToRegExp(glob);
|
|
267
|
+
if (glob.includes('*'))
|
|
268
|
+
return checks.filter((c) => jobNameMatches(re, c.name));
|
|
269
|
+
const exact = checks.filter((c) => c.name === glob);
|
|
270
|
+
if (exact.length > 0)
|
|
271
|
+
return exact;
|
|
272
|
+
return checks.filter((c) => jobNameMatches(re, c.name) || jobMatrixSuffixStart(re, c.name) > 0);
|
|
273
|
+
}
|
|
274
|
+
/** The configured base can contain parentheses, as can a matrix value. */
|
|
275
|
+
function jobMatrixSuffixStart(re, name) {
|
|
276
|
+
if (!name.endsWith(')'))
|
|
277
|
+
return -1;
|
|
278
|
+
for (let at = name.indexOf(' ('); at > 0; at = name.indexOf(' (', at + 2)) {
|
|
279
|
+
if (re.test(name.slice(0, at)))
|
|
280
|
+
return at;
|
|
281
|
+
}
|
|
282
|
+
return -1;
|
|
283
|
+
}
|
|
284
|
+
/** Same-named jobs from different workflows, apps or events cannot replace one another. */
|
|
285
|
+
function jobRunSource(check) {
|
|
286
|
+
return JSON.stringify([
|
|
287
|
+
check.event,
|
|
288
|
+
check.workflowPath ?? check.workflowName,
|
|
289
|
+
check.appSlug ?? check.appId,
|
|
290
|
+
]);
|
|
291
|
+
}
|
|
252
292
|
/**
|
|
253
293
|
* Judge a gate's required jobs as skipped by CI's own change filter (T14260):
|
|
254
294
|
* accepted only for a diff entirely outside the {@link PACKAGE_CODE_ROOTS},
|
|
@@ -283,10 +323,9 @@ export function evaluateFilterSkippedJobs(globs, changedPaths, checks, sha, scop
|
|
|
283
323
|
const ran = [];
|
|
284
324
|
const skipped = [];
|
|
285
325
|
for (const glob of globs) {
|
|
286
|
-
const re = globToRegExp(glob);
|
|
287
326
|
const latest = new Map();
|
|
288
|
-
for (const c of
|
|
289
|
-
const key = `${c.name}\u0000${c
|
|
327
|
+
for (const c of matchingJobRuns(glob, inScope)) {
|
|
328
|
+
const key = `${c.name}\u0000${jobRunSource(c)}`;
|
|
290
329
|
const prev = latest.get(key);
|
|
291
330
|
if (!prev || c.id > prev.id)
|
|
292
331
|
latest.set(key, c);
|
|
@@ -340,25 +379,30 @@ export function evaluateJobs(globs, checks, sha, scope, onlyEvent) {
|
|
|
340
379
|
const reasons = [];
|
|
341
380
|
const jobs = [];
|
|
342
381
|
for (const glob of globs) {
|
|
343
|
-
const
|
|
344
|
-
const matched = inScope.filter((c) => jobNameMatches(re, c.name));
|
|
382
|
+
const matched = matchingJobRuns(glob, inScope);
|
|
345
383
|
if (matched.length === 0) {
|
|
346
|
-
|
|
384
|
+
const closest = [...new Set(inScope.map((c) => c.name))]
|
|
385
|
+
.map((name) => [name, similarityScore(glob, name)])
|
|
386
|
+
.sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]))
|
|
387
|
+
.slice(0, 3)
|
|
388
|
+
.map(([name]) => JSON.stringify(name));
|
|
389
|
+
reasons.push(`job ${glob}: not found in ${scope.workflows.join(', ')}${closest.length ? `; closest check-run names: ${closest.join(', ')}` : '; no check-run names seen in scope'} on ${sha.slice(0, 12)}`);
|
|
347
390
|
continue;
|
|
348
391
|
}
|
|
349
392
|
const latest = new Map();
|
|
350
393
|
for (const c of matched) {
|
|
351
|
-
const key = `${c.name}\u0000${c
|
|
394
|
+
const key = `${c.name}\u0000${jobRunSource(c)}`;
|
|
352
395
|
const prev = latest.get(key);
|
|
353
396
|
if (!prev || c.id > prev.id)
|
|
354
397
|
latest.set(key, c);
|
|
355
398
|
}
|
|
356
|
-
const
|
|
399
|
+
const runs = [...latest.values()];
|
|
400
|
+
const bad = runs.find((c) => c.status !== 'completed' || c.conclusion !== 'success');
|
|
357
401
|
if (bad) {
|
|
358
402
|
reasons.push(`job ${bad.name}: ${bad.status !== 'completed' ? `pending (${bad.status})` : bad.conclusion} on ${sha.slice(0, 12)}`);
|
|
359
403
|
continue;
|
|
360
404
|
}
|
|
361
|
-
jobs.push(...new Set(
|
|
405
|
+
jobs.push(...new Set(runs.map((c) => c.name)));
|
|
362
406
|
}
|
|
363
407
|
return reasons.length > 0 ? { ok: false, reasons } : { ok: true, jobs };
|
|
364
408
|
}
|
|
@@ -1203,10 +1247,10 @@ export async function failedBeforeAnyTest(checks, sha, required, pins, fetchJobL
|
|
|
1203
1247
|
* required-check judgement reads them; a gate with no globs or no pinned
|
|
1204
1248
|
* workflow is left out here and refused there.
|
|
1205
1249
|
*/
|
|
1206
|
-
function gateJobSpecs(gateLists,
|
|
1207
|
-
const jobs = readCiChecks(storeRoot).jobs;
|
|
1250
|
+
function gateJobSpecs(gateLists, jobs, pins) {
|
|
1208
1251
|
return gateLists.flatMap((g) => {
|
|
1209
|
-
const
|
|
1252
|
+
const configured = jobs?.[g.key];
|
|
1253
|
+
const globs = Array.isArray(configured) ? configured : configured?.push;
|
|
1210
1254
|
const workflows = (g.list ?? []).flatMap((n) => pins[n]?.workflow ? [pins[n].workflow] : []);
|
|
1211
1255
|
const app = (g.list ?? []).map((n) => pins[n]?.app).find((a) => a !== undefined);
|
|
1212
1256
|
if (!globs || globs.length === 0 || workflows.length === 0)
|
|
@@ -2462,11 +2506,27 @@ export async function resolveCiEvidenceAtom(prNumber, roots, opts = {}) {
|
|
|
2462
2506
|
? head
|
|
2463
2507
|
: undefined;
|
|
2464
2508
|
let checks = fetched.checks;
|
|
2465
|
-
|
|
2466
|
-
const
|
|
2509
|
+
const eventJobKeys = gateLists.flatMap((g) => {
|
|
2510
|
+
const jobs = ciChecks.jobs?.[g.key];
|
|
2511
|
+
return jobs && !Array.isArray(jobs) ? [`evidence.ciChecks.jobs.${g.key}`] : [];
|
|
2512
|
+
});
|
|
2513
|
+
if (!mainOnly &&
|
|
2514
|
+
head &&
|
|
2515
|
+
head !== pr.mergeCommitSha &&
|
|
2516
|
+
(treeEqualHead || eventJobKeys.length > 0)) {
|
|
2517
|
+
const onHead = await fetchChecks(head, cwd);
|
|
2467
2518
|
if (onHead.ok)
|
|
2468
2519
|
checks = [...checks, ...onHead.checks];
|
|
2469
2520
|
}
|
|
2521
|
+
const docsOnlyDiff = pr.changedPaths.length > 0 && pr.changedPaths.every(isCiDocumentPath);
|
|
2522
|
+
const jobSpecs = docsOnlyDiff ? [] : gateJobSpecs(gateLists, ciChecks.jobs, pins);
|
|
2523
|
+
const pushUnmet = !docsOnlyDiff &&
|
|
2524
|
+
gateJobSpecs(gateLists.filter((g) => {
|
|
2525
|
+
const jobs = ciChecks.jobs?.[g.key];
|
|
2526
|
+
return jobs && !Array.isArray(jobs);
|
|
2527
|
+
}), ciChecks.jobs, pins).some((job) => !evaluateJobs(job.globs, checks, pr.mergeCommitSha, job.scope, 'push').ok);
|
|
2528
|
+
// The push stand-in search must see superseded merge checks despite an equal PR tree.
|
|
2529
|
+
const checkHead = pushUnmet ? undefined : treeEqualHead;
|
|
2470
2530
|
let judgedChecks = evaluateMergeCommitChecks(required.workflows, checks, pr.mergeCommitSha, {
|
|
2471
2531
|
...(treeEqualHead ? { treeEquivalentSha: treeEqualHead } : {}),
|
|
2472
2532
|
pins,
|
|
@@ -2483,15 +2543,13 @@ export async function resolveCiEvidenceAtom(prNumber, roots, opts = {}) {
|
|
|
2483
2543
|
// T13846: a code task's gates need their jobs to have run, so the stand-in
|
|
2484
2544
|
// must be a later main run where they did — not merely the first one whose
|
|
2485
2545
|
// required checks are green (a scripts-only merge skips the test jobs).
|
|
2486
|
-
|
|
2487
|
-
const jobSpecs = docsOnlyDiff ? [] : gateJobSpecs(gateLists, roots.storeRoot, pins);
|
|
2488
|
-
if (!judgedChecks.ok && onDefault.ref !== null) {
|
|
2546
|
+
if ((!judgedChecks.ok || pushUnmet) && onDefault.ref !== null) {
|
|
2489
2547
|
const found = await findGreenDescendant({
|
|
2490
2548
|
...(jobSpecs.length > 0 ? { jobs: jobSpecs } : {}),
|
|
2491
2549
|
required: required.workflows,
|
|
2492
2550
|
checks,
|
|
2493
2551
|
mergeCommitSha: pr.mergeCommitSha,
|
|
2494
|
-
...(
|
|
2552
|
+
...(checkHead ? { treeEquivalentSha: checkHead } : {}),
|
|
2495
2553
|
pins,
|
|
2496
2554
|
changedPaths: pr.changedPaths,
|
|
2497
2555
|
...(pr.headRefOid ? { prHeadSha: pr.headRefOid } : {}),
|
|
@@ -2510,7 +2568,7 @@ export async function resolveCiEvidenceAtom(prNumber, roots, opts = {}) {
|
|
|
2510
2568
|
if (found.ok) {
|
|
2511
2569
|
const withDescendant = [...checks, ...found.checks];
|
|
2512
2570
|
const rejudged = evaluateMergeCommitChecks(required.workflows, withDescendant, pr.mergeCommitSha, {
|
|
2513
|
-
...(
|
|
2571
|
+
...(checkHead ? { treeEquivalentSha: checkHead } : {}),
|
|
2514
2572
|
pins,
|
|
2515
2573
|
descendantSha: found.sha,
|
|
2516
2574
|
...(found.inherited || found.nonTest || found.untested
|
|
@@ -2601,7 +2659,7 @@ export async function resolveCiEvidenceAtom(prNumber, roots, opts = {}) {
|
|
|
2601
2659
|
: checks;
|
|
2602
2660
|
const rejudged = found.ok && missing === null
|
|
2603
2661
|
? evaluateMergeCommitChecks(required.workflows, withHead, pr.mergeCommitSha, {
|
|
2604
|
-
...(
|
|
2662
|
+
...(checkHead ? { treeEquivalentSha: checkHead } : {}),
|
|
2605
2663
|
pins,
|
|
2606
2664
|
descendantSha: found.sha,
|
|
2607
2665
|
currentHead: true,
|
|
@@ -2668,7 +2726,10 @@ export async function resolveCiEvidenceAtom(prNumber, roots, opts = {}) {
|
|
|
2668
2726
|
codeName: 'E_EVIDENCE_TESTS_FAILED',
|
|
2669
2727
|
reason: `${lead}${next}\n Required checks (source: ${describeRequiredWorkflowsSource(required.source)}):\n - ${judgedChecks.reasons.join('\n - ')}` +
|
|
2670
2728
|
(descendantReason ? `\n No later main run stands in: ${descendantReason}` : '') +
|
|
2671
|
-
(currentHeadReason ? `\n No current-HEAD run stands in: ${currentHeadReason}` : '')
|
|
2729
|
+
(currentHeadReason ? `\n No current-HEAD run stands in: ${currentHeadReason}` : '') +
|
|
2730
|
+
(eventJobKeys.length
|
|
2731
|
+
? `\n Check the per-event job requirements: ${eventJobKeys.map((key) => `${key}.pullRequest and ${key}.push`).join('; ')}.`
|
|
2732
|
+
: ''),
|
|
2672
2733
|
};
|
|
2673
2734
|
}
|
|
2674
2735
|
// Round 2 (skipped tests): the aggregate counts skipped jobs as a pass. For a
|
|
@@ -2686,13 +2747,17 @@ export async function resolveCiEvidenceAtom(prNumber, roots, opts = {}) {
|
|
|
2686
2747
|
let mergeNonTest;
|
|
2687
2748
|
if (isCode) {
|
|
2688
2749
|
for (const g of gateLists) {
|
|
2689
|
-
const
|
|
2690
|
-
|
|
2750
|
+
const configured = ciChecks.jobs?.[g.key];
|
|
2751
|
+
const byEvent = configured && !Array.isArray(configured) ? configured : undefined;
|
|
2752
|
+
const globs = Array.isArray(configured) ? configured : byEvent?.push;
|
|
2753
|
+
const configKey = `evidence.ciChecks.jobs.${g.key}`;
|
|
2754
|
+
if (!globs?.length || (byEvent && !mainOnly && !byEvent.pullRequest.length)) {
|
|
2691
2755
|
return {
|
|
2692
2756
|
ok: false,
|
|
2693
2757
|
codeName: 'E_EVIDENCE_INSUFFICIENT',
|
|
2694
2758
|
reason: `ci:${prNumber} cannot attest ${g.gate} for code task ${context.task.id}: set ` +
|
|
2695
|
-
|
|
2759
|
+
`${configKey}${byEvent ? (!globs?.length ? '.push' : '.pullRequest') : ''} to the job names that must run (e.g. "Unit Tests*"). ` +
|
|
2760
|
+
`When PR and main jobs differ, set ${configKey}.pullRequest and ${configKey}.push separately.`,
|
|
2696
2761
|
};
|
|
2697
2762
|
}
|
|
2698
2763
|
const scopeWorkflows = (g.list ?? []).flatMap((n) => pins[n]?.workflow ? [pins[n].workflow] : []);
|
|
@@ -2705,7 +2770,7 @@ export async function resolveCiEvidenceAtom(prNumber, roots, opts = {}) {
|
|
|
2705
2770
|
};
|
|
2706
2771
|
}
|
|
2707
2772
|
const scope = { ...(app !== undefined ? { app } : {}), workflows: scopeWorkflows };
|
|
2708
|
-
let judgedJobs = evaluateJobs(globs, checks, pr.mergeCommitSha, scope);
|
|
2773
|
+
let judgedJobs = evaluateJobs(globs, checks, pr.mergeCommitSha, scope, byEvent ? 'push' : undefined);
|
|
2709
2774
|
if (!judgedJobs.ok) {
|
|
2710
2775
|
// T13809: a job red only on the quarantine budget ran every test and
|
|
2711
2776
|
// they all passed; for this gate it ran and succeeded.
|
|
@@ -2715,12 +2780,12 @@ export async function resolveCiEvidenceAtom(prNumber, roots, opts = {}) {
|
|
|
2715
2780
|
if (mergeNonTest.ok) {
|
|
2716
2781
|
const passed = new Set(mergeNonTest.jobs.map((j) => j.mergeRunId));
|
|
2717
2782
|
const asRun = checks.map((c) => (passed.has(c.id) ? { ...c, conclusion: 'success' } : c));
|
|
2718
|
-
const onMerge = evaluateJobs(globs, asRun, pr.mergeCommitSha, scope);
|
|
2783
|
+
const onMerge = evaluateJobs(globs, asRun, pr.mergeCommitSha, scope, byEvent ? 'push' : undefined);
|
|
2719
2784
|
if (onMerge.ok)
|
|
2720
2785
|
judgedJobs = onMerge;
|
|
2721
2786
|
}
|
|
2722
2787
|
}
|
|
2723
|
-
if (!judgedJobs.ok && treeEqualHead && !mainOnly) {
|
|
2788
|
+
if (!judgedJobs.ok && treeEqualHead && !mainOnly && !byEvent) {
|
|
2724
2789
|
const onHead = evaluateJobs(globs, checks, treeEqualHead, scope, 'pull_request');
|
|
2725
2790
|
if (onHead.ok)
|
|
2726
2791
|
judgedJobs = onHead;
|
|
@@ -2728,8 +2793,8 @@ export async function resolveCiEvidenceAtom(prNumber, roots, opts = {}) {
|
|
|
2728
2793
|
if (!judgedJobs.ok && descendant) {
|
|
2729
2794
|
// T12742: the stand-in's jobs, and the PR head's own pull_request jobs.
|
|
2730
2795
|
const onDescendant = evaluateJobs(globs, checks, descendant.sha, scope, 'push');
|
|
2731
|
-
if (!descendant.prHeadSha) {
|
|
2732
|
-
//
|
|
2796
|
+
if (byEvent || !descendant.prHeadSha) {
|
|
2797
|
+
// Per-event head jobs are checked below; main-only never consults them.
|
|
2733
2798
|
if (onDescendant.ok)
|
|
2734
2799
|
judgedJobs = onDescendant;
|
|
2735
2800
|
}
|
|
@@ -2745,7 +2810,7 @@ export async function resolveCiEvidenceAtom(prNumber, roots, opts = {}) {
|
|
|
2745
2810
|
// outside the package code roots, with the required checks green.
|
|
2746
2811
|
let skipNote = '';
|
|
2747
2812
|
if (!judgedJobs.ok) {
|
|
2748
|
-
const skip = evaluateFilterSkippedJobs(globs, pr.changedPaths, checks, descendant?.sha ?? pr.mergeCommitSha, scope);
|
|
2813
|
+
const skip = evaluateFilterSkippedJobs(globs, pr.changedPaths, byEvent ? checks.filter((c) => c.event === 'push') : checks, descendant?.sha ?? pr.mergeCommitSha, scope);
|
|
2749
2814
|
if (skip.ok) {
|
|
2750
2815
|
judgedJobs = { ok: true, jobs: skip.jobs };
|
|
2751
2816
|
filterSkipped[g.gate] = skip.skipped;
|
|
@@ -2753,13 +2818,37 @@ export async function resolveCiEvidenceAtom(prNumber, roots, opts = {}) {
|
|
|
2753
2818
|
else
|
|
2754
2819
|
skipNote = `\n A filter skip does not stand in: ${skip.reason}`;
|
|
2755
2820
|
}
|
|
2821
|
+
let failedKey = byEvent ? `${configKey}.push` : configKey;
|
|
2822
|
+
if (byEvent && !mainOnly) {
|
|
2823
|
+
const onPrHead = evaluateJobs(byEvent.pullRequest, checks, head ?? '', scope, 'pull_request');
|
|
2824
|
+
if (!onPrHead.ok) {
|
|
2825
|
+
judgedJobs = onPrHead;
|
|
2826
|
+
failedKey = `${configKey}.pullRequest`;
|
|
2827
|
+
}
|
|
2828
|
+
else if (judgedJobs.ok) {
|
|
2829
|
+
judgedJobs = { ok: true, jobs: [...onPrHead.jobs, ...judgedJobs.jobs] };
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2756
2832
|
if (!judgedJobs.ok) {
|
|
2833
|
+
const pendingPush = byEvent &&
|
|
2834
|
+
failedKey.endsWith('.push') &&
|
|
2835
|
+
(g.list ?? []).some((name) => {
|
|
2836
|
+
const verdict = judgeOnSha(checks.filter((c) => c.name === name && pinMatches(c, pins[name])), descendant?.sha ?? pr.mergeCommitSha, 'push');
|
|
2837
|
+
return !verdict.ok && verdict.verdict.startsWith('pending');
|
|
2838
|
+
});
|
|
2757
2839
|
return {
|
|
2758
2840
|
ok: false,
|
|
2759
2841
|
codeName: 'E_EVIDENCE_TESTS_FAILED',
|
|
2760
2842
|
reason: `${g.gate} for code task ${context.task.id} needs its jobs to have run on PR #${prNumber}:\n - ` +
|
|
2761
2843
|
judgedJobs.reasons.join('\n - ') +
|
|
2762
|
-
skipNote
|
|
2844
|
+
skipNote +
|
|
2845
|
+
`\n Check ${failedKey}.` +
|
|
2846
|
+
(byEvent && (pendingPush || judgedJobs.reasons.some((r) => r.includes(': pending (')))
|
|
2847
|
+
? `\n The ${failedKey.endsWith('.pullRequest') ? 'PR-head pull_request' : 'main push'} run is pending; wait for it to finish, then verify again.`
|
|
2848
|
+
: '') +
|
|
2849
|
+
(!byEvent
|
|
2850
|
+
? ` When PR and main jobs differ, set ${configKey}.pullRequest and ${configKey}.push separately.`
|
|
2851
|
+
: ''),
|
|
2763
2852
|
};
|
|
2764
2853
|
}
|
|
2765
2854
|
jobsByGate[g.gate] = judgedJobs.jobs;
|