Skip to content

feat(history): match sparkline trends by manifest name field instead of filename#349

Merged
decko merged 2 commits into
mainfrom
soda/320
May 26, 2026
Merged

feat(history): match sparkline trends by manifest name field instead of filename#349
decko merged 2 commits into
mainfrom
soda/320

Conversation

@decko
Copy link
Copy Markdown
Owner

@decko decko commented May 26, 2026

Summary

Sparkline trends and incremental session filtering now use the logical name: field from the manifest YAML as the history match key, instead of the manifest filename.

Previously, HistoryEntry.manifest stored the filename (e.g. raki.yaml), but sparkline filtering compared against the project's logical name (e.g. soda-gate). This mismatch silently caused empty sparklines for all projects that set name: in their manifest.

Changes

src/raki/report/history.py

  • Added effective_manifest_name(manifest_name, manifest_file) helper — prefers EvalManifest.name when non-empty, falls back to filename for backward-compatibility
  • Updated append_history_entry() to accept manifest_name: str | None kwarg and store the logical name via the helper
  • Updated find_last_matching_entry() signature: manifest: str | None (short-circuits on None)

src/raki/cli.py (the run command)

  • Computes effective_manifest_id from effective_manifest_name(manifest.name, manifest_file) right after manifest load
  • Threads effective_manifest_id into load_seen_session_ids(), find_last_matching_entry(), and build_sparkline_data()

tests/test_320_manifest_name_history.py — 19 new tests covering all affected functions

changes/320.feature — Towncrier changelog fragment

Acceptance Criteria

  • append_history_entry() stores manifest.name (logical name) in the history entry
  • Sparkline trend filtering uses manifest.name as the match key
  • Duplicate-run detection uses manifest.name
  • Old entries stored under filename silently don't match (no errors)
  • Two manifest files with the same name: share history
  • 19 new tests; 0 regressions in the existing suite
  • Towncrier fragment present

Review Results

# Severity Finding Status
1 MINOR _effective_manifest_name had a leading underscore but was imported cross-module — renamed to effective_manifest_name ✅ Fixed
2 MINOR Import alias _eff_mfn in cli.py was cryptic — replaced with full descriptive name ✅ Fixed

Refs #320


Assisted-by: Claude Opus 4.6 (1M context) noreply@anthropic.com
Assigned-by: decko

decko added 2 commits May 26, 2026 14:36
…for sparkline trends

- Add _effective_manifest_name() helper to history.py that prefers
  EvalManifest.name over the filename when non-empty, falling back to
  the filename for backward compatibility
- Update append_history_entry() to accept manifest_name parameter and
  store the effective manifest identity (logical name or filename)
- Update find_last_matching_entry() to accept str | None and short-circuit
  on None
- Update raki run CLI to compute effective_manifest_id from manifest.name
  and pass it to load_seen_session_ids, find_last_matching_entry,
  build_sparkline_data, and append_history_entry
- Add 19 tests covering all new behavior
- Add towncrier fragment changes/320.feature
…import alias

Per review findings:
- Rename _effective_manifest_name → effective_manifest_name (now part of public API)
- Replace cryptic _eff_mfn alias in cli.py with the full descriptive name
@decko decko added the ai-assisted Implemented with AI assistance label May 26, 2026
@decko decko merged commit 16f292c into main May 26, 2026
4 checks passed
@decko decko deleted the soda/320 branch May 26, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Implemented with AI assistance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant