@oooooooooo/ch0de 0.0.0-stage → 1.9.55
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/API-TESTING.md +76 -0
- package/DEBTAUR-INTEGRATION.md +71 -0
- package/EDITING.md +80 -0
- package/EXPERT-PANEL.md +16 -0
- package/INTEGRATIONS.md +75 -0
- package/LICENSE +21 -0
- package/MODELS-DEV-LICENSE +21 -0
- package/PROVIDER-CONNECTIONS.md +48 -0
- package/PROVIDERS.md +17 -0
- package/README.md +523 -2
- package/RELIABILITY.md +95 -0
- package/UX-1.3.md +83 -0
- package/UX-1.4.1.md +13 -0
- package/UX-1.4.md +48 -0
- package/UX-1.5.md +13 -0
- package/UX-1.6.md +7 -0
- package/UX-1.7.3.md +13 -0
- package/UX-1.7.4.md +13 -0
- package/UX-1.7.md +19 -0
- package/acceptance-check.js +27 -0
- package/agent-budget.js +4 -0
- package/api-testing.js +140 -0
- package/automatic-re.js +19 -0
- package/benchmarks/public-baselines.json +29 -0
- package/benchmarks/render-1.4.0.json +8 -0
- package/benchmarks/targets.js +11 -0
- package/browser-check.js +1062 -0
- package/build-progress.js +10 -0
- package/build-quality.js +49 -0
- package/chode.js +7937 -0
- package/debtaur-engine.js +305 -0
- package/debtaur-orchestration.js +456 -0
- package/debtaur-worker.cjs +76 -0
- package/doctor.js +24 -0
- package/edit-transactions.js +79 -0
- package/elapsed.js +28 -0
- package/evidence-ledger.js +26 -0
- package/expert-panel.cjs +42 -0
- package/helios-ledger.js +405 -0
- package/install.cjs +25 -0
- package/integrations.js +30 -0
- package/json-output.js +8 -0
- package/local-memory.js +613 -0
- package/local-models.js +52 -0
- package/mcp-client.js +50 -0
- package/memory.js +511 -0
- package/model-catalog.js +46 -0
- package/native-tools.js +27 -0
- package/nosignups.js +325 -0
- package/observation-progress.js +33 -0
- package/orchestrator.js +299 -0
- package/package.json +158 -6
- package/plan-z6.js +490 -0
- package/project-memory.js +27 -0
- package/provider-capacity.js +13 -0
- package/provider-catalog.js +246 -0
- package/provider-connect.js +66 -0
- package/provider-credentials.js +5 -0
- package/provider-directory.js +8 -0
- package/provider-directory.json +32300 -0
- package/provider-errors.js +11 -0
- package/provider-picker.js +188 -0
- package/provider-policy.js +4 -0
- package/provider-race.js +25 -0
- package/provider-request.js +45 -0
- package/provider-store.js +13 -0
- package/rea-environment.js +5 -0
- package/read-window.js +21 -0
- package/recovery-context.js +3 -0
- package/reliability-memory.js +38 -0
- package/reliability-services.js +34 -0
- package/reliability-store.js +16 -0
- package/request-deadline.js +4 -0
- package/serve-frontend.html +172 -0
- package/settings-reset.js +11 -0
- package/skill-catalog.js +16 -0
- package/task-group.js +22 -0
- package/terminal-graphics.js +39 -0
- package/terminal-logo.js +76 -0
- package/terminal-ui.js +79 -0
- package/tool-call-validation.js +26 -0
- package/tool-health.js +22 -0
- package/tool-history.js +5 -0
- package/toolbox.js +156 -0
- package/tui-provider-picker.js +134 -0
- package/tui-worker.js +32 -0
- package/web-context.js +232 -0
- package/wolfram-math.js +6 -0
- package/worker-transport.js +11 -0
- package/workspace-commands.js +45 -0
- package/workspace-log.js +56 -0
- package/workspace-store.js +7 -0
- package/workspace-tui.js +113 -0
- package/workspace-view.js +109 -0
- package/worktrees.js +18 -0
- package/z6-integration.js +227 -0
package/orchestrator.js
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { spawnSync } = require('child_process');
|
|
6
|
+
|
|
7
|
+
function norm(file) {
|
|
8
|
+
return String(file == null ? '' : file).replace(/\\/g, '/').replace(/^\.\//, '');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function stepFiles(step) {
|
|
12
|
+
return Array.from(new Set(((step && step.files) || []).map(norm).filter(Boolean)));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function ownedFiles(step, options) {
|
|
16
|
+
options = options || {};
|
|
17
|
+
const instruction = String((step && step.text) || '').split(/(?:—|\bcheck\s*:)/i)[0];
|
|
18
|
+
const cleaned = instruction.replace(/^[\s*\-_`0-9.)]+/, '');
|
|
19
|
+
if (/^(?:read|inspect|review|check|verify|test|run|execute|compile|grep|search|list|find|debug|commit)\b/i.test(cleaned)) return [];
|
|
20
|
+
const protectedFile = options.acceptanceTest ? norm(options.acceptanceTest) : '';
|
|
21
|
+
const candidates = stepFiles(step).filter(function (file) { return file !== protectedFile; });
|
|
22
|
+
let files = candidates.filter(function (file) { return instruction.indexOf(file) !== -1; });
|
|
23
|
+
if (/^(?:edit|update|modify|refactor|change|fix|patch|targeted\s+edit)\b/i.test(cleaned) && files.length > 1) files = [files[0]];
|
|
24
|
+
return files.length ? files : candidates;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function buildUnits(planSteps, options) {
|
|
28
|
+
options = options || {};
|
|
29
|
+
const maxUnits = Math.max(2, Math.min(6, Number(options.maxUnits) || 4));
|
|
30
|
+
const steps = (planSteps || []).filter(function (step) { return ownedFiles(step, options).length; });
|
|
31
|
+
if (steps.length < 2) return [];
|
|
32
|
+
|
|
33
|
+
const parent = steps.map(function (_, index) { return index; });
|
|
34
|
+
function find(index) {
|
|
35
|
+
while (parent[index] !== index) {
|
|
36
|
+
parent[index] = parent[parent[index]];
|
|
37
|
+
index = parent[index];
|
|
38
|
+
}
|
|
39
|
+
return index;
|
|
40
|
+
}
|
|
41
|
+
function union(a, b) {
|
|
42
|
+
const ra = find(a), rb = find(b);
|
|
43
|
+
if (ra !== rb) parent[rb] = ra;
|
|
44
|
+
}
|
|
45
|
+
const owners = Object.create(null);
|
|
46
|
+
steps.forEach(function (step, index) {
|
|
47
|
+
ownedFiles(step, options).forEach(function (file) {
|
|
48
|
+
if (owners[file] == null) owners[file] = index;
|
|
49
|
+
else union(owners[file], index);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const grouped = new Map();
|
|
54
|
+
steps.forEach(function (step, index) {
|
|
55
|
+
const root = find(index);
|
|
56
|
+
if (!grouped.has(root)) grouped.set(root, []);
|
|
57
|
+
grouped.get(root).push(step);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
let units = Array.from(grouped.values()).map(function (group, index) {
|
|
61
|
+
const files = [];
|
|
62
|
+
const overwrites = [];
|
|
63
|
+
group.forEach(function (step) {
|
|
64
|
+
ownedFiles(step, options).forEach(function (file) { if (files.indexOf(file) === -1) files.push(file); });
|
|
65
|
+
((step.overwrites || []).map(norm)).forEach(function (file) { if (overwrites.indexOf(file) === -1) overwrites.push(file); });
|
|
66
|
+
});
|
|
67
|
+
files.forEach(function (file) { if (overwrites.indexOf(file) === -1) overwrites.push(file); });
|
|
68
|
+
const first = group.reduce(function (low, step) { return Math.min(low, Number(step.index) || 0); }, Infinity);
|
|
69
|
+
return {
|
|
70
|
+
id: 'unit_' + (index + 1),
|
|
71
|
+
index: first,
|
|
72
|
+
steps: group.slice().sort(function (a, b) { return (Number(a.index) || 0) - (Number(b.index) || 0); }),
|
|
73
|
+
files: files,
|
|
74
|
+
overwrites: overwrites,
|
|
75
|
+
checks: group.map(function (step) { return String(step.check || '').trim(); }).filter(Boolean)
|
|
76
|
+
};
|
|
77
|
+
}).sort(function (a, b) { return a.index - b.index; });
|
|
78
|
+
|
|
79
|
+
if (units.length < 2) return [];
|
|
80
|
+
|
|
81
|
+
while (units.length > maxUnits) {
|
|
82
|
+
let smallest = 0;
|
|
83
|
+
for (let i = 1; i < units.length; i++) {
|
|
84
|
+
if (units[i].files.length < units[smallest].files.length) smallest = i;
|
|
85
|
+
}
|
|
86
|
+
const removed = units.splice(smallest, 1)[0];
|
|
87
|
+
const target = units[smallest === units.length ? 0 : smallest] || units[0];
|
|
88
|
+
target.steps = target.steps.concat(removed.steps).sort(function (a, b) { return (Number(a.index) || 0) - (Number(b.index) || 0); });
|
|
89
|
+
removed.files.forEach(function (file) { if (target.files.indexOf(file) === -1) target.files.push(file); });
|
|
90
|
+
removed.overwrites.forEach(function (file) { if (target.overwrites.indexOf(file) === -1) target.overwrites.push(file); });
|
|
91
|
+
target.checks = target.checks.concat(removed.checks);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return units.map(function (unit, index) {
|
|
95
|
+
unit.id = 'unit_' + (index + 1);
|
|
96
|
+
return unit;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function verifyFiles(root, files) {
|
|
101
|
+
const checks = [];
|
|
102
|
+
(files || []).forEach(function (file) {
|
|
103
|
+
const full = path.isAbsolute(file) ? file : path.join(root, file);
|
|
104
|
+
let stat = null;
|
|
105
|
+
try { stat = fs.statSync(full); } catch (error) {}
|
|
106
|
+
if (!stat || !stat.isFile()) {
|
|
107
|
+
checks.push({ ok: false, file: file, error: 'file was not created' });
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (stat.size === 0) {
|
|
111
|
+
checks.push({ ok: false, file: file, error: 'file is empty' });
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
checks.push({ ok: true, file: file, bytes: stat.size });
|
|
115
|
+
if (/\.(?:js|cjs|mjs)$/i.test(file)) {
|
|
116
|
+
const syntax = spawnSync(process.execPath, ['--check', full], { encoding: 'utf8', timeout: 10000, windowsHide: true });
|
|
117
|
+
checks.push({
|
|
118
|
+
ok: syntax.status === 0 && !syntax.error,
|
|
119
|
+
file: file,
|
|
120
|
+
error: syntax.status === 0 ? '' : String(syntax.stderr || syntax.error || 'syntax check failed').slice(0, 400)
|
|
121
|
+
});
|
|
122
|
+
} else if (/\.json$/i.test(file)) {
|
|
123
|
+
try { JSON.parse(fs.readFileSync(full, 'utf8').replace(/^\uFEFF/, '')); checks.push({ ok: true, file: file }); }
|
|
124
|
+
catch (error) { checks.push({ ok: false, file: file, error: error.message }); }
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
const failed = checks.filter(function (check) { return !check.ok; });
|
|
128
|
+
return { ok: failed.length === 0, checks: checks, failed: failed };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function unitPrompt(unit, allUnits, request) {
|
|
132
|
+
const otherFiles = [];
|
|
133
|
+
allUnits.forEach(function (other) {
|
|
134
|
+
if (other.id === unit.id) return;
|
|
135
|
+
other.files.forEach(function (file) { if (otherFiles.indexOf(file) === -1) otherFiles.push(file); });
|
|
136
|
+
});
|
|
137
|
+
const steps = unit.steps.map(function (step) {
|
|
138
|
+
return String(step.index) + '. ' + String(step.text || '').slice(0, 500);
|
|
139
|
+
}).join('\n');
|
|
140
|
+
return '[DELEGATED TASK ' + unit.id + ' — one of ' + allUnits.length + ' parallel workers]\n'
|
|
141
|
+
+ 'You own ONLY these files: ' + JSON.stringify(unit.files) + '\n'
|
|
142
|
+
+ (otherFiles.length ? 'Other workers are responsible for these files at the same time: ' + JSON.stringify(otherFiles) + '\n' : '')
|
|
143
|
+
+ 'Do not create or edit any file outside your owned files. Do not run shell commands or spawn subagents. Read any existing file you need for context.\n'
|
|
144
|
+
+ 'Create complete, working files. Keep shared names, link paths, element ids and function signatures consistent with the rest of the project. Do not leave placeholders.\n'
|
|
145
|
+
+ 'Start now: your first response must contain one or more write tool calls for your owned files. Do not send a plan, questions, or a prose-only answer before writing.\n'
|
|
146
|
+
+ 'Your plan steps:\n' + steps + '\n'
|
|
147
|
+
+ (unit.checks.length ? 'Required checks: ' + unit.checks.join('; ') + '\n' : '')
|
|
148
|
+
+ 'When done, briefly state the exact files you wrote. If a step cannot be done inside your scope, explain the integration gap instead of editing another worker\'s file.\n'
|
|
149
|
+
+ '[END DELEGATED TASK]\n\nOriginal request:\n' + String(request || '').slice(0, 16000);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function retryPrompt(unit, request, failure) {
|
|
153
|
+
return '[DELEGATED TASK RETRY ' + unit.id + ']\n'
|
|
154
|
+
+ 'The previous attempt did not complete its owned files. You MUST change the files now with write/edit tools; a prose reply is a failed attempt.\n'
|
|
155
|
+
+ 'Owned files: ' + JSON.stringify(unit.files) + '\n'
|
|
156
|
+
+ 'Observed failures: ' + String(failure || '').slice(0, 1200) + '\n'
|
|
157
|
+
+ 'Write complete files for the owned paths. Do not touch any other file. Do not run shell commands.\n'
|
|
158
|
+
+ 'Required work:\n' + unit.steps.map(function (step) { return String(step.index) + '. ' + String(step.text || '').slice(0, 500); }).join('\n') + '\n'
|
|
159
|
+
+ 'Original request:\n' + String(request || '').slice(0, 12000);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
async function run(options) {
|
|
163
|
+
options = options || {};
|
|
164
|
+
const units = (options.units || []).slice();
|
|
165
|
+
const root = options.root || process.cwd();
|
|
166
|
+
const request = options.request || '';
|
|
167
|
+
const runSubagent = options.runSubagent;
|
|
168
|
+
if (typeof runSubagent !== 'function') throw new Error('orchestrator requires a subagent runner');
|
|
169
|
+
if (!units.length) return { ok: false, actions: {}, units: [], summary: 'No independent tasks were available.' };
|
|
170
|
+
|
|
171
|
+
const concurrency = Math.max(1, Math.min(Number(options.concurrency) || 3, units.length));
|
|
172
|
+
const budget = Math.max(4, Math.min(12, Number(options.maxModelCalls) || 8));
|
|
173
|
+
// Workers share the parent budget. Keep a bounded portion for integration,
|
|
174
|
+
// acceptance failures and independent verification; never enlarge the limit.
|
|
175
|
+
const parentBudget = options.aiCall && options.aiCall._chodeBudget;
|
|
176
|
+
const reserve = parentBudget ? Math.min(8, Math.max(2, Math.ceil(parentBudget.limit / 4))) : 0;
|
|
177
|
+
const delegatedLimit = parentBudget ? Math.max(0, parentBudget.limit - parentBudget.calls - reserve) : Infinity;
|
|
178
|
+
let delegatedCalls = 0;
|
|
179
|
+
const delegatedCall = async function () {
|
|
180
|
+
// Reserve synchronously before awaiting so concurrent workers cannot race.
|
|
181
|
+
if (delegatedCalls >= delegatedLimit || (parentBudget && parentBudget.limit - parentBudget.calls <= reserve)) return null;
|
|
182
|
+
delegatedCalls++;
|
|
183
|
+
return options.aiCall.apply(this, arguments);
|
|
184
|
+
};
|
|
185
|
+
const actions = { reads: 0, writes: [], edits: [], execs: [], fetched: [], searched: 0, toolsInstalled: [], asks: 0 };
|
|
186
|
+
const drafterIds = [];
|
|
187
|
+
const results = new Array(units.length);
|
|
188
|
+
let cursor = 0;
|
|
189
|
+
|
|
190
|
+
async function merge(sub) {
|
|
191
|
+
if (!sub) return;
|
|
192
|
+
const src = sub.actions || {};
|
|
193
|
+
actions.reads += src.reads || 0;
|
|
194
|
+
['writes', 'edits', 'execs', 'fetched', 'toolsInstalled', 'sources', 'rea', 'bgJobs', 'execResults'].forEach(function (key) {
|
|
195
|
+
if (Array.isArray(src[key])) (actions[key] = actions[key] || []).push.apply(actions[key], src[key]);
|
|
196
|
+
});
|
|
197
|
+
['searched', 'asks', 'tasks'].forEach(function (key) { actions[key] = (actions[key] || 0) + (src[key] || 0); });
|
|
198
|
+
(sub.drafterIds || []).forEach(function (id) { if (id && drafterIds.indexOf(String(id).toLowerCase()) === -1) drafterIds.push(String(id).toLowerCase()); });
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function narrate(text) {
|
|
202
|
+
try {
|
|
203
|
+
var fn = options.callOptions && options.callOptions.onNarrate;
|
|
204
|
+
if (typeof fn === 'function') fn(String(text || ''));
|
|
205
|
+
} catch (e) {}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
async function work(index) {
|
|
209
|
+
const unit = units[index];
|
|
210
|
+
let sub = null;
|
|
211
|
+
const audit=options.callOptions&&options.callOptions._debtaur;let lease=null;
|
|
212
|
+
async function dispatch(){if(!audit)return true;const result=await audit.dispatch(unit);lease=result.lease;if(!result.ok)throw Error('Worker scope/ownership rejected: '+(result.decision.missing.join('; ')||result.decision.reason));return true;}
|
|
213
|
+
async function checkFiles(){const before=audit?audit.snapshot(unit.files):null;let checked=verifyFiles(root,unit.files);if(audit){const decision=await audit.handoff(lease,before,{ok:checked.ok&&!!sub&&!sub.partial&&!sub.degraded&&!['FAILED','PARTIAL','PENDING'].includes(sub.completionStatus)});lease=null;if(!decision.allowed)checked={ok:false,failed:[{error:'Worker evidence rejected: '+(decision.missing.join('; ')||decision.reason)}]};}return checked;}
|
|
214
|
+
let verdict = { ok: false, failed: [{ error: 'not started' }] };
|
|
215
|
+
narrate('Delegated worker ' + unit.id + ' started (' + (unit.files || []).join(', ') + ').');
|
|
216
|
+
try {
|
|
217
|
+
await dispatch();
|
|
218
|
+
sub = await runSubagent(unitPrompt(unit, units, request), {
|
|
219
|
+
label: unit.id,
|
|
220
|
+
readOnly: false,
|
|
221
|
+
yolo: !!(options.callOptions && options.callOptions.yolo),freeOnly: !!(options.callOptions && options.callOptions.freeOnly),
|
|
222
|
+
noMemory: true,
|
|
223
|
+
force: options.force || null,
|
|
224
|
+
planTargets: unit.files,
|
|
225
|
+
overwriteTargets: unit.overwrites,
|
|
226
|
+
scopeTargets: unit.files,
|
|
227
|
+
maxSteps: 5,
|
|
228
|
+
toolCap: 10,
|
|
229
|
+
maxModelCalls: budget,
|
|
230
|
+
maxRetries: 1,
|
|
231
|
+
timeoutMs: 60000,
|
|
232
|
+
verify: false
|
|
233
|
+
}, delegatedCall, { onTool: options.onTool });
|
|
234
|
+
await merge(sub);
|
|
235
|
+
verdict = await checkFiles();
|
|
236
|
+
if (!verdict.ok) {
|
|
237
|
+
const failure = verdict.failed.map(function (check) { return check.file + ': ' + (check.error || 'failed'); }).join('; ');
|
|
238
|
+
await dispatch();
|
|
239
|
+
const retry = await runSubagent(retryPrompt(unit, request, failure), {
|
|
240
|
+
label: unit.id + '_retry',
|
|
241
|
+
readOnly: false,
|
|
242
|
+
yolo: !!(options.callOptions && options.callOptions.yolo),freeOnly: !!(options.callOptions && options.callOptions.freeOnly),
|
|
243
|
+
noMemory: true,
|
|
244
|
+
force: options.force || null,
|
|
245
|
+
planTargets: unit.files,
|
|
246
|
+
overwriteTargets: unit.overwrites,
|
|
247
|
+
scopeTargets: unit.files,
|
|
248
|
+
maxSteps: 4,
|
|
249
|
+
toolCap: 8,
|
|
250
|
+
maxModelCalls: budget,
|
|
251
|
+
maxRetries: 1,
|
|
252
|
+
timeoutMs: 60000,
|
|
253
|
+
verify: false
|
|
254
|
+
}, delegatedCall, { onTool: options.onTool });
|
|
255
|
+
await merge(retry);sub=retry;
|
|
256
|
+
verdict = await checkFiles();
|
|
257
|
+
}
|
|
258
|
+
} catch (error) {
|
|
259
|
+
if(audit&&lease)audit.release(lease,'worker-failed');
|
|
260
|
+
verdict = { ok: false, failed: [{ error: String((error && error.message) || error).slice(0, 800) }] };
|
|
261
|
+
}
|
|
262
|
+
narrate('Delegated worker ' + unit.id + ' ' + (verdict.ok ? 'finished its files.' : 'could not finish: ' + (verdict.failed || []).map(function (f) { return f.file ? f.file + ' ' + (f.error || '') : (f.error || ''); }).join('; ').slice(0, 200)));
|
|
263
|
+
results[index] = {
|
|
264
|
+
id: unit.id,
|
|
265
|
+
files: unit.files,
|
|
266
|
+
ok: !!verdict.ok,
|
|
267
|
+
failed: verdict.failed || [],
|
|
268
|
+
result: sub && sub.result ? String(sub.result).slice(0, 2000) : ''
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
async function worker() {
|
|
273
|
+
while (true) {
|
|
274
|
+
const index = cursor++;
|
|
275
|
+
if (index >= units.length) return;
|
|
276
|
+
await work(index);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
await Promise.all(Array.from({ length: concurrency }, worker));
|
|
281
|
+
|
|
282
|
+
const completed = results.filter(function (result) { return result && result.ok; });
|
|
283
|
+
const incomplete = results.filter(function (result) { return result && !result.ok; });
|
|
284
|
+
const summary = completed.length === units.length
|
|
285
|
+
? 'Completed ' + units.length + ' delegated task' + (units.length === 1 ? '' : 's') + ' and integrated ' + completed.reduce(function (n, result) { return n + result.files.length; }, 0) + ' files.'
|
|
286
|
+
: 'Completed ' + completed.length + ' of ' + units.length + ' delegated tasks.';
|
|
287
|
+
return {
|
|
288
|
+
ok: incomplete.length === 0,
|
|
289
|
+
actions: actions,
|
|
290
|
+
units: results,
|
|
291
|
+
completed: completed.length,
|
|
292
|
+
incomplete: incomplete,
|
|
293
|
+
drafterIds: drafterIds,
|
|
294
|
+
planSteps: units.reduce(function (all, unit) { return all.concat(unit.steps); }, []).sort(function (a, b) { return (Number(a.index) || 0) - (Number(b.index) || 0); }),
|
|
295
|
+
summary: summary
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
module.exports = { buildUnits, verifyFiles, unitPrompt, retryPrompt, run, norm, ownedFiles };
|
package/package.json
CHANGED
|
@@ -1,6 +1,158 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@oooooooooo/ch0de",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@oooooooooo/ch0de",
|
|
3
|
+
"version": "1.9.55",
|
|
4
|
+
"description": "The self-healing AI coding harness. Free tiers. HEMO auto-provisioning. Zero lock-in. Canonical brand: ch0de.",
|
|
5
|
+
"main": "chode.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"ch0de": "chode.js",
|
|
8
|
+
"chode-council": "expert-panel.cjs"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "node chode.js",
|
|
12
|
+
"test": "npm run test:units && npm run test:cli && npm run test:agent && npm run test:dogfood && npm run test:rea && npm run test:robust",
|
|
13
|
+
"test:units": "node --check chode.js && node tests/memory-lens.test.js && node tests/retro-revival.test.js && node tests/dream-decoder.test.js && node tests/debtaur-orchestration.test.js",
|
|
14
|
+
"test:cli": "node tests/legacy-suite.cjs cli",
|
|
15
|
+
"test:memory": "node memory.js",
|
|
16
|
+
"benchmark:targets": "node benchmarks/targets.js",
|
|
17
|
+
"test:agent": "node tests/legacy-suite.cjs agent",
|
|
18
|
+
"test:dogfood": "node tests/legacy-suite.cjs dogfood",
|
|
19
|
+
"test:rea": "node tests/legacy-suite.cjs rea",
|
|
20
|
+
"test:rea:live": "node tests/rea-live.test.js",
|
|
21
|
+
"test:robust": "node tests/legacy-suite.cjs robust",
|
|
22
|
+
"build:installers": "node build-installer-assets.cjs",
|
|
23
|
+
"test:api:live": "node tests/api-testing-live.test.js --install",
|
|
24
|
+
"test:cli:fixtures": "node tests/cli-smoke.test.js && node tests/reflection-scroll.test.js && node tests/web-context.test.js && node tests/agent-workflow.test.js && node tests/agent-loop.test.js && node tests/toolbox.test.js && node tests/interactive-tools.test.js && node tests/streaming.test.js && node tests/repl-ux.test.js && node tests/live-ux.test.js && node tests/sessions-health.test.js && node tests/ask-tool.test.js && node tests/no-pollinations.test.js && node tests/polish-audit.test.js && node tests/polish-round2.test.js && node tests/repl-pipe.test.js && node tests/polish-round3.test.js && node tests/polish-round4.test.js && node tests/subagents.test.js && node tests/plan.test.js && node tests/frontend-copy.test.js && node tests/terminal-ui.test.js && node tests/repl-lifecycle.test.js && node tests/workspace-view.test.js && node tests/terminal-logo.test.js && node tests/terminal-logo-input.test.js && node tests/terminal-graphics.test.js && node tests/evidence-ledger.test.js && node tests/app-research.test.js && node tests/tui-worker.test.js && node tests/permission-feedback.test.js && node tests/json-output.test.js && node tests/session-recap.test.js && node tests/workspace-lifecycle.test.js && node tests/workspace-polish.test.js && node tests/workspace-logs.test.js && node tests/installer.test.js && node tests/release-security.test.js && node tests/metrics-login-sync.test.js && node tests/entry-startup.test.js && node tests/installer-network.test.js && node tests/provider-catalog.test.js && node tests/provider-picker.test.js && node tests/tui-provider-picker.test.js",
|
|
25
|
+
"test:agent:fixtures": "node tests/v2-stages.test.js && node tests/prompt-integrity.test.js && node tests/completion-rounds.test.js && node tests/verified-budget-final.test.js && node tests/noop-continue.test.js && node tests/local-certification-on-capacity.test.js && node tests/orchestrator.test.js && node tests/free-orchestration.test.js && node tests/v2-guards.test.js && node tests/v2-providers.test.js && node tests/v2-budget.test.js && node tests/v2-edit.test.js && node tests/v2-selfwrite.test.js && node tests/v2-corelib.test.js && node tests/autonomous-repair.test.js && node tests/failed-run-recovery.test.js && node tests/build-completion.test.js && node tests/build-context.test.js && node tests/build-job-verification.test.js && node tests/tool-history.test.js && node tests/tool-call-validation.test.js && node tests/edit-transactions.test.js && node tests/worktrees.test.js && node tests/execution-modes.test.js && node tests/project-memory.test.js && node tests/task-group.test.js && node tests/verification-capture.test.js && node tests/browser-check.test.js && node tests/orchestration-reserve.test.js && node tests/certified-recap.test.js && node tests/configurable-budget.test.js && node tests/acceptance-summary.test.js && node tests/python-edit-preservation.test.js && node tests/core-quality.test.js && node tests/expert-panel.test.js && node tests/yolo.test.js",
|
|
26
|
+
"test:dogfood:fixtures": "node tests/workflow-dogfood.test.js && node tests/workspace-recovery.test.js && node tests/jobs.test.js && node tests/rewind.test.js",
|
|
27
|
+
"test:rea:fixtures": "node tests/v2-rea.test.js && node tests/v2-rea-substance.test.js && node tests/v2-rea-runner.test.js && node tests/rea-failure.test.js && node tests/re-task-routing.test.js",
|
|
28
|
+
"test:robust:fixtures": "node tests/robustness.test.js && node tests/automatic-re.test.js && node tests/free-capacity.test.js && node tests/free-auto-resume.test.js && node tests/worker-crash-recovery.test.js && node tests/stream-abort.test.js && node tests/provider-connect.test.js && node tests/provider-connect-runtime.test.js && node tests/provider-connect-terminal.test.js && node tests/provider-connect-tui.test.js && node tests/provider-probe.test.js && node tests/provider-endpoint-rotation.test.js && node tests/workspace-watchdog.test.js && node tests/stream-idle.test.js && node tests/local-models.test.js && node tests/model-catalog.test.js && node tests/provider-request.test.js && node tests/provider-race.test.js && node tests/provider-recovery.test.js && node tests/native-tools.test.js && node tests/native-stream.test.js && node tests/python-acceptance.test.js && node tests/read-window.test.js && node tests/read-window-agent.test.js && node tests/free-repair-budget.test.js && node tests/free-capacity-stop.test.js && node tests/acceptance-feedback.test.js && node tests/public-pilot-input.test.js && node tests/edit-recovery.test.js && node tests/python-hang-diagnostic.test.js && node tests/observation-progress.test.js && node tests/batch-recovery.test.js && node tests/native-interruption-capacity.test.js && node tests/platform-context.test.js && node tests/exec-diagnostics.test.js && node tests/capacity-continuation.test.js && node tests/shared-tool-budget.test.js && node tests/reliability-memory.test.js && node tests/reliability-boundaries.test.js && node tests/artifact-recovery.test.js && node tests/production-public.test.js && node tests/skill-catalog.test.js && node tests/mcp-client.test.js && node tests/mcp-oauth.test.js && node tests/mcp-stdio.test.js && node tests/integration-engine.test.js && node tests/provider-directory.test.js && node tests/tui-command-matrix.test.js && node tests/provider-binding.test.js && node tests/settings-reset.test.js && node tests/wolfram-math.test.js && node tests/api-testing.test.js && node tests/tool-health.test.js",
|
|
29
|
+
"test:debtaur:live": "node tests/debtaur-live.test.js && node tests/orchestrator.test.js"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"ai",
|
|
33
|
+
"coding",
|
|
34
|
+
"harness",
|
|
35
|
+
"self-healing",
|
|
36
|
+
"cloudflare",
|
|
37
|
+
"hemo",
|
|
38
|
+
"provider-routing",
|
|
39
|
+
"multi-provider"
|
|
40
|
+
],
|
|
41
|
+
"author": "Robert Fogeborg",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "https://github.com/fogennnnn/chode.git"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=18.0.0"
|
|
49
|
+
},
|
|
50
|
+
"files": [
|
|
51
|
+
"chode.js",
|
|
52
|
+
"serve-frontend.html",
|
|
53
|
+
"web-context.js",
|
|
54
|
+
"toolbox.js",
|
|
55
|
+
"memory.js",
|
|
56
|
+
"nosignups.js",
|
|
57
|
+
"helios-ledger.js",
|
|
58
|
+
"README.md",
|
|
59
|
+
"LICENSE",
|
|
60
|
+
"terminal-ui.js",
|
|
61
|
+
"workspace-view.js",
|
|
62
|
+
"workspace-tui.js",
|
|
63
|
+
"terminal-logo.js",
|
|
64
|
+
"terminal-graphics.js",
|
|
65
|
+
"tui-worker.js",
|
|
66
|
+
"evidence-ledger.js",
|
|
67
|
+
"json-output.js",
|
|
68
|
+
"benchmarks/public-baselines.json",
|
|
69
|
+
"benchmarks/targets.js",
|
|
70
|
+
"UX-1.3.md",
|
|
71
|
+
"workspace-log.js",
|
|
72
|
+
"workspace-store.js",
|
|
73
|
+
"workspace-commands.js",
|
|
74
|
+
"doctor.js",
|
|
75
|
+
"UX-1.4.md",
|
|
76
|
+
"benchmarks/render-1.4.0.json",
|
|
77
|
+
"elapsed.js",
|
|
78
|
+
"UX-1.4.1.md",
|
|
79
|
+
"automatic-re.js",
|
|
80
|
+
"request-deadline.js",
|
|
81
|
+
"UX-1.5.md",
|
|
82
|
+
"rea-environment.js",
|
|
83
|
+
"UX-1.6.md",
|
|
84
|
+
"agent-budget.js",
|
|
85
|
+
"acceptance-check.js",
|
|
86
|
+
"UX-1.7.md",
|
|
87
|
+
"recovery-context.js",
|
|
88
|
+
"install.cjs",
|
|
89
|
+
"provider-policy.js",
|
|
90
|
+
"build-quality.js",
|
|
91
|
+
"browser-check.js",
|
|
92
|
+
"UX-1.7.3.md",
|
|
93
|
+
"provider-capacity.js",
|
|
94
|
+
"build-progress.js",
|
|
95
|
+
"UX-1.7.4.md",
|
|
96
|
+
"worker-transport.js",
|
|
97
|
+
"provider-connect.js",
|
|
98
|
+
"provider-catalog.js",
|
|
99
|
+
"provider-picker.js",
|
|
100
|
+
"tui-provider-picker.js",
|
|
101
|
+
"tool-history.js",
|
|
102
|
+
"tool-call-validation.js",
|
|
103
|
+
"edit-transactions.js",
|
|
104
|
+
"EDITING.md",
|
|
105
|
+
"worktrees.js",
|
|
106
|
+
"local-memory.js",
|
|
107
|
+
"plan-z6.js",
|
|
108
|
+
"z6-integration.js",
|
|
109
|
+
"project-memory.js",
|
|
110
|
+
"task-group.js",
|
|
111
|
+
"orchestrator.js",
|
|
112
|
+
"local-models.js",
|
|
113
|
+
"model-catalog.js",
|
|
114
|
+
"provider-request.js",
|
|
115
|
+
"provider-race.js",
|
|
116
|
+
"native-tools.js",
|
|
117
|
+
"read-window.js",
|
|
118
|
+
"observation-progress.js",
|
|
119
|
+
"reliability-store.js",
|
|
120
|
+
"reliability-services.js",
|
|
121
|
+
"reliability-memory.js",
|
|
122
|
+
"RELIABILITY.md",
|
|
123
|
+
"skill-catalog.js",
|
|
124
|
+
"mcp-client.js",
|
|
125
|
+
"integrations.js",
|
|
126
|
+
"INTEGRATIONS.md",
|
|
127
|
+
"provider-credentials.js",
|
|
128
|
+
"provider-store.js",
|
|
129
|
+
"provider-errors.js",
|
|
130
|
+
"provider-directory.js",
|
|
131
|
+
"provider-directory.json",
|
|
132
|
+
"MODELS-DEV-LICENSE",
|
|
133
|
+
"PROVIDERS.md",
|
|
134
|
+
"PROVIDER-CONNECTIONS.md",
|
|
135
|
+
"settings-reset.js",
|
|
136
|
+
"wolfram-math.js",
|
|
137
|
+
"api-testing.js",
|
|
138
|
+
"API-TESTING.md",
|
|
139
|
+
"tool-health.js",
|
|
140
|
+
"expert-panel.cjs",
|
|
141
|
+
"EXPERT-PANEL.md",
|
|
142
|
+
"debtaur-engine.js",
|
|
143
|
+
"debtaur-worker.cjs",
|
|
144
|
+
"debtaur-orchestration.js",
|
|
145
|
+
"DEBTAUR-INTEGRATION.md"
|
|
146
|
+
],
|
|
147
|
+
"homepage": "https://github.com/fogennnnn/chode",
|
|
148
|
+
"bugs": {
|
|
149
|
+
"url": "https://github.com/fogennnnn/chode/issues"
|
|
150
|
+
},
|
|
151
|
+
"dependencies": {
|
|
152
|
+
"@modelcontextprotocol/sdk": "1.32.2",
|
|
153
|
+
"lean": "^0.1.1"
|
|
154
|
+
},
|
|
155
|
+
"devDependencies": {
|
|
156
|
+
"wrangler": "4.118.0"
|
|
157
|
+
}
|
|
158
|
+
}
|