GP-142 GP-143 GP-144: Harden training plan guardrails#103
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e3049ed23
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| available: true, | ||
| enabledOperations: [ | ||
| "previewCreationConfig", | ||
| "createFromCreationConfig", | ||
| "updateFromCreationConfig", |
There was a problem hiding this comment.
Preserve builder-authored data before backend saves
When this makes the backend commit route available, the create/edit builder starts saving through createFromCreationConfig/updateFromCreationConfig, but the mapped backend input only carries the minimal goal/config data and not state.details or state.structure.sessions. The backend commit then persists the generated expandedPlan, so a user who typed a plan name/description or manually arranged sessions/activity plans can save a different generated plan instead of the one they built; keep the legacy payload route for manual-builder saves or include those builder fields in the backend contract before enabling these commit operations.
Useful? React with 👍 / 👎.
| date >= projectionWindow.startDate && | ||
| date <= projectionWindow.endDate; |
There was a problem hiding this comment.
Use the requested schedule bounds for coverage
When a caller supplies scheduledWindowStart/scheduledWindowEnd that are narrower than the resolved projection guardrail, this predicate treats every date in the larger projection window as covered by fetched calendar data. aggregateScheduledLoadByDate still filters events to the actual requested window, so baseline scheduled_tss is replaced by 0 for dates outside the fetched range; compare against the requested schedule bounds here and use the projection window only to clamp which dates are emitted.
Useful? React with 👍 / 👎.
Summary
Verification
pnpm --filter @repo/core check-typespnpm --filter mobile check-typespnpm --filter @repo/core test -- trainingPlanCreationValidation trainingPlanProjectionBudgets— passes; current Vitest selection runs the core suite.pnpm --filter mobile test -- training-plan-creationpnpm --filter @repo/core lint— completed with existing warnings outside this change.pnpm --filter mobile lint— completed with existing warnings outside this change.Plane
Notes