Skip to content

feat(gateway): persist mobile mutation receipts - #63190

Draft
ericlewis wants to merge 7 commits into
NousResearch:mainfrom
ericlewis:codex/mobile-contract-durable-mutations
Draft

feat(gateway): persist mobile mutation receipts#63190
ericlewis wants to merge 7 commits into
NousResearch:mainfrom
ericlewis:codex/mobile-contract-durable-mutations

Conversation

@ericlewis

Copy link
Copy Markdown

Stack

This draft is stacked on #62858 (feat/mobile-contract-hello-scopes). It intentionally includes that PR's commits until #62858 merges; rebase this branch onto main after the parent lands.

  • Parent head used: d8bc3bc9b1277b54d72b097c7a5d0328ecb62348
  • Parent base: f67aae323010e32c592a185984d36b20e9fa474a
  • This foundation implements the non-approval durable-mutation work tracked in ericlewis/cuttle#4.

Summary

  • persist mobile mutation receipts in a private SQLite store keyed by authenticated principal plus client request identity
  • fingerprint durable Hermes conversation identity and semantic parameters rather than replaceable live session IDs
  • require client_request_id for mobile prompt submission, interruption, and deletion while preserving legacy ID-less transports
  • replay identical completed requests with deduplicated: true, reject semantic ID reuse deterministically, and expose authoritative mutation.status
  • retain replay after process restart, live-session rotation, and conversation deletion; abandoned ownership becomes fail-closed outcome_unknown
  • complete prompt receipts only after the exact principal-scoped user turn is proven persisted by the real SessionDB path
  • coordinate deferred prompt receipts with one condition-driven monitor per live session, O(1) live/durable proof sets, exact handoff cleanup, and terminal-only transcript fallback
  • preserve durable proof through Hermes consecutive-user repair without falsely promoting an unpersisted row
  • terminalize queued mobile prompts canceled by interrupt rather than leaving an in-progress receipt or live-tag residue

Existing dashboard, stdio, messaging, and other legacy callers keep their current wire behavior. The capability advertises only the mutation methods implemented in this slice.

Validation

Clean commit cc535c21eb6c98a778d88f27d8d76cad096fa964:

  • all 30 tests/tui_gateway/test_*.py files in fresh process isolation: 420 passed
  • tests/test_tui_gateway_server.py: 316 passed
  • dashboard auth WebSocket: 61 passed
  • dashboard ticket WebSocket: 23 passed
  • root gateway WebSocket: 6 passed
  • console WebSocket: 5 passed
  • PTY keepalive WebSocket: 1 passed
  • tests/run_agent/test_run_agent.py: 416 passed
  • chat-completions transport: 88 passed
  • turn context: 15 passed
  • message-sequence repair: 39 passed
  • total distinct coverage: 1,390 passed, 0 failed
  • two independent final reviews: no findings
  • Ruff on all changed Python files: passed
  • git diff --check: passed
  • added-line cross-platform footgun scan: clean

The tests/tui_gateway files are intentionally invoked in fresh processes because current upstream test_inline_rpc_gil_starvation.py replaces the global prompt.submit handler without restoring it; file-scoped isolation avoids that unrelated cross-file test leak.

Deliberate limit / next stack

approval.respond is intentionally not advertised by this foundation branch. Stable approval identity, recoverable lifecycle events, and durable approval-response fingerprinting are integrated together on the next #5 stack; ericlewis/cuttle#4 remains open until that integration is published and validated.

@alt-glitch alt-glitch added type/feature New feature or request comp/gateway Gateway runner, session dispatch, delivery comp/dashboard Web dashboard / control panel UI (dashboard/, landing) area/auth Authentication, OAuth, credential pools P3 Low — cosmetic, nice to have sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Jul 12, 2026
@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/dashboard Web dashboard / control panel UI (dashboard/, landing) comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants