test: dire exactement ce que le controle e2e mesure, qui est moins qu-il n-y parait

Le controle « une cle qui tombe pour un AUTRE document laisse le scope refuse »
mesure l'ISSUE, pas le ciblage : il ne separe pas « aucune reouverture n'a ete
tentee » de « une a ete tentee et refusee a nouveau », les deux finissant au meme
endroit. Le ciblage se mesure au compte de notifications, dans la suite unitaire.

Nommer ce qu'un controle vert prouve est toute la lecon du tour qui a livre cette
barriere sans aucune couverture de scope nomme.
This commit is contained in:
Sylvain Duchesne
2026-09-21 16:06:26 +02:00
parent f36ed5c164
commit aecb7cf2e8
2 changed files with 16 additions and 8 deletions
+14 -6
View File
@@ -519,14 +519,22 @@ async function main(): Promise<void> {
// That fetch FILED a cap, which fires `CapRegistry.onChange` - the channel a
// refused scope is re-opened on since `1.0.0-dev.9`, because the barrier aborts
// before any query exists and `publish` has nothing to re-filter. It has to be
// TARGETED: this cap says nothing about the protected document, so the refusal
// stands rather than buying a round-trip per cap for the rest of the session.
// The positive direction - the cap for the refused document itself arriving -
// needs a second actor delivering it, and lives in the applicative suite.
// before any query exists and `publish` has nothing to re-filter. This cap says
// nothing about the protected document, so the refusal must stand.
//
// What this measures, exactly, and it is less than it might look: the OUTCOME is
// unchanged. It does not separate "no re-open was attempted" from "one was
// attempted and refused again" - both end here - so the targeting itself is
// measured in the unit suite, by the notification count (`use-shape-query.test.ts`
// (s)). Saying which of the two a green check proves is the whole lesson of the
// round that shipped this barrier with no named-scope coverage at all.
//
// The positive direction - the cap for the refused document ITSELF arriving, and
// the view converging - needs a second actor delivering it, and belongs in the
// applicative suite; `use-shape-query.test.ts` (r) is its unit form.
const afterOtherCap = await sdkGet<any>(frame, "useShapeQuerySnapshot", refused);
check(
"a cap landing for ANOTHER document leaves a refused scope refused, not churning",
"a cap landing for ANOTHER document leaves a refused scope refused",
afterOtherCap.isError && !afterOtherCap.isSuccess && afterOtherCap.dataLen === 0,
`snap=${JSON.stringify(afterOtherCap)}`,
);