Skip to content

Add protocol-v2 at-most-once operations - #6

Draft
niqibiao wants to merge 1 commit into
mainfrom
codex/at-most-once-protocol
Draft

Add protocol-v2 at-most-once operations#6
niqibiao wants to merge 1 commit into
mainfrom
codex/at-most-once-protocol

Conversation

@niqibiao

@niqibiao niqibiao commented Jul 24, 2026

Copy link
Copy Markdown
Owner

What changed

  • add protocol-v2 invocation identities, durable receipts, status lookup, and a 24-hour at-most-once window for mutating HTTP endpoints
  • propagate protected invocation identity through Editor-to-Player execution and fail closed when the second-hop outcome cannot be proven
  • make refresh acceptance and lifecycle state durable across domain reload, process restart, compilation, and Play Mode exit
  • expose target/readiness evidence while keeping public refresh polling payloads bounded
  • harden main-thread timeout classification and keep runtime work progressing while the Player is unfocused
  • record the protocol handoff in Docs~/UnityCliPluginSync_zh.md

Why

Previously, a timeout or connection reset could happen after Unity had begun a mutation, leaving clients unable to distinguish “not executed” from “executed but response lost.” Refresh state also lived under rebuildable Temp, so reload and Play Mode transitions could lose the operation being awaited.

Impact

The same invocation cannot be dispatched twice within the advertised protection window, ambiguous outcomes remain queryable instead of being blindly retried, and refresh waits stay bound to the accepted operation and generation. Health polling reports a file count instead of repeatedly returning full changed-file lists, reducing payload and context growth in long workflows.

Validation

  • shared Python core: 35 tests passed
  • REPL product layer: 208 tests passed
  • Unity 2022 live validation: full and targeted refresh, reload recovery, bound wait, malformed-request no-mutation, Play Mode exit/resume, and uncertain-command recovery
  • revalidated on the final stacked package head with an isolated durable counter: concurrent same-ID requests executed once; completed exact replay and different-bytes conflict did not increment; client timeout recovered as completed; 30-second main-thread timeout remained outcome_unknown across another same-ID request; orphaned started after service epoch change became outcome_unknown; forced journal-claim write failure rejected before dispatch and recovered after reinitialization; an injected expired record returned protection_expired before redispatch was allowed
  • runtime two-hop fault injection passed: Player capability preflight succeeded, the only child /execute request carried invocation and target IDs, the connection then dropped after receipt, and both the child diagnostic and persisted Editor parent remained outcome_unknown without redispatch
  • git diff --check

No package version bump or release tag is included.

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