feat(orchestrator): enforce Page Data validation gate
This commit is contained in:
@@ -46,6 +46,13 @@ test('orchestrator config defaults to a disabled native-safe runtime', async ()
|
||||
reason: 'shadow_observation_not_requested',
|
||||
environmentGate: false,
|
||||
});
|
||||
assert.deepEqual(state.runtime.pageDataValidationGate, {
|
||||
requested: false,
|
||||
enabled: false,
|
||||
failClosed: true,
|
||||
reason: 'environment_page_data_validation_gate_disabled',
|
||||
environmentGate: false,
|
||||
});
|
||||
assert.equal(state.engines.find((engine) => engine.id === 'native').configured, true);
|
||||
assert.equal(state.engines.find((engine) => engine.id === 'langgraph').configured, false);
|
||||
assert.deepEqual(
|
||||
@@ -275,6 +282,34 @@ test('Shadow runtime reports the independent Portal observation wiring gate', as
|
||||
reason: null,
|
||||
environmentGate: true,
|
||||
});
|
||||
assert.deepEqual(runtime.runtime.pageDataValidationGate, {
|
||||
requested: false,
|
||||
enabled: false,
|
||||
failClosed: true,
|
||||
reason: 'environment_page_data_validation_gate_disabled',
|
||||
environmentGate: false,
|
||||
});
|
||||
});
|
||||
|
||||
test('Page Data validation gate is effective only with Shadow wiring and its own environment gate', async () => {
|
||||
const service = createOrchestratorAdminConfigService(createPool(), {
|
||||
env: {
|
||||
MEMIND_ORCHESTRATOR_SHADOW_OBSERVATION_ENABLED: '1',
|
||||
MEMIND_ORCHESTRATOR_PAGE_DATA_VALIDATION_GATE_ENABLED: '1',
|
||||
},
|
||||
});
|
||||
await service.updateAdminConfig({
|
||||
mode: 'shadow',
|
||||
serviceUrl: 'http://127.0.0.1:8093',
|
||||
});
|
||||
const runtime = await service.getRuntimeState();
|
||||
assert.deepEqual(runtime.runtime.pageDataValidationGate, {
|
||||
requested: true,
|
||||
enabled: true,
|
||||
failClosed: true,
|
||||
reason: null,
|
||||
environmentGate: true,
|
||||
});
|
||||
});
|
||||
|
||||
test('orchestrator emergency kill switch always forces native selection', async () => {
|
||||
|
||||
Reference in New Issue
Block a user