Gate the projection engine on use_for_projections - #2231
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second PR of the #2229 pair, following the merged migration #2230. Before deploying, confirm both migrations from #2230 (
db:migrateanddata:migrate) have run in production.Projection.sql'srelevant_event_idsCTE now filters onevents.use_for_projectionsinstead of event group concealment (theevent_groupsjoin is no longer needed). This carries automatically to every consumer of the engine: planning, live effort projections, crew access arrival estimates, and projection assessments.PlanDisplayanchors oncourse.projectable_events.latestinstead ofcourse.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.Event.used_for_projectionsscope andCourse#projectable_events.EventParameters.permittedincludes 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
Projectionspec contexts: an event flagged off is excluded from the pool; an event in a concealed group is included. NewPlanDisplayspec: plans build normally, still build when the course's only event group is concealed, and error when no events are flagged.🤖 Generated with Claude Code