Repository navigation
Conversation
|
Thanks for your first pull request to Orbit. Two things that will save you a review round: A maintainer will review this shortly. Ask anything on the thread. |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. Comment |
|
@imshashank This documentation-only draft is PR5, the fifth follow-up split from #512, covering the Issue outbox and reliable realtime publication. The full plan is in docs/pr5-outbox-plan.md. The plan follows your earlier deployment direction: bounded in-request draining plus a per-minute cron, with a shared drain interface and a standalone self-hosted worker deferred. Slack and email keep their existing Provider Outbox. MCP request idempotency remains separate under #407. The delivery guarantee ends at Redis accepting a publication; it does not promise that every client receives it. There are two areas I need to coordinate with you:
Separately, the plan documents a behavior fix for normal review: once the Issue transaction commits, an immediate delivery failure returns the original successful business result and retries delivery asynchronously. Authorization, validation and transaction failures remain errors. This draft contains the design only. No feature implementation or production change is included. |
imshashank
left a comment
There was a problem hiding this comment.
Thanks for writing this up before building it. Checked against the blockers from #512:
- Human writes need a gate. The plan routes the Human REST writes through the outbox and says no feature flag is proposed. That gives every human issue write an in-transaction insert plus up to a 250ms in-request drain, and makes rollback a redeploy. Please add an env gate, default off, with the off path keeping today's
handler.publishandoriginClientIdstamping exactly as they are. Your plan to passoriginClientIdbefore the transaction and store it on the row is sound once it's on. - The two-artifact rollout doesn't fit how we deploy.
apps/web/vercel.jsondeploys only from main, so there's no way to "deploy a specified preparation artifact before merge". Please plan it as sequential merges to main instead: consumer hardening first, then the table, drain and cron with the gate off, then the producer behind the gate. That also avoids one PR of 2,250 to 3,450 handwritten lines plus 16 to 18k generated, which is what #512 was split to avoid. Old hubs are already bounded:/api/wshasmaxDuration = 300, so the operator inventory step can just be "wait more than 300 seconds after the preparation deploy". - Worker. In-request drain plus cron, with no required worker, is right. The file list is missing
apps/web/src/lib/deployment/scheduler.ts, which replicatesvercel.json's crons for Docker and the catalog deploys. Without it, self-hosted installs never drain. Alternatively, piggyback on the existing per-minute/api/cron/notifications. - Bounded growth. Backoff, leases, fencing and the 7-day terminal prune are fine. But pending, retry and blocked rows never age out, Redis failures retry forever, and a missing
REDIS_URLnever marks a row published, so a misconfigured instance gains a row per action indefinitely. Add a delivery TTL in minutes after which rows are marked expired, since a reconnect already does an authoritative refresh. Also cap or alert on blocked rows. - Gate off means 200. With the gate added, the cron's gate-off path should be a 200 no-op, not a 503.
- Ordering. Bypassing the global
sincefilter is what drives most of the hub rework. A late lower-sync_id event is only missed by connections that subscribed after it was allocated, which already happens with direct publish today, and those clients loaded state on subscribe. I'd keepsincesemantics in v1. With the TTL, most of the historical replay authorization work goes away. Keep the strict per-issue version check and counterVersion dedupe. - The in-request drain should run via
after()orwaitUntilrather than block the response, or the added latency should be stated. - Placement.
docs/pr5-outbox-plan.mdwould be published on the public docs site (VitePress excludes onlysuperpowers/**), and it carries PR status tables. Please move it toextras/or the PR body.
|
Rechecked unchanged head |
|
The revised proposal in #569 has now landed as |
Current design revision continues in #569, preserving this proposal's history. It addresses the earlier Human producer gate, sequential release, v1 protocol, scheduler, delivery lifetime/blocked-row, gate-off cron, response-safe drain and public-doc placement feedback. The revised proposal is maintained outside public product documentation.
#569 is documentation only and does not approve implementation or activate an outbox. Current Actor delivery PRs are #564, #562, #565 and #566. This original proposal remains unchanged until its replacement merges.
What this changes
Adds the English design proposal for PR5, the fifth follow-up split from #512. This draft contains only docs/pr5-outbox-plan.md; it includes the complete technical plan, estimated file changes, failure-test matrix and rollout requirements.
Why
The proposed Issue outbox persists realtime actions in the same transaction as the business write, then publishes them through bounded request draining and cron recovery. Slack and email retain the existing Provider Outbox, and MCP request idempotency remains separate under #407.
Two points need coordination before their corresponding changes proceed: realtime replay and global
sincesemantics, and the production cutover, old hub retirement and rollback procedure. Other engineering choices are stated explicitly for normal PR review.Refs #512, #215. Related implementation stages: #516, #523, #524 and #525. This design proposal does not close #215.
How you know it works
bun run docs:buildpassed with the new proposal included.git diff --cached --checkpassed; the staged change is one Markdown file with 197 added lines.bun run verifypassed lint, comment/source-byte/Bun-import/dependency checks and all workspace typechecks, then stopped in the existingscripts/backup-prune.test.tsCLI subprocess assertion (proc.exitCode: expected 0, received 1). That test phase reported 179 passed and 1 failed on Windows/Bun 1.4.0; the remaining suite did not run. Full verification is not claimed green.The implementation and failure tests described in the document are planned work, not executed feature validation. Source and review status observations are pinned to the 2026-10-15 evidence baseline.
Checklist
bun run verifygreen; the local failure is recorded above.Anything reviewers should know
The planned implementation is estimated at 2,250-3,450 handwritten changed lines, with generated migration metadata reported separately. This PR contains the design document only. The standalone worker is deferred; the plan retains a shared drain interface for a future optional self-hosted entry point.