opencode-swarm 7.144.3 → 7.144.4
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-review/SKILL.md +3 -1
- package/.opencode/skills/swarm-pr-review/references/lane-output-recoverability.md +28 -0
- package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +2 -0
- package/README.md +3 -1
- package/dist/background/pending-delegations.d.ts +14 -0
- package/dist/cli/{config-doctor-pkr9w2nv.js → config-doctor-rw9zrjk6.js} +3 -3
- package/dist/cli/{core-7pymdx0b.js → core-zjx9aqaf.js} +2 -2
- package/dist/cli/{curation-policy-y1pqpztb.js → curation-policy-0wbrh11c.js} +5 -5
- package/dist/cli/{curator-wbzcjd0q.js → curator-g54a7wv0.js} +27 -27
- package/dist/cli/{curator-llm-factory-7are9wjh.js → curator-llm-factory-xgb4pxmm.js} +27 -27
- package/dist/cli/{evidence-summary-service-rcgrdm52.js → evidence-summary-service-fnr5y54e.js} +11 -11
- package/dist/cli/{gate-evidence-jmzctnhg.js → gate-evidence-2xt1x07r.js} +6 -6
- package/dist/cli/{guardrail-explain-brgw4sve.js → guardrail-explain-6wcgr9tz.js} +28 -28
- package/dist/cli/{guardrail-log-k1s9xf3h.js → guardrail-log-5w4b9zrw.js} +4 -4
- package/dist/cli/{hive-promoter-vcj5h0e3.js → hive-promoter-x63ehffd.js} +27 -27
- package/dist/cli/{index-xwpmxpb7.js → index-03pv47h2.js} +6 -6
- package/dist/cli/{index-zwrqe065.js → index-1csyxv0f.js} +1 -1
- package/dist/cli/{index-s2rcz51a.js → index-1jsmmx7y.js} +66 -34
- package/dist/cli/{index-06cn7haa.js → index-2m7mavaz.js} +2 -2
- package/dist/cli/{index-pr8vhj6j.js → index-4w5qdbk7.js} +7 -7
- package/dist/cli/{index-6s2q144w.js → index-8j0va7jp.js} +2 -2
- package/dist/cli/{index-8hkjk37c.js → index-9qq7c18c.js} +1 -1
- package/dist/cli/{index-satc0vs6.js → index-az8etqpp.js} +6 -6
- package/dist/cli/{index-584grrwn.js → index-bt9aa01f.js} +1 -1
- package/dist/cli/{index-ep14xc5z.js → index-btmsqv7p.js} +4 -4
- package/dist/cli/{index-x68tw7v3.js → index-cz25e8xp.js} +4 -4
- package/dist/cli/{index-7554tecy.js → index-d12jd5mn.js} +2 -2
- package/dist/cli/{index-0fgwdtvp.js → index-dty5qgk2.js} +1 -1
- package/dist/cli/{index-wd24zn2e.js → index-f9vvg5xb.js} +1 -1
- package/dist/cli/{index-8214dd7j.js → index-fqcjragy.js} +2 -2
- package/dist/cli/{index-2en8s72h.js → index-h98t1m88.js} +2 -2
- package/dist/cli/{index-krxcxkdq.js → index-jabkn643.js} +18 -3
- package/dist/cli/{index-zswmbm15.js → index-mazgg5s2.js} +1 -1
- package/dist/cli/{index-wck434f8.js → index-nckg4gxb.js} +2 -2
- package/dist/cli/{index-ghzvxj3g.js → index-p7cm3gtj.js} +31 -29
- package/dist/cli/{index-qj22wyw2.js → index-psvxq93b.js} +3 -3
- package/dist/cli/{index-p7hbphaq.js → index-pw83zgny.js} +3 -3
- package/dist/cli/{index-247wf23m.js → index-q4ed1jk7.js} +1236 -841
- package/dist/cli/{index-p863y7xx.js → index-q67jb94n.js} +1 -1
- package/dist/cli/{index-whezv7vc.js → index-v3y3qg48.js} +1 -1
- package/dist/cli/{index-eya357bk.js → index-x6tp0hfr.js} +5 -5
- package/dist/cli/{index-1brb14xc.js → index-y8j8ehc8.js} +2 -2
- package/dist/cli/{index-b227mpnk.js → index-yts89pqg.js} +4 -4
- package/dist/cli/{index-dpfphnmy.js → index-ywn7vtxp.js} +1 -1
- package/dist/cli/{index-j6mfyy0a.js → index-z6v7kwpa.js} +3 -3
- package/dist/cli/{index-pag8nsb1.js → index-zb0xcz9t.js} +3 -3
- package/dist/cli/index.js +27 -27
- package/dist/cli/{knowledge-escalator-x6jrcrwj.js → knowledge-escalator-ypg14d5r.js} +11 -11
- package/dist/cli/{knowledge-events-aw22r72m.js → knowledge-events-nkrym4wb.js} +9 -9
- package/dist/cli/{knowledge-link-bntppte4.js → knowledge-link-e4qgqmpx.js} +4 -4
- package/dist/cli/{knowledge-store-19xg1rw1.js → knowledge-store-vh3nhtg2.js} +5 -5
- package/dist/cli/{knowledge-validator-8wh82z0a.js → knowledge-validator-jrxvexv6.js} +7 -7
- package/dist/cli/{pending-delegations-1y303j3k.js → pending-delegations-pw79c8ds.js} +3 -3
- package/dist/cli/{pr-subscriptions-wvd041rp.js → pr-subscriptions-fk628bhc.js} +3 -3
- package/dist/cli/{runner-jn55k8xb.js → runner-b02sz2vx.js} +5 -5
- package/dist/cli/{scan-cursor-429r5db9.js → scan-cursor-fp7w5jmc.js} +6 -6
- package/dist/cli/{schema-jdwjcby0.js → schema-rptwqbm4.js} +2 -2
- package/dist/cli/{scope-persistence-s0s1bz15.js → scope-persistence-0bkaxawa.js} +7 -7
- package/dist/cli/{skill-generator-ffbj0ye5.js → skill-generator-nh8b4gjv.js} +13 -13
- package/dist/cli/{telemetry-xyfb5vm8.js → telemetry-cybx6cfz.js} +1 -1
- package/dist/cli/{worktree-collision-ownership-z5ftwjz3.js → worktree-collision-ownership-hqd9ypsz.js} +3 -3
- package/dist/cli/{worktree-isolation-y2p93438.js → worktree-isolation-canf3rj8.js} +27 -27
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/recover.d.ts +17 -0
- package/dist/commands/registry.d.ts +9 -1
- package/dist/commands/reset-session.d.ts +2 -0
- package/dist/hooks/context-budget.d.ts +4 -0
- package/dist/hooks/context-usage.d.ts +48 -0
- package/dist/hooks/pr-workflow-gate.d.ts +29 -2
- package/dist/index.js +310 -304
- package/dist/observability/catalog.d.ts +8 -6
- package/dist/sast/semgrep.d.ts +3 -2
- package/dist/telemetry.d.ts +17 -1
- package/dist/tools/context-status.d.ts +9 -3
- package/dist/tools/dispatch-lanes.d.ts +27 -2
- package/dist/tools/pre-check-batch.d.ts +9 -0
- package/dist/tools/sast-scan.d.ts +3 -0
- package/dist/workflow/coder-settlement.d.ts +74 -0
- package/package.json +1 -1
|
@@ -20,59 +20,59 @@ import {
|
|
|
20
20
|
sanitizeWorktreeTaskId,
|
|
21
21
|
standardWorktreeByCallID,
|
|
22
22
|
standardWorktreeSerializationSessions
|
|
23
|
-
} from "./index-
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
23
|
+
} from "./index-q4ed1jk7.js";
|
|
24
|
+
import"./index-d12jd5mn.js";
|
|
25
|
+
import"./index-h98t1m88.js";
|
|
26
|
+
import"./index-az8etqpp.js";
|
|
27
27
|
import"./index-134d35c1.js";
|
|
28
28
|
import"./index-b6e016tv.js";
|
|
29
|
-
import"./index-
|
|
30
|
-
import"./index-
|
|
29
|
+
import"./index-1csyxv0f.js";
|
|
30
|
+
import"./index-fqcjragy.js";
|
|
31
31
|
import"./index-y8552snf.js";
|
|
32
|
-
import"./index-
|
|
32
|
+
import"./index-nckg4gxb.js";
|
|
33
33
|
import"./index-70ha9e09.js";
|
|
34
34
|
import"./index-c8s9a3zh.js";
|
|
35
35
|
import"./index-9ss2m4rs.js";
|
|
36
36
|
import"./index-74hpm6sh.js";
|
|
37
|
-
import"./index-
|
|
38
|
-
import"./index-
|
|
39
|
-
import"./index-
|
|
40
|
-
import"./index-
|
|
41
|
-
import"./index-
|
|
37
|
+
import"./index-bt9aa01f.js";
|
|
38
|
+
import"./index-zb0xcz9t.js";
|
|
39
|
+
import"./index-x6tp0hfr.js";
|
|
40
|
+
import"./index-yts89pqg.js";
|
|
41
|
+
import"./index-dty5qgk2.js";
|
|
42
42
|
import"./index-rtry5xyf.js";
|
|
43
43
|
import"./index-zsrtt42s.js";
|
|
44
|
-
import"./index-
|
|
44
|
+
import"./index-jabkn643.js";
|
|
45
45
|
import"./index-k3cxyk66.js";
|
|
46
|
-
import"./index-
|
|
47
|
-
import"./index-
|
|
48
|
-
import"./index-
|
|
49
|
-
import"./index-
|
|
46
|
+
import"./index-cz25e8xp.js";
|
|
47
|
+
import"./index-8j0va7jp.js";
|
|
48
|
+
import"./index-pw83zgny.js";
|
|
49
|
+
import"./index-z6v7kwpa.js";
|
|
50
50
|
import"./index-556ja8an.js";
|
|
51
51
|
import"./index-7sy3aa9m.js";
|
|
52
52
|
import"./index-wx8zdh4a.js";
|
|
53
53
|
import"./index-8fwhhayc.js";
|
|
54
54
|
import"./index-q1exe2b3.js";
|
|
55
|
-
import"./index-
|
|
56
|
-
import"./index-
|
|
55
|
+
import"./index-03pv47h2.js";
|
|
56
|
+
import"./index-4w5qdbk7.js";
|
|
57
57
|
import {
|
|
58
58
|
resolveWorktreeIsolationConfig
|
|
59
|
-
} from "./index-
|
|
59
|
+
} from "./index-psvxq93b.js";
|
|
60
60
|
import"./index-gprxjmm7.js";
|
|
61
61
|
import"./index-n832052r.js";
|
|
62
62
|
import"./index-rn0eq85g.js";
|
|
63
63
|
import"./index-z6xqpmqg.js";
|
|
64
|
-
import"./index-
|
|
65
|
-
import"./index-
|
|
64
|
+
import"./index-9qq7c18c.js";
|
|
65
|
+
import"./index-y8j8ehc8.js";
|
|
66
66
|
import"./index-4rhhvd1a.js";
|
|
67
|
-
import"./index-
|
|
67
|
+
import"./index-v3y3qg48.js";
|
|
68
68
|
import"./index-zjygnfay.js";
|
|
69
69
|
import"./index-ae75rja9.js";
|
|
70
|
-
import"./index-
|
|
71
|
-
import"./index-
|
|
70
|
+
import"./index-ywn7vtxp.js";
|
|
71
|
+
import"./index-mazgg5s2.js";
|
|
72
72
|
import"./index-ed5ykebp.js";
|
|
73
73
|
import"./index-bk5tah7q.js";
|
|
74
|
-
import"./index-
|
|
75
|
-
import"./index-
|
|
74
|
+
import"./index-f9vvg5xb.js";
|
|
75
|
+
import"./index-1jsmmx7y.js";
|
|
76
76
|
import"./index-7g4c7s5r.js";
|
|
77
77
|
import"./index-bpmtbmy9.js";
|
|
78
78
|
import"./index-4nt52yr9.js";
|
package/dist/commands/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export { handlePlanCommand } from './plan';
|
|
|
46
46
|
export { handlePreflightCommand } from './preflight';
|
|
47
47
|
export { handlePromoteCommand } from './promote';
|
|
48
48
|
export { handleQaGatesCommand } from './qa-gates';
|
|
49
|
+
export { handleRecoverCommand } from './recover';
|
|
49
50
|
export { handleHelpCommand } from './registry';
|
|
50
51
|
export type { CommandContext, CommandEntry, RegisteredCommand, } from './registry.js';
|
|
51
52
|
export { COMMAND_REGISTRY, resolveCommand, VALID_COMMANDS, } from './registry.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles the /swarm recover command (issue #2268).
|
|
3
|
+
*
|
|
4
|
+
* The user-facing invoker for coder-settlement recovery. The wedge class this
|
|
5
|
+
* exists for: a DISPATCHED settlement WAL whose completion (toolAfter) never
|
|
6
|
+
* arrived — every dispatch retry is refused with CODER_SETTLEMENT_IN_PROGRESS
|
|
7
|
+
* / CODER_DISPATCH_IN_PROGRESS and internal sinks (update_task_status, /swarm
|
|
8
|
+
* close) are paused too. Safe mode recovers settlements whose owning process
|
|
9
|
+
* is gone; --force additionally releases ownership keys still held by THIS
|
|
10
|
+
* process (an operator assertion that no dispatch is genuinely in flight —
|
|
11
|
+
* a still-running dispatch's late completion will then fail settlement with
|
|
12
|
+
* CODER_SETTLEMENT_IDEMPOTENCY_CONFLICT, which is safe to ignore).
|
|
13
|
+
*
|
|
14
|
+
* Human-only by policy: agents already self-heal dead-owner settlements via
|
|
15
|
+
* update_task_status, and --force must stay an operator decision.
|
|
16
|
+
*/
|
|
17
|
+
export declare function handleRecoverCommand(directory: string, args: string[]): Promise<string>;
|
|
@@ -825,11 +825,19 @@ export declare const COMMAND_REGISTRY: {
|
|
|
825
825
|
readonly 'reset-session': {
|
|
826
826
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
827
827
|
readonly description: "Clear session state while preserving plan, evidence, and knowledge";
|
|
828
|
-
readonly details: "Deletes only .swarm/session/state.json and any other session files. Clears in-memory agent sessions, delegation chains, and active-agent mappings. Preserves plan, evidence, and knowledge for cross-session continuity. Before deleting, auto-backs up the session files it removes to .swarm/reset-backups/<timestamp>/ (newest 5 kept).";
|
|
828
|
+
readonly details: "Deletes only .swarm/session/state.json and any other session files. Clears in-memory agent sessions, delegation chains, and active-agent mappings. Preserves plan, evidence, and knowledge for cross-session continuity. Also recovers stale coder settlements, releasing in-flight ownership held by this process, so dispatches cannot stay wedged on CODER_DISPATCH_IN_PROGRESS (issue #2268). Before deleting, auto-backs up the session files it removes to .swarm/reset-backups/<timestamp>/ (newest 5 kept).";
|
|
829
829
|
readonly args: "";
|
|
830
830
|
readonly category: "utility";
|
|
831
831
|
readonly toolPolicy: "restricted";
|
|
832
832
|
};
|
|
833
|
+
readonly recover: {
|
|
834
|
+
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
835
|
+
readonly description: "Recover wedged coder settlements [task_id] [--force]";
|
|
836
|
+
readonly details: "Settles stale coder-settlement WALs in .swarm/coder-settlements/ — the CODER_DISPATCH_IN_PROGRESS wedge where a dispatch's completion never fired (issue #2268). Safe mode recovers settlements whose owner process is gone. --force also releases ownership keys held by this process: use only when no dispatch is genuinely running (a late completion then reports CODER_SETTLEMENT_IDEMPOTENCY_CONFLICT, safe to ignore). Never interrupts another live OpenCode process. Human-only.";
|
|
837
|
+
readonly args: "[task_id] [--force]";
|
|
838
|
+
readonly category: "utility";
|
|
839
|
+
readonly toolPolicy: "human-only";
|
|
840
|
+
};
|
|
833
841
|
readonly rollback: {
|
|
834
842
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
835
843
|
readonly description: "Restore swarm state or project files to a checkpoint";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { recoverStaleCoderSettlements } from '../workflow/coder-settlement.js';
|
|
1
2
|
import { type OrphanCleanupResult } from '../worktree/merge';
|
|
2
3
|
import { type ResetBackupResult } from './reset-backup';
|
|
3
4
|
/**
|
|
@@ -9,6 +10,7 @@ import { type ResetBackupResult } from './reset-backup';
|
|
|
9
10
|
export declare const _internals: {
|
|
10
11
|
cleanupOrphanedBranches: (directory: string, activeSessionIds: string[]) => Promise<OrphanCleanupResult>;
|
|
11
12
|
backupSwarmStateBeforeReset: (directory: string, kind: 'reset' | 'reset-session', relEntries: string[]) => ResetBackupResult;
|
|
13
|
+
recoverStaleCoderSettlements: typeof recoverStaleCoderSettlements;
|
|
12
14
|
};
|
|
13
15
|
/**
|
|
14
16
|
* Handles the /swarm reset-session command.
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* to provide proactive context management guidance to the architect agent.
|
|
7
7
|
*/
|
|
8
8
|
import type { PluginConfig } from '../config';
|
|
9
|
+
import { telemetry } from '../telemetry';
|
|
9
10
|
interface MessageInfo {
|
|
10
11
|
role: string;
|
|
11
12
|
agent?: string;
|
|
@@ -31,6 +32,9 @@ interface MessageWithParts {
|
|
|
31
32
|
info: MessageInfo;
|
|
32
33
|
parts: MessagePart[];
|
|
33
34
|
}
|
|
35
|
+
export declare const _internals: {
|
|
36
|
+
telemetryContextPruned: typeof telemetry.contextPruned;
|
|
37
|
+
};
|
|
34
38
|
/**
|
|
35
39
|
* Creates the experimental.chat.messages.transform hook for context budget tracking.
|
|
36
40
|
* Injects warnings when context usage exceeds configured thresholds.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface ContextUsageMessageInfo {
|
|
2
|
+
role?: string;
|
|
3
|
+
tokens?: {
|
|
4
|
+
input?: unknown;
|
|
5
|
+
cache?: {
|
|
6
|
+
read?: unknown;
|
|
7
|
+
write?: unknown;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export interface ContextUsageMessagePart {
|
|
13
|
+
type?: string;
|
|
14
|
+
text?: string;
|
|
15
|
+
state?: {
|
|
16
|
+
status?: string;
|
|
17
|
+
input?: unknown;
|
|
18
|
+
output?: string;
|
|
19
|
+
error?: string;
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
};
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}
|
|
24
|
+
export interface ContextUsageMessage {
|
|
25
|
+
info?: ContextUsageMessageInfo;
|
|
26
|
+
parts?: ContextUsageMessagePart[];
|
|
27
|
+
}
|
|
28
|
+
export type ContextUsageSource = 'provider' | 'estimated';
|
|
29
|
+
export interface ContextUsageResult {
|
|
30
|
+
tokensUsed: number;
|
|
31
|
+
source: ContextUsageSource;
|
|
32
|
+
assistantAnchorIndex: number | null;
|
|
33
|
+
}
|
|
34
|
+
export declare function serializeToolInput(input: unknown): string;
|
|
35
|
+
export declare function estimateToolInputTokens(input: unknown): number;
|
|
36
|
+
export declare function getVisibleToolPartText(part: ContextUsageMessagePart): string;
|
|
37
|
+
export declare function estimateVisibleToolPartTokens(part: ContextUsageMessagePart): number;
|
|
38
|
+
export declare function estimateMessageTokens(message: ContextUsageMessage): number;
|
|
39
|
+
export declare function readProviderPromptTokens(message: ContextUsageMessage | undefined): number | undefined;
|
|
40
|
+
export declare function computeContextUsage(messages: ContextUsageMessage[] | undefined): ContextUsageResult;
|
|
41
|
+
export declare const _test_exports: {
|
|
42
|
+
computeContextUsage: typeof computeContextUsage;
|
|
43
|
+
estimateToolInputTokens: typeof estimateToolInputTokens;
|
|
44
|
+
estimateVisibleToolPartTokens: typeof estimateVisibleToolPartTokens;
|
|
45
|
+
estimateMessageTokens: typeof estimateMessageTokens;
|
|
46
|
+
readProviderPromptTokens: typeof readProviderPromptTokens;
|
|
47
|
+
serializeToolInput: typeof serializeToolInput;
|
|
48
|
+
};
|
|
@@ -2,7 +2,7 @@ import * as fsp from 'node:fs/promises';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { type CandidateSeverity, type RowFormatFamily } from '../background/candidate-contract.js';
|
|
4
4
|
import { type LaneOutputArtifact } from '../background/lane-output-store.js';
|
|
5
|
-
import { type BackgroundDelegationRecord, type BackgroundDelegationResult, findByBatchId, sweepStaleDelegations } from '../background/pending-delegations.js';
|
|
5
|
+
import { type BackgroundDelegationRecord, type BackgroundDelegationResult, type BackgroundDelegationWorkflowLaneRecovery, findByBatchId, sweepStaleDelegations } from '../background/pending-delegations.js';
|
|
6
6
|
import { type PrReviewInlineTriggerRow } from '../background/pr-review-trigger-contract.js';
|
|
7
7
|
import { type RevisionDigestResult, resolveCommitCountSince, resolveCommitCountSinceAsync, resolveCurrentGitHead, resolveCurrentGitHeadAsync, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamPushTargetAsync, resolveCurrentUpstreamRemoteRef, resolveExactRemoteBranchHead, resolveExactRemoteBranchHeadAsync, resolveIsExactSingleChildCommit, resolveIsExactSingleChildCommitAsync, resolveIsWorkingTreeClean, resolveIsWorkingTreeCleanAsync, resolvePrReviewDiffStats, resolvePrReviewDiffStatsAsync, resolvePrWorkflowRevisionDigest, resolvePrWorkflowRevisionDigestDetailed, resolveRemoteRefsContainingHead, resolveRemoteRefsContainingHeadAsync } from '../background/workspace-snapshot.js';
|
|
8
8
|
import { classifyPrWorkflowGitState, type PrWorkflowGitState } from '../git/pr-workflow-state.js';
|
|
@@ -10,7 +10,7 @@ export declare const PR_REVIEW_BASE_DIMENSION_IDS: readonly ["intent-architectur
|
|
|
10
10
|
export declare const PR_REVIEW_REQUIRED_MICRO_LANE_IDS: ("auth-identity-secrets" | "untrusted-input-boundaries" | "subprocess-platform" | "concurrency-state" | "dependencies-build-release" | "api-schema-migrations" | "test-infrastructure" | "ui-accessibility-i18n" | "privacy-observability" | "generated-provenance" | "unclassified-risk")[];
|
|
11
11
|
export type PrReviewBaseDimensionId = (typeof PR_REVIEW_BASE_DIMENSION_IDS)[number];
|
|
12
12
|
export type PrWorkflowMode = 'PR_REVIEW' | 'PR_FEEDBACK';
|
|
13
|
-
export type PrReviewLaneValidationPredicate = 'batch.validated_at' | 'batch.expected_lane_unique' | 'record.missing' | 'record.duplicate_lane' | 'record.subagent_session_id' | 'record.duplicate_subagent_session_id' | 'record.forbidden_subagent_session_id' | 'record.created_at' | 'record.workflow_lane' | 'record.owned_workflow_lanes' | 'record.mode' | 'record.pr_head_sha' | 'record.git_head' | 'record.status' | 'result.output_degraded' | 'result.transcript_incomplete' | 'result.
|
|
13
|
+
export type PrReviewLaneValidationPredicate = 'batch.validated_at' | 'batch.expected_lane_unique' | 'record.missing' | 'record.duplicate_lane' | 'record.subagent_session_id' | 'record.duplicate_subagent_session_id' | 'record.forbidden_subagent_session_id' | 'record.created_at' | 'record.workflow_lane' | 'record.owned_workflow_lanes' | 'record.mode' | 'record.pr_head_sha' | 'record.git_head' | 'record.status' | 'result.output_degraded' | 'result.transcript_incomplete' | 'result.chars' | 'result.digest' | 'result.output_ref' | 'artifact.readable' | 'artifact.ref' | 'artifact.batch_id' | 'artifact.lane_id' | 'artifact.mode' | 'artifact.session_id' | 'artifact.parent_session_id' | 'artifact.agent' | 'artifact.role' | 'artifact.source' | 'artifact.workflow_lane_record' | 'artifact.workflow_lane_expected' | 'artifact.pr_head_sha' | 'artifact.git_head' | 'artifact.revision_digest' | 'record.scope' | 'artifact.scope' | 'artifact.digest' | 'artifact.chars' | 'discovery.header' | 'discovery.row' | 'discovery.coverage' | 'discovery.duplicate_evidence';
|
|
14
14
|
export interface PrReviewLaneValidationFailure {
|
|
15
15
|
predicate: PrReviewLaneValidationPredicate;
|
|
16
16
|
expected: string;
|
|
@@ -25,6 +25,8 @@ export type PrReviewLaneValidationResult = {
|
|
|
25
25
|
* distinguishable from a well-formed one.
|
|
26
26
|
*/
|
|
27
27
|
salvaged?: readonly string[];
|
|
28
|
+
/** Typed recovery disclosures persisted to the durable delegation ledger. */
|
|
29
|
+
recoveries?: readonly BackgroundDelegationWorkflowLaneRecovery[];
|
|
28
30
|
} | {
|
|
29
31
|
ok: false;
|
|
30
32
|
failure: PrReviewLaneValidationFailure;
|
|
@@ -44,6 +46,20 @@ export interface PrReviewDiscoveryLaneValidationInput {
|
|
|
44
46
|
checkWorkflowLane?: boolean;
|
|
45
47
|
};
|
|
46
48
|
}
|
|
49
|
+
export interface PrWorkflowTransportRecoveryValidationInput {
|
|
50
|
+
directory: string;
|
|
51
|
+
record: BackgroundDelegationRecord;
|
|
52
|
+
result: BackgroundDelegationResult;
|
|
53
|
+
artifact: LaneOutputArtifact | null;
|
|
54
|
+
revisionDigest: string;
|
|
55
|
+
}
|
|
56
|
+
export type PrWorkflowTransportRecoveryValidationResult = {
|
|
57
|
+
ok: true;
|
|
58
|
+
recoveries?: readonly BackgroundDelegationWorkflowLaneRecovery[];
|
|
59
|
+
} | {
|
|
60
|
+
ok: false;
|
|
61
|
+
reason: string;
|
|
62
|
+
};
|
|
47
63
|
export interface PrWorkflowCheckoutRecoveryRecord {
|
|
48
64
|
code: 'UNMERGED_INDEX' | 'GIT_OPERATION_IN_PROGRESS' | 'DIRTY_SUBMODULE' | 'SWARM_STATE_TRACKING_ERROR' | 'GIT_STATE_INDETERMINATE';
|
|
49
65
|
retryable: false;
|
|
@@ -1047,6 +1063,17 @@ declare function analyzePrReviewBatchRecordIntegrity(args: {
|
|
|
1047
1063
|
* accidentally accept stale terminal state or a different output reference.
|
|
1048
1064
|
*/
|
|
1049
1065
|
export declare function validatePrReviewDiscoveryLaneCompletion(input: PrReviewDiscoveryLaneValidationInput): PrReviewLaneValidationResult;
|
|
1066
|
+
/**
|
|
1067
|
+
* Collection-time proof for transport-recovered structured workflow lanes.
|
|
1068
|
+
*
|
|
1069
|
+
* Reviewer/critic/PR-feedback lanes normally settle later through the workflow
|
|
1070
|
+
* gate, not in `collect_lane_results`, so a truncated inline preview used to
|
|
1071
|
+
* pass through collection with no durable typed provenance. This helper proves
|
|
1072
|
+
* the durable artifact still carries the exact rows the already-declared batch
|
|
1073
|
+
* owns, allowing collection to persist the transport recovery immediately. Any
|
|
1074
|
+
* unsupported or unprovable structured mode fails closed.
|
|
1075
|
+
*/
|
|
1076
|
+
export declare function validatePrWorkflowTransportRecovery(input: PrWorkflowTransportRecoveryValidationInput): Promise<PrWorkflowTransportRecoveryValidationResult>;
|
|
1050
1077
|
/** Require at least one semantically valid discovery row or CLEAN attestation. */
|
|
1051
1078
|
export declare function prReviewDiscoveryArtifactCoversLane(text: string, expectedWorkflowLane: string, ownedWorkflowLanes?: readonly string[], mode?: string): boolean;
|
|
1052
1079
|
/**
|