Skip to content

feat(governance): stale-baseline warning — surface baseline age (F7) - #26

Merged
lostmartian merged 1 commit into
mainfrom
feat/f7-stale-baseline
Aug 26, 2026
Merged

lostmartian merged 1 commit into
mainfrom
feat/f7-stale-baseline

Conversation

@lostmartian

Copy link
Copy Markdown
Collaborator

What

With --explain, AgentDiff warns when the baseline file is older than stale_baseline_days (default 30, flag --stale-days, config [cli] stale_baseline_days):

! Baseline is 47 days old (last modified 2026-07-10). Stale threshold is 30 days - consider re-recording it if the agent's expected behavior has legitimately changed (agentdiff record ... --update-baseline).

Why

F7 (0.4.0 Honest Gate). Thresholds aren't the only thing that drifts - baselines age too. A golden trace from three sprints ago still anchors every diff; failures get noisy and teams quietly stop trusting the gate. This makes baseline age visible so re-recording is a deliberate act. Advisory only - never blocks.

How

  • staleness.py: check_baseline_staleness() - mtime age vs threshold; missing files are load errors (not staleness)
  • CLI diff: --stale-days flag + [cli] stale_baseline_days config key; warning prints in the --explain section after culprit
  • Docs: 'Stale baselines' section in Configuration guide + README flag

Testing

5 new tests (344 total): old-baseline warning, fresh no-warning, config-driven threshold, missing-file semantics, fresh-file render.

- staleness.py: check_baseline_staleness() — file mtime age vs threshold,
  advisory only, missing files are load errors not staleness
- CLI diff: --stale-days flag + [cli] stale_baseline_days config (default 30);
  --explain prints re-record suggestion when the baseline crosses the line
- Docs: 'Stale baselines' section in Configuration guide, README flag
- 5 new tests (344 total)
@lostmartian
lostmartian merged commit 4b2391c into main Aug 26, 2026
1 check passed
@lostmartian
lostmartian deleted the feat/f7-stale-baseline branch August 26, 2026 15:48
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.

1 participant