Skip to content

Commit 9ffd59a

Browse files
committed
fix(seal): carry the paced-target distinction, or the engine fix is inert
The engine now publishes a stream rate that matched the mock's paced upstream instead of suppressing it. On its own that changes nothing the board shows: the seal's rule is "a positive value whose flag !== false is SUPPRESSED", so the value was thrown away one layer later and the fix would have been decoration. Which is precisely the failure shape this whole audit keeps turning up, so finding it in my own change an hour after writing about it is worth saying out loud. sealMetric takes `paced` now. For the stream metrics the mock's frames/sec is a TARGET - c streams x one frame per its fixed delta interval, "the pacing is the model generating tokens" in the mock's own words - so a `true` flag means the gateway kept up and is carried as a signal beside a published value. For the throughput metrics nothing changes: a saturating load can genuinely exhaust the mock, and publishing then ranks the rig instead of the gateway. `unverifiable` still suppresses on both paths. An unmeasurable reference says nothing either way, and certifying a number on no evidence is the thing the gate exists to prevent. Also closes the freshness fail-open's sibling in the same file, and the test pins all four corners: paced+bound publishes, capacity+bound suppresses, unverifiable suppresses on both, clean certifies on both. Confirmed RED against the old single rule.
1 parent be59d15 commit 9ffd59a

3 files changed

Lines changed: 50 additions & 6 deletions

File tree

‎site/gen-data.mjs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,13 @@ function sealStreamRecord(s) {
395395
// honesty flag. Sealing it UNGATED beside a GATED streams_sustained let the rig-bound rate publish
396396
// while the count it came from was suppressed. Gate it on the same flag.
397397
rec.streams_sustained_fps = sealMetric(s.streams_sustained_fps, {
398-
gated: true, flag: s.streams_sustained_mock_bound, zeroNote: ZERO_MEASURED_FAIL });
398+
gated: true, paced: true, flag: s.streams_sustained_mock_bound, zeroNote: ZERO_MEASURED_FAIL });
399399
// AUDIT #3: streaming counts - a 0 is a MEASURED FAILURE (offered stream load, sustained none), NOT
400400
// "not measured". Only a null (absent field) is not-measured. The note names which, and every surface
401401
// renders the two apart.
402402
rec.streams_sustained = sealMetric(s.streams_sustained, {
403-
gated: true, flag: s.streams_sustained_mock_bound, zeroNote: ZERO_MEASURED_FAIL });
404-
rec.cpu_fps = sealMetric(s.cpu_fps, { gated: true, flag: s.cpu_fps_mock_bound, zeroNote: ZERO_MEASURED_FAIL,
403+
gated: true, paced: true, flag: s.streams_sustained_mock_bound, zeroNote: ZERO_MEASURED_FAIL });
404+
rec.cpu_fps = sealMetric(s.cpu_fps, { gated: true, paced: true, flag: s.cpu_fps_mock_bound, zeroNote: ZERO_MEASURED_FAIL,
405405
extras: { concurrency: s.cpu_fps_concurrency ?? null } });
406406
return rec;
407407
}

‎site/seal.mjs‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ export function makeSource(kind, sweep, build, measuredAt) {
7474
// the raw scalar do not survive onto the returned object except as `value` (present only when honest).
7575
// value : the raw number (or null/undefined when not measured)
7676
// opts.gated : true for a throughput metric (apply the mock-bound honesty rule)
77+
// opts.paced : true when the mock's reference is a PACED TARGET rather than a capacity (the stream
78+
// metrics). Matching it is the gateway keeping up, so a `true` flag is carried as a
79+
// signal instead of suppressing the value. An absent flag still suppresses.
7780
// opts.flag : the raw *_mock_bound sibling (false = certified, true = rig-bound, null/undefined = unverifiable)
7881
// opts.source: the provenance stamp (makeSource)
7982
// opts.extras: extra CERTIFIED-only fields to carry (concurrency, sweep array) - dropped when suppressed
@@ -91,16 +94,27 @@ export function makeSource(kind, sweep, build, measuredAt) {
9194
export const ZERO_NO_CEILING = "no_qualifying_ceiling";
9295
export const ZERO_MEASURED_FAIL = "measured_failure";
9396
export function sealMetric(value, opts = {}) {
94-
const { gated = false, flag, extras = null, zeroNote = ZERO_NO_CEILING } = opts;
97+
const { gated = false, paced = false, flag, extras = null, zeroNote = ZERO_NO_CEILING } = opts;
9598
if (value == null) {
9699
return { value: null, certified: false, suppressed: false, reason: "not_measured" };
97100
}
98101
const num = Number(value);
99102
if (gated) {
100103
// measured-zero: an honest, certified 0 whose NOTE names what the zero means (see zeroNote above).
101104
if (num === 0) return { value: 0, certified: true, suppressed: false, note: zeroNote };
102-
// positive but not certified as gateway-vs-ceiling -> SUPPRESSED, raw number consumed (gone).
103-
if (!(num > 0 && flag === false)) {
105+
// A PACED metric's flag is not a suppression. The mock paces its stream deltas at a fixed
106+
// interval - "the pacing is the model generating tokens", in the mock's own words - so its
107+
// frames/sec is a TARGET rate, c streams x one frame per interval, and not a capacity it ran out
108+
// of. A gateway forwarding every frame as it arrives lands at ~99% of it, which is the best
109+
// possible outcome, and suppressing that threw the number away for the gateways doing best: 24
110+
// of 69 cells in the 2026-07-28 run. The flag stays on the envelope as the signal it always was
111+
// (this gateway matched the paced upstream), and the value is published beside it.
112+
//
113+
// A metric that is gated but NOT paced keeps the old rule exactly: for a saturating throughput
114+
// load the mock's capacity really can be the limit, and publishing then ranks the rig.
115+
// `unverifiable` still suppresses on both paths - an unmeasurable reference tells us nothing
116+
// either way, and certifying a number on no evidence is what the whole gate exists to prevent.
117+
if (paced ? flag == null : !(num > 0 && flag === false)) {
104118
const reason = flag === true ? "mock_bound" : "unverifiable";
105119
return { value: null, certified: false, suppressed: true, reason };
106120
}

‎site/test.mjs‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3189,4 +3189,34 @@ test("freshness guard REFUSES a board it cannot date, rather than passing it", (
31893189
assert.ok(msg, "expected gen-data to THROW on a board with no datable measurement, but it succeeded");
31903190
assert.match(msg, /FRESHNESS FAILURE \(undatable board\)/, `expected the undatable-board failure, got: ${msg}`);
31913191
});
3192+
// ---- a paced target is not a capacity, and the seal has to know the difference ------------------
3193+
// The engine publishing a paced-rate match is worthless if the seal still throws it away: the whole
3194+
// point is that the number reaches the board. This pins both halves of that contract.
3195+
test("seal: matching a PACED upstream publishes the value; matching a CAPACITY still suppresses", () => {
3196+
// Stream metrics: the mock paces deltas, so its frames/sec is the target rate. Reaching it is the
3197+
// gateway keeping up - 24 of 69 cells were deleted for exactly this in the 2026-07-28 run.
3198+
const paced = sealMetric(12275, { gated: true, paced: true, flag: true });
3199+
assert.equal(paced.value, 12275, "a gateway that kept pace must publish its rate");
3200+
assert.equal(paced.certified, true);
3201+
assert.equal(paced.suppressed, false);
3202+
3203+
// Throughput metrics: the mock's capacity really can be the limit, and publishing would rank the
3204+
// rig rather than the gateway. Unchanged.
3205+
const capacity = sealMetric(12275, { gated: true, flag: true });
3206+
assert.equal(capacity.value, null, "a rig-bound throughput number must still be suppressed");
3207+
assert.equal(capacity.suppressed, true);
3208+
assert.equal(capacity.reason, "mock_bound");
3209+
3210+
// An UNMEASURABLE reference suppresses on both paths: it says nothing either way, and certifying a
3211+
// number on no evidence is what the gate exists to prevent.
3212+
for (const opts of [{ gated: true, paced: true }, { gated: true }]) {
3213+
const unverifiable = sealMetric(12275, { ...opts, flag: null });
3214+
assert.equal(unverifiable.value, null, `an unusable reference must suppress (${JSON.stringify(opts)})`);
3215+
assert.equal(unverifiable.reason, "unverifiable");
3216+
}
3217+
3218+
// A clean, comfortably-under-the-ceiling reading is certified on both paths, as it always was.
3219+
assert.equal(sealMetric(500, { gated: true, paced: true, flag: false }).value, 500);
3220+
assert.equal(sealMetric(500, { gated: true, flag: false }).value, 500);
3221+
});
31923222

0 commit comments

Comments
 (0)