Skip to content

Migrate API and CLI services to sennoric.com - #87

Merged
Ravikxx merged 2 commits into
masterfrom
codex/sennoric-domain-migration
Aug 9, 2026
Merged

Migrate API and CLI services to sennoric.com#87
Ravikxx merged 2 commits into
masterfrom
codex/sennoric-domain-migration

Conversation

@Ravikxx

@Ravikxx Ravikxx commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Migrates backend, CLI, email, model, and status URLs to sennoric.com. Adds a signed 60-second single-use cookie handoff, preserves the legacy API during cutover, and routes the old website hostname through the Worker. Includes D1 migration 041 and coverage for replay prevention and redirect behavior.\n\nValidated: 345 CLI tests and 239 Worker tests pass. The D1 migration and Worker routes are already deployed.

Summary by CodeRabbit

  • New Features

    • Introduced migration support from legacy Amplified SMP domains to Sennoric.
    • Added secure, short-lived, single-use session handoffs for account and key-related routes.
    • Updated authentication, OAuth, billing, chat, integrations, monitoring, and API services to use Sennoric domains.
    • Added compatibility routes and redirects for legacy URLs.
  • Documentation

    • Updated installation instructions, service links, and model-serving endpoint references.
  • Tests

    • Added coverage for migration handoffs, replay prevention, redirects, and updated Sennoric endpoints.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Ravikxx, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fa96d879-1478-4b0b-8b0c-066de403a12a

📥 Commits

Reviewing files that changed from the base of the PR and between 436b985 and 14dae9b.

📒 Files selected for processing (4)
  • api-proxy-cf/src/index.js
  • api-proxy-cf/test/billing.test.mjs
  • api-proxy-cf/test/desktop-auth.test.mjs
  • api-proxy-cf/test/migrations.test.mjs
📝 Walkthrough

Walkthrough

The PR moves web, API, OAuth, email, monitoring, client, and documentation URLs to Sennoric domains. It also adds legacy-domain redirects and secure, single-use session handoffs for authenticated migration.

Changes

Domain migration and cutover

Layer / File(s) Summary
Session handoff and legacy routing
api-proxy-cf/migrations/..., api-proxy-cf/src/webOrigins.js, api-proxy-cf/src/index.js, api-proxy-cf/test/desktop-auth.test.mjs, api-proxy-cf/test/migrations.test.mjs, api-proxy-cf/wrangler.toml
Adds migration-code storage, signed single-use handoffs, legacy redirects, host-specific cookies, expiration cleanup, route mappings, and migration tests.
Proxy endpoint and notification cutover
api-proxy-cf/src/index.js, api-proxy-cf/src/chatGeneration.js, api-proxy-cf/src/status.js, api-proxy-cf/test/*
Updates API, OAuth, billing, status, email, appeal, invitation, and redirect URLs to Sennoric endpoints.
Client endpoints and documentation
src/agent/*, src/bridge.js, src/config.js, src/tui/App.jsx, test/cloudArtifactTool.test.js, README.md, AGENTS.md, models/Lumen/IPYNBs/...
Updates client API calls, authentication guidance, relay defaults, catalog URLs, artifact requests, installation instructions, and notebook deployment documentation.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant LegacyAPI
  participant MigrationCodeTable
  participant NewAPI
  participant Browser
  LegacyAPI->>MigrationCodeTable: create short-lived migration code
  LegacyAPI->>Browser: redirect with signed handoff
  Browser->>NewAPI: submit signed handoff
  NewAPI->>MigrationCodeTable: atomically consume unredeemed code
  NewAPI->>Browser: set session cookie and redirect
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Inconsistancies ⚠️ Warning The appeal-notification email links to https://api.sennoric.com/admin (index.js:4493), but the Worker has no GET /admin route; other admin links correctly use https://sennoric.com/admin. Change the appeal email href at index.js:4493 to https://sennoric.com/admin and add a test for the generated link.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary migration of API and CLI services to sennoric.com.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/sennoric-domain-migration

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (3)
api-proxy-cf/src/index.js (1)

375-405: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Apply migration 041 before deploying these routes.

041_domain_migration_codes.sql defines the required primary key, nullable redeemed_at, and integer timestamps used with Date.now(). Add tests for expired handoffs and concurrent redemption; current tests cover only sequential replay.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api-proxy-cf/src/index.js` around lines 375 - 405, Apply migration
041_domain_migration_codes.sql before deploying the domain-migration routes,
ensuring domain_migration_codes has the required primary key, nullable
redeemed_at, and integer timestamp columns compatible with Date.now(). Extend
tests around the domain-migration accept handler to cover expired handoffs and
concurrent redemption in addition to sequential replay.
api-proxy-cf/src/status.js (1)

77-77: 🩺 Stability & Availability | 🔵 Trivial

Verify Resend authorization for the new sender.

Confirm that sennoric.com is verified in Resend and that the required SPF and DKIM records are active. Otherwise Resend can reject alerts after the incident is written to D1.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api-proxy-cf/src/status.js` at line 77, Verify that the sennoric.com domain
and status@sennoric.com sender are authorized in Resend, with active SPF and
DKIM records, before relying on the sender in the alert delivery flow.
api-proxy-cf/test/desktop-auth.test.mjs (1)

254-255: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add a concurrent acceptance test.

The handler already uses one conditional UPDATE with redeemed_at IS NULL and accepts only one changed row. The current test covers only sequential replay. Send two acceptance requests with Promise.all and assert one 302 response and one 400 response.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api-proxy-cf/test/desktop-auth.test.mjs` around lines 254 - 255, Add a
concurrent acceptance case around the existing replay test by issuing two
requests to acceptUrl.href simultaneously with Promise.all. Assert that the
resulting statuses contain exactly one 302 redirect and one 400 rejection,
preserving the existing sequential replay coverage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@api-proxy-cf/migrations/041_domain_migration_codes.sql`:
- Around line 1-13: Update the account deletion flow to explicitly delete rows
from domain_migration_codes for the target user before deleting the
corresponding users record, while preserving the existing expiry purge and
redemption behavior.

In `@api-proxy-cf/test/desktop-auth.test.mjs`:
- Around line 251-252: Update the cookie assertions in the accepted-auth
response test to also require the Secure attribute, alongside the existing
Domain and HttpOnly checks. Keep the current set-cookie header source and
assertions unchanged otherwise.
- Around line 48-54: Add the user_id foreign-key constraint to the
domain_migration_codes table definition, referencing the users table
consistently with migration 041. Explicitly enable SQLite foreign-key
enforcement for this test database connection before exercising the schema,
while preserving the existing column definitions and test behavior.

In `@api-proxy-cf/test/migrations.test.mjs`:
- Around line 32-45: Rename the test around the visible assertions in the
domain_migration_codes setup so it describes insertion, user association, and
the initial null redeemed_at state; do not retain “single-use” or handoff claims
unless the test is expanded to perform redemption and verify replay rejection.

---

Nitpick comments:
In `@api-proxy-cf/src/index.js`:
- Around line 375-405: Apply migration 041_domain_migration_codes.sql before
deploying the domain-migration routes, ensuring domain_migration_codes has the
required primary key, nullable redeemed_at, and integer timestamp columns
compatible with Date.now(). Extend tests around the domain-migration accept
handler to cover expired handoffs and concurrent redemption in addition to
sequential replay.

In `@api-proxy-cf/src/status.js`:
- Line 77: Verify that the sennoric.com domain and status@sennoric.com sender
are authorized in Resend, with active SPF and DKIM records, before relying on
the sender in the alert delivery flow.

In `@api-proxy-cf/test/desktop-auth.test.mjs`:
- Around line 254-255: Add a concurrent acceptance case around the existing
replay test by issuing two requests to acceptUrl.href simultaneously with
Promise.all. Assert that the resulting statuses contain exactly one 302 redirect
and one 400 rejection, preserving the existing sequential replay coverage.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6ddf3ab6-1c42-4107-b9fb-a90e22811cbf

📥 Commits

Reviewing files that changed from the base of the PR and between 1a5d285 and 436b985.

📒 Files selected for processing (24)
  • AGENTS.md
  • README.md
  • api-proxy-cf/migrations/041_domain_migration_codes.sql
  • api-proxy-cf/src/chatGeneration.js
  • api-proxy-cf/src/index.js
  • api-proxy-cf/src/status.js
  • api-proxy-cf/src/webOrigins.js
  • api-proxy-cf/test/billing.test.mjs
  • api-proxy-cf/test/chat-generation.test.mjs
  • api-proxy-cf/test/desktop-auth.test.mjs
  • api-proxy-cf/test/desktop-integrations.test.mjs
  • api-proxy-cf/test/migrations.test.mjs
  • api-proxy-cf/test/sandbox-route.test.mjs
  • api-proxy-cf/test/status.test.mjs
  • api-proxy-cf/wrangler.toml
  • models/Lumen/IPYNBs (COLAB RUNS)/In Use/lumen-1.3-sft.ipynb
  • src/agent/agent.js
  • src/agent/mcp-marketplace.js
  • src/agent/models.js
  • src/agent/tools.js
  • src/bridge.js
  • src/config.js
  • src/tui/App.jsx
  • test/cloudArtifactTool.test.js

Comment thread api-proxy-cf/migrations/041_domain_migration_codes.sql
Comment thread api-proxy-cf/test/desktop-auth.test.mjs
Comment thread api-proxy-cf/test/desktop-auth.test.mjs
Comment thread api-proxy-cf/test/migrations.test.mjs Outdated
@Ravikxx
Ravikxx merged commit 0de352f into master Aug 9, 2026
4 checks passed
@Ravikxx
Ravikxx deleted the codex/sennoric-domain-migration branch August 9, 2026 00:51
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