Skip to content

Consolidate Extensions domain ownership in API - #186

Open
admdly wants to merge 5 commits into
mainfrom
codex/consolidate-extensions-domain-api
Open

Consolidate Extensions domain ownership in API#186
admdly wants to merge 5 commits into
mainfrom
codex/consolidate-extensions-domain-api

Conversation

@admdly

@admdly admdly commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Consolidates the Extensions domain under the API Worker, including the users projection and the complete D1 migration chain.

Changes

  • Add a self-contained API migration baseline for the legacy catalogue and users schema, plus the deleted_at tombstone migration.
  • Model the complete API-owned users table and remove the external-table placeholder.
  • Add authenticated account projection, identity synchronization, profile, deletion, owner-profile, and owned-extension operations.
  • Enforce active-user authorization for domain mutations and preserve OIDC reactivation of deleted subjects.
  • Make account deletion transactional and guarded, including pending-work rejection, PII clearing, disposable ownership cleanup, and audit-history preservation.
  • Expose the non-identifying unclaimed developer field publicly.
  • Keep existing v1/v2 HTTPS endpoints and DB_EXTENSIONS binding.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 5, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
api 8de90f7 Commit Preview URL

Branch Preview URL
Aug 05 2026, 12:18 PM

@admdly admdly self-assigned this Aug 5, 2026
@admdly
admdly marked this pull request as ready for review August 5, 2026 09:32

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 26 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/services/extensions/v2/index.ts
Comment thread src/services/extensions/v2/db/migrations/0000_bootstrap_users.sql
Comment thread src/services/extensions/v2/account-routes.ts
Comment thread src/services/extensions/v2/index.ts
Comment thread src/services/extensions/v2/developer-profile-routes.ts
Comment thread src/services/extensions/v2/public-extensions-routes.ts Outdated
Comment thread src/services/extensions/v2/public-extensions-routes.ts Outdated
Comment thread src/services/extensions/v2/public-extensions-routes.ts Outdated
Comment thread src/services/extensions/v2/account-routes.ts
Comment thread src/services/extensions/v2/public-extensions-routes.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 17 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/services/extensions/v2/index.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Requires human review: Adds D1 schema migrations (0000 bootstrap, 0019 tombstone) and moves DB ownership across repos, plus auth/authorization and API-contract changes (active-account enforcement, identity-sync endpoint, new public unclaimed field). These data and security tradeoffs need human sign-off.

Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 8 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/services/extensions/v2/interfaces.ts">

<violation number="1" location="src/services/extensions/v2/interfaces.ts:141">
P2: A pending legacy submission can still publish the reserved `mine` id and make that extension unreachable through the public detail route, because this guard is bypassed when stored submissions are approved. Applying the reservation check during approval (and covering pending rows in the rollout preflight) would preserve the route contract.</violation>
</file>

<file name="src/services/extensions/v2/index.ts">

<violation number="1" location="src/services/extensions/v2/index.ts:129">
P3: This comment directs readers to "The deployment preflight in README.md" / "rollout preflight", but those rollout/preflight details were removed from README.md in commit 8de90f77 ("Trim rollout details from README") — grep shows README.md no longer mentions the reserved `mine`/`me` ids or any preflight. The comment now points to documentation that doesn't exist, so the operational safeguard (rejecting pre-existing rows with reserved ids before enabling the routes) is only recorded in code comments. Reconcile the two: either restore the preflight guidance to README.md or reword the comment to not cite it.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

})
.strict()
.superRefine((payload, ctx) => {
if (RESERVED_EXTENSION_IDS.has(payload.extension.id)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: A pending legacy submission can still publish the reserved mine id and make that extension unreachable through the public detail route, because this guard is bypassed when stored submissions are approved. Applying the reservation check during approval (and covering pending rows in the rollout preflight) would preserve the route contract.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/services/extensions/v2/interfaces.ts, line 141:

<comment>A pending legacy submission can still publish the reserved `mine` id and make that extension unreachable through the public detail route, because this guard is bypassed when stored submissions are approved. Applying the reservation check during approval (and covering pending rows in the rollout preflight) would preserve the route contract.</comment>

<file context>
@@ -131,6 +138,13 @@ export const SubmissionPayloadSchema = z
   })
   .strict()
   .superRefine((payload, ctx) => {
+    if (RESERVED_EXTENSION_IDS.has(payload.extension.id)) {
+      ctx.addIssue({
+        code: z.ZodIssueCode.custom,
</file context>


// Register the static owner route before the public parameter route
// (/extensions/{id}) so the reserved "mine" segment is handled as the
// owner collection. The deployment preflight in README.md must reject any

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This comment directs readers to "The deployment preflight in README.md" / "rollout preflight", but those rollout/preflight details were removed from README.md in commit 8de90f7 ("Trim rollout details from README") — grep shows README.md no longer mentions the reserved mine/me ids or any preflight. The comment now points to documentation that doesn't exist, so the operational safeguard (rejecting pre-existing rows with reserved ids before enabling the routes) is only recorded in code comments. Reconcile the two: either restore the preflight guidance to README.md or reword the comment to not cite it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/services/extensions/v2/index.ts, line 129:

<comment>This comment directs readers to "The deployment preflight in README.md" / "rollout preflight", but those rollout/preflight details were removed from README.md in commit 8de90f77 ("Trim rollout details from README") — grep shows README.md no longer mentions the reserved `mine`/`me` ids or any preflight. The comment now points to documentation that doesn't exist, so the operational safeguard (rejecting pre-existing rows with reserved ids before enabling the routes) is only recorded in code comments. Reconcile the two: either restore the preflight guidance to README.md or reword the comment to not cite it.</comment>

<file context>
@@ -125,7 +125,9 @@ const dependencies: RouteDependencies = {
 // Register the static owner route before the public parameter route
-// (/extensions/{id}) so "mine" is never interpreted as an extension id.
+// (/extensions/{id}) so the reserved "mine" segment is handled as the
+// owner collection. The deployment preflight in README.md must reject any
+// pre-existing extension with that id before this route is enabled.
 registerOwnerExtensionsRoutes(extensionsV2, dependencies);
</file context>

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