Skip to content

feat: sync entity_lookup + dynamic scope resolution from constructive-db#1231

Merged
pyramation merged 1 commit into
mainfrom
feat/sync-entity-lookup-scope-resolution
May 27, 2026
Merged

feat: sync entity_lookup + dynamic scope resolution from constructive-db#1231
pyramation merged 1 commit into
mainfrom
feat/sync-entity-lookup-scope-resolution

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Syncs node-type-registry changes from constructive-db PRs #1361 and #1368 into the constructive monorepo. These changes make all Limit*, Event*, Process*, and Billing* generators 100% entity-context-aware.

Changes to 10 limit + event generators:

  • entity_lookup param added to all generators — enables FK-based entity_id resolution (e.g., channel_id → channels.entity_id) when the trigger table doesn't have entity_id directly
  • scope param added to LimitEnforceAggregate, LimitWarningAggregate, LimitWarningRate (previously hardcoded to membership_type 2 or 1)
  • scope enum removed from LimitEnforceCounter, LimitEnforceFeature, LimitWarningCounter — now accepts any provisioned membership type prefix (app, org, data_room, channel, team, etc.) resolved dynamically via memberships_module
  • blueprint-types.generated.ts regenerated with updated param shapes

Files changed: 8 limit generators + 2 event generators + 1 generated types file

Review & Testing Checklist for Human

  • Verify blueprint-types.generated.ts looks correct — should have entity_lookup with {obj_table, obj_schema?, obj_field} shape on all Limit* and Event* param interfaces
  • Confirm scope descriptions no longer have enum: ['app', 'org'] constraint on counter/feature/warning-counter generators
  • Verify new scope param on aggregate/warning-aggregate/warning-rate generators has correct defaults ('org'/'org'/'app')

Notes

The job/trigger.ts and all process/* generators were already synced in a previous session — confirmed identical with constructive-db.

The codegen/generate-types.ts and module-presets/b2b-storage.ts have a separate storage_key → key rename that is unrelated to this work and not included here.

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

Syncs node-type-registry changes from constructive-db PRs #1361, #1368:

- Add entity_lookup param to 10 generators (all limit + event generators)
  for FK-based entity_id resolution (e.g., channel_id → channels.entity_id)
- Add scope param to enforce-aggregate, warning-aggregate, warning-rate
  (previously hardcoded to membership_type 2/1)
- Remove enum constraint on scope — now supports any provisioned type
  (app, org, data_room, channel, team, etc.) via dynamic resolution
- Regenerate blueprint-types.generated.ts with updated param shapes

All Event*, Limit*, Process*, and Billing* node types now support:
- entity_lookup for FK chain resolution
- Dynamic scope for type 3+ membership types
@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 and CI monitoring

@pyramation pyramation merged commit 1bc3aed into main May 27, 2026
37 checks passed
@pyramation pyramation deleted the feat/sync-entity-lookup-scope-resolution branch May 27, 2026 19:41
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