opencode-swarm 6.46.0 → 6.47.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/cli/index.js +450 -285
- package/dist/commands/close.d.ts +1 -1
- package/dist/commands/sync-plan.d.ts +3 -1
- package/dist/index.js +744 -578
- package/dist/plan/ledger.d.ts +2 -2
- package/dist/plan/manager.d.ts +12 -0
- package/dist/plan/manager.loadplan-validation-guard.test.d.ts +13 -0
- package/dist/plan/migration-revert.regression.test.d.ts +8 -0
- package/package.json +1 -1
package/dist/plan/ledger.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides durable, immutable audit trail of plan evolution events.
|
|
5
5
|
* Each event is written as a JSON line to .swarm/plan-ledger.jsonl
|
|
6
6
|
*/
|
|
7
|
-
import type
|
|
7
|
+
import { type Plan } from '../config/plan-schema';
|
|
8
8
|
/**
|
|
9
9
|
* Ledger schema version
|
|
10
10
|
*/
|
|
@@ -108,7 +108,7 @@ export declare function readLedgerEvents(directory: string): Promise<LedgerEvent
|
|
|
108
108
|
* @param directory - The working directory
|
|
109
109
|
* @param planId - Unique identifier for the plan
|
|
110
110
|
*/
|
|
111
|
-
export declare function initLedger(directory: string, planId: string): Promise<void>;
|
|
111
|
+
export declare function initLedger(directory: string, planId: string, initialPlanHash?: string): Promise<void>;
|
|
112
112
|
/**
|
|
113
113
|
* Append a new event to the ledger.
|
|
114
114
|
* Uses atomic write: write to temp file then rename.
|
package/dist/plan/manager.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ import { type Plan, type TaskStatus } from '../config/plan-schema';
|
|
|
5
5
|
* Use this when you want to check for structured plans without triggering migration.
|
|
6
6
|
*/
|
|
7
7
|
export declare function loadPlanJsonOnly(directory: string): Promise<Plan | null>;
|
|
8
|
+
/**
|
|
9
|
+
* Regenerate plan.md from valid plan.json (auto-heal case 1).
|
|
10
|
+
*/
|
|
11
|
+
export declare function regeneratePlanMarkdown(directory: string, plan: Plan): Promise<void>;
|
|
8
12
|
/**
|
|
9
13
|
* Load and validate plan from .swarm/plan.json with auto-heal sync.
|
|
10
14
|
*
|
|
@@ -38,6 +42,14 @@ export declare function rebuildPlan(directory: string, plan?: Plan): Promise<Pla
|
|
|
38
42
|
/**
|
|
39
43
|
* Load plan → find task by ID → update status → save → return updated plan.
|
|
40
44
|
* Throw if plan not found or task not found.
|
|
45
|
+
*
|
|
46
|
+
* Uses loadPlan() (not loadPlanJsonOnly) so that legitimate same-identity ledger
|
|
47
|
+
* drift is detected and healed before the status update is applied. Without this,
|
|
48
|
+
* a stale plan.json would silently overwrite ledger-ahead task state with only the
|
|
49
|
+
* one targeted status change applied on top.
|
|
50
|
+
*
|
|
51
|
+
* The migration guard in loadPlan() (plan_id identity check) prevents destructive
|
|
52
|
+
* revert after a swarm rename — so this is safe even in post-migration scenarios.
|
|
41
53
|
*/
|
|
42
54
|
export declare function updateTaskStatus(directory: string, taskId: string, status: TaskStatus): Promise<Plan>;
|
|
43
55
|
/**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for the migration-aware identity guard in loadPlan()'s validation-failure
|
|
3
|
+
* catch path (lines ~299-323 of manager.ts).
|
|
4
|
+
*
|
|
5
|
+
* When plan.json fails schema validation, the old code unconditionally called
|
|
6
|
+
* replayFromLedger(). This allowed a post-migration ledger (old identity) to
|
|
7
|
+
* overwrite a schema-invalid but correctly migrated plan.json.
|
|
8
|
+
*
|
|
9
|
+
* The fix: extract swarm+title from the raw JSON (even if schema validation
|
|
10
|
+
* fails), compare against the first ledger event's plan_id, and only replay
|
|
11
|
+
* when identities match.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Regression tests for GitHub issues #383/#384:
|
|
3
|
+
* PlanSyncWorker Aggressively Reverts Plan Files
|
|
4
|
+
*
|
|
5
|
+
* These tests verify that the fixes introduced in the debug-issues-383-384 branch
|
|
6
|
+
* prevent the destructive revert behavior and related edge cases.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.47.1",
|
|
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",
|