Skip to content

feat(core): report scenario override outcomes - #6

Open
92Infinitus92 wants to merge 1 commit into
developfrom
feat/scenario-override-outcomes
Open

feat(core): report scenario override outcomes#6
92Infinitus92 wants to merge 1 commit into
developfrom
feat/scenario-override-outcomes

Conversation

@92Infinitus92

@92Infinitus92 92Infinitus92 commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator
  • Return a typed outcome for every scenario override.
  • Report whether each override was applied or skipped, including the reason.
  • Add outcome-aware time travel for pending overrides.
  • Preserve RPC error classification and expose the new contract through the Node SDK.

Greptile Summary

The PR adds typed applied/skipped outcomes for scenario overrides and carries those outcomes through registration, time travel, RPC contracts, and the Node SDK.

  • Stages override materialization and atomically coordinates account commits with schedule removal.
  • Makes schedule replacement and cancellation use backend batch operations.
  • Preserves invalid-parameter versus internal-error classification across the runloop command boundary.
  • Exposes override outcomes through shared Rust types and generated TypeScript bindings.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
crates/core/src/surfnet/svm.rs Adds staged override materialization, atomic schedule replacement, retry-aware time travel, and outcome reporting; the previously reported state-consistency issues are resolved.
crates/core/src/storage/mod.rs Extends the storage abstraction with batch and cross-table atomic operations, rejecting unsupported persistent implementations before mutation.
crates/core/src/storage/sqlite.rs Implements transactional batch operations and verifies rollback for both same-table and cross-table failures.
crates/core/src/storage/postgres.rs Implements transactional account updates with scheduled-override removal and includes rollback coverage.
crates/core/src/runloops/mod.rs Delegates confirmed time travel to the outcome-aware SVM operation and returns classified command errors.
crates/core/src/rpc/surfnet_cheatcodes.rs Updates scenario registration and time-travel RPC responses to expose typed override outcomes.
crates/types/src/scenarios.rs Defines the shared serialized outcome contract used by core RPC and generated clients.
crates/sdk-node/surfpool-sdk/kit/types/api.ts Updates the Node SDK method signatures to match the new RPC result shapes.

Sequence Diagram

sequenceDiagram
  participant Client
  participant RPC
  participant Runloop
  participant SVM
  participant Storage
  Client->>RPC: registerScenario / timeTravel
  RPC->>Runloop: confirmed clock command
  Runloop->>SVM: time_travel_to_clock
  SVM->>SVM: stage override mutations
  SVM->>Storage: atomic account batch + schedule removal
  Storage-->>SVM: commit or rollback
  SVM-->>Runloop: epoch info + override outcomes
  Runloop-->>RPC: typed result
  RPC-->>Client: applied/skipped outcomes
Loading

Reviews (15): Last reviewed commit: "feat(core): report scenario override out..." | Re-trigger Greptile

Context used (4)

@92Infinitus92 92Infinitus92 self-assigned this Aug 14, 2026
Comment thread crates/core/src/surfnet/svm.rs
Comment thread crates/core/src/surfnet/svm.rs Outdated
Comment thread crates/core/src/surfnet/svm.rs Outdated
Comment thread crates/core/src/surfnet/svm.rs Outdated
Comment thread crates/core/src/surfnet/svm.rs Outdated
Comment thread crates/core/src/surfnet/svm.rs Outdated
Comment thread crates/core/src/surfnet/svm.rs Outdated
Comment thread crates/core/src/surfnet/svm.rs Outdated
Comment thread crates/core/src/surfnet/svm.rs
@92Infinitus92
92Infinitus92 force-pushed the feat/scenario-override-outcomes branch 2 times, most recently from 291cabf to 3601a68 Compare August 17, 2026 09:02
Comment thread crates/core/src/surfnet/svm.rs

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

92Infinitus92 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@failfmi

failfmi commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

@greptileai

@92Infinitus92
92Infinitus92 force-pushed the feat/scenario-override-outcomes branch from eae563d to c4da86e Compare August 21, 2026 13:54
@92Infinitus92

Copy link
Copy Markdown
Collaborator Author

@greptileai

@92Infinitus92
92Infinitus92 force-pushed the feat/scenario-override-outcomes branch from ececcd7 to 2427e2f Compare August 25, 2026 09:46
@92Infinitus92
92Infinitus92 force-pushed the feat/scenario-override-outcomes branch from 2427e2f to ddcc7ad Compare September 2, 2026 14:20
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.

2 participants