Skip to content

feat: upstream all changes from constructive-db main#74

Merged
pyramation merged 5 commits into
mainfrom
feat/upstream-constructive-db
May 26, 2026
Merged

feat: upstream all changes from constructive-db main#74
pyramation merged 5 commits into
mainfrom
feat/upstream-constructive-db

Conversation

@pyramation

@pyramation pyramation commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Comprehensive sync of all pgpm module source files from constructive-db/pgpm-modules/ (main) to this repo.

metaschema-schema:

  • Add unique index on table_grant (table_id, privilege, grantee_name, COALESCE(field_ids))

metaschema-modules (9 deploy tables updated, 10 verify files fixed):

  • agent_module — add knowledge_config, knowledge_policies, provisions columns
  • billing_module — add meter_sources_table_id/name columns
  • entity_type_provision — storage inference via has_storage boolean, updated comments
  • function_module — add provisions column
  • graph_module — rename exec_object_table_id → outputs_table_id, add provisions
  • inference_log_module — interval/premake → retention + scope
  • namespace_module — add schema names, api names, provisions; remove membership_type
  • storage_module — replace skip_default_policy_tables with provisions column
  • user_auth_module — rename audits_table_name default
  • Verify files aligned: secure_table_provision (nodes), relation_provision (nodes, create_index, expose_in_api), blueprint (remove status/constructed columns), compute_log_module (scope), db_usage_module (table_stats/query_stats renames + scope), inference_log_module (scope), storage_log_module (scope), transfer_log_module (scope), namespace_module (schema/api names + provisions), profiles_module (profile_templates)

database-jobs:

  • Add entity_id column to jobs and scheduled_jobs tables (billing scope)
  • Add entity_id parameter to add_job, add_scheduled_job, run_scheduled_job
  • Update tests: use JWT claims instead of db_id parameter

partman:

  • Grant USAGE/EXECUTE on partman schema to authenticated role

object-tree / object-store:

  • Restore DROP FUNCTION in revert script, update READMEs

Review & Testing Checklist for Human

  • Verify metaschema-modules deploy SQL matches constructive-db main (source of truth)
  • Verify database-jobs entity_id parameter changes work with existing job dispatch
  • Run integration test locally to confirm deploy → verify → revert cycle passes

Notes

Source of truth: constructive-io/constructive-db main branch. The only expected remaining diff is metaschema-schema/pgpm.plan (node_type_registry entries removed from pgpm-modules per PR #73). CI is 24/24 green.

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

Syncs metaschema-schema and metaschema-modules from constructive-db main.

metaschema-schema:
- Add unique index on table_grant (table_id, privilege, grantee_name, field_ids)

metaschema-modules:
- agent_module: add knowledge_config, knowledge_policies, provisions columns
- billing_module: add meter_sources_table_id/name columns
- entity_type_provision: storage inference via presence (remove has_storage),
  updated comments for namespace_events
- function_module: add provisions column
- graph_module: rename exec_object_table_id → outputs_table_id, add provisions
- inference_log_module: add retention default, scope, actor/entity FK columns,
  prefix-aware unique constraint
- namespace_module: add provisions column, remove schema name columns from verify
- storage_module: replace skip_default_policy_tables with provisions column
- user_auth_module: rename audits_table_name default
- Various verify file updates to match new column sets
- relation_provision/secure_table_provision verify updates
… constructive-db

database-jobs:
- Add entity_id column to jobs and scheduled_jobs tables (billing scope)
- Add entity_id parameter to add_job and add_scheduled_job functions
- Forward entity_id in run_scheduled_job
- Update tests with JWT claims setup

partman:
- Grant USAGE/EXECUTE on partman schema to authenticated role

object-tree:
- Add DROP FUNCTION set_props_and_commit to revert script
- Update README

object-store:
- Update README

encrypted-secrets-table:
- Update test snapshot
@devin-ai-integration

Copy link
Copy Markdown

🤖 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 and CI monitoring

database-jobs: update test to use JWT claims instead of db_id parameter
  (add_scheduled_job no longer accepts db_id — reads from jwt.claims)
encrypted-secrets-table: restore uuidv7() snapshot (postgres-plus:18 default)
object-tree: restore DROP FUNCTION set_props_and_commit in revert script
secure_table_provision: node_type/node_data → nodes
relation_provision: node_type/node_data → nodes, add create_index/expose_in_api
blueprint: remove status/constructed_at/error_details/ref_map/constructed_definition
compute_log_module: interval/premake → scope
db_usage_module: rename columns to table_stats_*/query_stats_*, interval/premake → scope
inference_log_module: interval/premake → scope
storage_log_module: interval/premake → scope
transfer_log_module: interval/premake → scope
namespace_module: remove membership_type, add schema names/api names/provisions
profiles_module: remove membership_type, add profile_templates columns
@pyramation pyramation merged commit ede2973 into main May 26, 2026
24 checks passed
@pyramation pyramation deleted the feat/upstream-constructive-db branch May 26, 2026 22:59
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