Skip to content

docs(desktop): plan candidates shortlist v1#203

Merged
Whiteks1 merged 1 commit intomainfrom
codex/desktop-candidates-shortlist-v1
Mar 28, 2026
Merged

docs(desktop): plan candidates shortlist v1#203
Whiteks1 merged 1 commit intomainfrom
codex/desktop-candidates-shortlist-v1

Conversation

@Whiteks1
Copy link
Copy Markdown
Owner

@Whiteks1 Whiteks1 commented Mar 28, 2026

Summary

This PR:

  • adds a plan-only spec for Candidates / Shortlist v1 under docs/desktop-candidates-shortlist-v1.md
  • defines the smallest decision layer needed for QuantLab Desktop to support launch -> inspect -> compare -> decide
  • fixes scope boundaries up front so the implementation does not drift into tagging, ranking, portfolio management, or Stepbit integration

Why

This slice matters because:

  • the shell already opens and inspects work, but the missing product layer is still decision continuity
  • before implementing #196, we needed a clear contract for entities, persistence, UI shape, acceptance criteria, and non-goals

Scope

This PR does not:

  • implement Candidates / Shortlist in code yet
  • change shell navigation, renderer state, or backend behavior

Validation

Validated with:

  • git show --stat e65196f
  • manual review of docs/desktop-candidates-shortlist-v1.md

Notes

  • This is intentionally a plan-only PR.
  • It exists to de-risk the next implementation slice for #196 by fixing the scope before code is written.
  • The plan keeps persistence local-first through outputs/desktop/candidates_shortlist.json and explicitly leaves Stepbit out of this first version.

Related to #196

Summary by Sourcery

Document the initial plan for a minimal Candidates / Shortlist decision layer in QuantLab Desktop, defining its scope, entities, persistence model, UI surface, and integration points without implementing any code changes.

Documentation:

  • Add a plan-only specification for Desktop Candidates / Shortlist v1, covering entities (candidate, shortlist, baseline), local JSON persistence, and non-goals.
  • Describe the v1 UI surface in the desktop shell for managing candidates, shortlist, and baseline, including key interactions and constraints.
  • Capture risks, acceptance criteria, and a stepwise technical plan to guide the subsequent implementation of the Candidates / Shortlist feature.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 28, 2026

Reviewer's Guide

Introduces a plan-only specification document for the QuantLab Desktop "Candidates / Shortlist v1" feature, defining entities, persistence format, scope boundaries, UI slice, integration points, and acceptance criteria without changing any runtime code.

Sequence diagram for marking a run as candidate and updating local store

sequenceDiagram
  actor Operator
  participant ShellUI
  participant RunRegistry
  participant CandidatesState
  participant LocalStore as LocalJsonStore

  Operator->>ShellUI: click Mark_as_candidate on run_id
  ShellUI->>RunRegistry: validateRun(run_id)
  RunRegistry-->>ShellUI: runExists
  alt run exists
    ShellUI->>CandidatesState: addCandidate(run_id, note)
    CandidatesState->>LocalStore: readStore()
    LocalStore-->>CandidatesState: storeJson_or_missing
    CandidatesState->>CandidatesState: mergeDefaults_and_updateCandidates
    CandidatesState->>LocalStore: writeStore(updatedStoreJson)
    LocalStore-->>CandidatesState: write_ok
    CandidatesState-->>ShellUI: candidate_added
    ShellUI-->>Operator: show_candidate_and_optional_shortlist_badge
  else run missing
    ShellUI-->>Operator: show_error_run_no_longer_exists
  end
Loading

Sequence diagram for opening compare from shortlist selection

sequenceDiagram
  actor Operator
  participant CandidatesTab as CandidatesTabUI
  participant CandidatesState
  participant RunRegistry
  participant CompareView

  Operator->>CandidatesTab: select_multiple_shortlisted_runs
  Operator->>CandidatesTab: click_Open_compare
  CandidatesTab->>CandidatesState: getShortlistSelection()
  CandidatesState-->>CandidatesTab: selected_run_ids
  CandidatesTab->>RunRegistry: resolveRuns(selected_run_ids)
  RunRegistry-->>CandidatesTab: resolved_runs_with_missing_flags
  CandidatesTab->>CompareView: openCompare(resolved_runs)
  CompareView-->>Operator: show_side_by_side_comparison
Loading

ER diagram for Candidates, Shortlist, Baseline, and Runs

erDiagram
  Run {
    string run_id PK
  }

  Candidate {
    string run_id FK
    string note
    datetime added_at
    boolean shortlisted
  }

  Shortlist {
    string shortlist_id PK
    datetime updated_at
  }

  ShortlistEntry {
    string shortlist_entry_id PK
    string shortlist_id FK
    string run_id FK
    int ordinal
  }

  Baseline {
    string baseline_id PK
    string run_id FK
    datetime marked_at
  }

  CandidatesStore {
    string schema_version
    datetime updated_at
    string baseline_run_id
  }

  Run ||--o{ Candidate : has_candidates
  Run ||--o{ ShortlistEntry : may_appear_in
  Run ||--o{ Baseline : may_be

  Shortlist ||--o{ ShortlistEntry : ordered_entries

  CandidatesStore ||--o{ Candidate : persists
  CandidatesStore ||--o{ Shortlist : persists
  CandidatesStore ||--o{ Baseline : persists
Loading

Class diagram for planned candidates shortlist data structures

classDiagram
  class CandidateRecord {
    string run_id
    string note
    datetime added_at
    boolean shortlisted
  }

  class CandidatesStoreData {
    string schema_version
    datetime updated_at
    string baseline_run_id
    CandidateRecord[] candidates
  }

  class CandidatesStoreHelpers {
    +CandidatesStoreData readStore(string file_path)
    +void writeStore(string file_path, CandidatesStoreData data)
    +CandidatesStoreData normalizeDefaults(CandidatesStoreData data)
    +CandidatesStoreData guardMissingFile(string file_path)
  }

  class ShellCandidatesState {
    +CandidatesStoreData store
    +void loadFromDisk(string file_path)
    +void addCandidate(string run_id, string note)
    +void removeCandidate(string run_id)
    +void toggleShortlist(string run_id, boolean shortlisted)
    +void setBaseline(string run_id)
    +CandidateRecord[] getCandidates()
    +CandidateRecord[] getShortlist()
  }

  class RunRegistry {
    +boolean runExists(string run_id)
    +object getRun(string run_id)
  }

  class CandidatesTabUI {
    +void showSummary(int total_candidates, int shortlist_count, string baseline_run_id)
    +void showCandidates(CandidateRecord[] candidates)
    +void onMarkCandidate(string run_id, string note)
    +void onToggleShortlist(string run_id)
    +void onSetBaseline(string run_id)
    +void onOpenCompare(string[] run_ids)
    +void onOpenArtifacts(string run_id)
  }

  CandidatesStoreHelpers --> CandidatesStoreData : reads_writes
  ShellCandidatesState --> CandidatesStoreHelpers : uses
  ShellCandidatesState --> CandidatesStoreData : manages
  ShellCandidatesState --> RunRegistry : validates_run_ids
  CandidatesTabUI --> ShellCandidatesState : interacts_with
  RunRegistry <.. CandidatesTabUI : opens_runs_from_registry
Loading

File-Level Changes

Change Details Files
Add a detailed plan-only specification for the Desktop Candidates / Shortlist v1 feature.
  • Define core entities (candidate, shortlist, baseline) and their required fields.
  • Specify local-first JSON persistence format, file location, and constraints for storing candidates and shortlist state.
  • Outline in-scope and out-of-scope behaviors to keep the feature narrowly focused on decision continuity rather than tagging or portfolio management.
  • Describe the minimal UI surface, layout, and row-level actions for a new Candidates tab/panel in the shell.
  • Detail interaction rules, desktop integration points, technical implementation steps, risks, and acceptance criteria for the future implementation.
docs/desktop-candidates-shortlist-v1.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The Shortlist entity is defined as an ordered list of run_ids, but the persistence example uses a shortlisted: true flag on candidates with no explicit ordering; consider aligning the spec by either adding an ordered shortlist array in the JSON or removing the ordering requirement.
  • The Baseline entity requires run_id and marked_at, but the JSON shape only includes baseline_run_id; clarify whether marked_at is needed in v1 and, if so, add it to the persistence example for consistency.
  • You mention that candidates should only apply to runs that exist in the current registry and that missing runs should be shown explicitly; it may help to specify in the plan how missing candidates are represented in the UI (e.g., a dedicated status or section) to avoid ad-hoc implementations later.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `Shortlist` entity is defined as an ordered list of `run_id`s, but the persistence example uses a `shortlisted: true` flag on candidates with no explicit ordering; consider aligning the spec by either adding an ordered `shortlist` array in the JSON or removing the ordering requirement.
- The `Baseline` entity requires `run_id` and `marked_at`, but the JSON shape only includes `baseline_run_id`; clarify whether `marked_at` is needed in v1 and, if so, add it to the persistence example for consistency.
- You mention that candidates should only apply to runs that exist in the current registry and that missing runs should be shown explicitly; it may help to specify in the plan how missing candidates are represented in the UI (e.g., a dedicated status or section) to avoid ad-hoc implementations later.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Whiteks1 Whiteks1 merged commit 38ece30 into main Mar 28, 2026
2 checks passed
@Whiteks1 Whiteks1 deleted the codex/desktop-candidates-shortlist-v1 branch March 28, 2026 17: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.

1 participant