fix: integration test — 24/24 pass, all subsystems operational

DoctorService:
- check_bun(): search common bun paths (~/.bun/bin/bun, /usr/*)

RuntimeApp:
- Create DatabaseHandle adapter for Bun's raw Database
- Wire migrations through proper adapter (add query() method)

Scheduler:
- rebuild_from_db(): graceful no-op when tasks table doesn't exist yet

BuiltInToolRegistrar:
- All executors return {status:'ok', ...} for ToolRegistry.call()

Integration test results: 24/24 pass
- RuntimeApp creation: 5/5 subsystems
- Startup: DB init, migrations, tools, recovery
- Tools: 10 built-in tools verified
- Tool calls: fs.read/write/list/stat, project.scan
- Shutdown: clean close

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
AirCoding
2026-06-05 13:19:53 +08:00
parent 1288a9b26c
commit 44c53422c9
4 changed files with 46 additions and 25 deletions

View File

@@ -110,12 +110,20 @@ export class DoctorService {
}
private check_bun(): DoctorCheck {
try {
const version = execFileSync('bun', ['--version'], { stdio: 'pipe', timeout: 5000 }).toString().trim()
return { name: 'bun', category: 'self_bootstrap', passed: true, message: `Bun ${version} found`, fixable: false }
} catch {
return { name: 'bun', category: 'self_bootstrap', passed: false, message: 'Bun not found', fixable: true, fix: 'Install Bun: curl -fsSL https://bun.sh/install | bash' }
// Search bun in common paths, not just PATH
const candidates = [
'bun', // PATH
`${process.env.HOME || '/root'}/.bun/bin/bun`,
'/usr/local/bin/bun',
'/usr/bin/bun',
]
for (const bun of candidates) {
try {
const version = execFileSync(bun, ['--version'], { stdio: 'pipe', timeout: 5000 }).toString().trim()
return { name: 'bun', category: 'self_bootstrap', passed: true, message: `Bun ${version} found`, fixable: false }
} catch { /* try next */ }
}
return { name: 'bun', category: 'self_bootstrap', passed: false, message: 'Bun not found', fixable: true, fix: 'Install Bun: curl -fsSL https://bun.sh/install | bash' }
}
private check_sqlite(): DoctorCheck {