feat(goose-v149): add offline phase3 gate without real LLM calls
Memind CI / Test, build, and release guards (push) Has been cancelled
Memind CI / Test, build, and release guards (push) Has been cancelled
Block unattended DashScope smokes by default and provide a zero-token merge verification entry via run-goosed-v149-phase3-offline.mjs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,121 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Phase 3 offline closeout: unit tests + manifest drift only (no real LLM).
|
||||
* Use when DashScope quota is exhausted or unattended smokes must stay blocked.
|
||||
*
|
||||
* Full portal/page/memory smokes still require:
|
||||
* GOOSE_V149_ALLOW_REAL_LLM=1 node scripts/run-goosed-v149-phase3.mjs
|
||||
*/
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
import { prepareGooseV149CheckEnv } from './goose-v149-canary.mjs';
|
||||
import { checkPassed, classifyCheckResult } from './goose-v149-check-result.mjs';
|
||||
|
||||
const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const checkEnv = prepareGooseV149CheckEnv({ ...process.env }, root);
|
||||
|
||||
const checks = [
|
||||
{
|
||||
name: 'real-llm-gate-unit',
|
||||
command: [process.execPath, '--test', 'scripts/goose-v149-real-llm-gate.test.mjs'],
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'deepseek-parity',
|
||||
command: [process.execPath, '--test', 'release-gate/deepseek-production-parity.test.mjs'],
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'goose-canary-unit',
|
||||
command: [process.execPath, '--test', 'scripts/goose-v149-canary.test.mjs'],
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'memory-manifest-unit',
|
||||
command: [process.execPath, '--test', 'scripts/compare-goose-v149-memory-manifest.test.mjs'],
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'memory-drift',
|
||||
script: 'compare-goose-v149-memory-manifest.mjs',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'memory-failopen',
|
||||
script: 'check-goosed-v149-memory-failopen.mjs',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: 'context-runtime-unit',
|
||||
command: [
|
||||
process.execPath,
|
||||
'--test',
|
||||
'memind-headroom-policy.test.mjs',
|
||||
'context-budget.test.mjs',
|
||||
'recall-fusion.test.mjs',
|
||||
'mcp-result-compactor.test.mjs',
|
||||
],
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
|
||||
function runScript(script, extraEnv = {}) {
|
||||
const result = spawnSync(process.execPath, [path.join(root, 'scripts', script)], {
|
||||
cwd: root,
|
||||
env: { ...checkEnv, ...extraEnv },
|
||||
encoding: 'utf8',
|
||||
});
|
||||
return {
|
||||
ok: checkPassed(result),
|
||||
outcome: classifyCheckResult(result),
|
||||
status: result.status,
|
||||
stdout: result.stdout?.trim() ?? '',
|
||||
stderr: result.stderr?.trim() ?? '',
|
||||
};
|
||||
}
|
||||
|
||||
function runCommand(command, extraEnv = {}) {
|
||||
const [bin, ...args] = command;
|
||||
const result = spawnSync(bin, args, {
|
||||
cwd: root,
|
||||
env: { ...checkEnv, ...extraEnv },
|
||||
encoding: 'utf8',
|
||||
});
|
||||
return {
|
||||
ok: checkPassed(result),
|
||||
outcome: classifyCheckResult(result),
|
||||
status: result.status,
|
||||
stdout: result.stdout?.trim() ?? '',
|
||||
stderr: result.stderr?.trim() ?? '',
|
||||
};
|
||||
}
|
||||
|
||||
function main() {
|
||||
const results = [];
|
||||
|
||||
for (const check of checks) {
|
||||
const item = {
|
||||
...check,
|
||||
...(check.script
|
||||
? runScript(check.script, check.extraEnv ?? {})
|
||||
: runCommand(check.command, check.extraEnv ?? {})),
|
||||
};
|
||||
results.push(item);
|
||||
console.log(`[goose-v149-offline] ${item.outcome} ${check.name}`);
|
||||
if (item.stdout) console.log(item.stdout);
|
||||
if (!item.ok && item.stderr) console.error(item.stderr);
|
||||
}
|
||||
|
||||
const failedRequired = results.filter((item) => item.required && !item.ok);
|
||||
if (failedRequired.length) {
|
||||
console.error(`GOOSE_V149_PHASE3_OFFLINE_FAIL: ${failedRequired.map((item) => item.name).join(', ')}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log('GOOSE_V149_PHASE3_OFFLINE_OK');
|
||||
console.log(' note: portal/page/memory smokes skipped; see docs/goose-v149-real-llm-gate.md');
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user