@telora/daemon 0.20.54 → 0.20.57
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 +6 -3
- package/dist/cli/session-state.d.ts +9 -0
- package/dist/cli/session-state.d.ts.map +1 -1
- package/dist/cli/session-state.js.map +1 -1
- package/dist/completion/review-exit-escalations.d.ts +85 -0
- package/dist/completion/review-exit-escalations.d.ts.map +1 -0
- package/dist/completion/review-exit-escalations.js +203 -0
- package/dist/completion/review-exit-escalations.js.map +1 -0
- package/dist/completion/review-exit-phase.d.ts.map +1 -1
- package/dist/completion/review-exit-phase.js +43 -135
- package/dist/completion/review-exit-phase.js.map +1 -1
- package/dist/delivery-advance-block.d.ts.map +1 -1
- package/dist/delivery-advance-block.js +8 -1
- package/dist/delivery-advance-block.js.map +1 -1
- package/dist/external-hold.d.ts +104 -0
- package/dist/external-hold.d.ts.map +1 -0
- package/dist/external-hold.js +149 -0
- package/dist/external-hold.js.map +1 -0
- package/dist/listener-auto-advance.d.ts.map +1 -1
- package/dist/listener-auto-advance.js +12 -0
- package/dist/listener-auto-advance.js.map +1 -1
- package/dist/listener.d.ts.map +1 -1
- package/dist/listener.js +56 -11
- package/dist/listener.js.map +1 -1
- package/dist/prompt-sections/execution-sections.d.ts.map +1 -1
- package/dist/prompt-sections/execution-sections.js +25 -23
- package/dist/prompt-sections/execution-sections.js.map +1 -1
- package/dist/queries/deliveries.d.ts +62 -0
- package/dist/queries/deliveries.d.ts.map +1 -1
- package/dist/queries/deliveries.js +1 -0
- package/dist/queries/deliveries.js.map +1 -1
- package/dist/queries/schemas.d.ts +2 -0
- package/dist/queries/schemas.d.ts.map +1 -1
- package/dist/queries/schemas.js +5 -0
- package/dist/queries/schemas.js.map +1 -1
- package/dist/resolver-dispatch.d.ts +108 -0
- package/dist/resolver-dispatch.d.ts.map +1 -0
- package/dist/resolver-dispatch.js +83 -0
- package/dist/resolver-dispatch.js.map +1 -0
- package/dist/resolver-reach.d.ts +192 -0
- package/dist/resolver-reach.d.ts.map +1 -0
- package/dist/resolver-reach.js +168 -0
- package/dist/resolver-reach.js.map +1 -0
- package/dist/resolvers/git-diff-against-base.d.ts.map +1 -1
- package/dist/resolvers/git-diff-against-base.js +8 -2
- package/dist/resolvers/git-diff-against-base.js.map +1 -1
- package/dist/resolvers/index.d.ts +1 -1
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +1 -1
- package/dist/resolvers/index.js.map +1 -1
- package/dist/resolvers/shared/git-diff.d.ts +47 -0
- package/dist/resolvers/shared/git-diff.d.ts.map +1 -1
- package/dist/resolvers/shared/git-diff.js +103 -15
- package/dist/resolvers/shared/git-diff.js.map +1 -1
- package/dist/spawn/review-role-fallback.d.ts +37 -3
- package/dist/spawn/review-role-fallback.d.ts.map +1 -1
- package/dist/spawn/review-role-fallback.js +38 -3
- package/dist/spawn/review-role-fallback.js.map +1 -1
- package/dist/verification-engine.d.ts +10 -0
- package/dist/verification-engine.d.ts.map +1 -1
- package/dist/verification-engine.js +142 -96
- package/dist/verification-engine.js.map +1 -1
- package/dist/verification-feedback.d.ts +44 -1
- package/dist/verification-feedback.d.ts.map +1 -1
- package/dist/verification-feedback.js +130 -1
- package/dist/verification-feedback.js.map +1 -1
- package/dist/verify-reconciliation.d.ts +25 -1
- package/dist/verify-reconciliation.d.ts.map +1 -1
- package/dist/verify-reconciliation.js +64 -2
- package/dist/verify-reconciliation.js.map +1 -1
- package/dist/verify-restatement.d.ts +22 -4
- package/dist/verify-restatement.d.ts.map +1 -1
- package/dist/verify-restatement.js +18 -1
- package/dist/verify-restatement.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,42 +4,58 @@
|
|
|
4
4
|
import { execSync } from 'node:child_process';
|
|
5
5
|
export const MAX_DIFF_BYTES = 50 * 1024; // 50 KB truncation limit for git diffs
|
|
6
6
|
/**
|
|
7
|
-
* Run git diff in a worktree
|
|
8
|
-
*
|
|
7
|
+
* Run `git diff <range>` in a worktree. Returns the raw diff output, or empty
|
|
8
|
+
* string on failure. `range` is any ref expression git diff accepts, e.g.
|
|
9
|
+
* `integration...HEAD` or `<merge>^1...<merge>`.
|
|
9
10
|
*/
|
|
10
|
-
export function
|
|
11
|
+
export function getGitDiffRange(worktreePath, range) {
|
|
11
12
|
try {
|
|
12
|
-
const diff = execSync(`git diff ${
|
|
13
|
+
const diff = execSync(`git diff ${range}`, { cwd: worktreePath, maxBuffer: 10 * 1024 * 1024, encoding: 'utf-8' });
|
|
13
14
|
return diff;
|
|
14
15
|
}
|
|
15
16
|
catch {
|
|
16
17
|
return '';
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
export function getDiffStatSummary(worktreePath, baseBranch) {
|
|
20
|
+
/** `git diff --stat <range>` (for the truncation header). Empty on failure. */
|
|
21
|
+
export function getDiffStatRange(worktreePath, range) {
|
|
23
22
|
try {
|
|
24
|
-
return execSync(`git diff --stat ${
|
|
23
|
+
return execSync(`git diff --stat ${range}`, { cwd: worktreePath, maxBuffer: 1024 * 1024, encoding: 'utf-8' });
|
|
25
24
|
}
|
|
26
25
|
catch {
|
|
27
26
|
return '';
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
* Returns an empty array on failure (missing worktree / bad range).
|
|
33
|
-
*/
|
|
34
|
-
export function getChangedFiles(worktreePath, baseBranch) {
|
|
29
|
+
/** `git diff --name-only <range>` (name-only). Empty array on failure. */
|
|
30
|
+
export function getChangedFilesRange(worktreePath, range) {
|
|
35
31
|
try {
|
|
36
|
-
const out = execSync(`git diff --name-only ${
|
|
32
|
+
const out = execSync(`git diff --name-only ${range}`, { cwd: worktreePath, maxBuffer: 1024 * 1024, encoding: 'utf-8' });
|
|
37
33
|
return out.split('\n').map((l) => l.trim()).filter((l) => l !== '');
|
|
38
34
|
}
|
|
39
35
|
catch {
|
|
40
36
|
return [];
|
|
41
37
|
}
|
|
42
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Run git diff in a worktree against the base branch.
|
|
41
|
+
* Returns the raw diff output, or empty string on failure.
|
|
42
|
+
*/
|
|
43
|
+
export function getGitDiff(worktreePath, baseBranch) {
|
|
44
|
+
return getGitDiffRange(worktreePath, `${baseBranch}...HEAD`);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get a summary of files changed in a diff (for truncation header).
|
|
48
|
+
*/
|
|
49
|
+
export function getDiffStatSummary(worktreePath, baseBranch) {
|
|
50
|
+
return getDiffStatRange(worktreePath, `${baseBranch}...HEAD`);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* List the files changed between the base branch and HEAD (name-only).
|
|
54
|
+
* Returns an empty array on failure (missing worktree / bad range).
|
|
55
|
+
*/
|
|
56
|
+
export function getChangedFiles(worktreePath, baseBranch) {
|
|
57
|
+
return getChangedFilesRange(worktreePath, `${baseBranch}...HEAD`);
|
|
58
|
+
}
|
|
43
59
|
/**
|
|
44
60
|
* Count commits on HEAD that are not reachable from the base branch
|
|
45
61
|
* (`git rev-list --count base..HEAD`). This is the delivery's own commit
|
|
@@ -57,4 +73,76 @@ export function getCommitsAhead(worktreePath, baseBranch) {
|
|
|
57
73
|
return 0;
|
|
58
74
|
}
|
|
59
75
|
}
|
|
76
|
+
/** How many merge commits back to scan on the base branch for a delivery merge. */
|
|
77
|
+
const MERGE_SCAN_LIMIT = 2000;
|
|
78
|
+
/**
|
|
79
|
+
* Find the merge commit on `baseBranch` that merged the current focus branch
|
|
80
|
+
* (the worktree's HEAD) into it.
|
|
81
|
+
*
|
|
82
|
+
* `git diff base...HEAD` answers "what is left to merge"; it empties the moment
|
|
83
|
+
* the focus branch merges into the base. But when the base advanced past the
|
|
84
|
+
* fork point, the merge is a real merge commit whose non-first parent IS the
|
|
85
|
+
* focus tip -- so `git diff <merge>^1 <merge>` still recovers exactly the
|
|
86
|
+
* delivery's contribution. This locates that merge commit deterministically
|
|
87
|
+
* from what is in the repo (no session ids, no reflog): scan the base branch's
|
|
88
|
+
* merge commits for one whose second (or later) parent equals HEAD.
|
|
89
|
+
*
|
|
90
|
+
* Returns null when no such merge exists -- an unmerged branch, or a merge that
|
|
91
|
+
* FAST-FORWARDED (no merge commit, so the fork point leaves no in-tree marker).
|
|
92
|
+
* The caller then yields an empty diff, which the instrument-fault path handles.
|
|
93
|
+
*/
|
|
94
|
+
export function findDeliveryMergeCommit(worktreePath, baseBranch) {
|
|
95
|
+
try {
|
|
96
|
+
const head = execSync('git rev-parse HEAD', {
|
|
97
|
+
cwd: worktreePath, maxBuffer: 1024 * 1024, encoding: 'utf-8',
|
|
98
|
+
}).trim();
|
|
99
|
+
if (head === '')
|
|
100
|
+
return null;
|
|
101
|
+
const out = execSync(`git rev-list --merges --parents -n ${MERGE_SCAN_LIMIT} ${baseBranch}`, { cwd: worktreePath, maxBuffer: 10 * 1024 * 1024, encoding: 'utf-8' });
|
|
102
|
+
for (const line of out.split('\n')) {
|
|
103
|
+
const parts = line.trim().split(/\s+/).filter((p) => p !== '');
|
|
104
|
+
// Format: <merge> <parent1> <parent2> [...]. A merge has >= 2 parents.
|
|
105
|
+
if (parts.length < 3)
|
|
106
|
+
continue;
|
|
107
|
+
const merge = parts[0];
|
|
108
|
+
const nonFirstParents = parts.slice(2); // second+ parents = the merged-in tips
|
|
109
|
+
if (nonFirstParents.includes(head))
|
|
110
|
+
return merge ?? null;
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Resolve the git range that contains a delivery's work, robust to the focus
|
|
120
|
+
* branch having already merged into its base:
|
|
121
|
+
*
|
|
122
|
+
* - branch AHEAD of base -> `base...HEAD` (historic behaviour,
|
|
123
|
+
* byte-identical to the old getGitDiff)
|
|
124
|
+
* - branch LEVEL/BEHIND after merge -> `<merge>^1...<merge>` (recovered from
|
|
125
|
+
* the merge commit that brought it in)
|
|
126
|
+
* - no attributable commits -> null (caller yields empty; the
|
|
127
|
+
* instrument-fault path handles it)
|
|
128
|
+
*/
|
|
129
|
+
export function resolveDeliveryDiffRange(worktreePath, baseBranch) {
|
|
130
|
+
if (getCommitsAhead(worktreePath, baseBranch) > 0)
|
|
131
|
+
return `${baseBranch}...HEAD`;
|
|
132
|
+
const merge = findDeliveryMergeCommit(worktreePath, baseBranch);
|
|
133
|
+
if (merge)
|
|
134
|
+
return `${merge}^1...${merge}`;
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The delivery's diff, resolved from the range that actually contains its work
|
|
139
|
+
* (see resolveDeliveryDiffRange). For a branch still ahead of base this is
|
|
140
|
+
* byte-identical to `getGitDiff(worktreePath, baseBranch)`; for a merged branch
|
|
141
|
+
* it recovers the delivery's contribution from the merge commit; for a delivery
|
|
142
|
+
* with no attributable commits it returns ''.
|
|
143
|
+
*/
|
|
144
|
+
export function getDeliveryDiff(worktreePath, baseBranch) {
|
|
145
|
+
const range = resolveDeliveryDiffRange(worktreePath, baseBranch);
|
|
146
|
+
return range ? getGitDiffRange(worktreePath, range) : '';
|
|
147
|
+
}
|
|
60
148
|
//# sourceMappingURL=git-diff.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-diff.js","sourceRoot":"","sources":["../../../src/resolvers/shared/git-diff.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,uCAAuC;AAEhF
|
|
1
|
+
{"version":3,"file":"git-diff.js","sourceRoot":"","sources":["../../../src/resolvers/shared/git-diff.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAA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AAC;IAChE,IAAI,KAAK;QAAE,OAAO,GAAG,KAAK,QAAQ,KAAK,EAAE,CAAC;IAC1C,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,YAAoB,EAAE,UAAkB;IACtE,MAAM,KAAK,GAAG,wBAAwB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACjE,OAAO,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -61,14 +61,48 @@ export declare function resolveReviewerFallbackRole(roles: Iterable<AgentRole>):
|
|
|
61
61
|
/**
|
|
62
62
|
* Decide what to do with a null-role pending spawn directive.
|
|
63
63
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
* A null assigned_agent_role_id now means one of TWO things, and they must be
|
|
65
|
+
* told apart:
|
|
66
|
+
*
|
|
67
|
+
* - An OPERATOR STOP (product_focuses.operator_stopped_at is set): the human
|
|
68
|
+
* pulled the Play toggle to halt the focus. This is authoritative and wins
|
|
69
|
+
* over everything -- when `operatorStopped` is true we `skip` for EVERY
|
|
70
|
+
* sessionType, review included. The stop lever must never become the trigger
|
|
71
|
+
* for the path it was meant to stop.
|
|
72
|
+
* - A LIFECYCLE CLEAR (operator_stopped_at null): auto_terminate_focus_team()
|
|
73
|
+
* nulled the role at completion. Here the pre-existing layered fallback
|
|
74
|
+
* applies -- a review directive is a SECOND team that must spawn AFTER
|
|
75
|
+
* completion (spawn under the fallback role, else clear); a coding directive
|
|
76
|
+
* is the intended off-state and is skipped.
|
|
77
|
+
*
|
|
78
|
+
* With `operatorStopped` false the behaviour is byte-identical to before the
|
|
79
|
+
* operator-stop fact existed.
|
|
67
80
|
*
|
|
68
81
|
* Pure and exported for unit testing (peer of resolveReviewerFallbackRole).
|
|
69
82
|
*/
|
|
70
83
|
export declare function decideNullRoleSpawn(input: {
|
|
71
84
|
sessionType: 'coding' | 'review' | undefined;
|
|
72
85
|
fallbackRole: AgentRole | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Whether an operator has stopped this focus (product_focuses.
|
|
88
|
+
* operator_stopped_at is set). When true, no spawn happens for any
|
|
89
|
+
* sessionType -- the operator's stop is authoritative.
|
|
90
|
+
*/
|
|
91
|
+
operatorStopped: boolean;
|
|
73
92
|
}): NullRoleSpawnDecision;
|
|
93
|
+
/**
|
|
94
|
+
* Once-per-blocked-episode gate for the null-role "coding off-state" skip
|
|
95
|
+
* warning. The listener holds a Set of focus ids already warned for the current
|
|
96
|
+
* continuous blocked episode; this mutates it and returns whether to emit the
|
|
97
|
+
* warning now:
|
|
98
|
+
*
|
|
99
|
+
* - focus not yet in the set -> add it and return true (warn once, on entry).
|
|
100
|
+
* - focus already in the set -> return false (suppress the per-poll repeat).
|
|
101
|
+
*
|
|
102
|
+
* The listener removes the focus from the set when it resumes (role assigned,
|
|
103
|
+
* directive cleared, or focus leaves the active set), so a later re-entry warns
|
|
104
|
+
* again. Pure w.r.t. its inputs (Set in, boolean out) and exported for unit
|
|
105
|
+
* testing without standing up the poll loop.
|
|
106
|
+
*/
|
|
107
|
+
export declare function shouldWarnNullRoleSkip(warnedFocuses: Set<string>, focusId: string): boolean;
|
|
74
108
|
//# sourceMappingURL=review-role-fallback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-role-fallback.d.ts","sourceRoot":"","sources":["../../src/spawn/review-role-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,cAAc,CAAC;AAEtD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,qBAAqB,GAC7B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GACpC;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;AAExB;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,GACzB,SAAS,GAAG,SAAS,CAKvB;AAED
|
|
1
|
+
{"version":3,"file":"review-role-fallback.d.ts","sourceRoot":"","sources":["../../src/spawn/review-role-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,cAAc,CAAC;AAEtD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,qBAAqB,GAC7B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAClB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GACpC;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC;AAExB;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,GACzB,SAAS,GAAG,SAAS,CAKvB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,WAAW,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC7C,YAAY,EAAE,SAAS,GAAG,SAAS,CAAC;IACpC;;;;OAIG;IACH,eAAe,EAAE,OAAO,CAAC;CAC1B,GAAG,qBAAqB,CAKxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,EAC1B,OAAO,EAAE,MAAM,GACd,OAAO,CAIT"}
|
|
@@ -46,17 +46,52 @@ export function resolveReviewerFallbackRole(roles) {
|
|
|
46
46
|
/**
|
|
47
47
|
* Decide what to do with a null-role pending spawn directive.
|
|
48
48
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
49
|
+
* A null assigned_agent_role_id now means one of TWO things, and they must be
|
|
50
|
+
* told apart:
|
|
51
|
+
*
|
|
52
|
+
* - An OPERATOR STOP (product_focuses.operator_stopped_at is set): the human
|
|
53
|
+
* pulled the Play toggle to halt the focus. This is authoritative and wins
|
|
54
|
+
* over everything -- when `operatorStopped` is true we `skip` for EVERY
|
|
55
|
+
* sessionType, review included. The stop lever must never become the trigger
|
|
56
|
+
* for the path it was meant to stop.
|
|
57
|
+
* - A LIFECYCLE CLEAR (operator_stopped_at null): auto_terminate_focus_team()
|
|
58
|
+
* nulled the role at completion. Here the pre-existing layered fallback
|
|
59
|
+
* applies -- a review directive is a SECOND team that must spawn AFTER
|
|
60
|
+
* completion (spawn under the fallback role, else clear); a coding directive
|
|
61
|
+
* is the intended off-state and is skipped.
|
|
62
|
+
*
|
|
63
|
+
* With `operatorStopped` false the behaviour is byte-identical to before the
|
|
64
|
+
* operator-stop fact existed.
|
|
52
65
|
*
|
|
53
66
|
* Pure and exported for unit testing (peer of resolveReviewerFallbackRole).
|
|
54
67
|
*/
|
|
55
68
|
export function decideNullRoleSpawn(input) {
|
|
69
|
+
if (input.operatorStopped)
|
|
70
|
+
return { action: 'skip' };
|
|
56
71
|
if (input.sessionType !== 'review')
|
|
57
72
|
return { action: 'skip' };
|
|
58
73
|
if (input.fallbackRole)
|
|
59
74
|
return { action: 'spawn', role: input.fallbackRole };
|
|
60
75
|
return { action: 'clear' };
|
|
61
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Once-per-blocked-episode gate for the null-role "coding off-state" skip
|
|
79
|
+
* warning. The listener holds a Set of focus ids already warned for the current
|
|
80
|
+
* continuous blocked episode; this mutates it and returns whether to emit the
|
|
81
|
+
* warning now:
|
|
82
|
+
*
|
|
83
|
+
* - focus not yet in the set -> add it and return true (warn once, on entry).
|
|
84
|
+
* - focus already in the set -> return false (suppress the per-poll repeat).
|
|
85
|
+
*
|
|
86
|
+
* The listener removes the focus from the set when it resumes (role assigned,
|
|
87
|
+
* directive cleared, or focus leaves the active set), so a later re-entry warns
|
|
88
|
+
* again. Pure w.r.t. its inputs (Set in, boolean out) and exported for unit
|
|
89
|
+
* testing without standing up the poll loop.
|
|
90
|
+
*/
|
|
91
|
+
export function shouldWarnNullRoleSkip(warnedFocuses, focusId) {
|
|
92
|
+
if (warnedFocuses.has(focusId))
|
|
93
|
+
return false;
|
|
94
|
+
warnedFocuses.add(focusId);
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
62
97
|
//# sourceMappingURL=review-role-fallback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-role-fallback.js","sourceRoot":"","sources":["../../src/spawn/review-role-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,WAAW,CAAC;AAmBtD;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAA0B;IAE1B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,IAAI,KAAK,0BAA0B;YAAE,OAAO,IAAI,CAAC;IAC5D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"review-role-fallback.js","sourceRoot":"","sources":["../../src/spawn/review-role-fallback.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,WAAW,CAAC;AAmBtD;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAA0B;IAE1B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,IAAI,KAAK,0BAA0B;YAAE,OAAO,IAAI,CAAC;IAC5D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,mBAAmB,CAAC,KASnC;IACC,IAAI,KAAK,CAAC,eAAe;QAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACrD,IAAI,KAAK,CAAC,WAAW,KAAK,QAAQ;QAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC9D,IAAI,KAAK,CAAC,YAAY;QAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC;IAC7E,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,sBAAsB,CACpC,aAA0B,EAC1B,OAAe;IAEf,IAAI,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7C,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -28,6 +28,7 @@ import { getPendingVerifications, type PendingVerification, type VerificationOut
|
|
|
28
28
|
import type { NodeWriteback } from './reality-writeback.js';
|
|
29
29
|
import { type ReconcileTargetsResult, type TargetRestatement, type TargetShortfall, type VerifyEvidence } from './verify-restatement.js';
|
|
30
30
|
import { type FileEscalationInput } from './escalations.js';
|
|
31
|
+
import type { EvidenceUnavailableDetail } from './queries/deliveries.js';
|
|
31
32
|
import type { DaemonConfig } from './types.js';
|
|
32
33
|
import { type ResolvedDefaultVerification } from './verification-config.js';
|
|
33
34
|
import { getActiveFocuses, getFocusDeliveries } from './supabase.js';
|
|
@@ -134,6 +135,15 @@ export interface VerificationDeps {
|
|
|
134
135
|
* the deterministic guard. Optional; defaultDeps provides it (requeueShortfallAsRework).
|
|
135
136
|
*/
|
|
136
137
|
deliverShortfallFeedback?: (v: PendingVerification, shortfalls: readonly TargetShortfall[]) => Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Instrument-fault hold: the verify path was handed no evidence it could judge
|
|
140
|
+
* the work against (an empty bundle). Writes gate_state under the
|
|
141
|
+
* evidence-unavailable guard (delivery stays in `verify`; no iteration is
|
|
142
|
+
* consumed) and files a first-occurrence operator escalation naming the
|
|
143
|
+
* missing evidence. Never routes to verify_failed and never reports under the
|
|
144
|
+
* deterministic or shortfall guard. Optional; defaultDeps provides it.
|
|
145
|
+
*/
|
|
146
|
+
deliverEvidenceUnavailableFeedback?: (v: PendingVerification, fault: Omit<EvidenceUnavailableDetail, 'heldAt'>) => Promise<void>;
|
|
137
147
|
/** cwd for the HEAD run -- the focus worktree. Optional; dispatch falls back to resolveCwd. */
|
|
138
148
|
resolveVerificationCwd?: (v: PendingVerification) => string;
|
|
139
149
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification-engine.d.ts","sourceRoot":"","sources":["../src/verification-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,wBAAwB,EAAE,KAAK,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,KAAK,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AACzG,OAAO,EACL,uBAAuB,EAIvB,KAAK,mBAAmB,EAExB,KAAK,mBAAmB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAA2C,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"verification-engine.d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