@osovv/vv-opencode 1.4.5 → 1.6.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/CHANGELOG.md +23 -0
- package/README.md +47 -16
- package/dist/commands/patch-provider.d.ts +5 -5
- package/dist/commands/patch-provider.js +10 -6
- package/dist/commands/patch-provider.js.map +1 -1
- package/dist/lib/agent-tool-catalog.d.ts +144 -0
- package/dist/lib/agent-tool-catalog.js +2551 -0
- package/dist/lib/agent-tool-catalog.js.map +1 -0
- package/dist/lib/agent-tool-contract.d.ts +200 -0
- package/dist/lib/agent-tool-contract.js +407 -0
- package/dist/lib/agent-tool-contract.js.map +1 -0
- package/dist/lib/opencode/agent-registrations.d.ts +33 -0
- package/dist/lib/opencode/agent-registrations.js +469 -0
- package/dist/lib/opencode/agent-registrations.js.map +1 -0
- package/dist/lib/opencode/inspection.d.ts +84 -0
- package/dist/lib/opencode/inspection.js +367 -0
- package/dist/lib/opencode/inspection.js.map +1 -0
- package/dist/lib/opencode/model-overrides.d.ts +19 -0
- package/dist/lib/opencode/model-overrides.js +221 -0
- package/dist/lib/opencode/model-overrides.js.map +1 -0
- package/dist/lib/opencode/paths.d.ts +21 -0
- package/dist/lib/opencode/paths.js +62 -0
- package/dist/lib/opencode/paths.js.map +1 -0
- package/dist/lib/opencode/plugin-registration.d.ts +17 -0
- package/dist/lib/opencode/plugin-registration.js +210 -0
- package/dist/lib/opencode/plugin-registration.js.map +1 -0
- package/dist/lib/opencode/shared-utils.d.ts +30 -0
- package/dist/lib/opencode/shared-utils.js +183 -0
- package/dist/lib/opencode/shared-utils.js.map +1 -0
- package/dist/lib/opencode/vvoc-config-io.d.ts +9 -0
- package/dist/lib/opencode/vvoc-config-io.js +58 -0
- package/dist/lib/opencode/vvoc-config-io.js.map +1 -0
- package/dist/lib/opencode.d.ts +15 -174
- package/dist/lib/opencode.js +19 -1387
- package/dist/lib/opencode.js.map +1 -1
- package/dist/lib/spec-lint/cross-file-rules.d.ts +2 -0
- package/dist/lib/spec-lint/cross-file-rules.js +33 -0
- package/dist/lib/spec-lint/cross-file-rules.js.map +1 -0
- package/dist/lib/spec-lint/delegated-extraction.d.ts +8 -0
- package/dist/lib/spec-lint/delegated-extraction.js +112 -0
- package/dist/lib/spec-lint/delegated-extraction.js.map +1 -0
- package/dist/lib/spec-lint/lint.d.ts +7 -0
- package/dist/lib/spec-lint/lint.js +92 -0
- package/dist/lib/spec-lint/lint.js.map +1 -0
- package/dist/lib/spec-lint/parser.d.ts +101 -0
- package/dist/lib/spec-lint/parser.js +482 -0
- package/dist/lib/spec-lint/parser.js.map +1 -0
- package/dist/lib/spec-lint/plan-rules.d.ts +38 -0
- package/dist/lib/spec-lint/plan-rules.js +745 -0
- package/dist/lib/spec-lint/plan-rules.js.map +1 -0
- package/dist/lib/spec-lint/spec-rules.d.ts +8 -0
- package/dist/lib/spec-lint/spec-rules.js +188 -0
- package/dist/lib/spec-lint/spec-rules.js.map +1 -0
- package/dist/lib/spec-lint.d.ts +4 -63
- package/dist/lib/spec-lint.js +13 -1505
- package/dist/lib/spec-lint.js.map +1 -1
- package/dist/lib/vvoc-preset-registry.d.ts +7 -7
- package/dist/lib/vvoc-preset-registry.js +8 -8
- package/dist/lib/vvoc-preset-registry.js.map +1 -1
- package/dist/lib/workflow-contract.d.ts +12 -0
- package/dist/lib/workflow-contract.js +71 -18
- package/dist/lib/workflow-contract.js.map +1 -1
- package/dist/plugins/hashline-edit/index.js +102 -97
- package/dist/plugins/hashline-edit/index.js.map +1 -1
- package/dist/plugins/hashline-edit/normalize-edits.d.ts +2 -8
- package/dist/plugins/hashline-edit/normalize-edits.js +32 -17
- package/dist/plugins/hashline-edit/normalize-edits.js.map +1 -1
- package/dist/plugins/hashline-edit/schemas.d.ts +246 -0
- package/dist/plugins/hashline-edit/schemas.js +659 -0
- package/dist/plugins/hashline-edit/schemas.js.map +1 -0
- package/dist/plugins/hashline-edit/str-replace-editor.d.ts +6 -17
- package/dist/plugins/hashline-edit/str-replace-editor.js +19 -21
- package/dist/plugins/hashline-edit/str-replace-editor.js.map +1 -1
- package/dist/plugins/hashline-edit/tool-description.d.ts +1 -0
- package/dist/plugins/hashline-edit/tool-description.js +20 -4
- package/dist/plugins/hashline-edit/tool-description.js.map +1 -1
- package/dist/plugins/web-tools/fetch-service.d.ts +8 -5
- package/dist/plugins/web-tools/fetch-service.js +30 -45
- package/dist/plugins/web-tools/fetch-service.js.map +1 -1
- package/dist/plugins/web-tools/index.js +23 -5
- package/dist/plugins/web-tools/index.js.map +1 -1
- package/dist/plugins/web-tools/schemas.d.ts +469 -0
- package/dist/plugins/web-tools/schemas.js +523 -0
- package/dist/plugins/web-tools/schemas.js.map +1 -0
- package/dist/plugins/web-tools/search-service.d.ts +6 -3
- package/dist/plugins/web-tools/search-service.js +24 -29
- package/dist/plugins/web-tools/search-service.js.map +1 -1
- package/dist/plugins/workflow/authority.d.ts +6 -0
- package/dist/plugins/workflow/authority.js +45 -10
- package/dist/plugins/workflow/authority.js.map +1 -1
- package/dist/plugins/workflow/authorization.d.ts +30 -0
- package/dist/plugins/workflow/authorization.js +147 -0
- package/dist/plugins/workflow/authorization.js.map +1 -0
- package/dist/plugins/workflow/checkpoints.d.ts +41 -2
- package/dist/plugins/workflow/checkpoints.js +176 -47
- package/dist/plugins/workflow/checkpoints.js.map +1 -1
- package/dist/plugins/workflow/delegated.d.ts +15 -1
- package/dist/plugins/workflow/delegated.js +65 -35
- package/dist/plugins/workflow/delegated.js.map +1 -1
- package/dist/plugins/workflow/execution.d.ts +15 -30
- package/dist/plugins/workflow/execution.js +133 -33
- package/dist/plugins/workflow/execution.js.map +1 -1
- package/dist/plugins/workflow/index.js +197 -435
- package/dist/plugins/workflow/index.js.map +1 -1
- package/dist/plugins/workflow/input-validation.d.ts +48 -0
- package/dist/plugins/workflow/input-validation.js +536 -0
- package/dist/plugins/workflow/input-validation.js.map +1 -0
- package/dist/plugins/workflow/inspection.d.ts +60 -0
- package/dist/plugins/workflow/inspection.js +316 -0
- package/dist/plugins/workflow/inspection.js.map +1 -0
- package/dist/plugins/workflow/protocol.d.ts +2 -0
- package/dist/plugins/workflow/protocol.js +26 -4
- package/dist/plugins/workflow/protocol.js.map +1 -1
- package/dist/plugins/workflow/recovery.d.ts +18 -0
- package/dist/plugins/workflow/recovery.js +217 -0
- package/dist/plugins/workflow/recovery.js.map +1 -0
- package/dist/plugins/workflow/repair.d.ts +1 -1
- package/dist/plugins/workflow/repair.js +9 -10
- package/dist/plugins/workflow/repair.js.map +1 -1
- package/dist/plugins/workflow/results.d.ts +2566 -0
- package/dist/plugins/workflow/results.js +1111 -0
- package/dist/plugins/workflow/results.js.map +1 -0
- package/dist/plugins/workflow/schemas.d.ts +398 -0
- package/dist/plugins/workflow/schemas.js +399 -0
- package/dist/plugins/workflow/schemas.js.map +1 -0
- package/dist/plugins/workflow/state.d.ts +3 -2
- package/dist/plugins/workflow/state.js +15 -8
- package/dist/plugins/workflow/state.js.map +1 -1
- package/dist/plugins/workflow/system-instruction.md +17 -1
- package/dist/plugins/workflow/tooling.d.ts +11 -82
- package/dist/plugins/workflow/tooling.js +478 -461
- package/dist/plugins/workflow/tooling.js.map +1 -1
- package/dist/plugins/workflow/transactions.d.ts +13 -0
- package/dist/plugins/workflow/transactions.js +13 -3
- package/dist/plugins/workflow/transactions.js.map +1 -1
- package/package.json +6 -3
- package/schemas/vvoc/v3.json +1 -1
- package/templates/agents/vv-code-reviewer.md +13 -4
- package/templates/agents/vv-implementer.md +16 -9
- package/templates/agents/vv-spec-reviewer.md +13 -4
- package/templates/skills/vv-execute/SKILL.md +3 -3
- package/templates/skills/vv-execute/references/tool-contracts.md +1750 -0
- package/templates/skills/vv-review/SKILL.md +1 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
// FILE: src/plugins/workflow/recovery.ts
|
|
2
|
+
// VERSION: 1.0.0
|
|
3
|
+
// START_MODULE_CONTRACT
|
|
4
|
+
// PURPOSE: Durable committed-recovery and staged-transaction machinery over the per-session persistence seam.
|
|
5
|
+
// SCOPE: Serialized generic tool transactions (staged persist before publish with per-session queueing), durably committed recovery mutations with synchronous persist and rollback so launch permissions appear only after a durable write, and record/checkpoint capture-restore helpers for rollback. No tool definitions, authorization checks, or domain reducers here.
|
|
6
|
+
// DEPENDS: [@opencode-ai/plugin (Plugin type), src/plugins/workflow/state.ts, src/plugins/workflow/persistence.ts, src/plugins/workflow/transactions.ts]
|
|
7
|
+
// LINKS: [M-PLUGIN-WORKFLOW, M-WORKFLOW-PERSISTENCE, M-WORKFLOW-STATE]
|
|
8
|
+
// ROLE: RUNTIME
|
|
9
|
+
// MAP_MODE: EXPORTS
|
|
10
|
+
// END_MODULE_CONTRACT
|
|
11
|
+
//
|
|
12
|
+
// START_MODULE_MAP
|
|
13
|
+
// RecoverySupportContext - Explicit seam (client, per-session stores, invalid-hydration sessions) consumed by the factory.
|
|
14
|
+
// RecoverySupport - Committed-transaction helpers bound to one plugin instance.
|
|
15
|
+
// createRecoverySupport - Binds the generic staged-transaction committer, the durably committed recovery executor, and the capture-restore helpers to an explicit seam with its own per-plugin serialization queue.
|
|
16
|
+
// END_MODULE_MAP
|
|
17
|
+
//
|
|
18
|
+
// START_CHANGE_SUMMARY
|
|
19
|
+
// LAST_CHANGE: [C-AGENT-TOOL-CONTRACTS T-003 - commitGenericToolResult takes the trusted expected tool identity and validates every owned staged success against it (missing/wrong tag, malformed nested result, and a thrown validator are fail-closed); a thrown validator is summarized safely by name without echoing its message; invalid hydration is a persistence failure and post-apply rollback throws carry persistence category plus an explicit rolled_back outcome.]
|
|
20
|
+
// END_CHANGE_SUMMARY
|
|
21
|
+
import { createRecordLookupKey, createWorkItemStoreView } from "./state.js";
|
|
22
|
+
import { snapshotWorkflowStateChecked } from "./persistence.js";
|
|
23
|
+
import { runWorkflowTransaction, WorkflowTransactionQueue } from "./transactions.js";
|
|
24
|
+
import { formatContractIssues } from "../../lib/agent-tool-contract.js";
|
|
25
|
+
import { normalizeWorkflowFailure, validateWorkflowToolResult, workflowInternalResultFailure, WorkflowDiagnosticError, } from "./results.js";
|
|
26
|
+
export function createRecoverySupport(context) {
|
|
27
|
+
const { client, stores, invalidHydrationSessions } = context;
|
|
28
|
+
// Per-session serialization for generic mutating tool calls. The staged
|
|
29
|
+
// snapshot persists before the committed state is published, so a failed
|
|
30
|
+
// write never exposes new obligations, authority, or launch permissions.
|
|
31
|
+
const workflowTransactions = new WorkflowTransactionQueue();
|
|
32
|
+
/**
|
|
33
|
+
* Producer contract check on a staged success before it is persisted and
|
|
34
|
+
* published. The expected tool identity comes from the trusted wrapper, not
|
|
35
|
+
* from the result itself, so a malformed success that omits or forges `tool`
|
|
36
|
+
* is rejected. A thrown validator is also fail-closed. The operation ran on
|
|
37
|
+
* the staged clone, so a rejection leaves the live store and every committed
|
|
38
|
+
* ledger entry unchanged.
|
|
39
|
+
*/
|
|
40
|
+
function guardStagedWorkflowResult(toolId, result) {
|
|
41
|
+
try {
|
|
42
|
+
if (result.tool !== toolId) {
|
|
43
|
+
return {
|
|
44
|
+
ok: false,
|
|
45
|
+
error: `owned staged result is not tagged for expected tool ${toolId}`,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const validation = validateWorkflowToolResult(toolId, result);
|
|
49
|
+
if (validation.ok) {
|
|
50
|
+
return { ok: true };
|
|
51
|
+
}
|
|
52
|
+
return { ok: false, error: formatContractIssues(validation.issues) };
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
// Never echo an arbitrary exception message: it can carry caller values
|
|
56
|
+
// or secrets. Report only a safe internal summary.
|
|
57
|
+
const name = error instanceof Error && error.name ? error.name : "Error";
|
|
58
|
+
return {
|
|
59
|
+
ok: false,
|
|
60
|
+
error: `owned staged result guard failed closed (${name})`,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async function commitGenericToolResult(sessionId, toolId, run) {
|
|
65
|
+
const liveStore = stores.get(sessionId);
|
|
66
|
+
if (!liveStore) {
|
|
67
|
+
return normalizeWorkflowFailure({
|
|
68
|
+
tool: toolId,
|
|
69
|
+
sessionId,
|
|
70
|
+
ok: false,
|
|
71
|
+
errorCode: "SESSION_MISMATCH",
|
|
72
|
+
message: `no live workflow store for session ${sessionId}`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (invalidHydrationSessions.has(sessionId)) {
|
|
76
|
+
return normalizeWorkflowFailure({
|
|
77
|
+
tool: toolId,
|
|
78
|
+
sessionId,
|
|
79
|
+
ok: false,
|
|
80
|
+
errorCode: "PERSISTENCE_FAILED",
|
|
81
|
+
category: "persistence",
|
|
82
|
+
message: `persisted workflow state for session ${sessionId} is invalid; refusing new mutations`,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const outcome = await runWorkflowTransaction({
|
|
86
|
+
queue: workflowTransactions,
|
|
87
|
+
sessionId,
|
|
88
|
+
getData: () => liveStore.getStoreData(),
|
|
89
|
+
operation: async (staged) => {
|
|
90
|
+
const result = await run(createWorkItemStoreView(staged));
|
|
91
|
+
if (result.ok !== true) {
|
|
92
|
+
// Validation failed: persist nothing and publish nothing.
|
|
93
|
+
return { result, skipPersist: true };
|
|
94
|
+
}
|
|
95
|
+
return { result };
|
|
96
|
+
},
|
|
97
|
+
guardStagedResult: (result) => guardStagedWorkflowResult(toolId, result),
|
|
98
|
+
});
|
|
99
|
+
if (!outcome.ok) {
|
|
100
|
+
if (outcome.invalidResult === true) {
|
|
101
|
+
void client.app
|
|
102
|
+
.log({
|
|
103
|
+
body: {
|
|
104
|
+
service: "workflow",
|
|
105
|
+
level: "error",
|
|
106
|
+
message: "[workflow][generic][BLOCK_RESULT_CONTRACT] staged result failed its contract",
|
|
107
|
+
extra: { sessionID: sessionId, error: outcome.error.slice(0, 300) },
|
|
108
|
+
},
|
|
109
|
+
})
|
|
110
|
+
.catch(() => undefined);
|
|
111
|
+
// Nothing was persisted or published, so the observed outcome is
|
|
112
|
+
// not_applied; report a bounded internal contract failure rather than
|
|
113
|
+
// an INVALID_INPUT request or an unqualified retry.
|
|
114
|
+
return workflowInternalResultFailure({
|
|
115
|
+
tool: toolId,
|
|
116
|
+
sessionId,
|
|
117
|
+
message: `staged workflow result failed its public contract: ${outcome.error}`,
|
|
118
|
+
outcome: "not_applied",
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
void client.app
|
|
122
|
+
.log({
|
|
123
|
+
body: {
|
|
124
|
+
service: "workflow",
|
|
125
|
+
level: "error",
|
|
126
|
+
message: "[workflow][generic][BLOCK_GENERIC_COMMIT] persistence failed",
|
|
127
|
+
extra: { sessionID: sessionId, error: outcome.error.slice(0, 300) },
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
.catch(() => undefined);
|
|
131
|
+
return normalizeWorkflowFailure({
|
|
132
|
+
tool: toolId,
|
|
133
|
+
sessionId,
|
|
134
|
+
ok: false,
|
|
135
|
+
errorCode: "PERSISTENCE_FAILED",
|
|
136
|
+
category: "persistence",
|
|
137
|
+
message: `generic workflow mutation could not be persisted: ${outcome.error}`,
|
|
138
|
+
outcome: "not_applied",
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
return outcome.result;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Execute one recovery mutation durably on the live store: the domain
|
|
145
|
+
* reducer applies to the live entry (re-prechecking after any authorization
|
|
146
|
+
* await), and the whole live store is then persisted synchronously. If the
|
|
147
|
+
* write fails, the captured prior entry is restored so no unpersisted launch
|
|
148
|
+
* permission is ever exposed — there is no await between mutation, persist,
|
|
149
|
+
* and rollback, so no concurrent actor can observe the intermediate state,
|
|
150
|
+
* and no stale whole-store snapshot can regress concurrent transitions.
|
|
151
|
+
*/
|
|
152
|
+
async function executeCommittedRecovery(sessionId, runRecovery, captureRestore, wasApplied) {
|
|
153
|
+
const liveStore = stores.get(sessionId);
|
|
154
|
+
if (!liveStore || invalidHydrationSessions.has(sessionId)) {
|
|
155
|
+
throw new WorkflowDiagnosticError("PERSISTENCE_FAILED", "persistence", `PERSISTENCE_FAILED: persisted workflow state for session ${sessionId} is invalid; resolve or remove it before new control mutations.`, "not_applied");
|
|
156
|
+
}
|
|
157
|
+
const restore = captureRestore();
|
|
158
|
+
const result = await runRecovery(liveStore);
|
|
159
|
+
if (!wasApplied(result)) {
|
|
160
|
+
return result;
|
|
161
|
+
}
|
|
162
|
+
const persisted = snapshotWorkflowStateChecked(sessionId, liveStore.getStoreData());
|
|
163
|
+
if (!persisted.ok) {
|
|
164
|
+
restore();
|
|
165
|
+
void client.app
|
|
166
|
+
.log({
|
|
167
|
+
body: {
|
|
168
|
+
service: "workflow",
|
|
169
|
+
level: "error",
|
|
170
|
+
message: "[workflow][recovery][BLOCK_RECOVERY_COMMIT] recovery persistence failed",
|
|
171
|
+
extra: { sessionID: sessionId, error: persisted.error.slice(0, 300) },
|
|
172
|
+
},
|
|
173
|
+
})
|
|
174
|
+
.catch(() => undefined);
|
|
175
|
+
// The mutation was applied in memory and then rolled back; report the
|
|
176
|
+
// observed outcome truthfully without promising a safe replay.
|
|
177
|
+
throw new WorkflowDiagnosticError("PERSISTENCE_FAILED", "persistence", `PERSISTENCE_FAILED: recovery applied in memory but could not be persisted and was rolled back: ${persisted.error}`, "rolled_back");
|
|
178
|
+
}
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
181
|
+
/** Capture and restore one work-item record entry for recovery rollback. */
|
|
182
|
+
function captureRecordRestore(sessionId, workItemId) {
|
|
183
|
+
const liveStore = stores.get(sessionId);
|
|
184
|
+
if (!liveStore)
|
|
185
|
+
return () => undefined;
|
|
186
|
+
const liveData = liveStore.getStoreData();
|
|
187
|
+
const lookupKey = createRecordLookupKey(sessionId, workItemId);
|
|
188
|
+
const prior = liveData.records.get(lookupKey);
|
|
189
|
+
return () => {
|
|
190
|
+
if (prior) {
|
|
191
|
+
liveData.records.set(lookupKey, prior);
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/** Capture and restore one checkpoint entry for recovery rollback. */
|
|
196
|
+
function captureCheckpointRestore(sessionId, runId, checkpointId) {
|
|
197
|
+
const liveStore = stores.get(sessionId);
|
|
198
|
+
if (!liveStore)
|
|
199
|
+
return () => undefined;
|
|
200
|
+
const run = liveStore.getStoreData().planRuns.get(runId);
|
|
201
|
+
if (!run)
|
|
202
|
+
return () => undefined;
|
|
203
|
+
const priorCheckpoint = run.checkpoints.get(checkpointId);
|
|
204
|
+
return () => {
|
|
205
|
+
if (priorCheckpoint) {
|
|
206
|
+
run.checkpoints.set(checkpointId, priorCheckpoint);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
commitGenericToolResult,
|
|
212
|
+
executeCommittedRecovery,
|
|
213
|
+
captureRecordRestore,
|
|
214
|
+
captureCheckpointRestore,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=recovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery.js","sourceRoot":"","sources":["../../../src/plugins/workflow/recovery.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,iBAAiB;AACjB,wBAAwB;AACxB,gHAAgH;AAChH,+WAA+W;AAC/W,2JAA2J;AAC3J,yEAAyE;AACzE,kBAAkB;AAClB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,6HAA6H;AAC7H,kFAAkF;AAClF,sNAAsN;AACtN,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,qdAAqd;AACrd,qBAAqB;AAGrB,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAsB,MAAM,YAAY,CAAC;AAChG,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,O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AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Plugin } from "@opencode-ai/plugin";
|
|
2
|
-
import type
|
|
2
|
+
import { type ProtocolErrorCode, type TrackedAgentName } from "./protocol.js";
|
|
3
3
|
export type ResumableTaskEnvelope = {
|
|
4
4
|
taskId: string;
|
|
5
5
|
innerResult: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// FILE: src/plugins/workflow/repair.ts
|
|
2
|
-
// VERSION: 0.2.
|
|
2
|
+
// VERSION: 0.2.1
|
|
3
3
|
// START_MODULE_CONTRACT
|
|
4
4
|
// PURPOSE: Recognize resumable OpenCode task envelopes and perform one bounded same-session continuation for malformed tracked outputs, letting the original subagent finish unfinished work or truthfully correct its final report.
|
|
5
|
-
// SCOPE: OpenCode task envelope parsing, protocol-error-aware continuation prompt construction that preserves work-item identity while reporting a truthful post-continuation status/route, explicit hard-stop status detection preserving the observed substantive stop for terminal settlement, continued-output extraction, and same-session continuation calls for tracked workflow results.
|
|
5
|
+
// SCOPE: OpenCode task envelope parsing, protocol-error-aware continuation prompt construction from the shared status/route contract that preserves work-item identity while reporting a truthful post-continuation status/route, explicit hard-stop status detection preserving the observed substantive stop for terminal settlement, continued-output extraction, and same-session continuation calls for tracked workflow results.
|
|
6
6
|
// DEPENDS: [@opencode-ai/plugin, @opencode-ai/sdk, src/plugins/workflow/protocol.ts]
|
|
7
7
|
// LINKS: [M-WORKFLOW-REPAIR, M-WORKFLOW-PROTOCOL, M-PLUGIN-WORKFLOW]
|
|
8
8
|
// ROLE: RUNTIME
|
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
// END_MODULE_MAP
|
|
21
21
|
//
|
|
22
22
|
// START_CHANGE_SUMMARY
|
|
23
|
-
// LAST_CHANGE: [C-
|
|
23
|
+
// LAST_CHANGE: [C-AGENT-TOOL-CONTRACTS T-007 - Generated the continuation status vocabulary and route requirement from the shared protocol contract and stated the first-line/no-fence rule; repair eligibility is unchanged. Prior: detectExplicitHardStopStatus preserves the exact observed substantive stop.]
|
|
24
24
|
// END_CHANGE_SUMMARY
|
|
25
|
+
import { describeStatusVocabulary, resultBlockRequiresRoute, } from "./protocol.js";
|
|
25
26
|
const RESUMABLE_TASK_ID_RE = /^task_id:\s+(\S+)\s+\(for resuming to continue this task if needed\)$/;
|
|
26
27
|
const SAFE_TRACKED_RESULT_REPAIR_CODES = new Set([
|
|
27
28
|
"MISSING_STATUS",
|
|
@@ -132,18 +133,15 @@ export function unwrapResumableTaskResult(output) {
|
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
135
|
export function buildTrackedResultRepairPrompt(options) {
|
|
135
|
-
const statusGuidance = options.agent
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
const routeGuidance = options.agent === "vv-implementer"
|
|
136
|
+
const statusGuidance = `Allowed VVOC_STATUS values: ${describeStatusVocabulary(options.agent)}.`;
|
|
137
|
+
const requiresRoute = resultBlockRequiresRoute(options.agent);
|
|
138
|
+
const routeGuidance = requiresRoute
|
|
139
139
|
? "Include `VVOC_ROUTE` in the strict top block, consistent with the original assignment; do not invent a route that conflicts with it."
|
|
140
140
|
: "Do not include `VVOC_ROUTE`.";
|
|
141
141
|
const exactFormat = [
|
|
142
142
|
`VVOC_WORK_ITEM_ID: ${options.workItemId}`,
|
|
143
143
|
"VVOC_STATUS: <truthful status>",
|
|
144
|
-
...(
|
|
145
|
-
? ["VVOC_ROUTE: <route consistent with the original assignment>"]
|
|
146
|
-
: []),
|
|
144
|
+
...(requiresRoute ? ["VVOC_ROUTE: <route consistent with the original assignment>"] : []),
|
|
147
145
|
"",
|
|
148
146
|
"<brief result handoff>",
|
|
149
147
|
].join("\n");
|
|
@@ -161,6 +159,7 @@ export function buildTrackedResultRepairPrompt(options) {
|
|
|
161
159
|
statusGuidance,
|
|
162
160
|
routeGuidance,
|
|
163
161
|
...(missingBodySeparatorGuidance ? [missingBodySeparatorGuidance] : []),
|
|
162
|
+
"Begin the corrected response with the protocol block on the first line: no preface, prose, or code fences before it.",
|
|
164
163
|
"Return only the corrected final response in this exact shape:",
|
|
165
164
|
exactFormat,
|
|
166
165
|
"Previous malformed response:",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repair.js","sourceRoot":"","sources":["../../../src/plugins/workflow/repair.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,iBAAiB;AACjB,wBAAwB;AACxB,uOAAuO;AACvO,
|
|
1
|
+
{"version":3,"file":"repair.js","sourceRoot":"","sources":["../../../src/plugins/workflow/repair.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,iBAAiB;AACjB,wBAAwB;AACxB,uOAAuO;AACvO,yaAAya;AACza,uFAAuF;AACvF,uEAAuE;AACvE,kBAAkB;AAClB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,gHAAgH;AAChH,gHAAgH;AAChH,kKAAkK;AAClK,sHAAsH;AACtH,yGAAyG;AACzG,wGAAwG;AACxG,gIAAgI;AAChI,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,oTAAoT;AACpT,qBAAqB;AAIrB,OAAO,EACL,wBAAwB,EACxB,wBAAwB,GAGzB,MAAM,eAAe,CAAC;AAQvB,MAAM,oBAAoB,GACxB,uEAAuE,CAAC;AAE1E,MAAM,gCAAgC,GAAmC,IAAI,GAAG,CAAC;IAC/E,gBAAgB;IAChB,eAAe;IACf,2BAA2B;IAC3B,wBAAwB;CACzB,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,8CAA8C,CAAC;AAE5E;;;;GAIG;AACH,MAAM,4BAA4B,GAAG,iDAAiD,CAAC;AAEvF,MAAM,yCAAyC,GAC7C,iYAAiY,CAAC;AAEpY,SAAS,0BAA0B,CAAC,MAAc;IAChD,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,IAAI,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