Repository navigation
Description
Problem
Work and Workflow describe the same closed operations repeatedly: mounted names/routes, daemon request variants, CLI request decoding, CLI result matching, HTTP decode/invoke arms, and HTTP result selectors. Workflow alone has 16 operations repeated across these layers; Work has a larger equivalent mapping. Adding an operation requires several synchronized mechanical edits.
The CLI also converts each typed ApplicationOutcome<T> into JSON and immediately deserializes the entire envelope back into ApplicationOutcome<Value>. Only its payload needs type erasure; receipts, authority, execution and other envelope fields already have the required types.
Evidence at reviewed commit 30c23baa1967d4bb04aee3f20deb7a19f302ba61:
- Existing mounted Workflow operation rows.
- CLI decoding, outcome matching and whole-envelope round trip.
- HTTP decode/invoke arms and result selectors.
- Existing receipt-preserving payload mapping.
Change
Extend an existing closed operation-row declaration, or place concrete shared decoding/projection helpers at the current dependency boundary, so each request DTO/invocation variant/result projector is declared once. Migrate both CLI and daemon HTTP adapters, then delete their duplicated tables and selectors. Keep dependency direction explicit; this is a bounded consolidation, not a new extensible registry framework.
Add a fallible counterpart to ApplicationOutcome::map_payload if necessary and serialize only the payload to Value. Remove whole-envelope serialization/deserialization from erase_workflow_outcome and erase_work_outcome.
Acceptance criteria
- Every currently mounted Work/Workflow operation remains reachable through its real CLI and HTTP/MCP callers.
- Unknown request fields and mismatched operation/result variants still fail closed.
- Request and binding IDs, result schema revisions, resolved scope, receipts, touched-file metadata, and durable settlement/delivery acknowledgments remain exact.
- Focused behavioral coverage proves representative typed read and mutation journeys plus malformed/mismatched outcomes; use Bazel and avoid tests that merely count rows or scan source text.
- Complete the caller cutover and delete obsolete mapping code in the same delivery slice.
Verification and coordination
This is based on source and production-caller inspection; no build or test was run. No duplicate open issue or PR was found. Merged #4158 owns Work writer-job migration. Coordinate adapter signature changes with the separate typed MCP settlement simplification while keeping storage execution and public wire shapes unchanged.
Activity