oxe-cc 0.9.3 → 1.0.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.
- package/README.md +1 -1
- package/bin/banner.txt +1 -1
- package/bin/lib/oxe-dashboard.cjs +9 -7
- package/bin/lib/oxe-operational.cjs +569 -4
- package/bin/oxe-cc.js +141 -57
- package/lib/runtime/compiler/graph-compiler.d.ts +83 -0
- package/lib/runtime/compiler/graph-compiler.js +135 -0
- package/lib/runtime/compiler/index.d.ts +1 -0
- package/lib/runtime/compiler/index.js +17 -0
- package/lib/runtime/context/context-pack-builder.d.ts +36 -0
- package/lib/runtime/context/context-pack-builder.js +136 -0
- package/lib/runtime/context/index.d.ts +1 -0
- package/lib/runtime/context/index.js +17 -0
- package/lib/runtime/delivery/branch-manager.d.ts +19 -0
- package/lib/runtime/delivery/branch-manager.js +78 -0
- package/lib/runtime/delivery/ci-checks.d.ts +34 -0
- package/lib/runtime/delivery/ci-checks.js +209 -0
- package/lib/runtime/delivery/index.d.ts +3 -0
- package/lib/runtime/delivery/index.js +19 -0
- package/lib/runtime/delivery/pr-manager.d.ts +30 -0
- package/lib/runtime/delivery/pr-manager.js +82 -0
- package/lib/runtime/events/bus.d.ts +9 -0
- package/lib/runtime/events/bus.js +63 -0
- package/lib/runtime/events/catalog.d.ts +3 -0
- package/lib/runtime/events/catalog.js +30 -0
- package/lib/runtime/events/envelope.d.ts +13 -0
- package/lib/runtime/events/envelope.js +2 -0
- package/lib/runtime/events/index.d.ts +3 -0
- package/lib/runtime/events/index.js +19 -0
- package/lib/runtime/evidence/evidence-store.d.ts +22 -0
- package/lib/runtime/evidence/evidence-store.js +106 -0
- package/lib/runtime/evidence/index.d.ts +1 -0
- package/lib/runtime/evidence/index.js +17 -0
- package/lib/runtime/gate/gate-manager.d.ts +39 -0
- package/lib/runtime/gate/gate-manager.js +104 -0
- package/lib/runtime/gate/index.d.ts +1 -0
- package/lib/runtime/gate/index.js +17 -0
- package/lib/runtime/index.d.ts +16 -0
- package/lib/runtime/index.js +40 -0
- package/lib/runtime/models/attempt.d.ts +12 -0
- package/lib/runtime/models/attempt.js +2 -0
- package/lib/runtime/models/evidence.d.ts +9 -0
- package/lib/runtime/models/evidence.js +2 -0
- package/lib/runtime/models/gate-decision.d.ts +10 -0
- package/lib/runtime/models/gate-decision.js +2 -0
- package/lib/runtime/models/index.d.ts +8 -0
- package/lib/runtime/models/index.js +24 -0
- package/lib/runtime/models/run.d.ts +13 -0
- package/lib/runtime/models/run.js +2 -0
- package/lib/runtime/models/session.d.ts +10 -0
- package/lib/runtime/models/session.js +2 -0
- package/lib/runtime/models/verification-result.d.ts +9 -0
- package/lib/runtime/models/verification-result.js +2 -0
- package/lib/runtime/models/work-item.d.ts +15 -0
- package/lib/runtime/models/work-item.js +2 -0
- package/lib/runtime/models/workspace.d.ts +25 -0
- package/lib/runtime/models/workspace.js +2 -0
- package/lib/runtime/plugins/index.d.ts +2 -0
- package/lib/runtime/plugins/index.js +18 -0
- package/lib/runtime/plugins/plugin-abi.d.ts +76 -0
- package/lib/runtime/plugins/plugin-abi.js +2 -0
- package/lib/runtime/plugins/plugin-registry.d.ts +21 -0
- package/lib/runtime/plugins/plugin-registry.js +114 -0
- package/lib/runtime/policy/index.d.ts +1 -0
- package/lib/runtime/policy/index.js +17 -0
- package/lib/runtime/policy/policy-engine.d.ts +40 -0
- package/lib/runtime/policy/policy-engine.js +80 -0
- package/lib/runtime/projection/index.d.ts +1 -0
- package/lib/runtime/projection/index.js +17 -0
- package/lib/runtime/projection/projection-engine.d.ts +11 -0
- package/lib/runtime/projection/projection-engine.js +218 -0
- package/lib/runtime/reducers/debug-reducer.d.ts +10 -0
- package/lib/runtime/reducers/debug-reducer.js +30 -0
- package/lib/runtime/reducers/index.d.ts +2 -0
- package/lib/runtime/reducers/index.js +18 -0
- package/lib/runtime/reducers/run-state-reducer.d.ts +20 -0
- package/lib/runtime/reducers/run-state-reducer.js +110 -0
- package/lib/runtime/scheduler/index.d.ts +1 -0
- package/lib/runtime/scheduler/index.js +17 -0
- package/lib/runtime/scheduler/multi-agent-coordinator.d.ts +34 -0
- package/lib/runtime/scheduler/multi-agent-coordinator.js +166 -0
- package/lib/runtime/scheduler/scheduler.d.ts +39 -0
- package/lib/runtime/scheduler/scheduler.js +196 -0
- package/lib/runtime/verification/index.d.ts +1 -0
- package/lib/runtime/verification/index.js +17 -0
- package/lib/runtime/verification/verification-compiler.d.ts +56 -0
- package/lib/runtime/verification/verification-compiler.js +147 -0
- package/lib/runtime/workspace/index.d.ts +5 -0
- package/lib/runtime/workspace/index.js +24 -0
- package/lib/runtime/workspace/strategies/ephemeral-container.d.ts +22 -0
- package/lib/runtime/workspace/strategies/ephemeral-container.js +109 -0
- package/lib/runtime/workspace/strategies/git-worktree.d.ts +12 -0
- package/lib/runtime/workspace/strategies/git-worktree.js +79 -0
- package/lib/runtime/workspace/strategies/inplace.d.ts +10 -0
- package/lib/runtime/workspace/strategies/inplace.js +37 -0
- package/lib/runtime/workspace/workspace-manager.d.ts +13 -0
- package/lib/runtime/workspace/workspace-manager.js +2 -0
- package/lib/sdk/index.cjs +24 -7
- package/lib/sdk/index.d.ts +17 -7
- package/package.json +9 -3
- package/packages/runtime/package.json +17 -0
- package/packages/runtime/src/compiler/graph-compiler.ts +245 -0
- package/packages/runtime/src/compiler/index.ts +1 -0
- package/packages/runtime/src/context/context-pack-builder.ts +193 -0
- package/packages/runtime/src/context/index.ts +1 -0
- package/packages/runtime/src/delivery/branch-manager.ts +84 -0
- package/packages/runtime/src/delivery/ci-checks.ts +252 -0
- package/packages/runtime/src/delivery/index.ts +3 -0
- package/packages/runtime/src/delivery/pr-manager.ts +112 -0
- package/packages/runtime/src/events/bus.ts +92 -0
- package/packages/runtime/src/events/catalog.ts +29 -0
- package/packages/runtime/src/events/envelope.ts +14 -0
- package/packages/runtime/src/events/index.ts +3 -0
- package/packages/runtime/src/evidence/evidence-store.ts +130 -0
- package/packages/runtime/src/evidence/index.ts +1 -0
- package/packages/runtime/src/gate/gate-manager.ts +137 -0
- package/packages/runtime/src/gate/index.ts +1 -0
- package/packages/runtime/src/index.ts +32 -0
- package/packages/runtime/src/models/attempt.ts +19 -0
- package/packages/runtime/src/models/evidence.ts +21 -0
- package/packages/runtime/src/models/gate-decision.ts +21 -0
- package/packages/runtime/src/models/index.ts +8 -0
- package/packages/runtime/src/models/run.ts +24 -0
- package/packages/runtime/src/models/session.ts +11 -0
- package/packages/runtime/src/models/verification-result.ts +10 -0
- package/packages/runtime/src/models/work-item.ts +25 -0
- package/packages/runtime/src/models/workspace.ts +28 -0
- package/packages/runtime/src/plugins/index.ts +2 -0
- package/packages/runtime/src/plugins/plugin-abi.ts +95 -0
- package/packages/runtime/src/plugins/plugin-registry.ts +119 -0
- package/packages/runtime/src/policy/index.ts +1 -0
- package/packages/runtime/src/policy/policy-engine.ts +113 -0
- package/packages/runtime/src/projection/index.ts +1 -0
- package/packages/runtime/src/projection/projection-engine.ts +249 -0
- package/packages/runtime/src/reducers/debug-reducer.ts +36 -0
- package/packages/runtime/src/reducers/index.ts +2 -0
- package/packages/runtime/src/reducers/run-state-reducer.ts +127 -0
- package/packages/runtime/src/scheduler/index.ts +1 -0
- package/packages/runtime/src/scheduler/multi-agent-coordinator.ts +231 -0
- package/packages/runtime/src/scheduler/scheduler.ts +281 -0
- package/packages/runtime/src/verification/index.ts +1 -0
- package/packages/runtime/src/verification/verification-compiler.ts +225 -0
- package/packages/runtime/src/workspace/index.ts +5 -0
- package/packages/runtime/src/workspace/strategies/ephemeral-container.ts +121 -0
- package/packages/runtime/src/workspace/strategies/git-worktree.ts +77 -0
- package/packages/runtime/src/workspace/strategies/inplace.ts +35 -0
- package/packages/runtime/src/workspace/workspace-manager.ts +15 -0
- package/packages/runtime/tsconfig.json +17 -0
- package/vscode-extension/oxe-agents-0.9.2.vsix +0 -0
- package/vscode-extension/oxe-agents-1.0.0.vsix +0 -0
- package/vscode-extension/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { execFileSync } from 'child_process';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import crypto from 'crypto';
|
|
5
|
+
import type { WorkspaceManager, WorkspaceRequest } from '../workspace-manager';
|
|
6
|
+
import type { WorkspaceLease, SnapshotRef } from '../../models/workspace';
|
|
7
|
+
|
|
8
|
+
export class GitWorktreeManager implements WorkspaceManager {
|
|
9
|
+
private leases = new Map<string, WorkspaceLease>();
|
|
10
|
+
|
|
11
|
+
constructor(private readonly projectRoot: string) {}
|
|
12
|
+
|
|
13
|
+
async allocate(req: WorkspaceRequest): Promise<WorkspaceLease> {
|
|
14
|
+
const wsId = `ws-${req.work_item_id}-a${req.attempt_number}`;
|
|
15
|
+
const branch = `oxe/${req.work_item_id}-attempt${req.attempt_number}`;
|
|
16
|
+
const worktreePath = path.join(this.projectRoot, '.oxe', 'workspaces', wsId);
|
|
17
|
+
|
|
18
|
+
const baseCommit = this.git(['rev-parse', 'HEAD']).trim();
|
|
19
|
+
|
|
20
|
+
fs.mkdirSync(path.dirname(worktreePath), { recursive: true });
|
|
21
|
+
|
|
22
|
+
// Create worktree on a new branch starting from HEAD
|
|
23
|
+
this.git(['worktree', 'add', worktreePath, '-b', branch]);
|
|
24
|
+
|
|
25
|
+
const lease: WorkspaceLease = {
|
|
26
|
+
workspace_id: wsId,
|
|
27
|
+
strategy: 'git_worktree',
|
|
28
|
+
branch,
|
|
29
|
+
base_commit: baseCommit,
|
|
30
|
+
root_path: worktreePath,
|
|
31
|
+
ttl_minutes: 45,
|
|
32
|
+
};
|
|
33
|
+
this.leases.set(wsId, lease);
|
|
34
|
+
return lease;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async snapshot(id: string): Promise<SnapshotRef> {
|
|
38
|
+
const lease = this.leases.get(id);
|
|
39
|
+
if (!lease || !lease.root_path) throw new Error(`Workspace ${id} not found`);
|
|
40
|
+
const commit = this.git(['rev-parse', 'HEAD'], lease.root_path).trim();
|
|
41
|
+
return {
|
|
42
|
+
snapshot_id: `snap-${crypto.randomBytes(4).toString('hex')}`,
|
|
43
|
+
workspace_id: id,
|
|
44
|
+
commit,
|
|
45
|
+
created_at: new Date().toISOString(),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async reset(id: string, snapRef: SnapshotRef): Promise<void> {
|
|
50
|
+
const lease = this.leases.get(id);
|
|
51
|
+
if (!lease) return;
|
|
52
|
+
this.git(['reset', '--hard', snapRef.commit], lease.root_path);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async dispose(id: string): Promise<void> {
|
|
56
|
+
const lease = this.leases.get(id);
|
|
57
|
+
if (!lease) return;
|
|
58
|
+
try {
|
|
59
|
+
this.git(['worktree', 'remove', lease.root_path, '--force']);
|
|
60
|
+
} catch {
|
|
61
|
+
// worktree may already be gone
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
if (lease.branch) this.git(['branch', '-D', lease.branch]);
|
|
65
|
+
} catch {
|
|
66
|
+
// branch may already be deleted
|
|
67
|
+
}
|
|
68
|
+
this.leases.delete(id);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private git(args: string[], cwd?: string): string {
|
|
72
|
+
return execFileSync('git', args, {
|
|
73
|
+
cwd: cwd ?? this.projectRoot,
|
|
74
|
+
encoding: 'utf8',
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import crypto from 'crypto';
|
|
2
|
+
import type { WorkspaceManager, WorkspaceRequest } from '../workspace-manager';
|
|
3
|
+
import type { WorkspaceLease, SnapshotRef } from '../../models/workspace';
|
|
4
|
+
|
|
5
|
+
export class InplaceWorkspaceManager implements WorkspaceManager {
|
|
6
|
+
constructor(private readonly projectRoot: string) {}
|
|
7
|
+
|
|
8
|
+
async allocate(req: WorkspaceRequest): Promise<WorkspaceLease> {
|
|
9
|
+
return {
|
|
10
|
+
workspace_id: `ws-inplace-${req.work_item_id}-a${req.attempt_number}`,
|
|
11
|
+
strategy: 'inplace',
|
|
12
|
+
branch: null,
|
|
13
|
+
base_commit: null,
|
|
14
|
+
root_path: this.projectRoot,
|
|
15
|
+
ttl_minutes: 60,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async snapshot(id: string): Promise<SnapshotRef> {
|
|
20
|
+
return {
|
|
21
|
+
snapshot_id: `snap-${crypto.randomBytes(4).toString('hex')}`,
|
|
22
|
+
workspace_id: id,
|
|
23
|
+
commit: 'HEAD',
|
|
24
|
+
created_at: new Date().toISOString(),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async reset(_id: string, _snapRef: SnapshotRef): Promise<void> {
|
|
29
|
+
// inplace: no filesystem isolation — reset is a no-op
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async dispose(_id: string): Promise<void> {
|
|
33
|
+
// inplace: nothing to tear down
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WorkspaceLease, SnapshotRef, WorkspaceStrategy } from '../models/workspace';
|
|
2
|
+
|
|
3
|
+
export interface WorkspaceRequest {
|
|
4
|
+
work_item_id: string;
|
|
5
|
+
attempt_number: number;
|
|
6
|
+
strategy: WorkspaceStrategy;
|
|
7
|
+
mutation_scope: string[];
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface WorkspaceManager {
|
|
11
|
+
allocate(req: WorkspaceRequest): Promise<WorkspaceLease>;
|
|
12
|
+
snapshot(id: string): Promise<SnapshotRef>;
|
|
13
|
+
reset(id: string, snapRef: SnapshotRef): Promise<void>;
|
|
14
|
+
dispose(id: string): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"declarationMap": false,
|
|
10
|
+
"sourceMap": false,
|
|
11
|
+
"outDir": "../../lib/runtime",
|
|
12
|
+
"rootDir": "src",
|
|
13
|
+
"skipLibCheck": true
|
|
14
|
+
},
|
|
15
|
+
"include": ["src/**/*.ts"],
|
|
16
|
+
"exclude": ["tests/**", "node_modules/**", "dist-tests/**"]
|
|
17
|
+
}
|
|
Binary file
|
|
Binary file
|