Skip to content

feat(studio): add bounded override persistence controls - #12

Open
bakasura980 wants to merge 4 commits into
feat/bisonfi-supportfrom
feat/bounded-persist
Open

feat(studio): add bounded override persistence controls#12
bakasura980 wants to merge 4 commits into
feat/bisonfi-supportfrom
feat/bounded-persist

Conversation

@bakasura980

@bakasura980 bakasura980 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Greptile Summary

The PR adds bounded and indefinite override-persistence controls, persistence-aware scenario serialization, and cancellation attempts during action or scenario deletion.

  • Adds persistence configuration and status controls to the scenario editor.
  • Serializes persistence through scenario PATCH and playback registration.
  • Adds stop-persistence requests before replacing or deleting active overrides.
  • Introduces request sequencing for asynchronous action restoration.

Confidence Score: 3/5

The PR is not yet safe to merge because the backend ignores the new persistence contract and the missing-template edit transition can still restore stale action state.

The current Surfpool backend has neither the persisted override field nor the cancellation RPC used by the UI, while one edit-selection path still leaves an earlier account request current after the editing target changes.

Files Needing Attention: apps/studio/src/lib/scenarios-api.ts, apps/studio/src/components/svm/scenario-editor.tsx, apps/studio/src/components/svm/scenarios-bento.tsx

Important Files Changed

Filename Overview
apps/studio/src/components/svm/scenario-editor.tsx Adds persistence editing, cancellation, serialized syncing, and request-token guards, but the missing-template edit transition still permits stale asynchronous restoration.
apps/studio/src/components/svm/scenarios-bento.tsx Stops marked-persistent overrides before scenario deletion, although the required RPC is absent from the current backend contract.
apps/studio/src/lib/scenarios-api.ts Defines persistence serialization and cancellation requests that are not supported by the current related Surfpool backend.
apps/studio/src/lib/scenarios-data.ts Extends the client scenario model with boolean or bounded-slot persistence settings.
apps/studio/src/lib/scenarios-api.test.ts Covers persistence serialization, slot validation, identity generation, and cancellation request construction at the client layer.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Editor[Persistence controls] --> Save[Scenario PATCH]
  Editor --> Play[surfnet_registerScenario]
  Save --> Backend[Surfpool backend]
  Play --> Backend
  Editor --> Stop[surfnet_stopPersistingOverride]
  Stop --> Backend
Loading

Comments Outside Diff (1)

  1. apps/studio/src/components/svm/scenario-editor.tsx, line 1435-1438 (link)

    P1 Missing template preserves stale request

    When action A has a pending account request and the user clicks persisted action B whose template is absent from the current catalog, editingAction changes without calling handleActionSelect or cancelActionSelection. A's request therefore remains current and restores its overrides and persistence controls into B's editing position, so updating B saves A's stale state.

    Knowledge Base Used: Studio scenarios and AI workflows

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/studio/src/components/svm/scenario-editor.tsx
    Line: 1435-1438
    
    Comment:
    **Missing template preserves stale request**
    
    When action A has a pending account request and the user clicks persisted action B whose template is absent from the current catalog, `editingAction` changes without calling `handleActionSelect` or `cancelActionSelection`. A's request therefore remains current and restores its overrides and persistence controls into B's editing position, so updating B saves A's stale state.
    
    **Knowledge Base Used:** [Studio scenarios and AI workflows](https://app.greptile.com/limechain/-/custom-context/knowledge-base/limechain/surfpool-web-ui/-/docs/studio-scenarios-ai.md)
    
    ---
    
    For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

    Fix in Claude Code Fix in Codex Fix in Cursor

Fix all with Greploop Fix All in Claude Code Fix All in Codex Fix All in Cursor

Prompt To Fix All With AI
### Issue 1
apps/studio/src/components/svm/scenario-editor.tsx:1435-1438
**Missing template preserves stale request**

When action A has a pending account request and the user clicks persisted action B whose template is absent from the current catalog, `editingAction` changes without calling `handleActionSelect` or `cancelActionSelection`. A's request therefore remains current and restores its overrides and persistence controls into B's editing position, so updating B saves A's stale state.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (4): Last reviewed commit: "fix(studio): include PDA values when sto..." | Re-trigger Greptile

Context used:

Comment thread apps/studio/src/lib/scenarios-api.ts
Comment thread apps/studio/src/components/svm/scenario-editor.tsx
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.

1 participant