test(reconnexion): repro à froid sans état local (@wip) + persistance/pause (@wip)

reconnexion-froide-sans-local = test décisif broker-vs-local (verdict LOCAL-ONLY), @wip. persistance-e2e + pause @wip. rename identifiant dans reconnexion/isolation/harness-ng.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014GbGgNEHRejVKoREvFuDFg
This commit is contained in:
Sylvain Duchesne
2026-07-20 13:16:04 +02:00
parent e326bebd42
commit 3a49376f17
8 changed files with 528 additions and 12 deletions
+5 -5
View File
@@ -356,7 +356,7 @@ function ConnectedHarness() {
// Enumerate the CURRENT account's own protected docs — the read-by-need
// path the APP uses (registration.countUserParticipations →
// listMyEntityDocs), NOT the all-accounts `listEntityDocs` fan-out. Each
// @data scenario runs under a FRESH virtual account (freshScenarioUsername
// @data scenario runs under a FRESH virtual account (freshScenarioIdentifier
// in localStorage), whose participation docs live ONLY in that account's
// protected scope index. The all-accounts fan-out (`allAccounts()`) does
// not surface the fresh account here (its registry record isn't in the
@@ -489,7 +489,7 @@ function ConnectedHarness() {
const priv = `did:ng:${session.private_store_id}`;
const SHIM = 'urn:ng-eventually:shim';
const t0 = Date.now();
// Delete every Account record (and its username/doc* predicates) from the
// Delete every Account record (and its identity/doc* predicates) from the
// anchor graph. `?p ?o` with the `a shim:Account` guard scopes the delete
// strictly to registry triples, leaving anything else in the private
// store intact.
@@ -611,13 +611,13 @@ function ConnectedHarness() {
* (3 docs + SPARQL INSERT), drop the cache, reload from the wallet via
* SPARQL SELECT. Validates: doc_create ×3 + shim sparql_update/query.
*/
async validateShim(username: string) {
async validateShim(identifier: string) {
const reg = await import('../utils/storeRegistry');
reg.resetRegistryCache();
const created = await reg.ensureAccount(username);
const created = await reg.ensureAccount(identifier);
reg.resetRegistryCache();
const reloaded = (await reg.allAccounts()).find(
a => a.id === username,
a => a.id === identifier,
) ?? null;
return { created, reloaded };
},