@osovv/vv-opencode 2.3.3 → 2.5.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 (108) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +18 -13
  3. package/dist/cli.js +5 -3
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/doctor.d.ts +4 -0
  6. package/dist/commands/doctor.js +60 -51
  7. package/dist/commands/doctor.js.map +1 -1
  8. package/dist/commands/plugin-toggle.d.ts +0 -16
  9. package/dist/commands/plugin-toggle.js +2 -34
  10. package/dist/commands/plugin-toggle.js.map +1 -1
  11. package/dist/commands/preset.d.ts +0 -8
  12. package/dist/commands/preset.js +3 -24
  13. package/dist/commands/preset.js.map +1 -1
  14. package/dist/commands/role.js +2 -30
  15. package/dist/commands/role.js.map +1 -1
  16. package/dist/commands/session.d.ts +50 -0
  17. package/dist/commands/session.js +354 -0
  18. package/dist/commands/session.js.map +1 -0
  19. package/dist/lib/managed-agents.js +2 -2
  20. package/dist/lib/managed-agents.js.map +1 -1
  21. package/dist/lib/managed-skills.js +3 -3
  22. package/dist/lib/managed-skills.js.map +1 -1
  23. package/dist/lib/opencode/agent-registrations.js +103 -13
  24. package/dist/lib/opencode/agent-registrations.js.map +1 -1
  25. package/dist/lib/opencode/inspection.js +131 -5
  26. package/dist/lib/opencode/inspection.js.map +1 -1
  27. package/dist/plugins/analytics/index.js +8 -19
  28. package/dist/plugins/analytics/index.js.map +1 -1
  29. package/dist/plugins/guardian/index.js +7 -21
  30. package/dist/plugins/guardian/index.js.map +1 -1
  31. package/dist/plugins/hashline-edit/index.js +6 -20
  32. package/dist/plugins/hashline-edit/index.js.map +1 -1
  33. package/dist/plugins/model-roles/index.d.ts +3 -3
  34. package/dist/plugins/model-roles/index.js +8 -8
  35. package/dist/plugins/model-roles/index.js.map +1 -1
  36. package/dist/plugins/peak-hours/index.js +9 -20
  37. package/dist/plugins/peak-hours/index.js.map +1 -1
  38. package/dist/plugins/secrets-redaction/index.js +11 -24
  39. package/dist/plugins/secrets-redaction/index.js.map +1 -1
  40. package/dist/plugins/spec-guard/index.js +10 -22
  41. package/dist/plugins/spec-guard/index.js.map +1 -1
  42. package/dist/plugins/system-context-injection/guidance.d.ts +6 -0
  43. package/dist/plugins/system-context-injection/guidance.js +79 -0
  44. package/dist/plugins/system-context-injection/guidance.js.map +1 -0
  45. package/dist/plugins/system-context-injection/index.js +20 -121
  46. package/dist/plugins/system-context-injection/index.js.map +1 -1
  47. package/dist/plugins/tool-history-compaction/index.js +14 -25
  48. package/dist/plugins/tool-history-compaction/index.js.map +1 -1
  49. package/dist/plugins/web-tools/index.js +14 -25
  50. package/dist/plugins/web-tools/index.js.map +1 -1
  51. package/dist/plugins/workflow/index.d.ts +3 -2
  52. package/dist/plugins/workflow/index.js +6 -22
  53. package/dist/plugins/workflow/index.js.map +1 -1
  54. package/dist/plugins/workflow/input-validation.d.ts +1 -1
  55. package/dist/plugins/workflow/input-validation.js +2 -2
  56. package/dist/plugins/workflow/input-validation.js.map +1 -1
  57. package/dist/plugins/workflow/results.d.ts +40 -40
  58. package/dist/plugins/workflow/system-instruction.md +20 -0
  59. package/dist/runtime/auxiliary.d.ts +11 -6
  60. package/dist/runtime/auxiliary.js +43 -35
  61. package/dist/runtime/auxiliary.js.map +1 -1
  62. package/dist/runtime/context-inspection.d.ts +7 -6
  63. package/dist/runtime/context-inspection.js +37 -43
  64. package/dist/runtime/context-inspection.js.map +1 -1
  65. package/dist/runtime/context.d.ts +22 -45
  66. package/dist/runtime/context.js +348 -634
  67. package/dist/runtime/context.js.map +1 -1
  68. package/dist/runtime/model-registry.d.ts +3 -34
  69. package/dist/runtime/model-registry.js +10 -190
  70. package/dist/runtime/model-registry.js.map +1 -1
  71. package/dist/runtime/session-settings.d.ts +204 -0
  72. package/dist/runtime/session-settings.js +445 -0
  73. package/dist/runtime/session-settings.js.map +1 -0
  74. package/dist/runtime/snapshot-config.d.ts +7 -70
  75. package/dist/runtime/snapshot-config.js +16 -198
  76. package/dist/runtime/snapshot-config.js.map +1 -1
  77. package/dist/runtime/types.d.ts +15 -256
  78. package/dist/runtime/types.js +9 -63
  79. package/dist/runtime/types.js.map +1 -1
  80. package/dist/tui/settings/plugin.d.ts +29 -0
  81. package/dist/tui/settings/plugin.js +134 -0
  82. package/dist/tui/settings/plugin.js.map +1 -0
  83. package/dist/tui.js +12 -12
  84. package/dist/tui.js.map +1 -1
  85. package/package.json +1 -1
  86. package/schemas/vvoc/v3.json +1 -1
  87. package/templates/agents/vv-code-reviewer.md +2 -2
  88. package/templates/agents/vv-controller.md +176 -151
  89. package/templates/agents/vv-implementer.md +2 -2
  90. package/templates/agents/vv-reflector.md +7 -0
  91. package/templates/agents/vv-spec-reviewer.md +2 -2
  92. package/templates/skills/vv-execute/SKILL.md +25 -4
  93. package/templates/skills/vv-execute/references/tool-contracts.md +3 -3
  94. package/templates/skills/vv-reflect/SKILL.md +1 -0
  95. package/templates/skills/vv-reflect/references/session-graph.py +581 -7
  96. package/templates/skills/vv-review/SKILL.md +2 -2
  97. package/dist/lib/rebind-request.d.ts +0 -41
  98. package/dist/lib/rebind-request.js +0 -134
  99. package/dist/lib/rebind-request.js.map +0 -1
  100. package/dist/runtime/snapshot-store.d.ts +0 -63
  101. package/dist/runtime/snapshot-store.js +0 -668
  102. package/dist/runtime/snapshot-store.js.map +0 -1
  103. package/dist/runtime/snapshots.d.ts +0 -36
  104. package/dist/runtime/snapshots.js +0 -508
  105. package/dist/runtime/snapshots.js.map +0 -1
  106. package/dist/tui/rebind/plugin.d.ts +0 -22
  107. package/dist/tui/rebind/plugin.js +0 -101
  108. package/dist/tui/rebind/plugin.js.map +0 -1
@@ -93,9 +93,9 @@ Stopping handoff:
93
93
  Final response protocol:
94
94
 
95
95
  - Start the first line of your final response with the protocol top block — no preface, prose, or code fence before it.
96
- - Use the exact `VVOC_WORK_ITEM_ID` returned by `work_item_open` for this assignment, never a sample id from another task.
96
+ - Copy the `VVOC_WORK_ITEM_ID: wi-N` line from the top of your assignment verbatim into your final top block; never a sample id from another task. You never open, list, or close work items — the controller owns their lifecycle.
97
97
  - Include exactly these fields, in this order, once each, then one blank line before the body:
98
- - `VVOC_WORK_ITEM_ID: <returned work item id>`
98
+ - `VVOC_WORK_ITEM_ID: <work item id from the assignment header>`
99
99
  - `VVOC_STATUS: DONE`
100
100
  - `VVOC_ROUTE: change_with_review`
101
101
  - Allowed `VVOC_STATUS` values: `DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED`
@@ -45,8 +45,15 @@ python3 "$SCRIPT" --project "$PWD" --format json
45
45
  # or, when the assignment disambiguates the target:
46
46
  python3 "$SCRIPT" --session <id> --format json
47
47
  python3 "$SCRIPT" --child <child-id> --format json
48
+ # for a machine-wide question spanning sessions or projects:
49
+ python3 "$SCRIPT" --archive --since 2026-02-01 --out /tmp/opencode/archive
48
50
  ```
49
51
 
52
+ `--archive` streams a machine-wide aggregate (`totals`, `tools`, `skills`, `agents`, `projects`,
53
+ `repeated_calls`, `top_errors`, and top sessions), deduplicates calls by entry id, and unions the
54
+ legacy `part` table with `session_message` instead of summing them. Use `--agent`, `--skill`,
55
+ `--project`, `--since`, and `--until` to bound it; `--out` writes `aggregate.json` and `digest.md`.
56
+
50
57
  The script is read-only (`mode=ro` plus `PRAGMA query_only`). It returns the session tree with per-node friction signals: tool-call counts, errors, repeated call shapes, test-command runs, duration, cost, changed files, and a short message tail per node. Read it; do not re-dump raw transcripts. If the script is missing, the database or schema is unsupported, or the target session cannot be resolved, report exactly that in your result and stop. Do not fall back to a raw `opencode session export` or analyze the transcript inline; the main session stops when the extractor is unavailable.
51
58
 
52
59
  Only after reading the signals, open the specific repository files the signals point to — `AGENTS.md`, `README.md`, the repo's own check command (`package.json` scripts, `lefthook`, CI), module contracts, `.grace` graph/verification entries, skill and agent templates, and `.vvoc/lessons` / `.vvoc/runbooks` indexes. Do not read the whole repository.
@@ -56,9 +56,9 @@ Method:
56
56
  Final response protocol:
57
57
 
58
58
  - Start the first line of your final response with the protocol top block — no preface, prose, or code fence before it.
59
- - Use the exact `VVOC_WORK_ITEM_ID` returned by `work_item_open` for this review, never a sample id from another task.
59
+ - Copy the `VVOC_WORK_ITEM_ID: wi-N` line from the top of your assignment verbatim into your final top block; never a sample id from another task. You never open, list, or close work items — the controller owns their lifecycle.
60
60
  - Include exactly these fields, in this order, once each, then one blank line before the body:
61
- - `VVOC_WORK_ITEM_ID: <returned work item id>`
61
+ - `VVOC_WORK_ITEM_ID: <work item id from the assignment header>`
62
62
  - `VVOC_STATUS: PASS`
63
63
  - Allowed `VVOC_STATUS` values: `PASS | FAIL | NEEDS_CONTEXT`
64
64
  - Use only the specified fields in the top block; a reviewer result carries no `VVOC_ROUTE`.
@@ -188,8 +188,25 @@ Every material finding from plan.xml must be enumerated explicitly in the packet
188
188
  </step>
189
189
 
190
190
  <step name="dispatch">
191
- Open an implementation work item with work_item_open for this task (e.g. `{ key, title, mode: "implementation", requiredReviewers: ["spec", "code"] }`).
192
- Dispatch vv-implementer with the exact returned VVOC_WORK_ITEM_ID header + the constructed packet.
191
+ Open an implementation work item with work_item_open for this task:
192
+ `{ items: [{ key, title, mode: "implementation", requiredReviewers: ["spec", "code"] }] }`.
193
+ A standalone item takes only `key`, `title`, `mode`, and `requiredReviewers`. The fields `goal`, `acceptanceCriteria`, `verification`, `writeScope`, `dependsOn`, and `blockedBy` belong to `execution.tasks[]` and are rejected on a standalone open. Put those details in the assignment packet, not in work_item_open.
194
+
195
+ The work_item_open response includes a ready-to-copy `header` for each item. Dispatch vv-implementer with a packet whose FIRST meaningful line is exactly that header, in the form `VVOC_WORK_ITEM_ID: wi-<n>`: colon after the id, nothing else on that line (no `=`, no trailing prose), followed by the constructed packet.
196
+
197
+ The launch gate allows exactly one tracked agent per workflow state:
198
+
199
+ | State | Allowed tracked agent |
200
+ |---|---|
201
+ | `open` (implementation) | `vv-implementer` |
202
+ | `awaiting_implementer` | `vv-implementer` |
203
+ | `awaiting_reviews` (active round) | the pending `vv-spec-reviewer` and `vv-code-reviewer` roles |
204
+ | `awaiting_acceptance` | none; the controller calls `work_item_decide` |
205
+ | `needs_context` / `blocked` | none until an explicit recovery decision |
206
+ | `ready_to_close` / `closed` | none |
207
+
208
+ If a launch is rejected, read the rejection instead of retrying the same transition. `LAUNCH_REJECTED_INVALID_TRANSITION` names the only allowed agent for the current state. `REVIEW_ROUND_NOT_ACTIVE` means the item has no active review round yet. `REVIEWER_ALREADY_IN_FLIGHT` means that reviewer is already running; wait for its report instead of launching it again.
209
+
193
210
  The implementer writes code, runs tests, and returns a status. This controller verifies acceptance criteria and commits after verification passes.
194
211
  </step>
195
212
 
@@ -223,8 +240,12 @@ If criteria fail → re-dispatch implementer with specific failure details.
223
240
 
224
241
  <step name="review">
225
242
  A DONE implementer moves the work item to awaiting_reviews with a review round that requires EVERY role in requiredReviewers (spec and code). Dispatch and collect ALL required reviewers before closing:
226
- - Dispatch vv-spec-reviewer with the returned VVOC_WORK_ITEM_ID header and a spec-compliance packet.
227
- - Dispatch vv-code-reviewer with the returned VVOC_WORK_ITEM_ID header and the changed code/diff.
243
+ - Dispatch vv-spec-reviewer with the header line exactly as returned, `VVOC_WORK_ITEM_ID: wi-<n>`, followed by a spec-compliance packet.
244
+ - Dispatch vv-code-reviewer with the same header line followed by the changed code/diff.
245
+ Each reviewer prompt must start with the header as its FIRST meaningful line; prose or `VVOC_WORK_ITEM_ID=` before it is rejected.
246
+
247
+ The launch gate allows exactly one agent per state. A reviewer launch is rejected while the item is open (`REVIEW_ROUND_NOT_ACTIVE`) or while another reviewer is in flight (`REVIEWER_ALREADY_IN_FLIGHT`); read the rejection and wait for that report instead of relaunching. To review a diff or PR that no implementation item owns, open a NEW item with `mode: "review_only"` and its reviewer roles first; a review-only item starts directly in `awaiting_reviews`.
248
+
228
249
  Collect both results.
229
250
  - Both PASS → the work item becomes ready_to_close → proceed to commit.
230
251
  - Any FAIL → the work item returns to awaiting_implementer. Re-dispatch the implementer with the normalized reviewer findings, then repeat handle-status → verify → review (bounded by the runtime review-round limit). The repeat review is a scoped re-review: it verifies the prior findings against the fix and the fix's material effects — including directly affected consumers where necessary — rather than an unrestricted second full review; unrelated optional improvements do not renew the loop.
@@ -2,10 +2,10 @@
2
2
 
3
3
  Generated from the pure tool catalog. Do not edit by hand; run `bun run contracts:generate`.
4
4
 
5
- - Package: `@osovv/vv-opencode@2.3.3`
5
+ - Package: `@osovv/vv-opencode@2.5.0`
6
6
  - Tool contract revision: `1`
7
7
  - Reference path: `templates/skills/vv-execute/references/tool-contracts.md`
8
- - Current model-facing size: descriptions 8794 bytes, published input schemas 22572 bytes
8
+ - Current model-facing size: descriptions 9082 bytes, published input schemas 22572 bytes
9
9
  - Baseline (commit f4319f8, SDK @opencode-ai/plugin@1.18.2, source-extraction): descriptions 8796 bytes, projected input schemas 6815 bytes
10
10
 
11
11
  > Schema acceptance is structural only. It is not authorization, not proof of evidence,
@@ -22,7 +22,7 @@ This is an on-demand reference; load only the tool section you need rather than
22
22
  ### `work_item_open`
23
23
 
24
24
  - Summary: Open one or more work items idempotently, or register/append generic execution tasks.
25
- - Description: Open one or more workflow work items idempotently with explicit mode and requiredReviewers.
25
+ - Description: Open one or more workflow work items idempotently with explicit mode and requiredReviewers. A standalone item takes only key, title, mode, and requiredReviewers; goal, acceptanceCriteria, verification, writeScope, dependsOn, and blockedBy …
26
26
 
27
27
  | field | type | required | description |
28
28
  | --- | --- | --- | --- |
@@ -14,6 +14,7 @@ You are the vv-reflect skill. You dispatch the read-only vv-reflector subagent t
14
14
  <rule>Do not use or create .vvoc/reflect.jsonc or any reflect-specific config.</rule>
15
15
  <rule>Do not add a CLI command, hook behavior, or automatic writer behavior; keep every applied change inside approved repository documents, guardrails, and vvoc-managed skill or agent templates.</rule>
16
16
  <rule>Prefer the smallest change that removes the friction. Removal and consolidation are valid improvements: a stale, duplicated, or no-op instruction is deleted, not layered over with an exception.</rule>
17
+ <rule>For a question spanning more than one session or project, run `session-graph.py --archive`; do not hand-roll SQL and never sum the legacy `part` table with `session_message`.</rule>
17
18
  </scope>
18
19
 
19
20
  <dispatch>