Skip to content

feat(api,ui): showcase workspace restore/replay (#393)#397

Merged
w7-mgfcode merged 5 commits into
devfrom
feat/showcase-workspace-restore-replay
Jun 12, 2026
Merged

feat(api,ui): showcase workspace restore/replay (#393)#397
w7-mgfcode merged 5 commits into
devfrom
feat/showcase-workspace-restore-replay

Conversation

@w7-mgfcode

Copy link
Copy Markdown
Owner

Summary

Implements showcase-workspace E4 — restore/replay (closes #393, umbrella #389). The E1 showcase_workspace rows become listable/loadable over two new GET endpoints, and the Showcase page gains workspace controls plus a server-backed panel with Load (re-attach, read-only) and Replay (verbatim re-run through the existing WS path with preservation="keep").

All additive — no migration, no schema change, no pipeline.py / models.py changes.

Backend

  • GET /demo/workspaces — paginated list, newest first; 200 + empty page on an empty table (mirrors GET /scenarios).
  • GET /demo/workspaces/{workspace_id} — full row incl. created_objects; 404 application/problem+json when missing.
  • New WorkspaceListItem / WorkspaceDetailResponse / WorkspaceListResponse response models (plain BaseModel + from_attributes — strict mode stays request-body-only) and a count_workspaces helper next to the E1 read helpers these routes consume.

Frontend

  • Showcase controls: Seed input (previously hardcoded 42), Save as workspace checkbox + name input with client-side pattern validation that disables Run on violation.
  • WorkspacePanel — lists saved workspaces (scenario, seed, status, winner, destructive-reset badge) with Load/Replay; refreshes via query invalidation when a kept run completes.
  • WorkspaceArtifactsPanel — deep-link card grid rebuilt from created_objects + grain columns (winning/V2 runs, scenario plans, batch, alias, grain-scoped forecast/backtest, agent session).
  • Load repopulates scenario/seed/reset/skip_seed/keep/name (calling setScenario before start — picker-desync gotcha); Replay re-submits the recorded config verbatim and always creates a NEW workspace row.
  • RunHistoryStrip now records ephemeral runs only — a summary carrying a workspaceId is not appended (server is source of truth for kept runs).

Tests

Docs

  • docs/_base/API_CONTRACTS.md — two endpoint rows + an E4 note on the WS section (additive; no overlap with E3's edit).

Validation

  • ruff check + ruff format --check + mypy --strict + pyright --strict + pytest -m "not integration" (1975) ✅
  • Full integration suite on a fresh DB: 303 passed ✅ (incl. the replay regression e2e)
  • Frontend pnpm lint && pnpm test --run (349) ✅
  • Browser dogfood on a seeded stack: save → list → load (controls + deep links restore, winning-run link resolves) → replay (green, second row) → ephemeral run feeds localStorage only ✅

Notes / deferred (per PRP)

  • No replayed_from provenance column (needs a migration — possible follow-up).
  • No DELETE endpoint (out of issue scope).

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4e22adea-dd84-4229-b02c-b6d211722471

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/showcase-workspace-restore-replay

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@w7-mgfcode w7-mgfcode merged commit c54e69b into dev Jun 12, 2026
11 of 12 checks passed
@w7-mgfcode w7-mgfcode deleted the feat/showcase-workspace-restore-replay branch June 12, 2026 15:36
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