feat: Baseline management — create, name, compare baselines with change control
Summary
Formal baseline management for project schedules: capture a named point-in-time snapshot of the approved schedule, compare any two baselines side by side, track variance trending over time, and enforce change control when re-baselining is requested. Required for regulated-industry and government work; referenced in the Gantt UI (baseline shadow bars) and EVM engine (BAC derivation).
Scope
Baseline creation
- "Capture baseline" action on a project: saves a snapshot of all tasks, durations, dependencies, assignments, dates, and cost plan at that point in time
- Name and description required (e.g. "v1 — Contract award", "v2 — Approved scope change #3 (closed)")
- Maximum baselines per project: configurable (default 10)
- Baseline is immutable after creation; no edits allowed without creating a new baseline
Baseline display on Gantt
- Baseline shadow bars shown below current task bars (as referenced in existing Gantt spec)
- Toggle which baseline to show as shadow (dropdown: Original / v2 / v3 / …)
- Baseline drift label on each task: "Baseline drift: +4d vs v2" (as referenced in Attention widget)
Baseline comparison view
- Select any two baselines to compare side by side (or baseline vs. current schedule)
- Comparison table: for each task, show planned dates in each baseline and variance
- Summary: total schedule slip, number of tasks shifted, critical path delta
- Visual diff: Gantt with color-coded bars (on schedule / slipped / accelerated)
Variance trending
- Chart: baseline drift over time — as of each status date, what was the cumulative slip vs. original baseline?
- Milestones view: track each key milestone across baselines to show when slippage was introduced
Change control
- Re-baseline request: PM submits a re-baseline request with justification
- In the OSS edition: request is logged and the PM can approve their own request (simple unlock)
- In the enterprise edition: re-baseline triggers a governance approval chain (enterprise #47 (closed))
- Audit log: every baseline creation and approval recorded with who/when/why
API
GET /api/v1/projects/{id}/baselines/— list baselines for a projectPOST /api/v1/projects/{id}/baselines/— capture a new baselineGET /api/v1/projects/{id}/baselines/{baseline_id}/— retrieve baseline snapshotGET /api/v1/projects/{id}/baselines/compare/?a={id}&b={id}— comparison data
Acceptance criteria
- Baseline captures exact snapshot of all task fields and dates at creation time
- Baseline is immutable: no task field edit via API without re-baselining
- Gantt renders shadow bars for selected baseline on all tasks
- Comparison view shows correct variance for each task between two baselines
- Variance trending chart plots correct cumulative slip at each status date
- Audit log records all baseline creation events
Related
- Enterprise #3 (closed) (EVM — BAC derived from baseline cost plan)
- Enterprise #47 (closed) (governance workflows — re-baseline approval in enterprise edition)