Skip to content

docs: correct the audit header to the database production actually uses - #304

Open
khaliqgant wants to merge 1 commit into
mainfrom
fix/audit-script-wrong-db-figures
Open

docs: correct the audit header to the database production actually uses#304
khaliqgant wants to merge 1 commit into
mainfrom
fix/audit-script-wrong-db-figures

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Aug 4, 2026

Copy link
Copy Markdown
Member

What

Comment-only correction to scripts/audit-dm-reservations.mjs. No behaviour change.

The header recorded 30 mismatched ids and 3425 two-party conversations. Those figures come from the first run of this script, which went against the pre-cutover relaycast D1 instance rather than relaycast-cloud — the one the worker actually binds. Every other record of that run (the migration record, and what was reported to the Ratify design partner) says 4 colliding pair groups, 87 mismatched ids, 2607 two-party conversations.

The finding replicated on both instances, so the conclusion held and the deployment was correct. But the script disagreed with itself and with everything else describing the same run, and it is the artifact someone would read first.

Also

  • Names which instance the figures are from, and how to resolve it: through the SST resource RelaycastDatabase, never by the name matching this repo. Two live instances carry DM data under confusingly close names, which is how the wrong one got audited in the first place.
  • Adds the missing --remote to the usage example. Without it wrangler d1 execute reads the local emulated database, so the audit silently reports on nothing — hit while re-running this against production today.

Verification

Re-ran the script against relaycast-cloud today: 3078 1:1 conversations scanned, 2961 reservable, 117 skipped (101 orphaned two-party, 16 self-DM), and zero findings in all three checks. Reservation table: 0 colliding pair groups, 0 reservations without a conversation, 0 unsorted pairs, and 0 of the 2961 two-party conversations without a reservation.

🤖 Generated with Claude Code

Review in cubic

The header recorded figures from the first run of this script, which went
against the pre-cutover `relaycast` instance rather than `relaycast-cloud`,
the one the worker binds. The deployment figures reported to the design partner
and in the migration record are 4 colliding pair groups, 87 mismatched ids and
2607 two-party conversations; the header said 30 and 3425. The finding
replicated on both instances so the conclusion held, but the numbers in the
script disagreed with every other record of the same run.

Also names which instance the figures come from and how to resolve it (the SST
resource, never the name matching the repo), and adds the missing `--remote` to
the usage example — without it wrangler reads the local emulated database and
the audit reports on nothing.

Comment-only; no behaviour change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 418018b3-47a1-4562-bfb7-7f8762f917eb

📥 Commits

Reviewing files that changed from the base of the PR and between 45beff3 and 08ddec7.

📒 Files selected for processing (1)
  • scripts/audit-dm-reservations.mjs

📝 Walkthrough

Walkthrough

The audit script updates production mismatch and conversation counts. It explains the database-instance correction and identifies the hosted database. It also documents the --remote flag required for hosted Wrangler audits.

Changes

Audit documentation

Layer / File(s) Summary
Production findings and remote audit guidance
scripts/audit-dm-reservations.mjs
The script records 87 mismatched IDs and 2,607 two-party conversations. It identifies relaycast-cloud and RelaycastDatabase and documents the required --remote flag.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested reviewers: kjgbot

Poem

A rabbit checks the numbers twice,
Finds eighty-seven mismatches precise.
The hosted database now shines clear,
With --remote commands drawing near.
Two thousand six hundred seven hop in line—
Audit paths now document fine.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: correcting the audit header to match the production database.
Description check ✅ Passed The description directly explains the corrected figures, database instance, remote execution flag, and comment-only scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/audit-script-wrong-db-figures

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

scripts/audit-dm-reservations.mjs

Parsing error: /scripts/audit-dm-reservations.mjs was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

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

No issues found across 1 file

Re-trigger cubic

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