opencode-swarm 7.135.0 → 7.135.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-feedback/SKILL.md +24 -21
- package/.opencode/skills/swarm-pr-review/SKILL.md +55 -42
- package/dist/agents/explorer.d.ts +1 -1
- package/dist/background/candidate-contract.d.ts +113 -0
- package/dist/background/candidate-parser.d.ts +8 -29
- package/dist/background/pr-review-trigger-contract.d.ts +197 -0
- package/dist/background/workspace-snapshot.d.ts +26 -0
- package/dist/cli/{config-doctor-j1x63x87.js → config-doctor-pj3yvxdb.js} +2 -2
- package/dist/cli/{core-fvqp2gnn.js → core-4va9z2ng.js} +2 -2
- package/dist/cli/{curation-policy-xg9zw0ep.js → curation-policy-b2caf3v3.js} +5 -5
- package/dist/cli/{curator-drift-9q6f85bm.js → curator-drift-2ta83hss.js} +2 -2
- package/dist/cli/{curator-llm-factory-4mat6cq5.js → curator-llm-factory-9983528d.js} +26 -26
- package/dist/cli/{curator-yc06cmnz.js → curator-r1s2mwf2.js} +26 -26
- package/dist/cli/{dispatch-gxbeb2ps.js → dispatch-wtk6dxky.js} +2 -2
- package/dist/cli/{evidence-summary-service-0cczdmjv.js → evidence-summary-service-feby8ny0.js} +5 -5
- package/dist/cli/{explorer-jp0nen03.js → explorer-15gqzxh8.js} +1 -1
- package/dist/cli/{gate-evidence-8zrwdj69.js → gate-evidence-84b03mb4.js} +3 -3
- package/dist/cli/guardrail-explain-pwxvg5n0.js +57 -0
- package/dist/cli/{guardrail-log-7egxrxap.js → guardrail-log-yzpz8b7t.js} +4 -4
- package/dist/cli/{hive-promoter-7s3gzajy.js → hive-promoter-586dhndj.js} +26 -26
- package/dist/cli/{index-nrvs08pr.js → index-02cqjna3.js} +6 -6
- package/dist/cli/{index-grxkbbc5.js → index-2pxk6qg4.js} +1 -1
- package/dist/cli/{index-crw4n55v.js → index-340chr1e.js} +1612 -166
- package/dist/cli/{index-g0raqavt.js → index-3m7kpnqf.js} +2 -2
- package/dist/cli/{index-z085b4ka.js → index-3xbx305x.js} +1 -1
- package/dist/cli/{index-b4z7s917.js → index-73dfyfhq.js} +1 -1
- package/dist/cli/{index-ens0gt38.js → index-7pnvf04s.js} +8 -8
- package/dist/cli/{index-x88w0cp5.js → index-8gw8p7yh.js} +3 -3
- package/dist/cli/{index-e8w62fgs.js → index-9c3gf2wd.js} +1 -1
- package/dist/cli/{index-vf6e8ame.js → index-b0eva00y.js} +2 -2
- package/dist/cli/{index-2ghkk9ve.js → index-bfd4xfpp.js} +3 -3
- package/dist/cli/{index-6kmmdtdp.js → index-bs4m85v1.js} +2 -2
- package/dist/cli/{index-86wdrskb.js → index-ckdva4rs.js} +5 -5
- package/dist/cli/{index-96b78s7p.js → index-cwdy5vw9.js} +28 -28
- package/dist/cli/{index-44zgqvqh.js → index-d5psymdk.js} +4 -4
- package/dist/cli/{index-vxv732ex.js → index-dg1njnms.js} +7 -4
- package/dist/cli/{index-yhba8swx.js → index-dzyjb33e.js} +1 -1
- package/dist/cli/{index-xg9repnx.js → index-ey29aap6.js} +1 -1
- package/dist/cli/{index-q9mq5tv3.js → index-g3meqrsg.js} +2 -2
- package/dist/cli/{index-7an2qn0s.js → index-hdy2nd5h.js} +4 -4
- package/dist/cli/{index-4yv2rn8q.js → index-hvrrq3f3.js} +1 -1
- package/dist/cli/{index-337r9pkr.js → index-j0kte6gd.js} +1 -1
- package/dist/cli/{index-ctvnb76s.js → index-j92ser8n.js} +1 -1
- package/dist/cli/{index-997d6p42.js → index-jgkjxpdh.js} +4 -4
- package/dist/cli/{index-13xxjfhn.js → index-m0ynxkaa.js} +3 -3
- package/dist/cli/{index-a4972t0f.js → index-qqkw794p.js} +3 -3
- package/dist/cli/{index-b7p0mp2q.js → index-ryqnn3nv.js} +1 -1
- package/dist/cli/{index-ny93srnd.js → index-vg3yx648.js} +1 -1
- package/dist/cli/{index-qe3v54nb.js → index-y111zefa.js} +64 -23
- package/dist/cli/{index-3nasn371.js → index-y6a7gjtj.js} +126 -42
- package/dist/cli/index.js +26 -26
- package/dist/cli/{knowledge-escalator-d76a090n.js → knowledge-escalator-w7by1m8m.js} +6 -6
- package/dist/cli/{knowledge-events-3mcg1a0e.js → knowledge-events-n8xxsay3.js} +4 -4
- package/dist/cli/{knowledge-link-etrfntkd.js → knowledge-link-mm1w967j.js} +3 -3
- package/dist/cli/{knowledge-store-xtt4sede.js → knowledge-store-xzmvfnx3.js} +4 -4
- package/dist/cli/{knowledge-validator-h1k7ymtd.js → knowledge-validator-5q1amsq6.js} +7 -7
- package/dist/cli/{pending-delegations-4z3tkkct.js → pending-delegations-mt5gs1bt.js} +3 -3
- package/dist/cli/{pr-subscriptions-29j794kd.js → pr-subscriptions-v5xd3j6d.js} +3 -3
- package/dist/cli/{scan-cursor-stztfv7d.js → scan-cursor-1q1zmt4b.js} +5 -5
- package/dist/cli/{schema-tbq2srrh.js → schema-8mtsfspm.js} +1 -1
- package/dist/cli/{scope-persistence-7wydjzx8.js → scope-persistence-h2fpgxww.js} +2 -2
- package/dist/cli/{skill-generator-02q1qdf0.js → skill-generator-54xbjgak.js} +8 -8
- package/dist/cli/{workspace-snapshot-9h5za0s6.js → workspace-snapshot-jmyamqnv.js} +6 -1
- package/dist/cli/{worktree-collision-ownership-dtwr0xj4.js → worktree-collision-ownership-15hymf1y.js} +5 -5
- package/dist/commands/registry.d.ts +1 -1
- package/dist/hooks/pr-workflow-gate.d.ts +30 -4
- package/dist/hooks/repo-graph-builder.d.ts +18 -0
- package/dist/hooks/scope-guard.d.ts +11 -4
- package/dist/index.js +395 -391
- package/dist/scope/scope-binding.d.ts +68 -0
- package/dist/session/snapshot-reader.d.ts +6 -0
- package/dist/state.d.ts +118 -0
- package/dist/tools/convene-council.d.ts +3 -3
- package/dist/tools/dispatch-lanes.d.ts +65 -7
- package/dist/tools/repo-graph/builder.d.ts +20 -2
- package/dist/tools/repo-graph/incremental.d.ts +18 -1
- package/dist/tools/repo-graph/ontology.d.ts +8 -0
- package/dist/tools/repo-graph/types.d.ts +62 -1
- package/dist/tools/repo-graph.d.ts +1 -1
- package/dist/tools/submit-phase-council-verdicts.d.ts +3 -3
- package/dist/tools/write-final-council-evidence.d.ts +3 -3
- package/dist/tools/write-pr-review-trigger-eval.d.ts +34 -63
- package/dist/turbo/lean/lane-scope.d.ts +120 -0
- package/dist/turbo/lean/runner.d.ts +66 -4
- package/package.json +1 -1
- package/dist/cli/guardrail-explain-zmbxwh3s.js +0 -57
|
@@ -1,79 +1,51 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { resolveExactMergeBase, resolvePrWorkflowRevisionDigest } from '../background/workspace-snapshot.js';
|
|
3
3
|
import { createSwarmTool } from './create-tool';
|
|
4
|
+
export { PR_REVIEW_TRIGGER_DEFINITIONS } from '../background/pr-review-trigger-contract.js';
|
|
4
5
|
export declare const _internals: {
|
|
5
6
|
resolvePrWorkflowRevisionDigest: typeof resolvePrWorkflowRevisionDigest;
|
|
6
7
|
resolveMergeBase: typeof resolveExactMergeBase;
|
|
7
8
|
};
|
|
8
|
-
/** Canonical trigger IDs and display values shared with the PR-review protocol. */
|
|
9
|
-
export declare const PR_REVIEW_TRIGGER_DEFINITIONS: readonly [{
|
|
10
|
-
readonly id: "auth-identity-secrets";
|
|
11
|
-
readonly scope: "universal";
|
|
12
|
-
readonly trigger_row: "authentication, authorization, identity, sessions, permissions, secrets, cryptography";
|
|
13
|
-
readonly micro_lane: "Identity and secret boundaries";
|
|
14
|
-
}, {
|
|
15
|
-
readonly id: "untrusted-input-boundaries";
|
|
16
|
-
readonly scope: "universal";
|
|
17
|
-
readonly trigger_row: "parsing, serialization, queries, templates/rendering, file or network input/output";
|
|
18
|
-
readonly micro_lane: "Untrusted input and sink analysis";
|
|
19
|
-
}, {
|
|
20
|
-
readonly id: "subprocess-platform";
|
|
21
|
-
readonly scope: "universal";
|
|
22
|
-
readonly trigger_row: "subprocesses, shell commands, filesystem operations, OS/runtime-specific code";
|
|
23
|
-
readonly micro_lane: "Subprocess and platform safety";
|
|
24
|
-
}, {
|
|
25
|
-
readonly id: "concurrency-state";
|
|
26
|
-
readonly scope: "universal";
|
|
27
|
-
readonly trigger_row: "queues, caches, retries, transactions, locks, state machines, async coordination";
|
|
28
|
-
readonly micro_lane: "Concurrency and state transitions";
|
|
29
|
-
}, {
|
|
30
|
-
readonly id: "dependencies-build-release";
|
|
31
|
-
readonly scope: "universal";
|
|
32
|
-
readonly trigger_row: "dependency manifests, lockfiles, installers, build scripts, CI, packaging, deployment";
|
|
33
|
-
readonly micro_lane: "Dependency and delivery integrity";
|
|
34
|
-
}, {
|
|
35
|
-
readonly id: "api-schema-migrations";
|
|
36
|
-
readonly scope: "universal";
|
|
37
|
-
readonly trigger_row: "public API, wire/schema/config/storage formats, migrations, feature flags";
|
|
38
|
-
readonly micro_lane: "Compatibility and migration safety";
|
|
39
|
-
}, {
|
|
40
|
-
readonly id: "test-infrastructure";
|
|
41
|
-
readonly scope: "universal";
|
|
42
|
-
readonly trigger_row: "tests, mocks, fixtures, harnesses, coverage, CI matrices";
|
|
43
|
-
readonly micro_lane: "Test validity and isolation";
|
|
44
|
-
}, {
|
|
45
|
-
readonly id: "ui-accessibility-i18n";
|
|
46
|
-
readonly scope: "universal";
|
|
47
|
-
readonly trigger_row: "user interfaces, interaction flows, rendering, accessibility, localization";
|
|
48
|
-
readonly micro_lane: "UI and human-interface quality";
|
|
49
|
-
}, {
|
|
50
|
-
readonly id: "privacy-observability";
|
|
51
|
-
readonly scope: "universal";
|
|
52
|
-
readonly trigger_row: "telemetry, logs, analytics, traces, retention, diagnostics";
|
|
53
|
-
readonly micro_lane: "Privacy and observability safety";
|
|
54
|
-
}, {
|
|
55
|
-
readonly id: "generated-provenance";
|
|
56
|
-
readonly scope: "universal";
|
|
57
|
-
readonly trigger_row: "generated, vendored, binary, model-produced, codegen or checked-in build artifacts";
|
|
58
|
-
readonly micro_lane: "Generated artifact provenance";
|
|
59
|
-
}, {
|
|
60
|
-
readonly id: "unclassified-risk";
|
|
61
|
-
readonly scope: "universal";
|
|
62
|
-
readonly trigger_row: "any changed artifact or behavior not confidently classified by the rows above";
|
|
63
|
-
readonly micro_lane: "Unclassified high-risk fallback";
|
|
64
|
-
}];
|
|
65
9
|
declare const WritePrReviewTriggerEvalArgsSchema: z.ZodObject<{
|
|
66
10
|
run_id: z.ZodString;
|
|
67
11
|
pr_head_sha: z.ZodString;
|
|
68
12
|
base_sha: z.ZodOptional<z.ZodString>;
|
|
69
13
|
base_ref: z.ZodOptional<z.ZodString>;
|
|
70
|
-
rows: z.ZodArray<z.ZodObject<{
|
|
71
|
-
trigger_id: z.
|
|
14
|
+
rows: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
15
|
+
trigger_id: z.ZodEnum<{
|
|
16
|
+
"auth-identity-secrets": "auth-identity-secrets";
|
|
17
|
+
"untrusted-input-boundaries": "untrusted-input-boundaries";
|
|
18
|
+
"subprocess-platform": "subprocess-platform";
|
|
19
|
+
"concurrency-state": "concurrency-state";
|
|
20
|
+
"dependencies-build-release": "dependencies-build-release";
|
|
21
|
+
"api-schema-migrations": "api-schema-migrations";
|
|
22
|
+
"test-infrastructure": "test-infrastructure";
|
|
23
|
+
"ui-accessibility-i18n": "ui-accessibility-i18n";
|
|
24
|
+
"privacy-observability": "privacy-observability";
|
|
25
|
+
"generated-provenance": "generated-provenance";
|
|
26
|
+
"unclassified-risk": "unclassified-risk";
|
|
27
|
+
}>;
|
|
72
28
|
result: z.ZodLiteral<"MATCHED">;
|
|
73
29
|
evidence: z.ZodString;
|
|
74
|
-
source_batch_id: z.
|
|
75
|
-
source_lane_id: z.
|
|
76
|
-
}, z.core.$strict
|
|
30
|
+
source_batch_id: z.ZodString;
|
|
31
|
+
source_lane_id: z.ZodString;
|
|
32
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
33
|
+
trigger_id: z.ZodEnum<{
|
|
34
|
+
"auth-identity-secrets": "auth-identity-secrets";
|
|
35
|
+
"untrusted-input-boundaries": "untrusted-input-boundaries";
|
|
36
|
+
"subprocess-platform": "subprocess-platform";
|
|
37
|
+
"concurrency-state": "concurrency-state";
|
|
38
|
+
"dependencies-build-release": "dependencies-build-release";
|
|
39
|
+
"api-schema-migrations": "api-schema-migrations";
|
|
40
|
+
"test-infrastructure": "test-infrastructure";
|
|
41
|
+
"ui-accessibility-i18n": "ui-accessibility-i18n";
|
|
42
|
+
"privacy-observability": "privacy-observability";
|
|
43
|
+
"generated-provenance": "generated-provenance";
|
|
44
|
+
"unclassified-risk": "unclassified-risk";
|
|
45
|
+
}>;
|
|
46
|
+
result: z.ZodLiteral<"NOT_TRIGGERED">;
|
|
47
|
+
evidence: z.ZodString;
|
|
48
|
+
}, z.core.$strict>], "result">>;
|
|
77
49
|
}, z.core.$strict>;
|
|
78
50
|
export type WritePrReviewTriggerEvalArgs = z.infer<typeof WritePrReviewTriggerEvalArgsSchema>;
|
|
79
51
|
/** Validate and atomically persist the complete PR-review trigger evaluation. */
|
|
@@ -81,4 +53,3 @@ export declare function executeWritePrReviewTriggerEval(args: unknown, directory
|
|
|
81
53
|
sessionID?: string;
|
|
82
54
|
}): Promise<string>;
|
|
83
55
|
export declare const write_pr_review_trigger_eval: ReturnType<typeof createSwarmTool>;
|
|
84
|
-
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lean Turbo lane write authority (issue #2002 — Lean Turbo half).
|
|
3
|
+
*
|
|
4
|
+
* ## The defect this closes
|
|
5
|
+
*
|
|
6
|
+
* A Lean Turbo lane creates a coder session rooted at the lane worktree and
|
|
7
|
+
* dispatches it with `tools: { write: true, edit: true, patch: true }`
|
|
8
|
+
* (`src/turbo/lean/runner.ts`), but nothing ever published a v2 scope binding
|
|
9
|
+
* for that session and nothing ever materialized the authoritative plan into
|
|
10
|
+
* the lane. `resolveAuthorizedScopeBinding` starts from
|
|
11
|
+
* `readCurrentPlan(directory)` (`src/scope/scope-persistence.ts`), so with no
|
|
12
|
+
* `.swarm/plan.json` in the lane it returned null before it even looked at a
|
|
13
|
+
* binding — and every lane coder write failed `SCOPE_NOT_DECLARED` regardless
|
|
14
|
+
* of which directory the gate resolved.
|
|
15
|
+
*
|
|
16
|
+
* This module publishes that authority using the same primitives as the
|
|
17
|
+
* standard worktree path (`src/hooks/delegation-gate.ts`, the
|
|
18
|
+
* `savePlan` → `deriveChildScopeBinding` → register + `writeScopeBindingToDisk`
|
|
19
|
+
* sequence), so every identity condition in
|
|
20
|
+
* `getAuthorizedScopeBindingByPlanIdentity` is satisfied without weakening or
|
|
21
|
+
* bypassing any of them.
|
|
22
|
+
*
|
|
23
|
+
* ## Authority boundary
|
|
24
|
+
*
|
|
25
|
+
* A lane binding authorizes exactly the intersection of
|
|
26
|
+
* 1. `lane.files` — the file set the lane already holds exclusive locks on
|
|
27
|
+
* (`acquireLaneLocks(directory, laneId, lane.files, agent, lane.taskIds[0], …)`
|
|
28
|
+
* in `src/turbo/lean/runner.ts`), and
|
|
29
|
+
* 2. the authoritative plan's `files_touched` for the lane's own tasks.
|
|
30
|
+
*
|
|
31
|
+
* It therefore grants nothing the lane's pre-existing file locks did not
|
|
32
|
+
* already reserve for this dispatch, and nothing the plan does not attribute to
|
|
33
|
+
* this lane's tasks. It is rooted at the lane worktree, owned by the lane's
|
|
34
|
+
* child session id, and correlated to a single synthetic dispatch id — so it
|
|
35
|
+
* can never authorize a write in another lane or in the project root.
|
|
36
|
+
*
|
|
37
|
+
* ## Known gap (deliberate, not a bypass)
|
|
38
|
+
*
|
|
39
|
+
* A lane may carry several task ids (`src/turbo/lean/planner.ts` assigns every
|
|
40
|
+
* non-conflicting ready task to the first non-conflicting lane). The scope
|
|
41
|
+
* gates resolve a binding by a single `session.currentTaskId`, so a lane gets
|
|
42
|
+
* ONE binding labelled with the lane's representative task id
|
|
43
|
+
* (`lane.taskIds[0]`, the same representative the lock layer already uses) and
|
|
44
|
+
* carrying the lane's whole plan-backed authority. This mirrors the lock
|
|
45
|
+
* record 1:1; it does not widen the lane past what the lock already reserved.
|
|
46
|
+
*
|
|
47
|
+
* ## Fail-closed contract
|
|
48
|
+
*
|
|
49
|
+
* When a lane has no representative task id in strict `N.M[.P]` form, no
|
|
50
|
+
* plan-backed files, or an unusable child identity, this module publishes
|
|
51
|
+
* NOTHING and returns null. The lane coder then hits the ordinary
|
|
52
|
+
* `SCOPE_NOT_DECLARED` block — byte-identical to pre-fix behaviour. There is no
|
|
53
|
+
* path here that grants a lane coder write authority without a validated,
|
|
54
|
+
* plan-correlated, lane-rooted binding.
|
|
55
|
+
*/
|
|
56
|
+
import type { Plan } from '../../config/plan-schema';
|
|
57
|
+
import { type ScopeBinding } from '../../scope/scope-binding';
|
|
58
|
+
/**
|
|
59
|
+
* Namespace for the synthetic dispatch-call id that correlates a lane's child
|
|
60
|
+
* binding to its parent Lean Turbo run. Lean Turbo dispatches through the
|
|
61
|
+
* OpenCode session API rather than the Task tool, so there is no upstream
|
|
62
|
+
* `callID`. The prefix keeps these ids disjoint from real Task call ids so a
|
|
63
|
+
* lane binding can never be claimed by a Task-dispatch lookup.
|
|
64
|
+
*/
|
|
65
|
+
export declare const LEAN_TURBO_LANE_DISPATCH_PREFIX = "lean-turbo-lane";
|
|
66
|
+
/** Minimal lane shape this module needs. Matches `LeanTurboLane`. */
|
|
67
|
+
export interface LeanTurboLaneScopeLane {
|
|
68
|
+
laneId: string;
|
|
69
|
+
taskIds: readonly string[];
|
|
70
|
+
files: readonly string[];
|
|
71
|
+
}
|
|
72
|
+
export interface PublishLeanTurboLaneScopeInput {
|
|
73
|
+
/** Project root the Lean Turbo run was started in. */
|
|
74
|
+
primaryDirectory: string;
|
|
75
|
+
/** Root the lane's coder session actually executes in. */
|
|
76
|
+
laneRoot: string;
|
|
77
|
+
/**
|
|
78
|
+
* True only when `laneRoot` is `provisionWorktree`'s own output. Never
|
|
79
|
+
* derive this from a path comparison and never from an agent-supplied
|
|
80
|
+
* value: it gates both the lane plan materialization and the workspace-root
|
|
81
|
+
* recording, which are the two writes that must follow provisioning
|
|
82
|
+
* authority only.
|
|
83
|
+
*/
|
|
84
|
+
isolated: boolean;
|
|
85
|
+
/** Authoritative plan for this run (already loaded from the project root). */
|
|
86
|
+
plan: Plan;
|
|
87
|
+
lane: LeanTurboLaneScopeLane;
|
|
88
|
+
/** Session running the Lean Turbo phase (the architect). */
|
|
89
|
+
parentSessionId: string;
|
|
90
|
+
/** Session id returned by `session.create` for this lane. */
|
|
91
|
+
childSessionId: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Resolve the file set a lane may be authorized for: lane-locked files that the
|
|
95
|
+
* authoritative plan also attributes to one of the lane's own tasks.
|
|
96
|
+
*
|
|
97
|
+
* Returns null when the plan attributes no usable file to this lane's tasks or
|
|
98
|
+
* when no locked lane file falls inside that plan authority — both are
|
|
99
|
+
* fail-closed outcomes, never a widening fallback.
|
|
100
|
+
*/
|
|
101
|
+
export declare function resolveLeanTurboLaneAuthorityFiles(plan: Plan, lane: LeanTurboLaneScopeLane): string[] | null;
|
|
102
|
+
/**
|
|
103
|
+
* Publish one Lean Turbo lane's write authority.
|
|
104
|
+
*
|
|
105
|
+
* Ordering is deliberate:
|
|
106
|
+
* 1. validate identity and resolve plan-backed authority (cheap, no writes) —
|
|
107
|
+
* a failure here publishes nothing at all;
|
|
108
|
+
* 2. materialize the authoritative plan into the lane (isolated lanes only,
|
|
109
|
+
* so concurrent lanes never re-write the project's own plan ledger);
|
|
110
|
+
* 3. derive the active child binding, register it, and persist it under the
|
|
111
|
+
* lane root;
|
|
112
|
+
* 4. bind the child session to the lane root so the write gates resolve
|
|
113
|
+
* against the lane instead of the plugin-root `ctx.directory`.
|
|
114
|
+
*
|
|
115
|
+
* @returns the published child binding, or null when the lane cannot be
|
|
116
|
+
* authorized (fail closed — the caller must NOT grant any substitute).
|
|
117
|
+
* @throws only on unexpected I/O failure (e.g. `savePlan` rejecting). The
|
|
118
|
+
* caller treats a throw as a hard dispatch failure.
|
|
119
|
+
*/
|
|
120
|
+
export declare function publishLeanTurboLaneScopeBinding(input: PublishLeanTurboLaneScopeInput): Promise<ScopeBinding | null>;
|
|
@@ -16,13 +16,15 @@
|
|
|
16
16
|
* - If dispatch fails, locks for that lane are released and lane is marked 'failed'
|
|
17
17
|
*/
|
|
18
18
|
import type { OpencodeClient } from '@opencode-ai/sdk';
|
|
19
|
+
import type { Plan } from '../../config/plan-schema';
|
|
19
20
|
import type { LeanTurboConfig } from '../../config/schema';
|
|
20
21
|
import { loadFullAutoRunState } from '../../full-auto/state';
|
|
21
22
|
import { acquireLaneLocks, releaseLaneLocks } from '../../parallel/file-locks';
|
|
22
23
|
import { loadPlanJsonOnly } from '../../plan/manager';
|
|
23
|
-
import {
|
|
24
|
+
import { hasActiveFullAuto } from '../../state';
|
|
24
25
|
import { type ModelOverride } from '../../utils/model-dispatch-fallback';
|
|
25
26
|
import { writeLaneEvidence, writePhaseEvidence } from './evidence';
|
|
27
|
+
import { publishLeanTurboLaneScopeBinding } from './lane-scope';
|
|
26
28
|
import { attemptMergeBackFromDirty, getMergeStrategy, mergeLaneBranch, postMergeCleanup, startupOrphanRecovery } from './merge-back';
|
|
27
29
|
import { planLeanTurboLanes } from './planner';
|
|
28
30
|
import type { LeanTurboDegradedTask, LeanTurboLane } from './state';
|
|
@@ -167,6 +169,32 @@ export interface LeanTurboPhaseResult {
|
|
|
167
169
|
/** Lanes whose coder completed but merge-back to primary branch failed */
|
|
168
170
|
mergeBackFailures?: MergeBackFailureInfo[];
|
|
169
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
* Orchestrates Lean Turbo lane execution.
|
|
174
|
+
*
|
|
175
|
+
* ## Usage
|
|
176
|
+
*
|
|
177
|
+
* ```ts
|
|
178
|
+
* const runner = new LeanTurboRunner({
|
|
179
|
+
* directory: projectRoot,
|
|
180
|
+
* sessionID: 'sess-abc123',
|
|
181
|
+
* opencodeClient: swarmState.opencodeClient,
|
|
182
|
+
* generatedAgentNames: swarmState.generatedAgentNames,
|
|
183
|
+
* });
|
|
184
|
+
*
|
|
185
|
+
* const result = await runner.runPhase(1);
|
|
186
|
+
* // ... monitor lanes ...
|
|
187
|
+
* await runner.cleanup();
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
/**
|
|
191
|
+
* Error code returned when a lane's write authority could not be published
|
|
192
|
+
* (issue #2002). Deliberately free of any token matched by
|
|
193
|
+
* `TRANSIENT_MODEL_ERROR_PATTERN` / `QUOTA_ERROR_PATTERN`, and classified
|
|
194
|
+
* `permanent` explicitly in `_processLane` so a broken authority handshake can
|
|
195
|
+
* never be mistaken for a provider blip and retried across fallback models.
|
|
196
|
+
*/
|
|
197
|
+
export declare const LANE_SCOPE_DENIED_CODE = "LEAN_TURBO_LANE_SCOPE_DENIED";
|
|
170
198
|
export declare class LeanTurboRunner {
|
|
171
199
|
/**
|
|
172
200
|
* Test-only dependency-injection seam.
|
|
@@ -195,8 +223,11 @@ export declare class LeanTurboRunner {
|
|
|
195
223
|
startupOrphanRecovery: typeof startupOrphanRecovery;
|
|
196
224
|
getMergeStrategy: typeof getMergeStrategy;
|
|
197
225
|
assertCleanWorkingTree: typeof assertCleanWorkingTree;
|
|
198
|
-
/**
|
|
199
|
-
|
|
226
|
+
/**
|
|
227
|
+
* Issue #2002: publishes a lane's plan-correlated, lane-rooted write
|
|
228
|
+
* authority before the lane's coder prompt is sent.
|
|
229
|
+
*/
|
|
230
|
+
publishLeanTurboLaneScopeBinding: typeof publishLeanTurboLaneScopeBinding;
|
|
200
231
|
};
|
|
201
232
|
/**
|
|
202
233
|
* Test-only dependency-injection seam for session operations.
|
|
@@ -269,12 +300,43 @@ export declare class LeanTurboRunner {
|
|
|
269
300
|
*
|
|
270
301
|
* @param lane - Lane to dispatch
|
|
271
302
|
* @param agentName - Agent name to dispatch to
|
|
303
|
+
* @param worktreeDirectory - Provisioned lane worktree, when isolation is on
|
|
304
|
+
* @param model - Per-call model override for a fallback attempt (#1896)
|
|
305
|
+
* @param plan - Authoritative plan for this run. Required to publish the
|
|
306
|
+
* lane's write authority (issue #2002). When omitted, no binding is
|
|
307
|
+
* minted AND the lane's `write`/`edit`/`patch` tools are force-disabled
|
|
308
|
+
* (see `_doDispatch`) — an unscoped lane can never be dispatched
|
|
309
|
+
* writable, regardless of caller. Only `_processLane` supplies a plan in
|
|
310
|
+
* production (always, per `runPhase`'s own `NO_PLAN` guard); direct
|
|
311
|
+
* callers that omit it get a read-only lane rather than a silent
|
|
312
|
+
* unscoped-but-writable one.
|
|
272
313
|
*/
|
|
273
|
-
dispatchLane(lane: LeanTurboLane, agentName: string, worktreeDirectory?: string, model?: ModelOverride): Promise<LaneDispatchResult>;
|
|
314
|
+
dispatchLane(lane: LeanTurboLane, agentName: string, worktreeDirectory?: string, model?: ModelOverride, plan?: Plan): Promise<LaneDispatchResult>;
|
|
274
315
|
/**
|
|
275
316
|
* Internal dispatch implementation (separated for timeout wrapping).
|
|
276
317
|
*/
|
|
277
318
|
private _doDispatch;
|
|
319
|
+
/**
|
|
320
|
+
* Publish the lane's write authority for a freshly created lane session
|
|
321
|
+
* (issue #2002 — Lean Turbo half).
|
|
322
|
+
*
|
|
323
|
+
* Two distinct fail-closed outcomes, deliberately kept apart:
|
|
324
|
+
*
|
|
325
|
+
* - **No authorizable lane** (`publishLeanTurboLaneScopeBinding` returns
|
|
326
|
+
* null: representative task id not in strict `N.M[.P]` form, no
|
|
327
|
+
* plan-backed files, unusable child identity). Nothing is published and
|
|
328
|
+
* the lane still runs — the coder is blocked by the ordinary
|
|
329
|
+
* `SCOPE_NOT_DECLARED` gate exactly as it was before this fix. An
|
|
330
|
+
* architect advisory makes the unscoped lane visible instead of silent.
|
|
331
|
+
* - **Publication failed unexpectedly** (I/O error, plan materialization
|
|
332
|
+
* rejected). That is not a pre-existing state, so the lane session is
|
|
333
|
+
* torn down and the dispatch fails permanently rather than running a
|
|
334
|
+
* coder whose authority is in an unknown state.
|
|
335
|
+
*
|
|
336
|
+
* @returns a failing `LaneDispatchResult` to abort the dispatch, or null to
|
|
337
|
+
* continue.
|
|
338
|
+
*/
|
|
339
|
+
private _publishLaneScope;
|
|
278
340
|
/**
|
|
279
341
|
* Get current status of all lanes tracked by this runner.
|
|
280
342
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.135.
|
|
3
|
+
"version": "7.135.2",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
handleGuardrailExplain
|
|
4
|
-
} from "./index-6kmmdtdp.js";
|
|
5
|
-
import"./index-crw4n55v.js";
|
|
6
|
-
import"./index-13xxjfhn.js";
|
|
7
|
-
import"./index-grxkbbc5.js";
|
|
8
|
-
import"./index-ctvnb76s.js";
|
|
9
|
-
import"./index-ens0gt38.js";
|
|
10
|
-
import"./index-4905hd2m.js";
|
|
11
|
-
import"./index-134d35c1.js";
|
|
12
|
-
import"./index-a4972t0f.js";
|
|
13
|
-
import"./index-86wdrskb.js";
|
|
14
|
-
import"./index-vf6e8ame.js";
|
|
15
|
-
import"./index-vxv732ex.js";
|
|
16
|
-
import"./index-c8s9a3zh.js";
|
|
17
|
-
import"./index-9ss2m4rs.js";
|
|
18
|
-
import"./index-b7p0mp2q.js";
|
|
19
|
-
import"./index-z085b4ka.js";
|
|
20
|
-
import"./index-997d6p42.js";
|
|
21
|
-
import"./index-g0raqavt.js";
|
|
22
|
-
import"./index-rtry5xyf.js";
|
|
23
|
-
import"./index-nrvs08pr.js";
|
|
24
|
-
import"./index-x88w0cp5.js";
|
|
25
|
-
import"./index-ae75rja9.js";
|
|
26
|
-
import"./index-yhba8swx.js";
|
|
27
|
-
import"./index-xg9repnx.js";
|
|
28
|
-
import"./index-e8w62fgs.js";
|
|
29
|
-
import"./index-k5jrywpr.js";
|
|
30
|
-
import"./index-n832052r.js";
|
|
31
|
-
import"./index-337r9pkr.js";
|
|
32
|
-
import"./index-bk5tah7q.js";
|
|
33
|
-
import"./index-8fwhhayc.js";
|
|
34
|
-
import"./index-q1exe2b3.js";
|
|
35
|
-
import"./index-ny93srnd.js";
|
|
36
|
-
import"./index-wxyxf0bd.js";
|
|
37
|
-
import"./index-1kz6da87.js";
|
|
38
|
-
import"./index-b4z7s917.js";
|
|
39
|
-
import"./index-b8zgtz81.js";
|
|
40
|
-
import"./index-44zgqvqh.js";
|
|
41
|
-
import"./index-4rhhvd1a.js";
|
|
42
|
-
import"./index-7an2qn0s.js";
|
|
43
|
-
import"./index-2ghkk9ve.js";
|
|
44
|
-
import"./index-fsrp8wp3.js";
|
|
45
|
-
import"./index-09b9zncg.js";
|
|
46
|
-
import"./index-7g4c7s5r.js";
|
|
47
|
-
import"./index-7a2hm51h.js";
|
|
48
|
-
import"./index-bpmtbmy9.js";
|
|
49
|
-
import"./index-z6xqpmqg.js";
|
|
50
|
-
import"./index-zjygnfay.js";
|
|
51
|
-
import"./index-qe3v54nb.js";
|
|
52
|
-
import"./index-zgwm4ryv.js";
|
|
53
|
-
import"./index-3nasn371.js";
|
|
54
|
-
import"./index-a76rekgs.js";
|
|
55
|
-
export {
|
|
56
|
-
handleGuardrailExplain
|
|
57
|
-
};
|