feat: add guarded portal canary release
Memind CI / Test, build, and release guards (push) Failing after 2m14s

This commit is contained in:
john
2026-07-26 19:51:44 +08:00
parent 058d646b32
commit 286069449b
33 changed files with 2161 additions and 53 deletions
+30
View File
@@ -0,0 +1,30 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import {
isPassiveCanaryRuntime,
resolvePortalRuntimeRole,
} from './portal-runtime-role.mjs';
test('runtime role defaults to stable and rejects unknown values', () => {
assert.equal(resolvePortalRuntimeRole({}), 'stable');
assert.equal(resolvePortalRuntimeRole({ MEMIND_RUNTIME_ROLE: 'unknown' }), 'stable');
});
test('candidate runtime is passive unless explicitly disabled', () => {
assert.equal(
isPassiveCanaryRuntime({ MEMIND_RUNTIME_ROLE: 'candidate' }),
true,
);
assert.equal(
isPassiveCanaryRuntime({
MEMIND_RUNTIME_ROLE: 'candidate',
MEMIND_CANARY_PASSIVE_RUNTIME: '0',
}),
false,
);
assert.equal(
isPassiveCanaryRuntime({ MEMIND_RUNTIME_ROLE: 'stable' }),
false,
);
});