ultra-builder-pro-cli 0.23.0 → 0.24.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.
- package/.ultra-template/docs/research/README.md +4 -4
- package/.ultra-template/tasks/tasks.json +4 -2
- package/CHANGELOG.md +72 -0
- package/README.md +55 -39
- package/adapters/_shared/codex-assets.cjs +121 -65
- package/adapters/_shared/interaction-contract.cjs +7 -1
- package/adapters/_shared/provenance.cjs +7 -2
- package/adapters/_shared/runtime-assets.cjs +3 -2
- package/adapters/_shared/runtime-native.cjs +132 -0
- package/adapters/claude.js +60 -30
- package/adapters/codex.js +178 -81
- package/adapters/grok.js +372 -0
- package/adapters/kimi.js +7 -3
- package/adapters/opencode.js +210 -32
- package/agents/code-reviewer.md +4 -2
- package/agents/debugger.md +4 -1
- package/agents/review-code.md +7 -3
- package/agents/review-comments.md +7 -4
- package/agents/review-coordinator.md +11 -7
- package/agents/review-design.md +8 -4
- package/agents/review-errors.md +8 -4
- package/agents/review-spec.md +8 -5
- package/agents/review-tests.md +7 -4
- package/agents/tdd-runner.md +5 -2
- package/bin/install.js +9 -4
- package/bin/orchestrator.js +4 -13
- package/docs/AGENT-CONTEXT.md +143 -229
- package/docs/ARCHITECTURE.md +205 -494
- package/docs/ARTIFACT-AUTHORITY.md +35 -28
- package/docs/LEGACY-CLI-CROSSWALK.md +1 -1
- package/docs/PLUGIN-ISOLATION-CONTRACT.md +12 -9
- package/docs/ROADMAP.md +85 -110
- package/docs/RUNTIME-COMPAT-MATRIX.md +139 -175
- package/docs/SKILL-AUTHORING.md +3 -3
- package/docs/STATE-DB-ACCESS-POLICY.md +13 -8
- package/docs/WORKFLOW-LIFECYCLE.md +189 -448
- package/hooks/README.md +11 -8
- package/hooks/active_task_context.py +16 -16
- package/hooks/adapters/grok.py +134 -0
- package/hooks/{context_spine.py → context_envelope.py} +26 -22
- package/hooks/health_check.py +29 -34
- package/hooks/pre_stop_check.py +22 -12
- package/hooks/subagent_tracker.py +1 -1
- package/hooks/workflow_checkpoint.py +14 -13
- package/hooks/workflow_context.py +11 -12
- package/hooks/workflow_resume.py +14 -13
- package/mcp-server/{breadcrumb.cjs → hook-context.cjs} +7 -9
- package/mcp-server/lib/baseline-workflow.cjs +108 -82
- package/mcp-server/lib/canonical-json.cjs +19 -0
- package/mcp-server/lib/change-authority.cjs +26 -0
- package/mcp-server/lib/change-workflow.cjs +630 -45
- package/mcp-server/lib/context-envelope.cjs +508 -0
- package/mcp-server/lib/decision-records.cjs +337 -0
- package/mcp-server/lib/doctor.cjs +91 -33
- package/mcp-server/lib/init-project.cjs +78 -39
- package/mcp-server/lib/managed-file-write.cjs +116 -0
- package/mcp-server/lib/plan-checkpoint.cjs +177 -0
- package/mcp-server/lib/project-context.cjs +178 -0
- package/mcp-server/lib/stage-checkpoints.cjs +309 -0
- package/mcp-server/lib/state-db.cjs +155 -24
- package/mcp-server/lib/state-ops.cjs +21 -3
- package/mcp-server/lib/task-ledger.cjs +522 -13
- package/mcp-server/lib/ultra-facade.cjs +757 -442
- package/mcp-server/lib/worker-packet.cjs +358 -0
- package/mcp-server/server.cjs +200 -1103
- package/orchestrator/daemon.cjs +27 -9
- package/orchestrator/parallel-orchestrator.cjs +111 -76
- package/orchestrator/session-runner.cjs +135 -34
- package/package.json +10 -3
- package/skills/ultra-change/SKILL.md +10 -8
- package/skills/ultra-deliver/SKILL.md +17 -19
- package/skills/ultra-dev/SKILL.md +20 -11
- package/skills/ultra-doctor/SKILL.md +4 -4
- package/skills/ultra-init/SKILL.md +6 -5
- package/skills/ultra-init/references/brownfield-adoption.md +20 -14
- package/skills/ultra-plan/SKILL.md +13 -9
- package/skills/ultra-research/SKILL.md +18 -9
- package/skills/ultra-review/SKILL.md +14 -9
- package/skills/ultra-review/references/unified-schema.md +2 -0
- package/skills/ultra-review/scripts/review_wait.py +8 -0
- package/skills/ultra-status/SKILL.md +2 -2
- package/skills/ultra-test/SKILL.md +10 -6
- package/skills/ultra-think/SKILL.md +8 -7
- package/skills/ultra-think/references/interaction-boundary.md +56 -0
- package/spec/cli-protocol.md +80 -199
- package/spec/mcp-tools.yaml +43 -2806
- package/spec/schemas/state-db.sql +107 -4
- package/spec/schemas/{task-ledger.v1.schema.json → task-ledger.v2.schema.json} +70 -6
- package/ultra-tools/commands/status.cjs +369 -243
- package/mcp-server/lib/context-spine.cjs +0 -1208
- package/mcp-server/lib/decision-dialogue.cjs +0 -1128
- package/mcp-server/lib/project-breadcrumb.cjs +0 -173
- package/mcp-server/lib/spec-learning.cjs +0 -284
- package/mcp-server/lib/workflow-state.cjs +0 -3129
- package/skills/ultra-think/references/decision-dialogue.md +0 -155
package/adapters/opencode.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/** Build a native OpenCode Ultra Builder Pro plugin. */
|
|
4
4
|
|
|
5
5
|
const fs = require('node:fs');
|
|
6
|
+
const crypto = require('node:crypto');
|
|
6
7
|
const os = require('node:os');
|
|
7
8
|
const path = require('node:path');
|
|
8
9
|
|
|
@@ -14,7 +15,11 @@ const {
|
|
|
14
15
|
removeTree,
|
|
15
16
|
writeAtomic,
|
|
16
17
|
} = require('./_shared/file-ops.cjs');
|
|
17
|
-
const {
|
|
18
|
+
const {
|
|
19
|
+
applyNativeDoctor,
|
|
20
|
+
buildMcpRuntime,
|
|
21
|
+
mcpCommand,
|
|
22
|
+
} = require('./_shared/codex-assets.cjs');
|
|
18
23
|
const { adaptInteractionGuidance } = require('./_shared/interaction-contract.cjs');
|
|
19
24
|
const provenance = require('./_shared/provenance.cjs');
|
|
20
25
|
const {
|
|
@@ -233,7 +238,7 @@ function removeEmptyDir(dir) {
|
|
|
233
238
|
if (fs.readdirSync(dir).length === 0) fs.rmdirSync(dir);
|
|
234
239
|
}
|
|
235
240
|
|
|
236
|
-
function copyCommands(repoRoot, target) {
|
|
241
|
+
function copyCommands(repoRoot, target, publishedTarget = target) {
|
|
237
242
|
const output = path.join(target, 'commands');
|
|
238
243
|
ensureDir(output);
|
|
239
244
|
removeStaleManagedFiles(output, COMMAND_NAMES.map((name) => `${name}.md`));
|
|
@@ -242,7 +247,7 @@ function copyCommands(repoRoot, target) {
|
|
|
242
247
|
const file = `${name}.md`;
|
|
243
248
|
const source = path.join(repoRoot, 'commands', file);
|
|
244
249
|
if (!fs.existsSync(source)) throw new Error(`missing allowlisted OpenCode command: ${file}`);
|
|
245
|
-
const workflowFile = path.join(
|
|
250
|
+
const workflowFile = path.join(publishedTarget, BUNDLE_DIR, 'workflows', name, 'SKILL.md');
|
|
246
251
|
const transformed = withManagedMarker(
|
|
247
252
|
openCodeCommandTransform(fs.readFileSync(source), file, name, workflowFile),
|
|
248
253
|
);
|
|
@@ -341,13 +346,13 @@ const TEAM_TASK_LEDGER = ".ultra/tasks/tasks.json";
|
|
|
341
346
|
const LIVE_TASK_PROJECTION = ".ultra/.runtime/projections/tasks.json";
|
|
342
347
|
const NODE_BINARY = ${JSON.stringify(process.execPath)};
|
|
343
348
|
const PLUGIN_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
344
|
-
const
|
|
345
|
-
PLUGIN_DIR, "..", ${JSON.stringify(BUNDLE_DIR)}, "runtime", "
|
|
349
|
+
const CONTEXT_CLI = path.resolve(
|
|
350
|
+
PLUGIN_DIR, "..", ${JSON.stringify(BUNDLE_DIR)}, "runtime", "hook-context.cjs",
|
|
346
351
|
);
|
|
347
352
|
|
|
348
353
|
function readUltraContext(directory) {
|
|
349
354
|
try {
|
|
350
|
-
const raw = execFileSync(NODE_BINARY, [
|
|
355
|
+
const raw = execFileSync(NODE_BINARY, [CONTEXT_CLI, "--discover", directory], {
|
|
351
356
|
cwd: directory,
|
|
352
357
|
encoding: "utf8",
|
|
353
358
|
stdio: ["ignore", "pipe", "pipe"],
|
|
@@ -356,12 +361,10 @@ function readUltraContext(directory) {
|
|
|
356
361
|
const value = JSON.parse(raw);
|
|
357
362
|
const root = value?.root;
|
|
358
363
|
if (typeof root !== "string" || !root) return null;
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|| typeof value.text !== "string" || !value.text) {
|
|
362
|
-
return { root, breadcrumb: null, text: null };
|
|
364
|
+
if (!value?.context || typeof value.text !== "string" || !value.text) {
|
|
365
|
+
return { root, context: null, text: null };
|
|
363
366
|
}
|
|
364
|
-
return { root,
|
|
367
|
+
return { root, context: value.context, text: value.text };
|
|
365
368
|
} catch (error) {
|
|
366
369
|
const detail = String(error?.stderr || error?.message || error);
|
|
367
370
|
if (/RUNTIME_(?:STATE_CONFLICT|PATH_UNSAFE|ORPHAN_SIDECAR|ROOT_INVALID|AUTHORITY_MISMATCH)|both legacy .*runtime.*state\\.db/i.test(detail)) {
|
|
@@ -446,37 +449,116 @@ export const UltraBuilderProPlugin = async ({ directory, worktree }) => {
|
|
|
446
449
|
`;
|
|
447
450
|
}
|
|
448
451
|
|
|
449
|
-
function
|
|
450
|
-
const
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
452
|
+
function createInstallTransaction() {
|
|
453
|
+
const changes = [];
|
|
454
|
+
const backups = [];
|
|
455
|
+
const backupPath = (target) => path.join(
|
|
456
|
+
path.dirname(target),
|
|
457
|
+
`.${path.basename(target)}.ubp-backup-${crypto.randomUUID()}`,
|
|
458
|
+
);
|
|
459
|
+
return {
|
|
460
|
+
replaceFile(source, target) {
|
|
461
|
+
let previous = null;
|
|
462
|
+
try {
|
|
463
|
+
const stat = fs.statSync(target);
|
|
464
|
+
previous = { contents: fs.readFileSync(target), mode: stat.mode & 0o7777 };
|
|
465
|
+
} catch (error) {
|
|
466
|
+
if (error.code !== 'ENOENT') throw error;
|
|
467
|
+
}
|
|
468
|
+
writeAtomic(target, fs.readFileSync(source));
|
|
469
|
+
changes.push({ type: 'file', target, previous });
|
|
470
|
+
},
|
|
471
|
+
replaceTree(source, target) {
|
|
472
|
+
ensureDir(path.dirname(target));
|
|
473
|
+
let backup = null;
|
|
474
|
+
if (fs.existsSync(target)) {
|
|
475
|
+
backup = backupPath(target);
|
|
476
|
+
fs.renameSync(target, backup);
|
|
477
|
+
backups.push(backup);
|
|
478
|
+
}
|
|
479
|
+
try {
|
|
480
|
+
fs.renameSync(source, target);
|
|
481
|
+
} catch (error) {
|
|
482
|
+
if (backup && fs.existsSync(backup)) fs.renameSync(backup, target);
|
|
483
|
+
throw error;
|
|
484
|
+
}
|
|
485
|
+
changes.push({ type: 'tree', target, backup });
|
|
486
|
+
},
|
|
487
|
+
removeFile(target) {
|
|
488
|
+
if (!fs.existsSync(target)) return;
|
|
489
|
+
const stat = fs.statSync(target);
|
|
490
|
+
const previous = { contents: fs.readFileSync(target), mode: stat.mode & 0o7777 };
|
|
491
|
+
fs.unlinkSync(target);
|
|
492
|
+
changes.push({ type: 'file', target, previous });
|
|
493
|
+
},
|
|
494
|
+
removeTree(target) {
|
|
495
|
+
if (!fs.existsSync(target)) return;
|
|
496
|
+
const backup = backupPath(target);
|
|
497
|
+
fs.renameSync(target, backup);
|
|
498
|
+
backups.push(backup);
|
|
499
|
+
changes.push({ type: 'tree', target, backup, removed: true });
|
|
500
|
+
},
|
|
501
|
+
commit() {
|
|
502
|
+
for (const backup of backups) {
|
|
503
|
+
if (fs.existsSync(backup)) removeTree(backup);
|
|
504
|
+
}
|
|
505
|
+
changes.length = 0;
|
|
506
|
+
backups.length = 0;
|
|
507
|
+
},
|
|
508
|
+
rollback() {
|
|
509
|
+
const errors = [];
|
|
510
|
+
for (const change of changes.reverse()) {
|
|
511
|
+
try {
|
|
512
|
+
if (change.type === 'file') {
|
|
513
|
+
if (change.previous) {
|
|
514
|
+
writeAtomic(change.target, change.previous.contents);
|
|
515
|
+
fs.chmodSync(change.target, change.previous.mode);
|
|
516
|
+
} else if (fs.existsSync(change.target)) {
|
|
517
|
+
fs.unlinkSync(change.target);
|
|
518
|
+
}
|
|
519
|
+
} else {
|
|
520
|
+
if (!change.removed && fs.existsSync(change.target)) removeTree(change.target);
|
|
521
|
+
if (change.backup && fs.existsSync(change.backup)) {
|
|
522
|
+
fs.renameSync(change.backup, change.target);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
} catch (error) {
|
|
526
|
+
errors.push(error);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (errors.length > 0) {
|
|
530
|
+
throw new AggregateError(errors, 'OpenCode install rollback failed');
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
};
|
|
534
|
+
}
|
|
458
535
|
|
|
459
|
-
|
|
460
|
-
|
|
536
|
+
function buildStaging(repoRoot, staging, target) {
|
|
537
|
+
const report = { target, copied: {}, config: { updated: false } };
|
|
538
|
+
report.copied.commands = copyCommands(repoRoot, staging, target);
|
|
539
|
+
report.copied.skills = copySkills(repoRoot, staging);
|
|
540
|
+
report.copied.agents = copyAgents(repoRoot, staging);
|
|
541
|
+
ensureDir(path.join(staging, 'plugins'));
|
|
542
|
+
writeAtomic(path.join(staging, 'plugins', 'ultra-builder-pro.js'), pluginSource());
|
|
461
543
|
report.copied.plugins = ['ultra-builder-pro.js'];
|
|
462
544
|
|
|
463
|
-
const bundleRoot = path.join(
|
|
464
|
-
if (fs.existsSync(bundleRoot)) removeTree(bundleRoot);
|
|
545
|
+
const bundleRoot = path.join(staging, BUNDLE_DIR);
|
|
465
546
|
ensureDir(bundleRoot);
|
|
466
547
|
report.copied.workflows = copyPrivateWorkflows(repoRoot, bundleRoot);
|
|
467
|
-
|
|
548
|
+
buildMcpRuntime(repoRoot, bundleRoot, { runtime: 'opencode' });
|
|
468
549
|
markManaged(bundleRoot, { adapter: 'opencode', asset: 'runtime-bundle' });
|
|
469
550
|
const configFile = path.join(target, 'opencode.json');
|
|
470
551
|
const existing = readJsonSafe(configFile, { rescue: true });
|
|
471
552
|
const mcp = { ...(existing.mcp || {}) };
|
|
553
|
+
const command = mcpCommand(path.join(target, BUNDLE_DIR, 'runtime', 'launch.cjs'));
|
|
472
554
|
mcp[MCP_SERVER_NAME] = {
|
|
473
555
|
type: 'local',
|
|
474
556
|
enabled: true,
|
|
475
|
-
command: [
|
|
557
|
+
command: [command.command, ...command.args],
|
|
476
558
|
};
|
|
477
559
|
const next = { ...existing, mcp };
|
|
478
560
|
delete next[LEGACY_SENTINEL_KEY];
|
|
479
|
-
writeAtomic(
|
|
561
|
+
writeAtomic(path.join(staging, 'opencode.json'), JSON.stringify(next, null, 2) + '\n');
|
|
480
562
|
report.config.updated = true;
|
|
481
563
|
const source = provenance.packageSource(repoRoot);
|
|
482
564
|
const bundleAssets = provenance.assetRefsForTree('config', bundleRoot, {
|
|
@@ -491,6 +573,7 @@ function install(ctx = {}) {
|
|
|
491
573
|
adapter: 'opencode',
|
|
492
574
|
...source,
|
|
493
575
|
roots: { config: target },
|
|
576
|
+
assetRoots: { config: staging },
|
|
494
577
|
assets: [
|
|
495
578
|
...report.copied.commands.map((file) => ({ root: 'config', path: path.join('commands', file) })),
|
|
496
579
|
...report.copied.skills.map((file) => ({ root: 'config', path: path.join('skills', file) })),
|
|
@@ -503,13 +586,106 @@ function install(ctx = {}) {
|
|
|
503
586
|
host_plugin: { root: 'config', path: path.join('plugins', 'ultra-builder-pro.js') },
|
|
504
587
|
mcp_config: { root: 'config', path: 'opencode.json' },
|
|
505
588
|
mcp_launcher: { root: 'config', path: path.join(BUNDLE_DIR, 'runtime', 'launch.cjs') },
|
|
589
|
+
native_runtime: { root: 'config', path: path.join(BUNDLE_DIR, 'runtime', 'native-runtime.json') },
|
|
590
|
+
context_envelope_helper: { root: 'config', path: path.join(BUNDLE_DIR, 'runtime', 'hook-context.cjs') },
|
|
506
591
|
hook_event_helper: { root: 'config', path: path.join(BUNDLE_DIR, 'runtime', 'hook-event.cjs') },
|
|
507
592
|
},
|
|
508
593
|
});
|
|
509
|
-
report.provenance.file =
|
|
594
|
+
report.provenance.file = path.join(target, BUNDLE_DIR, PROVENANCE_FILE);
|
|
510
595
|
return report;
|
|
511
596
|
}
|
|
512
597
|
|
|
598
|
+
function managedTextFiles(dir) {
|
|
599
|
+
if (!fs.existsSync(dir)) return [];
|
|
600
|
+
return fs.readdirSync(dir, { withFileTypes: true })
|
|
601
|
+
.filter((entry) => entry.isFile() && isManagedTextFile(path.join(dir, entry.name)))
|
|
602
|
+
.map((entry) => entry.name);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
function managedSkillDirs(root) {
|
|
606
|
+
if (!fs.existsSync(root)) return [];
|
|
607
|
+
return fs.readdirSync(root, { withFileTypes: true })
|
|
608
|
+
.filter((entry) => entry.isDirectory() && isManaged(path.join(root, entry.name)))
|
|
609
|
+
.map((entry) => entry.name);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
function publishStaging(staging, target, report) {
|
|
613
|
+
const transaction = createInstallTransaction();
|
|
614
|
+
const commandNames = report.copied.commands;
|
|
615
|
+
const agentNames = report.copied.agents;
|
|
616
|
+
const skillNames = discoverableSkillNames();
|
|
617
|
+
try {
|
|
618
|
+
for (const file of commandNames) {
|
|
619
|
+
transaction.replaceFile(
|
|
620
|
+
path.join(staging, 'commands', file),
|
|
621
|
+
path.join(target, 'commands', file),
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
for (const stale of managedTextFiles(path.join(target, 'commands'))) {
|
|
625
|
+
if (!commandNames.includes(stale)) {
|
|
626
|
+
transaction.removeFile(path.join(target, 'commands', stale));
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
for (const name of skillNames) {
|
|
630
|
+
transaction.replaceTree(
|
|
631
|
+
path.join(staging, 'skills', name),
|
|
632
|
+
path.join(target, 'skills', name),
|
|
633
|
+
);
|
|
634
|
+
}
|
|
635
|
+
for (const stale of managedSkillDirs(path.join(target, 'skills'))) {
|
|
636
|
+
if (!skillNames.includes(stale)) {
|
|
637
|
+
transaction.removeTree(path.join(target, 'skills', stale));
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
for (const file of agentNames) {
|
|
641
|
+
transaction.replaceFile(
|
|
642
|
+
path.join(staging, 'agents', file),
|
|
643
|
+
path.join(target, 'agents', file),
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
for (const stale of managedTextFiles(path.join(target, 'agents'))) {
|
|
647
|
+
if (!agentNames.includes(stale)) {
|
|
648
|
+
transaction.removeFile(path.join(target, 'agents', stale));
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
transaction.replaceFile(
|
|
652
|
+
path.join(staging, 'plugins', 'ultra-builder-pro.js'),
|
|
653
|
+
path.join(target, 'plugins', 'ultra-builder-pro.js'),
|
|
654
|
+
);
|
|
655
|
+
transaction.replaceTree(
|
|
656
|
+
path.join(staging, BUNDLE_DIR),
|
|
657
|
+
path.join(target, BUNDLE_DIR),
|
|
658
|
+
);
|
|
659
|
+
transaction.replaceFile(
|
|
660
|
+
path.join(staging, 'opencode.json'),
|
|
661
|
+
path.join(target, 'opencode.json'),
|
|
662
|
+
);
|
|
663
|
+
transaction.commit();
|
|
664
|
+
} catch (error) {
|
|
665
|
+
try {
|
|
666
|
+
transaction.rollback();
|
|
667
|
+
} catch (rollbackError) {
|
|
668
|
+
throw new AggregateError([error, rollbackError], 'OpenCode install and rollback both failed');
|
|
669
|
+
}
|
|
670
|
+
throw error;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
function install(ctx = {}) {
|
|
675
|
+
const target = resolveTarget(ctx);
|
|
676
|
+
const repoRoot = resolveRepoRoot(ctx);
|
|
677
|
+
ensureDir(target);
|
|
678
|
+
preflightAssets(repoRoot, target);
|
|
679
|
+
const staging = fs.mkdtempSync(path.join(path.dirname(target), '.ubp-opencode-staging-'));
|
|
680
|
+
try {
|
|
681
|
+
const report = buildStaging(repoRoot, staging, target);
|
|
682
|
+
publishStaging(staging, target, report);
|
|
683
|
+
return report;
|
|
684
|
+
} finally {
|
|
685
|
+
if (fs.existsSync(staging)) removeTree(staging);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
513
689
|
function doctor(ctx = {}) {
|
|
514
690
|
const target = resolveTarget(ctx);
|
|
515
691
|
const repoRoot = resolveRepoRoot(ctx);
|
|
@@ -525,11 +701,14 @@ function doctor(ctx = {}) {
|
|
|
525
701
|
try {
|
|
526
702
|
const config = readJsonSafe(configFile);
|
|
527
703
|
const entry = config.mcp && config.mcp[MCP_SERVER_NAME];
|
|
704
|
+
const command = mcpCommand(expectedLauncher);
|
|
528
705
|
registrationOk = entry?.type === 'local'
|
|
529
706
|
&& entry.enabled === true
|
|
530
707
|
&& Array.isArray(entry.command)
|
|
531
|
-
&& entry.command
|
|
532
|
-
|
|
708
|
+
&& JSON.stringify(entry.command) === JSON.stringify([
|
|
709
|
+
command.command,
|
|
710
|
+
...command.args,
|
|
711
|
+
]);
|
|
533
712
|
} catch (error) {
|
|
534
713
|
report.issues.push({ code: 'MCP_REGISTRATION_INVALID', message: error.message });
|
|
535
714
|
}
|
|
@@ -541,8 +720,7 @@ function doctor(ctx = {}) {
|
|
|
541
720
|
});
|
|
542
721
|
}
|
|
543
722
|
report.checks.registration = { status: registrationOk ? 'pass' : 'fail' };
|
|
544
|
-
|
|
545
|
-
return report;
|
|
723
|
+
return applyNativeDoctor(report, path.join(target, BUNDLE_DIR, 'runtime'));
|
|
546
724
|
}
|
|
547
725
|
|
|
548
726
|
function uninstall(ctx = {}) {
|
package/agents/code-reviewer.md
CHANGED
|
@@ -19,6 +19,8 @@ evidence. Default to read-only analysis.
|
|
|
19
19
|
|
|
20
20
|
1. Resolve the exact diff, file set, HEAD, intended outcome, and repository guidance.
|
|
21
21
|
Report an empty or ambiguous scope instead of expanding it silently.
|
|
22
|
+
For an Ultra delegation, first validate the immutable Worker Packet and echo its
|
|
23
|
+
exact `packet_digest` in the assigned output.
|
|
22
24
|
2. Trace changed behavior from its entry point to state, side effects, errors, and a
|
|
23
25
|
real consumer.
|
|
24
26
|
3. Follow `code-review-expert`. Load its security, integration, design, or removal
|
|
@@ -37,5 +39,5 @@ fix, modify only findings within the accepted scope, preserve unrelated changes,
|
|
|
37
39
|
rerun the checks invalidated by each edit. Judgment-heavy or scope-expanding fixes
|
|
38
40
|
return to the primary agent for a decision.
|
|
39
41
|
|
|
40
|
-
Use the current checkout and parent-supplied
|
|
41
|
-
not raw tool output.
|
|
42
|
+
Use the current checkout and parent-supplied packet only. Do not call Ultra MCP write
|
|
43
|
+
tools. Return a concise review, not raw tool output.
|
package/agents/debugger.md
CHANGED
|
@@ -15,6 +15,8 @@ that violates the intended contract.
|
|
|
15
15
|
|
|
16
16
|
1. Read the complete error and reproduce the smallest observable symptom with the exact
|
|
17
17
|
command or action.
|
|
18
|
+
For an Ultra delegation, validate the immutable Worker Packet before investigation
|
|
19
|
+
and echo its exact `packet_digest` in the assigned output.
|
|
18
20
|
2. Inspect the relevant recent diff, configuration, dependency, and runtime boundaries.
|
|
19
21
|
3. Trace the bad value or state backward through callers and side effects. Compare a
|
|
20
22
|
nearby working path only when it exercises the same contract.
|
|
@@ -34,4 +36,5 @@ from another checkout as evidence.
|
|
|
34
36
|
If three distinct fix attempts expose different underlying failures, stop patching and
|
|
35
37
|
return the evidence as an architectural boundary problem. For an Ultra incident, also
|
|
36
38
|
provide the reproduction, tested hypotheses, earliest bad state, regression signal,
|
|
37
|
-
and recovery path needed by the durable diagnosis artifact.
|
|
39
|
+
and recovery path needed by the durable diagnosis artifact. Do not call Ultra MCP
|
|
40
|
+
write tools; the parent model owns registration.
|
package/agents/review-code.md
CHANGED
|
@@ -17,7 +17,7 @@ transcript into the parent conversation.
|
|
|
17
17
|
|
|
18
18
|
## Required input
|
|
19
19
|
|
|
20
|
-
- `
|
|
20
|
+
- immutable `WORKER_PACKET`, its `PACKET_DIGEST`, `SESSION_PATH`, and `OUTPUT_FILE`;
|
|
21
21
|
- `SCHEMA_PATH` resolved by the parent from the active review Skill;
|
|
22
22
|
- exact `DIFF_RANGE` and `DIFF_FILES`;
|
|
23
23
|
- reviewed full HEAD;
|
|
@@ -27,6 +27,8 @@ transcript into the parent conversation.
|
|
|
27
27
|
|
|
28
28
|
1. Validate the input scope and inspect only the diff plus callers, contracts, tests,
|
|
29
29
|
and configuration needed to establish a finding.
|
|
30
|
+
Stop with an incomplete acknowledgement when the packet digest, output path, HEAD,
|
|
31
|
+
scope, or schema differs from the packet.
|
|
30
32
|
2. Trace changed behavior to a production entry point and consumer.
|
|
31
33
|
3. Apply `code-review-expert`, `security-rules`, and `integration-rules` only where their
|
|
32
34
|
risk is present.
|
|
@@ -34,7 +36,8 @@ transcript into the parent conversation.
|
|
|
34
36
|
observability, compatibility, and reachability.
|
|
35
37
|
5. Report only evidence-backed defects with plausible triggers and concrete impact.
|
|
36
38
|
Deduplicate by root cause and keep line ranges tight.
|
|
37
|
-
6. Write `ultra-review-findings-v2` following `SCHEMA_PATH
|
|
39
|
+
6. Write `ultra-review-findings-v2` following `SCHEMA_PATH`, including the exact
|
|
40
|
+
`packet_digest`.
|
|
38
41
|
|
|
39
42
|
Use `axis: engineering_standards`. After the file is valid, return exactly:
|
|
40
43
|
|
|
@@ -42,4 +45,5 @@ Use `axis: engineering_standards`. After the file is valid, return exactly:
|
|
|
42
45
|
Wrote N findings (P0:X P1:X P2:X P3:X) to <filepath>
|
|
43
46
|
```
|
|
44
47
|
|
|
45
|
-
Do not modify source, task state, or
|
|
48
|
+
Do not modify source, call Ultra MCP write tools, change task state, or edit another
|
|
49
|
+
worker's artifact.
|
|
@@ -12,8 +12,9 @@ Write findings to the assigned JSON file and return only a file acknowledgement.
|
|
|
12
12
|
|
|
13
13
|
## Workflow
|
|
14
14
|
|
|
15
|
-
1. Validate
|
|
16
|
-
HEAD, and the supplied
|
|
15
|
+
1. Validate the immutable `WORKER_PACKET`, exact `PACKET_DIGEST`, `SESSION_PATH`,
|
|
16
|
+
`OUTPUT_FILE`, `SCHEMA_PATH`, `DIFF_RANGE`, `DIFF_FILES`, HEAD, and the supplied
|
|
17
|
+
public-contract context. Stop incomplete when any value differs from the packet.
|
|
17
18
|
2. Inspect comments, docstrings, examples, annotations, and API documentation changed
|
|
18
19
|
by the diff. Read the associated implementation and contract before judging them.
|
|
19
20
|
3. Report factual contradictions, stale names or behavior, unsafe operational advice,
|
|
@@ -23,7 +24,8 @@ Write findings to the assigned JSON file and return only a file acknowledgement.
|
|
|
23
24
|
to investigate, not automatic defects. Calibrate severity to the reachable impact.
|
|
24
25
|
5. Ignore wording preferences and harmless redundancy. Keep line ranges tight and
|
|
25
26
|
propose the smallest correction that restores an accurate contract.
|
|
26
|
-
6. Write `ultra-review-findings-v2` following `SCHEMA_PATH
|
|
27
|
+
6. Write `ultra-review-findings-v2` following `SCHEMA_PATH`, including the exact
|
|
28
|
+
`packet_digest`.
|
|
27
29
|
|
|
28
30
|
Use `axis: engineering_standards` and category `comments`. After valid output, return
|
|
29
31
|
exactly:
|
|
@@ -32,4 +34,5 @@ exactly:
|
|
|
32
34
|
Wrote N findings (P0:X P1:X P2:X P3:X) to <filepath>
|
|
33
35
|
```
|
|
34
36
|
|
|
35
|
-
Do not modify source, task state, or
|
|
37
|
+
Do not modify source, call Ultra MCP write tools, change task state, or edit another
|
|
38
|
+
worker's artifact.
|
|
@@ -13,15 +13,17 @@ rewrite a specialist's severity.
|
|
|
13
13
|
|
|
14
14
|
## Required input
|
|
15
15
|
|
|
16
|
-
- `
|
|
17
|
-
selection or skip
|
|
16
|
+
- immutable coordinator `WORKER_PACKET`, exact `PACKET_DIGEST`, `SESSION_PATH`, review
|
|
17
|
+
mode, reviewed HEAD, diff range, and expected worker list with selection or skip
|
|
18
|
+
rationale;
|
|
18
19
|
- `SCHEMA_PATH` resolved by the parent from the active review Skill;
|
|
19
20
|
- one complete `spec_fidelity` artifact;
|
|
20
21
|
- every selected `engineering_standards` artifact.
|
|
21
22
|
|
|
22
23
|
## Workflow
|
|
23
24
|
|
|
24
|
-
1.
|
|
25
|
+
1. Validate the packet digest, scope, HEAD, output paths, and schema, then read the
|
|
26
|
+
artifact contract at `SCHEMA_PATH`. Stop incomplete when any value differs.
|
|
25
27
|
2. Parse every expected artifact. Reject stale HEAD or range, malformed JSON, wrong
|
|
26
28
|
axis, duplicate finding ids, and missing required fields. Record missing or invalid
|
|
27
29
|
workers as limitations instead of silently continuing as complete.
|
|
@@ -39,9 +41,10 @@ rewrite a specialist's severity.
|
|
|
39
41
|
7. Record the review mode and every selected or skipped worker with its supplied
|
|
40
42
|
scope-specific rationale. The selection must match completed, failed, and skipped
|
|
41
43
|
worker state exactly.
|
|
42
|
-
8. Write `SUMMARY.json` as `ultra-review-summary-v2
|
|
43
|
-
the two axis verdicts, blocking
|
|
44
|
-
artifact paths. Validate both
|
|
44
|
+
8. Write `SUMMARY.json` as `ultra-review-summary-v2`, including the exact
|
|
45
|
+
`packet_digest`, and a concise `SUMMARY.md` with the two axis verdicts, blocking
|
|
46
|
+
findings, limitations, positive observations, and artifact paths. Validate both
|
|
47
|
+
files before acknowledging completion.
|
|
45
48
|
|
|
46
49
|
Return exactly:
|
|
47
50
|
|
|
@@ -49,4 +52,5 @@ Return exactly:
|
|
|
49
52
|
Coordination complete: <VERDICT> — P0:X P1:X P2:X P3:X — <SUMMARY.json path>
|
|
50
53
|
```
|
|
51
54
|
|
|
52
|
-
Do not modify source, task state
|
|
55
|
+
Do not modify source, call Ultra MCP write tools, change task state or projections, or
|
|
56
|
+
edit specialist artifacts.
|
package/agents/review-design.md
CHANGED
|
@@ -12,8 +12,10 @@ Write findings to the assigned JSON file and return only a file acknowledgement.
|
|
|
12
12
|
|
|
13
13
|
## Workflow
|
|
14
14
|
|
|
15
|
-
1. Validate
|
|
16
|
-
HEAD, and the supplied
|
|
15
|
+
1. Validate the immutable `WORKER_PACKET`, exact `PACKET_DIGEST`, `SESSION_PATH`,
|
|
16
|
+
`OUTPUT_FILE`, `SCHEMA_PATH`, `DIFF_RANGE`, `DIFF_FILES`, HEAD, and the supplied
|
|
17
|
+
architecture and acceptance context. Stop incomplete when any value differs from
|
|
18
|
+
the packet.
|
|
17
19
|
2. Trace changed types and modules through their real constructors, callers, state,
|
|
18
20
|
side effects, and consumers.
|
|
19
21
|
3. Check whether important invariants can be bypassed, ownership is ambiguous, an
|
|
@@ -24,7 +26,8 @@ Write findings to the assigned JSON file and return only a file acknowledgement.
|
|
|
24
26
|
5. Prefer a focused before/after remediation when simplification is supported by the
|
|
25
27
|
current use cases. Do not propose speculative frameworks or abstractions.
|
|
26
28
|
6. Calibrate severity to the reachable impact and write
|
|
27
|
-
`ultra-review-findings-v2` following `SCHEMA_PATH
|
|
29
|
+
`ultra-review-findings-v2` following `SCHEMA_PATH`, including the exact
|
|
30
|
+
`packet_digest`.
|
|
28
31
|
|
|
29
32
|
Use `axis: engineering_standards` and the narrowest applicable category, such as
|
|
30
33
|
`architecture`, `type-design`, or `complexity`. After valid output, return exactly:
|
|
@@ -33,4 +36,5 @@ Use `axis: engineering_standards` and the narrowest applicable category, such as
|
|
|
33
36
|
Wrote N findings (P0:X P1:X P2:X P3:X) to <filepath>
|
|
34
37
|
```
|
|
35
38
|
|
|
36
|
-
Do not modify source, task state, or
|
|
39
|
+
Do not modify source, call Ultra MCP write tools, change task state, or edit another
|
|
40
|
+
worker's artifact.
|
package/agents/review-errors.md
CHANGED
|
@@ -14,8 +14,10 @@ Write findings to the assigned JSON file and return only a file acknowledgement.
|
|
|
14
14
|
|
|
15
15
|
## Workflow
|
|
16
16
|
|
|
17
|
-
1. Validate
|
|
18
|
-
HEAD, and the supplied
|
|
17
|
+
1. Validate the immutable `WORKER_PACKET`, exact `PACKET_DIGEST`, `SESSION_PATH`,
|
|
18
|
+
`OUTPUT_FILE`, `SCHEMA_PATH`, `DIFF_RANGE`, `DIFF_FILES`, HEAD, and the supplied
|
|
19
|
+
runtime and acceptance context. Stop incomplete when any value differs from the
|
|
20
|
+
packet.
|
|
19
21
|
2. Trace changed exceptions, error results, retries, fallbacks, optional values,
|
|
20
22
|
cancellation, timeouts, and asynchronous work from trigger to caller-visible state.
|
|
21
23
|
3. Identify handlers that swallow a required failure, report false success, lose
|
|
@@ -27,7 +29,8 @@ Write findings to the assigned JSON file and return only a file acknowledgement.
|
|
|
27
29
|
generic messages as investigation signals. Severity follows reachable impact, not
|
|
28
30
|
the surface pattern.
|
|
29
31
|
6. Check the corresponding recovery and observability path, then write
|
|
30
|
-
`ultra-review-findings-v2` following `SCHEMA_PATH
|
|
32
|
+
`ultra-review-findings-v2` following `SCHEMA_PATH`, including the exact
|
|
33
|
+
`packet_digest`.
|
|
31
34
|
|
|
32
35
|
Use `axis: engineering_standards` and category `error-handling` or `security`. After
|
|
33
36
|
valid output, return exactly:
|
|
@@ -36,4 +39,5 @@ valid output, return exactly:
|
|
|
36
39
|
Wrote N findings (P0:X P1:X P2:X P3:X) to <filepath>
|
|
37
40
|
```
|
|
38
41
|
|
|
39
|
-
Do not modify source, task state, or
|
|
42
|
+
Do not modify source, call Ultra MCP write tools, change task state, or edit another
|
|
43
|
+
worker's artifact.
|
package/agents/review-spec.md
CHANGED
|
@@ -13,9 +13,10 @@ this axis independent from general engineering quality.
|
|
|
13
13
|
|
|
14
14
|
## Workflow
|
|
15
15
|
|
|
16
|
-
1. Validate
|
|
17
|
-
HEAD, and the supplied
|
|
18
|
-
context.
|
|
16
|
+
1. Validate the immutable `WORKER_PACKET`, exact `PACKET_DIGEST`, `SESSION_PATH`,
|
|
17
|
+
`OUTPUT_FILE`, `SCHEMA_PATH`, `DIFF_RANGE`, `DIFF_FILES`, HEAD, and the supplied
|
|
18
|
+
intent, accepted delta, acceptance criteria, and public-seam context. Stop
|
|
19
|
+
incomplete when any value differs from the packet.
|
|
19
20
|
2. Read the changed behavior and only the callers, tests, docs, and contracts needed to
|
|
20
21
|
determine whether each accepted requirement is actually delivered.
|
|
21
22
|
3. Map every acceptance criterion to current executable or source evidence. Check for
|
|
@@ -24,7 +25,8 @@ this axis independent from general engineering quality.
|
|
|
24
25
|
4. Do not report style, generic maintainability, or preferred architecture on this
|
|
25
26
|
axis. Report only a concrete mismatch between accepted intent and delivered behavior.
|
|
26
27
|
5. Calibrate severity to the user-visible or delivery impact and write
|
|
27
|
-
`ultra-review-findings-v2` following `SCHEMA_PATH
|
|
28
|
+
`ultra-review-findings-v2` following `SCHEMA_PATH`, including the exact
|
|
29
|
+
`packet_digest`.
|
|
28
30
|
|
|
29
31
|
Use `axis: spec_fidelity` and the narrowest category, such as `acceptance-gap`,
|
|
30
32
|
`scope-drift`, `spec-drift`, or `public-contract`. After valid output, return exactly:
|
|
@@ -33,4 +35,5 @@ Use `axis: spec_fidelity` and the narrowest category, such as `acceptance-gap`,
|
|
|
33
35
|
Wrote N findings (P0:X P1:X P2:X P3:X) to <filepath>
|
|
34
36
|
```
|
|
35
37
|
|
|
36
|
-
Do not modify source, task state, specifications,
|
|
38
|
+
Do not modify source, call Ultra MCP write tools, change task state, specifications,
|
|
39
|
+
or another worker's artifact.
|
package/agents/review-tests.md
CHANGED
|
@@ -14,8 +14,9 @@ Write findings to the assigned JSON file and return only a file acknowledgement.
|
|
|
14
14
|
|
|
15
15
|
## Workflow
|
|
16
16
|
|
|
17
|
-
1. Validate
|
|
18
|
-
HEAD, and the supplied
|
|
17
|
+
1. Validate the immutable `WORKER_PACKET`, exact `PACKET_DIGEST`, `SESSION_PATH`,
|
|
18
|
+
`OUTPUT_FILE`, `SCHEMA_PATH`, `DIFF_RANGE`, `DIFF_FILES`, HEAD, and the supplied
|
|
19
|
+
acceptance context. Stop incomplete when any value differs from the packet.
|
|
19
20
|
2. Map each changed behavior and acceptance claim to an executable test or check.
|
|
20
21
|
3. Follow `testing-rules` to determine what the evidence proves across functional,
|
|
21
22
|
persistence, protocol, UI, and failure boundaries that matter to this diff.
|
|
@@ -25,7 +26,8 @@ Write findings to the assigned JSON file and return only a file acknowledgement.
|
|
|
25
26
|
5. Detect missing error or state-transition coverage, ineffective assertions, hidden
|
|
26
27
|
skips, flaky assumptions, and tests that never reach the changed code.
|
|
27
28
|
6. Calibrate severity to the escaped product risk and write
|
|
28
|
-
`ultra-review-findings-v2` following `SCHEMA_PATH
|
|
29
|
+
`ultra-review-findings-v2` following `SCHEMA_PATH`, including the exact
|
|
30
|
+
`packet_digest`.
|
|
29
31
|
|
|
30
32
|
Use `axis: engineering_standards` and category `test-quality`. After valid output,
|
|
31
33
|
return exactly:
|
|
@@ -34,4 +36,5 @@ return exactly:
|
|
|
34
36
|
Wrote N findings (P0:X P1:X P2:X P3:X) to <filepath>
|
|
35
37
|
```
|
|
36
38
|
|
|
37
|
-
Do not modify tests
|
|
39
|
+
Do not modify tests or production code, call Ultra MCP write tools, change task state,
|
|
40
|
+
or edit another worker's artifact.
|
package/agents/tdd-runner.md
CHANGED
|
@@ -17,6 +17,8 @@ Run tests and analyze their evidence. This assignment is read-only.
|
|
|
17
17
|
1. Resolve the requested scope, checkout, repository guidance, and canonical command
|
|
18
18
|
from package scripts, CI configuration, or framework files. Ask the parent to
|
|
19
19
|
resolve ambiguity when different commands prove different contracts.
|
|
20
|
+
For an Ultra delegation, validate the immutable Worker Packet and echo its exact
|
|
21
|
+
`packet_digest` in the assigned output.
|
|
20
22
|
2. Run the exact command without weakening flags, skipping failures, or changing test
|
|
21
23
|
configuration. Capture exit code, duration, pass/fail/skip counts, and coverage only
|
|
22
24
|
when the runner reports it.
|
|
@@ -31,5 +33,6 @@ Run tests and analyze their evidence. This assignment is read-only.
|
|
|
31
33
|
failures, environment limitations, and residual coverage gaps. Do not paste the full
|
|
32
34
|
runner transcript unless the parent requests it.
|
|
33
35
|
|
|
34
|
-
Do not edit tests
|
|
35
|
-
suite when the command did not complete
|
|
36
|
+
Do not edit tests or production code, call Ultra MCP write tools, change task state, or
|
|
37
|
+
edit projections. Do not claim a green suite when the command did not complete
|
|
38
|
+
successfully.
|