Skip to content

testing: replace the live-contract gate with timestampGranularity capability + peer-mention + readiness/drain fixes (comms-e5vm.10) - #18

Merged
GraemeF merged 2 commits into
mainfrom
comms-e5vm.10
Jun 14, 2026
Merged

GraemeF merged 2 commits into
mainfrom
comms-e5vm.10

Conversation

@GraemeF

@GraemeF GraemeF commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Replaces PR #13's blanket live-contract gate (the coarseTimestamps +
noSelfEventDelivery ContractEnv flags) with the three triaged fixes from
comms-e5vm.10, restoring real live coverage instead of skips.

Treatments

  1. Coarse timestamps → a port capability. AgentComms.capabilities.timestampGranularity
    (the resolution of the message-ordering model): Memory reports Duration.zero
    (its ts is a monotonic counter), Zulip reports Duration.seconds(1) (integer
    epoch seconds). The contract's postSpaced helper spaces the 4 range/replay
    fixtures by one granularity unit, so they run at full assertion strength on
    both substrates. The coarseTimestamps gate is gone. (Production rationale:
    the gap-replay watermark dedups on ts, so "ts is not a unique key below this
    resolution" is knowledge a consumer should consult, not only a test concern.)

  2. Readiness timing. The subscribe→post→observe test's inline 2s timeout
    became a generous shared EVENT_DELIVERY_DEADLINE — the own-post arrives on
    the live realm, just later than 2s.

  3. Self-mention → peer-mention. The two mention-floor tests now have a seeded
    peer post the @-mention (sender ≠ self) via a new ContractEnv.peerPost
    hook (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 noSelfEventDelivery flag is gone.

Also

  • Event-delivery robustness: the positive event-delivery assertions now
    drain-until-match (awaitEvent) instead of positional Queue.take, so a
    duplicate / gap-replayed message-posted under 429 rate-limiting can't break a
    positional assertion (this was an intermittent live failure under load).
  • The new port capabilities field is filled with an inert default at the
    completeAsSubstrate test seam for the above-port MCP fakes.

Validation

  • bun run check green (866 tests).
  • bun run test:live against a real Zulip realm: 60 pass / 0 fail — clean
    green, no gated-off holdouts.

realm.live.test.ts is unchanged; the fold-in is comms-e5vm.6.

GraemeF added 2 commits June 13, 2026 12:52
…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.
@GraemeF
GraemeF merged commit 55247a1 into main Jun 14, 2026
2 checks passed
@GraemeF
GraemeF deleted the comms-e5vm.10 branch June 14, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant