Skip to content

sync: port the capabilities rename and five modules' drift from constructive-db - #119

Merged
pyramation merged 2 commits into
mainfrom
feat/sync-capabilities-and-staging-bucket
Aug 10, 2026
Merged

sync: port the capabilities rename and five modules' drift from constructive-db#119
pyramation merged 2 commits into
mainfrom
feat/sync-capabilities-and-staging-bucket

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

constructive-db vendors these modules under pgpm-modules/ and edits them in place, so the trees drift until someone ports back (last done in #118). This is that port, driven by the platform rename of permissionscapabilities.

I diffed all 30 vendored modules against packages/. Only five have substantive drift; the other 25 differ solely in the test harness import (constructive-test vs pgsql-test) and in bundle artifacts, so they are untouched here.

metaschema-modules — the rename, and it is a rename in place, not an append-only change:

deploy|revert|verify/schemas/metaschema_modules_public/tables/
  permissions_module/      -> capabilities_module/
  data_permissions_field/  -> data_capabilities_field/
every module table with it:
  default_permissions text[]  -> default_capabilities text[]
+ content_preset_module/  email_sender_module/  oauth_requests_module/  file_ref_field/

The four added tables are modules provision_database_modules already accepts; they were only missing here.

function-resolution — the opt-in staging bucket: resolve_staging_bucket + staging_bucket_tag changes and the corresponding resolve_api update.

metaschema-schema / object-store / object-tree — procedure-level fixes (enforce_api_exposure_ratchet, object_category, insert_nodes_at_paths, init_empty_repo, set_and_commit, set_many_and_commit).

Notes for review:

  • Tests were copied from the vendored tree but rewritten back to import { ... } from 'pgsql-test' — the vendored constructive-test import is not upstreamed.
  • sql/*.sql and sql/*.bundle.tar.gz regenerated with pgpm package on 5.23.1 (5.8.0 resolves inside the workspace and silently emits no bundle — it deletes the artifact).
  • metaschema-modules snapshots re-recorded against the ported deploy tree (68 → 71 module tables, 486 → 505 FK constraints). The vendored snapshot was itself stale, so it was not copied verbatim.
  • A release bump is needed before publishing. 0.40.0 is already released and this changes object names inside it.

Verified locally against constructiveio/postgres-plus:18: function-resolution 83/83, object-store 28/28, object-tree 15/15, metaschema-schema 1/1, metaschema-modules 8/8.

Not ported, flagging instead: constructive-db also vendors two modules that do not exist here at all — @pgpm/db-utils and @pgpm/infra-utils, both 0.0.1. They look deliberately platform-local; say the word if they belong upstream.

Link to Devin session: https://app.devin.ai/sessions/8f89acc9280e4cef880921d966e0e8fc
Requested by: @pyramation

…ructive-db

constructive-db vendors these modules and edits them in place, so the two
trees drift until someone ports the changes back (last done in #118).
Five modules had substantive drift; the other 25 differ only in the test
harness import and bundle artifacts.

metaschema-modules carries the rename: permissions_module becomes
capabilities_module and data_permissions_field becomes
data_capabilities_field, default_permissions becomes default_capabilities
on every module table that has it, plus four module tables the platform
already provisions (content_preset, email_sender, oauth_requests,
file_ref_field). function-resolution gains the opt-in staging bucket
(resolve_staging_bucket, staging_bucket_tag). metaschema-schema,
object-store and object-tree carry procedure-level fixes.

Tests keep upstream's pgsql-test import rather than the vendored
constructive-test one. sql/ artifacts regenerated with pgpm package 5.23.1;
metaschema-modules snapshots re-recorded against the ported deploy tree.

A publish needs a version bump: 0.40.0 is already released and these
changes rename objects inside it.
@pyramation pyramation self-assigned this Aug 10, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

…ex name

app-scope's membership test still inserted permissions_table_id /
default_permissions_table_id into memberships_module, which the ported
metaschema-modules renamed; constructive-db's copy of that test was already
updated. Also renames data_capabilities_field's index, which still carried
permissions_module in its name.
@pyramation
pyramation merged commit 28ee748 into main Aug 10, 2026
29 checks passed
@pyramation
pyramation deleted the feat/sync-capabilities-and-staging-bucket branch August 10, 2026 01:30
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