Skip to content

Gate the projection engine on use_for_projections - #2231

Merged
moveson merged 2 commits into
masterfrom
oveson/claude/use-for-projections-behavior
Aug 20, 2026
Merged

Gate the projection engine on use_for_projections#2231
moveson merged 2 commits into
masterfrom
oveson/claude/use-for-projections-behavior

Conversation

@moveson

@moveson moveson commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Second PR of the #2229 pair, following the merged migration #2230. Before deploying, confirm both migrations from #2230 (db:migrate and data:migrate) have run in production.

  • Projection.sql's relevant_event_ids CTE now filters on events.use_for_projections instead of event group concealment (the event_groups join is no longer needed). This carries automatically to every consumer of the engine: planning, live effort projections, crew access arrival estimates, and projection assessments.
  • PlanDisplay anchors on course.projectable_events.latest instead of course.visible_events.latest, and errors with "No events on this course are available for planning." when nothing is flagged — so a course whose only event is a concealed seed event can plan, and a course whose events are all excluded reports correctly rather than projecting from nothing.
  • New Event.used_for_projections scope and Course#projectable_events.
  • Event form exposes the checkbox (default checked) with tooltip help text covering both directions: concealed events can feed projections, unreliable visible events can be kept out.
  • EventParameters.permitted includes the new attribute.

Not in scope: SplitTimeQuery.typical_segment_time (the data-status pooling from #2169) still has no visibility filter; applying this flag there is a natural follow-up per the discussion on that issue.

Resolves #2229

Testing

  • New Projection spec contexts: an event flagged off is excluded from the pool; an event in a concealed group is included. New PlanDisplay spec: plans build normally, still build when the course's only event group is concealed, and error when no events are flagged.
  • All four behavior-differentiating examples verified to fail against the pre-change code.
  • Affected suites green: projection, plan display, plan effort flow (system), gating location row, projection assessments runner, event and course models — 133 examples, 0 failures.
  • rubocop and erb_lint clean on touched files.

🤖 Generated with Claude Code

moveson and others added 2 commits August 20, 2026 10:37
Replaces the concealment predicate in Projection.sql's event selection
with the new events.use_for_projections flag, decoupling projection
and planning data inclusion from public concealment. A concealed seed
event can now power planning and race-day predictions on a new course,
and a visible event with unreliable times can be kept out of the
stream.

PlanDisplay now anchors on the same projectable events the engine
draws from, so a seed-only course can plan; the event form exposes the
flag with help text.

Resolves #2229

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@moveson
moveson merged commit c1bb96c into master Aug 20, 2026
7 checks passed
@moveson
moveson deleted the oveson/claude/use-for-projections-behavior branch August 20, 2026 17:34
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.

Decouple projection/planning data inclusion from event group concealment

1 participant