opencode-model-router 2.6.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +239 -0
- package/README.md +3 -1
- package/package.json +2 -2
- package/src/commands/approvals.ts +354 -0
- package/src/commands/output.ts +12 -1
- package/src/compat/v2-hooks.ts +255 -53
- package/src/index.ts +328 -37
- package/src/router/config.ts +48 -2
- package/src/router/dispatch-header.ts +95 -2
- package/src/router/git-tools.ts +165 -9
- package/src/router/protocol.ts +5 -1
- package/src/router/role-agents.ts +110 -3
- package/src/router/roles-config.ts +83 -0
- package/src/router/roles.ts +1 -1
- package/src/router/sessions.ts +11 -0
- package/src/routing/classify/route-line.ts +96 -5
- package/src/routing/classify/types.ts +26 -0
- package/src/routing/outcomes/signals.ts +17 -0
- package/src/routing/roles/admission.ts +1028 -0
- package/src/routing/roles/approvals.ts +876 -0
- package/src/routing/roles/binding.ts +17 -4
- package/src/routing/roles/check-placement.ts +112 -0
- package/src/routing/roles/git-root.ts +500 -0
- package/src/routing/roles/policy.ts +9 -0
- package/src/routing/roles/read-set.ts +325 -0
- package/src/routing/roles/work-root.ts +9 -1
- package/src/routing/wire/dispatch.ts +611 -18
- package/src/routing/wire/working-set.ts +58 -0
- package/src/util/linear-trim.ts +32 -0
- package/src/verify/batch.ts +7 -2
- package/src/verify/branch.ts +135 -0
- package/src/verify/deterministic.ts +232 -10
- package/src/verify/dispatch.ts +284 -9
- package/src/verify/dod.ts +46 -0
- package/src/verify/edges.ts +817 -0
- package/src/verify/gate.ts +349 -16
- package/src/verify/git-top.ts +43 -0
- package/src/verify/head.ts +107 -0
- package/src/verify/pending.ts +155 -8
- package/src/verify/perimeter.ts +1180 -0
- package/src/verify/pin.ts +109 -0
- package/src/verify/reference.ts +174 -30
- package/src/verify/risk.ts +16 -3
- package/src/verify/runner.ts +706 -32
- package/src/verify/tree.ts +347 -8
- package/src/verify/types.ts +57 -0
- package/src/verify/wiring.ts +1324 -35
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The working set of an orchestrator session (`docs/design/cross-repo.md`, Phase 1 step P1.4): the repository locations its role
|
|
3
|
+
* dispatches were bound to, so a later `root=` naming one of their worktrees is admitted by rule 2 (a worktree that a known
|
|
4
|
+
* repository lists). Per orchestrator session, at most {@link WORKING_SET_MAX} roots (the oldest evicted), de-duplicated by
|
|
5
|
+
* worktree (a re-bound worktree moves to the newest place, with its latest location). Forgotten on `session.deleted`.
|
|
6
|
+
*/
|
|
7
|
+
import type { RepoLocation } from "../roles/admission";
|
|
8
|
+
|
|
9
|
+
/** Roots kept per orchestrator session; the oldest is evicted first. */
|
|
10
|
+
export const WORKING_SET_MAX = 16;
|
|
11
|
+
|
|
12
|
+
const sets = new Map<string, RepoLocation[]>();
|
|
13
|
+
|
|
14
|
+
/** Record that a dispatch of `orchestratorSessionID` was bound to `location`. */
|
|
15
|
+
export function addToWorkingSet(orchestratorSessionID: string, location: RepoLocation): void {
|
|
16
|
+
const current = sets.get(orchestratorSessionID) ?? [];
|
|
17
|
+
const next = current.filter((entry) => entry.worktree !== location.worktree);
|
|
18
|
+
next.push(location);
|
|
19
|
+
while (next.length > WORKING_SET_MAX) next.shift();
|
|
20
|
+
sets.set(orchestratorSessionID, next);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The bound locations of `orchestratorSessionID`, oldest first; [] when none. */
|
|
24
|
+
export function workingSetOf(orchestratorSessionID: string): readonly RepoLocation[] {
|
|
25
|
+
return [...(sets.get(orchestratorSessionID) ?? [])];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Drop the working set of a deleted session. */
|
|
29
|
+
export function forgetWorkingSet(orchestratorSessionID: string): void {
|
|
30
|
+
sets.delete(orchestratorSessionID);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Comparison key of a path: case-insensitive on Windows. */
|
|
34
|
+
function workingSetKey(p: string, platform: NodeJS.Platform): string {
|
|
35
|
+
return platform === "win32" ? p.toLowerCase() : p;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Remove one repository from every session's working set (SD-P4-12, `/router revoke`): every entry of the repository whose
|
|
40
|
+
* main worktree is the canonical path `match` (any of its worktrees), every entry bound to that worktree, and every entry
|
|
41
|
+
* backed by an approval of that path. Paths compare as text, case-insensitive on win32. Returns the number of entries removed.
|
|
42
|
+
*/
|
|
43
|
+
export function dropFromWorkingSets(match: string, platform: NodeJS.Platform = process.platform): number {
|
|
44
|
+
const key = workingSetKey(match, platform);
|
|
45
|
+
const hit = (entry: RepoLocation): boolean =>
|
|
46
|
+
workingSetKey(entry.repository, platform) === key
|
|
47
|
+
|| workingSetKey(entry.worktree, platform) === key
|
|
48
|
+
|| (entry.approval !== undefined && workingSetKey(entry.approval, platform) === key);
|
|
49
|
+
let removed = 0;
|
|
50
|
+
for (const [sessionID, entries] of sets) {
|
|
51
|
+
const kept = entries.filter((entry) => !hit(entry));
|
|
52
|
+
if (kept.length === entries.length) continue;
|
|
53
|
+
removed += entries.length - kept.length;
|
|
54
|
+
if (kept.length === 0) sets.delete(sessionID);
|
|
55
|
+
else sets.set(sessionID, kept);
|
|
56
|
+
}
|
|
57
|
+
return removed;
|
|
58
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linear-time trimming helpers.
|
|
3
|
+
*
|
|
4
|
+
* Regular expressions such as `/\/+$/` or `/^\s+|\s+$/` are polynomial on
|
|
5
|
+
* uncontrolled input (CodeQL js/polynomial-redos): on a long run of the
|
|
6
|
+
* repeated character that is not at the end, the engine retries the run from
|
|
7
|
+
* every start position. These helpers scan once from the relevant end.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** Returns `value` without the trailing run of characters for which `isTrimmed` holds. */
|
|
11
|
+
export function trimEndWhile(value: string, isTrimmed: (char: string) => boolean): string {
|
|
12
|
+
let end = value.length;
|
|
13
|
+
while (end > 0 && isTrimmed(value[end - 1] as string)) end--;
|
|
14
|
+
return end === value.length ? value : value.slice(0, end);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Returns `value` without the leading run of characters for which `isTrimmed` holds. */
|
|
18
|
+
export function trimStartWhile(value: string, isTrimmed: (char: string) => boolean): string {
|
|
19
|
+
let start = 0;
|
|
20
|
+
while (start < value.length && isTrimmed(value[start] as string)) start++;
|
|
21
|
+
return start === 0 ? value : value.slice(start);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** True for `/` and `\`. */
|
|
25
|
+
export function isPathSeparator(char: string): boolean {
|
|
26
|
+
return char === "/" || char === "\\";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** True for `/` only. */
|
|
30
|
+
export function isSlash(char: string): boolean {
|
|
31
|
+
return char === "/";
|
|
32
|
+
}
|
package/src/verify/batch.ts
CHANGED
|
@@ -52,6 +52,8 @@
|
|
|
52
52
|
// 1. The coordinator is disposed -> { scoped: aborted BATCH_REASONS.disposed }.
|
|
53
53
|
// 2. request.testScope === "full" -> runtime.direct(request). The resolved command runs as
|
|
54
54
|
// written (2.1-T2 P5f). It cannot be merged, and S6 forbids widening a scoped run into it.
|
|
55
|
+
// 2a. request.crossLinkRoot set -> runtime.direct(request) (cross-repo P3a, SD-P3a-8). The
|
|
56
|
+
// coordinator plans with { command, cwd, changedFiles } only, so a union would drop W.
|
|
55
57
|
// 3. runtime.batchWindowMs <= 0 -> runtime.direct(request). "batchWindowMs: 0 disables
|
|
56
58
|
// batching": every request runs alone, still scoped.
|
|
57
59
|
// 4. plan = runtime.plan(request, request.deadline), that is, planScopedRun (B6). Then:
|
|
@@ -784,7 +786,7 @@ export type OpenBatchScope = (meta: Parameters<OpenVerificationScope>[0]) => Bat
|
|
|
784
786
|
|
|
785
787
|
/** The seams and settings of one gate (deviation D6). The window opener's values apply to its batch. */
|
|
786
788
|
export interface BatchRuntime {
|
|
787
|
-
/** 2.1's one-request hook, used for testScope "full" and batchWindowMs <= 0 (B2). */
|
|
789
|
+
/** 2.1's one-request hook, used for testScope "full", a crossLinkRoot request and batchWindowMs <= 0 (B2). */
|
|
788
790
|
readonly direct: TestsPassHook;
|
|
789
791
|
readonly plan: BatchPlanner;
|
|
790
792
|
readonly openScope: OpenBatchScope;
|
|
@@ -1763,7 +1765,10 @@ export function createBatchCoordinator(options: BatchCoordinatorOptions = {}): B
|
|
|
1763
1765
|
|
|
1764
1766
|
async function submit(runtime: BatchRuntime, request: TestsPassRequest): Promise<TestsPassRun> {
|
|
1765
1767
|
if (disposed) return abortedRun(BATCH_REASONS.disposed);
|
|
1766
|
-
|
|
1768
|
+
// B2 2a (cross-repo P3a, SD-P3a-8): a cross-link request is never batched; the union plan has no W.
|
|
1769
|
+
if (request.testScope === "full" || request.crossLinkRoot !== undefined || !(runtime.batchWindowMs > 0)) {
|
|
1770
|
+
return await runtime.direct(request);
|
|
1771
|
+
}
|
|
1767
1772
|
// QA-2.2-9: planning comes first, as in 2.1's direct hook, so an exhausted deadline still gets
|
|
1768
1773
|
// the planning outcome (NoAffected, S6) the direct path gives, and aborted only for a spec.
|
|
1769
1774
|
// W7: a request in planning may join an open window, so it keeps the windows open.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* src/verify/branch.ts — I7 (P0.2, S9/S12): did the verified working tree switch branch between two tree snapshots? Pure.
|
|
3
|
+
*
|
|
4
|
+
* The wiring compares the dispatch snapshot with the gate's (synchronous path), and the state recorded when a deferred
|
|
5
|
+
* producer returned with router_verify's fresh snapshot, then hands the worded reason to the gate (Artefact.branchSwitch).
|
|
6
|
+
* Kept out of tree.ts on purpose: several tests mock that module with `snapshotTree` alone.
|
|
7
|
+
*/
|
|
8
|
+
import type { TreeSnapshot } from "./dispatch";
|
|
9
|
+
import type { HeadState, ReflogEntry } from "./head";
|
|
10
|
+
import { isSlash, trimEndWhile } from "../util/linear-trim";
|
|
11
|
+
|
|
12
|
+
/** The part of a snapshot (or of a deferred registration) the branch rule reads. */
|
|
13
|
+
export type BranchState = Pick<TreeSnapshot, "head" | "branch">;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Fail closed. Two known branches that differ are a switch, including a new branch at the same commit (`checkout -b`), and
|
|
17
|
+
* so is a detached HEAD at another commit (a commit on a detached HEAD cannot be told apart from a checkout without the
|
|
18
|
+
* reflog). With either side unknown, any HEAD move is a switch. Ancestry never excuses one: a descendant branch can still
|
|
19
|
+
* leave the producer's commit unchecked-out.
|
|
20
|
+
*/
|
|
21
|
+
export function branchSwitched(before: BranchState, now: BranchState): boolean {
|
|
22
|
+
if (before.branch !== undefined && now.branch !== undefined) {
|
|
23
|
+
if (before.branch !== now.branch) return true;
|
|
24
|
+
return before.branch === null && before.head !== now.head;
|
|
25
|
+
}
|
|
26
|
+
return before.head !== now.head;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** `branch feat/x`, `detached HEAD at <7-char sha>`, or `an unknown branch`. */
|
|
30
|
+
export function describeBranch(state: BranchState): string {
|
|
31
|
+
if (state.branch === undefined) return "an unknown branch";
|
|
32
|
+
if (state.branch === null) return `detached HEAD at ${state.head.slice(0, 7)}`;
|
|
33
|
+
return `branch ${state.branch}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** The gate's unverifiable reason for a switch (Artefact.branchSwitch); each side describes itself. */
|
|
37
|
+
export function branchSwitchReason(
|
|
38
|
+
root: string,
|
|
39
|
+
before: BranchState,
|
|
40
|
+
now: BranchState,
|
|
41
|
+
when: "during the dispatch" | "since the producer returned" | "since the attempt that introduced this acceptance",
|
|
42
|
+
): string {
|
|
43
|
+
const verb = before.branch === null && now.branch === null ? "moved" : "switched";
|
|
44
|
+
return `the working tree ${root} ${verb} from ${describeBranch(before)} to ${describeBranch(now)} ${when}; the checks would verify another branch`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** router_verify: a branch was recorded when the producer returned, but the current tree could not be read. */
|
|
48
|
+
export function branchUnconfirmedReason(root: string): string {
|
|
49
|
+
return `cannot confirm the branch of ${root}: the working tree could not be read at router_verify, so the checks could verify another branch. Run router_verify again, or re-dispatch.`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** How a working tree moved between two head states. */
|
|
53
|
+
export type TreeMove = { readonly kind: "switched" | "rewritten" | "relocated"; readonly detail?: string };
|
|
54
|
+
|
|
55
|
+
function sameRoot(a: string, b: string, platform: NodeJS.Platform): boolean {
|
|
56
|
+
const norm = (p: string) => {
|
|
57
|
+
const slashed = trimEndWhile(p.replace(/\\/g, "/"), isSlash); // linear: no `/\/+$/` (polynomial on a run of "/")
|
|
58
|
+
return platform === "win32" ? slashed.toLowerCase() : slashed;
|
|
59
|
+
};
|
|
60
|
+
return norm(a) === norm(b);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** A reflog subject with control characters removed, capped at 120 chars. */
|
|
64
|
+
function cleanSubject(subject: string): string {
|
|
65
|
+
return subject.replace(/[\u0000-\u001f\u007f-\u009f]/g, "").slice(0, 120);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The reflog subjects of entries that move HEAD and are the producer's own work: commits (initial, amend, merge), merges,
|
|
70
|
+
* cherry-pick, revert, am and a `pull` that is not a rebase. Matched up to the first colon, so a message cannot widen it.
|
|
71
|
+
* `pull --rebase` and a pull that rebased through config (`pull origin main (start): checkout …`) are refused: they replay
|
|
72
|
+
* the producer's commits onto another base.
|
|
73
|
+
*/
|
|
74
|
+
const OWN_WORK = /^(?:commit(?: \([^)]*\))?|merge [^:]*|cherry-pick|revert|am|pull(?![^:]*(?:--rebase|\((?:start|pick|reword|edit|squash|fixup|drop|exec|break|label|reset|finish|continue|abort)\)))[^:]*)(?::|$)/i;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Did the tree move between `before` and `now`? Roots that differ are a relocation; two known branches that differ are a
|
|
78
|
+
* switch. `window` is the anchored HEAD reflog window since `before` (readReflogWindow: the entries newer than `before`
|
|
79
|
+
* plus the one that was newest then, newest first); pass it only when both states have a reflog count and the count did not
|
|
80
|
+
* shrink. The window must line up with both heads. An entry that left HEAD where it was (stash, unstage, a same-branch
|
|
81
|
+
* checkout, an abort) is ignored; one that moved HEAD must be the producer's own work (OWN_WORK), else it is a rewrite.
|
|
82
|
+
* Without a window, the fail-closed `branchSwitched` rule decides.
|
|
83
|
+
*/
|
|
84
|
+
export function treeMove(
|
|
85
|
+
before: HeadState,
|
|
86
|
+
now: HeadState,
|
|
87
|
+
window: readonly ReflogEntry[] | undefined,
|
|
88
|
+
platform: NodeJS.Platform = process.platform,
|
|
89
|
+
): TreeMove | undefined {
|
|
90
|
+
if (!sameRoot(before.root, now.root, platform)) return { kind: "relocated" };
|
|
91
|
+
if (before.branch !== now.branch) return { kind: "switched" };
|
|
92
|
+
// Every HEAD update writes a reflog entry: a reflog that shrank, or a HEAD that moved with no new entry, is another history
|
|
93
|
+
// in place (a replaced repository, an expired or edited reflog). Fail closed.
|
|
94
|
+
const counted = before.reflog !== undefined && now.reflog !== undefined;
|
|
95
|
+
if (counted) {
|
|
96
|
+
if (now.reflog! < before.reflog!) return { kind: "rewritten", detail: "the reflog has fewer entries than before" };
|
|
97
|
+
if (now.reflog === before.reflog && now.head !== before.head) return { kind: "rewritten", detail: "HEAD moved without a reflog entry" };
|
|
98
|
+
}
|
|
99
|
+
if (window === undefined) return branchSwitched(before, now) ? { kind: "switched" } : undefined;
|
|
100
|
+
const misaligned: TreeMove = { kind: "rewritten", detail: "the reflog window does not line up with the recorded HEAD" };
|
|
101
|
+
const grown = counted ? now.reflog! - before.reflog! : Math.max(0, window.length - 1);
|
|
102
|
+
if (grown === 0) {
|
|
103
|
+
// Nothing new: the heads are equal here (checked above when counted), and a window, when read, is the one old entry.
|
|
104
|
+
if (now.head !== before.head) return misaligned;
|
|
105
|
+
return window.length === 0 || (window.length === 1 && window[0]!.commit === now.head) ? undefined : misaligned;
|
|
106
|
+
}
|
|
107
|
+
if (window.length !== grown + 1) return misaligned;
|
|
108
|
+
if (window[window.length - 1]!.commit !== before.head || window[0]!.commit !== now.head) return misaligned;
|
|
109
|
+
for (let i = 0; i < window.length - 1; i++) {
|
|
110
|
+
const entry = window[i]!;
|
|
111
|
+
if (entry.commit === window[i + 1]!.commit) continue; // HEAD did not move.
|
|
112
|
+
if (!OWN_WORK.test(entry.subject)) {
|
|
113
|
+
return { kind: "rewritten", detail: entry.subject === "" ? "an unnamed reflog entry" : cleanSubject(entry.subject) };
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** The gate's unverifiable reason for a TreeMove. */
|
|
120
|
+
export function treeMoveReason(
|
|
121
|
+
root: string,
|
|
122
|
+
before: HeadState,
|
|
123
|
+
now: HeadState,
|
|
124
|
+
move: TreeMove,
|
|
125
|
+
when: "during the dispatch" | "since the producer returned",
|
|
126
|
+
): string {
|
|
127
|
+
switch (move.kind) {
|
|
128
|
+
case "switched":
|
|
129
|
+
return `${branchSwitchReason(root, before, now, when)}. Check out ${describeBranch(before)} again and re-dispatch, or send a fresh [acceptance] block on the current branch.`;
|
|
130
|
+
case "rewritten":
|
|
131
|
+
return `the working tree ${root} moved or was rewritten ${when} (reflog: "${move.detail ?? ""}"); the checks could verify a tree without the producer's work. Re-dispatch, or send a fresh [acceptance] block.`;
|
|
132
|
+
case "relocated":
|
|
133
|
+
return `the working tree ${root} is now ${now.root} ${when}; the checks would verify another tree. Re-dispatch in the intended worktree.`;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
@@ -37,6 +37,7 @@ import type {
|
|
|
37
37
|
RunnerHost,
|
|
38
38
|
RunResult,
|
|
39
39
|
TestSearchSeam,
|
|
40
|
+
Unverifiable,
|
|
40
41
|
} from "./runner";
|
|
41
42
|
import type { DispatchReference, MaterializedReference, ReferenceDeps } from "./reference";
|
|
42
43
|
import type { TreeSnapshot } from "./dispatch";
|
|
@@ -47,6 +48,7 @@ import { resolveAgainst } from "./paths";
|
|
|
47
48
|
import { isAbsolute, posix as pathPosix, win32 as pathWin32 } from "node:path";
|
|
48
49
|
import { judgeScoped, observeTests, REFERENCE_NONE } from "./baseline";
|
|
49
50
|
import {
|
|
51
|
+
crossLinkIgnoredS6,
|
|
50
52
|
detectRunner,
|
|
51
53
|
isNoAffected,
|
|
52
54
|
isUnscoped,
|
|
@@ -58,6 +60,7 @@ import {
|
|
|
58
60
|
resolveEntry,
|
|
59
61
|
} from "./runner";
|
|
60
62
|
import { fileKeyOfId } from "./baseline";
|
|
63
|
+
import { isTestPath } from "./risk";
|
|
61
64
|
import { DEFAULT_MATERIALIZE_TIMEOUT_MS, gcStaleReferences, materialize, nodeReferenceFs } from "./reference";
|
|
62
65
|
import { acquireSlot, type SlotHandle } from "./slot";
|
|
63
66
|
|
|
@@ -1238,6 +1241,19 @@ export interface DirectTestsPassHookDeps {
|
|
|
1238
1241
|
currentTree?: TreeSnapshot;
|
|
1239
1242
|
/** Planner seam; default planScopedRun. */
|
|
1240
1243
|
plan?: typeof planScopedRun;
|
|
1244
|
+
/**
|
|
1245
|
+
* Cross-repo P3a (D23, OD-P3a-2 b): lists the linked repository's git-ignored modules (tree.ts listIgnoredModules), added to a
|
|
1246
|
+
* cross-link request's changed files so a consumer that loads W's build output (`dist/`) is selected. Called only for a request
|
|
1247
|
+
* with `crossLinkRoot`, a `dispatchStartedAt` (`since`: only the files modified at or after it, D23 as amended 2026-10-12)
|
|
1248
|
+
* and a non-empty change set; absent: nothing is added (as before).
|
|
1249
|
+
*/
|
|
1250
|
+
listIgnored?: (root: string, signal: AbortSignal, since: number) => Promise<import("./tree").IgnoredModules>;
|
|
1251
|
+
/**
|
|
1252
|
+
* Cross-repo P3a (D23, QA round 2 M-A): a changed source's mtime in ms (tree.ts fileMtimeMs), undefined when the file does not
|
|
1253
|
+
* exist. Compared with the newest listed ignored module of each ignored directory; absent, or a throw, counts as newer than
|
|
1254
|
+
* any build (fail closed: S6 cross-link-build-stale).
|
|
1255
|
+
*/
|
|
1256
|
+
mtimeOf?: (path: string) => Promise<number | undefined>;
|
|
1241
1257
|
logger?: Pick<PluginLogger, "warn">;
|
|
1242
1258
|
}
|
|
1243
1259
|
|
|
@@ -1274,6 +1290,78 @@ async function synthesizeFullResult(
|
|
|
1274
1290
|
};
|
|
1275
1291
|
}
|
|
1276
1292
|
|
|
1293
|
+
/** Cross-repo P3a (D23, QA round 2 M-A): declaration files are never build inputs whose edit leaves the build output stale. */
|
|
1294
|
+
const DECLARATION_SOURCE = /\.d\.[cm]?ts$/i;
|
|
1295
|
+
|
|
1296
|
+
/**
|
|
1297
|
+
* Cross-repo P3a (D23, QA round 2 M-A): mirrors tree.ts IGNORED_TOOL_STATE_DIRS (not imported: this module stays pure). A path
|
|
1298
|
+
* relative to W with a `node_modules` (so `node_modules/.vite`) or tool-state segment, any case for the latter.
|
|
1299
|
+
*/
|
|
1300
|
+
const TOOL_STATE_DIRS: readonly string[] = ["coverage", ".nyc_output", ".vitest", ".cache"];
|
|
1301
|
+
function isToolStatePath(relative: string): boolean {
|
|
1302
|
+
return relative.split(/[\\/]/).some(segment => segment === "node_modules" || TOOL_STATE_DIRS.includes(segment.toLowerCase()));
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
/** A deleted status: a porcelain XY code with D in either column, else (`D`, `deleted`) its first letter (as risk.ts). */
|
|
1306
|
+
function isDeletedStatus(status: string | undefined): boolean {
|
|
1307
|
+
if (status === undefined) return false;
|
|
1308
|
+
return /^[ MADRCU?!]{2}$/.test(status) ? status.includes("D") : /^d/i.test(status);
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
/**
|
|
1312
|
+
* Cross-repo P3a (D23, QA round 2 M-A): S6 `cross-link-build-stale` when a changed source of W is newer than the newest listed
|
|
1313
|
+
* ignored module of an ignored directory (`newestByDir`, tree.ts newestMtimeByDir), else undefined. The sources: the request's
|
|
1314
|
+
* changed files under `root` that are not tests (risk.ts isTestPath, on the W-relative path), not declaration files, not
|
|
1315
|
+
* deleted and not ignored (`!!`). A source that no longer exists (`mtimeOf` undefined) is skipped; a source whose mtime cannot
|
|
1316
|
+
* be read (a throw, or no `mtimeOf`) counts as newer than any build (fail closed). The newest source names the S6; the
|
|
1317
|
+
* directories are compared in sorted order.
|
|
1318
|
+
*/
|
|
1319
|
+
async function buildStaleness(
|
|
1320
|
+
req: TestsPassRequest,
|
|
1321
|
+
root: string,
|
|
1322
|
+
newestByDir: Readonly<Record<string, number>>,
|
|
1323
|
+
mtimeOf: ((path: string) => Promise<number | undefined>) | undefined,
|
|
1324
|
+
host: Partial<RunnerHost> | undefined,
|
|
1325
|
+
): Promise<Unverifiable | undefined> {
|
|
1326
|
+
if (req.changedFiles === "unavailable") return undefined;
|
|
1327
|
+
const P = (host?.platform ?? process.platform) === "win32" ? pathWin32 : pathPosix;
|
|
1328
|
+
let newestSource: { rel: string; mtime: number } | undefined;
|
|
1329
|
+
const sources = req.changedFiles
|
|
1330
|
+
.filter(f => f.status !== "!!" && !isDeletedStatus(f.status))
|
|
1331
|
+
.map(f => {
|
|
1332
|
+
const absolute = P.isAbsolute(f.path) ? f.path : P.resolve(req.cwd, f.path);
|
|
1333
|
+
return { absolute, rel: P.relative(root, absolute).replace(/\\/g, "/") };
|
|
1334
|
+
})
|
|
1335
|
+
.filter(s => s.rel !== "" && s.rel !== ".." && !s.rel.startsWith("../") && !P.isAbsolute(s.rel))
|
|
1336
|
+
.filter(s => !isTestPath(s.rel) && !DECLARATION_SOURCE.test(s.rel))
|
|
1337
|
+
.sort((a, b) => (a.rel < b.rel ? -1 : a.rel > b.rel ? 1 : 0));
|
|
1338
|
+
for (const source of sources) {
|
|
1339
|
+
let mtime: number | undefined;
|
|
1340
|
+
try {
|
|
1341
|
+
mtime = mtimeOf === undefined ? Infinity : await mtimeOf(source.absolute);
|
|
1342
|
+
} catch {
|
|
1343
|
+
mtime = Infinity;
|
|
1344
|
+
}
|
|
1345
|
+
if (mtime === undefined) continue; // Gone: no content of it can be newer than the build.
|
|
1346
|
+
if (Number.isNaN(mtime)) mtime = Infinity; // Unreadable: fail closed.
|
|
1347
|
+
if (newestSource === undefined || mtime > newestSource.mtime) newestSource = { rel: source.rel, mtime };
|
|
1348
|
+
}
|
|
1349
|
+
if (newestSource === undefined) return undefined;
|
|
1350
|
+
for (const dir of Object.keys(newestByDir).sort()) {
|
|
1351
|
+
if (newestSource.mtime > newestByDir[dir]) {
|
|
1352
|
+
const where = dir === "." ? root : `${root}/${dir}`;
|
|
1353
|
+
return {
|
|
1354
|
+
unverifiable: true,
|
|
1355
|
+
code: "cross-link-build-stale",
|
|
1356
|
+
reason:
|
|
1357
|
+
`the build output in ${where} is older than ${newestSource.rel} changed in the linked repository; ` +
|
|
1358
|
+
"rebuild it (e.g. a buildPasses check in the linked repository before this one) or use scope=full",
|
|
1359
|
+
};
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
return undefined;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1277
1365
|
/**
|
|
1278
1366
|
* S5 as a direct call (2.1.2.4; 2.2 swaps in the batch coordinator): plan, run under ONE scope,
|
|
1279
1367
|
* recheck the failing files at the dispatch reference, close the scope. Never rejects.
|
|
@@ -1300,6 +1388,55 @@ export function createDirectTestsPassHook(deps: DirectTestsPassHookDeps): TestsP
|
|
|
1300
1388
|
return scope.rechecker(req.command, req.cwd, deps.currentTree)(ref.reference, scoped.result.failingFiles, req.deadline);
|
|
1301
1389
|
};
|
|
1302
1390
|
|
|
1391
|
+
/**
|
|
1392
|
+
* Cross-repo P3a (D23, OD-P3a-2 b, finding X6): with `crossLinkRoot` and a lister, W's git-ignored modules are appended to the
|
|
1393
|
+
* changed files (exact-path duplicates dropped; status `!!`, git's code for an ignored file), so a consumer that loads W's
|
|
1394
|
+
* build output (`dist/`) is selected. Over the bounds, unlisted or a throwing lister → S6 (fail closed), before any plan.
|
|
1395
|
+
* Otherwise (no cross-link root, no lister, unavailable changed files, nothing ignored) the request's own changed files.
|
|
1396
|
+
*
|
|
1397
|
+
* D23 as amended (2026-10-12, QA C1/M4): only the modules whose own mtime is at or after the dispatch start are listed (lister
|
|
1398
|
+
* `since` = the request's `dispatchStartedAt`, the original start of a deferred one; tool-state directories such as
|
|
1399
|
+
* `coverage/` never), so a build output older than the dispatch is never a run input. A module written during the dispatch
|
|
1400
|
+
* is still stale when W's source changed again after it (QA round 2 M-A): when any changed source of W (buildStaleness) is
|
|
1401
|
+
* newer than the newest listed module of an ignored directory that contributed modules (`dist/`), the request is S6
|
|
1402
|
+
* `cross-link-build-stale` (fail closed), before any plan. No start time, or no change of W's in the request: the lister is
|
|
1403
|
+
* not called and nothing is added; nothing listed: nothing is added and nothing is compared (toward zero selection, never
|
|
1404
|
+
* toward stale inputs).
|
|
1405
|
+
*/
|
|
1406
|
+
const withIgnoredModules = async (req: TestsPassRequest): Promise<{ files: TestsPassRequest["changedFiles"] } | Unverifiable> => {
|
|
1407
|
+
if (req.crossLinkRoot === undefined || deps.listIgnored === undefined || req.changedFiles === "unavailable") {
|
|
1408
|
+
return { files: req.changedFiles };
|
|
1409
|
+
}
|
|
1410
|
+
const since = req.dispatchStartedAt;
|
|
1411
|
+
if (since === undefined || !Number.isFinite(since) || req.changedFiles.length === 0) return { files: req.changedFiles };
|
|
1412
|
+
const root = req.crossLinkRoot;
|
|
1413
|
+
let listed: import("./tree").IgnoredModules;
|
|
1414
|
+
try {
|
|
1415
|
+
listed = await deps.listIgnored(root, req.deadline.signal, since);
|
|
1416
|
+
} catch {
|
|
1417
|
+
listed = { unavailable: true };
|
|
1418
|
+
}
|
|
1419
|
+
if ("overBounds" in listed) return crossLinkIgnoredS6("over-bounds", root);
|
|
1420
|
+
if (!("files" in listed)) return crossLinkIgnoredS6("unavailable", root);
|
|
1421
|
+
// QA round 2 M-A: tool-state files (`coverage/`, ...) are neither inputs nor build output, whatever the lister answers.
|
|
1422
|
+
const P = (deps.host?.platform ?? process.platform) === "win32" ? pathWin32 : pathPosix;
|
|
1423
|
+
const modules = listed.files.filter(path => !isToolStatePath(P.relative(root, path)));
|
|
1424
|
+
if (modules.length > 0) {
|
|
1425
|
+
const newestByDir: Record<string, number> = {};
|
|
1426
|
+
for (const [dir, mtime] of Object.entries(listed.newestMtimeByDir)) if (!isToolStatePath(dir)) newestByDir[dir] = mtime;
|
|
1427
|
+
const stale = await buildStaleness(req, root, newestByDir, deps.mtimeOf, deps.host);
|
|
1428
|
+
if (stale !== undefined) return stale;
|
|
1429
|
+
}
|
|
1430
|
+
const seen = new Set(req.changedFiles.map(f => f.path));
|
|
1431
|
+
const added: { path: string; status: string }[] = [];
|
|
1432
|
+
for (const path of modules) {
|
|
1433
|
+
if (seen.has(path)) continue;
|
|
1434
|
+
seen.add(path);
|
|
1435
|
+
added.push({ path, status: "!!" });
|
|
1436
|
+
}
|
|
1437
|
+
return { files: added.length === 0 ? req.changedFiles : [...req.changedFiles, ...added] };
|
|
1438
|
+
};
|
|
1439
|
+
|
|
1303
1440
|
return async (req): Promise<TestsPassRun> => {
|
|
1304
1441
|
let scope: CheckScope | undefined;
|
|
1305
1442
|
let scoped: ScopedOutcome | undefined;
|
|
@@ -1308,15 +1445,23 @@ export function createDirectTestsPassHook(deps: DirectTestsPassHookDeps): TestsP
|
|
|
1308
1445
|
scope = deps.openScope({ cwd: req.cwd, command: req.command });
|
|
1309
1446
|
scoped = await runFull(req, scope);
|
|
1310
1447
|
} else {
|
|
1448
|
+
// Cross-repo P3a (D23): a cross-link request also passes W's ignored modules (its build output), or is S6 without them.
|
|
1449
|
+
const changedFiles = await withIgnoredModules(req);
|
|
1450
|
+
if ("unverifiable" in changedFiles) {
|
|
1451
|
+
return { scoped: { kind: "unverifiable", code: changedFiles.code, reason: changedFiles.reason }, recheck: undefined };
|
|
1452
|
+
}
|
|
1311
1453
|
// P2/P3: planning outcomes take no slot and spawn nothing.
|
|
1312
1454
|
const planned = await plan({
|
|
1313
1455
|
command: req.command,
|
|
1314
1456
|
cwd: req.cwd,
|
|
1315
|
-
changedFiles:
|
|
1457
|
+
changedFiles: changedFiles.files,
|
|
1316
1458
|
budget: { maxWorkers: deps.budget.maxWorkers },
|
|
1317
1459
|
fs: deps.plannerFs,
|
|
1318
1460
|
search: deps.search,
|
|
1319
1461
|
...(deps.host !== undefined ? { host: deps.host } : {}),
|
|
1462
|
+
// Cross-repo P3a (runner.ts G.4b): only when set, so a request without them plans as before.
|
|
1463
|
+
...(req.crossLinkRoot !== undefined ? { crossLinkRoot: req.crossLinkRoot } : {}),
|
|
1464
|
+
...(req.crossLinkAliases !== undefined ? { crossLinkAliases: req.crossLinkAliases } : {}),
|
|
1320
1465
|
});
|
|
1321
1466
|
if (isNoAffected(planned)) return { scoped: { kind: "no-affected", note: planned.note }, recheck: undefined };
|
|
1322
1467
|
if (isUnverifiable(planned)) {
|
|
@@ -1486,12 +1631,44 @@ function fromJudgement(j: TestsPassJudgement): CheckResult {
|
|
|
1486
1631
|
};
|
|
1487
1632
|
}
|
|
1488
1633
|
|
|
1634
|
+
/** Cross-repo P2.4: the reference of a check placed in another repository (the dispatch captured the work root only). */
|
|
1635
|
+
export const FOREIGN_REFERENCE_NONE = "the check runs in another repository; the dispatch reference covers the work root only";
|
|
1636
|
+
|
|
1489
1637
|
function defaultReference(deps: DeterministicDeps): ReferenceState {
|
|
1490
1638
|
return deps.budget?.failureRecheck === false ? { kind: "disabled" } : { kind: "none", reason: REFERENCE_NONE.untracked };
|
|
1491
1639
|
}
|
|
1492
1640
|
|
|
1641
|
+
/**
|
|
1642
|
+
* Cross-repo P3a (SD-P3a-1, -2, -5): the cross-link inputs of a foreign testsPass with an explicit scope=affected: W's git top
|
|
1643
|
+
* and the other spellings of it seen from the consumer (`DeterministicDeps.crossLinkAliases`).
|
|
1644
|
+
*/
|
|
1645
|
+
interface CrossLinkTarget {
|
|
1646
|
+
readonly root: string;
|
|
1647
|
+
readonly aliases?: readonly string[];
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
/** The cross-link target for a consumer cwd; the alias provider is fail-soft (an error or a non-array gives no aliases). */
|
|
1651
|
+
function crossLinkTarget(deps: DeterministicDeps, root: string, consumerCwd: string): CrossLinkTarget {
|
|
1652
|
+
let aliases: readonly string[] | undefined;
|
|
1653
|
+
if (deps.crossLinkAliases !== undefined) {
|
|
1654
|
+
try {
|
|
1655
|
+
const given = deps.crossLinkAliases(consumerCwd);
|
|
1656
|
+
if (Array.isArray(given)) aliases = given.filter((alias): alias is string => typeof alias === "string" && alias !== "");
|
|
1657
|
+
} catch {
|
|
1658
|
+
aliases = undefined;
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
return { root, ...(aliases !== undefined ? { aliases } : {}) };
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1493
1664
|
/** P0-P8 for one testsPass check whose command already passed the allowlist (P1). Never rejects. */
|
|
1494
|
-
async function runTestsPass(
|
|
1665
|
+
async function runTestsPass(
|
|
1666
|
+
command: string,
|
|
1667
|
+
deps: DeterministicDeps,
|
|
1668
|
+
timeoutMs: number,
|
|
1669
|
+
scope?: "affected" | "full",
|
|
1670
|
+
crossLink?: CrossLinkTarget,
|
|
1671
|
+
): Promise<CheckResult> {
|
|
1495
1672
|
if (!deps.testsPass) return { ok: false, unverifiable: true, reason: `${NO_TESTS_PASS_HOOK}: ${command}` };
|
|
1496
1673
|
if (!deps.cwd || !isAbsolute(deps.cwd)) {
|
|
1497
1674
|
return { ok: false, unverifiable: true, reason: `testsPass cannot run without an absolute working directory: ${command}` };
|
|
@@ -1503,10 +1680,14 @@ async function runTestsPass(command: string, deps: DeterministicDeps, timeoutMs:
|
|
|
1503
1680
|
const run = await hook({
|
|
1504
1681
|
command,
|
|
1505
1682
|
cwd,
|
|
1506
|
-
testScope: deps.budget?.testScope ?? "affected",
|
|
1683
|
+
testScope: scope ?? deps.budget?.testScope ?? "affected",
|
|
1507
1684
|
changedFiles: deps.changedFiles ?? "unavailable",
|
|
1508
1685
|
reference: deps.reference ?? defaultReference(deps),
|
|
1509
1686
|
deadline,
|
|
1687
|
+
...(crossLink !== undefined ? { crossLinkRoot: crossLink.root } : {}),
|
|
1688
|
+
...(crossLink?.aliases !== undefined ? { crossLinkAliases: crossLink.aliases } : {}),
|
|
1689
|
+
// D23 as amended (QA C1): the dispatch start, so only W's ignored modules modified during the dispatch are inputs.
|
|
1690
|
+
...(crossLink !== undefined && deps.dispatchStartedAt !== undefined ? { dispatchStartedAt: deps.dispatchStartedAt } : {}),
|
|
1510
1691
|
});
|
|
1511
1692
|
// QA-G-B-2-1: a carried acceptance never passes on a run that never happened.
|
|
1512
1693
|
if (deps.noAffectedUnverifiable !== undefined && run.scoped.kind === "no-affected") {
|
|
@@ -1525,6 +1706,8 @@ async function runCommandCheck(
|
|
|
1525
1706
|
deps: DeterministicDeps,
|
|
1526
1707
|
allowlist: string[],
|
|
1527
1708
|
timeoutMs: number,
|
|
1709
|
+
scope?: "affected" | "full",
|
|
1710
|
+
crossLink?: CrossLinkTarget,
|
|
1528
1711
|
): Promise<CheckResult> {
|
|
1529
1712
|
let command = resolveRepoCommand(check, kind, deps.defaults);
|
|
1530
1713
|
if (kind === "buildPasses" && !check.command && !deps.defaults?.buildCommand) {
|
|
@@ -1552,7 +1735,7 @@ async function runCommandCheck(
|
|
|
1552
1735
|
if (!isCommandAllowed(command, allowlist)) {
|
|
1553
1736
|
return { ok: false, unverifiable: true, reason: `command not allowlisted: ${command}` };
|
|
1554
1737
|
}
|
|
1555
|
-
return runTestsPass(command, deps, timeoutMs);
|
|
1738
|
+
return runTestsPass(command, deps, timeoutMs, scope, crossLink);
|
|
1556
1739
|
}
|
|
1557
1740
|
|
|
1558
1741
|
const fn = async (): Promise<CheckResult> => {
|
|
@@ -1562,7 +1745,8 @@ async function runCommandCheck(
|
|
|
1562
1745
|
}
|
|
1563
1746
|
let launch: Launch = (scope, deadline) => scope.runShell(command, deps.cwd, deadline);
|
|
1564
1747
|
let scopedTo: number | undefined;
|
|
1565
|
-
|
|
1748
|
+
// Cross-repo P2.4: scope=full runs the lint unscoped.
|
|
1749
|
+
if (kind === "lintClean" && deps.openScope && scope !== "full") {
|
|
1566
1750
|
// T8: NoAffected passes with its note and takes no slot; Unscoped runs the command as today.
|
|
1567
1751
|
const plan = await planLint(command, deps);
|
|
1568
1752
|
if (isNoAffected(plan)) {
|
|
@@ -1666,23 +1850,48 @@ export async function runDeterministic(dod: DoD, deps: DeterministicDeps): Promi
|
|
|
1666
1850
|
const results: CheckResult[] = [];
|
|
1667
1851
|
|
|
1668
1852
|
// Sequential for deterministic mutex semantics and stable evidence order.
|
|
1669
|
-
for (const check of checks) {
|
|
1853
|
+
for (const [index, check] of checks.entries()) {
|
|
1670
1854
|
let result: CheckResult;
|
|
1855
|
+
// Cross-repo P2.4: a placed check runs with its own cwd (also the mutex key and the base of relative paths); a foreign one
|
|
1856
|
+
// has no dispatch reference. Without a placement `cd` is `deps` itself.
|
|
1857
|
+
const placement = deps.placements?.[index];
|
|
1858
|
+
const cd: DeterministicDeps = placement
|
|
1859
|
+
? { ...deps, cwd: placement.cwd, ...(placement.foreign ? { reference: { kind: "none", reason: FOREIGN_REFERENCE_NONE } satisfies ReferenceState } : {}) }
|
|
1860
|
+
: deps;
|
|
1861
|
+
|
|
1862
|
+
// Cross-repo P3a (SD-P3a-1, D22): a consumer testsPass with an explicit scope=affected runs `related` through the link into
|
|
1863
|
+
// W (deps.changeRoot, set by the gate only with foreign placements); without changeRoot it keeps the refusal below.
|
|
1864
|
+
const crossLink =
|
|
1865
|
+
placement?.foreign === true && check.kind === "testsPass" && placement.scope === "affected" && deps.changeRoot !== undefined
|
|
1866
|
+
? crossLinkTarget(deps, deps.changeRoot, placement.cwd)
|
|
1867
|
+
: undefined;
|
|
1868
|
+
|
|
1869
|
+
// A test or lint check in a consumer repository must use scope=full (except the cross-link testsPass above): the change under
|
|
1870
|
+
// verification is in the work root, so an affected-only run cannot be attributed to it. Unverifiable without running; never a
|
|
1871
|
+
// recorded failure.
|
|
1872
|
+
if (placement?.foreign === true && (check.kind === "testsPass" || check.kind === "lintClean") && placement.scope !== "full" && crossLink === undefined) {
|
|
1873
|
+
results.push({
|
|
1874
|
+
ok: false,
|
|
1875
|
+
unverifiable: true,
|
|
1876
|
+
reason: `check ${index + 1} (${check.kind}) runs in another repository (${placement.cwd}) and must use scope=full: affected tests cannot be attributed to a change in the work root`,
|
|
1877
|
+
});
|
|
1878
|
+
continue;
|
|
1879
|
+
}
|
|
1671
1880
|
|
|
1672
1881
|
switch (check.kind) {
|
|
1673
1882
|
case "fileExists":
|
|
1674
|
-
result = await runFileExists(check,
|
|
1883
|
+
result = await runFileExists(check, cd);
|
|
1675
1884
|
break;
|
|
1676
1885
|
case "run":
|
|
1677
|
-
result = await runRun(check,
|
|
1886
|
+
result = await runRun(check, cd, allowlist, timeoutMs);
|
|
1678
1887
|
break;
|
|
1679
1888
|
case "testsPass":
|
|
1680
1889
|
case "buildPasses":
|
|
1681
1890
|
case "lintClean":
|
|
1682
|
-
result = await runCommandCheck(check, check.kind,
|
|
1891
|
+
result = await runCommandCheck(check, check.kind, cd, allowlist, timeoutMs, placement?.scope, crossLink);
|
|
1683
1892
|
break;
|
|
1684
1893
|
case "schemaMatch":
|
|
1685
|
-
result = await runSchemaMatch(check,
|
|
1894
|
+
result = await runSchemaMatch(check, cd);
|
|
1686
1895
|
break;
|
|
1687
1896
|
default: {
|
|
1688
1897
|
// Defensive: TypeScript proves this is unreachable; guards runtime extensions.
|
|
@@ -1692,6 +1901,19 @@ export async function runDeterministic(dod: DoD, deps: DeterministicDeps): Promi
|
|
|
1692
1901
|
}
|
|
1693
1902
|
}
|
|
1694
1903
|
|
|
1904
|
+
// F6: the change under verification is in the work root, so a failure in a foreign repository is the consumer's:
|
|
1905
|
+
// unverifiable, never recorded as a failure (gate.ts turns a recorded failure into "fail").
|
|
1906
|
+
if (placement?.foreign === true && !result.ok && !result.unverifiable) {
|
|
1907
|
+
// The failing ids are dropped with the verdict: nothing in the work root's reference says whom they belong to.
|
|
1908
|
+
result = {
|
|
1909
|
+
ok: false,
|
|
1910
|
+
unverifiable: true,
|
|
1911
|
+
...(result.note !== undefined ? { note: result.note } : {}),
|
|
1912
|
+
...(result.evidence !== undefined ? { evidence: result.evidence } : {}),
|
|
1913
|
+
reason: `a check in another repository (${placement.cwd}) failed; the change under verification is in the work root, so this failure can be neither excused nor attributed: ${result.reason ?? "check failed"}`,
|
|
1914
|
+
};
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1695
1917
|
results.push(result);
|
|
1696
1918
|
if (!result.ok && !result.unverifiable) {
|
|
1697
1919
|
deps.onFailure?.(scrubText(result.reason ?? "check failed"));
|