Skip to content

feat(backend): return fenced subscription activation receipts - #327

Draft
sandersonstabo wants to merge 2 commits into
agent/backend-conversation-subscription-preparation-port-5ece543from
agent/backend-request-handler-subscription-receipt-port-ab5109a
Draft

feat(backend): return fenced subscription activation receipts#327
sandersonstabo wants to merge 2 commits into
agent/backend-conversation-subscription-preparation-port-5ece543from
agent/backend-request-handler-subscription-receipt-port-ab5109a

Conversation

@sandersonstabo

@sandersonstabo sandersonstabo commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Depends on #326.

Scope:

  • add an opt-in request-handler-owned conversation subscription registrar
  • return non-Clone local activation receipts while leaving successful subscriptions Pending
  • activate only through an explicit post-response method and stop subscriptions immediately/idempotently
  • fence receipts to their exact handler so cross-handler lease collisions cannot activate
  • preserve ordinary request behavior and add real-repository coverage for fresh/resume/error/replacement/stop/delegation paths

Excludes:

  • connection or transport integration
  • delivery tasks, patch publication, notifications, or QUIC ownership
  • shared build/manifest changes

Verification:

  • external Luna worker focused suite: 40 passed
  • authoritative jobs=1 Bazel gate: //modules/backend:backend and //tests/backend:request_handler_test
  • fresh production/test Clippy markers
  • root //:format_test
  • locked/offline Cargo metadata, exact seven-path hash/status guards, and Bazel shutdown
  • receipt: D:/artisan-editor-gate-logs/backend-request-handler-subscription-receipt-20260829-gate1/receipt.json

Remaining work:

  • the next packet must adapt the connection driver to transport's accepted receipt-aware dispatch and call activation only after response write plus send-side FIN
  • conversation delivery ownership remains separate

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Adds an opt-in request-handler-owned subscription registrar that returns fenced, non-clone activation receipts. Subscriptions are prepared as Pending and left for the caller to activate after writing the response; ordinary respond behavior is unchanged.

Behavior

  • Activation happens only through RequestHandler::activate_after_response, which returns the exact lease and cursor or a typed error.
  • Receipts are bound to the exact handler that prepared them, so cross-handler activation is rejected.
  • Unsubscribe stops immediately and idempotently, without producing a receipt.
  • Subscription preparation failures reuse the existing wire classifications.

Tests

  • Adds real-repository coverage for fresh, resume, beyond-tail, repository-failure, replacement, cross-handler, stop, and delegation paths.

Written for commit b974e24. Summary will update on new commits.

Review in 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