sortie-dogs 0.4.7 → 0.5.0

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.
Files changed (35) hide show
  1. package/README.md +23 -22
  2. package/dist/asset-version.d.ts +1 -1
  3. package/dist/asset-version.js +1 -1
  4. package/dist/core/scope-lease-registry.d.ts +53 -0
  5. package/dist/core/scope-lease-registry.js +560 -0
  6. package/dist/core/types.d.ts +208 -1
  7. package/dist/core/validate-schema.d.ts +2 -1
  8. package/dist/core/validate-schema.js +98 -0
  9. package/dist/core/validate-worktree-parallel.d.ts +2 -0
  10. package/dist/core/validate-worktree-parallel.js +139 -0
  11. package/dist/core/worktree-commit-artifact.d.ts +15 -0
  12. package/dist/core/worktree-commit-artifact.js +1076 -0
  13. package/dist/core/worktree-integration-queue.d.ts +57 -0
  14. package/dist/core/worktree-integration-queue.js +956 -0
  15. package/dist/core/worktree-lifecycle.d.ts +86 -0
  16. package/dist/core/worktree-lifecycle.js +983 -0
  17. package/dist/core/worktree-parallel-dispatch.d.ts +61 -0
  18. package/dist/core/worktree-parallel-dispatch.js +1033 -0
  19. package/dist/core/worktree-scope.d.ts +9 -0
  20. package/dist/core/worktree-scope.js +23 -0
  21. package/dist/index.d.ts +12 -0
  22. package/dist/index.js +8 -0
  23. package/dist/plugin/continuation.d.ts +2 -0
  24. package/dist/plugin/continuation.js +33 -12
  25. package/dist/plugin/fast-lane.d.ts +4 -1
  26. package/dist/plugin/fast-lane.js +70 -27
  27. package/dist/plugin/gate.d.ts +8 -0
  28. package/dist/plugin/gate.js +226 -12
  29. package/dist/plugin/index.d.ts +1 -0
  30. package/dist/plugin/index.js +1544 -71
  31. package/dist/plugin/model-routing.d.ts +4 -4
  32. package/dist/plugin/model-routing.js +4 -4
  33. package/dist/runtime-assets.d.ts +8 -8
  34. package/dist/runtime-assets.js +346 -127
  35. package/package.json +5 -3
package/README.md CHANGED
@@ -11,16 +11,16 @@
11
11
 
12
12
  ![Sortie-dogs coordinating a bounded implementation workflow](https://raw.githubusercontent.com/zufall-upon/Sortie-dogs/main/docs/assets/sortie-workflow.gif)
13
13
 
14
- Sortie-dogs is an opt-in OpenCode orchestration plugin. It turns a task into a
15
- scoped plan, parallel investigation, bounded independent implementation, canonical
16
- validation, and evidence-backed completion—while preserving standard OpenCode
17
- agents and settings.
14
+ Sortie-dogs is an opt-in OpenCode orchestration plugin. It turns a task into a
15
+ scoped plan, optional evidence gathering, one bounded implementation unit, canonical
16
+ validation, and evidence-backed completion—while preserving standard OpenCode
17
+ agents and settings.
18
18
 
19
19
  Requirements: Node.js 22.6 or newer, npm, and OpenCode.
20
20
 
21
21
  Guides: [日本語](docs/guide-ja.md) · [简体中文](docs/guide-zh-CN.md) · [CLI testing](docs/cli-testing.md)
22
22
 
23
- Release: [v0.4.7](https://github.com/zufall-upon/Sortie-dogs/releases/tag/v0.4.7)
23
+ Release: [v0.5.0](https://github.com/zufall-upon/Sortie-dogs/releases/tag/v0.5.0)
24
24
 
25
25
  ## Quick start
26
26
 
@@ -62,7 +62,7 @@ to the `plugin` array of the OpenCode configuration the agents run under —
62
62
  Restart OpenCode afterwards. A `plugin` entry must name the package, not a
63
63
  subpath: `sortie-dogs/plugin` is an import specifier, not a plugin specifier.
64
64
 
65
- `dog-coordinator` defaults to `openai/gpt-5.6-terra` with the `medium` variant; `dog-scout` defaults to
65
+ `dog-coordinator` defaults to `openai/gpt-5.6-luna` with the `max` variant; `dog-scout` defaults to
66
66
  `openai/gpt-5.6-luna`. To pin either role to another model, save this
67
67
  as `.opencode/sortie-dogs.json`:
68
68
 
@@ -203,12 +203,14 @@ global file for durable global settings.
203
203
 
204
204
  - **Focused when invited, invisible otherwise.** Activate it with `/sortie` or
205
205
  select `dog-coordinator`; ordinary OpenCode sessions remain unchanged.
206
- - **Parallel context without uncontrolled fan-out.** Every worker handoff uses
207
- exactly three bounded scouts before implementation begins.
206
+ - **Evidence gathering without arbitrary dispatch ceilings.** A bounded scout resolves
207
+ each concrete manifest, validation, or ownership gap whenever it appears; unchanged
208
+ requests are not repeated.
208
209
  - **Writes stay inside the assignment.** Exact source or operation manifests
209
210
  gate edits and handoffs.
210
- - **Safe implementation fan-out.** Independent units may use two or three workers
211
- with non-overlapping write manifests; dependent or same-path work stays on one worker.
211
+ - **Autonomous sequential implementation.** A normal request may use as many sequential
212
+ workers as its accepted scope requires. Concurrent fan-out still needs the explicit
213
+ parallel contract.
212
214
  - **Runtime overlap protection.** Active equal or ancestor write scopes are rejected
213
215
  before mutation, and full validation waits until every parallel unit joins.
214
216
  - **Evidence before completion.** Canonical validation, risk-based review, and
@@ -223,8 +225,8 @@ An illustrative low-risk run stays bounded and reports its gates:
223
225
  ```text
224
226
  You: /sortie Add the requested behavior
225
227
  dog-coordinator: manifest confirmed
226
- dog-scout ×3: investigation complete
227
- dog-worker: implementation complete
228
+ dog-scout: skipped — no concrete evidence gap
229
+ dog-worker: implementation complete
228
230
  validation: npm test — PASS
229
231
  review: skipped — low risk
230
232
  dog-coordinator: completion evidence accepted
@@ -234,8 +236,8 @@ dog-coordinator: completion evidence accepted
234
236
 
235
237
  1. **Brief and plan** — `dog-coordinator` turns the request into acceptance
236
238
  criteria, a write manifest, and validation requirements.
237
- 2. **Exactly three scouts** — bounded, read-only investigation collects
238
- complementary evidence without expanding the write scope.
239
+ 2. **Optional scout** — one bounded, read-only investigation runs only for a
240
+ concrete pre-worker evidence gap.
239
241
  3. **Dedicated worker** — the dedicated worker implements only the approved
240
242
  manifest and also owns scoped remediation or blocker resolution.
241
243
  4. **Canonical validation** — the declared test or build command must produce
@@ -288,13 +290,13 @@ untouched.
288
290
  ## Model routing
289
291
 
290
292
  Default routes split work by required capability and repeated-context cost.
291
- Sortie-dogs keeps retrieval on Luna, coordinator state and routing on Terra,
292
- and independent review on Sol unless the host declares another target.
293
+ Sortie-dogs keeps retrieval and coordinator routing on Luna, and independent
294
+ review on Sol unless the host declares another target.
293
295
 
294
- `dog-coordinator` defaults to `openai/gpt-5.6-terra` with the `medium` variant. Coordinator work repeatedly
295
- processes the root context but is primarily state management and routing, so
296
- Terra is the cost-conscious middle tier between Luna and Sol. Project or global
297
- `modelRouting` can override this default. If the host proves Terra unavailable,
296
+ `dog-coordinator` defaults to `openai/gpt-5.6-luna` with the `max` variant. Coordinator work repeatedly
297
+ processes the root context, so Luna Max keeps deliberation high without paying
298
+ Terra rates for every cached turn. Project or global `modelRouting` can override
299
+ this default. If the host proves Luna unavailable,
298
300
  the existing availability policy uses a configured free-tier fallback when present
299
301
  and otherwise preserves the session model.
300
302
 
@@ -332,7 +334,7 @@ actually serve.
332
334
  {
333
335
  "modelRouting": {
334
336
  "dog-coordinator": {
335
- "preferred": { "model": "openai/gpt-5.6-terra", "variant": "medium" }
337
+ "preferred": { "model": "openai/gpt-5.6-luna", "variant": "max" }
336
338
  },
337
339
  "dog-scout": {
338
340
  "preferred": { "model": "openai/gpt-5.6-luna", "variant": "high" }
@@ -347,7 +349,6 @@ actually serve.
347
349
  },
348
350
  "modelCatalog": {
349
351
  "project": [
350
- { "model": "openai/gpt-5.6-terra", "variants": ["medium"] },
351
352
  { "model": "openai/gpt-5.6-sol", "variants": ["medium", "xhigh"] },
352
353
  { "model": "openai/gpt-5.6-luna", "variants": ["max", "high"] },
353
354
  { "model": "anthropic/claude-opus-5" }
@@ -2,5 +2,5 @@
2
2
  * Version of the installable runtime assets. Kept in its own module so the plugin can compare an
3
3
  * installed project marker without importing every asset body.
4
4
  */
5
- export declare const RUNTIME_ASSET_VERSION = "0.3.11-worker-resume-v1";
5
+ export declare const RUNTIME_ASSET_VERSION = "0.3.32-terminal-outcome-v1";
6
6
  export type RuntimeAssetVersion = typeof RUNTIME_ASSET_VERSION;
@@ -2,4 +2,4 @@
2
2
  * Version of the installable runtime assets. Kept in its own module so the plugin can compare an
3
3
  * installed project marker without importing every asset body.
4
4
  */
5
- export const RUNTIME_ASSET_VERSION = "0.3.11-worker-resume-v1";
5
+ export const RUNTIME_ASSET_VERSION = "0.3.32-terminal-outcome-v1";
@@ -0,0 +1,53 @@
1
+ import { type WorktreeScope } from "./worktree-scope.js";
2
+ export type ScopeLeaseErrorCode = "scope-conflict" | "not-held" | "corrupt-state" | "invalid-request" | "lock-timeout" | "lock-lost";
3
+ export declare class ScopeLeaseError extends Error {
4
+ readonly code: ScopeLeaseErrorCode;
5
+ constructor(code: ScopeLeaseErrorCode, message: string);
6
+ }
7
+ export type ScopeLeaseAcquireRequest = {
8
+ readonly scope: WorktreeScope;
9
+ readonly ownerId?: string;
10
+ readonly ttlMs?: number;
11
+ };
12
+ export type ScopeLeaseRegistryOptions = {
13
+ readonly ttlMs?: number;
14
+ readonly mutexRetries?: number;
15
+ readonly mutexRetryMs?: number;
16
+ readonly mutexStaleMs?: number;
17
+ };
18
+ export interface ScopeLease {
19
+ readonly id: string;
20
+ readonly ownerId: string;
21
+ readonly scope: WorktreeScope;
22
+ heartbeat(): Promise<void>;
23
+ assertHeld(): Promise<void>;
24
+ release(): Promise<void>;
25
+ abandon(): Promise<void>;
26
+ close(): void;
27
+ }
28
+ export declare class ScopeLeaseRegistry {
29
+ private readonly stateRoot;
30
+ private readonly statePath;
31
+ private readonly lockPath;
32
+ private readonly options;
33
+ constructor(stateRoot: string, options?: ScopeLeaseRegistryOptions);
34
+ static open(stateRoot: string, options?: ScopeLeaseRegistryOptions): ScopeLeaseRegistry;
35
+ acquire(request: ScopeLeaseAcquireRequest): Promise<ScopeLease>;
36
+ private validateRequest;
37
+ private makeLease;
38
+ private load;
39
+ private cleanupTemps;
40
+ private save;
41
+ private sameMutexSnapshot;
42
+ private sameDirectorySnapshot;
43
+ private mutexSnapshot;
44
+ private assertMutexHeld;
45
+ private quarantineSnapshot;
46
+ private sameQuarantineSnapshot;
47
+ private sameMovedQuarantineSnapshot;
48
+ private cleanupQuarantine;
49
+ private hasQuarantine;
50
+ private recoverStaleLock;
51
+ private removeOwnedMutex;
52
+ private withLock;
53
+ }