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 exposes them through scenario registration, time travel, shared RPC contracts, and the Node SDK.

  • Adds atomic scheduling and staged materialization across in-memory, SQLite, and PostgreSQL storage.
  • Preserves invalid-parameter versus internal-error classification across the command channel.
  • Adds focused regression coverage for replacement, materialization, retry, and time-travel behavior.

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 Implements atomic scenario replacement, staged override materialization, outcome reporting, and retry-aware time travel; the previously reported failure paths are resolved or intentionally recoverable.
crates/core/src/storage/mod.rs Extends the storage contract with batched operations and cross-table removal needed for atomic account and schedule commits.
crates/core/src/storage/sqlite.rs Implements batch and cross-table operations inside SQLite transactions with rollback coverage.
crates/core/src/storage/postgres.rs Implements equivalent transactional batch behavior for PostgreSQL.
crates/core/src/rpc/surfnet_cheatcodes.rs Returns typed override outcomes from scenario registration and time travel while preserving RPC error conversion.
crates/types/src/scenarios.rs Defines the shared serialized override outcome contract.
crates/types/src/types.rs Extends command and time-travel response contracts to carry override outcomes and classified errors.
crates/sdk-node/surfpool-sdk/kit/types/api.ts Updates the Node SDK cheatcode API to expose the new scenario and time-travel result shapes.
crates/sdk-node/surfpool-sdk/kit/generated/OverrideOutcome.ts Adds the generated TypeScript representation of applied and skipped override outcomes.

Sequence Diagram

sequenceDiagram
    participant Client
    participant RPC
    participant Runloop
    participant SVM
    participant Storage
    Client->>RPC: registerScenario / timeTravel
    RPC->>Runloop: command with response channel
    Runloop->>SVM: schedule or materialize overrides
    SVM->>Storage: atomic schedule/account batch
    Storage-->>SVM: committed state
    SVM-->>Runloop: applied/skipped outcomes
    Runloop-->>RPC: typed result
    RPC-->>Client: OverrideOutcome[] / TimeTravelResult
Loading

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

Context used (5)

@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
@92Infinitus92
92Infinitus92 force-pushed the feat/scenario-override-outcomes branch from ddcc7ad to e00ed63 Compare September 3, 2026 06:33
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