opencode-swarm 7.125.4 → 7.125.6
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/brainstorm/SKILL.md +1 -0
- package/.opencode/skills/execute/SKILL.md +5 -0
- package/.opencode/skills/phase-wrap/SKILL.md +2 -0
- package/.opencode/skills/plan/SKILL.md +1 -0
- package/.opencode/skills/swarm-pr-feedback/SKILL.md +16 -0
- package/.opencode/skills/swarm-pr-review/SKILL.md +34 -0
- package/dist/cli/{config-doctor-rm1m07gz.js → config-doctor-akxywx0c.js} +2 -2
- package/dist/cli/{curation-policy-7pgdjt5w.js → curation-policy-62w2pwfz.js} +2 -2
- package/dist/cli/{curator-n6whbm4r.js → curator-gke6nrc4.js} +12 -12
- package/dist/cli/{curator-llm-factory-0hncnz9t.js → curator-llm-factory-40c4852v.js} +12 -12
- package/dist/cli/{guardrail-explain-8gknrsbb.js → guardrail-explain-m34vcgjg.js} +13 -13
- package/dist/cli/{guardrail-log-6a2zxvtx.js → guardrail-log-222xyxfp.js} +3 -3
- package/dist/cli/{hive-promoter-mpjq0fw9.js → hive-promoter-6fg3redm.js} +12 -12
- package/dist/cli/{index-vdfewvn5.js → index-0f45t7xy.js} +5 -5
- package/dist/cli/{index-45mvd5q7.js → index-1012f47p.js} +4 -4
- package/dist/cli/{index-jkwyjr8x.js → index-1cxp3b5y.js} +2 -2
- package/dist/cli/{index-rp5msv7n.js → index-1htanqp1.js} +1 -1
- package/dist/cli/{index-emzes7sj.js → index-4b1e5m0d.js} +2 -2
- package/dist/cli/{index-ambnwnmt.js → index-74xejn4v.js} +1 -1
- package/dist/cli/{index-7xg876np.js → index-d17kqe54.js} +221 -94
- package/dist/cli/{index-xezv6tdw.js → index-dezgmvtw.js} +1 -1
- package/dist/cli/{index-8tjbq2ej.js → index-e315gwc9.js} +1 -1
- package/dist/cli/{index-fm4zfxnr.js → index-gbnpz7rh.js} +1 -1
- package/dist/cli/{index-01n43w2p.js → index-gd5w3ef8.js} +3 -3
- package/dist/cli/{index-pk099nqv.js → index-jt7hnr7q.js} +1 -1
- package/dist/cli/{index-4ycq2mrp.js → index-qzkcy22e.js} +1 -1
- package/dist/cli/{index-414r47r7.js → index-r1gdkn2d.js} +4 -0
- package/dist/cli/{index-sa3dgpmc.js → index-yq4s3q43.js} +2 -2
- package/dist/cli/{index-hr2kzcem.js → index-zp330ss0.js} +14 -14
- package/dist/cli/index.js +12 -12
- package/dist/cli/{knowledge-escalator-gr8qd7kz.js → knowledge-escalator-h3hg7ek7.js} +3 -3
- package/dist/cli/{knowledge-events-q83g3f8z.js → knowledge-events-jtr66wxz.js} +1 -1
- package/dist/cli/{knowledge-store-qq3w5yt8.js → knowledge-store-69ttjjjs.js} +1 -1
- package/dist/cli/{knowledge-validator-7jhq8yam.js → knowledge-validator-yn06rh13.js} +4 -4
- package/dist/cli/{scan-cursor-fa5sy36q.js → scan-cursor-r0w2p5gz.js} +2 -2
- package/dist/cli/{schema-bw68my66.js → schema-69z8w1ka.js} +1 -1
- package/dist/cli/{skill-generator-ffc1agyw.js → skill-generator-a7xfyddq.js} +5 -5
- package/dist/commands/abort-pr-workflow.d.ts +17 -0
- package/dist/commands/registry.d.ts +8 -0
- package/dist/hooks/pr-workflow-gate.d.ts +32 -0
- package/dist/hooks/pr-workflow-response-gate.d.ts +48 -0
- package/dist/index.js +84 -67
- package/dist/tools/abort-pr-workflow.d.ts +5 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/manifest.d.ts +1 -0
- package/dist/tools/tool-metadata.d.ts +4 -0
- package/package.json +1 -1
|
@@ -608,7 +608,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
|
|
|
608
608
|
deltas.push({ id, delta });
|
|
609
609
|
}
|
|
610
610
|
if (deltas.length > 0) {
|
|
611
|
-
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-
|
|
611
|
+
const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-69ttjjjs.js");
|
|
612
612
|
await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
|
|
613
613
|
}
|
|
614
614
|
return {
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ALLOWED_SKILL_PATH_PREFIXES,
|
|
4
4
|
validateSkillPath
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-yq4s3q43.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-1012f47p.js";
|
|
13
13
|
import {
|
|
14
14
|
effectiveRetrievalOutcomes,
|
|
15
15
|
readKnowledgeCounterRollups
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-gbnpz7rh.js";
|
|
17
17
|
import {
|
|
18
18
|
init_knowledge_types,
|
|
19
19
|
isActiveStatus
|
|
@@ -174,6 +174,10 @@ var init_tool_metadata = __esm(() => {
|
|
|
174
174
|
description: "validate terminal PR workflow evidence and clear its durable session gate",
|
|
175
175
|
agents: ["architect"]
|
|
176
176
|
},
|
|
177
|
+
abort_pr_workflow: {
|
|
178
|
+
description: "abort an unrecoverable PR_REVIEW/PR_FEEDBACK mechanical gate and clear its durable session state",
|
|
179
|
+
agents: ["architect"]
|
|
180
|
+
},
|
|
177
181
|
run_pr_feedback_stage_a: {
|
|
178
182
|
description: "execute and persist mandatory PR-feedback Stage A checks on a content-bound revision",
|
|
179
183
|
agents: ["architect"]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
authorizeCuration
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-1htanqp1.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-1012f47p.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveKnowledgeStoreDir
|
|
15
15
|
} from "./index-q27bajqb.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-1cxp3b5y.js";
|
|
5
5
|
import {
|
|
6
6
|
handleGuardrailLog
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-qzkcy22e.js";
|
|
8
8
|
import {
|
|
9
9
|
COMMAND_REGISTRY,
|
|
10
10
|
SWARM_COMMAND_TOOL_ALLOWLIST,
|
|
@@ -83,28 +83,28 @@ import {
|
|
|
83
83
|
handleWriteRetroCommand,
|
|
84
84
|
normalizeSwarmCommandInput,
|
|
85
85
|
resolveCommand
|
|
86
|
-
} from "./index-
|
|
87
|
-
import"./index-
|
|
88
|
-
import"./index-
|
|
86
|
+
} from "./index-d17kqe54.js";
|
|
87
|
+
import"./index-dezgmvtw.js";
|
|
88
|
+
import"./index-jt7hnr7q.js";
|
|
89
89
|
import"./index-kk1scggc.js";
|
|
90
90
|
import"./index-4905hd2m.js";
|
|
91
91
|
import"./index-134d35c1.js";
|
|
92
92
|
import"./index-6n2jpz7x.js";
|
|
93
|
-
import"./index-
|
|
94
|
-
import"./index-
|
|
95
|
-
import"./index-
|
|
93
|
+
import"./index-gd5w3ef8.js";
|
|
94
|
+
import"./index-0f45t7xy.js";
|
|
95
|
+
import"./index-e315gwc9.js";
|
|
96
96
|
import"./index-vxv732ex.js";
|
|
97
97
|
import"./index-c8s9a3zh.js";
|
|
98
98
|
import"./index-9ss2m4rs.js";
|
|
99
99
|
import"./index-23zsx7dm.js";
|
|
100
|
-
import"./index-
|
|
101
|
-
import"./index-
|
|
100
|
+
import"./index-yq4s3q43.js";
|
|
101
|
+
import"./index-1htanqp1.js";
|
|
102
102
|
import"./index-rtry5xyf.js";
|
|
103
|
-
import"./index-
|
|
104
|
-
import"./index-
|
|
103
|
+
import"./index-1012f47p.js";
|
|
104
|
+
import"./index-gbnpz7rh.js";
|
|
105
105
|
import"./index-ae75rja9.js";
|
|
106
106
|
import"./index-q27bajqb.js";
|
|
107
|
-
import"./index-
|
|
107
|
+
import"./index-74xejn4v.js";
|
|
108
108
|
import"./index-k5jrywpr.js";
|
|
109
109
|
import"./index-n832052r.js";
|
|
110
110
|
import {
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
init_constants,
|
|
114
114
|
init_schema,
|
|
115
115
|
stripKnownSwarmPrefix
|
|
116
|
-
} from "./index-
|
|
116
|
+
} from "./index-r1gdkn2d.js";
|
|
117
117
|
import"./index-bk5tah7q.js";
|
|
118
118
|
import"./index-8fwhhayc.js";
|
|
119
119
|
import"./index-q1exe2b3.js";
|
package/dist/cli/index.js
CHANGED
|
@@ -7,34 +7,34 @@ import {
|
|
|
7
7
|
getPluginLockFilePaths,
|
|
8
8
|
package_default,
|
|
9
9
|
resolveCommand
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
10
|
+
} from "./index-d17kqe54.js";
|
|
11
|
+
import"./index-dezgmvtw.js";
|
|
12
|
+
import"./index-jt7hnr7q.js";
|
|
13
13
|
import"./index-kk1scggc.js";
|
|
14
14
|
import"./index-4905hd2m.js";
|
|
15
15
|
import"./index-134d35c1.js";
|
|
16
16
|
import"./index-6n2jpz7x.js";
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
17
|
+
import"./index-gd5w3ef8.js";
|
|
18
|
+
import"./index-0f45t7xy.js";
|
|
19
|
+
import"./index-e315gwc9.js";
|
|
20
20
|
import"./index-vxv732ex.js";
|
|
21
21
|
import"./index-c8s9a3zh.js";
|
|
22
22
|
import"./index-9ss2m4rs.js";
|
|
23
23
|
import"./index-23zsx7dm.js";
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
24
|
+
import"./index-yq4s3q43.js";
|
|
25
|
+
import"./index-1htanqp1.js";
|
|
26
26
|
import"./index-rtry5xyf.js";
|
|
27
|
-
import"./index-
|
|
28
|
-
import"./index-
|
|
27
|
+
import"./index-1012f47p.js";
|
|
28
|
+
import"./index-gbnpz7rh.js";
|
|
29
29
|
import"./index-ae75rja9.js";
|
|
30
30
|
import"./index-q27bajqb.js";
|
|
31
|
-
import"./index-
|
|
31
|
+
import"./index-74xejn4v.js";
|
|
32
32
|
import"./index-k5jrywpr.js";
|
|
33
33
|
import"./index-n832052r.js";
|
|
34
34
|
import {
|
|
35
35
|
DEFAULT_AGENT_CONFIGS,
|
|
36
36
|
init_constants
|
|
37
|
-
} from "./index-
|
|
37
|
+
} from "./index-r1gdkn2d.js";
|
|
38
38
|
import"./index-bk5tah7q.js";
|
|
39
39
|
import"./index-8fwhhayc.js";
|
|
40
40
|
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-0f45t7xy.js";
|
|
12
|
+
import"./index-1012f47p.js";
|
|
13
|
+
import"./index-gbnpz7rh.js";
|
|
14
14
|
import"./index-ae75rja9.js";
|
|
15
15
|
import"./index-q27bajqb.js";
|
|
16
16
|
import"./index-bk5tah7q.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
resolveKnowledgeCounterBaselinePath,
|
|
27
27
|
resolveKnowledgeEventsPath,
|
|
28
28
|
resolveLegacyApplicationLogPath
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-gbnpz7rh.js";
|
|
30
30
|
import"./index-ae75rja9.js";
|
|
31
31
|
import"./index-q27bajqb.js";
|
|
32
32
|
import"./index-zgwm4ryv.js";
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
validateLesson,
|
|
24
24
|
validateSkillCandidatePath,
|
|
25
25
|
validateSkillPath
|
|
26
|
-
} from "./index-
|
|
27
|
-
import"./index-
|
|
26
|
+
} from "./index-yq4s3q43.js";
|
|
27
|
+
import"./index-1htanqp1.js";
|
|
28
28
|
import"./index-rtry5xyf.js";
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
29
|
+
import"./index-1012f47p.js";
|
|
30
|
+
import"./index-gbnpz7rh.js";
|
|
31
31
|
import"./index-ae75rja9.js";
|
|
32
32
|
import"./index-q27bajqb.js";
|
|
33
33
|
import"./index-bk5tah7q.js";
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
alreadyCuratedThisGeneration,
|
|
5
5
|
claimNextScanBatch,
|
|
6
6
|
getScanStatus
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
} from "./index-e315gwc9.js";
|
|
8
|
+
import"./index-1012f47p.js";
|
|
9
9
|
import"./index-ae75rja9.js";
|
|
10
10
|
import"./index-q27bajqb.js";
|
|
11
11
|
import"./index-bk5tah7q.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-gd5w3ef8.js";
|
|
37
|
+
import"./index-yq4s3q43.js";
|
|
38
|
+
import"./index-1htanqp1.js";
|
|
39
39
|
import"./index-rtry5xyf.js";
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
40
|
+
import"./index-1012f47p.js";
|
|
41
|
+
import"./index-gbnpz7rh.js";
|
|
42
42
|
import"./index-ae75rja9.js";
|
|
43
43
|
import"./index-q27bajqb.js";
|
|
44
44
|
import"./index-bk5tah7q.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handle /swarm abort-pr-workflow command.
|
|
3
|
+
*
|
|
4
|
+
* Human-only escape hatch for an unrecoverable PR_REVIEW / PR_FEEDBACK
|
|
5
|
+
* mechanical gate. When the architect cannot reach `complete_pr_workflow`
|
|
6
|
+
* (compound `git fetch && git checkout` rejected as read-only shell syntax,
|
|
7
|
+
* missing PR ref, model confusion, suspended wake budget, …), the user runs
|
|
8
|
+
* this to clear the durable gate and stop the auto-resume loop without
|
|
9
|
+
* depending on the trapped model.
|
|
10
|
+
*
|
|
11
|
+
* The command is `toolPolicy: 'restricted'` — the agent cannot run it via
|
|
12
|
+
* `swarm_command`; the agent must instead call the `abort_pr_workflow` tool
|
|
13
|
+
* (or ask the user to run this command). Both paths funnel into
|
|
14
|
+
* `abortPrWorkflow`, which is fail-closed on armed publication and on
|
|
15
|
+
* in-flight lanes.
|
|
16
|
+
*/
|
|
17
|
+
export declare function handleAbortPrWorkflowCommand(directory: string, args: string[], sessionID: string): Promise<string>;
|
|
@@ -513,6 +513,14 @@ export declare const COMMAND_REGISTRY: {
|
|
|
513
513
|
readonly category: "agent";
|
|
514
514
|
readonly toolPolicy: "none";
|
|
515
515
|
};
|
|
516
|
+
readonly 'abort-pr-workflow': {
|
|
517
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
518
|
+
readonly description: "Clear a stuck PR_REVIEW/PR_FEEDBACK mechanical gate and stop the auto-resume loop [mode] [reason]";
|
|
519
|
+
readonly args: "[PR_REVIEW|PR_FEEDBACK] [reason...]";
|
|
520
|
+
readonly details: "Human-only escape hatch for an unrecoverable PR_REVIEW or PR_FEEDBACK mechanical gate. When the architect cannot reach complete_pr_workflow — for example a compound `git fetch && git checkout` was rejected as read-only shell syntax, the PR head cannot be fetched, or the working tree is on the wrong branch — running this clears the durable gate state for the current session and stops the auto-resume loop without depending on the trapped model. The agent itself cannot run this command; it must call the abort_pr_workflow tool (or ask you to run this command). Both paths funnel into the same fail-closed abortPrWorkflow hook, which refuses while the workflow is armed for publication or while PR workflow lanes are still in flight. An audit event is appended to .swarm/events.jsonl.";
|
|
521
|
+
readonly category: "utility";
|
|
522
|
+
readonly toolPolicy: "restricted";
|
|
523
|
+
};
|
|
516
524
|
readonly 'pr-review': {
|
|
517
525
|
readonly handler: (ctx: CommandContext) => CommandResult;
|
|
518
526
|
readonly description: "Launch deep PR review with multi-lane analysis [url] [--council]";
|
|
@@ -118,6 +118,38 @@ export declare function activatePrWorkflow(directory: string, sessionID: string,
|
|
|
118
118
|
}): Promise<PrWorkflowGateState>;
|
|
119
119
|
export declare function readPrWorkflowGateState(directory: string, sessionID: string): Promise<PrWorkflowGateState | null>;
|
|
120
120
|
export declare function clearPrWorkflowGateState(directory: string, sessionID: string, expectedRevision?: number): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Abort an active PR workflow gate without reaching terminal completion.
|
|
123
|
+
*
|
|
124
|
+
* This is the escape hatch for the deadlock where `/swarm pr-review` activates
|
|
125
|
+
* a PR_REVIEW gate without binding a PR head and the architect cannot reach
|
|
126
|
+
* `completePrWorkflow` (compound `git fetch && git checkout` rejected by the
|
|
127
|
+
* read-only shell classifier, missing PR ref, model confusion, etc.). Without
|
|
128
|
+
* this path the durable gate is permanent for the session and the response
|
|
129
|
+
* gate's auto-resume loop runs unbounded.
|
|
130
|
+
*
|
|
131
|
+
* Fail-closed semantics, checked in order:
|
|
132
|
+
* 1. Authorization: operates on the raw caller `sessionID` only. A lane or
|
|
133
|
+
* child session whose ID has no gate record throws "no active gate" —
|
|
134
|
+
* lanes must not abort the controller's gate.
|
|
135
|
+
* 2. Mode match when `expectedMode` is supplied.
|
|
136
|
+
* 3. Refuses while `prFeedbackReadyToPublish` is set — clearing an armed
|
|
137
|
+
* gate would drop the immutable-commit binding and leave a half-published
|
|
138
|
+
* commit. The tool gate refuses armed abort too (defense in depth).
|
|
139
|
+
* 4. Refuses while open `swarm-pr-*` delegations exist, matching
|
|
140
|
+
* `completePrWorkflow` — aborting mid-flight would orphan running lanes.
|
|
141
|
+
*
|
|
142
|
+
* Records a non-fatal audit event into the existing `.swarm/events.jsonl`
|
|
143
|
+
* (no new ledger file), then delegates to `clearPrWorkflowGateState`.
|
|
144
|
+
*/
|
|
145
|
+
export declare function abortPrWorkflow(directory: string, sessionID: string, options?: {
|
|
146
|
+
expectedMode?: PrWorkflowMode;
|
|
147
|
+
reason?: string;
|
|
148
|
+
}): Promise<{
|
|
149
|
+
mode: PrWorkflowMode;
|
|
150
|
+
prHeadSha?: string;
|
|
151
|
+
openLanes: number;
|
|
152
|
+
}>;
|
|
121
153
|
/** Bind an active PR workflow to one immutable PR head. */
|
|
122
154
|
export declare function bindPrWorkflowHead(directory: string, sessionID: string, prHeadSha: string): Promise<PrWorkflowGateState>;
|
|
123
155
|
/** Bind an active PR_REVIEW workflow to one immutable merge-base scope. */
|
|
@@ -1,15 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maximum number of consecutive unproductive auto-resumes per gated session
|
|
3
|
+
* before the response gate suspends further wakes. "Unproductive" means the
|
|
4
|
+
* durable gate's `revision` did not advance between wakes — i.e. no
|
|
5
|
+
* state-mutating controller tool (dispatch_lanes_async,
|
|
6
|
+
* write_pr_review_trigger_eval, complete_pr_workflow, recordPrReview*,
|
|
7
|
+
* bindPrReviewBase, …) made durable progress. A healthy review bumps
|
|
8
|
+
* `revision` on every successful state-mutating controller call, so the
|
|
9
|
+
* consecutive counter resets on progress and never exhausts the budget.
|
|
10
|
+
* Read-only tools (collect_lane_results polling, grep, read) intentionally do
|
|
11
|
+
* NOT bump `revision` — an architect that only polls without ever dispatching
|
|
12
|
+
* new lanes or recording trigger evaluations IS making progress on the
|
|
13
|
+
* runtime's bookkeeping but is not advancing the durable gate, so the budget
|
|
14
|
+
* treats long polling-only stretches conservatively. Only a genuinely stuck
|
|
15
|
+
* session holds `revision` constant across many idle cycles.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_MAX_CONSECUTIVE_UNPRODUCTIVE_WAKES = 5;
|
|
18
|
+
/**
|
|
19
|
+
* Cooldown applied ONLY between consecutive unproductive wakes. The first
|
|
20
|
+
* wake after progress is never throttled, so a review that is actively
|
|
21
|
+
* bumping `revision` never waits.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DEFAULT_WAKE_COOLDOWN_MS = 30000;
|
|
24
|
+
/**
|
|
25
|
+
* Bounded FIFO map of tracked wake budgets. Invariant 8 (session/global
|
|
26
|
+
* state): module-level state must have an explicit eviction strategy.
|
|
27
|
+
*/
|
|
28
|
+
export declare const MAX_TRACKED_WAKE_SESSIONS = 200;
|
|
1
29
|
interface PrWorkflowResponseGateClient {
|
|
2
30
|
session?: unknown;
|
|
3
31
|
}
|
|
32
|
+
interface WakeBudget {
|
|
33
|
+
consecutiveUnproductive: number;
|
|
34
|
+
lastWakeAt: number;
|
|
35
|
+
lastSeenRevision?: number;
|
|
36
|
+
suspended: boolean;
|
|
37
|
+
}
|
|
4
38
|
/**
|
|
5
39
|
* Prevent an architect from bypassing PR obligations by simply emitting text.
|
|
6
40
|
* The text-complete hook replaces every architect-session text part while the
|
|
7
41
|
* durable gate exists; session.idle then mechanically resumes that session.
|
|
42
|
+
*
|
|
43
|
+
* The resume loop is bounded (see DEFAULT_MAX_CONSECUTIVE_UNPRODUCTIVE_WAKES)
|
|
44
|
+
* so a session that cannot make progress suspends instead of spinning
|
|
45
|
+
* forever. `textComplete` keeps rewriting text after suspension so the
|
|
46
|
+
* user-visible surface always names the recovery path.
|
|
8
47
|
*/
|
|
9
48
|
export declare function createPrWorkflowResponseGate(options: {
|
|
10
49
|
directory: string;
|
|
11
50
|
client?: PrWorkflowResponseGateClient;
|
|
12
51
|
wakeTimeoutMs?: number;
|
|
52
|
+
maxConsecutiveUnproductiveWakes?: number;
|
|
53
|
+
wakeCooldownMs?: number;
|
|
13
54
|
}): {
|
|
14
55
|
event: (input: {
|
|
15
56
|
event: unknown;
|
|
@@ -19,5 +60,12 @@ export declare function createPrWorkflowResponseGate(options: {
|
|
|
19
60
|
}, output: {
|
|
20
61
|
text: string;
|
|
21
62
|
}) => Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Test/inspection seam: returns a snapshot of the wake budget for the
|
|
65
|
+
* given session. Production code does not call this; it exists so
|
|
66
|
+
* tests can assert the consecutive counter and suspended flag
|
|
67
|
+
* without relying on `promptAsync` call counts alone.
|
|
68
|
+
*/
|
|
69
|
+
_inspectWakeBudget: (sessionID: string) => WakeBudget | undefined;
|
|
22
70
|
};
|
|
23
71
|
export {};
|