Skip to content

sync all 28 modules to constructive-db's source, lockstep 0.39.0 - #115

Merged
pyramation merged 2 commits into
mainfrom
feat/sync-constructive-db-catalog-assertions
Aug 7, 2026
Merged

sync all 28 modules to constructive-db's source, lockstep 0.39.0#115
pyramation merged 2 commits into
mainfrom
feat/sync-constructive-db-catalog-assertions

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

constructive-db/pgpm-modules/* and packages/* here are the same 28 modules and had drifted: constructive-db carried the newer source, this tree carried the higher version numbers. This mirrors constructive-db's source back into the published packages and puts both trees on one version.

The drift is not incidental — the vendored copy replaced the whole verification vocabulary. Every verify/ script here still calls the string-addressed wrappers; constructive-db asserts against catalog identities:

-SELECT verify_domain('public.upload');
+CALL assert_domain('public.upload'::regtype, 'jsonb'::regtype, _constraints => 1);

That is only expressible with the pgpm-verify in constructive-db (0.38.0, ahead of this tree's 0.36.0 line), so pgpm-verify's 19 verify_*/list_*/get_*_from_str procedures are replaced by 16 assert_* procedures, and all 27 other modules' verify/ trees are rewritten onto them. Cross-module pgpm.plan requires that pinned pgpm-verify:@0.1.0 now name a change, pgpm-verify:procedures/assert_function.

Deploy-source changes carried over, beyond the verify rewrite:

  • function-resolution — resolution now answers from the published catalog plane in one static read (catalog_location is dropped), plus a whole capability-resolution surface: frame_candidates, resolve_bucket, resolve_api, resolve_payload_refs, resolve_capabilities, bucket_catalog_row, api_catalog_row, bound_bucket_id, validate_capabilities.
  • app-scope — new projected_parent; frames yields the tenant's own database frame before falling through to the platform database.
  • metaschema-modulesscope_types_module and user_settings_security_module tables.
  • object-storenode_hash_uuid and a set-based insert_nodes_at_paths.
  • object-treeset_many_and_commit.
  • partmanafter_delete_partition trigger that unparents metaschema partition rows.
  • totp — NUL-safe base32 decode path.
  • revert/ across every module drops objects by exact identity instead of by name.

Version rule

Lerna fixed-mode lockstep, one minor bump above the highest version present in either tree. The vendored pgpm-verify was at 0.38.0 — ahead of this tree — so 0.37.0/0.38.0 were unavailable and everything goes to 0.39.0, including errors, which the vendored copy still had at 0.0.1. pgpm sync-versions propagated it into each .control default_version and Makefile DATA, and regenerated sql/<name>--0.39.0.sql + .bundle.tar.gz from deploy/. Nothing generated was hand-edited; the bundles are byte-identical to the ones regenerated in constructive-db from the same sources (constructive-io/constructive-db#2858), which is the check that the two trees really are in sync.

Where this tree was ahead, and kept

kept from here why
defaults/__tests__ moved here deliberately in constructive-db@a80a95bc093 — constructive-db's workflows never run pgpm-modules/** suites. Its snapshot is also the correct one (default_func_acl_count: 1 after the PUBLIC-execute revoke); the vendored snapshot still said 2 and is fixed downstream.
metaschema-modules snapshot vendored snapshot predates pages_module; refreshed here for the two new module tables instead.
app-scope, function-resolution READMEs no vendored counterpart; copied downstream.

Test infrastructure

Two changes were needed for the synced suites to run at all:

  • pgsql-test ^5.4.1^5.10.6. 5.4.1 resolves @pgpmjs/core@7.9.0, which ignores extensions.json's schema/createSchema (as AGENTS.md notes for the pgpm 4 CLI), so pg_partman installed without its partman schema and the new partman suite died in beforeAll with schema "partman" does not exist.
  • inflection-db's jest config pointed ts-jest at a tsconfig.json that no package in the workspace has, and its @ts-expect-error for jest-in-case is unused now that the types resolve. That suite has never run in either tree; it now passes with 29 tests.
  • pnpm-workspace.yaml regenerated by pnpm-policy for the new first-party transitive (git-changed).

Per-package inventory

Counts are source files only (sql/ excluded). "tests: N changed" is the constructive-testpgsql-test import swap unless the package is listed above; that import is the one legitimately tree-specific difference left between the trees.

package direction source drift resolved old (db / upstream) new
achievements db → upstream verify: 15 changed; revert: 7 changed; tests: 2 changed 0.33.0 / 0.36.0 0.39.0
app-scope db → upstream · README upstream → db deploy: 2 changed, 1 added; verify: 7 changed, 1 added; revert: 6 changed, 1 added; plan: 1 changed; tests: 1 changed; other: 1 removed 0.33.1 / 0.36.0 0.39.0
base32 db → upstream verify: 3 changed; revert: 2 changed; tests: 2 changed 0.33.0 / 0.36.0 0.39.0
database-jobs db → upstream verify: 40 changed; revert: 24 changed; plan: 1 changed; tests: 1 changed 0.33.1 / 0.36.0 0.39.0
defaults db → upstream (tests kept upstream) · snapshot upstream → db tests: 2 changed 0.33.0 / 0.36.0 0.39.0
encrypted-secrets db → upstream verify: 13 changed; revert: 11 changed; tests: 1 changed 0.33.0 / 0.36.0 0.39.0
encrypted-secrets-table db → upstream verify: 3 changed; revert: 1 changed; tests: 1 changed 0.33.0 / 0.36.0 0.39.0
errors db → upstream metadata only 0.0.1 / 0.36.0 0.39.0
faker db → upstream verify: 4 changed; revert: 1 changed; tests: 1 changed 0.33.0 / 0.36.0 0.39.0
function-resolution db → upstream · README upstream → db deploy: 4 changed, 9 added, 1 removed; verify: 6 changed, 9 added, 1 removed; revert: 5 changed, 9 added, 1 removed; plan: 1 changed; tests: 3 changed, 3 added; other: 1 removed 0.33.1 / 0.36.0 0.39.0
geotypes db → upstream verify: 4 changed; tests: 1 changed 0.33.0 / 0.36.0 0.39.0
inflection db → upstream verify: 19 changed; revert: 14 changed; tests: 1 changed 0.33.0 / 0.36.0 0.39.0
inflection-db db → upstream verify: 15 changed; revert: 14 changed; plan: 1 changed; tests: 1 changed 0.33.0 / 0.36.0 0.39.0
jobs db → upstream verify: 36 changed; revert: 20 changed; plan: 1 changed; tests: 1 changed 0.33.0 / 0.36.0 0.39.0
jwt-claims db → upstream verify: 19 changed; revert: 16 changed; tests: 1 changed 0.33.0 / 0.36.0 0.39.0
ltree-helpers db → upstream verify: 4 changed; revert: 3 changed 0.33.0 / 0.36.0 0.39.0
measurements db → upstream verify: 2 changed; tests: 1 changed 0.33.0 / 0.36.0 0.39.0
metaschema-modules db → upstream · snapshot upstream → db deploy: 3 changed, 2 added; verify: 33 changed, 2 added; revert: 2 added; plan: 1 changed; tests: 2 changed 0.33.1 / 0.36.0 0.39.0
metaschema-schema db → upstream verify: 29 changed; revert: 4 changed; tests: 1 changed 0.33.1 / 0.36.0 0.39.0
object-store db → upstream deploy: 2 changed, 2 added; verify: 24 changed, 2 added; revert: 17 changed, 2 added; plan: 1 changed; tests: 5 changed, 1 added 0.33.1 / 0.36.0 0.39.0
object-tree db → upstream deploy: 1 changed, 1 added; verify: 10 changed, 1 added; revert: 4 changed, 1 added; plan: 1 changed; tests: 8 changed, 1 added; other: 1 changed 0.33.1 / 0.36.0 0.39.0
partman db → upstream deploy: 1 added; verify: 5 changed, 1 added; revert: 6 changed, 1 added; plan: 1 changed; tests: 1 added 0.34.0 / 0.36.0 0.39.0
stamps db → upstream verify: 2 changed; revert: 1 changed; tests: 1 changed 0.33.0 / 0.36.0 0.39.0
totp db → upstream deploy: 1 changed; verify: 4 changed; revert: 3 changed; tests: 2 changed 0.33.0 / 0.36.0 0.39.0
types db → upstream verify: 7 changed; tests: 3 changed 0.33.0 / 0.36.0 0.39.0
utils db → upstream verify: 5 changed; revert: 4 changed; tests: 1 changed 0.33.0 / 0.36.0 0.39.0
uuid db → upstream verify: 5 changed; revert: 4 changed 0.33.0 / 0.36.0 0.39.0
verify db → upstream deploy: 16 added, 19 removed; verify: 16 added, 19 removed; revert: 16 added, 19 removed; plan: 1 changed; tests: 1 added, 1 removed 0.38.0 / 0.36.0 0.39.0

No genuine semantic conflicts were found: every difference was one side being stale, and each is attributed above.

Verification

All 28 packages' suites pass locally against postgres-plus:18 (errors, ltree-helpers and uuid have none): 449 tests. npx eslint . and pnpm policy:check clean.

Follow-up: bucket_id on the upload/image domains (constructive-planning#1476/#1477) is a separate PR on top of this one.

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

….39.0

constructive-db carries the newer source for all 28 shared modules; this mirrors
it back into the published copies, then reconciles versions so the two trees
agree.

Direction per package is constructive-db -> here for every deploy/revert/verify
source and plan, with three exceptions where this tree was ahead and is kept:
pgpm-defaults' jest suite (moved here deliberately in constructive-db@a80a95bc093
because its workflows never run pgpm-modules/** suites), the app-scope and
function-resolution READMEs (no vendored counterpart), and the
metaschema-modules snapshot, which is refreshed here for the two new module
tables rather than taken from the stale vendored copy.

Headline source changes carried over:

- pgpm-verify: the verify_* wrappers are replaced by catalog assertions with
  typed identities (assert_table/_view/_index/_trigger/_policy/_schema/_type/
  _domain/_function plus the grant and security assertions), and every module's
  verify/ scripts are rewritten onto them. verify_domain('public.upload')
  becomes assert_domain('public.upload'::regtype, 'jsonb'::regtype,
  _constraints => 1). Cross-module plan requires that pointed at
  pgpm-verify:@0.1.0 now name pgpm-verify:procedures/assert_function.
- revert/ across every module drops each created object by its exact identity.
- app-scope: projected_parent, and frames resolves the tenant's own database
  frame before the platform fall-through.
- function-resolution: resolution answers from the published catalog plane in
  one static read (catalog_location is gone), plus the capability-resolution
  surface (frame_candidates, resolve_bucket/_api/_capabilities/_payload_refs,
  bucket/api catalog rows, bound_bucket_id, validate_capabilities).
- metaschema-modules: scope_types_module and user_settings_security_module.
- object-store: node_hash_uuid + set-based insert_nodes_at_paths.
- object-tree: set_many_and_commit.
- partman: after_delete_partition unparents metaschema partition rows.

Version rule: lerna fixed-mode lockstep, one minor bump above the highest
version present in either tree (the vendored pgpm-verify was at 0.38.0, ahead of
this tree's 0.36.0 line), so every module - including errors, which the vendored
copy still had at 0.0.1 - becomes 0.39.0. sync-versions propagated it to each
.control default_version and Makefile DATA, and every sql/ artifact was
regenerated from deploy/ with pgpm package; the bundles are byte-identical to
the ones regenerated in constructive-db from the same sources.

Test infrastructure, needed for the synced suites to run at all:

- pgsql-test ^5.4.1 -> ^5.10.6: 5.4.1 resolves @pgpmjs/core 7.9.0, which ignores
  extensions.json's schema/createSchema, so pg_partman landed without its
  partman schema and the new partman suite could not deploy.
- inflection-db's jest config pointed ts-jest at a tsconfig.json no package has,
  and its @ts-expect-error for jest-in-case is unused now that the types are
  installed; that suite has never run in either tree and now passes (29 tests).
- pnpm-workspace.yaml regenerated by pnpm-policy for the new first-party
  transitive (git-changed).

All 28 packages' suites pass locally (errors, ltree-helpers and uuid have none).
@pyramation pyramation self-assigned this Aug 7, 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

@socket-security

socket-security Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpgsql-test@​5.10.77510010098100

View full report

…e deployed functions

The message argument is defaulted, so regprocedure lookup and DROP FUNCTION
must spell the full argument list.
@pyramation
pyramation merged commit 08e9673 into main Aug 7, 2026
25 checks passed
@pyramation
pyramation deleted the feat/sync-constructive-db-catalog-assertions branch August 7, 2026 23:31
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