Skip to content

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

Open
92Infinitus92 wants to merge 8 commits into
developfrom
feat/scenario-override-outcomes
Open

feat(core): report scenario override outcomes#6
92Infinitus92 wants to merge 8 commits 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 outcomes for scenario overrides and exposes outcome-aware registration and time travel through RPC and the Node SDK. It also makes schedule updates and persistent override materialization transactional.

  • Reports whether each override was applied or skipped, with an explanatory reason.
  • Adds outcome-aware time travel while retaining the existing time-travel endpoint.
  • Batches replacement and cancellation mutations across supported storage backends.
  • Atomically commits persistent account changes with removal of the corresponding scheduled override.
  • Preserves invalid-parameter versus internal RPC error classification.

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 updates, outcome reporting, and retry-aware time-travel sequencing without leaving a blocking failure from the prior threads.
crates/core/src/storage/sqlite.rs Implements transactional batch mutations and atomic account-update-plus-schedule-removal operations for SQLite.
crates/core/src/storage/postgres.rs Implements transactional batch mutations and cross-table schedule removal for PostgreSQL.
crates/core/src/runloops/mod.rs Routes confirmed clock updates through the outcome-aware time-travel operation and returns classified command errors.
crates/core/src/rpc/surfnet_cheatcodes.rs Exposes typed override outcomes from scenario registration and the new outcome-aware time-travel RPC.
crates/types/src/scenarios.rs Defines the typed override outcome contract used by core RPC behavior and SDK generation.
crates/sdk-node/surfpool-sdk/kit/types/api.ts Exposes the updated outcome-bearing RPC contract through the Node SDK types.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Time-travel request] --> B[Validate target slot]
    B --> C{Pending override strictly between current and target?}
    C -- Yes --> D[Return invalid-params error]
    C -- No --> E[Materialize current-slot overrides]
    E --> F{Target differs from current?}
    F -- Yes --> G[Confirm current block]
    G --> H[Materialize next-slot overrides]
    F -- No --> K[Apply target clock]
    H --> I{Target later than next slot?}
    I -- Yes --> J[Materialize target-slot overrides]
    I -- No --> K
    J --> K
    K --> L[Return epoch info and override outcomes]
Loading

Reviews (11): Last reviewed commit: "fix(core): reset state after scenario pl..." | Re-trigger Greptile

@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
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