Skip to content

feat(workhub): persist delegation linkage - #3930

Closed
ARE404 wants to merge 1 commit into
apache:mainfrom
ARE404:codex/workhub-durable-delegation
Closed

feat(workhub): persist delegation linkage#3930
ARE404 wants to merge 1 commit into
apache:mainfrom
ARE404:codex/workhub-durable-delegation

Conversation

@ARE404

@ARE404 ARE404 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Persist the first Slice 5 delegation authority in the existing WorkHub Coordination Session:

  • append closed, versioned delegation_intent and delegation_committed records around create_new and delegate_existing effects
  • replay an exact committed result after Runtime Host restart, reject conflicting action-id reuse, and resume an interrupted intent without re-admitting an expired opaque candidate
  • recover an accepted target Turn from durable root/message admission evidence when submit outcome is unknown
  • project persisted target Session ids into the Desktop host namespace

This intentionally does not add replace, Stop ownership, target lifecycle state, or a general workflow phase machine. Those remain later Slice 5 work.

Refs #3492
Proposal: #3286

Design choice: minimal intent before the effect

A committed-only journal is insufficient because candidateRef is deliberately opaque and scoped to one candidate snapshot. If the target effect succeeds but the committed link is not appended before a Host restart, a later candidate set cannot safely reconstruct which Session the action selected.

The Action Gate therefore writes one immutable delegation_intent containing the resolved target before attempting the effect, then appends one immutable delegation_committed record with the accepted target Turn. This is the minimum recovery seam: the two records are append-only facts, not mutable phases, and they do not claim ownership of Stop or target execution lifecycle.

Verification

  • npm -w packages/core test — PASS (658/658)
  • WorkHub Action Gate, coordinator, and protocol tests — PASS (25/25)
  • Runtime Host full test suite — PASS on exact head
  • Desktop main-process full test suite — PASS on exact head
  • affected Core/Storage/MCP/Runtime/Runtime Host builds and Desktop build:test — PASS
  • Biome on all changed TypeScript files — PASS
  • ASF header audit and git diff --check — PASS

npm run build reaches the unchanged @maka/ui workspace and stops on existing prop/type mismatches (settledText, conversationKey, unlockAutoFollow, and trailingAction). This PR does not modify packages/ui; all affected package builds and Desktop main build pass.

No screenshot or recording: this PR changes internal persistence/recovery behavior and adds no visual UI change.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Codex implemented the typed records, durable journal and recovery wiring, added tests and ADR updates, and ran the verification above. The commit includes the required Generated-by: Codex trailer.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@ARE404 ARE404 closed this Aug 26, 2026
@ARE404
ARE404 deleted the codex/workhub-durable-delegation branch August 26, 2026 15:12
@ARE404

ARE404 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #3935. GitHub automatically closed this PR when the fork branch was renamed to satisfy CONTRIBUTING.md; the replacement contains the same Slice 5 work plus the production retry-identity P1 fix and complete verification matrix. — Codex

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