Skip to content

feat(core): add durable operation replay protection - #99

Open
Alfazal007 wants to merge 2 commits into
systemind-team:mainfrom
Alfazal007:t3code/durable-operation-replay
Open

Alfazal007 wants to merge 2 commits into
systemind-team:mainfrom
Alfazal007:t3code/durable-operation-replay

Conversation

@Alfazal007

@Alfazal007 Alfazal007 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Repeated resource operation IDs currently call the provider twice. Add kernel-owned replay gates for execution, tool-call, resource-operation and message identities, backed by a host-owned durable ReplayStore. Atomic claims block concurrent duplicates, conflicting input is rejected, and retained terminal results are replayed without repeating effects.

ADR 0028 defines tenant scoping, canonical fingerprints, pending/failed/interrupted states, permanent identity tombstones, result expiry, fenced crash recovery and ambiguous external effects. Standard resource tools derive provider IDs from their full execution identity; messaging claims both direct and nested deliveries. Testkit supplies an isolated in-memory adapter.

Protocol v1 activation is opt-in through SharedOSKernelOptions.replayStore; omission preserves legacy unprotected behavior. Production hosts must install a durable adapter. ADR 0019 now freezes protocol "1" at the 1.0.0-preview shape. Mandatory activation remains a future coordinated semantic protocol migration; this change does not assume epoch 2 or /v2 routes. No exactly-once claim is made for external systems. Grant reservation and audit transactions remain outside this change.

Validation:

  • 35 focused replay/testkit tests passed with one worker, covering the original duplicate-effect probe, all four identity paths, HTTP, races, conflicts, tenant isolation, outages, cancellation, retention, result replay and recovery.
  • 21 selected existing kernel/runtime regression tests passed with one worker.
  • pnpm typecheck, pnpm format:check and git diff --check passed.
  • pnpm check was attempted, then stopped at the user's request to avoid heavy suites on this machine. The full conformance and final aggregate checks are not claimed as passed.

Pre-existing/environment issues: the initial check could not start because dependencies were absent (resolved with a frozen install). TypeDoc's Git repository detection ignores worktrees whose .git is a file, removing source links even for unchanged APIs; regenerated API references preserve the existing canonical links. These are separate from replay test results.

Merge integration: merged main at d9e2ea4 and resolved the generated API conflicts. Replay scoping now follows trusted AccessContext.executionId, and the executor normalizes context execution identity before fingerprinting and claiming a turn. Added focused regressions for both cases.

Post-merge validation: 37 replay/testkit tests plus 6 selected turn-isolation regressions passed, all with one worker. Type checking, formatting and conflict/whitespace checks passed. No full test or conformance suite was run, honoring the machine-resource constraint.

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