agentic-orchestrator 0.1.26 → 0.1.28
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/AGENTS.md +2 -2
- package/CLAUDE.md +2 -2
- package/README.md +47 -14
- package/agentic/orchestrator/agents.yaml +13 -0
- package/agentic/orchestrator/policy.yaml +3 -0
- package/agentic/orchestrator/schemas/agents.schema.json +76 -0
- package/agentic/orchestrator/schemas/policy.schema.json +16 -0
- package/agentic/orchestrator/schemas/policy.user.schema.json +16 -0
- package/agentic/orchestrator/schemas/state.schema.json +53 -0
- package/apps/control-plane/src/application/configuration-service.ts +181 -0
- package/apps/control-plane/src/application/kernel-tool-wiring.ts +292 -0
- package/apps/control-plane/src/application/services/checkpoint-service.ts +523 -0
- package/apps/control-plane/src/application/services/feature-send-message-service.ts +132 -0
- package/apps/control-plane/src/application/services/patch-service.ts +29 -5
- package/apps/control-plane/src/application/services/repo-operations-service.ts +276 -0
- package/apps/control-plane/src/application/services/worktree-watchdog-service.ts +156 -0
- package/apps/control-plane/src/cli/cli-argument-parser.ts +12 -0
- package/apps/control-plane/src/cli/help-command-handler.ts +17 -0
- package/apps/control-plane/src/cli/init-command-handler.ts +31 -0
- package/apps/control-plane/src/cli/resume-command-handler.ts +31 -4
- package/apps/control-plane/src/cli/rollback-command-handler.ts +217 -0
- package/apps/control-plane/src/cli/run-command-handler.ts +8 -0
- package/apps/control-plane/src/cli/types.ts +3 -0
- package/apps/control-plane/src/core/kernel-types.ts +55 -0
- package/apps/control-plane/src/core/kernel.ts +61 -878
- package/apps/control-plane/src/core/tool-caller.ts +10 -0
- package/apps/control-plane/src/core/utils/field-readers.ts +38 -0
- package/apps/control-plane/src/core/utils/index-normalizer.ts +119 -0
- package/apps/control-plane/src/core/utils/path-normalizers.ts +22 -0
- package/apps/control-plane/src/interfaces/cli/bootstrap.ts +15 -0
- package/apps/control-plane/src/providers/api-worker-provider.ts +14 -12
- package/apps/control-plane/src/providers/cli-worker-provider.ts +82 -12
- package/apps/control-plane/src/providers/providers.ts +45 -24
- package/apps/control-plane/src/providers/worker-provider-factory.ts +36 -1
- package/apps/control-plane/src/supervisor/run-coordinator.ts +91 -36
- package/apps/control-plane/src/supervisor/runtime.ts +107 -1
- package/apps/control-plane/src/supervisor/types.ts +9 -0
- package/apps/control-plane/src/supervisor/worker-decision-loop.ts +253 -14
- package/apps/control-plane/test/checkpoint-service.spec.ts +537 -0
- package/apps/control-plane/test/cli-helpers.spec.ts +28 -0
- package/apps/control-plane/test/cli.unit.spec.ts +52 -0
- package/apps/control-plane/test/configuration-service.spec.ts +466 -0
- package/apps/control-plane/test/dashboard-api.integration.spec.ts +537 -0
- package/apps/control-plane/test/dashboard-client.spec.ts +233 -0
- package/apps/control-plane/test/feature-send-message-service.spec.ts +314 -0
- package/apps/control-plane/test/init-wizard.spec.ts +35 -0
- package/apps/control-plane/test/path-normalizers.spec.ts +41 -0
- package/apps/control-plane/test/repo-operations-service.spec.ts +339 -0
- package/apps/control-plane/test/resume-command.spec.ts +33 -0
- package/apps/control-plane/test/review-workspace-logic.spec.ts +130 -0
- package/apps/control-plane/test/rollback-command.spec.ts +208 -0
- package/apps/control-plane/test/run-coordinator.spec.ts +119 -0
- package/apps/control-plane/test/worker-decision-loop.spec.ts +209 -0
- package/apps/control-plane/test/worker-provider-adapters.spec.ts +102 -0
- package/apps/control-plane/test/worker-provider-factory.spec.ts +14 -0
- package/apps/control-plane/test/worktree-watchdog-service.spec.ts +147 -0
- package/config/agentic/orchestrator/agents.yaml +13 -0
- package/dist/apps/control-plane/application/configuration-service.d.ts +19 -0
- package/dist/apps/control-plane/application/configuration-service.js +123 -0
- package/dist/apps/control-plane/application/configuration-service.js.map +1 -0
- package/dist/apps/control-plane/application/kernel-tool-wiring.d.ts +39 -0
- package/dist/apps/control-plane/application/kernel-tool-wiring.js +38 -0
- package/dist/apps/control-plane/application/kernel-tool-wiring.js.map +1 -0
- package/dist/apps/control-plane/application/services/checkpoint-service.d.ts +84 -0
- package/dist/apps/control-plane/application/services/checkpoint-service.js +367 -0
- package/dist/apps/control-plane/application/services/checkpoint-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/feature-send-message-service.d.ts +25 -0
- package/dist/apps/control-plane/application/services/feature-send-message-service.js +105 -0
- package/dist/apps/control-plane/application/services/feature-send-message-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/patch-service.d.ts +6 -0
- package/dist/apps/control-plane/application/services/patch-service.js +11 -2
- package/dist/apps/control-plane/application/services/patch-service.js.map +1 -1
- package/dist/apps/control-plane/application/services/repo-operations-service.d.ts +70 -0
- package/dist/apps/control-plane/application/services/repo-operations-service.js +213 -0
- package/dist/apps/control-plane/application/services/repo-operations-service.js.map +1 -0
- package/dist/apps/control-plane/application/services/worktree-watchdog-service.d.ts +23 -0
- package/dist/apps/control-plane/application/services/worktree-watchdog-service.js +119 -0
- package/dist/apps/control-plane/application/services/worktree-watchdog-service.js.map +1 -0
- package/dist/apps/control-plane/cli/cli-argument-parser.js +12 -0
- package/dist/apps/control-plane/cli/cli-argument-parser.js.map +1 -1
- package/dist/apps/control-plane/cli/help-command-handler.js +17 -0
- package/dist/apps/control-plane/cli/help-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/init-command-handler.js +23 -0
- package/dist/apps/control-plane/cli/init-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/resume-command-handler.js +25 -5
- package/dist/apps/control-plane/cli/resume-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/rollback-command-handler.d.ts +6 -0
- package/dist/apps/control-plane/cli/rollback-command-handler.js +177 -0
- package/dist/apps/control-plane/cli/rollback-command-handler.js.map +1 -0
- package/dist/apps/control-plane/cli/run-command-handler.js +7 -1
- package/dist/apps/control-plane/cli/run-command-handler.js.map +1 -1
- package/dist/apps/control-plane/cli/types.d.ts +3 -0
- package/dist/apps/control-plane/cli/types.js +1 -0
- package/dist/apps/control-plane/cli/types.js.map +1 -1
- package/dist/apps/control-plane/core/configuration-service.d.ts +25 -0
- package/dist/apps/control-plane/core/configuration-service.js +130 -0
- package/dist/apps/control-plane/core/configuration-service.js.map +1 -0
- package/dist/apps/control-plane/core/kernel-tool-wiring.d.ts +50 -0
- package/dist/apps/control-plane/core/kernel-tool-wiring.js +44 -0
- package/dist/apps/control-plane/core/kernel-tool-wiring.js.map +1 -0
- package/dist/apps/control-plane/core/kernel-types.d.ts +48 -0
- package/dist/apps/control-plane/core/kernel-types.js +2 -0
- package/dist/apps/control-plane/core/kernel-types.js.map +1 -0
- package/dist/apps/control-plane/core/kernel.d.ts +17 -48
- package/dist/apps/control-plane/core/kernel.js +44 -539
- package/dist/apps/control-plane/core/kernel.js.map +1 -1
- package/dist/apps/control-plane/core/tool-caller.d.ts +10 -0
- package/dist/apps/control-plane/core/utils/error-normalizer.d.ts +2 -0
- package/dist/apps/control-plane/core/utils/error-normalizer.js +51 -0
- package/dist/apps/control-plane/core/utils/error-normalizer.js.map +1 -0
- package/dist/apps/control-plane/core/utils/field-readers.d.ts +9 -0
- package/dist/apps/control-plane/core/utils/field-readers.js +30 -0
- package/dist/apps/control-plane/core/utils/field-readers.js.map +1 -0
- package/dist/apps/control-plane/core/utils/index-normalizer.d.ts +7 -0
- package/dist/apps/control-plane/core/utils/index-normalizer.js +92 -0
- package/dist/apps/control-plane/core/utils/index-normalizer.js.map +1 -0
- package/dist/apps/control-plane/core/utils/path-normalizers.d.ts +2 -0
- package/dist/apps/control-plane/core/utils/path-normalizers.js +17 -0
- package/dist/apps/control-plane/core/utils/path-normalizers.js.map +1 -0
- package/dist/apps/control-plane/interfaces/cli/bootstrap.js +13 -1
- package/dist/apps/control-plane/interfaces/cli/bootstrap.js.map +1 -1
- package/dist/apps/control-plane/providers/api-worker-provider.d.ts +4 -13
- package/dist/apps/control-plane/providers/api-worker-provider.js +10 -0
- package/dist/apps/control-plane/providers/api-worker-provider.js.map +1 -1
- package/dist/apps/control-plane/providers/cli-worker-provider.d.ts +11 -13
- package/dist/apps/control-plane/providers/cli-worker-provider.js +64 -0
- package/dist/apps/control-plane/providers/cli-worker-provider.js.map +1 -1
- package/dist/apps/control-plane/providers/providers.d.ts +31 -24
- package/dist/apps/control-plane/providers/providers.js +10 -0
- package/dist/apps/control-plane/providers/providers.js.map +1 -1
- package/dist/apps/control-plane/providers/worker-provider-factory.d.ts +11 -0
- package/dist/apps/control-plane/providers/worker-provider-factory.js +20 -1
- package/dist/apps/control-plane/providers/worker-provider-factory.js.map +1 -1
- package/dist/apps/control-plane/supervisor/run-coordinator.d.ts +3 -0
- package/dist/apps/control-plane/supervisor/run-coordinator.js +81 -33
- package/dist/apps/control-plane/supervisor/run-coordinator.js.map +1 -1
- package/dist/apps/control-plane/supervisor/runtime.d.ts +8 -1
- package/dist/apps/control-plane/supervisor/runtime.js +90 -0
- package/dist/apps/control-plane/supervisor/runtime.js.map +1 -1
- package/dist/apps/control-plane/supervisor/types.d.ts +11 -0
- package/dist/apps/control-plane/supervisor/types.js.map +1 -1
- package/dist/apps/control-plane/supervisor/worker-decision-loop.d.ts +21 -1
- package/dist/apps/control-plane/supervisor/worker-decision-loop.js +207 -13
- package/dist/apps/control-plane/supervisor/worker-decision-loop.js.map +1 -1
- package/package.json +1 -1
- package/packages/web-dashboard/package.json +2 -0
- package/packages/web-dashboard/src/app/analytics/page.tsx +83 -2
- package/packages/web-dashboard/src/app/api/actions/route.ts +92 -1
- package/packages/web-dashboard/src/app/api/analytics/route.ts +5 -2
- package/packages/web-dashboard/src/app/api/features/[id]/checkpoints/[checkpointId]/diff/route.ts +43 -0
- package/packages/web-dashboard/src/app/api/features/[id]/checkpoints/compare/route.ts +45 -0
- package/packages/web-dashboard/src/app/api/features/[id]/checkpoints/stream/route.ts +170 -0
- package/packages/web-dashboard/src/app/api/features/[id]/file-diff/route.ts +144 -0
- package/packages/web-dashboard/src/app/api/features/[id]/log-stream/route.ts +167 -0
- package/packages/web-dashboard/src/app/api/features/[id]/raw-logs/[filename]/route.ts +65 -0
- package/packages/web-dashboard/src/app/api/features/[id]/raw-logs/route.ts +63 -0
- package/packages/web-dashboard/src/app/api/features/[id]/timeline/route.ts +60 -0
- package/packages/web-dashboard/src/app/feature/[id]/page.tsx +32 -11
- package/packages/web-dashboard/src/app/globals.css +2 -0
- package/packages/web-dashboard/src/components/detail-panel.tsx +483 -0
- package/packages/web-dashboard/src/components/review-workspace.tsx +1162 -0
- package/packages/web-dashboard/src/lib/aop-client.ts +725 -0
- package/packages/web-dashboard/src/lib/review-contracts.ts +182 -0
- package/packages/web-dashboard/src/lib/review-workspace-logic.ts +64 -0
- package/packages/web-dashboard/src/lib/types.ts +131 -0
- package/packages/web-dashboard/src/styles/dashboard.module.css +333 -0
- package/spec-files/completed/agentic_orchestrator_execution_mode_spec.md +1905 -0
- package/spec-files/outstanding/agentic_orchestrator_runtime_inspection_spec.md +940 -0
- package/spec-files/outstanding/execution_mode_critical_review.md +355 -0
- package/spec-files/outstanding/shadow_workspace_implementation_spec.md +1271 -0
- package/spec-files/outstanding/shadow_workspace_spec_summary.md +222 -0
- package/spec-files/progress.md +269 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { ERROR_CODES } from '../core/error-codes.js';
|
|
4
|
+
import { parseFrontMatter } from '../core/frontmatter.js';
|
|
5
|
+
import { runGit } from '../core/git.js';
|
|
6
|
+
import type { AppError } from '../providers/providers.js';
|
|
7
|
+
import type { CliOptions } from './types.js';
|
|
8
|
+
|
|
9
|
+
interface CheckpointRollbackRecord {
|
|
10
|
+
checkpoint_id: string;
|
|
11
|
+
diff_snapshot: string;
|
|
12
|
+
validation_status: 'valid' | 'invalid' | 'skipped';
|
|
13
|
+
timestamp: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function isValidFeatureId(value: string): boolean {
|
|
17
|
+
return /^[a-z0-9_][a-z0-9_-]*$/.test(value);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function invalidCliArgs(details: Record<string, unknown>): never {
|
|
21
|
+
const error = new Error(ERROR_CODES.INVALID_CLI_ARGS) as AppError;
|
|
22
|
+
error.code = ERROR_CODES.INVALID_CLI_ARGS;
|
|
23
|
+
error.details = details;
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function asCheckpointRecord(value: unknown): CheckpointRollbackRecord | null {
|
|
28
|
+
if (!value || typeof value !== 'object') {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const record = value as Record<string, unknown>;
|
|
32
|
+
const checkpointId =
|
|
33
|
+
typeof record['checkpoint_id'] === 'string' ? record['checkpoint_id'].trim() : '';
|
|
34
|
+
const diffSnapshot =
|
|
35
|
+
typeof record['diff_snapshot'] === 'string' ? record['diff_snapshot'].trim() : '';
|
|
36
|
+
const timestamp = typeof record['timestamp'] === 'string' ? record['timestamp'] : '';
|
|
37
|
+
const validationStatus =
|
|
38
|
+
record['validation_status'] === 'valid' ||
|
|
39
|
+
record['validation_status'] === 'invalid' ||
|
|
40
|
+
record['validation_status'] === 'skipped'
|
|
41
|
+
? record['validation_status']
|
|
42
|
+
: null;
|
|
43
|
+
|
|
44
|
+
if (!checkpointId || !diffSnapshot || !timestamp || !validationStatus) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
checkpoint_id: checkpointId,
|
|
50
|
+
diff_snapshot: diffSnapshot,
|
|
51
|
+
validation_status: validationStatus,
|
|
52
|
+
timestamp,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function throwFileNotFound(details: Record<string, unknown>): never {
|
|
57
|
+
const error = new Error(ERROR_CODES.FILE_NOT_FOUND) as AppError;
|
|
58
|
+
error.code = ERROR_CODES.FILE_NOT_FOUND;
|
|
59
|
+
error.details = details;
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function isPathInside(rootPath: string, targetPath: string): boolean {
|
|
64
|
+
const root = path.resolve(rootPath);
|
|
65
|
+
const target = path.resolve(targetPath);
|
|
66
|
+
if (target === root) {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
return target.startsWith(`${root}${path.sep}`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function normalizeWorktreePath(
|
|
73
|
+
frontMatter: Record<string, unknown>,
|
|
74
|
+
repoRoot: string,
|
|
75
|
+
featureId: string,
|
|
76
|
+
): string {
|
|
77
|
+
const fromState =
|
|
78
|
+
typeof frontMatter['worktree_path'] === 'string' &&
|
|
79
|
+
frontMatter['worktree_path'].trim().length > 0
|
|
80
|
+
? frontMatter['worktree_path'].trim()
|
|
81
|
+
: path.join(repoRoot, '.worktrees', featureId);
|
|
82
|
+
return path.resolve(fromState);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export class RollbackCommandHandler {
|
|
86
|
+
private readonly repoRoot: string;
|
|
87
|
+
|
|
88
|
+
constructor(repoRoot: string) {
|
|
89
|
+
this.repoRoot = repoRoot;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async execute(options: CliOptions): Promise<unknown> {
|
|
93
|
+
const featureId = options.feature_id?.trim() ?? '';
|
|
94
|
+
if (!featureId) {
|
|
95
|
+
invalidCliArgs({
|
|
96
|
+
reason: '--feature-id is required for rollback',
|
|
97
|
+
expected: '--feature-id <feature_id>',
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (!isValidFeatureId(featureId)) {
|
|
101
|
+
invalidCliArgs({
|
|
102
|
+
reason: 'Invalid --feature-id value',
|
|
103
|
+
provided: featureId,
|
|
104
|
+
expected_pattern: '^[a-z0-9_][a-z0-9_-]*$',
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const checkpointId = options.checkpoint?.trim() ?? '';
|
|
109
|
+
if (!checkpointId) {
|
|
110
|
+
invalidCliArgs({
|
|
111
|
+
reason: '--checkpoint is required for rollback',
|
|
112
|
+
expected: '--checkpoint <checkpoint_id>',
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const statePath = path.join(this.repoRoot, '.aop', 'features', featureId, 'state.md');
|
|
117
|
+
let stateRaw = '';
|
|
118
|
+
try {
|
|
119
|
+
stateRaw = await fs.readFile(statePath, 'utf8');
|
|
120
|
+
} catch {
|
|
121
|
+
throwFileNotFound({
|
|
122
|
+
reason: 'Feature state not found',
|
|
123
|
+
feature_id: featureId,
|
|
124
|
+
state_path: statePath,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const { frontMatter } = parseFrontMatter(stateRaw);
|
|
129
|
+
const checkpoints = Array.isArray(frontMatter['checkpoints'])
|
|
130
|
+
? frontMatter['checkpoints']
|
|
131
|
+
.map((entry) => asCheckpointRecord(entry))
|
|
132
|
+
.filter((entry): entry is CheckpointRollbackRecord => entry != null)
|
|
133
|
+
: [];
|
|
134
|
+
const checkpoint = checkpoints.find((entry) => entry.checkpoint_id === checkpointId);
|
|
135
|
+
|
|
136
|
+
if (!checkpoint) {
|
|
137
|
+
invalidCliArgs({
|
|
138
|
+
reason: 'Checkpoint not found for feature',
|
|
139
|
+
feature_id: featureId,
|
|
140
|
+
checkpoint_id: checkpointId,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const checkpointPath = path.resolve(this.repoRoot, checkpoint.diff_snapshot);
|
|
145
|
+
if (!isPathInside(this.repoRoot, checkpointPath)) {
|
|
146
|
+
invalidCliArgs({
|
|
147
|
+
reason: 'Checkpoint diff snapshot resolved outside repository root',
|
|
148
|
+
checkpoint_path: checkpointPath,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
try {
|
|
153
|
+
await fs.stat(checkpointPath);
|
|
154
|
+
} catch {
|
|
155
|
+
throwFileNotFound({
|
|
156
|
+
reason: 'Checkpoint diff snapshot file not found',
|
|
157
|
+
feature_id: featureId,
|
|
158
|
+
checkpoint_id: checkpointId,
|
|
159
|
+
checkpoint_path: checkpointPath,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const worktreePath = normalizeWorktreePath(frontMatter, this.repoRoot, featureId);
|
|
164
|
+
|
|
165
|
+
if (options.dry_run === true) {
|
|
166
|
+
return {
|
|
167
|
+
ok: true,
|
|
168
|
+
data: {
|
|
169
|
+
command: 'rollback',
|
|
170
|
+
feature_id: featureId,
|
|
171
|
+
checkpoint_id: checkpointId,
|
|
172
|
+
worktree_path: worktreePath,
|
|
173
|
+
checkpoint_path: checkpointPath,
|
|
174
|
+
dry_run: true,
|
|
175
|
+
applied: false,
|
|
176
|
+
validation_status: checkpoint.validation_status,
|
|
177
|
+
message: `Rollback preview ready for ${featureId} at ${checkpointId}`,
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const applyResult = await runGit(
|
|
183
|
+
this.repoRoot,
|
|
184
|
+
['apply', '-R', '--whitespace=nowarn', checkpointPath],
|
|
185
|
+
{ cwd: worktreePath },
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
if (applyResult.code !== 0) {
|
|
189
|
+
const error = new Error(ERROR_CODES.GIT_FAILURE) as AppError;
|
|
190
|
+
error.code = ERROR_CODES.GIT_FAILURE;
|
|
191
|
+
error.details = {
|
|
192
|
+
feature_id: featureId,
|
|
193
|
+
checkpoint_id: checkpointId,
|
|
194
|
+
checkpoint_path: checkpointPath,
|
|
195
|
+
worktree_path: worktreePath,
|
|
196
|
+
stderr: applyResult.stderr,
|
|
197
|
+
};
|
|
198
|
+
throw error;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return {
|
|
202
|
+
ok: true,
|
|
203
|
+
data: {
|
|
204
|
+
command: 'rollback',
|
|
205
|
+
feature_id: featureId,
|
|
206
|
+
checkpoint_id: checkpointId,
|
|
207
|
+
worktree_path: worktreePath,
|
|
208
|
+
checkpoint_path: checkpointPath,
|
|
209
|
+
dry_run: false,
|
|
210
|
+
applied: true,
|
|
211
|
+
validation_status: checkpoint.validation_status,
|
|
212
|
+
timestamp: checkpoint.timestamp,
|
|
213
|
+
message: `Rolled back ${featureId} to checkpoint ${checkpointId}`,
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
}
|
|
@@ -4,6 +4,7 @@ import { resolveProviderSelection } from '../providers/providers.js';
|
|
|
4
4
|
import {
|
|
5
5
|
DefaultWorkerProviderFactory,
|
|
6
6
|
resolveWorkerProviderMode,
|
|
7
|
+
resolveWorkerProviderObservability,
|
|
7
8
|
resolveWorkerProviderPolicy,
|
|
8
9
|
resolveWorkerProviderRuntime,
|
|
9
10
|
type WorkerProviderFactory,
|
|
@@ -88,6 +89,10 @@ export class RunCommandHandler {
|
|
|
88
89
|
policySnapshot.execution && typeof policySnapshot.execution === 'object'
|
|
89
90
|
? (policySnapshot.execution as Record<string, unknown>)
|
|
90
91
|
: null;
|
|
92
|
+
const observabilityPolicy =
|
|
93
|
+
policySnapshot.observability && typeof policySnapshot.observability === 'object'
|
|
94
|
+
? (policySnapshot.observability as Record<string, unknown>)
|
|
95
|
+
: null;
|
|
91
96
|
const provider = this.workerProviderFactory.create({
|
|
92
97
|
selection,
|
|
93
98
|
mode: resolveWorkerProviderMode(
|
|
@@ -97,7 +102,9 @@ export class RunCommandHandler {
|
|
|
97
102
|
),
|
|
98
103
|
context: 'run',
|
|
99
104
|
policy: resolveWorkerProviderPolicy(executionPolicy),
|
|
105
|
+
observability: resolveWorkerProviderObservability(observabilityPolicy),
|
|
100
106
|
runtime: runtimeConfig,
|
|
107
|
+
repoRoot,
|
|
101
108
|
});
|
|
102
109
|
const supervisor = new SupervisorRuntime(kernel, provider, toolClient, {
|
|
103
110
|
max_active_features: maxActiveFeatures ?? 5,
|
|
@@ -105,6 +112,7 @@ export class RunCommandHandler {
|
|
|
105
112
|
run_id: runId,
|
|
106
113
|
owner_instance_id: kernel.instanceId,
|
|
107
114
|
takeover_stale_run: options.takeover_stale_run,
|
|
115
|
+
execution_mode: options.execution_mode,
|
|
108
116
|
});
|
|
109
117
|
|
|
110
118
|
const startResult = await supervisor.start(ingested as Array<{ feature_id: string }>);
|
|
@@ -5,6 +5,7 @@ export enum CliCommand {
|
|
|
5
5
|
Stop = 'stop',
|
|
6
6
|
Delete = 'delete',
|
|
7
7
|
Cleanup = 'cleanup',
|
|
8
|
+
Rollback = 'rollback',
|
|
8
9
|
Init = 'init',
|
|
9
10
|
Dashboard = 'dashboard',
|
|
10
11
|
Retry = 'retry',
|
|
@@ -19,6 +20,7 @@ export interface CliOptions {
|
|
|
19
20
|
folder_input?: string;
|
|
20
21
|
feature_id?: string;
|
|
21
22
|
message?: string;
|
|
23
|
+
checkpoint?: string;
|
|
22
24
|
dry_run?: boolean;
|
|
23
25
|
yes?: boolean;
|
|
24
26
|
remove_worktree?: boolean;
|
|
@@ -28,6 +30,7 @@ export interface CliOptions {
|
|
|
28
30
|
agent_config?: string;
|
|
29
31
|
provider_config_env?: string;
|
|
30
32
|
worker_provider_mode?: 'live' | 'stub';
|
|
33
|
+
execution_mode?: 'deterministic' | 'interactive';
|
|
31
34
|
transport?: string;
|
|
32
35
|
takeover_stale_run?: boolean;
|
|
33
36
|
batch?: boolean;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
|
+
export type AnyRecord = Record<string, any>;
|
|
3
|
+
|
|
4
|
+
export interface KernelContext {
|
|
5
|
+
actor_type?: string;
|
|
6
|
+
actor_id?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface KernelConfigOverrides {
|
|
10
|
+
policyPath?: string;
|
|
11
|
+
gatesPath?: string;
|
|
12
|
+
agentsPath?: string;
|
|
13
|
+
adaptersPath?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface AgentsRoleConfig {
|
|
17
|
+
system_prompt_path?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AgentsRuntimeConfig {
|
|
21
|
+
execution_mode?: 'deterministic' | 'interactive' | string;
|
|
22
|
+
interactive?: {
|
|
23
|
+
watchdog_poll_interval_ms?: number;
|
|
24
|
+
checkpoint_interval_ms?: number;
|
|
25
|
+
max_uncommitted_changes?: number;
|
|
26
|
+
validation_on_checkpoint?: boolean;
|
|
27
|
+
revert_on_violation?: boolean;
|
|
28
|
+
violation_severity?: 'info' | 'warning' | 'error' | 'critical' | string;
|
|
29
|
+
shadow_workspace?: {
|
|
30
|
+
enabled?: boolean;
|
|
31
|
+
promotion_strategy?: 'atomic' | 'incremental' | string;
|
|
32
|
+
cleanup_on_failure?: boolean;
|
|
33
|
+
max_shadow_size_mb?: number;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
default_provider?: string;
|
|
37
|
+
default_model?: string;
|
|
38
|
+
provider_config_env?: string;
|
|
39
|
+
default_agent_config?: Record<string, unknown>;
|
|
40
|
+
provider_configs?: Record<string, Record<string, unknown>>;
|
|
41
|
+
worker_provider_mode?: 'live' | 'stub' | string;
|
|
42
|
+
worker_response_timeout_ms?: number;
|
|
43
|
+
max_consecutive_no_progress_iterations?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface AgentsConfigSnapshot {
|
|
47
|
+
version?: number;
|
|
48
|
+
roles?: Record<string, AgentsRoleConfig>;
|
|
49
|
+
missing_prompt_behavior?: 'ignore' | 'error' | string;
|
|
50
|
+
runtime?: AgentsRuntimeConfig;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface PolicyConfigSnapshot extends AnyRecord {
|
|
54
|
+
rbac?: Record<string, string[]>;
|
|
55
|
+
}
|