test(editor): pin Home repoint as a document departure — RED at ca265d3
CI / ci (push) Canceled after 0s
CI / ci (push) Canceled after 0s
PostsModelRepointTests (6 pins over a two-Home same-slug rig,
projects/posts/shared/post.md in both libraries): the gate runs
before anything changes (failed flush, unanswered #67, never-loaded
retype — sessionMayDepart's three legs), the same-slug piece opens
from B and saves there (flush AND quit), a no-collision repoint lands
the dirty buffer before tearing down, and a pass started after the
repoint runs against the new library.
RED at ca265d3bd3 on the rail
(-only-testing:MuseionTests/PostsModelRepointTests): 6 executed /
0 passed / 6 failed, zero compile errors — each on the finding's
signature: the retained A session under the B binding
(session.text = "A body, typed in A", targets(home: B) false), B's
edits landing on A's disk, watchedHome = B despite a refused flush,
and the no-collision vanish path dropping the dirty buffer.
The tests speak the Settings path as it exists at base (bind), which
has no gate to refuse through; the fix commit moves each repoint call
to the gated entry. EditorSession gains the pure identity predicates
the assertions speak in (targets(postID:home:) / targets(home:)) —
read-only, no behavior change.
This commit is contained in:
1 parent
ca265d3bd3
commit
bce6abb38b
2 files changed
+227
No files matched your search
@@ -63,6 +63,24 @@ final class EditorSession {
|
||||
return nil
|
||||
}
|
||||
|
||||
/// brief-28: document identity — a post session is (Home, ID), never the
|
||||
/// bare id: two libraries can hold the same slug, and only the pair says
|
||||
/// which piece the buffer belongs to. The target is immutable, so the
|
||||
/// Home here is the one the session was BORN under — a model whose
|
||||
/// `watchedHome` moved past it must treat this session as a foreign
|
||||
/// document, not as its own open piece.
|
||||
func targets(postID id: String, home: URL) -> Bool {
|
||||
guard case let .post(mine, myHome) = target else { return false }
|
||||
return mine == id && myHome == home
|
||||
}
|
||||
|
||||
/// brief-28: the Home half alone — does this post session live under
|
||||
/// `home`? External guests never do.
|
||||
func targets(home: URL) -> Bool {
|
||||
guard case let .post(_, myHome) = target else { return false }
|
||||
return myHome == home
|
||||
}
|
||||
|
||||
/// The document's folder — the piece's resolved folder under projects/
|
||||
/// or archive/ for posts (image resolution #71; resolved once at init,
|
||||
/// ADR-0012 — a vanished piece still needs some path, so an unresolvable
|
||||
|
||||
Reference in new issue
Block a user