Skip to content

Harden durable execution ownership, recovery, and result access - #19

Draft
the-mindful-dude wants to merge 194 commits into
mainfrom
fix/sdk-runtime-durability-hardening
Draft

the-mindful-dude wants to merge 194 commits into
mainfrom
fix/sdk-runtime-durability-hardening

Conversation

@the-mindful-dude

Copy link
Copy Markdown
Collaborator

Summary

This branch completes the next durability-hardening slice:

  • Scope result lookup to the requested instance and reject mismatches before compiling the frozen result contract.
  • Cap serialized execution-result responses at 1 MiB; oversized responses return HTTP 413 with execution_result_too_large.
  • Atomically fence durable event-history appends with the store owner ID and revision.
  • Atomically fence dispatch-reconciler batch claims, claim releases, and rollback cleanup.
  • Atomically fence due-timer claims, renewals, and stale-timer cleanup.
  • Extend regression coverage for stale-owner writes, result response limits, and cross-instance result resolution.
  • Correct public CLI/API documentation for instance-scoped result retrieval and response-size behavior.

The existing process-level kill/restart acceptance test exercises recovery replay, single-owner takeover, ordered downstream dispatch, and result retrieval through the instance-scoped endpoint.

Review requested

This is a draft pending independent architecture and security review. In particular, please verify:

  1. The full durable mutation surface is fenced atomically, including timer operations, event persistence, dispatch reconciliation, metadata, execution snapshots, and dispatch intents.
  2. Cross-instance result probes return the same 404 behavior as unknown executions and do not trigger result-contract compilation.
  3. The 1 MiB response ceiling and existing composite/result validation provide acceptable resource bounds.
  4. The process-level restart test proves no duplicate terminal effect and correct result survival across ownership transfer.
  5. The architecture boundaries and lease assumptions remain consistent with the design.

No security or architecture signoff is claimed by this implementation pass. ADR-002 remains proposed. The local .agents/ coordination ledger is intentionally not included in this PR.

Validation

CI is running on the branch head. The Go race suite, process-level acceptance test, release matrix, module-integrity checks, and TypeScript SDK/example checks must all pass before this PR is ready for approval.

… Port.Nullable field, required/optional/nullable runtime validation with tests
…mposable, no .required() in SDK, README updated, type tests updated
…ema redesign, and core fixes

- shared/types/protocol: Add top-level execution result endpoint (GET /v1/executions/{id}/result),
  ExecutionResultResponse DTO, ExecutionError type, rename ExecutionResult->ExecutionResultURL
- nore/internal/execution: Recursive composite ValueRef resolution (array/object), depth/node/cycle bounds,
  deterministic string output, ErrNotTerminal only for genuine non-terminal
- shared/types/core: Composite ValueRef validation, ReferencedCapabilities, ValueRefToParam resolution
- application/compiler: Recursive canonicalization of binding sources, result fields, assembly params
- nore/internal/planner: Cross-source binding rejection, multi-source assembly result allowance,
  recursive dependency edges, result_detach recursion
- nore/internal/instance: Manager.ResolveExecutionResult with frozen blueprint reattach,
  terminal-first logic, proper error/status codes
- packages/assembly-sdks/typescript: Required-by-default schema API, .optional()/.nullable() composable,
  recursive Expressionify for arrays/objects, cross-source rejection, dependency edges
- .gitignore: Ignore generated capability runtime catalog and stray echo binary
- examples: Remove tracked echo binary (built by build.sh into catalog/)
- Tests added across core, compiler, planner, execution, protocol, and planner boundaries

This branch has not been deployed

No deployments
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