Skip to content

feat: ms.ExposeTable — producer-side read-only table exposure#125

Merged
I-am-nothing merged 1 commit into
mainfrom
feat/expose-table
Jun 19, 2026
Merged

feat: ms.ExposeTable — producer-side read-only table exposure#125
I-am-nothing merged 1 commit into
mainfrom
feat/expose-table

Conversation

@I-am-nothing

Copy link
Copy Markdown
Contributor

Summary

Producer-side ms.ExposeTable(name) — marks a table eligible for cross-module SELECT. Read-only, tables only (v1). Surfaced in the manifest as a top-level exposes.tables (flat, sorted, de-duplicated name list).

Trust model (settles the axis #95 was closed over): no publisher-controlled readableBy allowlist. The producer only marks eligibility; the app owner is the trust root and decides who reads by installing the depending module. Pairs with the existing consumer side ms.DependsOn(x).Table(name).

What's in it

  • internal/registry: AddExposedTable (set-union dedup) + ExposedTables() (sorted, non-nil clone — deterministic manifest)
  • internal/core/expose.go: (m *Module).ExposeTable + package-level facade (panics before Init, mirrors Emits/Cron)
  • system/manifest.go: always-present exposes block → {"exposes":{"tables":[...]}}
  • mirrorstack.go: public ms.ExposeTable facade with the full trust-model doc comment
  • 13 unit tests (dedup/sort determinism, exact manifest wire shape, facade behavior); VERSION 0.2.4→0.2.5 + CHANGELOG

Notes

  • This is the SDK declaration only — schema-agnostic (emits names). The platform side (publish storage + install-time validate/consent/GRANT SELECT) lands in a separate api-platform PR.
  • Part of Milestone F (cross-module table reads).

🤖 Generated with Claude Code

Producer-side declaration ms.ExposeTable(name) marking a table eligible for
cross-module SELECT. Read-only, tables only (v1). No per-consumer readableBy
allowlist (the publisher-controlled model rejected in #95) — the producer
marks eligibility; the app owner is the trust root and decides who reads by
installing the depending module.

- registry: AddExposedTable (set-union dedup) + ExposedTables() (sorted clone)
- core/expose.go: (m *Module).ExposeTable + package-level facade
- manifest: always-present exposes.tables block, from reg.ExposedTables()
- mirrorstack.go: public ms.ExposeTable facade
- 13 unit tests (dedup/sort determinism, manifest wire shape, facade panics)
- VERSION 0.2.4->0.2.5 + CHANGELOG entry

Part of Milestone F (cross-module table reads). Platform side (publish storage
+ install validate/consent/GRANT) lands in api-platform separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@I-am-nothing I-am-nothing merged commit 8596f8b into main Jun 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant