ultra-builder-pro-cli 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ultra-template/docs/research/README.md +11 -7
- package/.ultra-template/specs/architecture.md +36 -36
- package/.ultra-template/specs/discovery.md +46 -33
- package/.ultra-template/specs/product.md +38 -29
- package/.ultra-template/specs/research-distillate.md +48 -0
- package/.ultra-template/tasks/contexts/TEMPLATE.md +11 -28
- package/CHANGELOG.md +44 -1
- package/README.md +34 -19
- package/adapters/_shared/codex-assets.cjs +6 -2
- package/adapters/_shared/file-ops.cjs +6 -2
- package/adapters/claude.js +3 -2
- package/adapters/codex.js +1 -0
- package/adapters/kimi.js +3 -2
- package/adapters/opencode.js +3 -2
- package/agents/review-coordinator.md +9 -6
- package/docs/AGENT-CONTEXT.md +15 -8
- package/docs/ARCHITECTURE.md +33 -12
- package/docs/PLAN.zh-CN.md +3 -2
- package/docs/ROADMAP.md +8 -4
- package/docs/RUNTIME-COMPAT-MATRIX.md +4 -4
- package/docs/STATE-DB-ACCESS-POLICY.md +27 -25
- package/docs/WORKFLOW-LIFECYCLE.md +266 -0
- package/hooks/README.md +6 -1
- package/hooks/health_check.py +12 -3
- package/hooks/subagent_tracker.py +52 -77
- package/mcp-server/hook-event.cjs +34 -0
- package/mcp-server/lib/archive-journal.cjs +17 -5
- package/mcp-server/lib/baseline-workflow.cjs +158 -18
- package/mcp-server/lib/change-workflow.cjs +550 -85
- package/mcp-server/lib/context-spine.cjs +242 -24
- package/mcp-server/lib/doctor.cjs +33 -3
- package/mcp-server/lib/init-project.cjs +210 -16
- package/mcp-server/lib/plan-store.cjs +4 -1
- package/mcp-server/lib/pricing.cjs +7 -10
- package/mcp-server/lib/project-breadcrumb.cjs +6 -0
- package/mcp-server/lib/projector.cjs +57 -3
- package/mcp-server/lib/spec-learning.cjs +79 -2
- package/mcp-server/lib/state-db.cjs +145 -8
- package/mcp-server/lib/state-ops.cjs +160 -9
- package/mcp-server/lib/workflow-state.cjs +2292 -0
- package/mcp-server/server.cjs +161 -15
- package/orchestrator/daemon.cjs +1 -2
- package/orchestrator/dispatch-rules.cjs +5 -31
- package/orchestrator/planner/plan-builder.cjs +21 -12
- package/package.json +13 -3
- package/skills/ultra-change/SKILL.md +53 -68
- package/skills/ultra-change/references/change-contract.md +36 -0
- package/skills/ultra-deliver/SKILL.md +69 -79
- package/skills/ultra-deliver/references/baseline-reconciliation.md +20 -0
- package/skills/ultra-dev/SKILL.md +54 -59
- package/skills/ultra-doctor/SKILL.md +40 -71
- package/skills/ultra-init/SKILL.md +96 -103
- package/skills/ultra-init/references/brownfield-adoption.md +2 -2
- package/skills/ultra-plan/SKILL.md +79 -85
- package/skills/ultra-plan/references/semantic-preflight.md +18 -0
- package/skills/ultra-research/SKILL.md +87 -60
- package/skills/ultra-research/references/00-problem-validation.md +36 -0
- package/skills/ultra-research/references/01-opportunity-discovery.md +33 -0
- package/skills/ultra-research/references/02-market-assessment.md +30 -0
- package/skills/ultra-research/references/03-competitive-landscape.md +31 -0
- package/skills/ultra-research/references/04-product-strategy.md +32 -0
- package/skills/ultra-research/references/05-assumptions-validation.md +31 -0
- package/skills/ultra-research/references/10-user-personas.md +29 -0
- package/skills/ultra-research/references/11-user-scenarios.md +28 -0
- package/skills/ultra-research/references/20-user-stories.md +30 -0
- package/skills/ultra-research/references/21-features-scope.md +29 -0
- package/skills/ultra-research/references/22-success-metrics.md +28 -0
- package/skills/ultra-research/references/30-architecture-context.md +30 -0
- package/skills/ultra-research/references/31-solution-strategy.md +28 -0
- package/skills/ultra-research/references/32-building-blocks.md +28 -0
- package/skills/ultra-research/references/40-deployment.md +29 -0
- package/skills/ultra-research/references/41-quality-risks.md +28 -0
- package/skills/ultra-research/references/99-synthesis.md +35 -0
- package/skills/ultra-review/SKILL.md +57 -73
- package/skills/ultra-review/references/review-modes.md +27 -0
- package/skills/ultra-review/references/unified-schema.md +25 -0
- package/skills/ultra-review/scripts/review_wait.py +40 -3
- package/skills/ultra-status/SKILL.md +41 -45
- package/skills/ultra-test/SKILL.md +48 -55
- package/skills/ultra-verify/SKILL.md +1 -1
- package/skills/ultra-verify/references/{confidence-system.md → evidence-status.md} +3 -3
- package/spec/cli-protocol.md +7 -2
- package/spec/mcp-tools.yaml +384 -63
- package/spec/schemas/baseline-reconciliation.v1.schema.json +73 -0
- package/spec/schemas/delivery-report.v1.schema.json +111 -0
- package/spec/schemas/mcp-tools.schema.json +1 -1
- package/spec/schemas/state-db.sql +82 -1
- package/spec/schemas/tasks.v4.5.schema.json +8 -1
- package/spec/schemas/test-report.v1.schema.json +194 -0
- package/ultra-tools/cli.cjs +1 -1
- package/ultra-tools/commands/migrate.cjs +3 -3
- package/ultra-tools/commands/status.cjs +213 -12
- package/.ultra-template/delivery-report.json +0 -9
- package/.ultra-template/test-report.json +0 -8
- package/adapters/_shared/tests/file-ops.test.cjs +0 -54
- package/adapters/_shared/tests/frontmatter.test.cjs +0 -47
- package/adapters/_shared/tests/handbook.test.cjs +0 -101
- package/adapters/_shared/tests/path-rewrite.test.cjs +0 -60
- package/adapters/_shared/tests/provenance.test.cjs +0 -133
- package/adapters/_shared/tests/resolve-target.test.cjs +0 -75
- package/adapters/_shared/tests/runtime-assets.test.cjs +0 -149
- package/adapters/_shared/tests/settings-merge.test.cjs +0 -85
- package/adapters/_shared/tests/validate.test.cjs +0 -30
- package/adapters/tests/claude.test.cjs +0 -138
- package/adapters/tests/codex-hook.test.cjs +0 -142
- package/adapters/tests/codex.test.cjs +0 -430
- package/adapters/tests/kimi-hook.test.cjs +0 -149
- package/adapters/tests/kimi.test.cjs +0 -259
- package/adapters/tests/opencode.test.cjs +0 -357
- package/mcp-server/lib/archive-journal.test.cjs +0 -35
- package/mcp-server/lib/baseline-workflow.test.cjs +0 -477
- package/mcp-server/lib/change-workflow.test.cjs +0 -971
- package/mcp-server/lib/context-spine.test.cjs +0 -93
- package/mcp-server/lib/doctor.test.cjs +0 -148
- package/mcp-server/lib/plan-store.test.cjs +0 -132
- package/mcp-server/lib/prd-parser.test.cjs +0 -82
- package/mcp-server/lib/project-breadcrumb.test.cjs +0 -112
- package/mcp-server/lib/runtime-state.test.cjs +0 -92
- package/mcp-server/lib/spec-learning.test.cjs +0 -67
- package/mcp-server/lib/state-db.test.cjs +0 -314
- package/mcp-server/lib/task-expander.test.cjs +0 -169
- package/mcp-server/lib/topo.test.cjs +0 -158
- package/mcp-server/tests/circuit-breaker.test.cjs +0 -125
- package/mcp-server/tests/commit-hash-flow.test.cjs +0 -117
- package/mcp-server/tests/concurrency-update.test.cjs +0 -96
- package/mcp-server/tests/concurrency.test.cjs +0 -112
- package/mcp-server/tests/db-ops.test.cjs +0 -121
- package/mcp-server/tests/init-project.test.cjs +0 -393
- package/mcp-server/tests/migrate.test.cjs +0 -232
- package/mcp-server/tests/projector.test.cjs +0 -162
- package/mcp-server/tests/server-contract.test.cjs +0 -1467
- package/mcp-server/tests/staleness.test.cjs +0 -190
- package/mcp-server/tests/state-db.test.cjs +0 -106
- package/mcp-server/tests/state-ops.test.cjs +0 -449
- package/mcp-server/tests/tagged-tasks.test.cjs +0 -163
- package/mcp-server/tests/telemetry.test.cjs +0 -219
- package/orchestrator/planner/plan-builder.test.cjs +0 -165
- package/orchestrator/tests/auto-merge.test.cjs +0 -216
- package/orchestrator/tests/daemon.test.cjs +0 -311
- package/orchestrator/tests/dispatch-rules.test.cjs +0 -124
- package/orchestrator/tests/parallel-orchestrator.test.cjs +0 -233
- package/orchestrator/tests/phase-8b-gate.test.cjs +0 -183
- package/orchestrator/tests/recovery.test.cjs +0 -190
- package/orchestrator/tests/session-runner.test.cjs +0 -314
- package/orchestrator/tests/skill-miner.test.cjs +0 -147
- package/orchestrator/tests/worktree-manager.test.cjs +0 -148
- package/skills/ultra-research/references/architecture.md +0 -38
- package/skills/ultra-research/references/problem-product.md +0 -39
- package/skills/ultra-research/references/quality-delivery.md +0 -34
- package/skills/ultra-research/references/synthesis.md +0 -38
- package/skills/ultra-research/references/users-scope.md +0 -40
- package/ultra-tools/legacy-memory.test.cjs +0 -80
- package/ultra-tools/status-command.test.cjs +0 -181
- package/ultra-tools/system-command.test.cjs +0 -309
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { test } = require('node:test');
|
|
4
|
-
const assert = require('node:assert/strict');
|
|
5
|
-
const fs = require('node:fs');
|
|
6
|
-
const os = require('node:os');
|
|
7
|
-
const path = require('node:path');
|
|
8
|
-
const { spawnSync } = require('node:child_process');
|
|
9
|
-
const { initStateDb, closeStateDb } = require('../../mcp-server/lib/state-db.cjs');
|
|
10
|
-
const { createChange } = require('../../mcp-server/lib/change-workflow.cjs');
|
|
11
|
-
const { createTask } = require('../../mcp-server/lib/state-ops.cjs');
|
|
12
|
-
const { compileRoleContext } = require('../../mcp-server/lib/context-spine.cjs');
|
|
13
|
-
|
|
14
|
-
const REPO_ROOT = path.resolve(__dirname, '..', '..');
|
|
15
|
-
const ADAPTER = path.join(REPO_ROOT, 'hooks', 'adapters', 'codex.py');
|
|
16
|
-
|
|
17
|
-
function run(feature, payload) {
|
|
18
|
-
return spawnSync('python3', [ADAPTER, feature], {
|
|
19
|
-
cwd: REPO_ROOT,
|
|
20
|
-
input: JSON.stringify(payload),
|
|
21
|
-
encoding: 'utf8',
|
|
22
|
-
env: { ...process.env, PLUGIN_DATA: path.join(REPO_ROOT, '.tmp-codex-hook-test') },
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function seedContext(project, taskId = 'task-7') {
|
|
27
|
-
const state = initStateDb(path.join(project, '.ultra', 'state.db'));
|
|
28
|
-
state.db.prepare(
|
|
29
|
-
`INSERT INTO baselines
|
|
30
|
-
(id, project_name, mode, status, approved_by, approval_note, converged_at)
|
|
31
|
-
VALUES ('baseline', 'fixture', 'greenfield', 'ready', 'test', 'fixture', ?)`,
|
|
32
|
-
).run(new Date().toISOString());
|
|
33
|
-
const { change } = createChange(state.db, {
|
|
34
|
-
id: 'hook-change', title: 'Hook change', kind: 'quick',
|
|
35
|
-
intent: 'Inject the authoritative task.',
|
|
36
|
-
docs_impact: { status: 'none', rationale: 'fixture' },
|
|
37
|
-
}, { rootDir: project });
|
|
38
|
-
const task = createTask(state.db, {
|
|
39
|
-
id: taskId, title: 'Hook task', type: 'bugfix', priority: 'P0', change_id: change.id,
|
|
40
|
-
});
|
|
41
|
-
compileRoleContext(state.db, {
|
|
42
|
-
input: {
|
|
43
|
-
task_id: task.id, role: 'implement', gate: 'implementation',
|
|
44
|
-
execution_contract: {
|
|
45
|
-
slice_kind: 'tracer_bullet', public_seam: 'hook injection',
|
|
46
|
-
verification_command: 'node --test adapters/tests/codex-hook.test.cjs',
|
|
47
|
-
},
|
|
48
|
-
next_action: 'Continue the authoritative hook task.',
|
|
49
|
-
},
|
|
50
|
-
change, tasks: [task], rootDir: project,
|
|
51
|
-
});
|
|
52
|
-
closeStateDb(state.db);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
test('Codex hook adapter rejects retired generic policy hooks', () => {
|
|
56
|
-
const result = run('block_dangerous_commands.py', {
|
|
57
|
-
session_id: 'session-1',
|
|
58
|
-
turn_id: 'turn-1',
|
|
59
|
-
cwd: REPO_ROOT,
|
|
60
|
-
hook_event_name: 'PreToolUse',
|
|
61
|
-
tool_name: 'Bash',
|
|
62
|
-
tool_input: { command: 'git reset --hard' },
|
|
63
|
-
});
|
|
64
|
-
assert.equal(result.status, 0, result.stderr);
|
|
65
|
-
const output = JSON.parse(result.stdout);
|
|
66
|
-
assert.match(output.systemMessage, /refused unknown feature/);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
test('Codex hook adapter injects only an active Ultra task boundary before edits', () => {
|
|
70
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), 'ubp-codex-hook-'));
|
|
71
|
-
try {
|
|
72
|
-
seedContext(project);
|
|
73
|
-
const result = run('active_task_context.py', {
|
|
74
|
-
session_id: 'session-2',
|
|
75
|
-
cwd: project,
|
|
76
|
-
hook_event_name: 'PreToolUse',
|
|
77
|
-
tool_name: 'apply_patch',
|
|
78
|
-
tool_input: { command: '*** Begin Patch\n*** Update File: src/a.py\n*** End Patch' },
|
|
79
|
-
});
|
|
80
|
-
assert.equal(result.status, 0, result.stderr);
|
|
81
|
-
const output = JSON.parse(result.stdout);
|
|
82
|
-
assert.equal(output.hookSpecificOutput.hookEventName, 'PreToolUse');
|
|
83
|
-
assert.match(output.hookSpecificOutput.additionalContext, /task-7/);
|
|
84
|
-
assert.doesNotMatch(JSON.stringify(output), /memory|recall|journal/);
|
|
85
|
-
} finally {
|
|
86
|
-
fs.rmSync(project, { recursive: true, force: true });
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
test('Codex hook adapter maps apply_patch payloads to Edit-compatible file inputs', () => {
|
|
91
|
-
const script = [
|
|
92
|
-
'import importlib.util, json, pathlib',
|
|
93
|
-
`p = pathlib.Path(${JSON.stringify(ADAPTER)})`,
|
|
94
|
-
's = importlib.util.spec_from_file_location("codex_hook_adapter", p)',
|
|
95
|
-
'm = importlib.util.module_from_spec(s)',
|
|
96
|
-
's.loader.exec_module(m)',
|
|
97
|
-
'payload = {"hook_event_name":"PostToolUse","tool_name":"apply_patch","tool_input":{"patch":"*** Begin Patch\\n*** Update File: src/a.py\\n*** Add File: src/b.py\\n*** End Patch"}}',
|
|
98
|
-
'print(json.dumps(m.normalize_inputs(payload)))',
|
|
99
|
-
].join('; ');
|
|
100
|
-
const result = spawnSync('python3', ['-c', script], { cwd: REPO_ROOT, encoding: 'utf8' });
|
|
101
|
-
assert.equal(result.status, 0, result.stderr);
|
|
102
|
-
const outputs = JSON.parse(result.stdout);
|
|
103
|
-
assert.deepEqual(outputs.map((entry) => entry.tool_input.file_path), ['src/a.py', 'src/b.py']);
|
|
104
|
-
assert.ok(outputs.every((entry) => entry.tool_name === 'Edit'));
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
test('Codex hook adapter denies apply_patch writes to tasks.json during an active Ultra workflow', () => {
|
|
108
|
-
const project = fs.mkdtempSync(path.join(os.tmpdir(), 'ubp-codex-hook-deny-'));
|
|
109
|
-
try {
|
|
110
|
-
fs.mkdirSync(path.join(project, '.ultra'));
|
|
111
|
-
const result = run('active_task_context.py', {
|
|
112
|
-
session_id: 'session-deny',
|
|
113
|
-
cwd: project,
|
|
114
|
-
hook_event_name: 'PreToolUse',
|
|
115
|
-
tool_name: 'apply_patch',
|
|
116
|
-
tool_input: {
|
|
117
|
-
patch: '*** Begin Patch\n*** Update File: .ultra/tasks/tasks.json\n*** End Patch',
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
assert.equal(result.status, 0, result.stderr);
|
|
121
|
-
const output = JSON.parse(result.stdout);
|
|
122
|
-
assert.equal(output.hookSpecificOutput.permissionDecision, 'deny');
|
|
123
|
-
assert.match(output.hookSpecificOutput.permissionDecisionReason, /\.ultra\/state\.db/);
|
|
124
|
-
} finally {
|
|
125
|
-
fs.rmSync(project, { recursive: true, force: true });
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
test('Codex hook adapter converts compact recovery context to PostCompact schema', () => {
|
|
130
|
-
const script = [
|
|
131
|
-
'import importlib.util, json, pathlib',
|
|
132
|
-
`p = pathlib.Path(${JSON.stringify(ADAPTER)})`,
|
|
133
|
-
's = importlib.util.spec_from_file_location("codex_hook_adapter", p)',
|
|
134
|
-
'm = importlib.util.module_from_spec(s)',
|
|
135
|
-
's.loader.exec_module(m)',
|
|
136
|
-
'legacy = {"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":"restored"}}',
|
|
137
|
-
'print(json.dumps(m.adapt_output(legacy, "PostCompact")))',
|
|
138
|
-
].join('; ');
|
|
139
|
-
const result = spawnSync('python3', ['-c', script], { cwd: REPO_ROOT, encoding: 'utf8' });
|
|
140
|
-
assert.equal(result.status, 0, result.stderr);
|
|
141
|
-
assert.deepEqual(JSON.parse(result.stdout), { systemMessage: 'restored' });
|
|
142
|
-
});
|
|
@@ -1,430 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { test } = require('node:test');
|
|
4
|
-
const assert = require('node:assert/strict');
|
|
5
|
-
const fs = require('node:fs');
|
|
6
|
-
const os = require('node:os');
|
|
7
|
-
const path = require('node:path');
|
|
8
|
-
const { spawnSync } = require('node:child_process');
|
|
9
|
-
const yaml = require('js-yaml');
|
|
10
|
-
const { Client } = require('@modelcontextprotocol/sdk/client/index.js');
|
|
11
|
-
const { StdioClientTransport } = require('@modelcontextprotocol/sdk/client/stdio.js');
|
|
12
|
-
const { initStateDb, closeStateDb } = require('../../mcp-server/lib/state-db.cjs');
|
|
13
|
-
|
|
14
|
-
const codex = require('../codex.js');
|
|
15
|
-
const { parse: parseFrontmatter } = require('../_shared/frontmatter.cjs');
|
|
16
|
-
const PACKAGE_VERSION = require('../../package.json').version;
|
|
17
|
-
const {
|
|
18
|
-
MCP_DEPENDENT_SKILLS,
|
|
19
|
-
skillsForRuntime,
|
|
20
|
-
WORKFLOW_HOOK_FILES,
|
|
21
|
-
} = require('../_shared/runtime-assets.cjs');
|
|
22
|
-
|
|
23
|
-
const REPO_ROOT = path.resolve(__dirname, '..', '..');
|
|
24
|
-
const COMMANDS = [
|
|
25
|
-
'learn',
|
|
26
|
-
'ultra-change',
|
|
27
|
-
'ultra-deliver',
|
|
28
|
-
'ultra-dev',
|
|
29
|
-
'ultra-doctor',
|
|
30
|
-
'ultra-init',
|
|
31
|
-
'ultra-plan',
|
|
32
|
-
'ultra-research',
|
|
33
|
-
'ultra-status',
|
|
34
|
-
'ultra-test',
|
|
35
|
-
'ultra-think',
|
|
36
|
-
];
|
|
37
|
-
const AGENTS = [
|
|
38
|
-
'code-reviewer',
|
|
39
|
-
'debugger',
|
|
40
|
-
'review-code',
|
|
41
|
-
'review-comments',
|
|
42
|
-
'review-coordinator',
|
|
43
|
-
'review-design',
|
|
44
|
-
'review-errors',
|
|
45
|
-
'review-spec',
|
|
46
|
-
'review-tests',
|
|
47
|
-
'tdd-runner',
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
function mkLayout() {
|
|
51
|
-
const homeDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ubp-codex-home-'));
|
|
52
|
-
return {
|
|
53
|
-
homeDir,
|
|
54
|
-
configDir: path.join(homeDir, '.codex'),
|
|
55
|
-
pluginRoot: path.join(homeDir, 'plugins', 'ultra-builder-pro'),
|
|
56
|
-
marketplaceFile: path.join(homeDir, '.agents', 'plugins', 'marketplace.json'),
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function cleanup(layout) {
|
|
61
|
-
fs.rmSync(layout.homeDir, { recursive: true, force: true });
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function install(layout) {
|
|
65
|
-
return codex.install({
|
|
66
|
-
configDir: layout.configDir,
|
|
67
|
-
homeDir: layout.homeDir,
|
|
68
|
-
scope: 'global',
|
|
69
|
-
repoRoot: REPO_ROOT,
|
|
70
|
-
runPluginCli: false,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function skillNames(pluginRoot) {
|
|
75
|
-
return fs.readdirSync(path.join(pluginRoot, 'skills'), { withFileTypes: true })
|
|
76
|
-
.filter((entry) => entry.isDirectory() && fs.existsSync(path.join(pluginRoot, 'skills', entry.name, 'SKILL.md')))
|
|
77
|
-
.map((entry) => entry.name)
|
|
78
|
-
.sort();
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
test('install builds one Codex-native plugin with complete skill and command coverage', () => {
|
|
82
|
-
const layout = mkLayout();
|
|
83
|
-
try {
|
|
84
|
-
const report = install(layout);
|
|
85
|
-
assert.equal(report.plugin.root, layout.pluginRoot);
|
|
86
|
-
|
|
87
|
-
const manifest = JSON.parse(fs.readFileSync(path.join(layout.pluginRoot, '.codex-plugin', 'plugin.json'), 'utf8'));
|
|
88
|
-
assert.equal(manifest.name, 'ultra-builder-pro');
|
|
89
|
-
const escapedVersion = PACKAGE_VERSION.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
90
|
-
assert.match(manifest.version, new RegExp(`^${escapedVersion}\\+codex\\.[0-9a-f]{12}$`));
|
|
91
|
-
assert.equal(manifest.skills, './skills/');
|
|
92
|
-
assert.equal(manifest.mcpServers, './.mcp.json');
|
|
93
|
-
assert.ok(!Object.hasOwn(manifest, 'hooks'), 'default hooks/hooks.json discovery avoids unsupported manifest field');
|
|
94
|
-
|
|
95
|
-
const expectedSkills = skillsForRuntime('codex').sort();
|
|
96
|
-
assert.deepEqual(skillNames(layout.pluginRoot), expectedSkills);
|
|
97
|
-
assert.equal(expectedSkills.length, 18);
|
|
98
|
-
assert.ok(!fs.existsSync(path.join(layout.pluginRoot, 'skills', 'codex-collab')));
|
|
99
|
-
assert.ok(!fs.existsSync(path.join(layout.pluginRoot, 'skills', 'learned')));
|
|
100
|
-
|
|
101
|
-
const commandMap = JSON.parse(fs.readFileSync(path.join(layout.pluginRoot, 'command-map.json'), 'utf8'));
|
|
102
|
-
assert.deepEqual(Object.keys(commandMap).sort(), COMMANDS.map((name) => `/${name}`).sort());
|
|
103
|
-
for (const command of COMMANDS) {
|
|
104
|
-
assert.equal(commandMap[`/${command}`], `$ultra-builder-pro:${command}`);
|
|
105
|
-
assert.ok(fs.existsSync(path.join(layout.pluginRoot, 'skills', command, 'SKILL.md')));
|
|
106
|
-
}
|
|
107
|
-
assert.ok(!fs.existsSync(path.join(layout.configDir, 'prompts')), 'deprecated Codex prompts must not be installed');
|
|
108
|
-
} finally {
|
|
109
|
-
cleanup(layout);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
test('every generated skill is Codex-valid, UI-visible, and free of Claude host bindings', () => {
|
|
114
|
-
const layout = mkLayout();
|
|
115
|
-
try {
|
|
116
|
-
install(layout);
|
|
117
|
-
for (const name of skillNames(layout.pluginRoot)) {
|
|
118
|
-
const skillDir = path.join(layout.pluginRoot, 'skills', name);
|
|
119
|
-
const text = fs.readFileSync(path.join(skillDir, 'SKILL.md'), 'utf8');
|
|
120
|
-
const { fm } = parseFrontmatter(text);
|
|
121
|
-
assert.deepEqual(Object.keys(fm).sort(), ['description', 'name'], `${name} should use Codex skill frontmatter only`);
|
|
122
|
-
assert.equal(fm.name, name);
|
|
123
|
-
assert.doesNotMatch(
|
|
124
|
-
text,
|
|
125
|
-
/~\/\.claude|CLAUDE\.md|AskUserQuestion|(^|[\s`(>])\/(?:ultra-[a-z-]+|recall|learn|codex-collab)(?=$|[\s`,.;):])/m,
|
|
126
|
-
);
|
|
127
|
-
assert.doesNotMatch(text, /TaskCreate|TaskUpdate|TaskList|TaskOutput|run_in_background|~\/\.codex\/skills|mcp__claude/);
|
|
128
|
-
assert.doesNotMatch(text, /[\u3400-\u9fff]|ultra-review-findings-v1|Context7|Exa MCP|confidence\s*>=?\s*\d+/iu);
|
|
129
|
-
|
|
130
|
-
const openai = yaml.load(fs.readFileSync(path.join(skillDir, 'agents', 'openai.yaml'), 'utf8'));
|
|
131
|
-
const openaiSource = fs.readFileSync(path.join(skillDir, 'agents', 'openai.yaml'), 'utf8');
|
|
132
|
-
assert.ok(openai.interface.display_name);
|
|
133
|
-
assert.ok(openai.interface.short_description);
|
|
134
|
-
assert.ok(openai.interface.short_description.length >= 25, name);
|
|
135
|
-
assert.ok(openai.interface.short_description.length <= 64, name);
|
|
136
|
-
assert.match(openaiSource, /short_description:\s+['"]/);
|
|
137
|
-
assert.match(openaiSource, /default_prompt:\s+['"]/);
|
|
138
|
-
assert.match(openai.interface.default_prompt, new RegExp(`\\$ultra-builder-pro:${name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}`));
|
|
139
|
-
assert.equal(openai.policy.allow_implicit_invocation, false);
|
|
140
|
-
if (MCP_DEPENDENT_SKILLS.includes(name)) {
|
|
141
|
-
assert.deepEqual(openai.dependencies.tools, [{
|
|
142
|
-
type: 'mcp',
|
|
143
|
-
value: 'ultra-builder-pro',
|
|
144
|
-
description: 'Ultra Builder Pro authoritative task and change runtime',
|
|
145
|
-
}]);
|
|
146
|
-
} else {
|
|
147
|
-
assert.equal(openai.dependencies, undefined);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const cc = fs.readFileSync(path.join(layout.pluginRoot, 'skills', 'cc-collab', 'SKILL.md'), 'utf8');
|
|
152
|
-
assert.match(cc, /Claude Code/);
|
|
153
|
-
assert.match(cc, /claude --safe-mode/);
|
|
154
|
-
|
|
155
|
-
const verify = fs.readFileSync(path.join(layout.pluginRoot, 'skills', 'ultra-verify', 'SKILL.md'), 'utf8');
|
|
156
|
-
assert.match(verify, /Keep the current host responsible/);
|
|
157
|
-
assert.match(verify, /installed collaboration companion/);
|
|
158
|
-
assert.match(verify, /host-analysis\.md/);
|
|
159
|
-
assert.doesNotMatch(verify, /codex exec|claude --safe-mode|Claude synthesizes|Claude-only/);
|
|
160
|
-
|
|
161
|
-
const waiter = fs.readFileSync(path.join(layout.pluginRoot, 'skills', 'ultra-verify', 'scripts', 'verify_wait.py'), 'utf8');
|
|
162
|
-
assert.match(waiter, /--advisor/);
|
|
163
|
-
assert.match(waiter, /advisor-output\.md/);
|
|
164
|
-
assert.doesNotMatch(waiter, /^ADVISOR\s*=|^OUTPUT_FILE\s*=/m);
|
|
165
|
-
|
|
166
|
-
const review = fs.readFileSync(path.join(layout.pluginRoot, 'skills', 'ultra-review', 'SKILL.md'), 'utf8');
|
|
167
|
-
assert.match(review, /native Codex custom agents/);
|
|
168
|
-
assert.match(review, /review-spec/);
|
|
169
|
-
assert.match(review, /scripts\/review_wait\.py/);
|
|
170
|
-
|
|
171
|
-
const plan = fs.readFileSync(path.join(layout.pluginRoot, 'skills', 'ultra-plan', 'SKILL.md'), 'utf8');
|
|
172
|
-
const status = fs.readFileSync(path.join(layout.pluginRoot, 'skills', 'ultra-status', 'SKILL.md'), 'utf8');
|
|
173
|
-
assert.doesNotMatch(plan, /LEGACY_STATE_MIGRATION_REQUIRED|v4\.4|v4\.5/);
|
|
174
|
-
assert.match(plan, /Never read or\s+write .*tasks\.json/i);
|
|
175
|
-
assert.match(status, /Never fall\s+back to generated task JSON/i);
|
|
176
|
-
|
|
177
|
-
const coreWorkflowText = [
|
|
178
|
-
...COMMANDS,
|
|
179
|
-
'ultra-review',
|
|
180
|
-
].map((name) => fs.readFileSync(path.join(layout.pluginRoot, 'skills', name, 'SKILL.md'), 'utf8')).join('\n');
|
|
181
|
-
assert.doesNotMatch(coreWorkflowText, /Phase (?:3\.7|5|7) placeholder|not yet implemented|UNKNOWN_TOOL/);
|
|
182
|
-
assert.doesNotMatch(coreWorkflowText, /session\.checkpoint|review\.run|ultra-tools subagent/);
|
|
183
|
-
assert.doesNotMatch(coreWorkflowText, /ask\.question|ultra-tools task (?:create|update|list|get)/);
|
|
184
|
-
assert.doesNotMatch(coreWorkflowText, /Context7 MCP|mcp__context7|Exa MCP|mcp__exa|Playwright via Bash/);
|
|
185
|
-
assert.doesNotMatch(coreWorkflowText, /`\/{command}`/);
|
|
186
|
-
} finally {
|
|
187
|
-
cleanup(layout);
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
test('install converts all bundled agent prompts into native Codex agent TOML', () => {
|
|
192
|
-
const layout = mkLayout();
|
|
193
|
-
try {
|
|
194
|
-
const report = install(layout);
|
|
195
|
-
assert.deepEqual(report.agents.installed.sort(), AGENTS.map((name) => `${name}.toml`).sort());
|
|
196
|
-
for (const name of AGENTS) {
|
|
197
|
-
const text = fs.readFileSync(path.join(layout.configDir, 'agents', `${name}.toml`), 'utf8');
|
|
198
|
-
assert.match(text, new RegExp(`^name = "${name}"`, 'm'));
|
|
199
|
-
assert.match(text, /^description = /m);
|
|
200
|
-
assert.match(text, /^developer_instructions = """/m);
|
|
201
|
-
assert.doesNotMatch(
|
|
202
|
-
text,
|
|
203
|
-
/model = "opus"|^tools =|^memory =|maxTurns|CLAUDE\.md|AskUserQuestion|(^|[\s`(>])\/(?:ultra-[a-z-]+|recall|learn|codex-collab)(?=$|[\s`,.;):])/m,
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
} finally {
|
|
207
|
-
cleanup(layout);
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
test('plugin declares current Codex hooks and a project-local Ultra MCP server', () => {
|
|
212
|
-
const layout = mkLayout();
|
|
213
|
-
try {
|
|
214
|
-
install(layout);
|
|
215
|
-
const hooks = JSON.parse(fs.readFileSync(path.join(layout.pluginRoot, 'hooks', 'hooks.json'), 'utf8')).hooks;
|
|
216
|
-
assert.deepEqual(Object.keys(hooks).sort(), [
|
|
217
|
-
'PostCompact', 'PreCompact', 'PreToolUse', 'SessionStart', 'Stop',
|
|
218
|
-
'SubagentStart', 'SubagentStop',
|
|
219
|
-
].sort());
|
|
220
|
-
const serializedHooks = JSON.stringify(hooks);
|
|
221
|
-
for (const feature of WORKFLOW_HOOK_FILES.filter((value) => value !== 'context_spine.py')) {
|
|
222
|
-
assert.match(serializedHooks, new RegExp(feature.replace('.', '\\.')));
|
|
223
|
-
}
|
|
224
|
-
assert.ok(fs.existsSync(path.join(layout.pluginRoot, 'hooks', 'context_spine.py')));
|
|
225
|
-
assert.doesNotMatch(serializedHooks, /memory|recall|journal|observation_capture|user_prompt_capture|block_dangerous|post_edit_guard/);
|
|
226
|
-
assert.match(serializedHooks, /\$PLUGIN_ROOT\/hooks\/adapters\/codex\.py/);
|
|
227
|
-
assert.match(serializedHooks, /apply_patch/);
|
|
228
|
-
|
|
229
|
-
const mcp = JSON.parse(fs.readFileSync(path.join(layout.pluginRoot, '.mcp.json'), 'utf8'));
|
|
230
|
-
const server = mcp.mcpServers['ultra-builder-pro'];
|
|
231
|
-
assert.equal(server.type, 'stdio');
|
|
232
|
-
assert.ok(path.isAbsolute(server.command));
|
|
233
|
-
assert.ok(path.isAbsolute(server.args[0]));
|
|
234
|
-
assert.equal(server.args[0], path.join(layout.pluginRoot, 'runtime', 'launch.cjs'));
|
|
235
|
-
assert.doesNotMatch(server.args[0], new RegExp(REPO_ROOT.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
|
|
236
|
-
assert.ok(!server.env, 'MCP must use each Codex task cwd so .ultra/state.db stays project-local');
|
|
237
|
-
|
|
238
|
-
for (const rel of [
|
|
239
|
-
'runtime/index.cjs',
|
|
240
|
-
'runtime/breadcrumb.cjs',
|
|
241
|
-
'runtime/launch.cjs',
|
|
242
|
-
'runtime/ultra-tools.cjs',
|
|
243
|
-
'runtime/build/Release/better_sqlite3.node',
|
|
244
|
-
'spec/mcp-tools.yaml',
|
|
245
|
-
'spec/upstream-mcp-tools.yaml',
|
|
246
|
-
'spec/codex-capability-map.json',
|
|
247
|
-
'spec/schemas/state-db.sql',
|
|
248
|
-
'templates/.ultra/tasks/tasks.json',
|
|
249
|
-
]) {
|
|
250
|
-
assert.ok(fs.existsSync(path.join(layout.pluginRoot, rel)), `missing bundled MCP asset ${rel}`);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
const liveSpec = yaml.load(fs.readFileSync(path.join(layout.pluginRoot, 'spec', 'mcp-tools.yaml'), 'utf8'));
|
|
254
|
-
const upstreamSpec = yaml.load(fs.readFileSync(path.join(layout.pluginRoot, 'spec', 'upstream-mcp-tools.yaml'), 'utf8'));
|
|
255
|
-
const capabilityMap = JSON.parse(fs.readFileSync(path.join(layout.pluginRoot, 'spec', 'codex-capability-map.json'), 'utf8'));
|
|
256
|
-
assert.equal(liveSpec.tools.length, 36);
|
|
257
|
-
assert.equal(upstreamSpec.tools.length, 36);
|
|
258
|
-
assert.deepEqual(upstreamSpec.tools.map((tool) => tool.name).sort(), liveSpec.tools.map((tool) => tool.name).sort());
|
|
259
|
-
assert.deepEqual(capabilityMap.live_mcp_tools.sort(), liveSpec.tools.map((tool) => tool.name).sort());
|
|
260
|
-
assert.equal(Object.keys(capabilityMap.codex_native_replacements).length, 9);
|
|
261
|
-
assert.equal(capabilityMap.codex_native_replacements['review.run'].surface, 'native_custom_agents');
|
|
262
|
-
assert.equal(capabilityMap.codex_native_replacements['ask.question'].surface, 'direct_user_interaction');
|
|
263
|
-
} finally {
|
|
264
|
-
cleanup(layout);
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
test('bundled plugin MCP runs outside the source checkout and keeps state in the Codex task cwd', async () => {
|
|
269
|
-
const layout = mkLayout();
|
|
270
|
-
const projectDir = fs.mkdtempSync(path.join(os.tmpdir(), 'ubp-codex-mcp-project-'));
|
|
271
|
-
let client;
|
|
272
|
-
try {
|
|
273
|
-
install(layout);
|
|
274
|
-
const seededState = initStateDb(path.join(projectDir, '.ultra', 'state.db'));
|
|
275
|
-
seededState.db.prepare(
|
|
276
|
-
`INSERT INTO baselines
|
|
277
|
-
(id, project_name, mode, status, approved_by, approval_note, converged_at)
|
|
278
|
-
VALUES ('test-baseline', 'codex-bundle', 'greenfield', 'ready', 'test', 'smoke fixture', ?)`,
|
|
279
|
-
).run(new Date().toISOString());
|
|
280
|
-
closeStateDb(seededState.db);
|
|
281
|
-
const mcp = JSON.parse(fs.readFileSync(path.join(layout.pluginRoot, '.mcp.json'), 'utf8'));
|
|
282
|
-
const server = mcp.mcpServers['ultra-builder-pro'];
|
|
283
|
-
const env = { ...process.env };
|
|
284
|
-
delete env.UBP_DB_PATH;
|
|
285
|
-
delete env.UBP_ROOT_DIR;
|
|
286
|
-
delete env.UBP_RUNTIME_ROOT;
|
|
287
|
-
const transport = new StdioClientTransport({
|
|
288
|
-
command: server.command,
|
|
289
|
-
args: server.args,
|
|
290
|
-
cwd: projectDir,
|
|
291
|
-
env,
|
|
292
|
-
stderr: 'pipe',
|
|
293
|
-
});
|
|
294
|
-
client = new Client({ name: 'ubp-codex-adapter-test', version: '0.0.0' }, { capabilities: {} });
|
|
295
|
-
await client.connect(transport);
|
|
296
|
-
|
|
297
|
-
const tools = await client.listTools();
|
|
298
|
-
assert.ok(tools.tools.some((tool) => tool.name === 'task.create'));
|
|
299
|
-
const created = await client.callTool({
|
|
300
|
-
name: 'task.create',
|
|
301
|
-
arguments: { id: 'codex-bundle-1', title: 'bundled runtime', type: 'feature', priority: 'P1' },
|
|
302
|
-
});
|
|
303
|
-
assert.equal(created.isError, undefined);
|
|
304
|
-
assert.ok(fs.existsSync(path.join(projectDir, '.ultra', 'state.db')));
|
|
305
|
-
assert.ok(!fs.existsSync(path.join(layout.pluginRoot, '.ultra', 'state.db')));
|
|
306
|
-
|
|
307
|
-
const status = spawnSync(process.execPath, [
|
|
308
|
-
path.join(layout.pluginRoot, 'runtime', 'ultra-tools.cjs'),
|
|
309
|
-
'status', '--cost', '--json',
|
|
310
|
-
], { cwd: projectDir, encoding: 'utf8' });
|
|
311
|
-
assert.equal(status.status, 0, status.stderr);
|
|
312
|
-
assert.equal(JSON.parse(status.stdout).ok, true);
|
|
313
|
-
|
|
314
|
-
const freshTarget = path.join(projectDir, 'fresh-project');
|
|
315
|
-
const initialized = await client.callTool({
|
|
316
|
-
name: 'task.init_project',
|
|
317
|
-
arguments: { target_dir: freshTarget, project_name: 'Codex bundle', project_type: 'cli' },
|
|
318
|
-
});
|
|
319
|
-
assert.equal(initialized.isError, undefined);
|
|
320
|
-
assert.ok(fs.existsSync(path.join(freshTarget, '.ultra', 'tasks', 'tasks.json')));
|
|
321
|
-
} finally {
|
|
322
|
-
if (client) await client.close();
|
|
323
|
-
fs.rmSync(projectDir, { recursive: true, force: true });
|
|
324
|
-
cleanup(layout);
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
test('install preserves user config and marketplace entries and is byte-idempotent', () => {
|
|
329
|
-
const layout = mkLayout();
|
|
330
|
-
try {
|
|
331
|
-
fs.mkdirSync(layout.configDir, { recursive: true });
|
|
332
|
-
const configFile = path.join(layout.configDir, 'config.toml');
|
|
333
|
-
fs.writeFileSync(configFile, '[profile]\nname = "dev"\n');
|
|
334
|
-
fs.mkdirSync(path.dirname(layout.marketplaceFile), { recursive: true });
|
|
335
|
-
fs.writeFileSync(layout.marketplaceFile, JSON.stringify({
|
|
336
|
-
name: 'personal',
|
|
337
|
-
interface: { displayName: 'Personal' },
|
|
338
|
-
plugins: [{
|
|
339
|
-
name: 'mine',
|
|
340
|
-
source: { source: 'local', path: './plugins/mine' },
|
|
341
|
-
policy: { installation: 'AVAILABLE', authentication: 'ON_INSTALL' },
|
|
342
|
-
category: 'Developer Tools',
|
|
343
|
-
}],
|
|
344
|
-
}, null, 2) + '\n');
|
|
345
|
-
|
|
346
|
-
install(layout);
|
|
347
|
-
const firstConfig = fs.readFileSync(configFile, 'utf8');
|
|
348
|
-
const firstMarketplace = fs.readFileSync(layout.marketplaceFile, 'utf8');
|
|
349
|
-
const firstManifest = fs.readFileSync(path.join(layout.pluginRoot, '.codex-plugin', 'plugin.json'), 'utf8');
|
|
350
|
-
const firstAgent = fs.readFileSync(path.join(layout.configDir, 'agents', 'review-code.toml'), 'utf8');
|
|
351
|
-
install(layout);
|
|
352
|
-
|
|
353
|
-
assert.equal(fs.readFileSync(configFile, 'utf8'), firstConfig);
|
|
354
|
-
assert.equal(fs.readFileSync(layout.marketplaceFile, 'utf8'), firstMarketplace);
|
|
355
|
-
assert.equal(fs.readFileSync(path.join(layout.pluginRoot, '.codex-plugin', 'plugin.json'), 'utf8'), firstManifest);
|
|
356
|
-
assert.equal(fs.readFileSync(path.join(layout.configDir, 'agents', 'review-code.toml'), 'utf8'), firstAgent);
|
|
357
|
-
|
|
358
|
-
const marketplace = JSON.parse(firstMarketplace);
|
|
359
|
-
assert.deepEqual(marketplace.plugins.map((entry) => entry.name), ['mine', 'ultra-builder-pro']);
|
|
360
|
-
assert.equal(marketplace.plugins[1].source.path, './plugins/ultra-builder-pro');
|
|
361
|
-
} finally {
|
|
362
|
-
cleanup(layout);
|
|
363
|
-
}
|
|
364
|
-
});
|
|
365
|
-
|
|
366
|
-
test('uninstall removes only UBP-managed plugin and agents', () => {
|
|
367
|
-
const layout = mkLayout();
|
|
368
|
-
try {
|
|
369
|
-
fs.mkdirSync(layout.configDir, { recursive: true });
|
|
370
|
-
const configFile = path.join(layout.configDir, 'config.toml');
|
|
371
|
-
fs.writeFileSync(configFile, '[profile]\nname = "dev"\n');
|
|
372
|
-
install(layout);
|
|
373
|
-
fs.writeFileSync(path.join(layout.configDir, 'agents', 'mine.toml'), 'name = "mine"\n');
|
|
374
|
-
|
|
375
|
-
codex.uninstall({
|
|
376
|
-
configDir: layout.configDir,
|
|
377
|
-
homeDir: layout.homeDir,
|
|
378
|
-
scope: 'global',
|
|
379
|
-
runPluginCli: false,
|
|
380
|
-
});
|
|
381
|
-
|
|
382
|
-
assert.ok(!fs.existsSync(layout.pluginRoot));
|
|
383
|
-
for (const name of AGENTS) {
|
|
384
|
-
assert.ok(!fs.existsSync(path.join(layout.configDir, 'agents', `${name}.toml`)));
|
|
385
|
-
}
|
|
386
|
-
assert.ok(fs.existsSync(path.join(layout.configDir, 'agents', 'mine.toml')));
|
|
387
|
-
assert.equal(fs.readFileSync(configFile, 'utf8'), '[profile]\nname = "dev"\n');
|
|
388
|
-
const marketplace = JSON.parse(fs.readFileSync(layout.marketplaceFile, 'utf8'));
|
|
389
|
-
assert.ok(!marketplace.plugins.some((entry) => entry.name === 'ultra-builder-pro'));
|
|
390
|
-
} finally {
|
|
391
|
-
cleanup(layout);
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
|
|
395
|
-
test('doctor checks the current Codex cache hook target for a CLI-managed global install', () => {
|
|
396
|
-
const layout = mkLayout();
|
|
397
|
-
try {
|
|
398
|
-
install(layout);
|
|
399
|
-
const runtimeManifest = JSON.parse(fs.readFileSync(
|
|
400
|
-
path.join(layout.configDir, 'ultra-builder-pro', 'install-manifest.json'),
|
|
401
|
-
'utf8',
|
|
402
|
-
));
|
|
403
|
-
const version = runtimeManifest.plugin.version;
|
|
404
|
-
const cacheAdapter = path.join(
|
|
405
|
-
codex._internal.pluginCacheRoot(layout.configDir, 'personal'),
|
|
406
|
-
version,
|
|
407
|
-
'hooks',
|
|
408
|
-
'adapters',
|
|
409
|
-
'codex.py',
|
|
410
|
-
);
|
|
411
|
-
const doctorCtx = {
|
|
412
|
-
homeDir: layout.homeDir,
|
|
413
|
-
scope: 'global',
|
|
414
|
-
repoRoot: REPO_ROOT,
|
|
415
|
-
runPluginCli: true,
|
|
416
|
-
};
|
|
417
|
-
|
|
418
|
-
const degraded = codex.doctor(doctorCtx);
|
|
419
|
-
assert.equal(degraded.status, 'degraded');
|
|
420
|
-
assert.ok(degraded.issues.some((entry) => (
|
|
421
|
-
entry.code === 'HOOK_TARGET_MISSING' && entry.version === version
|
|
422
|
-
)));
|
|
423
|
-
|
|
424
|
-
fs.mkdirSync(path.dirname(cacheAdapter), { recursive: true });
|
|
425
|
-
fs.copyFileSync(path.join(layout.pluginRoot, 'hooks', 'adapters', 'codex.py'), cacheAdapter);
|
|
426
|
-
assert.equal(codex.doctor(doctorCtx).status, 'healthy');
|
|
427
|
-
} finally {
|
|
428
|
-
cleanup(layout);
|
|
429
|
-
}
|
|
430
|
-
});
|