Skip to content

feat(dsh): persist and recover handoff deliveries - #2603

Merged
hidb4ai merged 2 commits into
masterfrom
codex/dsh-handoff-delivery
Nov 13, 2026
Merged

hidb4ai merged 2 commits into
masterfrom
codex/dsh-handoff-delivery

Conversation

@knqiufan

Copy link
Copy Markdown
Collaborator

Which issue or RFC does this PR implement?

Part of #2514; implements task 3 of RFC #2528. Based on master fd9f1682, which includes the merged #2569. The tracking issue remains open.

Rationale

A successful PowerContext preparation response must survive a DSH Host restart with the exact selected reply, workspace observation, Server/Scope binding and ACK source identity. A captured Source alone cannot reconstruct the original Prepared Handoff.

Changes

  • Add a standalone LocalDeliveryService and the shared Host contracts. An injected PreflightGate must validate before any task-content capture or preparation. Support inspected current-work fields, bounded evidence for configured generation, and explicitly selected exact Handoff revisions.
  • Save a private versioned record and an atomic package per delivery. Store the complete Prepared wire value and actual Source receipt, or the exact revision reference. Keep the Core-compatible Prepared digest separate from the file SHA-256.
  • Persist request aliases and the preallocated content ACK source ID. Verify packages on read, export and launch lookup. Recover an interrupted write only from the verified original file; report unknown and require an explicit new version otherwise. Protect unconfirmed and pinned packages and report capacity exhaustion.

User-facing changes and integration

No public Server API or plugin entry point changes. English and Chinese developer docs describe storage, recovery and retention.

Task 4 still needs to inject the authenticated Host gate, exact boundary reader and connection resolver; map the shared safe error codes; and coordinate launch path use with retention. The exact Revision variant reuses the existing integer ArtifactReference.revision. Target installation and launch, and final ACK verification, are outside this PR.

Validation

  • make check; make js-test (537 plugin tests, 9 HTTP E2E); make docs-test; focused TypeScript compilation of the new handoff modules.
  • uv run pytest -q tests/test_dsh_handoff_digest.py tests/test_workflow_actions.py tests/test_js_operations.py tests/e2e/test_dsh_http_chain.py (16 passed).
  • A local real PowerContext Server accepted the exported Prepared value through continue_handoff and served the selected exact Revision. A subprocess crash and restart exercised local recovery. Gate and generation tests use fixtures; they do not establish native DSH Host, model-provider, or destination acceptance.

AI usage statement

Implemented and tested with OpenAI Codex (GPT-6).

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

Two reproducible issues remain in restart recovery and evidence-omission handling. Please address the inline findings before merging.

@hidb4ai
hidb4ai dismissed their stale review November 13, 2026 08:47

Re-reviewed baaf317. Both reported findings are fixed: the kernel lock permits recovery despite stale PID markers, and overflowed Host omissions now produce an explicit coverage warning. The original counterexamples and focused Linux delivery/recovery tests, including a real local Server round trip, pass. Withdrawing this obsolete changes request. This does not establish native macOS/DSH or destination-agent acceptance.

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

LGTM

@hidb4ai
hidb4ai merged commit 867e8cc into master Nov 13, 2026
40 checks passed
@hidb4ai hidb4ai added the 1.5.2 v1.5.2 release tracking label Nov 15, 2026
@PsiACE
PsiACE deleted the codex/dsh-handoff-delivery branch November 16, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.5.2 v1.5.2 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants