opencode-swarm 7.187.3 → 7.188.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.
- package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/background/delegation-lifecycle.d.ts +4 -0
- package/dist/cli/{auto-checkpoint-521fehr3.js → auto-checkpoint-hm3qjke6.js} +7 -7
- package/dist/cli/{checkpoint-czx5eken.js → checkpoint-z3eprns8.js} +12 -12
- package/dist/cli/{coder-settlement-skfkfgt7.js → coder-settlement-enhpgjdh.js} +8 -8
- package/dist/cli/{config-doctor-t88fd5ra.js → config-doctor-pfwj6c8d.js} +11 -11
- package/dist/cli/{core-fap9x47g.js → core-r7ypbkzn.js} +1 -1
- package/dist/cli/{curation-policy-e1ce7ha8.js → curation-policy-v64ctcbd.js} +5 -5
- package/dist/cli/{curator-drift-ea11apaw.js → curator-drift-4e9p7afg.js} +5 -5
- package/dist/cli/{curator-llm-factory-758hynyn.js → curator-llm-factory-gnx5wyx0.js} +35 -35
- package/dist/cli/{curator-b7zzsv98.js → curator-m1f5tpmq.js} +35 -35
- package/dist/cli/{doctor-knowledge-receipt-phase-id-5768wb0n.js → doctor-knowledge-receipt-phase-id-mdvra07t.js} +6 -6
- package/dist/cli/{evidence-summary-service-z2yj87tn.js → evidence-summary-service-64nqgkaw.js} +15 -15
- package/dist/cli/{gate-evidence-m90ynftc.js → gate-evidence-22eweae0.js} +5 -5
- package/dist/cli/{guardrail-explain-y2g82gqv.js → guardrail-explain-e6z5x5jt.js} +36 -36
- package/dist/cli/{guardrail-log-c50qd8sf.js → guardrail-log-x53wpnp0.js} +6 -6
- package/dist/cli/{guardrail-reset-h7g9a90e.js → guardrail-reset-zr13a010.js} +35 -35
- package/dist/cli/{hive-promoter-wpcn3wyz.js → hive-promoter-knbj0apv.js} +35 -35
- package/dist/cli/{index-w3xapqjq.js → index-00mqbc83.js} +3 -3
- package/dist/cli/{index-5x8zhfsq.js → index-0dvkbkhg.js} +3 -3
- package/dist/cli/{index-bkcd3nwh.js → index-0v2svrev.js} +1 -1
- package/dist/cli/{index-468s960k.js → index-170k2yeh.js} +1 -1
- package/dist/cli/{index-ez4kkgcd.js → index-1wzsp7ag.js} +3 -3
- package/dist/cli/{index-7t15ybzn.js → index-2bdebshy.js} +3 -3
- package/dist/cli/{index-by488z8m.js → index-41v699sv.js} +3 -3
- package/dist/cli/{index-sec8fwf1.js → index-4htcpbs4.js} +67 -48
- package/dist/cli/{index-zbv9t6p2.js → index-4ws5agzc.js} +6 -6
- package/dist/cli/{index-6551m2st.js → index-64s3825r.js} +2 -2
- package/dist/cli/{index-japwz660.js → index-6j6fmw3r.js} +1 -1
- package/dist/cli/{index-h7p78r0w.js → index-6qef1jtq.js} +4 -4
- package/dist/cli/{index-mdxrk3az.js → index-6zpfvs4t.js} +3 -3
- package/dist/cli/{index-zzgv4jy6.js → index-78ag9dsc.js} +4 -4
- package/dist/cli/{index-xpj149rz.js → index-7sbyvk99.js} +1 -1
- package/dist/cli/{index-4tmk29gc.js → index-7vrnbtsk.js} +1 -1
- package/dist/cli/{index-7fekgghd.js → index-8b0gmpm6.js} +7 -7
- package/dist/cli/{index-h03j41jw.js → index-8tqt8fbf.js} +4 -4
- package/dist/cli/{index-10h0jx4e.js → index-8xzsncfk.js} +4 -4
- package/dist/cli/{index-mh3nsv7v.js → index-9yw1fgpp.js} +2 -2
- package/dist/cli/{index-6rdajskg.js → index-aahk3yq1.js} +138 -102
- package/dist/cli/{index-yk9vs9pw.js → index-af1qsczg.js} +2 -2
- package/dist/cli/{index-hrxr48p5.js → index-b9pz70d0.js} +2 -2
- package/dist/cli/{index-a5pjm9zc.js → index-bd4agttq.js} +2 -2
- package/dist/cli/{index-v8ytrkrg.js → index-dfyjz036.js} +77 -11
- package/dist/cli/{index-ksvm96bz.js → index-ggdwbsc3.js} +1 -1
- package/dist/cli/{index-by7x4ty3.js → index-j5ecgr3f.js} +35 -35
- package/dist/cli/{index-fk7s8btv.js → index-jd3hvnqn.js} +2 -2
- package/dist/cli/{index-45d3vpry.js → index-jj222n0z.js} +1 -1
- package/dist/cli/{index-02nzb100.js → index-k333nq26.js} +2 -2
- package/dist/cli/{index-7ba0hdg4.js → index-mb1reyw3.js} +1 -1
- package/dist/cli/{index-5ktekhxk.js → index-nf22t88g.js} +1 -1
- package/dist/cli/{index-m3dcecc5.js → index-qe3e6z5c.js} +37 -37
- package/dist/cli/{index-nsvm2j4x.js → index-rwabrcsg.js} +1 -1
- package/dist/cli/{index-npkxp81s.js → index-txecan4h.js} +14 -9
- package/dist/cli/{index-wvkbp1qr.js → index-w4309fkk.js} +6 -6
- package/dist/cli/{index-e3vbyy10.js → index-x73e0zkb.js} +1 -1
- package/dist/cli/{index-w9p41945.js → index-xgr0rjhh.js} +1 -1
- package/dist/cli/{index-naxtsh2e.js → index-zwbheerv.js} +4 -4
- package/dist/cli/{index-q0am9gm3.js → index-zwgh0gty.js} +1 -1
- package/dist/cli/index.js +36 -36
- package/dist/cli/{knowledge-escalator-wzsxp6yg.js → knowledge-escalator-w043k3ah.js} +12 -12
- package/dist/cli/{knowledge-events-dcchq50n.js → knowledge-events-krd8ndqh.js} +10 -10
- package/dist/cli/{knowledge-link-zh9rzesj.js → knowledge-link-9gx2djyd.js} +4 -4
- package/dist/cli/{knowledge-store-p27r8wa9.js → knowledge-store-0x9ejztz.js} +5 -5
- package/dist/cli/{knowledge-validator-rmtymth5.js → knowledge-validator-y7pr7h3g.js} +7 -7
- package/dist/cli/{mcp-jr1rr2zd.js → mcp-tf5b5aqa.js} +1 -1
- package/dist/cli/{model-preflight-xzy5x4rt.js → model-preflight-pt6n1re7.js} +35 -35
- package/dist/cli/{pending-delegations-4k740a2c.js → pending-delegations-rqfgnay0.js} +7 -7
- package/dist/cli/{pr-subscriptions-515xdgjj.js → pr-subscriptions-1frpr34c.js} +7 -7
- package/dist/cli/{pr-workflow-gate-srpa0mds.js → pr-workflow-gate-dhzvaqj8.js} +35 -35
- package/dist/cli/{runner-tk1cmgzt.js → runner-x8sbydkw.js} +5 -5
- package/dist/cli/{scan-cursor-w89sck5y.js → scan-cursor-nm6h3gdd.js} +6 -6
- package/dist/cli/{schema-1mwgvrv7.js → schema-4fxm5b9r.js} +1 -1
- package/dist/cli/{scope-persistence-qen27qx7.js → scope-persistence-3hs7yy2b.js} +11 -11
- package/dist/cli/{server-rhz44ye9.js → server-tmjef10y.js} +35 -35
- package/dist/cli/{skill-generator-05mxym3d.js → skill-generator-qk0gpwhq.js} +14 -14
- package/dist/cli/{snapshot-coordination-init-jjegs3v5.js → snapshot-coordination-init-pqsgthaa.js} +35 -35
- package/dist/cli/{speckit-checkoff-3m04ks95.js → speckit-checkoff-9kx59cdb.js} +3 -3
- package/dist/cli/{telemetry-vwxbsnye.js → telemetry-d0j31j5d.js} +1 -1
- package/dist/cli/{worktree-collision-ownership-0d73y8h0.js → worktree-collision-ownership-d890zzka.js} +7 -7
- package/dist/cli/{worktree-isolation-d0vn38wb.js → worktree-isolation-45hj9jy7.js} +35 -35
- package/dist/commands/close/align-stage.d.ts +26 -0
- package/dist/commands/close/context.d.ts +8 -0
- package/dist/commands/close/internals.d.ts +1 -1
- package/dist/commands/destructive-purge.d.ts +55 -27
- package/dist/commands/registry.d.ts +1 -1
- package/dist/hooks/knowledge-validator.d.ts +18 -1
- package/dist/index.js +20 -19
- package/dist/observability/catalog.d.ts +3 -3
- package/dist/telemetry.d.ts +15 -1
- package/dist/tools/repo-map.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,30 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Issue #2527 / #2508: the shared two-step destructive-purge confirmation
|
|
3
|
-
* primitive (preview + confirm_token → exact-token execution).
|
|
4
|
-
*
|
|
5
|
-
* Contract (frozen by check C8 and the destructive-purge-2527 unit suite):
|
|
6
|
-
* - `previewDestructivePurge` is a side-effect-free preview (counts, exact
|
|
7
|
-
* option label, the confirmation the operator must echo);
|
|
8
|
-
* - `issueConfirmToken` records a single-slot pending purge keyed by a
|
|
9
|
-
* digest over the candidate SET (sorted absolute paths + kind) and
|
|
10
|
-
* returns the confirm token (15-minute TTL);
|
|
11
|
-
* - `executeDestructivePurge` re-derives the CURRENT scope digest and
|
|
12
|
-
* passes only on exact token match AND digest match AND fresh TTL — so
|
|
13
|
-
* replay after the candidate set changes (a lane added, removed, or the
|
|
14
|
-
* scope re-derived differently) is rejected by construction, and the
|
|
15
|
-
* token is single-use (the pending record is consumed on execution; a
|
|
16
|
-
* second execution is rejected with "no pending purge").
|
|
17
|
-
* - TTL expiry: an expired pending record is treated as absent on read
|
|
18
|
-
* (silent); every new issuance overwrites the single slot — the
|
|
19
|
-
* overwritten token can never execute (it is rejected with "confirm
|
|
20
|
-
* token mismatch"; a single-slot store cannot distinguish generations,
|
|
21
|
-
* but rejection is guaranteed either way).
|
|
22
|
-
* - Scope-of-execution: the executor deletes ONLY the recorded candidate
|
|
23
|
-
* paths. The primitive confirms operator intent; CALLERS own scoping —
|
|
24
|
-
* `/swarm reset-session` (and #2508's `/swarm close` when it adopts
|
|
25
|
-
* this) must only construct candidate sets from ownership-gated,
|
|
26
|
-
* base-scoped directories.
|
|
27
|
-
*/
|
|
28
1
|
import { randomBytes } from 'node:crypto';
|
|
29
2
|
import * as fs from 'node:fs';
|
|
30
3
|
import { atomicWriteSwarmFileSync } from '../utils/atomic-write';
|
|
@@ -54,6 +27,61 @@ export declare const _internals: {
|
|
|
54
27
|
now: () => number;
|
|
55
28
|
randomBytes: typeof randomBytes;
|
|
56
29
|
scopeDigest: typeof scopeDigest;
|
|
30
|
+
runGitStatus: typeof runGitStatusSync;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Shared argv for every tracked-dirty measurement (issue #2953): the close
|
|
34
|
+
* gate and the pre-destruction re-check run the identical status command and
|
|
35
|
+
* feed the same parser, so the two measurements parse identically. (The two
|
|
36
|
+
* reads still go through separate spawn wrappers; equivalence is by
|
|
37
|
+
* convention + review, not a single shared call site.)
|
|
38
|
+
*/
|
|
39
|
+
export declare const GIT_STATUS_ARGS: readonly ["status", "--porcelain"];
|
|
40
|
+
/** Default bounded status read (invariant 3: array form, cwd, timeout, ignore
|
|
41
|
+
* stdin, bounded stdout, windowsHide). Exposed via `_internals` for tests. */
|
|
42
|
+
declare function runGitStatusSync(args: readonly string[], cwd: string): string | null;
|
|
43
|
+
/**
|
|
44
|
+
* Parse `git status --porcelain` (newline) output into repo-relative
|
|
45
|
+
* tracked-dirty paths: untracked (`??`) entries are skipped (they survive the
|
|
46
|
+
* align reset), surrounding quotes are stripped, and rename/copy records are
|
|
47
|
+
* split into BOTH sides. R/C may appear in EITHER status column (`R old ->
|
|
48
|
+
* new` staged, ` R old -> new` worktree renames via `git add -N`) — both
|
|
49
|
+
* columns are tested, never just the first (the codebase porcelain-parser
|
|
50
|
+
* rule from the #2976 rollback-gate review). Sibling module
|
|
51
|
+
* `src/commands/rollback-gate.ts` exports a same-named parser for
|
|
52
|
+
* NUL-terminated `--porcelain -z` output (J1/#2946); the two are deliberately
|
|
53
|
+
* not consolidated in this PR.
|
|
54
|
+
*/
|
|
55
|
+
export declare function parseTrackedDirtyPaths(statusOutput: string): string[];
|
|
56
|
+
/**
|
|
57
|
+
* Shared tracked-dirty read (issue #2953): GIT_STATUS_ARGS + the shared
|
|
58
|
+
* parser around the default runner (test seam: `_internals.runGitStatus`).
|
|
59
|
+
* The close gate composes the same argv + parser directly through its own
|
|
60
|
+
* long-standing `_closeGateInternals.runGit` seam rather than calling this
|
|
61
|
+
* helper, so its existing #2508 fail-closed tests keep their injection point.
|
|
62
|
+
*/
|
|
63
|
+
export declare function readTrackedDirtyPaths(directory: string): {
|
|
64
|
+
ok: true;
|
|
65
|
+
dirtyPaths: string[];
|
|
66
|
+
} | {
|
|
67
|
+
ok: false;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Issue #2953 TOCTOU re-check: re-measure the tracked-dirty set immediately
|
|
71
|
+
* before a destructive reset and compare it to the set the operator actually
|
|
72
|
+
* confirmed (or the empty clean-tree set). Fail-closed in both directions
|
|
73
|
+
* that matter: ANY newly-dirty tracked path refuses, and an unreadable
|
|
74
|
+
* status refuses (a measurement that cannot be taken must never read as
|
|
75
|
+
* "unchanged"). A file that got cleaner passes — strictly less destruction
|
|
76
|
+
* than confirmed.
|
|
77
|
+
*/
|
|
78
|
+
export declare function recheckBeforeDestructive(directory: string, expectedDirtyPaths: readonly string[]): {
|
|
79
|
+
ok: true;
|
|
80
|
+
dirtyPaths: string[];
|
|
81
|
+
} | {
|
|
82
|
+
ok: false;
|
|
83
|
+
reason: string;
|
|
84
|
+
newDirtyPaths: string[];
|
|
57
85
|
};
|
|
58
86
|
declare function scopeDigest(kind: string, candidates: PurgeCandidate[]): string;
|
|
59
87
|
/**
|
|
@@ -730,7 +730,7 @@ export declare const COMMAND_REGISTRY: {
|
|
|
730
730
|
readonly finalize: {
|
|
731
731
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
732
732
|
readonly description: "Use /swarm finalize to finalize the swarm project and archive evidence";
|
|
733
|
-
readonly details: "Idempotent 4-stage terminal finalization: (1) finalize writes retrospectives for in-progress phases, (2) archive creates timestamped bundle of swarm artifacts and evidence, (3) clean removes active-state files for a clean slate, (4) align performs aggressive git reset --hard to the default remote branch, discarding uncommitted changes and gitignored build artifacts (user-created untracked files are preserved); falls back to a cautious reset that preserves uncommitted changes when the aggressive path cannot proceed. WARNING: alignment discards local changes and gitignored files. Resets agent sessions, delegation chains, and active-agent mappings. Reads .swarm/close-lessons.md for explicit lessons and runs curation. Cleanup: knowledge.jsonl is preserved; plan.json, plan.md, events.jsonl, handoff.*, run-memory.jsonl, and summaries/ are removed. Use --skill-review to run the quota-bounded skill_improver in proposal mode. Use --dry-run to preview what finalize would archive, clean, and align without taking the lock or changing anything.";
|
|
733
|
+
readonly details: "Idempotent 4-stage terminal finalization: (1) finalize writes retrospectives for in-progress phases, (2) archive creates timestamped bundle of swarm artifacts and evidence, (3) clean removes active-state files for a clean slate, (4) align performs aggressive git reset --hard to the default remote branch, discarding uncommitted changes and gitignored build artifacts (user-created untracked files are preserved); falls back to a cautious reset that preserves uncommitted changes when the aggressive path cannot proceed. Alignment re-verifies the tracked tree immediately before its destructive reset and aborts fail-closed (leaving alignment undone) when tracked files changed after the close gate was verified or the status cannot be re-read (#2953). WARNING: alignment discards local changes and gitignored files. Resets agent sessions, delegation chains, and active-agent mappings. Reads .swarm/close-lessons.md for explicit lessons and runs curation. Cleanup: knowledge.jsonl is preserved; plan.json, plan.md, events.jsonl, handoff.*, run-memory.jsonl, and summaries/ are removed. Use --skill-review to run the quota-bounded skill_improver in proposal mode. Use --dry-run to preview what finalize would archive, clean, and align without taking the lock or changing anything.";
|
|
734
734
|
readonly args: "--prune-branches, --skill-review, --dry-run";
|
|
735
735
|
readonly category: "core";
|
|
736
736
|
readonly toolPolicy: "none";
|
|
@@ -121,6 +121,23 @@ export interface EntryHealthResult {
|
|
|
121
121
|
concern?: string;
|
|
122
122
|
}
|
|
123
123
|
export declare function auditEntryHealth(entry: KnowledgeEntryBase): EntryHealthResult;
|
|
124
|
+
/**
|
|
125
|
+
* #2950: what `quarantineEntry` actually did inside the lock. Callers that
|
|
126
|
+
* need to report truthfully (the knowledge_archive tool) switch on this
|
|
127
|
+
* instead of assuming the mutation happened; value-discarding callers are
|
|
128
|
+
* unaffected.
|
|
129
|
+
*/
|
|
130
|
+
export type QuarantineEntryOutcome = {
|
|
131
|
+
status: 'quarantined';
|
|
132
|
+
} | {
|
|
133
|
+
status: 'denied';
|
|
134
|
+
basis: string;
|
|
135
|
+
detail: string;
|
|
136
|
+
} | {
|
|
137
|
+
status: 'not_found';
|
|
138
|
+
} | {
|
|
139
|
+
status: 'invalid_input';
|
|
140
|
+
};
|
|
124
141
|
export declare function quarantineEntry(directory: string, entryId: string, reason: string, reportedBy: 'architect' | 'user' | 'auto',
|
|
125
142
|
/** #1848: cohort-safe curation context. When provided, the quarantine is
|
|
126
143
|
* authorized through the shared curation policy BEFORE mutating; an
|
|
@@ -130,7 +147,7 @@ export declare function quarantineEntry(directory: string, entryId: string, reas
|
|
|
130
147
|
curationContext?: {
|
|
131
148
|
input: CurationAuthorizationInput;
|
|
132
149
|
context: CurationContext;
|
|
133
|
-
}): Promise<
|
|
150
|
+
}): Promise<QuarantineEntryOutcome>;
|
|
134
151
|
export declare function restoreEntry(directory: string, entryId: string,
|
|
135
152
|
/** #1848 §2: cohort-safe curation context (optional). When provided, the
|
|
136
153
|
* restore is authorized through the shared policy before mutating. */
|