@osovv/vv-opencode 1.4.2 → 1.4.3-rc.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +20 -6
  3. package/dist/lib/orchestration.js +12 -3
  4. package/dist/lib/orchestration.js.map +1 -1
  5. package/dist/lib/spec-lint.d.ts +2 -64
  6. package/dist/lib/spec-lint.js +47 -45
  7. package/dist/lib/spec-lint.js.map +1 -1
  8. package/dist/lib/workflow-contract.d.ts +277 -0
  9. package/dist/lib/workflow-contract.js +636 -0
  10. package/dist/lib/workflow-contract.js.map +1 -0
  11. package/dist/plugins/system-context-injection/index.js +15 -7
  12. package/dist/plugins/system-context-injection/index.js.map +1 -1
  13. package/dist/plugins/workflow/authority.d.ts +99 -0
  14. package/dist/plugins/workflow/authority.js +435 -0
  15. package/dist/plugins/workflow/authority.js.map +1 -0
  16. package/dist/plugins/workflow/checkpoint-io.d.ts +10 -1
  17. package/dist/plugins/workflow/checkpoint-io.js +22 -3
  18. package/dist/plugins/workflow/checkpoint-io.js.map +1 -1
  19. package/dist/plugins/workflow/checkpoints.d.ts +58 -1
  20. package/dist/plugins/workflow/checkpoints.js +362 -34
  21. package/dist/plugins/workflow/checkpoints.js.map +1 -1
  22. package/dist/plugins/workflow/delegated.d.ts +150 -2
  23. package/dist/plugins/workflow/delegated.js +551 -15
  24. package/dist/plugins/workflow/delegated.js.map +1 -1
  25. package/dist/plugins/workflow/execution.d.ts +361 -0
  26. package/dist/plugins/workflow/execution.js +1807 -0
  27. package/dist/plugins/workflow/execution.js.map +1 -0
  28. package/dist/plugins/workflow/index.js +539 -80
  29. package/dist/plugins/workflow/index.js.map +1 -1
  30. package/dist/plugins/workflow/persistence.d.ts +18 -4
  31. package/dist/plugins/workflow/persistence.js +439 -42
  32. package/dist/plugins/workflow/persistence.js.map +1 -1
  33. package/dist/plugins/workflow/repair.d.ts +2 -0
  34. package/dist/plugins/workflow/repair.js +16 -8
  35. package/dist/plugins/workflow/repair.js.map +1 -1
  36. package/dist/plugins/workflow/snapshots.js +3 -3
  37. package/dist/plugins/workflow/snapshots.js.map +1 -1
  38. package/dist/plugins/workflow/state.d.ts +13 -0
  39. package/dist/plugins/workflow/state.js +37 -7
  40. package/dist/plugins/workflow/state.js.map +1 -1
  41. package/dist/plugins/workflow/system-instruction.md +15 -1
  42. package/dist/plugins/workflow/tooling.d.ts +81 -6
  43. package/dist/plugins/workflow/tooling.js +956 -23
  44. package/dist/plugins/workflow/tooling.js.map +1 -1
  45. package/dist/plugins/workflow/transactions.d.ts +54 -0
  46. package/dist/plugins/workflow/transactions.js +147 -0
  47. package/dist/plugins/workflow/transactions.js.map +1 -0
  48. package/package.json +1 -1
  49. package/schemas/vvoc/v3.json +1 -1
  50. package/templates/agents/vv-code-reviewer.md +1 -0
  51. package/templates/agents/vv-controller.md +26 -13
  52. package/templates/agents/vv-implementer.md +1 -0
  53. package/templates/agents/vv-spec-reviewer.md +1 -0
  54. package/templates/skills/vv-execute/SKILL.md +6 -5
  55. package/templates/skills/vv-plan/SKILL.md +1 -1
  56. package/templates/skills/vv-review/SKILL.md +1 -0
  57. package/templates/skills/vv-spec/SKILL.md +2 -2
@@ -1,13 +1,27 @@
1
1
  import { type WorkItemStore } from "./state.js";
2
+ import { type LookupRecoveryUserMessage } from "./delegated.js";
3
+ import { type AuthorityMessageSnapshot } from "./authority.js";
2
4
  import type { LoadedDelegatedPlan } from "./checkpoint-io.js";
3
5
  export type WorkflowToolContext = {
4
6
  sessionId: string;
7
+ /** Trusted absolute workspace root; required for generic execution registration. */
8
+ workspaceRoot?: string;
5
9
  };
6
10
  export type WorkflowToolDefinition<TArgs, TResult> = {
7
11
  name: string;
8
12
  description: string;
9
13
  execute: (args: TArgs, context: WorkflowToolContext, store?: WorkItemStore) => TResult;
10
14
  };
15
+ /** Optional read-only authorization lookup bound to the plugin SDK client. */
16
+ export interface DelegatedControlOptions {
17
+ lookupUserMessage?: LookupRecoveryUserMessage;
18
+ /** Resolve one root-user message snapshot for advance-authority provenance. */
19
+ lookupAuthorityMessage?: (input: {
20
+ sessionId: string;
21
+ runId: string;
22
+ messageId: string;
23
+ }) => Promise<AuthorityMessageSnapshot | undefined>;
24
+ }
11
25
  type OpenInputItem = {
12
26
  key?: unknown;
13
27
  title?: unknown;
@@ -16,9 +30,22 @@ type OpenInputItem = {
16
30
  writeScope?: unknown;
17
31
  planRunId?: unknown;
18
32
  planTaskId?: unknown;
33
+ /** Generic execution task-contract fields. */
34
+ taskId?: unknown;
35
+ goal?: unknown;
36
+ acceptanceCriteria?: unknown;
37
+ verification?: unknown;
38
+ dependsOn?: unknown;
39
+ blockedBy?: unknown;
19
40
  };
20
41
  type OpenArgs = {
21
42
  items: OpenInputItem[];
43
+ /** Generic execution descriptor; mutually exclusive with runId. */
44
+ execution?: unknown;
45
+ /** Append tasks to an existing generic execution. */
46
+ runId?: unknown;
47
+ amendmentId?: unknown;
48
+ rationale?: unknown;
22
49
  };
23
50
  type ListArgs = {
24
51
  includeClosed?: boolean;
@@ -29,24 +56,63 @@ type CloseArgs = {
29
56
  export type DecideArgs = {
30
57
  workItemId: string;
31
58
  attempt: number;
32
- decision: "accept" | "request_changes" | "rework";
33
- rationale: string;
34
- evidence: string[];
59
+ decision: "accept" | "request_changes" | "rework" | "recover";
60
+ /** Required for accept, request_changes, and rework; unused by recover. */
61
+ rationale?: string;
62
+ /** Required for accept and request_changes; unused by rework and recover. */
63
+ evidence?: string[];
35
64
  concernsDisposition?: string;
36
65
  runId?: string;
37
66
  checkpointId?: string;
67
+ /** Recover-only bounded diagnosis, changed condition, and verification references. */
68
+ diagnosis?: string;
69
+ changedCondition?: string;
70
+ verification?: string[];
71
+ recoveryId?: string;
72
+ /** Recover-only fresh root-user message authorizing one further unit. */
73
+ userMessageId?: string;
74
+ /** Recover-only recorded advance authority authorizing one further unit. */
75
+ authorityId?: string;
38
76
  };
39
77
  export type CheckpointArgs = {
40
- action: "register" | "start" | "verify";
78
+ action: "register" | "start" | "verify" | "recover" | "review" | "bind" | "complete" | "amend" | "authorize" | "record_approval" | "revoke_authority";
41
79
  planPath?: string;
42
80
  runId?: string;
43
81
  checkpointId?: string;
44
82
  complete?: boolean;
83
+ /** Recover-only bounded diagnosis, changed condition, and verification references. */
84
+ diagnosis?: string;
85
+ changedCondition?: string;
86
+ verification?: string[];
87
+ recoveryId?: string;
88
+ /** Recover-only fresh root-user message authorizing one further generation. */
89
+ userMessageId?: string;
90
+ /** Generic checkpoint append/registration payloads. */
91
+ checkpoints?: unknown;
92
+ tasks?: unknown;
93
+ amendmentId?: string;
94
+ rationale?: string;
95
+ startFingerprint?: string;
96
+ /** Generic reviewer result recording (status is read from the linked round). */
97
+ reviewer?: string;
98
+ /** Advance authority inputs. */
99
+ authorityId?: string;
100
+ messageId?: string;
101
+ approvalId?: string;
102
+ stage?: string;
103
+ artifactPath?: string;
104
+ artifactSha256?: string;
105
+ revocationId?: string;
106
+ /** Authority scope inputs. */
107
+ stages?: unknown;
108
+ decisionScope?: string;
109
+ fileBoundary?: unknown;
110
+ reservedStops?: unknown;
45
111
  };
46
112
  export declare function createWorkItemOpenTool(store: WorkItemStore): WorkflowToolDefinition<OpenArgs, Record<string, unknown>>;
47
113
  export declare function createWorkItemListTool(store: WorkItemStore): WorkflowToolDefinition<ListArgs, Record<string, unknown>>;
48
114
  export declare function createWorkItemCloseTool(store: WorkItemStore): WorkflowToolDefinition<CloseArgs, Record<string, unknown>>;
49
- export declare function createWorkItemDecideTool(store: WorkItemStore): WorkflowToolDefinition<DecideArgs, Record<string, unknown>>;
115
+ export declare function createWorkItemDecideTool(store: WorkItemStore, options?: DelegatedControlOptions): WorkflowToolDefinition<DecideArgs, Promise<Record<string, unknown>>>;
50
116
  export interface WorkCheckpointRegisterInput {
51
117
  action: "register";
52
118
  planPath: string;
@@ -60,6 +126,15 @@ export type WorkCheckpointInput = WorkCheckpointRegisterInput | {
60
126
  runId: string;
61
127
  checkpointId: string;
62
128
  complete?: boolean;
129
+ } | {
130
+ action: "recover";
131
+ runId: string;
132
+ checkpointId: string;
133
+ diagnosis: string;
134
+ changedCondition: string;
135
+ verification: string[];
136
+ recoveryId: string;
137
+ userMessageId?: string;
63
138
  };
64
139
  export type WorkCheckpointExecuteContext = WorkflowToolContext & {
65
140
  /** Trusted absolute workspace root used for plan loading and snapshots. */
@@ -69,5 +144,5 @@ export type WorkCheckpointExecuteContext = WorkflowToolContext & {
69
144
  loadError: string;
70
145
  }>;
71
146
  };
72
- export declare function createWorkCheckpointTool(store: WorkItemStore): WorkflowToolDefinition<CheckpointArgs, Promise<Record<string, unknown>>>;
147
+ export declare function createWorkCheckpointTool(store: WorkItemStore, options?: DelegatedControlOptions): WorkflowToolDefinition<CheckpointArgs, Promise<Record<string, unknown>>>;
73
148
  export {};