// // PostsModelIdentity.swift // Museion // // brief-28 (home-repoint-retains-old-editor-target): document identity for // the open session. Every "is this piece open" question in the model // routes through here — select, the structural rail, the pass guard, the // card refresh, Micropub. The bare `session.postID == id` comparison is // retired: two libraries can hold the same slug, and the id alone matched // a session retained from another library (the repoint finding's seam). // import Foundation extension PostsModel { /// brief-28: is the open session THIS library's piece `id`? Identity is /// (Home, ID) — `watchedHome` is the Home half, so the answer is "the /// buffer belongs to the piece the current library lists under that id". /// A session born under another Home (or an external guest) is never /// the open piece, whatever its id says; nothing bound = nothing open. func openSessionTargets(_ id: String) -> Bool { guard let session, let home = watchedHome else { return false } return session.targets(postID: id, home: home) } }