oxe-cc 1.0.0 → 1.2.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 (207) hide show
  1. package/.cursor/commands/oxe-ask.md +1 -1
  2. package/.cursor/commands/oxe-capabilities.md +1 -1
  3. package/.cursor/commands/oxe-checkpoint.md +1 -1
  4. package/.cursor/commands/oxe-compact.md +1 -1
  5. package/.cursor/commands/oxe-dashboard.md +1 -1
  6. package/.cursor/commands/oxe-debug.md +1 -1
  7. package/.cursor/commands/oxe-discuss.md +1 -1
  8. package/.cursor/commands/oxe-execute.md +2 -2
  9. package/.cursor/commands/oxe-forensics.md +1 -1
  10. package/.cursor/commands/oxe-help.md +1 -1
  11. package/.cursor/commands/oxe-loop.md +1 -1
  12. package/.cursor/commands/oxe-milestone.md +1 -1
  13. package/.cursor/commands/oxe-next.md +1 -1
  14. package/.cursor/commands/oxe-obs.md +1 -1
  15. package/.cursor/commands/oxe-plan-agent.md +1 -1
  16. package/.cursor/commands/oxe-plan.md +1 -1
  17. package/.cursor/commands/oxe-project.md +1 -1
  18. package/.cursor/commands/oxe-quick.md +1 -1
  19. package/.cursor/commands/oxe-research.md +1 -1
  20. package/.cursor/commands/oxe-retro.md +1 -1
  21. package/.cursor/commands/oxe-review-pr.md +1 -1
  22. package/.cursor/commands/oxe-route.md +1 -1
  23. package/.cursor/commands/oxe-scan.md +1 -1
  24. package/.cursor/commands/oxe-security.md +1 -1
  25. package/.cursor/commands/oxe-session.md +2 -2
  26. package/.cursor/commands/oxe-ship.md +45 -0
  27. package/.cursor/commands/oxe-skill.md +1 -1
  28. package/.cursor/commands/oxe-spec.md +1 -1
  29. package/.cursor/commands/oxe-ui-review.md +1 -1
  30. package/.cursor/commands/oxe-ui-spec.md +1 -1
  31. package/.cursor/commands/oxe-update.md +1 -1
  32. package/.cursor/commands/oxe-validate-gaps.md +1 -1
  33. package/.cursor/commands/oxe-verify.md +1 -1
  34. package/.cursor/commands/oxe-workstream.md +1 -1
  35. package/.cursor/commands/oxe.md +4 -4
  36. package/.github/copilot-instructions.md +91 -1
  37. package/.github/prompts/oxe-ask.prompt.md +1 -1
  38. package/.github/prompts/oxe-capabilities.prompt.md +1 -1
  39. package/.github/prompts/oxe-checkpoint.prompt.md +1 -1
  40. package/.github/prompts/oxe-compact.prompt.md +1 -1
  41. package/.github/prompts/oxe-dashboard.prompt.md +1 -1
  42. package/.github/prompts/oxe-debug.prompt.md +1 -1
  43. package/.github/prompts/oxe-discuss.prompt.md +1 -1
  44. package/.github/prompts/oxe-execute.prompt.md +2 -2
  45. package/.github/prompts/oxe-forensics.prompt.md +1 -1
  46. package/.github/prompts/oxe-help.prompt.md +1 -1
  47. package/.github/prompts/oxe-loop.prompt.md +1 -1
  48. package/.github/prompts/oxe-milestone.prompt.md +1 -1
  49. package/.github/prompts/oxe-next.prompt.md +1 -1
  50. package/.github/prompts/oxe-obs.prompt.md +1 -1
  51. package/.github/prompts/oxe-plan-agent.prompt.md +1 -1
  52. package/.github/prompts/oxe-plan.prompt.md +1 -1
  53. package/.github/prompts/oxe-project.prompt.md +1 -1
  54. package/.github/prompts/oxe-quick.prompt.md +1 -1
  55. package/.github/prompts/oxe-research.prompt.md +1 -1
  56. package/.github/prompts/oxe-retro.prompt.md +1 -1
  57. package/.github/prompts/oxe-review-pr.prompt.md +1 -1
  58. package/.github/prompts/oxe-route.prompt.md +1 -1
  59. package/.github/prompts/oxe-scan.prompt.md +1 -1
  60. package/.github/prompts/oxe-security.prompt.md +1 -1
  61. package/.github/prompts/oxe-session.prompt.md +2 -2
  62. package/.github/prompts/oxe-ship.prompt.md +45 -0
  63. package/.github/prompts/oxe-skill.prompt.md +1 -1
  64. package/.github/prompts/oxe-spec.prompt.md +1 -1
  65. package/.github/prompts/oxe-ui-review.prompt.md +1 -1
  66. package/.github/prompts/oxe-ui-spec.prompt.md +1 -1
  67. package/.github/prompts/oxe-update.prompt.md +1 -1
  68. package/.github/prompts/oxe-validate-gaps.prompt.md +1 -1
  69. package/.github/prompts/oxe-verify.prompt.md +1 -1
  70. package/.github/prompts/oxe-workstream.prompt.md +1 -1
  71. package/.github/prompts/oxe.prompt.md +3 -3
  72. package/AGENTS.md +43 -28
  73. package/CHANGELOG.md +158 -0
  74. package/README.md +72 -50
  75. package/bin/banner.txt +1 -1
  76. package/bin/lib/oxe-project-health.cjs +1 -1
  77. package/commands/oxe/ask.md +5 -1
  78. package/commands/oxe/checkpoint.md +1 -1
  79. package/commands/oxe/compact.md +1 -1
  80. package/commands/oxe/debug.md +1 -1
  81. package/commands/oxe/execute.md +2 -2
  82. package/commands/oxe/forensics.md +1 -1
  83. package/commands/oxe/loop.md +1 -1
  84. package/commands/oxe/milestone.md +1 -1
  85. package/commands/oxe/next.md +1 -1
  86. package/commands/oxe/obs.md +1 -1
  87. package/commands/oxe/oxe.md +3 -3
  88. package/commands/oxe/project.md +1 -1
  89. package/commands/oxe/research.md +1 -1
  90. package/commands/oxe/retro.md +1 -1
  91. package/commands/oxe/review-pr.md +1 -1
  92. package/commands/oxe/route.md +1 -1
  93. package/commands/oxe/scan.md +1 -1
  94. package/commands/oxe/security.md +1 -1
  95. package/commands/oxe/session.md +2 -2
  96. package/commands/oxe/ship.md +49 -0
  97. package/commands/oxe/spec.md +2 -2
  98. package/commands/oxe/ui-review.md +1 -1
  99. package/commands/oxe/ui-spec.md +1 -1
  100. package/commands/oxe/validate-gaps.md +1 -1
  101. package/commands/oxe/verify.md +2 -2
  102. package/commands/oxe/workstream.md +1 -1
  103. package/lib/runtime/audit/audit-trail.d.ts +71 -0
  104. package/lib/runtime/audit/audit-trail.js +154 -0
  105. package/lib/runtime/audit/index.d.ts +2 -0
  106. package/lib/runtime/audit/index.js +18 -0
  107. package/lib/runtime/audit/policy-pack.d.ts +15 -0
  108. package/lib/runtime/audit/policy-pack.js +57 -0
  109. package/lib/runtime/context/context-pack-builder.d.ts +15 -0
  110. package/lib/runtime/context/context-pack-builder.js +42 -0
  111. package/lib/runtime/context/context-pack-store.d.ts +38 -0
  112. package/lib/runtime/context/context-pack-store.js +142 -0
  113. package/lib/runtime/context/context-profiles.d.ts +11 -0
  114. package/lib/runtime/context/context-profiles.js +51 -0
  115. package/lib/runtime/context/index.d.ts +2 -0
  116. package/lib/runtime/context/index.js +2 -0
  117. package/lib/runtime/decision/decision-engine.d.ts +43 -0
  118. package/lib/runtime/decision/decision-engine.js +127 -0
  119. package/lib/runtime/decision/decision-memo.d.ts +53 -0
  120. package/lib/runtime/decision/decision-memo.js +173 -0
  121. package/lib/runtime/decision/index.d.ts +2 -0
  122. package/lib/runtime/decision/index.js +18 -0
  123. package/lib/runtime/delivery/index.d.ts +1 -0
  124. package/lib/runtime/delivery/index.js +1 -0
  125. package/lib/runtime/delivery/promotion-pipeline.d.ts +39 -0
  126. package/lib/runtime/delivery/promotion-pipeline.js +127 -0
  127. package/lib/runtime/index.d.ts +3 -0
  128. package/lib/runtime/index.js +4 -0
  129. package/lib/runtime/plugins/capability-matrix.d.ts +20 -0
  130. package/lib/runtime/plugins/capability-matrix.js +59 -0
  131. package/lib/runtime/plugins/index.d.ts +2 -0
  132. package/lib/runtime/plugins/index.js +2 -0
  133. package/lib/runtime/plugins/plugin-manifest.d.ts +22 -0
  134. package/lib/runtime/plugins/plugin-manifest.js +91 -0
  135. package/lib/runtime/plugins/plugin-registry.js +5 -0
  136. package/lib/runtime/policy/policy-engine.d.ts +28 -1
  137. package/lib/runtime/policy/policy-engine.js +96 -5
  138. package/lib/runtime/reducers/run-state-reducer.d.ts +26 -0
  139. package/lib/runtime/reducers/run-state-reducer.js +117 -1
  140. package/lib/runtime/scheduler/agent-registry.d.ts +44 -0
  141. package/lib/runtime/scheduler/agent-registry.js +96 -0
  142. package/lib/runtime/scheduler/agent-roles.d.ts +54 -0
  143. package/lib/runtime/scheduler/agent-roles.js +62 -0
  144. package/lib/runtime/scheduler/index.d.ts +3 -0
  145. package/lib/runtime/scheduler/index.js +3 -0
  146. package/lib/runtime/scheduler/multi-agent-coordinator.d.ts +2 -0
  147. package/lib/runtime/scheduler/multi-agent-coordinator.js +91 -4
  148. package/lib/runtime/scheduler/run-journal.d.ts +18 -0
  149. package/lib/runtime/scheduler/run-journal.js +54 -0
  150. package/lib/runtime/scheduler/scheduler.d.ts +11 -1
  151. package/lib/runtime/scheduler/scheduler.js +135 -7
  152. package/lib/runtime/verification/index.d.ts +1 -0
  153. package/lib/runtime/verification/index.js +1 -0
  154. package/lib/runtime/verification/verification-manifest.d.ts +58 -0
  155. package/lib/runtime/verification/verification-manifest.js +129 -0
  156. package/oxe/workflows/ask.md +4 -0
  157. package/oxe/workflows/checkpoint.md +14 -10
  158. package/oxe/workflows/debug.md +19 -15
  159. package/oxe/workflows/execute.md +30 -2
  160. package/oxe/workflows/forensics.md +13 -9
  161. package/oxe/workflows/help.md +97 -49
  162. package/oxe/workflows/loop.md +17 -13
  163. package/oxe/workflows/obs.md +4 -0
  164. package/oxe/workflows/oxe.md +64 -31
  165. package/oxe/workflows/project.md +6 -1
  166. package/oxe/workflows/references/workflow-runtime-contracts.json +23 -0
  167. package/oxe/workflows/research.md +32 -28
  168. package/oxe/workflows/retro.md +4 -0
  169. package/oxe/workflows/review-pr.md +15 -11
  170. package/oxe/workflows/scan.md +4 -0
  171. package/oxe/workflows/security.md +14 -10
  172. package/oxe/workflows/session.md +17 -1
  173. package/oxe/workflows/ship.md +142 -0
  174. package/oxe/workflows/spec.md +15 -0
  175. package/oxe/workflows/ui-review.md +20 -16
  176. package/oxe/workflows/ui-spec.md +7 -3
  177. package/oxe/workflows/validate-gaps.md +13 -9
  178. package/oxe/workflows/verify.md +42 -3
  179. package/package.json +1 -1
  180. package/packages/runtime/src/audit/audit-trail.ts +243 -0
  181. package/packages/runtime/src/audit/index.ts +2 -0
  182. package/packages/runtime/src/audit/policy-pack.ts +62 -0
  183. package/packages/runtime/src/context/context-pack-builder.ts +66 -0
  184. package/packages/runtime/src/context/context-pack-store.ts +197 -0
  185. package/packages/runtime/src/context/context-profiles.ts +60 -0
  186. package/packages/runtime/src/context/index.ts +2 -0
  187. package/packages/runtime/src/decision/decision-engine.ts +174 -0
  188. package/packages/runtime/src/decision/decision-memo.ts +211 -0
  189. package/packages/runtime/src/decision/index.ts +2 -0
  190. package/packages/runtime/src/delivery/index.ts +1 -0
  191. package/packages/runtime/src/delivery/promotion-pipeline.ts +180 -0
  192. package/packages/runtime/src/index.ts +5 -0
  193. package/packages/runtime/src/plugins/capability-matrix.ts +83 -0
  194. package/packages/runtime/src/plugins/index.ts +2 -0
  195. package/packages/runtime/src/plugins/plugin-manifest.ts +113 -0
  196. package/packages/runtime/src/plugins/plugin-registry.ts +5 -0
  197. package/packages/runtime/src/policy/policy-engine.ts +138 -7
  198. package/packages/runtime/src/reducers/run-state-reducer.ts +143 -1
  199. package/packages/runtime/src/scheduler/agent-registry.ts +132 -0
  200. package/packages/runtime/src/scheduler/agent-roles.ts +109 -0
  201. package/packages/runtime/src/scheduler/index.ts +3 -0
  202. package/packages/runtime/src/scheduler/multi-agent-coordinator.ts +106 -4
  203. package/packages/runtime/src/scheduler/run-journal.ts +62 -0
  204. package/packages/runtime/src/scheduler/scheduler.ts +168 -8
  205. package/packages/runtime/src/verification/index.ts +1 -0
  206. package/packages/runtime/src/verification/verification-manifest.ts +192 -0
  207. package/vscode-extension/oxe-agents-1.0.0.vsix +0 -0
@@ -0,0 +1,192 @@
1
+ import crypto from 'crypto';
2
+ import path from 'path';
3
+ import fs from 'fs';
4
+ import type { VerificationStatus } from '../models/verification-result';
5
+ import type { CheckResult } from './verification-compiler';
6
+
7
+ export type VerificationProfile = 'quick' | 'standard' | 'critical';
8
+
9
+ export type FailureClass =
10
+ | 'deterministic'
11
+ | 'flaky'
12
+ | 'timeout'
13
+ | 'env_setup'
14
+ | 'policy_failure'
15
+ | 'evidence_missing';
16
+
17
+ export type VerificationGranularity = 'work_item' | 'wave' | 'run';
18
+
19
+ export interface ManifestCheck {
20
+ check_id: string;
21
+ acceptance_ref: string | null;
22
+ status: VerificationStatus;
23
+ failure_class: FailureClass | null;
24
+ evidence_refs: string[];
25
+ duration_ms: number;
26
+ }
27
+
28
+ export interface VerificationManifest {
29
+ manifest_id: string;
30
+ run_id: string;
31
+ work_item_id: string | null;
32
+ wave: number | null;
33
+ granularity: VerificationGranularity;
34
+ profile: VerificationProfile;
35
+ compiled_at: string;
36
+ checks: ManifestCheck[];
37
+ summary: {
38
+ total: number;
39
+ pass: number;
40
+ fail: number;
41
+ skip: number;
42
+ error: number;
43
+ all_passed: boolean;
44
+ };
45
+ }
46
+
47
+ export interface ResidualRisk {
48
+ risk_id: string;
49
+ work_item_id: string | null;
50
+ check_id: string | null;
51
+ failure_class: FailureClass;
52
+ description: string;
53
+ severity: 'low' | 'medium' | 'high' | 'critical';
54
+ mitigation: string | null;
55
+ }
56
+
57
+ export interface ResidualRiskLedger {
58
+ run_id: string;
59
+ generated_at: string;
60
+ risks: ResidualRisk[];
61
+ }
62
+
63
+ const PROFILE_REQUIRED_CHECKS: Record<VerificationProfile, FailureClass[]> = {
64
+ quick: ['deterministic'],
65
+ standard: ['deterministic', 'policy_failure'],
66
+ critical: ['deterministic', 'policy_failure', 'evidence_missing', 'flaky'],
67
+ };
68
+
69
+ export function classifyFailure(result: CheckResult): FailureClass | null {
70
+ if (result.status === 'pass' || result.status === 'skip') return null;
71
+ if (result.error && (result.error.toLowerCase().includes('timeout') || result.error.toLowerCase().includes('timed out'))) return 'timeout';
72
+ if (result.exit_code === null && result.error) return 'env_setup';
73
+ if (result.stderr.toLowerCase().includes('policy') || result.stderr.toLowerCase().includes('denied')) {
74
+ return 'policy_failure';
75
+ }
76
+ if (result.exit_code !== 0 && result.stderr === '' && result.stdout === '') return 'evidence_missing';
77
+ // Default: non-deterministic signals (no reliable exit code pattern)
78
+ return 'deterministic';
79
+ }
80
+
81
+ export function buildManifest(
82
+ runId: string,
83
+ results: CheckResult[],
84
+ options: {
85
+ workItemId?: string;
86
+ wave?: number;
87
+ granularity?: VerificationGranularity;
88
+ profile?: VerificationProfile;
89
+ evidenceRefs?: Map<string, string[]>;
90
+ } = {}
91
+ ): VerificationManifest {
92
+ const profile = options.profile ?? 'standard';
93
+ const granularity = options.granularity ?? 'run';
94
+ const evidenceRefs = options.evidenceRefs ?? new Map();
95
+
96
+ const checks: ManifestCheck[] = results.map((r) => ({
97
+ check_id: r.check_id,
98
+ acceptance_ref: r.acceptance_ref,
99
+ status: r.status,
100
+ failure_class: classifyFailure(r),
101
+ evidence_refs: evidenceRefs.get(r.check_id) ?? [],
102
+ duration_ms: r.duration_ms,
103
+ }));
104
+
105
+ const summary = {
106
+ total: checks.length,
107
+ pass: checks.filter((c) => c.status === 'pass').length,
108
+ fail: checks.filter((c) => c.status === 'fail').length,
109
+ skip: checks.filter((c) => c.status === 'skip').length,
110
+ error: checks.filter((c) => c.status === 'error').length,
111
+ all_passed: checks.every((c) => c.status === 'pass' || c.status === 'skip'),
112
+ };
113
+
114
+ return {
115
+ manifest_id: `vm-${crypto.randomBytes(4).toString('hex')}`,
116
+ run_id: runId,
117
+ work_item_id: options.workItemId ?? null,
118
+ wave: options.wave ?? null,
119
+ granularity,
120
+ profile,
121
+ compiled_at: new Date().toISOString(),
122
+ checks,
123
+ summary,
124
+ };
125
+ }
126
+
127
+ export function buildRiskLedger(
128
+ runId: string,
129
+ manifest: VerificationManifest
130
+ ): ResidualRiskLedger {
131
+ const risks: ResidualRisk[] = [];
132
+
133
+ for (const check of manifest.checks) {
134
+ if (check.status === 'pass' || check.status === 'skip') continue;
135
+ if (!check.failure_class) continue;
136
+
137
+ const required = PROFILE_REQUIRED_CHECKS[manifest.profile];
138
+ if (!required.includes(check.failure_class)) continue;
139
+
140
+ risks.push({
141
+ risk_id: `risk-${crypto.randomBytes(3).toString('hex')}`,
142
+ work_item_id: manifest.work_item_id,
143
+ check_id: check.check_id,
144
+ failure_class: check.failure_class,
145
+ description: `Check ${check.check_id} ${check.status}: ${check.failure_class}`,
146
+ severity: check.failure_class === 'policy_failure' || check.failure_class === 'deterministic'
147
+ ? 'high'
148
+ : check.failure_class === 'evidence_missing'
149
+ ? 'medium'
150
+ : 'low',
151
+ mitigation: null,
152
+ });
153
+ }
154
+
155
+ return {
156
+ run_id: runId,
157
+ generated_at: new Date().toISOString(),
158
+ risks,
159
+ };
160
+ }
161
+
162
+ export function saveManifest(projectRoot: string, runId: string, manifest: VerificationManifest): void {
163
+ const p = path.join(projectRoot, '.oxe', 'runs', runId, 'verification-manifest.json');
164
+ fs.mkdirSync(path.dirname(p), { recursive: true });
165
+ fs.writeFileSync(p, JSON.stringify(manifest, null, 2), 'utf8');
166
+ }
167
+
168
+ export function loadManifest(projectRoot: string, runId: string): VerificationManifest | null {
169
+ const p = path.join(projectRoot, '.oxe', 'runs', runId, 'verification-manifest.json');
170
+ if (!fs.existsSync(p)) return null;
171
+ try {
172
+ return JSON.parse(fs.readFileSync(p, 'utf8')) as VerificationManifest;
173
+ } catch {
174
+ return null;
175
+ }
176
+ }
177
+
178
+ export function saveRiskLedger(projectRoot: string, runId: string, ledger: ResidualRiskLedger): void {
179
+ const p = path.join(projectRoot, '.oxe', 'runs', runId, 'residual-risks.json');
180
+ fs.mkdirSync(path.dirname(p), { recursive: true });
181
+ fs.writeFileSync(p, JSON.stringify(ledger, null, 2), 'utf8');
182
+ }
183
+
184
+ export function loadRiskLedger(projectRoot: string, runId: string): ResidualRiskLedger | null {
185
+ const p = path.join(projectRoot, '.oxe', 'runs', runId, 'residual-risks.json');
186
+ if (!fs.existsSync(p)) return null;
187
+ try {
188
+ return JSON.parse(fs.readFileSync(p, 'utf8')) as ResidualRiskLedger;
189
+ } catch {
190
+ return null;
191
+ }
192
+ }