diff --git a/docs/migration-guide.md b/docs/migration-guide.md index 1cb2500..c768880 100644 --- a/docs/migration-guide.md +++ b/docs/migration-guide.md @@ -47,8 +47,8 @@ The `sharedWalletShim` (account → 3 scope-document NURIs, held in a subscribab doc-shim reached via a write-once pointer in the store-root — see [`nextgraph-current-state.md`](./nextgraph-current-state.md) § *The pointer → doc-shim indirection*) has no target equivalent — the target has no central directory. Remove -it entirely: `store-registry.ts`, `configureStoreRegistry`, the pointer + doc-shim + -migration SPARQL, and the `pointerGuard` dep. Cross-wallet reads replace the fan-out; +it entirely: `store-registry.ts`, `configureStoreRegistry`, the pointer + doc-shim +resolution, and the `pointerGuard` dep. Cross-wallet reads replace the fan-out; per-user wallets replace the shared one. ### 4. Real inbox → drop the in-lib read emulation diff --git a/docs/nextgraph-current-state.md b/docs/nextgraph-current-state.md index 5fdc81a..c61d874 100644 --- a/docs/nextgraph-current-state.md +++ b/docs/nextgraph-current-state.md @@ -264,9 +264,8 @@ document is both (previous section), the shim uses an **indirection**: named doc-shim through its barrier (`ensureRepoOpen`) → read the account AUTHORITATIVELY. First login (no pointer): `doc_create` the doc-shim, publish the pointer, done. A **pointer fork** (two devices each writing a pointer before either -synced) is **benign**: reconcile to the lexicographically-smallest doc-shim NURI -(content-addressed, so every device converges), and no account data is lost — a -non-canonical doc-shim's records are migrated forward on the next resolve. +synced) is reconciled to the lexicographically-smallest doc-shim NURI +(content-addressed, so every device converges on the same doc-shim). **The account-level retry is GONE.** Before this indirection the shim lived directly in the store-root graph, so an account read had no barrier and a cold 0 was ambiguous; @@ -279,12 +278,12 @@ re-read of the **pointer** itself (`pointerGuard`, one write-once triple): it ca NEVER re-provision or fork an account — at worst it takes a couple extra reads to see a pointer that is still landing. -**Migration (no existing account lost).** A wallet whose accounts were written under -the OLD scheme has its `AccountRecord`s in the store-root graph, not a doc-shim. On -resolution, `migrateLegacyRecords` reads that old location best-effort and RE-INSERTS -each legacy record into the doc-shim (copy, not move — the store-root copy is left -inert), BEFORE any "account absent" conclusion. So a legacy account is READ (and made -barrier-authoritative going forward), never re-provisioned into a fork. +**No legacy migration.** A wallet written under the OLD scheme (accounts directly in +the store-root graph, no pointer) is NOT recovered: opening it under the current scheme +simply provisions a fresh doc-shim, and the pre-indirection store-root records are +ignored. This is deliberate — the only such wallets are dev data — so the resolution +path carries no legacy-migration step; it always reads the account authoritatively from +the doc-shim. ### The union is read-only — writes must target one document diff --git a/docs/simulation.md b/docs/simulation.md index dc0fa2f..7ad5223 100644 --- a/docs/simulation.md +++ b/docs/simulation.md @@ -107,7 +107,8 @@ public/protected/private stores — on top of one shared wallet. through its barrier, and reads the account authoritatively — so a fresh reconnecting session never mistakes sync-lag for "account absent" (which would provision a FORK). Full rationale — including why the old account-level retry (`provisionRetry`) is - removed and how legacy store-root records are migrated forward — is in + removed (pre-indirection store-root records are NOT recovered; such wallets are dev + data and simply get a fresh doc-shim) — is in [`nextgraph-current-state.md`](./nextgraph-current-state.md) §§ *Findable vs subscribable* / *The pointer → doc-shim indirection*. This map is the account→document trust root, which is why every untrusted value that reaches its diff --git a/packages/client/src/access-log.ts b/packages/client/src/access-log.ts index 8da8b5b..c761e92 100644 --- a/packages/client/src/access-log.ts +++ b/packages/client/src/access-log.ts @@ -61,12 +61,27 @@ function activeIdentity(): string { return getCurrentUser() ?? "(none)"; } +/** + * Shorten a NURI for the access log: the full form (`did:ng:o::v:<...>`, + * ~100 chars) is too verbose to scan. Drop the `did:ng:o:` prefix and the `:v:<...>` + * overlay suffix, and keep the first 8 chars of the RepoID + an ellipsis — short but + * still identifiable (`vDlwbZio…`). A NURI that doesn't match the expected shape is + * returned unchanged (best-effort, this is only a diagnostic label). + */ +export function shortNuri(nuri: string): string { + const withoutPrefix = nuri.replace(/^did:ng:o:/, ""); + const repoId = withoutPrefix.split(":v:")[0] ?? withoutPrefix; + return repoId.length > 8 ? repoId.slice(0, 8) + "…" : repoId; +} + /** * Log one document access — but ONLY when {@link enabled}. Off → returns * immediately, prints nothing. Format: - * `[] READ (