Files
goodbuddy/tests/support/supervisor-preview.mjs
T
mesalogo 7d487f9326 feat: add supervisor workspace and traceable story graph
Extend the existing heartbeat workspace with scoped work reviews, result-specific story graphs, source inspection, and pinned conversation or task feedback. Connect confirmed continuation and local knowledge entity previews through the desktop APIs, and preserve result history and user corrections in schema 43.

Include focused regression tests, an isolated visual fixture, and implementation evidence. Full event-by-event replay, Experiment targets, no-change handling, and cancellation remain incomplete; this commit does not claim complete feature acceptance. Existing automatic plans remain active when the application entry is disabled.

Release note: Review work progress in the Supervisor workspace, trace graph events to saved sources, and open a matching review from pinned conversation or task feedback.
2026-09-23 13:49:13 +08:00

37 lines
1.6 KiB
JavaScript

// Local, simulated fixture only. Run: node tests/support/supervisor-preview.mjs
import { createServer } from 'vite'
import react from '@vitejs/plugin-react'
import { mkdtemp, rm } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join, resolve } from 'node:path'
import process from 'node:process'
import console from 'node:console'
const cacheDir = await mkdtemp(join(tmpdir(), 'goodbuddy-supervisor-preview-'))
const server = await createServer({
configFile: false,
root: resolve('.'),
cacheDir,
plugins: [react(), {
name: 'supervisor-preview',
configureServer(server) {
server.middlewares.use('/supervisor.html', async (_request, response) => {
response.setHeader('Content-Type', 'text/html; charset=utf-8')
response.end(await server.transformIndexHtml('/supervisor.html',
'<!doctype html><html lang="zh-CN"><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>SIMULATED Supervisor validation</title><body><div id="root"></div><script type="module" src="/tests/support/supervisor-layout-regression.tsx"></script></body></html>'))
})
}
}],
server: { host: '127.0.0.1', port: 4179, strictPort: true }
})
await server.listen()
console.log(`${server.resolvedUrls.local[0]}supervisor.html`)
console.log('Fixed simulated data. Scenarios: ?story=1, ?story=2, ?long=1, ?dense=1, ?state=loading, ?state=error, ?state=empty')
const close = async () => {
await server.close()
await rm(cacheDir, { recursive: true, force: true })
process.exit(0)
}
process.on('SIGINT', close)
process.on('SIGTERM', close)