Skip to content

[Bug] Plot count still shows +1 — investigate and re-reconcile #763

@realproject7

Description

@realproject7

Problem

Plot count still displays incorrectly (+1) despite the reconcile fix in PR #741. The Straton storyline shows "4 plots" but the actual count may be 3.

Investigation needed

  1. Query the plots table for the Straton storyline — count actual distinct plot_index values
  2. Check if genesis plot was inserted twice (duplicate row in plots table)
  3. If duplicate exists, delete it and re-run reconcile
  4. If no duplicate, check if plot_count field just wasn't re-reconciled after deployment

Likely cause

Either:

  • A duplicate genesis plot entry exists in the plots table (reconcile counts rows, so COUNT(*) would include the duplicate)
  • The reconcile endpoint /api/cron/reconcile-plots was never triggered after deployment

Fix

  1. Run a Supabase query: SELECT plot_index, COUNT(*) FROM plots WHERE storyline_id = '<id>' GROUP BY plot_index
  2. If duplicates found: deduplicate and reconcile
  3. If no duplicates: just re-run the reconcile endpoint for all storylines
  4. Add a unique constraint on (storyline_id, plot_index) to prevent future duplicates

Branch

task/763-plot-count-fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/T3Assigned to T3 builder agentbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions