Skip to content

Revert package source rescue primitive - #531

Merged
kentcdodds merged 9 commits into
mainfrom
source-rescue-workflow
Jun 9, 2026
Merged

kentcdodds merged 9 commits into
mainfrom
source-rescue-workflow

Conversation

@kentcdodds

@kentcdodds kentcdodds commented Jun 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Remove the package source rescue primitive that was merged/deployed in Add package source rescue workflow #530.
  • Delete the MCP capability, repo-session RPC/DO recovery path, source rescue types/tests/audit writer, and publish-note extension.
  • Remove the source-rescue table creation migration from the branch and add 0040-drop-source-rescue-events.sql so deployed environments drop source_rescue_events safely.

Testing

  • npm run validate — passed on the same final tree.
  • Note: the first full validate run hit an MCP E2E timeout while checks were running concurrently; npm run test:mcp passed standalone, then a subsequent full npm run validate passed.
Open in Web Open in Cursor 

Summary by CodeRabbit

Release Notes

  • Chores
    • Removed source rescue feature, including database tables and migrations, RPC methods, event logging, and validation schemas.

cursoragent and others added 9 commits June 9, 2026 00:52
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
@coderabbitai

coderabbitai Bot commented Jun 9, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5ff4d15b-5c2e-45fc-9d0a-56830d35fc27

📥 Commits

Reviewing files that changed from the base of the PR and between 50c743e and 62fd2ec.

📒 Files selected for processing (12)
  • packages/worker/migrations/0039-source-rescue-events.sql
  • packages/worker/migrations/0040-drop-source-rescue-events.sql
  • packages/worker/src/mcp/capabilities/packages/domain.ts
  • packages/worker/src/mcp/capabilities/packages/source-rescue.node.test.ts
  • packages/worker/src/mcp/capabilities/packages/source-rescue.ts
  • packages/worker/src/repo/publish-git-notes.ts
  • packages/worker/src/repo/repo-session-do.node.test.ts
  • packages/worker/src/repo/repo-session-do.ts
  • packages/worker/src/repo/repo-session-rpc.ts
  • packages/worker/src/repo/source-rescue-events.ts
  • packages/worker/src/repo/source-safety-policy.node.test.ts
  • packages/worker/src/repo/types.ts
💤 Files with no reviewable changes (9)
  • packages/worker/src/mcp/capabilities/packages/source-rescue.ts
  • packages/worker/migrations/0039-source-rescue-events.sql
  • packages/worker/src/repo/source-rescue-events.ts
  • packages/worker/src/mcp/capabilities/packages/source-rescue.node.test.ts
  • packages/worker/src/repo/repo-session-do.node.test.ts
  • packages/worker/src/repo/types.ts
  • packages/worker/src/repo/source-safety-policy.node.test.ts
  • packages/worker/src/repo/repo-session-rpc.ts
  • packages/worker/src/mcp/capabilities/packages/domain.ts

📝 Walkthrough

Walkthrough

This PR removes the source-rescue feature entirely: the database table and indexes, the recoverSourceFromSessionCheckpoint RPC/durable-object method, the MCP package_source_rescue capability, the insertSourceRescueEvent module, related type definitions, and all supporting tests.

Changes

Source Rescue Feature Removal

Layer / File(s) Summary
Database Table Removal
packages/worker/migrations/0040-drop-source-rescue-events.sql
New migration adds DROP TABLE IF EXISTS source_rescue_events to remove the persisted events table.
RPC and Durable Object Method Removal
packages/worker/src/repo/repo-session-do.ts, packages/worker/src/repo/repo-session-rpc.ts
Remove the recoverSourceFromSessionCheckpoint(...) method from both RepoSessionBase durable object and RepoSessionRpc type; clean up type imports for SourceRescueResult and inline publishedBy as a string literal union instead of imported type.
MCP Capability Exposure Removal
packages/worker/src/mcp/capabilities/packages/domain.ts
Remove sourceRescueCapability import and reference from the packagesDomain capabilities array.
Type Contracts and Validation Updates
packages/worker/src/repo/publish-git-notes.ts, packages/worker/src/repo/types.ts
Narrow KodyPublishGitNotePublishedBy union to remove 'source_rescue' option and update schema validation accordingly; remove SourceRescueValidationResult and SourceRescueResult type definitions; add repairHint: 'repo_rebase_session' field to RepoSessionPublishResult rebase outcome variant.
Test and Reference Cleanup
packages/worker/src/repo/repo-session-do.node.test.ts, packages/worker/src/repo/source-safety-policy.node.test.ts
Remove insertSourceRescueEvent from shared mock module, baseline fixture initialization, and module-level vi.mock wiring; delete test case asserting recovery restores missing source HEAD; remove test verifying overwrites stay blocked without verified backup.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • kentcdodds/kody#530: Introduced the source-rescue capability and RPC infrastructure that this PR now removes.
  • kentcdodds/kody#509: Added git-notes support and KodyPublishGitNotePublishedBy type that this PR narrows by removing the source_rescue variant.
  • kentcdodds/kody#218: Modified RepoSessionPublishResult types; this PR adds the repairHint field to the rebase outcome variant.

Poem

🐰 The source rescue sailed away today,
Its table dropped, its methods gone astray,
No RPC calls, no MCP to play—
Clean code hops forward, a brighter way! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: reverting the entire package source rescue primitive that was previously added.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 source-rescue-workflow

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 and usage tips.

@kentcdodds
kentcdodds marked this pull request as ready for review June 9, 2026 03:06
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🔎 Preview deployed: https://kody-pr-531.kentcdodds.workers.dev

Worker: kody-pr-531
D1: kody-pr-531-db
KV: kody-pr-531-oauth-kv

Mocks:

@kentcdodds
kentcdodds merged commit 72e5b45 into main Jun 9, 2026
8 checks passed
@kody-bot
kody-bot deleted the source-rescue-workflow branch July 21, 2026 19: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.

2 participants