Skip to content

Normalize Extensions v2 contract - #252

Merged
admdly merged 6 commits into
mainfrom
rfc-0001-contract-tidy
Sep 23, 2026
Merged

admdly merged 6 commits into
mainfrom
rfc-0001-contract-tidy

Conversation

@admdly

@admdly admdly commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Breaking-within-v2 contract tidy. No D1 migration; coordinated release with the site PR (FOSSBilling/extensions#343, same branch name).

What changed

  • Cursor pagination everywhere: GET /developers, GET /developers/claims, GET /developers/{id}/history move from offset to keyset cursors (PaginationSchema); offset helpers deleted. Same-second ties still broken by rowid.
  • GET /developers?scope=all|unapproved (?status= kept as deprecated alias, 422 on explicit conflict); scope=pending + disagreeing status now 422 instead of silently ignored.
  • New POST /extensions/{id}/relist (+ relist() DB, extension-relisted mail, revalidate).
  • Errors: statusFromOwnershipErrorCode folded into statusFromWriteErrorCode; shared NotifiedSchema fragment; tags by resource (listDevelopers, claim decisions → Developers).
  • New contract.test.ts (static-beats-param, reserved ids, scope-misuse matrix, cursor envelopes).
  • README + AGENTS.md updated (relist, scope, cursor pagination, bot [auto] note convention).

Follow-up (deferred, builds on this): #251 moderator content-correction.

Testing

  • npm run typecheck, lint (0 errors), format:check clean.
  • test/services/extensions/v2/: 11 files / 321 tests pass, incl. new relist, scope/cursor, and contract coverage.

No config/binding changes.

@admdly admdly changed the title Normalize Extensions v2 contract per RFC 0001 Normalize Extensions v2 contract Sep 23, 2026
@admdly admdly self-assigned this Sep 23, 2026

@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.

Review completed against the latest diff

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

Re-trigger cubic

Comment thread src/services/extensions/v2/db/developer-profiles.ts Outdated
Comment thread src/services/extensions/v2/schemas/common.ts Outdated
Comment thread src/services/extensions/v2/routes/ownership.ts
Comment thread src/services/extensions/v2/routes/moderation.ts
Comment thread test/services/extensions/v2/moderation.test.ts
Comment thread src/services/extensions/v2/routes/moderation.ts
Comment thread src/services/extensions/v2/schemas/developers.ts Outdated
Comment thread src/services/extensions/v2/routes/developer-profiles.ts Outdated
Comment thread test/services/extensions/v2/contract.test.ts
Comment thread test/services/extensions/v2/moderation.test.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.

All reported issues were addressed across 16 files

Requires human review: Auto-approval blocked because this review re-detected 3 unresolved issues already reported by Cubic.

Re-trigger cubic

Comment thread src/services/extensions/v2/db/extensions.ts Outdated
Comment thread src/services/extensions/v2/routes/moderation.ts
Comment thread src/services/extensions/v2/schemas/ownership.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.

1 issue found across 9 files (changes from recent commits).

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

Re-trigger cubic

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/db/developer-claims.ts">

<violation number="1" location="src/services/extensions/v2/db/developer-claims.ts:312">
P3: The `scope=mine` cursor is bound only to scope, not to the claimant, even though `claimantId` is the primary filter of that result set. A cursor minted by one user, passed with another user's `scope=mine` request, decodes cleanly and seeks from the first claimant's key boundary, silently skipping the second claimant's newest claims — the same "wrong key boundary" page this PR rejects for scope and history. In contrast, the `listHistory` binding added in this same delta tags the developer id (`d`) and rejects a foreign one. Tag the claimant id for `scope=mine` and validate it on decode, mirroring `decoded.d` in `listHistory`.</violation>
</file>

Comment thread src/services/extensions/v2/db/developer-claims.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 6 files (changes from recent commits).

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

Re-trigger cubic

Comment thread src/services/extensions/v2/db/extensions.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.

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

Requires human review: This PR introduces a breaking public API contract change and coordinated site migration that requires human sign-off.

Re-trigger cubic

@admdly
admdly merged commit ccd4d3c into main Sep 23, 2026
9 checks passed
@admdly
admdly deleted the rfc-0001-contract-tidy branch September 23, 2026 22:02
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