1- # Migrate samod: ` quarto-dev/samod@q2 ` → ` shikokuchuo /samod@access-policy`
1+ # Migrate samod: ` quarto-dev/samod@q2 ` → ` quarto-dev /samod@access-policy`
22
33## Overview
44
55Our vendored samod fork is moving from ** ` quarto-dev/samod ` branch ` q2 ` **
6- (samod ` 0.9.0 ` , automerge ` 0.8.0 ` ) to ** ` shikokuchuo/samod ` branch
7- ` access-policy ` ** (samod ` 0.12.1 ` , automerge ` 0.10.0 ` ).
6+ (samod ` 0.9.0 ` , automerge ` 0.8.0 ` ) to the ** ` access-policy ` branch**
7+ (samod ` 0.12.1 ` , automerge ` 0.10.0 ` ).
8+
9+ > ** Fork location.** The ` access-policy ` branch was developed on the
10+ > ` shikokuchuo/samod ` fork and later relocated to its canonical long-term home
11+ > at ** ` quarto-dev/samod ` ** (same commit, same branch). The dependency now
12+ > points at ` quarto-dev/samod ` branch ` access-policy ` ; earlier phase entries and
13+ > commits below that mention ` shikokuchuo/samod ` are the historical record of
14+ > the interim location. See "Post-migration follow-ups".
815
916The new fork = upstream samod ` 0.12.1 ` + a fresh "Implement access policy"
1017commit. The * only* thing the old ` q2 ` branch carried on top of its base was
@@ -236,8 +243,10 @@ the Rust test suite cannot cover on its own.
236243
237244## References
238245
239- - New fork : ` shikokuchuo /samod` branch ` access-policy ` , samod ` 0.12.1 ` /
246+ - Fork : ` quarto-dev /samod` branch ` access-policy ` , samod ` 0.12.1 ` /
240247 samod-core ` 0.12.0 ` / automerge ` 0.10.0 ` . Access-policy commit ` c5a06c3 ` .
248+ (Developed on ` shikokuchuo/samod ` ; relocated to ` quarto-dev/samod ` — same
249+ commit — as the canonical home. See "Post-migration follow-ups".)
241250- Old fork: ` quarto-dev/samod ` branch ` q2 ` , rev ` 0b50c16 ` ("Implement access
242251 policy" on samod ` 0.9.0 ` / automerge ` 0.8.0 ` ).
243252- samod CHANGELOG (0.9→0.12): automerge 0.8→0.10; added ` Repo::search ` /
@@ -246,3 +255,32 @@ the Rust test suite cannot cover on its own.
246255- Consumers: `crates/quarto-hub/src/{access_policy,context,server,sync,index,
247256 sync_state,resource,automerge_api_tests}.rs`,
248257 ` crates/quarto-preview/src/capture_driver.rs ` .
258+
259+ ## Post-migration follow-ups
260+
261+ Discovered during review of the migration branch, after the Phase 0–6 work
262+ above landed as ` bfcee64f ` :
263+
264+ - [x] ** Audit-log dedup (` d1935ec7 ` ).** samod 0.12 consults the access policy
265+ * synchronously on every inbound sync message* (three gates in
266+ ` samod-core/hub/state.rs ` ; the inbound ` handle_doc_message ` gate is
267+ un-memoized), whereas samod 0.9 memoized the check per ` (peer, doc) `
268+ connection (` AccessPolicyState ` ). ` AuditAccessPolicy ` logged
269+ unconditionally, so a single document open emitted 2–3 identical
270+ "Document accessed" lines. Restored once-per-` (peer, doc) ` semantics with
271+ a dedup ` HashSet ` in ` AuditAccessPolicy ` , pruned per-peer on disconnect
272+ via ` forget_peer ` (called from ` server.rs ` 's ` ClientDisconnected ` arm next
273+ to the existing ` peer_emails ` removal). Three tracing-capture tests cover
274+ dedup, per-doc distinctness, and re-log-after-forget. Full workspace green
275+ (9859 passed).
276+
277+ - [x] ** Fork relocated to ` quarto-dev/samod ` (` 46f1da95 ` ).** The ` access-policy `
278+ branch was pushed to ` quarto-dev/samod ` (same commit ` c5a06c39 ` ); the
279+ ` git = … ` source in both ` crates/quarto-hub/Cargo.toml ` and
280+ ` crates/quarto-preview/Cargo.toml ` now points there instead of
281+ ` shikokuchuo/samod ` . The ` Cargo.lock ` change is exactly the two samod
282+ ` source = ` lines — verified with ` cargo check --locked ` that no
283+ re-resolution (e.g. transitive ` windows-sys ` churn) is needed; a stray
284+ ` cargo update -p samod ` had incidentally normalized 11 unrelated
285+ Windows-only ` windows-sys ` edges, which was reverted to keep the diff
286+ minimal.
0 commit comments