Skip to content

[Bug] Stories incorrectly showing as 'Active' — deadline expired but status says 'Open' #977

@realproject7

Description

@realproject7

Problem

Stories that should be expired/completed are showing the "Active" badge. Their deadline stat box shows "Open" (meaning has_deadline = false), but they should actually be expired.

Investigation needed

Check lib/story-status.ts (or wherever getStoryStatus() / active status is determined):

  1. How is "active" determined? Likely: sunset === false AND (has_deadline === false OR deadline not expired)
  2. The bug: Stories with has_deadline = false are treated as "active" (open-ended, no deadline). But these stories may have been created with a deadline that already expired — or the has_deadline field is wrong in the DB.
  3. Check the DB: Query storylines where has_deadline = false but last_plot_time is old (weeks/months ago). Are these truly open-ended, or should they have has_deadline = true?

Possible root causes:

  • has_deadline is wrong in DB — some stories were created with hasDeadline = true on-chain but indexed as false
  • Active status logic doesn't check sunset — story might be effectively dead even without a formal deadline
  • "Open" in the deadline box (Deadline stat box shows '—' instead of 'No deadline' for open-ended stories #895 fix) masks expired stories — showing "Open" when the story is actually abandoned

Files

  • lib/story-status.ts — active/expired logic
  • src/components/StoryCard.tsx — reads status
  • Check DB: SELECT storyline_id, title, has_deadline, last_plot_time, sunset FROM storylines WHERE has_deadline = false

Acceptance Criteria

  • Root cause identified
  • Only truly active stories show "Active" badge
  • Expired/abandoned stories show correct status

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