test: harden profile artifact path boundaries

This commit is contained in:
Eve
2026-05-08 10:48:41 +08:00
parent 8c7aca145e
commit 173de01bdb
4 changed files with 114 additions and 4 deletions

View File

@@ -149,3 +149,30 @@ test('orchestrator adapter can bootstrap from profile artifact loader path', ()
fs.rmSync(root, { recursive: true, force: true });
}
});
test('orchestrator adapter can use artifact_roots.queueItems as the default queueDir at execution time', () => {
const root = createFixtureRoot();
try {
mkdirs(root, ['evidence', 'events', 'spool', 'receipts']);
const statePath = writeState(root);
const result = runOrchestratorAdapter({
profileId: 'strict-manager-mode',
repoRootOverride: path.resolve(packageRoot, '..', '..'),
state: statePath,
evidenceDir: path.join(root, 'evidence'),
eventDir: path.join(root, 'events'),
spoolDir: path.join(root, 'spool'),
receiptDir: path.join(root, 'receipts'),
writeState: true,
dryRun: true,
now: '2026-05-07T08:20:00.000Z',
});
assert.equal(result.ok, true);
assert.equal(result.result.dispatcher.dispatchedCount >= 0, true);
} finally {
fs.rmSync(root, { recursive: true, force: true });
}
});