refactor: make production gate impact only
Memind CI / Test, build, and release guards (push) Has been cancelled

This commit is contained in:
john
2026-07-28 01:13:28 +08:00
parent 864197162d
commit 7a381db132
14 changed files with 195 additions and 98 deletions
+41 -11
View File
@@ -30,21 +30,51 @@ test('domain changes select the domain and dependency closure', async () => {
assert.equal(selection.selected_ids.includes('BILL-07'), false);
});
test('critical and unmapped runtime paths fail closed to the full gate', async () => {
test('critical paths expand mapped domains and unmapped paths block release', async () => {
const catalog = await loadScenarioCatalog();
const critical = selectImpactScenarios({
catalog,
changedPaths: ['server.mjs'],
});
assert.equal(critical.strategy, 'full');
assert.equal(critical.selected_total, catalog.length);
assert.deepEqual(critical.full_gate_reasons, ['critical_path:server.mjs']);
assert.equal(critical.policy_version, 2);
assert.equal(critical.strategy, 'impact');
assert.ok(critical.selected_total < catalog.length);
assert.deepEqual(
critical.impact_groups,
['AGENT', 'AUTH', 'CFG', 'CHAT', 'DATA', 'FILE', 'MS', 'PAGE'],
);
assert.deepEqual(critical.full_gate_reasons, []);
const unknown = selectImpactScenarios({
catalog,
changedPaths: ['new-runtime-kernel.mjs'],
});
assert.equal(unknown.strategy, 'full');
assert.deepEqual(unknown.unmapped_paths, ['new-runtime-kernel.mjs']);
assert.equal(unknown.selected_total, catalog.length);
assert.throws(
() => selectImpactScenarios({
catalog,
changedPaths: ['new-runtime-kernel.mjs'],
}),
/unmapped runtime paths: new-runtime-kernel\.mjs/,
);
assert.throws(
() => selectImpactScenarios({
catalog,
changedPaths: [],
blockingReasons: ['deployed_commit_not_ancestor:abc'],
}),
/Impact selection is blocked/,
);
});
test('release policy changes use mapped REL and CFG domains without selecting the catalog', async () => {
const catalog = await loadScenarioCatalog();
const selection = selectImpactScenarios({
catalog,
changedPaths: [
'release-gate/impact.mjs',
'scripts/release-portal-canary-prod.sh',
'.runtime/portal/server.mjs',
],
});
assert.equal(selection.strategy, 'impact');
assert.deepEqual(selection.impact_groups, ['CFG', 'REL']);
assert.ok(selection.selected_total < catalog.length);
assert.equal(selection.changed_paths.includes('.runtime/portal/server.mjs'), true);
});