feat: align conversation state, composer and scoped approvals
This commit is contained in:
1 parent
771ca540f7
commit
308b98df23
61 files changed
+1701
-292
No files matched your search
@@ -0,0 +1,34 @@
|
||||
/** Offline alignment regression: never starts a model service or Claude CLI. */
|
||||
import { build } from 'esbuild'
|
||||
import { spawnSync } from 'node:child_process'
|
||||
const tests = [
|
||||
'model-selection-alignment-regression.ts', 'model-settings-alignment-regression.ts', 'session-factory-alignment-regression.ts',
|
||||
'session-composer-alignment-regression.tsx', 'alignment-conversation-regression.tsx',
|
||||
'runtime-authorization-regression.ts', 'permission-intercept-regression.tsx'
|
||||
]
|
||||
for (const file of tests) {
|
||||
const format = file.endsWith('.tsx') ? 'cjs' : 'esm'
|
||||
const outfile = `.tmp/alignment-tests/${file.replace(/\.tsx?$/, format === 'cjs' ? '.cjs' : '.mjs')}`
|
||||
await build({ entryPoints: [`scripts/${file}`], outfile, bundle: true, platform: 'node', format, external: ['esbuild'], jsx: 'automatic', loader: { '.css': 'empty' }, logLevel: 'warning' })
|
||||
const result = spawnSync(process.execPath, [outfile], { stdio: 'inherit', timeout: 120000 })
|
||||
if (result.error) throw result.error
|
||||
if (result.status !== 0) process.exit(result.status ?? 1)
|
||||
}
|
||||
|
||||
// Host/SDK-interface fixtures; these builders stub query and never launch the CLI.
|
||||
for (const file of ['scripts/build-runtime-regressions.mjs', '.tmp/claude-approval-policy-regression.mjs', '.tmp/claude-grant-replay-regression.mjs']) {
|
||||
const result = spawnSync(process.execPath, [file], { stdio: 'inherit', timeout: 120000 })
|
||||
if (result.error) throw result.error
|
||||
if (result.status !== 0) process.exit(result.status ?? 1)
|
||||
}
|
||||
|
||||
// Optional DOM tests use separately installed jsdom, not Electron/CLI or an upstream model.
|
||||
if (process.env.YCODE_TEST_DOM_MODULE) {
|
||||
for (const file of ['task-popconfirm-regression', 'question-interaction-regression', 'permission-intercept-dom-regression']) {
|
||||
const outfile = `.tmp/alignment-tests/${file}.cjs`
|
||||
await build({ entryPoints: [`scripts/${file}.tsx`], outfile, bundle: true, platform: 'node', format: 'cjs', jsx: 'automatic', loader: { '.css': 'empty' }, logLevel: 'warning' })
|
||||
const result = spawnSync(process.execPath, [outfile], { stdio: 'inherit', timeout: 120000 })
|
||||
if (result.error) throw result.error
|
||||
if (result.status !== 0) process.exit(result.status ?? 1)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user