scene_pipelines.core.access_markers
Intent markers for SCENE tables: sync authority and write role.
Note
Markers are not enforced by this package. The database administrator sets up grants and sync rules from them.
Read them with sync_authority_of / write_role_of.
SyncAuthority names which database holds the truth for a row:
CENTRAL: the central database (consortium catalogs such asLab). Site -> central verifies and central wins; central -> site overwrites.ORIGIN: the site that acquired the data (subjects, sessions). The site's copy wins; central does not write these tables (enforced by grants, seeWriteRole). The row's provenance stamp records the last writer, not an owner.SHARED: no owner; append-only identities (Deployment). Either direction inserts missing rows and never overwrites.
An unmarked table is ORIGIN. A dj.Part follows its master, and a
row-meta table follows its tracked_table.
WriteRole restricts who may INSERT. ADMIN is a SCENE consortium
administrator; ACQUISITION is a lab's experimenter or acquisition pipeline,
and that marker admits no other role. No marker means unrestricted: admin,
acquisition, and any later role may write. The sync account is not a marker.
WriteRole
mark_sync_authority
mark_sync_authority(authority: SyncAuthority)
Class decorator declaring which database owns this table's rows.
mark_write_role
mark_write_role(role: WriteRole)
Class decorator restricting INSERT to one kind of account.
sync_authority_of
sync_authority_of(table: type) -> SyncAuthority
Return the table's sync authority: its marker, its master's, or ORIGIN.