testing: replace the live-contract gate with timestampGranularity capability + peer-mention + readiness/drain fixes (comms-e5vm.10) - #18
Merged
Conversation
…drain-until-match event tests (comms-e5vm.10) Replaces PR #13's blanket coarseTimestamps/noSelfEventDelivery gate with the triaged fixes: - T1: AgentComms.capabilities.timestampGranularity (memory Duration.zero, zulip Duration.seconds(1)) — the message-ordering resolution a consumer must space posts by. contract.ts postSpaced() respaces the 4 range/replay fixtures off it; both run at full strength on the live realm. coarseTimestamps gone. - T2: the subscribe-readiness test's inline 2s swapped for a generous shared EVENT_DELIVERY_DEADLINE — the own-post arrives, just later than 2s live. - Event-delivery tests drain-until-match (awaitEvent) instead of positional Queue.take, so a duplicate/gap-replayed message-posted under 429 load no longer breaks a positional assertion. noSelfEventDelivery gone; the peer-mention rewrite (ContractEnv.peerPost, memory peerPost affordance, live peer-bound adapter) lands the cross-identity shape. The peer-mention TESTS' final form is pending a Graeme ruling on the minter-owned-queue mention-floor limit (live Zulip surfaces a bound bot's mention only in queue mode 'all'); held separately. bun run check green (866 tests); T1+T2 validated on the live realm.
…m.10, ruling A)
Live Zulip surfaces a bound bot's own mention only when its events queue is
in mode 'all' — which a channel subscription sets, not the acquire-time /
subscribe('mentions') narrow (the queue is minter-owned and is:mentioned is
keyed to the owner). So the two peer->self mention tests subscribe self to the
channel before the peer posts, mirroring realm.live.test.ts's observer!=sender
proof. The bare mention floor (no channel subscribe) holds on Memory but not
yet on Zulip; comms-9usb tracks restoring it cross-substrate (per-bot queue),
after which the channel subscribe becomes unnecessary.
bun run test:live now reports 60 pass / 0 fail — clean green, no gated-off
holdouts. T1 (timestampGranularity respacing), T2 (readiness deadline), and the
drain-until-match event tests all validated on the live realm alongside this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces PR #13's blanket live-contract gate (the
coarseTimestamps+noSelfEventDeliveryContractEnv flags) with the three triaged fixes fromcomms-e5vm.10, restoring real live coverage instead of skips.
Treatments
Coarse timestamps → a port capability.
AgentComms.capabilities.timestampGranularity(the resolution of the message-ordering model): Memory reports
Duration.zero(its
tsis a monotonic counter), Zulip reportsDuration.seconds(1)(integerepoch seconds). The contract's
postSpacedhelper spaces the 4 range/replayfixtures by one granularity unit, so they run at full assertion strength on
both substrates. The
coarseTimestampsgate is gone. (Production rationale:the gap-replay watermark dedups on
ts, so "tsis not a unique key below thisresolution" is knowledge a consumer should consult, not only a test concern.)
Readiness timing. The subscribe→post→observe test's inline 2s timeout
became a generous shared
EVENT_DELIVERY_DEADLINE— the own-post arrives onthe live realm, just later than 2s.
Self-mention → peer-mention. The two mention-floor tests now have a seeded
peer post the @-mention (sender ≠ self) via a new
ContractEnv.peerPosthook (Memory injects a peer-authored message; Zulip posts through a peer-bound
adapter). Self subscribes the channel (queue mode 'all') so the mention
surfaces on live Zulip, where a bound bot's minter-owned events queue only
surfaces its own mentions in mode 'all'. The bare floor (mention without a
channel subscribe) holds on Memory but not yet on Zulip; comms-9usb tracks
restoring it cross-substrate. The
noSelfEventDeliveryflag is gone.Also
drain-until-match (
awaitEvent) instead of positionalQueue.take, so aduplicate / gap-replayed
message-postedunder 429 rate-limiting can't break apositional assertion (this was an intermittent live failure under load).
capabilitiesfield is filled with an inert default at thecompleteAsSubstratetest seam for the above-port MCP fakes.Validation
bun run checkgreen (866 tests).bun run test:liveagainst a real Zulip realm: 60 pass / 0 fail — cleangreen, no gated-off holdouts.
realm.live.test.tsis unchanged; the fold-in is comms-e5vm.6.