opencode-swarm 7.137.0 → 7.137.2
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/.opencode/skills/swarm-pr-review/SKILL.md +35 -3
- package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +7 -3
- package/dist/background/candidate-contract.d.ts +14 -0
- package/dist/cli/{config-doctor-vyx82nx2.js → config-doctor-xrbzq4r0.js} +2 -2
- package/dist/cli/{curation-policy-8tvs4pa0.js → curation-policy-xyradeax.js} +2 -2
- package/dist/cli/{curator-43xqs75k.js → curator-h1ea9skz.js} +13 -13
- package/dist/cli/{curator-llm-factory-8nywfdsh.js → curator-llm-factory-rk7pccwc.js} +13 -13
- package/dist/cli/{guardrail-explain-8kkqz8tx.js → guardrail-explain-sq1kcah3.js} +14 -14
- package/dist/cli/{guardrail-log-e2v9qw71.js → guardrail-log-7anp1z1n.js} +3 -3
- package/dist/cli/{hive-promoter-jt9ky0hn.js → hive-promoter-qsymj94z.js} +13 -13
- package/dist/cli/{index-d00q9kpq.js → index-02jqxmh8.js} +5 -5
- package/dist/cli/{index-pcwjz5de.js → index-1da1tvtn.js} +1 -1
- package/dist/cli/{index-72wzb81c.js → index-4t39wzzg.js} +1 -1
- package/dist/cli/{index-aze9n64z.js → index-5k0csd2m.js} +2 -2
- package/dist/cli/{index-fgkhpdc6.js → index-9casmxdt.js} +4 -4
- package/dist/cli/{index-j6ewv2pe.js → index-aygnzd04.js} +1 -1
- package/dist/cli/{index-k3mezk96.js → index-b2s3t517.js} +4 -2
- package/dist/cli/{index-92v63zzr.js → index-d735dzm7.js} +617 -192
- package/dist/cli/{index-y25nsyaq.js → index-gey6qegb.js} +1 -1
- package/dist/cli/{index-p124rnwb.js → index-jdqayy7h.js} +2 -2
- package/dist/cli/{index-wg98bsxz.js → index-kakb2jm0.js} +1 -1
- package/dist/cli/{index-j2ghsdzz.js → index-p0kez6cn.js} +15 -15
- package/dist/cli/{index-f24r6yqk.js → index-pwx989sa.js} +3 -3
- package/dist/cli/{index-91kk2e9j.js → index-rfrkt29c.js} +1 -1
- package/dist/cli/{index-mg26zd8x.js → index-s9at02fn.js} +1 -1
- package/dist/cli/{index-mwdzkr6k.js → index-vyh2prxv.js} +1 -1
- package/dist/cli/{index-d0nhz96c.js → index-ysh3a2nb.js} +2 -2
- package/dist/cli/index.js +13 -13
- package/dist/cli/{knowledge-escalator-9k0kbx6b.js → knowledge-escalator-e9zk371p.js} +3 -3
- package/dist/cli/{knowledge-events-8nz3sa2d.js → knowledge-events-dnyc1k78.js} +1 -1
- package/dist/cli/{knowledge-store-esghe3f9.js → knowledge-store-x4vqyhbz.js} +1 -1
- package/dist/cli/{knowledge-validator-bjxag1jp.js → knowledge-validator-72jdx5ze.js} +4 -4
- package/dist/cli/{runner-d820ws7y.js → runner-9rqc8y3m.js} +1 -1
- package/dist/cli/{scan-cursor-t212v00f.js → scan-cursor-z4xpes5f.js} +2 -2
- package/dist/cli/{schema-11gyrec3.js → schema-2dkw18zz.js} +1 -1
- package/dist/cli/{skill-generator-a07hpmw6.js → skill-generator-0q1jk6xd.js} +5 -5
- package/dist/council/council-evidence-writer.d.ts +2 -1
- package/dist/council/council-round-state.d.ts +110 -0
- package/dist/council/types.d.ts +0 -2
- package/dist/evaluation/index.d.ts +1 -0
- package/dist/evaluation/model-dispatcher.d.ts +19 -1
- package/dist/evaluation/pr-review-recovery.d.ts +41 -0
- package/dist/evaluation/public-api.d.ts +2 -0
- package/dist/evaluation/runner.d.ts +9 -0
- package/dist/hooks/pr-workflow-gate.d.ts +69 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +187 -183
- package/dist/tools/convene-council.d.ts +2 -17
- package/dist/tools/dispatch-lanes.d.ts +1 -0
- package/dist/tools/submit-phase-council-verdicts.d.ts +0 -1
- package/dist/tools/write-final-council-evidence.d.ts +4 -18
- package/evaluation-fixtures/pr-review-recovery/baseline/SKILL.md +1823 -0
- package/evaluation-fixtures/pr-review-recovery/baseline-manifest.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/environment/score-recovery.cjs +135 -0
- package/evaluation-fixtures/pr-review-recovery/instruction.md +40 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/blind-full-wave-retry/model-output.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/contradictory/model-output.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/copied-contract/model-output.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/critical-without-harm/model-output.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/invented-harm/model-output.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/malformed/model-output.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/missing-reproduction/model-output.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/parser-only/model-output.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/passing/model-output.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/premature-systemic-claim/model-output.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/profile-b-fallback/model-output.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/underclaimed-harm/model-output.json +1 -0
- package/evaluation-fixtures/pr-review-recovery/scorer-fixtures/unsupported-severity/model-output.json +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
authorizeCuration
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-s9at02fn.js";
|
|
5
5
|
import {
|
|
6
6
|
findNearDuplicate,
|
|
7
7
|
inferTags,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resolveSwarmKnowledgePath,
|
|
10
10
|
resolveSwarmRejectedPath,
|
|
11
11
|
transactKnowledge
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-9casmxdt.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveKnowledgeStoreDir
|
|
15
15
|
} from "./index-vft1pg34.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-ysh3a2nb.js";
|
|
5
5
|
import {
|
|
6
6
|
handleGuardrailLog
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-gey6qegb.js";
|
|
8
8
|
import {
|
|
9
9
|
COMMAND_REGISTRY,
|
|
10
10
|
SWARM_COMMAND_TOOL_ALLOWLIST,
|
|
@@ -84,39 +84,39 @@ import {
|
|
|
84
84
|
handleWriteRetroCommand,
|
|
85
85
|
normalizeSwarmCommandInput,
|
|
86
86
|
resolveCommand
|
|
87
|
-
} from "./index-
|
|
87
|
+
} from "./index-d735dzm7.js";
|
|
88
88
|
import"./index-vm4xw9z3.js";
|
|
89
|
-
import"./index-
|
|
90
|
-
import"./index-
|
|
91
|
-
import"./index-
|
|
89
|
+
import"./index-b2s3t517.js";
|
|
90
|
+
import"./index-aygnzd04.js";
|
|
91
|
+
import"./index-rfrkt29c.js";
|
|
92
92
|
import"./index-1zrb3vt2.js";
|
|
93
93
|
import"./index-5wjw05dy.js";
|
|
94
94
|
import"./index-y8552snf.js";
|
|
95
95
|
import"./index-4905hd2m.js";
|
|
96
96
|
import"./index-134d35c1.js";
|
|
97
|
-
import"./index-
|
|
98
|
-
import"./index-
|
|
99
|
-
import"./index-
|
|
97
|
+
import"./index-pwx989sa.js";
|
|
98
|
+
import"./index-02jqxmh8.js";
|
|
99
|
+
import"./index-kakb2jm0.js";
|
|
100
100
|
import"./index-6mjf4vr1.js";
|
|
101
101
|
import"./index-c8s9a3zh.js";
|
|
102
102
|
import"./index-9ss2m4rs.js";
|
|
103
103
|
import"./index-wsdnttf4.js";
|
|
104
104
|
import"./index-5r6kkhd7.js";
|
|
105
|
-
import"./index-
|
|
106
|
-
import"./index-
|
|
105
|
+
import"./index-jdqayy7h.js";
|
|
106
|
+
import"./index-s9at02fn.js";
|
|
107
107
|
import"./index-rtry5xyf.js";
|
|
108
|
-
import"./index-
|
|
109
|
-
import"./index-
|
|
108
|
+
import"./index-9casmxdt.js";
|
|
109
|
+
import"./index-4t39wzzg.js";
|
|
110
110
|
import"./index-ae75rja9.js";
|
|
111
111
|
import"./index-vft1pg34.js";
|
|
112
112
|
import"./index-n3h6rmbe.js";
|
|
113
|
-
import"./index-
|
|
113
|
+
import"./index-1da1tvtn.js";
|
|
114
114
|
import"./index-k5jrywpr.js";
|
|
115
115
|
import"./index-n832052r.js";
|
|
116
116
|
import {
|
|
117
117
|
init_schema,
|
|
118
118
|
stripKnownSwarmPrefix
|
|
119
|
-
} from "./index-
|
|
119
|
+
} from "./index-vyh2prxv.js";
|
|
120
120
|
import"./index-bk5tah7q.js";
|
|
121
121
|
import"./index-8fwhhayc.js";
|
|
122
122
|
import"./index-q1exe2b3.js";
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ALLOWED_SKILL_PATH_PREFIXES,
|
|
4
4
|
validateSkillPath
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-jdqayy7h.js";
|
|
6
6
|
import {
|
|
7
7
|
computeOutcomeSignal,
|
|
8
8
|
readKnowledge,
|
|
9
9
|
resolveHiveKnowledgePath,
|
|
10
10
|
resolveSwarmKnowledgePath,
|
|
11
11
|
transactKnowledge
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-9casmxdt.js";
|
|
13
13
|
import {
|
|
14
14
|
effectiveRetrievalOutcomes,
|
|
15
15
|
readKnowledgeCounterRollups
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-4t39wzzg.js";
|
|
17
17
|
import {
|
|
18
18
|
init_knowledge_types,
|
|
19
19
|
isActiveStatus
|
|
@@ -21,7 +21,7 @@ var package_default;
|
|
|
21
21
|
var init_package = __esm(() => {
|
|
22
22
|
package_default = {
|
|
23
23
|
name: "opencode-swarm",
|
|
24
|
-
version: "7.137.
|
|
24
|
+
version: "7.137.2",
|
|
25
25
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
26
26
|
main: "dist/index.js",
|
|
27
27
|
types: "dist/index.d.ts",
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
detectPosixWrites,
|
|
13
13
|
detectWindowsWrites,
|
|
14
14
|
resolveWriteTargets
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-d735dzm7.js";
|
|
16
16
|
import {
|
|
17
17
|
checkFileAuthority,
|
|
18
18
|
classifyFile,
|
|
19
19
|
isInDeclaredScope,
|
|
20
20
|
redactPath,
|
|
21
21
|
redactShellCommand
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-aygnzd04.js";
|
|
23
23
|
|
|
24
24
|
// src/services/guardrail-explain-service.ts
|
|
25
25
|
import path from "path";
|
package/dist/cli/index.js
CHANGED
|
@@ -6,39 +6,39 @@ import {
|
|
|
6
6
|
getPluginConfigDir,
|
|
7
7
|
getPluginLockFilePaths,
|
|
8
8
|
resolveCommand
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-d735dzm7.js";
|
|
10
10
|
import"./index-vm4xw9z3.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
11
|
+
import"./index-b2s3t517.js";
|
|
12
|
+
import"./index-aygnzd04.js";
|
|
13
|
+
import"./index-rfrkt29c.js";
|
|
14
14
|
import"./index-1zrb3vt2.js";
|
|
15
15
|
import"./index-5wjw05dy.js";
|
|
16
16
|
import"./index-y8552snf.js";
|
|
17
17
|
import"./index-4905hd2m.js";
|
|
18
18
|
import"./index-134d35c1.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
19
|
+
import"./index-pwx989sa.js";
|
|
20
|
+
import"./index-02jqxmh8.js";
|
|
21
|
+
import"./index-kakb2jm0.js";
|
|
22
22
|
import"./index-6mjf4vr1.js";
|
|
23
23
|
import"./index-c8s9a3zh.js";
|
|
24
24
|
import"./index-9ss2m4rs.js";
|
|
25
25
|
import"./index-wsdnttf4.js";
|
|
26
26
|
import"./index-5r6kkhd7.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
27
|
+
import"./index-jdqayy7h.js";
|
|
28
|
+
import"./index-s9at02fn.js";
|
|
29
29
|
import"./index-rtry5xyf.js";
|
|
30
|
-
import"./index-
|
|
31
|
-
import"./index-
|
|
30
|
+
import"./index-9casmxdt.js";
|
|
31
|
+
import"./index-4t39wzzg.js";
|
|
32
32
|
import"./index-ae75rja9.js";
|
|
33
33
|
import"./index-vft1pg34.js";
|
|
34
34
|
import"./index-n3h6rmbe.js";
|
|
35
|
-
import"./index-
|
|
35
|
+
import"./index-1da1tvtn.js";
|
|
36
36
|
import"./index-k5jrywpr.js";
|
|
37
37
|
import"./index-n832052r.js";
|
|
38
38
|
import {
|
|
39
39
|
init_package,
|
|
40
40
|
package_default
|
|
41
|
-
} from "./index-
|
|
41
|
+
} from "./index-vyh2prxv.js";
|
|
42
42
|
import"./index-bk5tah7q.js";
|
|
43
43
|
import"./index-8fwhhayc.js";
|
|
44
44
|
import"./index-q1exe2b3.js";
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
maybeEscalateOnViolation,
|
|
9
9
|
maybeQuarantineOnContradiction,
|
|
10
10
|
readRecentEscalations
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
11
|
+
} from "./index-02jqxmh8.js";
|
|
12
|
+
import"./index-9casmxdt.js";
|
|
13
|
+
import"./index-4t39wzzg.js";
|
|
14
14
|
import"./index-ae75rja9.js";
|
|
15
15
|
import"./index-vft1pg34.js";
|
|
16
16
|
import"./index-n3h6rmbe.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
resolveKnowledgeCounterBaselinePath,
|
|
29
29
|
resolveKnowledgeEventsPath,
|
|
30
30
|
resolveLegacyApplicationLogPath
|
|
31
|
-
} from "./index-
|
|
31
|
+
} from "./index-4t39wzzg.js";
|
|
32
32
|
import"./index-ae75rja9.js";
|
|
33
33
|
import"./index-vft1pg34.js";
|
|
34
34
|
import"./index-n3h6rmbe.js";
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
validateLesson,
|
|
24
24
|
validateSkillCandidatePath,
|
|
25
25
|
validateSkillPath
|
|
26
|
-
} from "./index-
|
|
27
|
-
import"./index-
|
|
26
|
+
} from "./index-jdqayy7h.js";
|
|
27
|
+
import"./index-s9at02fn.js";
|
|
28
28
|
import"./index-rtry5xyf.js";
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
29
|
+
import"./index-9casmxdt.js";
|
|
30
|
+
import"./index-4t39wzzg.js";
|
|
31
31
|
import"./index-ae75rja9.js";
|
|
32
32
|
import"./index-vft1pg34.js";
|
|
33
33
|
import"./index-n3h6rmbe.js";
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
alreadyCuratedThisGeneration,
|
|
5
5
|
claimNextScanBatch,
|
|
6
6
|
getScanStatus
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
} from "./index-kakb2jm0.js";
|
|
8
|
+
import"./index-9casmxdt.js";
|
|
9
9
|
import"./index-ae75rja9.js";
|
|
10
10
|
import"./index-vft1pg34.js";
|
|
11
11
|
import"./index-n3h6rmbe.js";
|
|
@@ -33,12 +33,12 @@ import {
|
|
|
33
33
|
sanitizeSlug,
|
|
34
34
|
selectCandidateEntries,
|
|
35
35
|
writeEvalStub
|
|
36
|
-
} from "./index-
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
36
|
+
} from "./index-pwx989sa.js";
|
|
37
|
+
import"./index-jdqayy7h.js";
|
|
38
|
+
import"./index-s9at02fn.js";
|
|
39
39
|
import"./index-rtry5xyf.js";
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
40
|
+
import"./index-9casmxdt.js";
|
|
41
|
+
import"./index-4t39wzzg.js";
|
|
42
42
|
import"./index-ae75rja9.js";
|
|
43
43
|
import"./index-vft1pg34.js";
|
|
44
44
|
import"./index-n3h6rmbe.js";
|
|
@@ -24,4 +24,5 @@ import type { CouncilSynthesis } from './types';
|
|
|
24
24
|
export declare const _internals: {
|
|
25
25
|
withTaskEvidenceLock: typeof withTaskEvidenceLock;
|
|
26
26
|
};
|
|
27
|
-
export declare function writeCouncilEvidence(workingDir: string, synthesis: CouncilSynthesis): Promise<void>;
|
|
27
|
+
export declare function writeCouncilEvidence(workingDir: string, synthesis: CouncilSynthesis, attemptId?: string): Promise<void>;
|
|
28
|
+
export declare function hasCouncilEvidenceAttempt(workingDir: string, taskId: string, attemptId: string, roundNumber: number): boolean;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { withEvidenceLock } from '../evidence/lock.js';
|
|
3
|
+
import { atomicWriteFile } from '../evidence/task-file.js';
|
|
4
|
+
export type CouncilRoundScope = {
|
|
5
|
+
kind: 'task';
|
|
6
|
+
taskId: string;
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'phase';
|
|
9
|
+
phaseNumber: number;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'final';
|
|
12
|
+
generation: string;
|
|
13
|
+
};
|
|
14
|
+
export type CouncilRoundTransition = 'stay' | 'advance' | 'close';
|
|
15
|
+
type AuditScope = {
|
|
16
|
+
kind: 'task';
|
|
17
|
+
scopeHash: string;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'phase';
|
|
20
|
+
phaseNumber: number;
|
|
21
|
+
} | {
|
|
22
|
+
kind: 'final';
|
|
23
|
+
scopeHash: string;
|
|
24
|
+
};
|
|
25
|
+
interface StateSnapshot {
|
|
26
|
+
version: 1;
|
|
27
|
+
currentRound: number;
|
|
28
|
+
status: 'open' | 'closed';
|
|
29
|
+
maxRoundsExhausted: boolean;
|
|
30
|
+
lastAttemptId?: string;
|
|
31
|
+
lastDigest?: string;
|
|
32
|
+
}
|
|
33
|
+
interface AttemptRecord {
|
|
34
|
+
version: 1;
|
|
35
|
+
event: 'received' | 'finalized' | 'recovered';
|
|
36
|
+
attemptId: string;
|
|
37
|
+
timestamp: string;
|
|
38
|
+
scope: AuditScope;
|
|
39
|
+
clientRound?: number;
|
|
40
|
+
authoritativeRound: number;
|
|
41
|
+
digest: string;
|
|
42
|
+
sessionHash?: string;
|
|
43
|
+
disposition: string;
|
|
44
|
+
verdictCount: number;
|
|
45
|
+
members: string[];
|
|
46
|
+
transition?: CouncilRoundTransition;
|
|
47
|
+
gateEffect?: 'none' | 'blocked' | 'allowed';
|
|
48
|
+
verdict?: 'APPROVE' | 'CONCERNS' | 'REJECT';
|
|
49
|
+
quorumSize?: number;
|
|
50
|
+
evidenceRef?: string;
|
|
51
|
+
nextState?: StateSnapshot;
|
|
52
|
+
}
|
|
53
|
+
export interface CouncilAttemptEvaluation {
|
|
54
|
+
disposition: string;
|
|
55
|
+
response: Record<string, unknown>;
|
|
56
|
+
transition: CouncilRoundTransition;
|
|
57
|
+
gateEffect: 'none' | 'blocked' | 'allowed';
|
|
58
|
+
verdict?: 'APPROVE' | 'CONCERNS' | 'REJECT';
|
|
59
|
+
quorumSize?: number;
|
|
60
|
+
evidence?: {
|
|
61
|
+
reference: string;
|
|
62
|
+
commit: (attemptId: string) => Promise<void>;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Non-critical notification/reward work. It runs best-effort and at most once
|
|
66
|
+
* after the verdict, audit, and state commit; failures never change the verdict.
|
|
67
|
+
*/
|
|
68
|
+
afterCommit?: () => void | Promise<void>;
|
|
69
|
+
}
|
|
70
|
+
export interface CouncilAttemptInput {
|
|
71
|
+
directory: string;
|
|
72
|
+
scope: CouncilRoundScope;
|
|
73
|
+
clientRound?: number;
|
|
74
|
+
maxRounds: number;
|
|
75
|
+
sessionID?: string;
|
|
76
|
+
request: unknown;
|
|
77
|
+
verdictCount: number;
|
|
78
|
+
members: string[];
|
|
79
|
+
probePendingEvidence?: (attemptId: string, round: number, evidenceRef?: string) => Promise<boolean>;
|
|
80
|
+
evaluate: (authoritativeRound: number) => Promise<CouncilAttemptEvaluation>;
|
|
81
|
+
}
|
|
82
|
+
export declare class CouncilRoundStateUncertainError extends Error {
|
|
83
|
+
constructor(message: string);
|
|
84
|
+
}
|
|
85
|
+
export declare function councilRoundStatePaths(directory: string, scope: CouncilRoundScope): {
|
|
86
|
+
state: string;
|
|
87
|
+
audit: string;
|
|
88
|
+
lock: string;
|
|
89
|
+
};
|
|
90
|
+
export declare function councilRequestDigest(request: unknown, round: number): string;
|
|
91
|
+
declare function appendAudit(path: string, record: AttemptRecord): void;
|
|
92
|
+
interface AuditTail {
|
|
93
|
+
records: AttemptRecord[];
|
|
94
|
+
truncated: boolean;
|
|
95
|
+
}
|
|
96
|
+
declare function readAuditTail(path: string, scope: CouncilRoundScope): AuditTail;
|
|
97
|
+
export declare function runCouncilAttempt(input: CouncilAttemptInput): Promise<string>;
|
|
98
|
+
export declare function recordUnscopedCouncilAttempt(directory: string, level: 'task' | 'phase' | 'final', disposition: string, raw: unknown, issues: Array<{
|
|
99
|
+
path: Array<PropertyKey>;
|
|
100
|
+
code: string;
|
|
101
|
+
}>, sessionID?: string): Promise<string | null>;
|
|
102
|
+
export declare const _internals: {
|
|
103
|
+
now: () => string;
|
|
104
|
+
uuid: typeof randomUUID;
|
|
105
|
+
appendAudit: typeof appendAudit;
|
|
106
|
+
readAuditTail: typeof readAuditTail;
|
|
107
|
+
atomicWrite: typeof atomicWriteFile;
|
|
108
|
+
withLock: typeof withEvidenceLock;
|
|
109
|
+
};
|
|
110
|
+
export {};
|
package/dist/council/types.d.ts
CHANGED
|
@@ -21,8 +21,6 @@ export interface CouncilFinding {
|
|
|
21
21
|
export interface CouncilMemberVerdict {
|
|
22
22
|
agent: CouncilAgent;
|
|
23
23
|
verdict: CouncilVerdict;
|
|
24
|
-
/** Optional source round for freshness checks on resubmission. */
|
|
25
|
-
verdictRound?: number;
|
|
26
24
|
/** Confidence 0.0–1.0 */
|
|
27
25
|
confidence: number;
|
|
28
26
|
findings: CouncilFinding[];
|
|
@@ -9,6 +9,7 @@ export type { TaskInputHashLimits } from './hashing.js';
|
|
|
9
9
|
export { canonicalHash, canonicalJson, computeCandidateInputContentHash, computeManifestContentHash, computeRunIntegrityHash, computeTaskContentHash, computeTaskInputContentHash, computeTaskLineageInputHash, computeTaskSetContentHash, contentHashWithout, resolveContainedExistingPath, sha256, } from './hashing.js';
|
|
10
10
|
export type { EvaluationModelDispatcher, EvaluationModelDispatchRequest, EvaluationModelDispatchResult, } from './model-dispatcher.js';
|
|
11
11
|
export { createEvaluationModelDispatcher, resolveEvaluationAgentName, } from './model-dispatcher.js';
|
|
12
|
+
export * from './pr-review-recovery.js';
|
|
12
13
|
export * from './public-api.js';
|
|
13
14
|
export * from './retention.js';
|
|
14
15
|
export type { EvaluationExecutor, EvaluationExecutorResult, RunEvaluationOptions, } from './runner.js';
|
|
@@ -2,7 +2,25 @@ import type { Agent, OpencodeClient } from '@opencode-ai/sdk';
|
|
|
2
2
|
import type { DelegationCostFields } from '../services/cost-accounting.js';
|
|
3
3
|
import { _internals as ephemeralDispatcherInternals } from './ephemeral-agent-dispatcher.js';
|
|
4
4
|
export type EvaluationModelDispatchRequest = {
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The directory the ephemeral session is created against.
|
|
7
|
+
*
|
|
8
|
+
* This is the directory OpenCode uses to key permission state
|
|
9
|
+
* (`Permission.state`, `Agent.state`, `ToolRegistry.state` are all built
|
|
10
|
+
* through the directory-keyed `InstanceState` cache) AND to resolve
|
|
11
|
+
* registered agents. It MUST be the invoking instance's directory (the
|
|
12
|
+
* project root) so the session lands in the SAME permission partition as
|
|
13
|
+
* the user's session — a foreign directory gets a fresh, empty `approved`
|
|
14
|
+
* list and a private pending map that the user's TUI cannot reach, so an
|
|
15
|
+
* `external_directory` prompt raised there hangs forever.
|
|
16
|
+
*
|
|
17
|
+
* The SDK's `session.create` has no separate working-directory field, so
|
|
18
|
+
* this is also the agent's CWD. When the fixture the agent must inspect is
|
|
19
|
+
* NOT under this directory, the caller conveys the fixture path via the
|
|
20
|
+
* prompt (see gate-audit.ts `modelPrompt` and runner.ts
|
|
21
|
+
* `createModelEvaluationExecutor`).
|
|
22
|
+
*/
|
|
23
|
+
sessionDirectory: string;
|
|
6
24
|
agentName: string;
|
|
7
25
|
modelId: string;
|
|
8
26
|
prompt: string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { EvaluationRunV1 } from './contracts.js';
|
|
2
|
+
import type { EvaluationModelDispatcher } from './model-dispatcher.js';
|
|
3
|
+
export declare const PR_REVIEW_RECOVERY_BASE_SHA: "3811fe5981072c7fa541523e9f08430f18594590";
|
|
4
|
+
type RecoveryBudgets = {
|
|
5
|
+
maxTasks: number;
|
|
6
|
+
maxRepetitions: number;
|
|
7
|
+
maxConcurrency: number;
|
|
8
|
+
maxTaskTimeMs: number;
|
|
9
|
+
maxRetries: number;
|
|
10
|
+
maxOutputBytes: number;
|
|
11
|
+
maxSpendUsd?: number;
|
|
12
|
+
};
|
|
13
|
+
export type EvaluatePrReviewRecoveryV1Options = {
|
|
14
|
+
projectRoot: string;
|
|
15
|
+
packageRoot?: string;
|
|
16
|
+
dispatcher: EvaluationModelDispatcher;
|
|
17
|
+
parentSessionId?: string;
|
|
18
|
+
model?: string;
|
|
19
|
+
seed?: string;
|
|
20
|
+
baselineSourceSha?: string;
|
|
21
|
+
budgets?: Partial<RecoveryBudgets>;
|
|
22
|
+
abortSignal?: AbortSignal;
|
|
23
|
+
};
|
|
24
|
+
type BaselineManifest = {
|
|
25
|
+
v: 1;
|
|
26
|
+
sourceSha: string;
|
|
27
|
+
payloadPath: string;
|
|
28
|
+
sha256: string;
|
|
29
|
+
};
|
|
30
|
+
declare function parseBaselineManifest(value: unknown): BaselineManifest;
|
|
31
|
+
declare function verifyBaseline(packageRoot: string, requestedSourceSha: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Runs the packaged issue-2075 recovery scenario against the exact canonical
|
|
34
|
+
* PR-review skill and its content-addressed pre-hardening baseline.
|
|
35
|
+
*/
|
|
36
|
+
export declare function evaluatePrReviewRecoveryV1(options: EvaluatePrReviewRecoveryV1Options): Promise<EvaluationRunV1>;
|
|
37
|
+
export declare const _internals: {
|
|
38
|
+
parseBaselineManifest: typeof parseBaselineManifest;
|
|
39
|
+
verifyBaseline: typeof verifyBaseline;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { EvaluationRunV1, PromotionDecisionV1, PromotionPolicyV1 } from './contracts.js';
|
|
2
2
|
import { recordTestImpactGateGroundTruth } from './gate-ground-truth.js';
|
|
3
3
|
import { computeCandidateInputContentHash, computeTaskInputContentHash } from './hashing.js';
|
|
4
|
+
import { evaluatePrReviewRecoveryV1 } from './pr-review-recovery.js';
|
|
4
5
|
import { type RunEvaluationOptions, runEvaluation } from './runner.js';
|
|
5
6
|
import { type DecidePromotionInput } from './statistics.js';
|
|
6
7
|
export type EvaluateCandidateV1Options = RunEvaluationOptions & {
|
|
@@ -25,6 +26,7 @@ export declare function evaluateCandidateV1(options: EvaluateCandidateV1Options)
|
|
|
25
26
|
*/
|
|
26
27
|
export declare const evaluationV1: ((options: EvaluateCandidateV1Options) => Promise<EvaluateCandidateV1Result>) & {
|
|
27
28
|
evaluateCandidate: typeof evaluateCandidateV1;
|
|
29
|
+
evaluatePrReviewRecovery: typeof evaluatePrReviewRecoveryV1;
|
|
28
30
|
runEvaluation: typeof runEvaluation;
|
|
29
31
|
decidePromotion: (input: DecidePromotionInput) => {
|
|
30
32
|
v: 1;
|
|
@@ -19,6 +19,15 @@ export type EvaluationExecutor = (args: {
|
|
|
19
19
|
payload: string;
|
|
20
20
|
seed: string;
|
|
21
21
|
abortSignal: AbortSignal;
|
|
22
|
+
/**
|
|
23
|
+
* The invoking instance's directory (the project root). An executor that
|
|
24
|
+
* creates an OpenCode session MUST bind it here — NOT to `isolatedRoot` —
|
|
25
|
+
* so the session lands in the same permission partition as the user's
|
|
26
|
+
* session (#2009). OpenCode keys permission state per directory; a foreign
|
|
27
|
+
* directory gets an empty approved list and a private pending map the TUI
|
|
28
|
+
* cannot reach, so a prompt raised there hangs forever.
|
|
29
|
+
*/
|
|
30
|
+
projectRoot: string;
|
|
22
31
|
}) => Promise<EvaluationExecutorResult>;
|
|
23
32
|
export type RunEvaluationOptions = {
|
|
24
33
|
projectRoot: string;
|