diff --git a/experiments/collector/README.md b/experiments/collector/README.md index 36ff964..a02a08d 100644 --- a/experiments/collector/README.md +++ b/experiments/collector/README.md @@ -86,6 +86,14 @@ Every observed body is compared to its submitted event, and every non-saturation case must account for all committed event IDs. Saturation requires both positive commits and independently observed loss relative to local evidence. +The saturation observer additionally requires the first submitted event (the +seed held at the receiver before pressure is applied) in both observed attempts +and backend commits. A different event cannot satisfy that identity check. +Additional pressure-event commits, duplicate attempts and reordered observations +remain allowed as long as the existing bounded-loss condition holds. The focused +observer controls exercise missing, substituted and reordered seed identities; +the historical pipeline runs below predate this strengthened assertion. + The TypeScript experiment emitter now passes the normalized event timestamp to the OTel SDK as an integer seconds/nanoseconds pair. This is experiment wiring, not a change to the reference SDK or a claim about all exporters/backends. diff --git a/experiments/collector/fidelity.py b/experiments/collector/fidelity.py index d72d0e1..e670ae4 100644 --- a/experiments/collector/fidelity.py +++ b/experiments/collector/fidelity.py @@ -37,6 +37,11 @@ def check_delivery(mode, events, evidence_count, attempts, commits): if mode == "queue_saturation": if not 0 < len(set(commits)) < len(events): raise AssertionError("expected bounded queue loss was not independently observed") + # The runner blocks the first submitted request before applying pressure. + # A different committed event cannot stand in for that seeded request. + seed = ids[0] + if seed not in attempts or seed not in commits: + raise AssertionError("saturation seed was not observed and committed") elif set(commits) != set(ids): raise AssertionError("a submitted event did not commit") if mode == "reorder": diff --git a/experiments/collector/test_fidelity.py b/experiments/collector/test_fidelity.py index dc0c73f..8891d0e 100644 --- a/experiments/collector/test_fidelity.py +++ b/experiments/collector/test_fidelity.py @@ -64,3 +64,23 @@ def test_saturation_requires_observed_loss_with_positive_commits(self): for commits in ([], ['one', 'two']): with self.subTest(commits=commits), self.assertRaises(AssertionError): check_delivery('queue_saturation', events, 2, commits, commits) + + def test_saturation_requires_seed_identity_in_attempts_and_commits(self): + events = [self.event, {**self.event, 'event_id': 'two'}, + {**self.event, 'event_id': 'three'}] + for attempts, commits in ((['one'], ['one']), + (['two', 'one', 'one'], ['two', 'one'])): + with self.subTest(attempts=attempts, commits=commits): + check_delivery('queue_saturation', events, 3, attempts, commits) + for attempts, commits in ((['two'], ['two']), + (['one', 'two'], ['two']), + (['two'], ['one'])): + with self.subTest(attempts=attempts, commits=commits): + with self.assertRaisesRegex(AssertionError, 'saturation seed'): + check_delivery('queue_saturation', events, 3, attempts, commits) + + def test_saturation_seed_is_first_input_not_a_fixed_identifier(self): + events = [{**self.event, 'event_id': 'two'}, self.event] + check_delivery('queue_saturation', events, 2, ['two'], ['two']) + with self.assertRaisesRegex(AssertionError, 'saturation seed'): + check_delivery('queue_saturation', events, 2, ['one'], ['one'])