opencode-swarm 7.153.2 → 7.154.1
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/dist/background/pending-delegations.d.ts +29 -0
- package/dist/background/pr-subscriptions.d.ts +265 -27
- package/dist/cli/{config-doctor-tv0ar88m.js → config-doctor-keasv3r8.js} +2 -2
- package/dist/cli/{core-kmsm50zn.js → core-7aj5g3f4.js} +1 -1
- package/dist/cli/{curation-policy-twa6agf8.js → curation-policy-a6tve11y.js} +6 -6
- package/dist/cli/{curator-wxe863k9.js → curator-anz136hr.js} +29 -29
- package/dist/cli/{curator-llm-factory-dxkhdhwg.js → curator-llm-factory-cr5ckwbd.js} +29 -29
- package/dist/cli/{evidence-summary-service-9akrdg9t.js → evidence-summary-service-6tgme7p3.js} +12 -12
- package/dist/cli/{gate-evidence-bdzqbg2y.js → gate-evidence-36nfx4vb.js} +6 -6
- package/dist/cli/{guardrail-explain-kx9rem51.js → guardrail-explain-frb5xd5h.js} +30 -30
- package/dist/cli/{guardrail-log-zxzyx1de.js → guardrail-log-fvma65xm.js} +5 -5
- package/dist/cli/{guardrail-reset-1mc3st34.js → guardrail-reset-3qk6k334.js} +29 -29
- package/dist/cli/{hive-promoter-gncwtq0z.js → hive-promoter-v3dhtzfa.js} +29 -29
- package/dist/cli/{index-ebshrg4x.js → index-0vss7vdg.js} +3 -3
- package/dist/cli/{index-zppxpc3y.js → index-107cv0dr.js} +2 -2
- package/dist/cli/{index-hhv2pvab.js → index-155pbsan.js} +1 -1
- package/dist/cli/{index-21pt4jwf.js → index-1sjnqsc8.js} +1 -1
- package/dist/cli/{index-3ttktt56.js → index-2ppbt5cf.js} +1 -1
- package/dist/cli/{index-4pjkdcgc.js → index-3md256qr.js} +1 -1
- package/dist/cli/{index-yvepnbyd.js → index-4r46q7tk.js} +5 -5
- package/dist/cli/{index-3bh4h6ve.js → index-50cy1a3p.js} +7 -7
- package/dist/cli/{index-84m4per1.js → index-97q41ds3.js} +2 -2
- package/dist/cli/{index-x3y6zhgj.js → index-9wzgztj9.js} +1 -1
- package/dist/cli/{index-2mqmvxac.js → index-9xev69y4.js} +7 -1
- package/dist/cli/{index-02rbfrab.js → index-9znypky4.js} +4 -4
- package/dist/cli/{index-vhbds89e.js → index-akm1dbr9.js} +4 -4
- package/dist/cli/index-bmkxc6sa.js +1231 -0
- package/dist/cli/{index-td0jz8xe.js → index-c809a69b.js} +2 -2
- package/dist/cli/{index-a58nmnmz.js → index-fz9xcq6z.js} +5 -3
- package/dist/cli/{index-3cegckkq.js → index-garsang6.js} +1 -1
- package/dist/cli/{index-x8vw6ap1.js → index-h1g8w4v0.js} +59 -42
- package/dist/cli/{index-56ejcj07.js → index-h7pamys0.js} +4 -4
- package/dist/cli/{index-3fpqpyp6.js → index-p17hs70t.js} +2 -2
- package/dist/cli/{index-h06112sh.js → index-qm8b3aaj.js} +5 -5
- package/dist/cli/{index-j4f8sz67.js → index-r0yavfvm.js} +193 -102
- package/dist/cli/{index-kvk65qzz.js → index-sx5f2fq9.js} +3 -3
- package/dist/cli/{index-1gzdnjg9.js → index-tmgbwgsm.js} +2 -2
- package/dist/cli/{index-bw55r5bz.js → index-wmxke5se.js} +6 -6
- package/dist/cli/{index-0azn976d.js → index-wqp8kk0w.js} +7 -7
- package/dist/cli/{index-kenz5bja.js → index-wxpemcdj.js} +31 -31
- package/dist/cli/{index-891g7hbf.js → index-xagq35tf.js} +1 -1
- package/dist/cli/{index-pk1gbqmq.js → index-xdy28ngt.js} +1 -1
- package/dist/cli/{index-5zp4c36c.js → index-xsbf2mmf.js} +1 -1
- package/dist/cli/{index-h3zhb18p.js → index-y7gyhe13.js} +2 -2
- package/dist/cli/{index-5ad8xcv3.js → index-yy4yps8w.js} +2 -2
- package/dist/cli/{index-s6b8jgtn.js → index-zak84bqr.js} +1 -1
- package/dist/cli/index.js +29 -29
- package/dist/cli/{knowledge-escalator-gp3mpbqe.js → knowledge-escalator-1gjv97hj.js} +11 -11
- package/dist/cli/{knowledge-events-nvkhtqvn.js → knowledge-events-94hfvp85.js} +9 -9
- package/dist/cli/{knowledge-link-ge0rddxw.js → knowledge-link-fs8hgh4h.js} +5 -5
- package/dist/cli/{knowledge-store-2ngh8xvv.js → knowledge-store-g7grbt7h.js} +6 -6
- package/dist/cli/{knowledge-validator-4bphyrec.js → knowledge-validator-ep0ym1e4.js} +8 -8
- package/dist/cli/{pending-delegations-nk78wx7h.js → pending-delegations-0pf2dtwx.js} +3 -3
- package/dist/cli/{pr-subscriptions-dq1f61ye.js → pr-subscriptions-e70phj71.js} +15 -4
- package/dist/cli/{runner-n50w1y4w.js → runner-b7pskcxb.js} +6 -6
- package/dist/cli/{scan-cursor-c16xtygz.js → scan-cursor-8zps8v46.js} +7 -7
- package/dist/cli/{schema-83tbte2g.js → schema-8sx9jp7v.js} +1 -1
- package/dist/cli/{scope-persistence-gdbw8xh8.js → scope-persistence-zacyjnx9.js} +8 -8
- package/dist/cli/{skill-generator-gr13xeha.js → skill-generator-xs5n5j4k.js} +13 -13
- package/dist/cli/{telemetry-hh1j99za.js → telemetry-r8e8zey7.js} +1 -1
- package/dist/cli/{worktree-collision-ownership-4drcjymy.js → worktree-collision-ownership-yjk5ya71.js} +5 -5
- package/dist/cli/{worktree-isolation-jjkfg2pg.js → worktree-isolation-cpf6b8ns.js} +29 -29
- package/dist/commands/pr-monitor-status.d.ts +8 -1
- package/dist/config/schema.d.ts +8 -0
- package/dist/hooks/pr-review-resilience-circuit.d.ts +232 -0
- package/dist/hooks/pr-workflow-gate.d.ts +10 -11
- package/dist/index.js +298 -289
- package/dist/observability/catalog.d.ts +6 -3
- package/dist/telemetry.d.ts +22 -1
- package/package.json +1 -1
- package/dist/cli/index-meg33yyv.js +0 -247
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
alreadyCuratedThisGeneration,
|
|
5
5
|
claimNextScanBatch,
|
|
6
6
|
getScanStatus
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
} from "./index-yy4yps8w.js";
|
|
8
|
+
import"./index-wmxke5se.js";
|
|
9
9
|
import"./index-9e6fdz2h.js";
|
|
10
10
|
import"./index-4rhhvd1a.js";
|
|
11
11
|
import"./index-ae75rja9.js";
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
12
|
+
import"./index-9wzgztj9.js";
|
|
13
|
+
import"./index-107cv0dr.js";
|
|
14
14
|
import"./index-bk5tah7q.js";
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
15
|
+
import"./index-c809a69b.js";
|
|
16
|
+
import"./index-xagq35tf.js";
|
|
17
17
|
import"./index-ed5ykebp.js";
|
|
18
|
-
import"./index-
|
|
18
|
+
import"./index-h1g8w4v0.js";
|
|
19
19
|
import"./index-7g4c7s5r.js";
|
|
20
20
|
import"./index-bpmtbmy9.js";
|
|
21
21
|
import"./index-zgwm4ryv.js";
|
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
resolveGeneratedAgentRole,
|
|
100
100
|
resolveGuardrailsConfig,
|
|
101
101
|
stripKnownSwarmPrefix
|
|
102
|
-
} from "./index-
|
|
102
|
+
} from "./index-fz9xcq6z.js";
|
|
103
103
|
import"./index-myt57pht.js";
|
|
104
104
|
import"./index-zjygnfay.js";
|
|
105
105
|
import"./index-bk5tah7q.js";
|
|
@@ -23,21 +23,21 @@ import {
|
|
|
23
23
|
tombstoneScopeBinding,
|
|
24
24
|
writeScopeBindingToDisk,
|
|
25
25
|
writeScopeToDisk
|
|
26
|
-
} from "./index-
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
26
|
+
} from "./index-qm8b3aaj.js";
|
|
27
|
+
import"./index-0vss7vdg.js";
|
|
28
|
+
import"./index-xdy28ngt.js";
|
|
29
29
|
import"./index-556ja8an.js";
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
30
|
+
import"./index-xsbf2mmf.js";
|
|
31
|
+
import"./index-fz9xcq6z.js";
|
|
32
32
|
import"./index-myt57pht.js";
|
|
33
33
|
import"./index-9e6fdz2h.js";
|
|
34
34
|
import"./index-4rhhvd1a.js";
|
|
35
35
|
import"./index-zjygnfay.js";
|
|
36
36
|
import"./index-bk5tah7q.js";
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
37
|
+
import"./index-c809a69b.js";
|
|
38
|
+
import"./index-xagq35tf.js";
|
|
39
39
|
import"./index-ed5ykebp.js";
|
|
40
|
-
import"./index-
|
|
40
|
+
import"./index-h1g8w4v0.js";
|
|
41
41
|
import"./index-7g4c7s5r.js";
|
|
42
42
|
import"./index-bpmtbmy9.js";
|
|
43
43
|
import"./index-zgwm4ryv.js";
|
|
@@ -33,33 +33,33 @@ import {
|
|
|
33
33
|
sanitizeSlug,
|
|
34
34
|
selectCandidateEntries,
|
|
35
35
|
writeEvalStub
|
|
36
|
-
} from "./index-
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
36
|
+
} from "./index-akm1dbr9.js";
|
|
37
|
+
import"./index-h7pamys0.js";
|
|
38
|
+
import"./index-2ppbt5cf.js";
|
|
39
39
|
import"./index-rtry5xyf.js";
|
|
40
40
|
import"./index-q7sjgr1y.js";
|
|
41
|
-
import"./index-
|
|
42
|
-
import"./index-
|
|
43
|
-
import"./index-
|
|
41
|
+
import"./index-wmxke5se.js";
|
|
42
|
+
import"./index-50cy1a3p.js";
|
|
43
|
+
import"./index-p17hs70t.js";
|
|
44
44
|
import"./index-gprxjmm7.js";
|
|
45
45
|
import"./index-n832052r.js";
|
|
46
46
|
import"./index-4cgee5vh.js";
|
|
47
47
|
import"./index-z6xqpmqg.js";
|
|
48
48
|
import"./index-r3mvsbtq.js";
|
|
49
|
-
import"./index-
|
|
50
|
-
import"./index-
|
|
49
|
+
import"./index-xsbf2mmf.js";
|
|
50
|
+
import"./index-fz9xcq6z.js";
|
|
51
51
|
import"./index-myt57pht.js";
|
|
52
52
|
import"./index-9e6fdz2h.js";
|
|
53
53
|
import"./index-4rhhvd1a.js";
|
|
54
54
|
import"./index-zjygnfay.js";
|
|
55
55
|
import"./index-ae75rja9.js";
|
|
56
|
-
import"./index-
|
|
57
|
-
import"./index-
|
|
56
|
+
import"./index-9wzgztj9.js";
|
|
57
|
+
import"./index-107cv0dr.js";
|
|
58
58
|
import"./index-bk5tah7q.js";
|
|
59
|
-
import"./index-
|
|
60
|
-
import"./index-
|
|
59
|
+
import"./index-c809a69b.js";
|
|
60
|
+
import"./index-xagq35tf.js";
|
|
61
61
|
import"./index-ed5ykebp.js";
|
|
62
|
-
import"./index-
|
|
62
|
+
import"./index-h1g8w4v0.js";
|
|
63
63
|
import"./index-7g4c7s5r.js";
|
|
64
64
|
import"./index-bpmtbmy9.js";
|
|
65
65
|
import"./index-zgwm4ryv.js";
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
WORKTREE_PROVISIONING_OWNER_LEASE_MS,
|
|
4
4
|
removeWorktreeProvisioningOwner,
|
|
5
5
|
scanWorktreeProvisioningOwnersForRecovery
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-garsang6.js";
|
|
7
7
|
import {
|
|
8
8
|
scanWorktreeMergeFailuresForRecovery
|
|
9
9
|
} from "./index-zsrtt42s.js";
|
|
10
10
|
import {
|
|
11
11
|
scanDelegationFallbacksForRecovery,
|
|
12
12
|
scanDelegationsForRecovery
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-9xev69y4.js";
|
|
14
14
|
import"./index-4cgee5vh.js";
|
|
15
15
|
import"./index-z6xqpmqg.js";
|
|
16
16
|
import {
|
|
@@ -22,10 +22,10 @@ import {
|
|
|
22
22
|
} from "./index-9e6fdz2h.js";
|
|
23
23
|
import"./index-4rhhvd1a.js";
|
|
24
24
|
import"./index-zjygnfay.js";
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
25
|
+
import"./index-c809a69b.js";
|
|
26
|
+
import"./index-xagq35tf.js";
|
|
27
27
|
import"./index-ed5ykebp.js";
|
|
28
|
-
import"./index-
|
|
28
|
+
import"./index-h1g8w4v0.js";
|
|
29
29
|
import"./index-7g4c7s5r.js";
|
|
30
30
|
import"./index-bpmtbmy9.js";
|
|
31
31
|
import"./index-zgwm4ryv.js";
|
|
@@ -21,62 +21,62 @@ import {
|
|
|
21
21
|
sanitizeWorktreeTaskId,
|
|
22
22
|
standardWorktreeByCallID,
|
|
23
23
|
standardWorktreeSerializationSessions
|
|
24
|
-
} from "./index-
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
27
|
-
import"./index-
|
|
24
|
+
} from "./index-r0yavfvm.js";
|
|
25
|
+
import"./index-y7gyhe13.js";
|
|
26
|
+
import"./index-155pbsan.js";
|
|
27
|
+
import"./index-wqp8kk0w.js";
|
|
28
28
|
import"./index-134d35c1.js";
|
|
29
29
|
import"./index-nj6rmyeh.js";
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
30
|
+
import"./index-3md256qr.js";
|
|
31
|
+
import"./index-tmgbwgsm.js";
|
|
32
32
|
import"./index-y8552snf.js";
|
|
33
|
-
import"./index-
|
|
33
|
+
import"./index-yy4yps8w.js";
|
|
34
34
|
import"./index-70ha9e09.js";
|
|
35
35
|
import"./index-c8s9a3zh.js";
|
|
36
36
|
import"./index-9ss2m4rs.js";
|
|
37
37
|
import"./index-vnn7qq8c.js";
|
|
38
|
-
import"./index-
|
|
39
|
-
import"./index-
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
42
|
-
import"./index-
|
|
38
|
+
import"./index-bmkxc6sa.js";
|
|
39
|
+
import"./index-akm1dbr9.js";
|
|
40
|
+
import"./index-4r46q7tk.js";
|
|
41
|
+
import"./index-h7pamys0.js";
|
|
42
|
+
import"./index-2ppbt5cf.js";
|
|
43
43
|
import"./index-rtry5xyf.js";
|
|
44
|
-
import"./index-
|
|
44
|
+
import"./index-garsang6.js";
|
|
45
45
|
import"./index-zsrtt42s.js";
|
|
46
|
-
import"./index-
|
|
47
|
-
import"./index-
|
|
48
|
-
import"./index-
|
|
49
|
-
import"./index-
|
|
50
|
-
import"./index-
|
|
51
|
-
import"./index-
|
|
46
|
+
import"./index-9znypky4.js";
|
|
47
|
+
import"./index-zak84bqr.js";
|
|
48
|
+
import"./index-9xev69y4.js";
|
|
49
|
+
import"./index-qm8b3aaj.js";
|
|
50
|
+
import"./index-0vss7vdg.js";
|
|
51
|
+
import"./index-xdy28ngt.js";
|
|
52
52
|
import"./index-556ja8an.js";
|
|
53
53
|
import"./index-b43rt5ph.js";
|
|
54
54
|
import"./index-q7sjgr1y.js";
|
|
55
55
|
import"./index-4fwbbad3.js";
|
|
56
|
-
import"./index-
|
|
57
|
-
import"./index-
|
|
56
|
+
import"./index-wmxke5se.js";
|
|
57
|
+
import"./index-50cy1a3p.js";
|
|
58
58
|
import {
|
|
59
59
|
resolveWorktreeIsolationConfig
|
|
60
|
-
} from "./index-
|
|
60
|
+
} from "./index-p17hs70t.js";
|
|
61
61
|
import"./index-gprxjmm7.js";
|
|
62
62
|
import"./index-n832052r.js";
|
|
63
63
|
import"./index-4cgee5vh.js";
|
|
64
64
|
import"./index-z6xqpmqg.js";
|
|
65
65
|
import"./index-r3mvsbtq.js";
|
|
66
|
-
import"./index-
|
|
67
|
-
import"./index-
|
|
66
|
+
import"./index-xsbf2mmf.js";
|
|
67
|
+
import"./index-fz9xcq6z.js";
|
|
68
68
|
import"./index-myt57pht.js";
|
|
69
69
|
import"./index-9e6fdz2h.js";
|
|
70
70
|
import"./index-4rhhvd1a.js";
|
|
71
71
|
import"./index-zjygnfay.js";
|
|
72
72
|
import"./index-ae75rja9.js";
|
|
73
|
-
import"./index-
|
|
74
|
-
import"./index-
|
|
73
|
+
import"./index-9wzgztj9.js";
|
|
74
|
+
import"./index-107cv0dr.js";
|
|
75
75
|
import"./index-bk5tah7q.js";
|
|
76
|
-
import"./index-
|
|
77
|
-
import"./index-
|
|
76
|
+
import"./index-c809a69b.js";
|
|
77
|
+
import"./index-xagq35tf.js";
|
|
78
78
|
import"./index-ed5ykebp.js";
|
|
79
|
-
import"./index-
|
|
79
|
+
import"./index-h1g8w4v0.js";
|
|
80
80
|
import"./index-7g4c7s5r.js";
|
|
81
81
|
import"./index-bpmtbmy9.js";
|
|
82
82
|
import"./index-zgwm4ryv.js";
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Input contract (no args):
|
|
10
10
|
* /swarm pr status → show session subscriptions
|
|
11
11
|
*/
|
|
12
|
-
import { listActive } from '../background/pr-subscriptions.js';
|
|
12
|
+
import { getPrSubscriptionHealth, listActive, type PrSubscriptionHealth } from '../background/pr-subscriptions.js';
|
|
13
13
|
type MergeGroupRun = {
|
|
14
14
|
databaseId: number;
|
|
15
15
|
headBranch: string;
|
|
@@ -38,15 +38,22 @@ declare function listMergeGroupRuns(directory: string, repoFullName: string, prN
|
|
|
38
38
|
* and a link reference.
|
|
39
39
|
*/
|
|
40
40
|
declare function formatMergeGroupStatus(status?: string, conclusion?: string, htmlUrl?: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Format the bounded-store storage-health footer (issue #2042). Counts and
|
|
43
|
+
* bytes only — never a path or repo identity.
|
|
44
|
+
*/
|
|
45
|
+
declare function formatStorageHealth(health: PrSubscriptionHealth): string;
|
|
41
46
|
/**
|
|
42
47
|
* Exposed for unit testing via _internals.
|
|
43
48
|
*/
|
|
44
49
|
export declare const _internals: {
|
|
45
50
|
formatRelativeTime: typeof formatRelativeTime;
|
|
46
51
|
formatMergeGroupStatus: typeof formatMergeGroupStatus;
|
|
52
|
+
formatStorageHealth: typeof formatStorageHealth;
|
|
47
53
|
listActive: typeof listActive;
|
|
48
54
|
listMergeGroupRuns: typeof listMergeGroupRuns;
|
|
49
55
|
parseMergeGroupRuns: typeof parseMergeGroupRuns;
|
|
56
|
+
getPrSubscriptionHealth: typeof getPrSubscriptionHealth;
|
|
50
57
|
};
|
|
51
58
|
/**
|
|
52
59
|
* Show PR monitor subscription status for the current session.
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -1755,6 +1755,12 @@ export interface PrReviewResilienceConfig {
|
|
|
1755
1755
|
status_probe_timeout_ms: number;
|
|
1756
1756
|
correlated_failure_threshold: number;
|
|
1757
1757
|
max_retry_attempts_after_initial: number;
|
|
1758
|
+
/**
|
|
1759
|
+
* Issue #2382: how long an opened PR-review resilience circuit stays OPEN
|
|
1760
|
+
* before it admits exactly one HALF_OPEN probe. Applies both to the initial
|
|
1761
|
+
* open and to every provider-failure reopen.
|
|
1762
|
+
*/
|
|
1763
|
+
circuit_open_duration_ms: number;
|
|
1758
1764
|
}
|
|
1759
1765
|
/**
|
|
1760
1766
|
* Issue #2381: staged PR-review resilience defaults OFF while the #2380 repair
|
|
@@ -1770,6 +1776,7 @@ export declare const PrReviewResilienceConfigSchema: z.ZodObject<{
|
|
|
1770
1776
|
status_probe_timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
1771
1777
|
correlated_failure_threshold: z.ZodDefault<z.ZodNumber>;
|
|
1772
1778
|
max_retry_attempts_after_initial: z.ZodDefault<z.ZodNumber>;
|
|
1779
|
+
circuit_open_duration_ms: z.ZodDefault<z.ZodNumber>;
|
|
1773
1780
|
}, z.core.$strict>;
|
|
1774
1781
|
export declare const PluginConfigSchema: z.ZodObject<{
|
|
1775
1782
|
config_format_version: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1866,6 +1873,7 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
1866
1873
|
status_probe_timeout_ms: z.ZodDefault<z.ZodNumber>;
|
|
1867
1874
|
correlated_failure_threshold: z.ZodDefault<z.ZodNumber>;
|
|
1868
1875
|
max_retry_attempts_after_initial: z.ZodDefault<z.ZodNumber>;
|
|
1876
|
+
circuit_open_duration_ms: z.ZodDefault<z.ZodNumber>;
|
|
1869
1877
|
}, z.core.$strict>>;
|
|
1870
1878
|
gates: z.ZodOptional<z.ZodObject<{
|
|
1871
1879
|
syntax_check: z.ZodDefault<z.ZodObject<{
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PR-review resilience circuit — typed, recoverable, versioned (issue #2382).
|
|
3
|
+
*
|
|
4
|
+
* Pure state machine + typed-signal classification for the PR_REVIEW
|
|
5
|
+
* resilience circuit. No I/O: the owning gate (`pr-workflow-gate.ts`) reads
|
|
6
|
+
* the delegation ledger and persists transitions under its CAS write path.
|
|
7
|
+
*
|
|
8
|
+
* Contracts implemented (issue #2382 "Required design"):
|
|
9
|
+
* - Only durable, typed `provider_terminal` signals contribute; every other
|
|
10
|
+
* outcome is an `ignored` kind that can never open, reopen, or close the
|
|
11
|
+
* circuit.
|
|
12
|
+
* - The threshold counts distinct `(generation, batchId, laneId)` contributor
|
|
13
|
+
* lanes per provider class — never owned dimensions, never repeated
|
|
14
|
+
* collections of the same lane.
|
|
15
|
+
* - State is a versioned v2 record: CLOSED → OPEN (bounded interval) →
|
|
16
|
+
* exactly-one HALF_OPEN probe → CLOSED (generation bump + evidence
|
|
17
|
+
* waterline) or back to OPEN (new interval). Legacy unversioned records
|
|
18
|
+
* migrate once to a nonblocking v2 CLOSED record with an evidence waterline;
|
|
19
|
+
* malformed records fail open.
|
|
20
|
+
*/
|
|
21
|
+
import { z } from 'zod';
|
|
22
|
+
import type { BackgroundDelegationRecord } from '../background/pending-delegations.js';
|
|
23
|
+
/** Bounded contributor ledger. Mirrors `MAX_WORKFLOW_BATCHES (128) × 6` base dimensions. */
|
|
24
|
+
export declare const PR_REVIEW_CIRCUIT_CONTRIBUTOR_LIMIT = 768;
|
|
25
|
+
export type PrReviewCircuitIgnoredReason = 'observer_deadline' | 'client_unavailable' | 'parser' | 'validation' | 'policy' | 'filesystem' | 'git' | 'cancellation' | 'stale_observation' | 'unknown';
|
|
26
|
+
export type PrReviewCircuitSignal = {
|
|
27
|
+
kind: 'provider_terminal';
|
|
28
|
+
providerClass: string;
|
|
29
|
+
batchId: string;
|
|
30
|
+
laneId: string;
|
|
31
|
+
terminalAtMs: number;
|
|
32
|
+
} | {
|
|
33
|
+
kind: 'ignored';
|
|
34
|
+
reason: PrReviewCircuitIgnoredReason;
|
|
35
|
+
};
|
|
36
|
+
export type PrReviewCircuitState = 'CLOSED' | 'OPEN' | 'HALF_OPEN';
|
|
37
|
+
export interface PrReviewCircuitContributor {
|
|
38
|
+
batchId: string;
|
|
39
|
+
laneId: string;
|
|
40
|
+
/** ISO timestamp of the contributing lane's terminal evidence. */
|
|
41
|
+
terminalAt: string;
|
|
42
|
+
}
|
|
43
|
+
export interface PrReviewCircuitProbeRecord {
|
|
44
|
+
batchId: string;
|
|
45
|
+
laneId: string;
|
|
46
|
+
admittedAt: string;
|
|
47
|
+
}
|
|
48
|
+
export interface PrReviewCircuitRecordV2 {
|
|
49
|
+
version: 2;
|
|
50
|
+
state: PrReviewCircuitState;
|
|
51
|
+
generation: number;
|
|
52
|
+
providerClass?: string;
|
|
53
|
+
contributors: PrReviewCircuitContributor[];
|
|
54
|
+
openedAt?: string;
|
|
55
|
+
openUntil?: string;
|
|
56
|
+
/** Evidence at or before this ISO instant can never contribute again. */
|
|
57
|
+
evidenceWaterline?: string;
|
|
58
|
+
probe?: PrReviewCircuitProbeRecord;
|
|
59
|
+
}
|
|
60
|
+
/** The unversioned pre-#2382 persisted circuit shape. */
|
|
61
|
+
export interface PrReviewCircuitLegacyRecord {
|
|
62
|
+
signature: string;
|
|
63
|
+
count: number;
|
|
64
|
+
contributors: Array<{
|
|
65
|
+
batchId: string;
|
|
66
|
+
laneId: string;
|
|
67
|
+
}>;
|
|
68
|
+
openedAt: string;
|
|
69
|
+
}
|
|
70
|
+
export declare const PrReviewCircuitLegacyRecordSchema: z.ZodObject<{
|
|
71
|
+
signature: z.ZodString;
|
|
72
|
+
count: z.ZodNumber;
|
|
73
|
+
contributors: z.ZodArray<z.ZodObject<{
|
|
74
|
+
batchId: z.ZodString;
|
|
75
|
+
laneId: z.ZodString;
|
|
76
|
+
}, z.core.$strict>>;
|
|
77
|
+
openedAt: z.ZodString;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
export declare const PrReviewCircuitRecordV2Schema: z.ZodObject<{
|
|
80
|
+
version: z.ZodLiteral<2>;
|
|
81
|
+
state: z.ZodEnum<{
|
|
82
|
+
CLOSED: "CLOSED";
|
|
83
|
+
OPEN: "OPEN";
|
|
84
|
+
HALF_OPEN: "HALF_OPEN";
|
|
85
|
+
}>;
|
|
86
|
+
generation: z.ZodNumber;
|
|
87
|
+
providerClass: z.ZodOptional<z.ZodString>;
|
|
88
|
+
contributors: z.ZodArray<z.ZodObject<{
|
|
89
|
+
batchId: z.ZodString;
|
|
90
|
+
laneId: z.ZodString;
|
|
91
|
+
terminalAt: z.ZodString;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
openedAt: z.ZodOptional<z.ZodString>;
|
|
94
|
+
openUntil: z.ZodOptional<z.ZodString>;
|
|
95
|
+
evidenceWaterline: z.ZodOptional<z.ZodString>;
|
|
96
|
+
probe: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
batchId: z.ZodString;
|
|
98
|
+
laneId: z.ZodString;
|
|
99
|
+
admittedAt: z.ZodString;
|
|
100
|
+
}, z.core.$strict>>;
|
|
101
|
+
}, z.core.$strict>;
|
|
102
|
+
export declare const PrReviewCircuitRecordSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
103
|
+
signature: z.ZodString;
|
|
104
|
+
count: z.ZodNumber;
|
|
105
|
+
contributors: z.ZodArray<z.ZodObject<{
|
|
106
|
+
batchId: z.ZodString;
|
|
107
|
+
laneId: z.ZodString;
|
|
108
|
+
}, z.core.$strict>>;
|
|
109
|
+
openedAt: z.ZodString;
|
|
110
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
111
|
+
version: z.ZodLiteral<2>;
|
|
112
|
+
state: z.ZodEnum<{
|
|
113
|
+
CLOSED: "CLOSED";
|
|
114
|
+
OPEN: "OPEN";
|
|
115
|
+
HALF_OPEN: "HALF_OPEN";
|
|
116
|
+
}>;
|
|
117
|
+
generation: z.ZodNumber;
|
|
118
|
+
providerClass: z.ZodOptional<z.ZodString>;
|
|
119
|
+
contributors: z.ZodArray<z.ZodObject<{
|
|
120
|
+
batchId: z.ZodString;
|
|
121
|
+
laneId: z.ZodString;
|
|
122
|
+
terminalAt: z.ZodString;
|
|
123
|
+
}, z.core.$strict>>;
|
|
124
|
+
openedAt: z.ZodOptional<z.ZodString>;
|
|
125
|
+
openUntil: z.ZodOptional<z.ZodString>;
|
|
126
|
+
evidenceWaterline: z.ZodOptional<z.ZodString>;
|
|
127
|
+
probe: z.ZodOptional<z.ZodObject<{
|
|
128
|
+
batchId: z.ZodString;
|
|
129
|
+
laneId: z.ZodString;
|
|
130
|
+
admittedAt: z.ZodString;
|
|
131
|
+
}, z.core.$strict>>;
|
|
132
|
+
}, z.core.$strict>]>;
|
|
133
|
+
/**
|
|
134
|
+
* Derive the typed circuit signal from a durable delegation record's LATEST
|
|
135
|
+
* terminal state. Returns `null` for anything that is not a terminal failure
|
|
136
|
+
* signal (pending/running lanes, healthy completions).
|
|
137
|
+
*
|
|
138
|
+
* Trust rules: only the structured `terminalErrorClass` captured at settle
|
|
139
|
+
* time can produce `provider_terminal`; display text is never parsed. Records
|
|
140
|
+
* settled before this field existed, launch failures (the child never ran),
|
|
141
|
+
* presumed-stale sweeps, cancellations, and empty completions are `ignored`
|
|
142
|
+
* kinds or no signal at all.
|
|
143
|
+
*/
|
|
144
|
+
export declare function classifyPrReviewCircuitSignal(record: Pick<BackgroundDelegationRecord, 'status' | 'result' | 'terminalResult'> & {
|
|
145
|
+
batchId?: string;
|
|
146
|
+
laneId?: string;
|
|
147
|
+
}): PrReviewCircuitSignal | null;
|
|
148
|
+
/**
|
|
149
|
+
* Reduce per-lane signals into per-providerClass distinct-lane evidence under
|
|
150
|
+
* the CURRENT circuit generation. Dedupes on `(generation, batchId, laneId)`,
|
|
151
|
+
* drops evidence at or before the waterline, sorts newest-first, and bounds
|
|
152
|
+
* each class's contributor list with deterministic keep-newest eviction.
|
|
153
|
+
*/
|
|
154
|
+
export declare function scanPrReviewCircuitEvidence(signals: readonly PrReviewCircuitSignal[], generation: number, waterlineMs: number | undefined): Map<string, Array<PrReviewCircuitSignal & {
|
|
155
|
+
kind: 'provider_terminal';
|
|
156
|
+
}>>;
|
|
157
|
+
export type PrReviewCircuitAdoptionDiagnostic = {
|
|
158
|
+
code: 'migrated_legacy_circuit';
|
|
159
|
+
legacySignatureCount: number;
|
|
160
|
+
} | {
|
|
161
|
+
code: 'malformed_circuit_dropped';
|
|
162
|
+
bodyHash8: string;
|
|
163
|
+
byteLength: number;
|
|
164
|
+
};
|
|
165
|
+
export type PrReviewCircuitAdoption = {
|
|
166
|
+
kind: 'v2';
|
|
167
|
+
record: PrReviewCircuitRecordV2;
|
|
168
|
+
} | {
|
|
169
|
+
kind: 'absent';
|
|
170
|
+
} | {
|
|
171
|
+
kind: 'migrated';
|
|
172
|
+
record: PrReviewCircuitRecordV2;
|
|
173
|
+
diagnostic: PrReviewCircuitAdoptionDiagnostic;
|
|
174
|
+
} | {
|
|
175
|
+
kind: 'malformed';
|
|
176
|
+
diagnostic: PrReviewCircuitAdoptionDiagnostic;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Adopt a persisted circuit field: v2 records pass through, legacy unversioned
|
|
180
|
+
* records migrate ONCE to a nonblocking v2 CLOSED record whose evidence
|
|
181
|
+
* waterline is `now` (historical evidence can never immediately reopen), and
|
|
182
|
+
* malformed records fail open with a bounded hash-only diagnostic.
|
|
183
|
+
*/
|
|
184
|
+
export declare function adoptPrReviewCircuit(raw: unknown, nowMs: number): PrReviewCircuitAdoption;
|
|
185
|
+
export interface PrReviewCircuitAdvanceInput {
|
|
186
|
+
nowMs: number;
|
|
187
|
+
threshold: number;
|
|
188
|
+
openDurationMs: number;
|
|
189
|
+
/** The staged dispatch requesting admission, when this advance guards one. */
|
|
190
|
+
admission?: {
|
|
191
|
+
batchId: string;
|
|
192
|
+
laneId: string;
|
|
193
|
+
};
|
|
194
|
+
/** Latest-record signals for every dispatch lane of the current workflow. */
|
|
195
|
+
laneSignals: readonly PrReviewCircuitSignal[];
|
|
196
|
+
/**
|
|
197
|
+
* Observation of the CURRENT probe lane's latest record (HALF_OPEN only).
|
|
198
|
+
* The gate supplies it only when it read the recorded probe's batch/lane,
|
|
199
|
+
* which structurally drops late results from older generations.
|
|
200
|
+
*/
|
|
201
|
+
probeObservation?: {
|
|
202
|
+
terminalStatus: string;
|
|
203
|
+
signal: PrReviewCircuitSignal | null;
|
|
204
|
+
terminalAtMs: number;
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
export type PrReviewCircuitAdvanceResult = {
|
|
208
|
+
action: 'admit';
|
|
209
|
+
changed: false;
|
|
210
|
+
} | {
|
|
211
|
+
action: 'admit';
|
|
212
|
+
changed: true;
|
|
213
|
+
record: PrReviewCircuitRecordV2;
|
|
214
|
+
} | {
|
|
215
|
+
action: 'admit_as_probe';
|
|
216
|
+
changed: true;
|
|
217
|
+
record: PrReviewCircuitRecordV2;
|
|
218
|
+
} | {
|
|
219
|
+
action: 'admit_as_probe';
|
|
220
|
+
changed: false;
|
|
221
|
+
} | {
|
|
222
|
+
action: 'block';
|
|
223
|
+
reason: 'circuit_open' | 'probe_in_flight';
|
|
224
|
+
changed: boolean;
|
|
225
|
+
record?: PrReviewCircuitRecordV2;
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Advance the circuit one step. `current === null` means no circuit record
|
|
229
|
+
* exists yet (plain birth: no waterline — post-upgrade evidence counts; the
|
|
230
|
+
* gate passes an explicit waterlined record for migration / re-enable births).
|
|
231
|
+
*/
|
|
232
|
+
export declare function advancePrReviewCircuit(current: PrReviewCircuitRecordV2 | null, input: PrReviewCircuitAdvanceInput): PrReviewCircuitAdvanceResult;
|
|
@@ -7,6 +7,7 @@ import { type PrReviewInlineTriggerRow } from '../background/pr-review-trigger-c
|
|
|
7
7
|
import { type RevisionDigestResult, resolveCommitCountSince, resolveCommitCountSinceAsync, resolveCurrentGitHead, resolveCurrentGitHeadAsync, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamPushTargetAsync, resolveCurrentUpstreamRemoteRef, resolveExactRemoteBranchHead, resolveExactRemoteBranchHeadAsync, resolveIsExactSingleChildCommit, resolveIsExactSingleChildCommitAsync, resolveIsWorkingTreeClean, resolveIsWorkingTreeCleanAsync, resolvePrReviewDiffStats, resolvePrReviewDiffStatsAsync, resolvePrWorkflowRevisionDigest, resolvePrWorkflowRevisionDigestDetailed, resolveRemoteRefsContainingHead, resolveRemoteRefsContainingHeadAsync } from '../background/workspace-snapshot.js';
|
|
8
8
|
import { type PrReviewResilienceConfig } from '../config/schema.js';
|
|
9
9
|
import { classifyPrWorkflowGitState, type PrWorkflowGitState } from '../git/pr-workflow-state.js';
|
|
10
|
+
import { classifyPrReviewCircuitSignal, type PrReviewCircuitLegacyRecord, type PrReviewCircuitRecordV2 } from './pr-review-resilience-circuit.js';
|
|
10
11
|
export declare const PR_REVIEW_BASE_DIMENSION_IDS: readonly ["intent-architecture", "correctness-state", "tests-falsifiability", "security-trust", "reliability-performance", "compatibility-delivery"];
|
|
11
12
|
export declare const PR_REVIEW_REQUIRED_MICRO_LANE_IDS: ("auth-identity-secrets" | "untrusted-input-boundaries" | "subprocess-platform" | "concurrency-state" | "dependencies-build-release" | "api-schema-migrations" | "test-infrastructure" | "ui-accessibility-i18n" | "privacy-observability" | "generated-provenance" | "unclassified-risk")[];
|
|
12
13
|
export type PrReviewBaseDimensionId = (typeof PR_REVIEW_BASE_DIMENSION_IDS)[number];
|
|
@@ -176,6 +177,8 @@ interface PrReviewResiliencePolicyRecord {
|
|
|
176
177
|
statusProbeTimeoutMs: number;
|
|
177
178
|
correlatedFailureThreshold: number;
|
|
178
179
|
maxRetryAttemptsAfterInitial: number;
|
|
180
|
+
/** Issue #2382. Optional: policies persisted before the field existed parse unchanged. */
|
|
181
|
+
circuitOpenDurationMs?: number;
|
|
179
182
|
}
|
|
180
183
|
interface PrReviewResilienceAttemptRecord {
|
|
181
184
|
attempt: 0 | 1 | 2;
|
|
@@ -186,15 +189,12 @@ interface PrReviewResilienceAttemptRecord {
|
|
|
186
189
|
admittedAt: string;
|
|
187
190
|
fanoutBatchId?: string;
|
|
188
191
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}>;
|
|
196
|
-
openedAt: string;
|
|
197
|
-
}
|
|
192
|
+
/**
|
|
193
|
+
* Issue #2382: the persisted circuit is a versioned union. The unversioned
|
|
194
|
+
* pre-#2382 shape migrates once to a nonblocking v2 record on first adoption
|
|
195
|
+
* (see `adoptPrReviewCircuit`); malformed records fail open.
|
|
196
|
+
*/
|
|
197
|
+
type PrReviewResilienceCircuitRecord = PrReviewCircuitLegacyRecord | PrReviewCircuitRecordV2;
|
|
198
198
|
interface PrReviewResilienceStateRecord {
|
|
199
199
|
policy: PrReviewResiliencePolicyRecord;
|
|
200
200
|
attempts: PrReviewResilienceAttemptRecord[];
|
|
@@ -786,7 +786,6 @@ export declare class PrReviewResilienceRetryExhaustedError extends Error {
|
|
|
786
786
|
}
|
|
787
787
|
declare function snapshotPrReviewResiliencePolicy(policy?: PrReviewResilienceConfig): PrReviewResiliencePolicyRecord;
|
|
788
788
|
declare function effectivePrReviewResiliencePolicy(state: PrWorkflowGateState, requestedPolicy?: PrReviewResilienceConfig): PrReviewResiliencePolicyRecord;
|
|
789
|
-
declare function classifyTerminalFailureSignature(record: BackgroundDelegationRecord): string | null;
|
|
790
789
|
interface EnforcePrReviewBaseDimensionsOptions {
|
|
791
790
|
batchId: string;
|
|
792
791
|
prHeadSha: string;
|
|
@@ -903,7 +902,7 @@ export declare function enforcePrWorkflowToolBefore(directory: string, sessionID
|
|
|
903
902
|
/** Validate the terminal PR workflow contract before removing its durable gate. */
|
|
904
903
|
export declare function completePrWorkflow(directory: string, sessionID: string, expectedMode: PrWorkflowMode, prHeadSha: string): Promise<PrWorkflowCompletionStatus>;
|
|
905
904
|
export declare const _test_exports: {
|
|
906
|
-
|
|
905
|
+
classifyPrReviewCircuitSignal: typeof classifyPrReviewCircuitSignal;
|
|
907
906
|
minimumConsolidatedLaneCover: typeof minimumConsolidatedLaneCover;
|
|
908
907
|
analyzePrReviewBatchRecordIntegrity: typeof analyzePrReviewBatchRecordIntegrity;
|
|
909
908
|
MAX_COVER_UNIVERSE_BITS: number;
|