Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix([issue-9798]): reject conflicting acceptance CLI modes

[._.]/ Adam Eivyb2e0712d8b86
diff --git a/scripts/eidoverse-acceptance.js b/scripts/eidoverse-acceptance.js
index 6666dfb71f..1555df3bb8 100644
--- a/scripts/eidoverse-acceptance.js
+++ b/scripts/eidoverse-acceptance.js
@@ -194,6 +194,14 @@ async function live(report, reportPath, upstream) {
export async function main(args = process.argv.slice(2)) {
const reportPath = args.includes('--report') ? args[args.indexOf('--report') + 1] : join(tmpdir(), 'eidoverse-acceptance-report.json');
+ if (args.includes('--preflight') && args.includes('--live')) {
+ const report = newReport();
+ report.status = 'fail';
+ report.reason = '--preflight and --live are mutually exclusive; no acceptance attempted.';
+ await save(report, reportPath);
+ await summarize(report, process.env.GITHUB_STEP_SUMMARY);
+ return 2;
+ }
if (args.includes('--summary') || args.includes('--build-failed') || args.includes('--source-unavailable')) {
const report = JSON.parse(await readFile(reportPath, 'utf8'));
if (args.includes('--build-failed') && report.criteria.host.status === 'pass' && report.criteria.build.status !== 'pass') {
@@ -207,7 +215,7 @@ export async function main(args = process.argv.slice(2)) {
await save(report, reportPath);
}
await summarize(report, process.env.GITHUB_STEP_SUMMARY);
- return report.status === 'pass' ? 0 : 2;
+ return acceptanceExitCode(report);
}
const report = newReport();
report.criteria.host = await preflight();
@@ -221,7 +229,14 @@ export async function main(args = process.argv.slice(2)) {
}
await save(report, reportPath);
await summarize(report, process.env.GITHUB_STEP_SUMMARY);
- return args.includes('--preflight') && report.criteria.host.status === 'pass' ? 0 : report.status === 'pass' ? 0 : 2;
+ return acceptanceExitCode(report, { preflightOnly: args.includes('--preflight'), live: args.includes('--live') });
+}
+
+/** A successful prerequisite must never override a failed live verdict. */
+export function acceptanceExitCode(report, { preflightOnly = false, live = false } = {}) {
+ if (live) return report.status === 'pass' ? 0 : 2;
+ if (preflightOnly) return report.criteria.host.status === 'pass' ? 0 : 2;
+ return report.status === 'pass' ? 0 : 2;
}
if (isDirectlyInvoked(import.meta.url)) main().then(code => { process.exitCode = code; }).catch(() => {
diff --git a/scripts/lib/eidoverseAcceptance.test.js b/scripts/lib/eidoverseAcceptance.test.js
index 568b716778..dbfca4c6b9 100644
--- a/scripts/lib/eidoverseAcceptance.test.js
+++ b/scripts/lib/eidoverseAcceptance.test.js
@@ -6,6 +6,7 @@ import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { hostVerdict, assertVideo, inspectGeometry, toneRatio, assertContainment } from './eidoverseAcceptance.js';
import { syntheticSong } from '../fixtures/eidoverseAcceptanceScene.js';
+import { acceptanceExitCode } from '../eidoverse-acceptance.js';
const host = { platform: 'linux', arch: 'x64', docker: { OSType: 'linux', Architecture: 'x86_64' }, memAvailable: 8 * 1024 ** 3, diskFree: 60 * 1024 ** 3 };
const probe = { streams: [{ codec_type: 'video', width: 1280, height: 720, nb_read_frames: '48', avg_frame_rate: '24/1', duration: '2' }, { codec_type: 'audio', codec_name: 'aac' }], format: { duration: '2' } };
@@ -82,4 +83,23 @@ describe('acceptance evidence guards (synthetic validator tests, never runtime a
expect(JSON.stringify(saved)).not.toContain(root);
} finally { rmSync(root, { recursive: true, force: true }); }
});
+ it('rejects combined CLI modes before preflight and never promotes a failed live report to success', () => {
+ const root = mkdtempSync(join(tmpdir(), 'eido-acceptance-modes-'));
+ try {
+ const report = join(root, 'report.json');
+ const script = fileURLToPath(new URL('../eidoverse-acceptance.js', import.meta.url));
+ expect(() => execFileSync(process.execPath, [script, '--preflight', '--live', '--report', report], {
+ env: { PATH: '/no-acceptance-tools', NODE_ENV: 'test' }, stdio: 'pipe', timeout: 5000,
+ })).toThrow();
+ const saved = JSON.parse(readFileSync(report, 'utf8'));
+ expect(saved.status).toBe('fail');
+ expect(saved.reason).toContain('mutually exclusive');
+ expect(Object.values(saved.criteria).every(c => c.status === 'not-run')).toBe(true);
+ const failedLive = { status: 'fail', criteria: { host: { status: 'pass' } } };
+ expect(acceptanceExitCode(failedLive, { preflightOnly: true, live: true })).toBe(2);
+ expect(acceptanceExitCode(failedLive, { live: true })).toBe(2);
+ expect(acceptanceExitCode(failedLive)).toBe(2);
+ expect(acceptanceExitCode({ status: 'pass' }, { live: true })).toBe(0);
+ } finally { rmSync(root, { recursive: true, force: true }); }
+ });
});