fix(reporting-governance): tighten ack truth-state promotion guardrail
This commit is contained in:
@@ -5,6 +5,7 @@ import path from 'node:path';
|
||||
import os from 'node:os';
|
||||
|
||||
import { executeRuntimeIntegratedGovernance } from '../src/index.mjs';
|
||||
import { __testables as runtimeIntegratedTestables } from '../src/core/runtime-integrated.mjs';
|
||||
import capabilityDescriptor from '../capabilities/openclaw-watchdog-reference.json' with { type: 'json' };
|
||||
|
||||
const packageRoot = path.resolve(import.meta.dirname, '..');
|
||||
@@ -267,6 +268,34 @@ function assertAckedTruthState(result) {
|
||||
);
|
||||
}
|
||||
|
||||
test('truth-state promotion guardrail: mixed terminal outcomes must not promote overall state to acked', () => {
|
||||
assert.equal(runtimeIntegratedTestables.canPromoteAckedFromSupervisor({
|
||||
ackedCount: 1,
|
||||
pendingCount: 1,
|
||||
blockedCount: 0,
|
||||
}), false);
|
||||
|
||||
assert.equal(runtimeIntegratedTestables.canPromoteAckedFromSupervisor({
|
||||
ackedCount: 1,
|
||||
pendingCount: 0,
|
||||
blockedCount: 1,
|
||||
}), false);
|
||||
});
|
||||
|
||||
test('truth-state promotion guardrail: only fully acked observed terminal set may promote to acked', () => {
|
||||
assert.equal(runtimeIntegratedTestables.canPromoteAckedFromSupervisor({
|
||||
ackedCount: 0,
|
||||
pendingCount: 0,
|
||||
blockedCount: 0,
|
||||
}), false);
|
||||
|
||||
assert.equal(runtimeIntegratedTestables.canPromoteAckedFromSupervisor({
|
||||
ackedCount: 1,
|
||||
pendingCount: 0,
|
||||
blockedCount: 0,
|
||||
}), true);
|
||||
});
|
||||
|
||||
const futureTruthStateMatrix = Object.freeze({
|
||||
deferred: {
|
||||
contractDeliveryState: 'pending_external_send',
|
||||
|
||||
Reference in New Issue
Block a user