Skip to content

feat: rework capability IDs for stack-agnostic canonical naming - #20

Closed
grdsdev wants to merge 2 commits into
feat/add-capabilities-cleanfrom
feat/capability-naming-rework
Closed

grdsdev wants to merge 2 commits into
feat/add-capabilities-cleanfrom
feat/capability-naming-rework

Conversation

@grdsdev

@grdsdev grdsdev commented Jun 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Builds on #19 to address review comments and do a broader naming pass.

PR review comments addressed:

  • Namespace MFA, OAuth server, and admin feature IDs with dot-separated group prefixes (auth.mfa.*, auth.oauth_server.*, auth.admin.*, auth.admin.oauth.*, auth.admin.passkey.*)
  • Merge start_auto_refresh / stop_auto_refresh into a single auth.auto_refresh feature
  • Add database.select_after_mutation for select chained on mutations
  • Move track / untrack / presence_state to a new presence group in realtime
  • Fix JS-specific descriptions (removed navigator.credentials, method name references, service_role key mentions, browser redirect language)

Stack-agnostic naming pass:

  • Auth: auth.resend → auth.resend_confirmation, auth.on_auth_state_change → auth.subscribe_auth_events, auth.reset_password_for_email → auth.reset_password, auth.get_user_identities → auth.list_identities, auth.invite_user_by_email → auth.admin.invite_user
  • Database: all filter IDs prefixed with filter_ (database.eq → database.filter_eq, etc.); database.from → database.from_table; database.rollback → database.dry_run
  • Realtime: realtime.on_heartbeat → realtime.listen_heartbeats; realtime.http_send → realtime.broadcast_http; realtime.set_auth → realtime.set_auth_token
  • Storage: storage.from → storage.access_bucket; storage.index → storage.access_vector_index; storage.list_v2 → storage.list_files_paginated
  • Functions: functions.set_auth → functions.set_auth_token
  • Schema updated to allow multi-segment IDs (auth.mfa.challenge pattern)

Test plan

  • Verify schema validation still passes for all capability files
  • Review naming changes for any missed JS-isms or unclear abstractions

🤖 Generated with Claude Code

grdsdev and others added 2 commits June 12, 2026 06:19
…aming

Addresses review comments on PR #19:
- Namespace MFA, OAuth server, and admin features with dot-separated
  group prefixes (auth.mfa.*, auth.oauth_server.*, auth.admin.*,
  auth.admin.oauth.*, auth.admin.passkey.*)
- Merge auth.start_auto_refresh / auth.stop_auto_refresh into a single
  auth.auto_refresh feature per reviewer suggestion
- Add database.return_modified_data for select chained on mutations
- Move realtime.track/untrack/presence_state to a new presence group
- Remove JS-specific language from descriptions (navigator.credentials,
  method name references, service_role key mentions, browser redirects)

Stack-agnostic naming pass:
- Rename JS method-style IDs: auth.resend → auth.resend_confirmation,
  auth.on_auth_state_change → auth.subscribe_auth_events,
  auth.reset_password_for_email → auth.reset_password,
  auth.get_user_identities → auth.list_identities,
  auth.invite_user_by_email → auth.admin.invite_user
- Rename terse database filter IDs (database.eq → database.filter_eq,
  database.in → database.filter_in, etc.) with descriptive filter_ prefix
- Rename database.from → database.from_table,
  database.schema → database.schema_selection,
  database.rollback → database.dry_run,
  database.range (pagination) → database.paginate (avoids conflict with
  range filter family)
- Rename realtime.on_heartbeat → realtime.heartbeat_handler,
  realtime.http_send → realtime.broadcast_http,
  realtime.set_auth → realtime.set_auth_token
- Rename storage.from → storage.access_bucket,
  storage.index → storage.access_vector_index,
  storage.list_v2 → storage.list_files_paginated
- Rename functions.set_auth → functions.set_auth_token
- Update schema to allow dot-segmented IDs (auth.mfa.challenge pattern)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- database.return_modified_data → database.select_after_mutation
- database.paginate → database.range (revert)
- realtime.heartbeat_handler → realtime.listen_heartbeats

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@grdsdev
grdsdev requested a review from mandarini June 12, 2026 09:31
@grdsdev
grdsdev marked this pull request as ready for review June 12, 2026 09:31
@mandarini

mandarini commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Folded into #19 — kept most of this, with a few adjustments

I cherry-pick-merged your rename pass into feat/add-capabilities-clean (just pushed). Keeping this PR open as a record of the deltas. Summary:

Adopted in full

  • All stack-agnostic renames: resend → resend_confirmation, on_auth_state_change → subscribe_auth_events, reset_password_for_email → reset_password, get_user_identities → list_identities, *_by_id → admin.*, delete_factor → delete_mfa_factor, list_factors → list_mfa_factors, filter → raw, regex_match → regex, regex_i_match → regex_icase, ilike_all_of → ilike_all, etc.
  • start_auto_refresh + stop_auto_refresh → auth.session.auto_refresh (single capability).
  • New database.mutate.select_after_mutation.
  • Database method renames: csv → format_csv, geojson → format_geojson, single → single_row, maybe_single → maybe_single_row, max_affected → max_affected_rows, rollback → dry_run, from → from_table, schema → schema_selection.
  • Realtime: on_heartbeat → listen_heartbeats, http_send → broadcast_http, set_auth → set_auth_token. New presence group with track/untrack/presence_state.
  • Storage: from → access_bucket, index → access_vector_index, list → list_files, list_v2 → list_files_paginated, exists → file_exists, info → file_info, update → update_file, upload_to_signed_url → upload_with_signed_url.
  • Functions: set_auth → set_auth_token.
  • Group renames: auth-admin → admin, auth-mfa → mfa.

Diverged

Uniform 3-segment IDs — we keep every feature at exactly three segments (area.namespace.method); your mix of 2-seg and 4-seg got normalized:

  • Your flat auth.sign_up / auth.sign_in_with_password / etc. → auth.sign_in.sign_up / auth.sign_in.sign_in_with_password (kept the sign-in group as a namespace).
  • Same for passkey, session, identities groups.
  • Your 4-seg auth.admin.oauth.create_client / auth.admin.passkey.delete → 3-seg parallel namespaces auth.oauth_admin.create_client / auth.passkey_admin.delete_passkey. Reasoning: keeps depth consistent, and the namespace already conveys the grouping signal.

Filter prefix — you used flat database.filter_eq. With our using_filters namespace, the filter_ prefix is redundant, so it's database.using_filters.eq.

Schema regex — kept strict 3-segment (`^[a-z][a-z0-9_]*.[a-z0-9_]+.[a-z0-9_]+$`) instead of your relaxed `(.X)+` so depth stays uniform.

Realtime removals — kept subscribe/unsubscribe/connect/disconnect/remove_channel (documented user-facing methods). Dropped only push (low-level Phoenix internal) and the is_connected/is_connecting/is_disconnecting state queries.

@mandarini
mandarini force-pushed the feat/add-capabilities-clean branch from 34d6881 to 3722842 Compare June 12, 2026 12:14
@grdsdev grdsdev closed this Jun 12, 2026
@grdsdev
grdsdev deleted the feat/capability-naming-rework branch June 17, 2026 15:03
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.

2 participants