All checks were successful
deploy / deploy (push) Successful in 32s
Proof: Remove repo-owned automatic safety disarms and operator alert severity surfaces so arming state is no longer silently reverted by stale-quote alerts. Assumptions: The operator now wants arming to remain explicit and durable even when quote-truth checks are stale or noisy, and simple reachability/state is a better surface than derived alert severity for now. Still fake: The upstream quote-truth and health heuristics remain unreliable; this change removes their automatic containment effect instead of fixing their underlying accuracy.
49 lines
1.5 KiB
JavaScript
49 lines
1.5 KiB
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
|
|
import {
|
|
shouldContainExecutorForAlerts,
|
|
shouldRaiseIngestPublishStale,
|
|
} from '../src/core/runtime-health.mjs';
|
|
|
|
test('publish stale does not raise before any matching quote exists', () => {
|
|
assert.equal(shouldRaiseIngestPublishStale({
|
|
lastMatchingQuoteAt: null,
|
|
lastPublishedAt: null,
|
|
matchingQuoteAgeMs: null,
|
|
publishedAgeMs: null,
|
|
publishStaleMs: 30_000,
|
|
}), false);
|
|
});
|
|
|
|
test('publish stale raises after a matching quote exists but no publish follows', () => {
|
|
assert.equal(shouldRaiseIngestPublishStale({
|
|
lastMatchingQuoteAt: '2026-04-08T20:45:00.000Z',
|
|
lastPublishedAt: null,
|
|
matchingQuoteAgeMs: 10_000,
|
|
publishedAgeMs: null,
|
|
publishStaleMs: 30_000,
|
|
}), true);
|
|
});
|
|
|
|
test('executor containment stays disabled for quote-stale-only conditions', () => {
|
|
assert.equal(shouldContainExecutorForAlerts([{
|
|
alert_code: 'near_intents_quotes_stale',
|
|
severity: 'critical',
|
|
}]), false);
|
|
});
|
|
|
|
test('executor containment stays disabled even for broken truth path alerts', () => {
|
|
assert.equal(shouldContainExecutorForAlerts([{
|
|
alert_code: 'near_intents_ingest_disconnected',
|
|
severity: 'critical',
|
|
}]), false);
|
|
assert.equal(shouldContainExecutorForAlerts([{
|
|
alert_code: 'near_intents_publish_stale',
|
|
severity: 'critical',
|
|
}]), false);
|
|
assert.equal(shouldContainExecutorForAlerts([{
|
|
alert_code: 'history_writer_stalled',
|
|
severity: 'critical',
|
|
}]), false);
|
|
});
|