@osovv/vv-opencode 0.28.0 → 0.29.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.
@@ -1,10 +1,10 @@
1
1
  // FILE: src/plugins/workflow/index.ts
2
- // VERSION: 0.2.3
2
+ // VERSION: 0.2.5
3
3
  // START_MODULE_CONTRACT
4
4
  // PURPOSE: Register workflow work-item tools, tracked task launch/result hooks, and primary-session workflow guidance injection.
5
- // SCOPE: work_item_open/list/close tool registration, tracked launch validation on task tool, OpenCode task-result wrapper normalization, tracked result parsing/state transitions, round-limit gating, and chat.message guidance injection with subagent filtering.
6
- // DEPENDS: [@opencode-ai/plugin, src/lib/managed-agents.ts, src/plugins/workflow/protocol.ts, src/plugins/workflow/state.ts, src/plugins/workflow/transitions.ts, src/plugins/workflow/tooling.ts]
7
- // LINKS: [M-PLUGIN-WORKFLOW, M-WORKFLOW-PROTOCOL, M-WORKFLOW-STATE, M-WORKFLOW-TRANSITIONS, M-WORKFLOW-TOOLING]
5
+ // SCOPE: work_item_open/list/close tool registration, tracked launch validation on task tool, OpenCode task-result wrapper normalization, one-shot resumable result repair, tracked result parsing/state transitions, round-limit gating, and chat.message guidance injection with subagent filtering.
6
+ // DEPENDS: [@opencode-ai/plugin, src/lib/managed-agents.ts, src/plugins/workflow/protocol.ts, src/plugins/workflow/repair.ts, src/plugins/workflow/state.ts, src/plugins/workflow/transitions.ts, src/plugins/workflow/tooling.ts]
7
+ // LINKS: [M-PLUGIN-WORKFLOW, M-WORKFLOW-PROTOCOL, M-WORKFLOW-REPAIR, M-WORKFLOW-STATE, M-WORKFLOW-TRANSITIONS, M-WORKFLOW-TOOLING]
8
8
  // ROLE: RUNTIME
9
9
  // MAP_MODE: EXPORTS
10
10
  // END_MODULE_CONTRACT
@@ -14,6 +14,8 @@
14
14
  // END_MODULE_MAP
15
15
  //
16
16
  // START_CHANGE_SUMMARY
17
+ // LAST_CHANGE: [v0.2.5 - Limited resumable result repair to safe format-only protocol errors and disabled tool use during repair prompts where supported.]
18
+ // LAST_CHANGE: [v0.2.4 - Added a single same-session repair attempt for malformed tracked results inside recognized resumable OpenCode task envelopes.]
17
19
  // LAST_CHANGE: [v0.2.3 - Tightened OpenCode task-result envelope detection to the known resumable task header shape before unwrapping.]
18
20
  // LAST_CHANGE: [v0.2.2 - Restricted task-result wrapper extraction to recognized OpenCode task envelopes so foreign `<task_result>` text still fails strict parsing.]
19
21
  // LAST_CHANGE: [v0.2.1 - Extracted inner OpenCode `<task_result>` content before strict tracked result parsing so task wrapper metadata does not trip protocol validation.]
@@ -23,6 +25,7 @@
23
25
  // END_CHANGE_SUMMARY
24
26
  import { tool } from "@opencode-ai/plugin";
25
27
  import { MANAGED_SUBAGENT_NAMES } from "../../lib/managed-agents.js";
28
+ import { attemptTrackedResultRepair, isTrackedResultRepairEligible, unwrapResumableTaskResult, } from "./repair.js";
26
29
  import { parseResultBlock, parseWorkItemHeader, TRACKED_SUBAGENT_NAMES, } from "./protocol.js";
27
30
  import { createWorkItemStore, getReviewRound, getWorkItem, transitionWorkItemState, } from "./state.js";
28
31
  import { getAllowedNextAgent, getNextState, isAllowedTransition, shouldBlockRound, } from "./transitions.js";
@@ -103,39 +106,6 @@ function appendSystemInstruction(existingSystem, instruction) {
103
106
  function stringifyToolOutput(value) {
104
107
  return JSON.stringify(value, null, 2);
105
108
  }
106
- function extractTaskResultText(output) {
107
- const startTag = "<task_result>";
108
- const endTag = "</task_result>";
109
- const normalizedOutput = output.replace(/\r\n/g, "\n");
110
- const lines = normalizedOutput.split("\n");
111
- const firstMeaningfulIndex = lines.findIndex((line) => line.trim().length > 0);
112
- if (firstMeaningfulIndex < 0) {
113
- return output;
114
- }
115
- const firstMeaningfulLine = lines[firstMeaningfulIndex]?.trim() ?? "";
116
- if (!/^task_id:\s+\S+\s+\(for resuming to continue this task if needed\)$/.test(firstMeaningfulLine)) {
117
- return output;
118
- }
119
- let startTagIndex = firstMeaningfulIndex + 1;
120
- while (startTagIndex < lines.length && (lines[startTagIndex] ?? "").trim().length === 0) {
121
- startTagIndex += 1;
122
- }
123
- if ((lines[startTagIndex] ?? "").trim() !== startTag) {
124
- return output;
125
- }
126
- const endTagIndex = lines.findIndex((line, index) => index > startTagIndex && line.trim() === endTag);
127
- if (endTagIndex < 0) {
128
- return output;
129
- }
130
- const suffixLines = lines.slice(endTagIndex + 1);
131
- if (suffixLines.some((line) => line.trim().length > 0)) {
132
- return output;
133
- }
134
- return lines
135
- .slice(startTagIndex + 1, endTagIndex)
136
- .join("\n")
137
- .trim();
138
- }
139
109
  function createRoundLimitMessage(record, attemptedRound) {
140
110
  return [
141
111
  "LAUNCH_REJECTED_ROUND_LIMIT: review loop gate blocked tracked launch before entering round 3.",
@@ -144,7 +114,7 @@ function createRoundLimitMessage(record, attemptedRound) {
144
114
  ].join(" ");
145
115
  }
146
116
  // START_BLOCK_PLUGIN_ENTRY
147
- export const WorkflowPlugin = async ({ client }) => {
117
+ export const WorkflowPlugin = async ({ client, directory }) => {
148
118
  const store = createWorkItemStore();
149
119
  const knownSubagents = createKnownSubagentSet();
150
120
  const workItemOpenTool = createWorkItemOpenTool(store);
@@ -341,11 +311,47 @@ export const WorkflowPlugin = async ({ client }) => {
341
311
  });
342
312
  throw new Error("RESULT_PROTOCOL_ERROR: tracked task output must be a string");
343
313
  }
344
- const parsed = parseResultBlock({
314
+ const unwrapped = unwrapResumableTaskResult(output.output);
315
+ let parsed = parseResultBlock({
345
316
  agent: subagentType,
346
- output: extractTaskResultText(output.output),
317
+ output: unwrapped.normalizedOutput,
347
318
  expectedWorkItemId: header.value,
348
319
  });
320
+ if (!parsed.ok) {
321
+ if (unwrapped.envelope && isTrackedResultRepairEligible(parsed.error.code)) {
322
+ await client.app.log({
323
+ body: {
324
+ service: "workflow",
325
+ level: "info",
326
+ message: "[workflow][resultParsing][BLOCK_PARSE_RESULT] repair attempted",
327
+ extra: {
328
+ sessionID: input.sessionID,
329
+ agent: subagentType,
330
+ workItemId: header.value,
331
+ taskId: unwrapped.envelope.taskId,
332
+ reason: parsed.error.code,
333
+ attempt: 1,
334
+ },
335
+ },
336
+ });
337
+ const repairedOutput = await attemptTrackedResultRepair({
338
+ client,
339
+ directory,
340
+ taskId: unwrapped.envelope.taskId,
341
+ agent: subagentType,
342
+ workItemId: header.value,
343
+ malformedOutput: unwrapped.normalizedOutput,
344
+ parseErrorMessage: parsed.error.message,
345
+ });
346
+ if (repairedOutput) {
347
+ parsed = parseResultBlock({
348
+ agent: subagentType,
349
+ output: repairedOutput,
350
+ expectedWorkItemId: header.value,
351
+ });
352
+ }
353
+ }
354
+ }
349
355
  if (!parsed.ok) {
350
356
  await client.app.log({
351
357
  body: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/plugins/workflow/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iBAAiB;AACjB,wBAAwB;AACxB,mIAAmI;AACnI,uQAAuQ;AACvQ,qMAAqM;AACrM,kHAAkH;AAClH,kBAAkB;AAClB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,6IAA6I;AAC7I,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,0IAA0I;AAC1I,wKAAwK;AACxK,8KAA8K;AAC9K,2IAA2I;AAC3I,uKAAuK;AACvK,4KAA4K;AAC5K,qBAAqB;AAErB,OAAO,EAA4B,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,GAEvB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,uBAAuB,GAExB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,u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AI,CAAC,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE,CAAC;gBAChE,OAAO;YACT,CAAC;YAED,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,uBAAuB,CAC7C,MAAM,CAAC,OAAO,CAAC,MAAM,EACrB,2BAA2B,CAC5B,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AACF,yBAAyB"}
@@ -0,0 +1,26 @@
1
+ import type { Plugin } from "@opencode-ai/plugin";
2
+ import type { ProtocolErrorCode, TrackedAgentName } from "./protocol.js";
3
+ export type ResumableTaskEnvelope = {
4
+ taskId: string;
5
+ innerResult: string;
6
+ };
7
+ export declare function unwrapResumableTaskResult(output: string): {
8
+ normalizedOutput: string;
9
+ envelope?: ResumableTaskEnvelope;
10
+ };
11
+ export declare function buildTrackedResultRepairPrompt(options: {
12
+ agent: TrackedAgentName;
13
+ workItemId: string;
14
+ malformedOutput: string;
15
+ parseErrorMessage: string;
16
+ }): string;
17
+ export declare function isTrackedResultRepairEligible(code: ProtocolErrorCode): boolean;
18
+ export declare function attemptTrackedResultRepair(options: {
19
+ client: Parameters<Plugin>[0]["client"];
20
+ directory: string;
21
+ taskId: string;
22
+ agent: TrackedAgentName;
23
+ workItemId: string;
24
+ malformedOutput: string;
25
+ parseErrorMessage: string;
26
+ }): Promise<string | undefined>;
@@ -0,0 +1,163 @@
1
+ // FILE: src/plugins/workflow/repair.ts
2
+ // VERSION: 0.1.2
3
+ // START_MODULE_CONTRACT
4
+ // PURPOSE: Recognize resumable OpenCode task envelopes and perform one bounded tracked-result repair attempt in the same child session.
5
+ // SCOPE: OpenCode task envelope parsing, repair prompt construction, repaired text extraction, and same-session repair calls for tracked workflow results.
6
+ // DEPENDS: [@opencode-ai/plugin, @opencode-ai/sdk, src/plugins/workflow/protocol.ts]
7
+ // LINKS: [M-WORKFLOW-REPAIR, M-WORKFLOW-PROTOCOL, M-PLUGIN-WORKFLOW]
8
+ // ROLE: RUNTIME
9
+ // MAP_MODE: EXPORTS
10
+ // END_MODULE_CONTRACT
11
+ //
12
+ // START_MODULE_MAP
13
+ // ResumableTaskEnvelope - Recognized OpenCode resumable task wrapper metadata plus inner tracked result text.
14
+ // unwrapResumableTaskResult - Extracts tracked result text only from known resumable OpenCode task envelopes.
15
+ // buildTrackedResultRepairPrompt - Constructs the strict one-shot repair prompt for the same child session.
16
+ // isTrackedResultRepairEligible - Restricts one-shot repair to safe format-only protocol error classes.
17
+ // attemptTrackedResultRepair - Resumes the same child session once and returns repaired tracked result text when possible.
18
+ // END_MODULE_MAP
19
+ //
20
+ // START_CHANGE_SUMMARY
21
+ // LAST_CHANGE: [v0.1.2 - Excluded duplicate strict top-block field errors from same-session repair so ambiguous tracked results fail closed.]
22
+ // LAST_CHANGE: [v0.1.1 - Restricted repair to safe format-only protocol errors and sent format-only prompt requests with tools disabled where supported.]
23
+ // LAST_CHANGE: [v0.1.0 - Added bounded same-session result repair helpers for malformed tracked workflow outputs in resumable OpenCode task envelopes.]
24
+ // END_CHANGE_SUMMARY
25
+ const RESUMABLE_TASK_ID_RE = /^task_id:\s+(\S+)\s+\(for resuming to continue this task if needed\)$/;
26
+ const SAFE_TRACKED_RESULT_REPAIR_CODES = new Set([
27
+ "MISSING_STATUS",
28
+ "MISSING_ROUTE",
29
+ "UNEXPECTED_TOP_BLOCK_LINE",
30
+ ]);
31
+ const FORMAT_ONLY_REPAIR_SYSTEM_PROMPT = "Format-only workflow repair. Do not call tools, do not perform implementation or review work, and do not cause side effects. Return only the corrected final response text.";
32
+ const FORMAT_ONLY_REPAIR_DISABLED_TOOLS = {
33
+ apply_patch: false,
34
+ bash: false,
35
+ edit: false,
36
+ glob: false,
37
+ grep: false,
38
+ multi_tool_use: false,
39
+ read: false,
40
+ task: false,
41
+ work_item_close: false,
42
+ work_item_list: false,
43
+ work_item_open: false,
44
+ write: false,
45
+ };
46
+ function parseResumableTaskEnvelope(output) {
47
+ const normalizedOutput = output.replace(/\r\n/g, "\n");
48
+ const lines = normalizedOutput.split("\n");
49
+ const firstMeaningfulIndex = lines.findIndex((line) => line.trim().length > 0);
50
+ if (firstMeaningfulIndex < 0) {
51
+ return undefined;
52
+ }
53
+ const firstMeaningfulLine = lines[firstMeaningfulIndex]?.trim() ?? "";
54
+ const taskIdMatch = RESUMABLE_TASK_ID_RE.exec(firstMeaningfulLine);
55
+ if (!taskIdMatch) {
56
+ return undefined;
57
+ }
58
+ let startTagIndex = firstMeaningfulIndex + 1;
59
+ while (startTagIndex < lines.length && (lines[startTagIndex] ?? "").trim().length === 0) {
60
+ startTagIndex += 1;
61
+ }
62
+ if ((lines[startTagIndex] ?? "").trim() !== "<task_result>") {
63
+ return undefined;
64
+ }
65
+ const endTagIndex = lines.findIndex((line, index) => index > startTagIndex && line.trim() === "</task_result>");
66
+ if (endTagIndex < 0) {
67
+ return undefined;
68
+ }
69
+ const suffixLines = lines.slice(endTagIndex + 1);
70
+ if (suffixLines.some((line) => line.trim().length > 0)) {
71
+ return undefined;
72
+ }
73
+ return {
74
+ taskId: taskIdMatch[1],
75
+ innerResult: lines
76
+ .slice(startTagIndex + 1, endTagIndex)
77
+ .join("\n")
78
+ .trim(),
79
+ };
80
+ }
81
+ export function unwrapResumableTaskResult(output) {
82
+ const envelope = parseResumableTaskEnvelope(output);
83
+ return {
84
+ normalizedOutput: envelope?.innerResult ?? output,
85
+ ...(envelope ? { envelope } : {}),
86
+ };
87
+ }
88
+ export function buildTrackedResultRepairPrompt(options) {
89
+ const statusGuidance = options.agent === "vv-implementer"
90
+ ? "Allowed VVOC_STATUS values: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED."
91
+ : "Allowed VVOC_STATUS values: PASS | FAIL | NEEDS_CONTEXT.";
92
+ const routeGuidance = options.agent === "vv-implementer"
93
+ ? "Include `VVOC_ROUTE` in the strict top block and preserve the route that matches your prior result."
94
+ : "Do not include `VVOC_ROUTE`.";
95
+ const exactFormat = [
96
+ `VVOC_WORK_ITEM_ID: ${options.workItemId}`,
97
+ "VVOC_STATUS: <allowed status>",
98
+ ...(options.agent === "vv-implementer" ? ["VVOC_ROUTE: <existing route>"] : []),
99
+ "",
100
+ "<brief result handoff>",
101
+ ].join("\n");
102
+ return [
103
+ `Your previous final response for ${options.workItemId} was malformed for the workflow result protocol.`,
104
+ `Protocol error: ${options.parseErrorMessage}`,
105
+ "Repair only the response format. Do not do additional implementation or review work.",
106
+ "Keep the same underlying outcome and same work item.",
107
+ statusGuidance,
108
+ routeGuidance,
109
+ "Return only the corrected final response in this exact shape:",
110
+ exactFormat,
111
+ "Previous malformed response:",
112
+ "<<<MALFORMED_RESULT",
113
+ options.malformedOutput.trim() || "<empty>",
114
+ ">>>",
115
+ ].join("\n");
116
+ }
117
+ export function isTrackedResultRepairEligible(code) {
118
+ return SAFE_TRACKED_RESULT_REPAIR_CODES.has(code);
119
+ }
120
+ function extractTextParts(parts) {
121
+ return parts
122
+ .filter((part) => part.type === "text")
123
+ .map((part) => part.text)
124
+ .join("")
125
+ .trim();
126
+ }
127
+ export async function attemptTrackedResultRepair(options) {
128
+ try {
129
+ const response = await options.client.session.prompt({
130
+ path: {
131
+ id: options.taskId,
132
+ },
133
+ query: {
134
+ directory: options.directory,
135
+ },
136
+ body: {
137
+ agent: options.agent,
138
+ system: FORMAT_ONLY_REPAIR_SYSTEM_PROMPT,
139
+ tools: FORMAT_ONLY_REPAIR_DISABLED_TOOLS,
140
+ parts: [
141
+ {
142
+ type: "text",
143
+ text: buildTrackedResultRepairPrompt({
144
+ agent: options.agent,
145
+ workItemId: options.workItemId,
146
+ malformedOutput: options.malformedOutput,
147
+ parseErrorMessage: options.parseErrorMessage,
148
+ }),
149
+ },
150
+ ],
151
+ },
152
+ });
153
+ if (response.error || !response.data) {
154
+ return undefined;
155
+ }
156
+ const repairedOutput = extractTextParts(response.data.parts ?? []);
157
+ return repairedOutput || undefined;
158
+ }
159
+ catch {
160
+ return undefined;
161
+ }
162
+ }
163
+ //# sourceMappingURL=repair.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repair.js","sourceRoot":"","sources":["../../../src/plugins/workflow/repair.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,iBAAiB;AACjB,wBAAwB;AACxB,0IAA0I;AAC1I,6JAA6J;AAC7J,uFAAuF;AACvF,uEAAuE;AACvE,kBAAkB;AAClB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,gHAAgH;AAChH,gHAAgH;AAChH,8GAA8G;AAC9G,0GAA0G;AAC1G,6HAA6H;AAC7H,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,gJAAgJ;AAChJ,4JAA4J;AAC5J,0JAA0J;AAC1J,qBAAqB;AAWrB,MAAM,oBAAoB,GACxB,uEAAuE,CAAC;AAE1E,MAAM,gCAAgC,GAAmC,IAAI,GAAG,CAAC;IAC/E,gBAAgB;IAChB,eAAe;IACf,2BAA2B;CAC5B,CAAC,CAAC;AAEH,MAAM,gCAAgC,GACpC,6KAA6K,CAAC;AAEhL,MAAM,iCAAiC,GAAsC;IAC3E,WAAW,EAAE,KAAK;IAClB,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,cAAc,EAAE,KAAK;IACrB,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,KAAK;IACX,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,KAAK;IACrB,cAAc,EAAE,KAAK;IACrB,KAAK,EAAE,KAAK;CACb,CAAC;AAEF,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,CAAC,CAAC;IAC3C,MAAM,oBAAoB,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE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ACrC,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,cAAc,GAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QACnE,OAAO,cAAc,IAAI,SAAS,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -6,9 +6,10 @@ For tracked subagents (`vv-implementer`, `vv-spec-reviewer`, `vv-code-reviewer`)
6
6
  1. Open work items first with `work_item_open`.
7
7
  2. Reuse the returned `VVOC_WORK_ITEM_ID`.
8
8
  3. Put that header as the first line in tracked subagent prompts.
9
- 4. Treat `NEEDS_CONTEXT` as a hard stop.
10
- 5. Use `work_item_list` to inspect workflow state before retrying.
11
- 6. Avoid free-form review loops without explicit work-item identity.
9
+ 4. Prefer lightweight XML-like tagged assignment bodies after the header, such as `<assignment>`, `<goal>`, `<context>`, and `<verification>`.
10
+ 5. Treat `NEEDS_CONTEXT` as a hard stop.
11
+ 6. Use `work_item_list` to inspect workflow state before retrying.
12
+ 7. Avoid free-form review loops without explicit work-item identity.
12
13
 
13
14
  Use `work_item_close` explicitly when a work item is complete.
14
15
  </workflow_protocol>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osovv/vv-opencode",
3
- "version": "0.28.0",
3
+ "version": "0.29.1",
4
4
  "description": "Portable OpenCode workflow plugins, explicit memory, and CLI tooling.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -65,6 +65,7 @@
65
65
  },
66
66
  "scripts": {
67
67
  "build": "rm -rf dist && tsc -p tsconfig.build.json && mkdir -p dist/plugins/memory dist/plugins/workflow && cp src/plugins/memory/system-instruction.md dist/plugins/memory/system-instruction.md && cp src/plugins/workflow/system-instruction.md dist/plugins/workflow/system-instruction.md",
68
+ "prepublishOnly": "bun run build",
68
69
  "typecheck": "tsc --noEmit -p tsconfig.json",
69
70
  "lint": "oxlint --deny warnings src",
70
71
  "fmt": "oxfmt --write src",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cdn.jsdelivr.net/npm/@osovv/vv-opencode@0.28.0/schemas/vvoc/v1.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/@osovv/vv-opencode@0.29.0/schemas/vvoc/v1.json",
4
4
  "title": "vvoc config",
5
5
  "description": "Canonical vvoc configuration document.",
6
6
  "type": "object",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cdn.jsdelivr.net/npm/@osovv/vv-opencode@0.28.0/schemas/vvoc/v2.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/@osovv/vv-opencode@0.29.0/schemas/vvoc/v2.json",
4
4
  "title": "vvoc config",
5
5
  "description": "Canonical vvoc configuration document.",
6
6
  "type": "object",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://cdn.jsdelivr.net/npm/@osovv/vv-opencode@0.28.0/schemas/vvoc/v3.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/@osovv/vv-opencode@0.29.0/schemas/vvoc/v3.json",
4
4
  "title": "vvoc config",
5
5
  "description": "Canonical vvoc configuration document.",
6
6
  "type": "object",
@@ -19,17 +19,17 @@ Operating rules:
19
19
  - Start by deciding the most likely `task_type` and `execution_mode`.
20
20
  - Prefer standard trajectories over ad-hoc classifications.
21
21
  - Ask only the minimum clarifying questions needed to avoid a materially wrong prompt.
22
- - If the user says not to keep clarifying, finish with explicit assumptions instead of blocking.
23
- - Do not add requirements, scope, or constraints that the user did not ask for.
22
+ - If the user says not to keep clarifying, finish with explicit assumptions and proceed.
23
+ - Add only requirements, scope, and constraints that the user asked for.
24
24
  - Reuse stable domain terms from the user and any provided project context. If terminology needs to be mapped, do it once and then stay consistent.
25
25
  - Preserve any project-owned overlays already present in the request or upstream context, such as vocabulary, preferred patterns, boundaries, verification commands, architecture notes, or examples.
26
- - Do not invent project overlays that were not provided.
26
+ - Use only project overlays present in the request or upstream context.
27
27
  - Externalize a compact working state through the XML: goal, route, constraints, non-goals, assumptions, verification, current unknowns, reroute conditions, and project overlays when relevant.
28
28
  - Do not make silent material assumptions. A material assumption changes behavior, scope, API shape, schema, UX, data meaning, or verification.
29
- - Do not include the raw request verbatim in the final XML unless the user explicitly asks for it.
29
+ - Include the raw request in the final XML only when the user explicitly asks for it.
30
30
  - The final XML prompt must always be written in English.
31
- - Omit empty sections instead of emitting placeholders.
32
- - Keep the XML compact for small, localized requests instead of inflating the structure.
31
+ - Omit empty sections entirely.
32
+ - Keep the XML compact for small, localized requests.
33
33
 
34
34
  XML rules:
35
35
 
@@ -96,7 +96,7 @@ Question policy:
96
96
 
97
97
  - Ask at most 3 questions in one turn.
98
98
  - Ask questions only when the answer would materially change `task_type`, `execution_mode`, goal, constraints, non-goals, assumptions, project overlays, current unknowns, reroute conditions, deliverables, acceptance criteria, or verification.
99
- - If the request is already specific enough, do not ask questions.
99
+ - Skip questions when the request is already specific enough.
100
100
 
101
101
  Response policy:
102
102
 
@@ -127,3 +127,8 @@ Example:
127
127
  </verification>
128
128
  </task>
129
129
  ```
130
+
131
+
132
+ <task>
133
+ Your task is the ongoing user request above. Turn it into a structured XML task prompt for a follow-up agent.
134
+ </task>
@@ -59,3 +59,8 @@ Your primary objective is to determine whether the planned action poses a high r
59
59
  "rationale": string,
60
60
  "evidence": [{"message": string, "why": string}]
61
61
  }
62
+
63
+
64
+ <task>
65
+ Your current task is the tool call and transcript above. Assess its risk level and return a JSON judgment with the required schema.
66
+ </task>
@@ -11,8 +11,8 @@ Your job is to investigate bugs, failures, and unclear behavior before implement
11
11
 
12
12
  Iron law:
13
13
 
14
- - No fixes without root-cause investigation first.
15
- - Do not propose speculative patches just because they seem likely.
14
+ - Only fix after root cause is established.
15
+ - Propose patches only after a root cause is established.
16
16
 
17
17
  Default method:
18
18
 
@@ -31,15 +31,15 @@ Rules:
31
31
  - If the issue spans multiple components, inspect the boundaries and identify exactly where behavior diverges.
32
32
  - Reuse stable repository vocabulary. If the repository already has a canonical term, keep it.
33
33
  - If the task context or repository provides project-owned overlays such as architecture notes, boundaries, preferred patterns, verification commands, or examples, treat them as investigation constraints.
34
- - If a test fails, explain why it fails; do not jump straight to code changes.
34
+ - If a test fails, explain why it fails before considering code changes.
35
35
  - If you cannot reproduce the issue, say so clearly and report what evidence is missing.
36
36
  - Do not make silent material assumptions about environment, data shape, expected behavior, or verification.
37
37
  - If new evidence changes the safest route, say so explicitly.
38
38
  - If the root cause becomes bounded and the fix path is clear, recommend `direct_change`.
39
39
  - If the scope expands or the eventual fix crosses multiple boundaries, recommend `change_with_review`.
40
40
  - Use `NEEDS_CONTEXT` when logs, repro steps, or environment details are too incomplete to investigate responsibly.
41
- - If multiple speculative fixes have already failed, stop and question the architecture or assumptions instead of trying a fourth patch.
42
- - If repeated hypotheses or strategy changes are not increasing confidence, stop and summarize instead of continuing blindly.
41
+ - If multiple speculative fixes have already failed, stop and question the architecture or assumptions first.
42
+ - If repeated hypotheses or strategy changes are not increasing confidence, stop and summarize when confidence is not increasing.
43
43
  - Maintain a compact investigation log as you work: hypothesis, experiment, evidence, ruled out, and next experiment or next best step.
44
44
  - Avoid code changes unless the task explicitly asks for implementation after investigation.
45
45
 
@@ -54,3 +54,8 @@ Final response format:
54
54
  - Assumptions / missing evidence:
55
55
  - Ruled out:
56
56
  - Next best step:
57
+
58
+
59
+ <task>
60
+ Your current task is defined by the investigation request at the start of this conversation. Reproduce the issue, establish root cause, and report findings. A fix follows only after a proven root cause.
61
+ </task>
@@ -33,3 +33,8 @@ Return sections in this order:
33
33
  ## Questions
34
34
 
35
35
  ## Summary
36
+
37
+
38
+ <task>
39
+ Your current task is the memory scopes above. Review entries and produce a cleanup report.
40
+ </task>
@@ -55,3 +55,8 @@ Output format:
55
55
  - Plan artifact: path or none
56
56
 
57
57
  If `NEEDS_CONTEXT`, include only the blocking questions and the reason each answer matters.
58
+
59
+
60
+ <task>
61
+ Your current task is defined by the analysis request. Turn ambiguous requirements into precise artifacts for the controller and architect.
62
+ </task>
@@ -53,3 +53,8 @@ Output format:
53
53
  - Plan artifact: path or none
54
54
 
55
55
  If `NEEDS_CONTEXT`, include only the blocking questions and the reason each answer matters.
56
+
57
+
58
+ <task>
59
+ Your current task is defined by the architecture request. Design module boundaries, contracts, implementation waves, and verification gates.
60
+ </task>
@@ -21,23 +21,23 @@ Primary focus:
21
21
 
22
22
  Rules:
23
23
 
24
- - Inspect the code and diff directly. Do not rely on the implementer's report.
24
+ - Inspect the code and diff directly for all findings.
25
25
  - Reconstruct the effective task model before reviewing: goal, route when stated, constraints, non-goals, assumptions, verification, and project-owned overlays when present.
26
26
  - Review only issues introduced by this change or left unresolved by it.
27
- - Do not audit the whole codebase when the task is narrower.
27
+ - Keep review scope within the change boundaries.
28
28
  - Findings come first, ordered by severity.
29
29
  - Use the tightest actionable location package available for every finding: file path, line reference when available, and affected symbol, function, block, or scope when identifiable.
30
30
  - Within `Critical`, `Important`, and `Minor`, use parseable finding lines whenever possible: `- [Label] path:line (symbol/scope) - explanation`. Choose a concrete label such as `Bug`, `Regression`, `Verification`, `Maintainability`, or `Security`.
31
31
  - Phrase each finding so the controller can lift it directly into a normalized finding packet: make the failure mode, concrete location, and expected fix direction explicit.
32
- - Do not force line references or symbol names when unavailable. Use the best available path-level or scope-level reference, or move broader uncertainty into `Residual risks / testing gaps` instead of inventing a location.
32
+ - Do not force line references or symbol names when unavailable. Use the best available path-level or scope-level reference, or move broader uncertainty into `Residual risks / testing gaps`.
33
33
  - Reuse canonical repository terms in findings and residual risks.
34
34
  - If project-owned overlays define preferred patterns, boundaries, or verification commands, evaluate the change against them when present.
35
35
  - Explain what is wrong, why it matters, and what kind of fix is needed.
36
36
  - Treat vague new identifiers as a finding only when they obscure behavior or create a real maintenance risk.
37
37
  - If a bug risk depends on an unstated material assumption, say so explicitly.
38
- - Do not treat route or process choices as findings unless they create a concrete engineering risk.
39
- - Do not spend time on cosmetic nits unless they hide a real engineering risk.
40
- - If a concern lacks a concrete failure mode, keep it under residual risks instead of calling it a finding.
38
+ - Treat route or process choices as findings only when they create a concrete engineering risk.
39
+ - Raise cosmetic concerns only when they hide a real engineering risk.
40
+ - If a concern lacks a concrete failure mode, keep it under residual risks.
41
41
  - If no issues are found, say `No findings` explicitly and mention any residual risk or testing gap.
42
42
 
43
43
  Final response protocol:
@@ -47,7 +47,7 @@ Final response protocol:
47
47
  - `VVOC_STATUS: PASS`
48
48
  - Replace values as needed using only allowed `VVOC_STATUS` values.
49
49
  - Allowed `VVOC_STATUS` values: `PASS | FAIL | NEEDS_CONTEXT`
50
- - Do not add a plain `Status:` line or any other extra top-block field.
50
+ - Use only the specified fields in the top block.
51
51
 
52
52
  Output format after the top block:
53
53
 
@@ -59,3 +59,8 @@ Output format after the top block:
59
59
 
60
60
  If no issues are found, keep `VVOC_STATUS: PASS` and use `- none` under Critical, Important, and Minor.
61
61
  When a finding is present, make the explanation self-contained enough that a follow-up implementer can act on it without re-discovering the area.
62
+
63
+
64
+ <task>
65
+ Your current task is defined by the review request at the start of this conversation. Review the actual code for bugs, regressions, and maintainability risks — findings first, severity ordered.
66
+ </task>