Repository navigation
feat(primitives): read shared tables across patches - #216
Conversation
Astra reviewReviewed StandardsNo merge-blocking method or YAGNI findings. The shared operations reuse the existing row-read implementations and inventory authority; catalog, builders and generation remain with their owning tickets. SpecNo merge-blocking intent findings. Checked declaration admission and refusal, stale-revision warnings, source-indexed reads, whole-call access denial, ordered/dangling Verification: 69 tests passed across five focused offline suites: API schemas, Surface checks covered wire/server/CLI/docs, vocabulary/product and company-resource locking. No migration, seed, package-layout or rendered-page changes required propagation. Summary: Standards: 0 blockers (method 0, YAGNI 0); Spec: 0 blockers (intent 0). No worst issue on either axis. |
Code review — PR 216 vs #200Stacked on #215 ( Issue 200's intent: admit That is what landed. StandardsDocumented standards — no hard violations. Effect service layout / namespace imports / Judgement — Feature Envy + Speculative Generality (
The count is platform Expected: keep the count in Patches; have Tables emit sharing changes; format the caller-visible warning once at record. Require the map or drop the optional. SpecNo spec-axis findings. (a) Missing or partial — none. (b) Scope creep — none that the issue did not require. File-mode detection, optional (c) Implemented but wrong — none. Sharing authority is the live inventory MethodThis is the right method, and it is small. Identity lives on the consumer version ( Publish verifies the id formula and that the source is live / same-company / inventory-shared; it does not rewrite or rebind. Runtime re-checks the formula,
One lock note, not a defect: sharing is snapshotted under the source lock, the lock is dropped, then the SELECT runs. An unshare can commit in that window and the in-flight read still returns rows. Later calls fail. That matches ADR-0009's “then the same indexed row operations,” the same TOCTOU as file blob I/O. YAGNI / beautiful codeRuntime reads are the honest model: two resolvers, one SQL path. Do not unify owned Taste, not merge-blockers:
Surfaces the two axes didn't ownHit-every-surface is otherwise complete (wire, CLI refusal recovery, ADR-0004, skill +
Standards: 1 judgement (worst: |
|
Reviewed the Astra and Grok comments. Neither found blockers. Cheap nits addressed in d871930. Fixed
Kept, with reasons
Verification and disposition
Changes and verification by GPT-6 Astra in Oh My Pi. |
c00628b to
9686b5d
Compare
Admit shared-table declarations, resolve cumulative source inventory at publish and on runtime reads, and report live declaring patches when sharing is removed. Closes #200
d871930 to
c3f8943
Compare
Company admins have no way to connect Postgres databases or publish patches bound to their discovered schemas. Adds secure company connections with encrypted credentials, verified TLS and public-address checks, immutable schema discovery, and publish-time connection/revision checks. The company pages cover the full administration lifecycle. Postgres operations remain deferred to ticket 9. Stacked on #216 (`sdk/200-shared-tables`); this PR targets that branch. Includes the page polish in `df56d39`. Uses migration `0007_integrations_baseline`, after the runtime baseline. Closes #201. Verified on the complete branch, including the page polish: `pnpm test` (540 tests), `pnpm typecheck`, and `pnpm lint`. Implementation and PR prepared with GPT-6 Astra in Oh My Pi; page polish contributed with Claude Fable 5.1. --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
Patches can own tables, but cannot yet read another patch's shared data without copying it.
Admit shared-table declarations and resolve them to stable source identities. Shared reads reuse the source's inventory definitions and indexes, checking access and sharing on every call. Publishing warns about older schema stamps, refuses unavailable sources, and reports affected consumers when a table is unshared. Omitting a table or rolling back its source does not change sharing, and deleting/recreating a patch never rebinds consumers.
Stacked on #215 (
sdk/199-files). This PR targets that branch and should merge after it.Closes #200.
Verification
Implemented with GPT-6 Astra in Oh My Pi.