@osovv/vv-opencode 0.19.0 → 0.24.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.
Files changed (80) hide show
  1. package/README.md +45 -9
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.js +9 -5
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/managed-agents.d.ts +3 -3
  6. package/dist/lib/managed-agents.js +14 -13
  7. package/dist/lib/managed-agents.js.map +1 -1
  8. package/dist/lib/model-roles.d.ts +3 -3
  9. package/dist/lib/model-roles.js +5 -4
  10. package/dist/lib/model-roles.js.map +1 -1
  11. package/dist/lib/opencode.js +100 -5
  12. package/dist/lib/opencode.js.map +1 -1
  13. package/dist/lib/vvoc-config.js +5 -4
  14. package/dist/lib/vvoc-config.js.map +1 -1
  15. package/dist/plugins/hashline-edit/autocorrect-replacement-lines.d.ts +1 -0
  16. package/dist/plugins/hashline-edit/autocorrect-replacement-lines.js +184 -0
  17. package/dist/plugins/hashline-edit/autocorrect-replacement-lines.js.map +1 -0
  18. package/dist/plugins/hashline-edit/constants.d.ts +4 -0
  19. package/dist/plugins/hashline-edit/constants.js +26 -0
  20. package/dist/plugins/hashline-edit/constants.js.map +1 -0
  21. package/dist/plugins/hashline-edit/edit-operation-primitives.d.ts +10 -0
  22. package/dist/plugins/hashline-edit/edit-operation-primitives.js +114 -0
  23. package/dist/plugins/hashline-edit/edit-operation-primitives.js.map +1 -0
  24. package/dist/plugins/hashline-edit/edit-operations.d.ts +7 -0
  25. package/dist/plugins/hashline-edit/edit-operations.js +168 -0
  26. package/dist/plugins/hashline-edit/edit-operations.js.map +1 -0
  27. package/dist/plugins/hashline-edit/edit-text-normalization.d.ts +6 -0
  28. package/dist/plugins/hashline-edit/edit-text-normalization.js +123 -0
  29. package/dist/plugins/hashline-edit/edit-text-normalization.js.map +1 -0
  30. package/dist/plugins/hashline-edit/file-text-canonicalization.d.ts +7 -0
  31. package/dist/plugins/hashline-edit/file-text-canonicalization.js +52 -0
  32. package/dist/plugins/hashline-edit/file-text-canonicalization.js.map +1 -0
  33. package/dist/plugins/hashline-edit/hash-computation.d.ts +3 -0
  34. package/dist/plugins/hashline-edit/hash-computation.js +34 -0
  35. package/dist/plugins/hashline-edit/hash-computation.js.map +1 -0
  36. package/dist/plugins/hashline-edit/index.d.ts +2 -0
  37. package/dist/plugins/hashline-edit/index.js +246 -0
  38. package/dist/plugins/hashline-edit/index.js.map +1 -0
  39. package/dist/plugins/hashline-edit/normalize-edits.d.ts +10 -0
  40. package/dist/plugins/hashline-edit/normalize-edits.js +82 -0
  41. package/dist/plugins/hashline-edit/normalize-edits.js.map +1 -0
  42. package/dist/plugins/hashline-edit/tool-description.d.ts +1 -0
  43. package/dist/plugins/hashline-edit/tool-description.js +35 -0
  44. package/dist/plugins/hashline-edit/tool-description.js.map +1 -0
  45. package/dist/plugins/hashline-edit/types.d.ts +17 -0
  46. package/dist/plugins/hashline-edit/types.js +19 -0
  47. package/dist/plugins/hashline-edit/types.js.map +1 -0
  48. package/dist/plugins/hashline-edit/validation.d.ts +20 -0
  49. package/dist/plugins/hashline-edit/validation.js +160 -0
  50. package/dist/plugins/hashline-edit/validation.js.map +1 -0
  51. package/dist/plugins/system-context-injection/index.js +65 -2
  52. package/dist/plugins/system-context-injection/index.js.map +1 -1
  53. package/dist/plugins/workflow/index.d.ts +2 -0
  54. package/dist/plugins/workflow/index.js +411 -0
  55. package/dist/plugins/workflow/index.js.map +1 -0
  56. package/dist/plugins/workflow/protocol.d.ts +33 -0
  57. package/dist/plugins/workflow/protocol.js +188 -0
  58. package/dist/plugins/workflow/protocol.js.map +1 -0
  59. package/dist/plugins/workflow/state.d.ts +79 -0
  60. package/dist/plugins/workflow/state.js +307 -0
  61. package/dist/plugins/workflow/state.js.map +1 -0
  62. package/dist/plugins/workflow/system-instruction.md +14 -0
  63. package/dist/plugins/workflow/tooling.d.ts +26 -0
  64. package/dist/plugins/workflow/tooling.js +161 -0
  65. package/dist/plugins/workflow/tooling.js.map +1 -0
  66. package/dist/plugins/workflow/transitions.d.ts +7 -0
  67. package/dist/plugins/workflow/transitions.js +102 -0
  68. package/dist/plugins/workflow/transitions.js.map +1 -0
  69. package/package.json +11 -3
  70. package/schemas/vvoc/v1.json +1 -1
  71. package/schemas/vvoc/v2.json +1 -1
  72. package/schemas/vvoc/v3.json +1 -1
  73. package/templates/agents/enhancer.md +54 -21
  74. package/templates/agents/investitagor.md +18 -6
  75. package/templates/agents/vv-code-reviewer.md +57 -0
  76. package/templates/agents/vv-implementer.md +78 -0
  77. package/templates/agents/vv-spec-reviewer.md +62 -0
  78. package/templates/agents/code-reviewer.md +0 -37
  79. package/templates/agents/implementer.md +0 -53
  80. package/templates/agents/spec-reviewer.md +0 -41
@@ -0,0 +1,161 @@
1
+ // FILE: src/plugins/workflow/tooling.ts
2
+ // VERSION: 0.1.1
3
+ // START_MODULE_CONTRACT
4
+ // PURPOSE: Provide work-item tooling handlers that wrap workflow state operations with structured protocol-friendly responses.
5
+ // SCOPE: work_item_open, work_item_list, and work_item_close tool definitions and deterministic execution responses.
6
+ // DEPENDS: [src/plugins/workflow/state.ts]
7
+ // LINKS: [M-WORKFLOW-TOOLING]
8
+ // ROLE: RUNTIME
9
+ // MAP_MODE: EXPORTS
10
+ // END_MODULE_CONTRACT
11
+ //
12
+ // START_MODULE_MAP
13
+ // WorkflowToolContext - Minimal execution context required by workflow tools.
14
+ // WorkflowToolDefinition - Deterministic tool definition shape with execute handler.
15
+ // createWorkItemOpenTool - Creates work_item_open tool wrapper around openWorkItem.
16
+ // createWorkItemListTool - Creates work_item_list tool wrapper around listWorkItems.
17
+ // createWorkItemCloseTool - Creates work_item_close tool wrapper around closeWorkItem.
18
+ // END_MODULE_MAP
19
+ //
20
+ // START_CHANGE_SUMMARY
21
+ // LAST_CHANGE: [v0.1.1 - Wired work_item_list includeClosed flag into state listing options.]
22
+ // LAST_CHANGE: [v0.1.0 - Added workflow core tooling handlers for open/list/close operations with structured results and VVOC headers.]
23
+ // END_CHANGE_SUMMARY
24
+ import { closeWorkItem, getReviewRound, listWorkItems, openWorkItem, } from "./state.js";
25
+ function coerceNonEmptyString(value) {
26
+ if (typeof value !== "string")
27
+ return undefined;
28
+ const trimmed = value.trim();
29
+ return trimmed || undefined;
30
+ }
31
+ // START_CONTRACT: createWorkItemOpenTool
32
+ // PURPOSE: Build work_item_open handler that supports deterministic batch idempotent open operations.
33
+ // INPUTS: { store: WorkItemStore - workflow in-memory store }
34
+ // OUTPUTS: { WorkflowToolDefinition<OpenArgs, unknown> - executable tool definition }
35
+ // SIDE_EFFECTS: [Mutates in-memory work-item store through open operations]
36
+ // LINKS: [M-WORKFLOW-TOOLING, M-WORKFLOW-STATE]
37
+ // END_CONTRACT: createWorkItemOpenTool
38
+ export function createWorkItemOpenTool(store) {
39
+ return {
40
+ name: "work_item_open",
41
+ description: "Open one or more workflow work items idempotently.",
42
+ execute: (args, context) => {
43
+ const inputItems = Array.isArray(args.items) ? args.items : [];
44
+ const results = inputItems.map((item) => {
45
+ const key = coerceNonEmptyString(item.key);
46
+ const title = coerceNonEmptyString(item.title);
47
+ if (!key || !title) {
48
+ return {
49
+ ok: false,
50
+ errorCode: "INVALID_INPUT",
51
+ message: "INVALID_INPUT: key and title must be non-empty strings",
52
+ };
53
+ }
54
+ const opened = openWorkItem(store, {
55
+ sessionId: context.sessionId,
56
+ key,
57
+ title,
58
+ });
59
+ if (!opened.ok) {
60
+ return {
61
+ ok: false,
62
+ errorCode: opened.errorCode,
63
+ message: opened.message,
64
+ existingWorkItemId: opened.existingWorkItemId,
65
+ };
66
+ }
67
+ return {
68
+ ok: true,
69
+ reused: opened.reused,
70
+ workItemId: opened.record.workItemId,
71
+ header: opened.header,
72
+ state: opened.record.state,
73
+ };
74
+ });
75
+ return {
76
+ tool: "work_item_open",
77
+ sessionId: context.sessionId,
78
+ items: results,
79
+ };
80
+ },
81
+ };
82
+ }
83
+ // START_CONTRACT: createWorkItemListTool
84
+ // PURPOSE: Build work_item_list handler that returns current work items and review metadata.
85
+ // INPUTS: { store: WorkItemStore - workflow in-memory store }
86
+ // OUTPUTS: { WorkflowToolDefinition<ListArgs, unknown> - executable tool definition }
87
+ // SIDE_EFFECTS: [none]
88
+ // LINKS: [M-WORKFLOW-TOOLING, M-WORKFLOW-STATE]
89
+ // END_CONTRACT: createWorkItemListTool
90
+ export function createWorkItemListTool(store) {
91
+ return {
92
+ name: "work_item_list",
93
+ description: "List workflow work items for the current session.",
94
+ execute: (args, context) => {
95
+ const includeClosed = args.includeClosed === true;
96
+ const records = listWorkItems(store, context.sessionId, { includeClosed });
97
+ return {
98
+ tool: "work_item_list",
99
+ sessionId: context.sessionId,
100
+ includeClosed,
101
+ items: records.map((record) => ({
102
+ workItemId: record.workItemId,
103
+ header: `VVOC_WORK_ITEM_ID: ${record.workItemId}`,
104
+ key: record.key,
105
+ title: record.title,
106
+ state: record.state,
107
+ specReviewCount: record.specReviewCount,
108
+ codeReviewCount: record.codeReviewCount,
109
+ reviewRound: getReviewRound(record),
110
+ createdAt: record.createdAt,
111
+ updatedAt: record.updatedAt,
112
+ })),
113
+ };
114
+ },
115
+ };
116
+ }
117
+ // START_CONTRACT: createWorkItemCloseTool
118
+ // PURPOSE: Build work_item_close handler that closes an existing work item.
119
+ // INPUTS: { store: WorkItemStore - workflow in-memory store }
120
+ // OUTPUTS: { WorkflowToolDefinition<CloseArgs, unknown> - executable tool definition }
121
+ // SIDE_EFFECTS: [Mutates in-memory work-item store through close operations]
122
+ // LINKS: [M-WORKFLOW-TOOLING, M-WORKFLOW-STATE]
123
+ // END_CONTRACT: createWorkItemCloseTool
124
+ export function createWorkItemCloseTool(store) {
125
+ return {
126
+ name: "work_item_close",
127
+ description: "Close a workflow work item by id.",
128
+ execute: (args, context) => {
129
+ const workItemId = coerceNonEmptyString(args.workItemId);
130
+ if (!workItemId) {
131
+ return {
132
+ tool: "work_item_close",
133
+ sessionId: context.sessionId,
134
+ ok: false,
135
+ errorCode: "INVALID_INPUT",
136
+ message: "INVALID_INPUT: workItemId must be a non-empty string",
137
+ };
138
+ }
139
+ const closed = closeWorkItem(store, context.sessionId, workItemId);
140
+ if (!closed.ok) {
141
+ return {
142
+ tool: "work_item_close",
143
+ sessionId: context.sessionId,
144
+ ok: false,
145
+ errorCode: closed.errorCode,
146
+ message: closed.message,
147
+ };
148
+ }
149
+ return {
150
+ tool: "work_item_close",
151
+ sessionId: context.sessionId,
152
+ ok: true,
153
+ workItemId: closed.record.workItemId,
154
+ header: closed.header,
155
+ state: closed.record.state,
156
+ closedAt: closed.record.closedAt,
157
+ };
158
+ },
159
+ };
160
+ }
161
+ //# sourceMappingURL=tooling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooling.js","sourceRoot":"","sources":["../../../src/plugins/workflow/tooling.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,iBAAiB;AACjB,wBAAwB;AACxB,iIAAiI;AACjI,uHAAuH;AACvH,6CAA6C;AAC7C,gCAAgC;AAChC,kBAAkB;AAClB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,gFAAgF;AAChF,uFAAuF;AACvF,sFAAsF;AACtF,uFAAuF;AACvF,yFAAyF;AACzF,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,gGAAgG;AAChG,0IAA0I;AAC1I,qBAAqB;AAErB,OAAO,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,YAAY,GAEb,MAAM,YAAY,CAAC;AA6BpB,SAAS,oBAAoB,CAAC,KAAc;IAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,IAAI,SAAS,CAAC;AAC9B,CAAC;AAED,yCAAyC;AACzC,wGAAwG;AACxG,gEAAgE;AAChE,wFAAwF;AACxF,8EAA8E;AAC9E,kDAAkD;AAClD,uCAAuC;AACvC,MAA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AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ParsedResultBlock, TrackedAgentName } from "./protocol.js";
2
+ import type { WorkItemState } from "./state.js";
3
+ export declare const MAX_REVIEW_ROUNDS = 2;
4
+ export declare function getAllowedNextAgent(state: WorkItemState): TrackedAgentName | null;
5
+ export declare function isAllowedTransition(state: WorkItemState, agent: TrackedAgentName): boolean;
6
+ export declare function getNextState(currentState: WorkItemState, result: ParsedResultBlock): WorkItemState;
7
+ export declare function shouldBlockRound(reviewRound: number): boolean;
@@ -0,0 +1,102 @@
1
+ // FILE: src/plugins/workflow/transitions.ts
2
+ // VERSION: 0.1.0
3
+ // START_MODULE_CONTRACT
4
+ // PURPOSE: Provide deterministic workflow transition rules, allowed-next-agent resolution, and loop-gate policy checks.
5
+ // SCOPE: Work-item state transition mapping from tracked results, launch permission checks by state, and review-round limit checks.
6
+ // DEPENDS: [src/plugins/workflow/protocol.ts, src/plugins/workflow/state.ts]
7
+ // LINKS: [M-WORKFLOW-TRANSITIONS]
8
+ // ROLE: RUNTIME
9
+ // MAP_MODE: EXPORTS
10
+ // END_MODULE_CONTRACT
11
+ //
12
+ // START_MODULE_MAP
13
+ // MAX_REVIEW_ROUNDS - Maximum allowed review rounds before loop-gate block.
14
+ // getNextState - Computes next work-item state from tracked agent result.
15
+ // getAllowedNextAgent - Resolves the only allowed tracked agent for a state.
16
+ // isAllowedTransition - Checks whether launching an agent from current state is allowed.
17
+ // shouldBlockRound - Enforces loop-gate policy for review rounds.
18
+ // END_MODULE_MAP
19
+ //
20
+ // START_CHANGE_SUMMARY
21
+ // LAST_CHANGE: [v0.1.0 - Added deterministic state transition policy, launch-allowance resolution, and review round-gate checks.]
22
+ // END_CHANGE_SUMMARY
23
+ export const MAX_REVIEW_ROUNDS = 2;
24
+ // START_CONTRACT: getAllowedNextAgent
25
+ // PURPOSE: Resolve the single tracked agent allowed to run from the current state.
26
+ // INPUTS: { state: WorkItemState - current work-item lifecycle state }
27
+ // OUTPUTS: { TrackedAgentName | null - allowed tracked agent or null when no launch is allowed }
28
+ // SIDE_EFFECTS: [none]
29
+ // LINKS: [M-WORKFLOW-TRANSITIONS]
30
+ // END_CONTRACT: getAllowedNextAgent
31
+ export function getAllowedNextAgent(state) {
32
+ if (state === "open" || state === "awaiting_implementer") {
33
+ return "vv-implementer";
34
+ }
35
+ if (state === "awaiting_spec_review") {
36
+ return "vv-spec-reviewer";
37
+ }
38
+ if (state === "awaiting_code_review") {
39
+ return "vv-code-reviewer";
40
+ }
41
+ return null;
42
+ }
43
+ // START_CONTRACT: isAllowedTransition
44
+ // PURPOSE: Check whether launching the requested tracked agent is valid for current state.
45
+ // INPUTS: { state: WorkItemState - current state, agent: TrackedAgentName - requested tracked subagent }
46
+ // OUTPUTS: { boolean - true when launch is allowed }
47
+ // SIDE_EFFECTS: [none]
48
+ // LINKS: [M-WORKFLOW-TRANSITIONS]
49
+ // END_CONTRACT: isAllowedTransition
50
+ export function isAllowedTransition(state, agent) {
51
+ return getAllowedNextAgent(state) === agent;
52
+ }
53
+ // START_CONTRACT: getNextState
54
+ // PURPOSE: Compute deterministic next work-item state from a tracked subagent result.
55
+ // INPUTS: { currentState: WorkItemState - current lifecycle state, result: ParsedResultBlock - validated tracked result block }
56
+ // OUTPUTS: { WorkItemState - next lifecycle state }
57
+ // SIDE_EFFECTS: [none]
58
+ // LINKS: [M-WORKFLOW-TRANSITIONS]
59
+ // END_CONTRACT: getNextState
60
+ export function getNextState(currentState, result) {
61
+ if (result.agent === "vv-implementer") {
62
+ if (result.status === "DONE" || result.status === "DONE_WITH_CONCERNS") {
63
+ return "awaiting_spec_review";
64
+ }
65
+ if (result.status === "NEEDS_CONTEXT") {
66
+ return "needs_context";
67
+ }
68
+ return "blocked";
69
+ }
70
+ if (result.agent === "vv-spec-reviewer") {
71
+ if (result.status === "PASS") {
72
+ return "awaiting_code_review";
73
+ }
74
+ if (result.status === "FAIL") {
75
+ return "awaiting_implementer";
76
+ }
77
+ return "needs_context";
78
+ }
79
+ if (result.agent === "vv-code-reviewer") {
80
+ if (result.status === "PASS") {
81
+ return "ready_to_close";
82
+ }
83
+ if (result.status === "FAIL") {
84
+ return "awaiting_implementer";
85
+ }
86
+ return "needs_context";
87
+ }
88
+ return currentState;
89
+ }
90
+ // START_CONTRACT: shouldBlockRound
91
+ // PURPOSE: Enforce loop-gate policy by rejecting rounds above MAX_REVIEW_ROUNDS.
92
+ // INPUTS: { reviewRound: number - computed review round }
93
+ // OUTPUTS: { boolean - true when launch must be blocked }
94
+ // SIDE_EFFECTS: [none]
95
+ // LINKS: [M-WORKFLOW-TRANSITIONS]
96
+ // END_CONTRACT: shouldBlockRound
97
+ // START_BLOCK_CHECK_ROUND_LIMIT
98
+ export function shouldBlockRound(reviewRound) {
99
+ return reviewRound > MAX_REVIEW_ROUNDS;
100
+ }
101
+ // END_BLOCK_CHECK_ROUND_LIMIT
102
+ //# sourceMappingURL=transitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transitions.js","sourceRoot":"","sources":["../../../src/plugins/workflow/transitions.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,iBAAiB;AACjB,wBAAwB;AACxB,0HAA0H;AAC1H,sIAAsI;AACtI,+EAA+E;AAC/E,oCAAoC;AACpC,kBAAkB;AAClB,sBAAsB;AACtB,sBAAsB;AACtB,EAAE;AACF,mBAAmB;AACnB,8EAA8E;AAC9E,4EAA4E;AAC5E,+EAA+E;AAC/E,2FAA2F;AAC3F,oEAAoE;AACpE,iBAAiB;AACjB,EAAE;AACF,uBAAuB;AACvB,oIAAoI;AACpI,qBAAqB;AAKrB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAEnC,sCAAsC;AACtC,qFAAqF;AACrF,yEAAyE;AACzE,mGAAmG;AACnG,yBAAyB;AACzB,oCAAoC;AACpC,oCAAoC;AACpC,MAAM,UAAU,mBAAmB,CAAC,KAAoB;IACtD,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,sB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,IAAI,MAAM,CAAC,KAAK,KAAK,kBAAkB,EAAE,CAAC;QACxC,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YAC7B,OAAO,gBAAgB,CAAC;QAC1B,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;YAC7B,OAAO,sBAAsB,CAAC;QAChC,CAAC;QACD,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,mCAAmC;AACnC,mFAAmF;AACnF,4DAA4D;AAC5D,4DAA4D;AAC5D,yBAAyB;AACzB,oCAAoC;AACpC,iCAAiC;AACjC,gCAAgC;AAChC,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAClD,OAAO,WAAW,GAAG,iBAAiB,CAAC;AACzC,CAAC;AACD,8BAA8B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osovv/vv-opencode",
3
- "version": "0.19.0",
3
+ "version": "0.24.0",
4
4
  "description": "Portable OpenCode workflow plugins, explicit memory, and CLI tooling.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -38,6 +38,10 @@
38
38
  "types": "./dist/plugins/guardian/index.d.ts",
39
39
  "import": "./dist/plugins/guardian/index.js"
40
40
  },
41
+ "./plugins/hashline-edit": {
42
+ "types": "./dist/plugins/hashline-edit/index.d.ts",
43
+ "import": "./dist/plugins/hashline-edit/index.js"
44
+ },
41
45
  "./plugins/memory": {
42
46
  "types": "./dist/plugins/memory/index.d.ts",
43
47
  "import": "./dist/plugins/memory/index.js"
@@ -50,20 +54,24 @@
50
54
  "types": "./dist/plugins/system-context-injection/index.d.ts",
51
55
  "import": "./dist/plugins/system-context-injection/index.js"
52
56
  },
57
+ "./plugins/workflow": {
58
+ "types": "./dist/plugins/workflow/index.d.ts",
59
+ "import": "./dist/plugins/workflow/index.js"
60
+ },
53
61
  "./plugins/secrets-redaction": {
54
62
  "types": "./dist/plugins/secrets-redaction/index.d.ts",
55
63
  "import": "./dist/plugins/secrets-redaction/index.js"
56
64
  }
57
65
  },
58
66
  "scripts": {
59
- "build": "rm -rf dist && tsc -p tsconfig.build.json && mkdir -p dist/plugins/memory && cp src/plugins/memory/system-instruction.md dist/plugins/memory/system-instruction.md",
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",
60
68
  "typecheck": "tsc --noEmit -p tsconfig.json",
61
69
  "lint": "oxlint --deny warnings src",
62
70
  "fmt": "oxfmt --write src",
63
71
  "fmt:check": "oxfmt --check src",
64
72
  "test": "bun test",
65
73
  "check": "bun run typecheck && bun run lint && bun run fmt:check && bun test",
66
- "pack:check": "bun run build && bun -e \"const root = await import('./dist/index.js'); if (!('GuardianPlugin' in root)) throw new Error('dist root export missing GuardianPlugin'); if (!('MemoryPlugin' in root)) throw new Error('dist root export missing MemoryPlugin'); if (!('ModelRolesPlugin' in root)) throw new Error('dist root export missing ModelRolesPlugin'); if (!('SystemContextInjectionPlugin' in root)) throw new Error('dist root export missing SystemContextInjectionPlugin'); if (!('SecretsRedactionPlugin' in root)) throw new Error('dist root export missing SecretsRedactionPlugin'); await import('./dist/plugins/guardian/index.js'); await import('./dist/plugins/memory/index.js'); await import('./dist/plugins/model-roles/index.js'); await import('./dist/plugins/system-context-injection/index.js')\" && npm pack --dry-run",
74
+ "pack:check": "bun run build && bun -e \"const root = await import('./dist/index.js'); if (!('GuardianPlugin' in root)) throw new Error('dist root export missing GuardianPlugin'); if (!('HashlineEditPlugin' in root)) throw new Error('dist root export missing HashlineEditPlugin'); if (!('MemoryPlugin' in root)) throw new Error('dist root export missing MemoryPlugin'); if (!('ModelRolesPlugin' in root)) throw new Error('dist root export missing ModelRolesPlugin'); if (!('SystemContextInjectionPlugin' in root)) throw new Error('dist root export missing SystemContextInjectionPlugin'); if (!('WorkflowPlugin' in root)) throw new Error('dist root export missing WorkflowPlugin'); if (!('SecretsRedactionPlugin' in root)) throw new Error('dist root export missing SecretsRedactionPlugin'); await import('./dist/plugins/guardian/index.js'); await import('./dist/plugins/hashline-edit/index.js'); await import('./dist/plugins/memory/index.js'); await import('./dist/plugins/model-roles/index.js'); await import('./dist/plugins/system-context-injection/index.js'); await import('./dist/plugins/workflow/index.js')\" && npm pack --dry-run",
67
75
  "prepare": "lefthook install --force"
68
76
  },
69
77
  "dependencies": {
@@ -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.19.0/schemas/vvoc/v1.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/@osovv/vv-opencode@0.24.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.19.0/schemas/vvoc/v2.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/@osovv/vv-opencode@0.24.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.19.0/schemas/vvoc/v3.json",
3
+ "$id": "https://cdn.jsdelivr.net/npm/@osovv/vv-opencode@0.24.0/schemas/vvoc/v3.json",
4
4
  "title": "vvoc config",
5
5
  "description": "Canonical vvoc configuration document.",
6
6
  "type": "object",
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Turns raw user intent into a structured XML prompt for a follow-up agent.
2
+ description: Turns raw user intent into a structured XML task prompt for a follow-up agent.
3
3
  mode: primary
4
4
  permission:
5
5
  edit: deny
@@ -10,61 +10,92 @@ permission:
10
10
 
11
11
  You are the enhancer agent.
12
12
 
13
- Your job is to convert a raw user request into a clean structured XML prompt for a follow-up agent.
13
+ Your job is to turn a raw user request into a clean structured XML task prompt for a follow-up agent.
14
14
  Do not execute the task yourself.
15
15
 
16
16
  Operating rules:
17
17
 
18
18
  - Preserve the user's actual intent, but rewrite it so another agent can execute it reliably.
19
+ - Start by deciding the most likely `task_type` and `execution_mode`.
20
+ - Prefer standard trajectories over ad-hoc classifications.
19
21
  - Ask only the minimum clarifying questions needed to avoid a materially wrong prompt.
20
22
  - If the user says not to keep clarifying, finish with explicit assumptions instead of blocking.
21
23
  - Do not add requirements, scope, or constraints that the user did not ask for.
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
+ - 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.
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
+ - Do not make silent material assumptions. A material assumption changes behavior, scope, API shape, schema, UX, data meaning, or verification.
22
29
  - Do not include the raw request verbatim in the final XML unless the user explicitly asks for it.
23
30
  - The final XML prompt must always be written in English.
24
31
  - Omit empty sections instead of emitting placeholders.
32
+ - Keep the XML compact for small, localized requests instead of inflating the structure.
25
33
 
26
34
  XML rules:
27
35
 
28
36
  - Use `<task>` as the root element.
29
- - Use semantic tag names that keep both meaning and identity in the tag itself.
30
- - For repeated elements, prefer unique semantic tags such as `<constraint-1>`, `<deliverable-2>`, and `<verification-check-1>`.
31
- - Do not use generic repeated tags like `<item>` or `<item-1>` when a more specific semantic tag is possible.
32
- - Do not use repeated identical child tags with `index` attributes unless the user explicitly asks for that style.
37
+ - Use a stable schema so downstream agents can rely on predictable sections.
38
+ - Include `<task_type>` and `<execution_mode>` when you have enough information to classify the work.
39
+ - Use container sections such as `<context>`, `<constraints>`, `<non_goals>`, `<deliverables>`, `<acceptance_criteria>`, `<verification>`, `<assumptions>`, `<current_unknowns>`, `<reroute_if>`, and `<project_overlays>` when they are relevant.
40
+ - Inside container sections, use unique semantic child tags such as `<context_detail_1>`, `<constraint_1>`, `<deliverable_2>`, and `<verification_check_1>`.
41
+ - Prefer semantically meaningful child-tag names that match the task domain or overlay type.
42
+ - Do not use repeated identical child tags.
43
+ - Do not use generic tags such as `<item>` or `<entry>` when a more specific semantic tag is available.
33
44
  - The final XML must be self-sufficient for a capable follow-up agent.
34
45
 
46
+ Classification rules:
47
+
48
+ - `task_type`: `implement` | `investigate` | `review` | `refactor` | `docs` | `mixed`
49
+ - `execution_mode`: `direct_change` | `investigate_first` | `change_with_review`
50
+ - Prefer `investigate_first` when the request is about a bug, failure, regression, or unclear behavior.
51
+ - Prefer `change_with_review` when the task is multi-file, ambiguous, or likely to benefit from explicit review.
52
+ - Prefer `direct_change` when the task is localized, clear, and low-risk.
53
+ - If the route is unstable, prefer a short question or an explicit assumption over ornamental certainty.
54
+
35
55
  Preferred XML shape:
36
56
 
37
57
  ```xml
38
58
  <task>
39
59
  <goal>...</goal>
60
+ <task_type>...</task_type>
61
+ <execution_mode>...</execution_mode>
40
62
  <context>
41
- <context-detail-1>...</context-detail-1>
63
+ <context_detail_1>...</context_detail_1>
42
64
  </context>
43
65
  <constraints>
44
- <constraint-1>...</constraint-1>
66
+ <constraint_1>...</constraint_1>
45
67
  </constraints>
46
68
  <non_goals>
47
- <non-goal-1>...</non-goal-1>
69
+ <non_goal_1>...</non_goal_1>
48
70
  </non_goals>
49
71
  <deliverables>
50
- <deliverable-1>...</deliverable-1>
72
+ <deliverable_1>...</deliverable_1>
51
73
  </deliverables>
52
74
  <acceptance_criteria>
53
- <acceptance-criterion-1>...</acceptance-criterion-1>
75
+ <acceptance_criterion_1>...</acceptance_criterion_1>
54
76
  </acceptance_criteria>
55
77
  <verification>
56
- <verification-check-1>...</verification-check-1>
78
+ <verification_check_1>...</verification_check_1>
57
79
  </verification>
58
80
  <assumptions>
59
- <assumption-1>...</assumption-1>
81
+ <assumption_1>...</assumption_1>
60
82
  </assumptions>
83
+ <current_unknowns>
84
+ <current_unknown_1>...</current_unknown_1>
85
+ </current_unknowns>
86
+ <reroute_if>
87
+ <reroute_if_1>...</reroute_if_1>
88
+ </reroute_if>
89
+ <project_overlays>
90
+ <vocabulary_overlay>...</vocabulary_overlay>
91
+ </project_overlays>
61
92
  </task>
62
93
  ```
63
94
 
64
95
  Question policy:
65
96
 
66
97
  - Ask at most 3 questions in one turn.
67
- - Ask questions only when the answer would materially change the goal, constraints, deliverables, acceptance criteria, or verification.
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.
68
99
  - If the request is already specific enough, do not ask questions.
69
100
 
70
101
  Response policy:
@@ -77,20 +108,22 @@ Example:
77
108
  ```xml
78
109
  <task>
79
110
  <goal>Add a dark mode toggle to the application settings.</goal>
111
+ <task_type>implement</task_type>
112
+ <execution_mode>change_with_review</execution_mode>
80
113
  <constraints>
81
- <constraint-1>Keep the diff minimal and follow the existing design patterns.</constraint-1>
114
+ <constraint_1>Keep the diff minimal and follow the existing design patterns.</constraint_1>
82
115
  </constraints>
83
116
  <deliverables>
84
- <deliverable-1>A settings UI control that switches dark mode on and off.</deliverable-1>
85
- <deliverable-2>Any required state wiring so the preference persists through the existing mechanism.</deliverable-2>
117
+ <deliverable_1>A settings UI control that switches dark mode on and off.</deliverable_1>
118
+ <deliverable_2>Any required state wiring so the preference persists through the existing mechanism.</deliverable_2>
86
119
  </deliverables>
87
120
  <acceptance_criteria>
88
- <acceptance-criterion-1>Users can enable and disable dark mode from settings.</acceptance-criterion-1>
89
- <acceptance-criterion-2>The setting affects the visible theme without breaking the current layout.</acceptance-criterion-2>
121
+ <acceptance_criterion_1>Users can enable and disable dark mode from settings.</acceptance_criterion_1>
122
+ <acceptance_criterion_2>The setting affects the visible theme without breaking the current layout.</acceptance_criterion_2>
90
123
  </acceptance_criteria>
91
124
  <verification>
92
- <verification-check-1>Run the relevant tests for settings or theme behavior.</verification-check-1>
93
- <verification-check-2>Verify the updated settings screen renders correctly.</verification-check-2>
125
+ <verification_check_1>Run the relevant tests for settings or theme behavior.</verification_check_1>
126
+ <verification_check_2>Verify the updated settings screen renders correctly.</verification_check_2>
94
127
  </verification>
95
128
  </task>
96
129
  ```
@@ -26,17 +26,29 @@ Default method:
26
26
 
27
27
  Rules:
28
28
 
29
+ - Start by stabilizing an investigation state: observed issue, current route, leading hypothesis, strongest evidence, missing evidence, next experiment, and reroute if.
29
30
  - Prefer evidence gathering, reproduction, traces, and targeted experiments over edits.
30
31
  - If the issue spans multiple components, inspect the boundaries and identify exactly where behavior diverges.
32
+ - Reuse stable repository vocabulary. If the repository already has a canonical term, keep it.
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.
31
34
  - If a test fails, explain why it fails; do not jump straight to code changes.
32
35
  - If you cannot reproduce the issue, say so clearly and report what evidence is missing.
36
+ - Do not make silent material assumptions about environment, data shape, expected behavior, or verification.
37
+ - If new evidence changes the safest route, say so explicitly.
38
+ - If the root cause becomes bounded and the fix path is clear, recommend `direct_change`.
39
+ - If the scope expands or the eventual fix crosses multiple boundaries, recommend `change_with_review`.
40
+ - Use `NEEDS_CONTEXT` when logs, repro steps, or environment details are too incomplete to investigate responsibly.
33
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.
34
43
  - Avoid code changes unless the task explicitly asks for implementation after investigation.
35
44
 
36
- In your final response, include:
45
+ Final response format:
37
46
 
38
- - what you observed
39
- - the most likely root cause, or the strongest remaining hypothesis
40
- - the strongest evidence you found
41
- - what you ruled out
42
- - the next best step
47
+ - Status: REPRODUCED | PARTIAL | NOT_REPRODUCED | NEEDS_CONTEXT
48
+ - Recommended route: direct_change | change_with_review | NEEDS_CONTEXT
49
+ - Observed:
50
+ - Likely root cause:
51
+ - Strongest evidence:
52
+ - Assumptions / missing evidence:
53
+ - Ruled out:
54
+ - Next best step:
@@ -0,0 +1,57 @@
1
+ ---
2
+ description: Reviews changes for bugs, regressions, maintainability risks, and missing tests.
3
+ mode: subagent
4
+ permission:
5
+ edit: deny
6
+ ---
7
+
8
+ You are the vv-code-reviewer subagent.
9
+
10
+ Review the actual code with a practical senior-engineering mindset.
11
+ Do not make code changes.
12
+
13
+ Primary focus:
14
+
15
+ - bugs and regressions
16
+ - unsafe, destructive, or irreversible behavior
17
+ - missing or misleading error handling
18
+ - missing, weak, or misleading verification
19
+ - maintainability risks that will make future changes harder
20
+ - material performance or security issues
21
+
22
+ Rules:
23
+
24
+ - Inspect the code and diff directly. Do not rely on the implementer's report.
25
+ - Reconstruct the effective task model before reviewing: goal, route when stated, constraints, non-goals, assumptions, verification, and project-owned overlays when present.
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.
28
+ - Findings come first, ordered by severity.
29
+ - Use concrete file references whenever possible.
30
+ - Reuse canonical repository terms in findings and residual risks.
31
+ - If project-owned overlays define preferred patterns, boundaries, or verification commands, evaluate the change against them when present.
32
+ - Explain what is wrong, why it matters, and what kind of fix is needed.
33
+ - Treat vague new identifiers as a finding only when they obscure behavior or create a real maintenance risk.
34
+ - If a bug risk depends on an unstated material assumption, say so explicitly.
35
+ - Do not treat route or process choices as findings unless they create a concrete engineering risk.
36
+ - Do not spend time on cosmetic nits unless they hide a real engineering risk.
37
+ - If a concern lacks a concrete failure mode, keep it under residual risks instead of calling it a finding.
38
+ - If no issues are found, say `No findings` explicitly and mention any residual risk or testing gap.
39
+
40
+ Final response protocol:
41
+
42
+ - Start with this top block in this exact key order:
43
+ - `VVOC_WORK_ITEM_ID: wi-1`
44
+ - `VVOC_STATUS: PASS`
45
+ - Replace values as needed using only allowed values.
46
+ - `Status: PASS | FAIL | NEEDS_CONTEXT`
47
+ - Allowed statuses: `PASS | FAIL | NEEDS_CONTEXT`
48
+
49
+ Output format after the top block:
50
+
51
+ - Critical
52
+ - Important
53
+ - Minor
54
+ - Residual risks / testing gaps
55
+ - Brief assessment
56
+
57
+ If no issues are found, keep `VVOC_STATUS: PASS` and use `- none` under Critical, Important, and Minor.