Skip to content

feat(api): extend mutation replay through gateway interceptors - #3323

Merged
johntmyers merged 1 commit into
feat/3051-mutation-replay/mrunalpfrom
feat/3051-interceptor-mutation-replay/mrunalp
Sep 15, 2026
Merged

johntmyers merged 1 commit into
feat/3051-mutation-replay/mrunalpfrom
feat/3051-interceptor-mutation-replay/mrunalp

Conversation

@mrunalp

@mrunalp mrunalp commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

🏗️ build-from-issue-agent

Summary

Extend durable request admission and replay to the remaining 24 ordinary user-callable unary mutations. Typed receipts preserve operation outcomes without storing credential-bearing request or response snapshots, and intercepted retries remain subject to current validation.

Related Issue

Part of #3051, phase 3b. Stacked on #3321 (feat/3051-mutation-replay/mrunalp). This PR does not close the issue: credential capabilities, exec/streaming semantics, curated SDK request-ID helpers, and the final mutation audit remain phase 4.

Changes

  • Add optional UUID request IDs to sandbox lifecycle/attachment, service, provider/refresh, profile, and policy/config mutations; regenerate Go bindings and migrate Rust request literals.
  • Capture identities from actual handler reads/writes. Sandbox replay loads the live original UUID; provider/profile/service projections require recorded versions; refresh projections require the original grant epoch; policy/config and delete receipts preserve historical outcomes.
  • Bound completed receipts to 64 KiB and leave uncertain admissions permanently unresolved. Protect potentially sensitive payload fingerprints with domain-separated HMAC derived from existing JWT or primary TLS private material. Missing or rotated keys fail closed, and replicas must share key material.
  • Carry original client payloads only in private in-memory middleware extensions, freeze request IDs, reauthorize original/effective scopes, rerun interceptor modification/validation, and suppress duplicate post-commit observation. Observation remains best-effort, not a durable outbox.
  • Add 14 server regression tests, extend SQLite/PostgreSQL restart/concurrency coverage to keyed adapters, and add a live sandbox lifecycle/replacement regression.
  • Update architecture/gateway.md and docs/reference/api-errors.mdx with the supported RPCs, replay projections, key-material requirements, and remaining exclusions.

Deviations from Plan

No scope expansion. The reviewed phase-3b design uses method-specific receipts and existing private gateway material rather than generic response persistence or new deployment configuration.

Testing

  • mise run pre-commit passes.
  • Targeted replay suite: 25 passed; opt-in PostgreSQL scenario passed separately.
  • TypeScript SDK CI: 108 tests passed, including codegen/type checks/build.
  • Documentation validation: 0 errors, 3 existing warnings.
  • Full mise run ci: 1,546 server unit tests passed (9 existing ignored); repository tests and Go SDK CI passed; Python 247 passed, TypeScript 108 passed.
  • Docker conformance smoke and both Rust workspace lifecycle tests passed.
  • Python sandbox/workspace API E2E: 11 passed, 159 intentionally deselected, including the new replay regression.

Local Rust verification disables an unusable sccache wrapper via a task-shell override. Docker supervisor staging uses its supported OPENSHELL_AUDITABLE=1 build mode, which removes the wrapper after nested mise setup. No checks are skipped and repository tool configuration is unchanged. Disposable E2E gateways, sandboxes, networks, and PostgreSQL test resources were removed.

Checklist

  • Follows Conventional Commits.
  • Commit is signed off (DCO).
  • Independent implementation review found no correctness or security blockers.
  • Reviewed related skills with the maintenance map; no skill inventory, workflow, or instruction changes required.

Add typed durable replay receipts for 24 ordinary unary mutations, protect sensitive payload fingerprints, and revalidate intercepted retries without repeating post-commit observation.

Part of #3051 (phase 3b).

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@mrunalp
mrunalp requested review from a team, derekwaynecarr and sjenning as code owners September 14, 2026 18:56
@mrunalp

mrunalp commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

🏗️ build-from-issue-agent

E2E Test Attestation

Local Docker-backed E2E passed against the contents committed as 80415d1604988cf4fcfcfef8f13660fbe57232be.

Commands:

OPENSHELL_AUDITABLE=1 OPENSHELL_E2E_DOCKER_TEST=workspace_lifecycle mise run --shell 'env RUSTC_WRAPPER= bash -c -o errexit -o pipefail' e2e:docker
OPENSHELL_AUDITABLE=1 E2E_PARALLEL=0 PYTEST_ADDOPTS="-k 'test_sandbox_api or test_workspace_api' -v" mise run --shell 'env RUSTC_WRAPPER= bash -c -o errexit -o pipefail' e2e:python

Both commands created isolated standalone gateways with the Docker compute driver, current gateway/CLI binaries, and a freshly built static supervisor. The auditable supervisor build mode and task shell avoid a local sccache execution error; no repository checks were disabled. The initial Docker attempt stopped during supervisor staging before tests started. Both final commands passed, and their gateways, sandboxes, and temporary networks were removed.

Results

  • Standalone CLI conformance smoke: passed (status, create, exec, deletion).
  • Rust: 2 passed; 0 failed; 0 ignored.
  • Python: 11 passed, 159 deselected in 23.46s. The deselected tests were outside the focused sandbox/workspace API modules; no selected test was skipped.

Tests Executed

  • e2e/rust/tests/workspace_lifecycle.rs::workspace_terminating_rejects_creates — passed.
  • e2e/rust/tests/workspace_lifecycle.rs::workspace_full_crud_lifecycle — passed.
  • e2e/python/test_sandbox_api.py::test_mutation_replay_preserves_sandbox_lifecycle_and_replacement — passed.
  • e2e/python/test_sandbox_api.py::test_sandbox_api_crud_and_exec — passed.
  • e2e/python/test_sandbox_api.py::test_sandbox_interactive_exec_honors_tty — passed.
  • e2e/python/test_sandbox_api.py::test_list_scoped_and_for_all_workspaces — passed.
  • e2e/python/test_sandbox_api.py::test_sandbox_labels_and_selectors — passed.
  • e2e/python/test_workspace_api.py::test_workspace_crud — passed.
  • e2e/python/test_workspace_api.py::test_workspace_create_with_labels — passed.
  • e2e/python/test_workspace_api.py::test_workspace_list_includes_created — passed.
  • e2e/python/test_workspace_api.py::test_workspace_delete_nonexistent_raises_not_found — passed.
  • e2e/python/test_workspace_api.py::test_workspace_get_nonexistent_raises_not_found — passed.
  • e2e/python/test_workspace_api.py::test_workspace_request_id_replays_without_deleting_replacement — passed.

The new replay regression verifies create/stop/start/config/delete results and server replay metadata across actual sandbox reconciliation, then recreates the same name and proves delete replay preserves the replacement.

@github-actions

Copy link
Copy Markdown

@johntmyers johntmyers added the gator:in-review Gator is reviewing or awaiting PR review feedback label Sep 15, 2026

@johntmyers johntmyers left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gator-agent

PR Review Status

This accepted issue-backed phase is project-valid, and the full initial code review found no blocking defects. The user-visible replay contract is documented; required current-head testing must now be dispatched before pipeline monitoring begins.

Blocking findings:

  • No blocking findings remain

Carried findings:

  • None

Non-blocking suggestions:

  • None
Gator metadata
  • Validation: Implements accepted issue #3051 phase 3b on its reviewed stacked base #3321.
  • Docs: Replay behavior and API errors are updated in architecture/gateway.md and docs/reference/api-errors.mdx; navigation changes are not needed for the existing reference page.
  • Checks: Current-head Branch Checks and Helm Lint have not run yet; DCO, vouch, Trivy, docs preview, and available synthetic gates are green.
  • E2E: test:e2e is required for sandbox lifecycle, gateway/interceptor, policy/config, and provider-flow changes and is being dispatched.
  • Head SHA: 80415d1604988cf4fcfcfef8f13660fbe57232be
  • Base SHA: 5dc3c72940b13ca0da55a0b62ec792d71e50cf17
  • Merge base SHA: 5dc3c72940b13ca0da55a0b62ec792d71e50cf17
  • Patch ID: 132f907ff26a660e8d851f936f50f356109b090a
  • Gator payload: 9
  • Review mode: initial
  • Previous reviewed SHA: none
  • Review budget exhausted: no
  • Maintainer decision required: no
  • Next state: gator:in-review

@johntmyers johntmyers added the test:e2e Requires end-to-end coverage label Sep 15, 2026
@github-actions

Copy link
Copy Markdown

Label test:e2e applied, but pull-request/3323 does not exist yet. A maintainer needs to comment /ok to test 80415d1604988cf4fcfcfef8f13660fbe57232be to mirror this PR. Once the mirror exists, re-apply the label or re-run Branch E2E Checks from the Actions tab.

@johntmyers

Copy link
Copy Markdown
Collaborator

/ok to test 80415d1

@johntmyers johntmyers added gator:watch-pipeline Gator is monitoring PR CI/CD status gator:in-review Gator is reviewing or awaiting PR review feedback gator:follow-up-needed Gator needs submitter or maintainer follow-up gator:approval-needed Gator completed review; maintainer approval needed and removed gator:in-review Gator is reviewing or awaiting PR review feedback gator:watch-pipeline Gator is monitoring PR CI/CD status gator:follow-up-needed Gator needs submitter or maintainer follow-up labels Sep 15, 2026
@johntmyers johntmyers added gator:merge-ready and removed gator:approval-needed Gator completed review; maintainer approval needed labels Sep 15, 2026
@johntmyers
johntmyers merged commit 59a6077 into feat/3051-mutation-replay/mrunalp Sep 15, 2026
291 of 312 checks passed
@johntmyers
johntmyers deleted the feat/3051-interceptor-mutation-replay/mrunalp branch September 15, 2026 17:48
@johntmyers

Copy link
Copy Markdown
Collaborator

gator-agent

Monitoring Complete

Monitoring is complete because this PR has merged.

Final status: The PR reached gator:merge-ready with maintainer approval and required checks complete.

I removed the active gator:* label because there is nothing left for gator to monitor on this PR.

Gator metadata
  • Head SHA: 80415d1604988cf4fcfcfef8f13660fbe57232be
  • Gator payload: 9

mrunalp added a commit that referenced this pull request Sep 16, 2026
Add typed durable replay receipts for 24 ordinary unary mutations, protect sensitive payload fingerprints, and revalidate intercepted retries without repeating post-commit observation.

Part of #3051 (phase 3b).

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
pull Bot pushed a commit to rozsazoltan-forks/OpenShell that referenced this pull request Sep 17, 2026
…A#3321)

* feat(api): add durable workspace mutation admission and replay

Part of NVIDIA#3051 (phase 3a). Preserve unresolved admissions, reauthorize replay, and protect same-name replacements.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

* feat(api): extend mutation replay through gateway interceptors (NVIDIA#3323)

Add typed durable replay receipts for 24 ordinary unary mutations, protect sensitive payload fingerprints, and revalidate intercepted retries without repeating post-commit observation.

Part of NVIDIA#3051 (phase 3b).

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

* fix(api): scope workspace request IDs by target

Include the requested workspace name in create/delete admission keys while leaving workspace UUID guards unset. Cover cross-target UUID reuse, replay, and missing targets with server and live gateway regressions.

Merge the latest phase-two SDK fixes and preserve the approved interceptor replay changes.

Refs NVIDIA#3051.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

---------

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants