Repository navigation
Closed
Labels
ready-for-agentFully specified, ready for an AFK agent
Description
Part of #193. Implements the shared-table parts of spec §4 and §11; decisions Definition versus declaration, Open a patch and The tables surface §§ Read surface, Schema revision.
What to build
- The manifest's
usessharedTableentries ({ alias, patchId, table, schemaRevision }, declared by patch id, never by name) are admitted.shared: trueon a definition marks a table shared; marking is additive; unsharing (shared: falseon a defined table) is allowed and reported with the count of declaring patches. - Publish resolves each declaration: the source patch exists in the same company, the publishing user can open it, and the table is shared, else
patch_not_openable; a stamp behind the source's current revision is a warning. shared.list,shared.get,shared.getManyinpackages/apiand the handler map: the read surface oftables.*over the source's indexes, no writes; resolved through the loaded version's manifest to the source's stable id; on every call the viewer must be able to open the source patch and the inventory'ssharedflag must be set, else the whole call isaccess_denied(never null-per-missing).- The catalog, generation and fixtures read a shared table's definition from the source's inventory (
patchy.tables,columns,indexes), never its active manifest, so a table its source omitted stays readable by consumers and keeps its identity by source patch and table. t.ref(uses.contacts)typing lands with ticket 10's builders; here the manifest carries a ref's target as the resolved id.
Admitted at merge
Manifests with sharedTable declarations and shared definitions.
Done when
- A consumer reads a shared table through
shared.*with the source's indexes; after the source unshares, the consumer's next call isaccess_deniedand its own rows are untouched; a source deleted and recreated under the same name does not rebind; rollback of the source never changes sharing. - Publishing a consumer whose stamp is behind warns; one whose source is no longer shared refuses.
getManyon shared ids keeps order and returns null per dangling id while the source stays shared.
Surfaces
The wire, vocabulary (Shared table in Primitives; Declaration in Integrations covers shared tables), docs/product.md § Patches and other patches and § Primitives (shared tables).
Metadata
Metadata
Assignees
Labels
ready-for-agentFully specified, ready for an AFK agent
Activity
feat(primitives): read shared tables across patches
feat(primitives): read shared tables across patches (#216)