Skip to content

feat: add historical scoring with history and trend-chart commands#46

Merged
hummbl-dev merged 1 commit into
mainfrom
feat/claude/historical
Apr 19, 2026
Merged

feat: add historical scoring with history and trend-chart commands#46
hummbl-dev merged 1 commit into
mainfrom
feat/claude/historical

Conversation

@hummbl-dev
Copy link
Copy Markdown
Owner

Summary

  • Add Store.get_history() method with optional repo name and days filtering for detailed snapshot queries
  • Add arbiter history command with plain text, --json, and --markdown output formats showing date, repo, score, grade, and delta from previous snapshot
  • Add arbiter trend-chart command showing ASCII sparkline bars per repo with first/latest score and delta
  • 16 tests covering empty DB, filtering, delta calculation, all output formats, argparse wiring, and ASCII bar rendering

Test plan

  • 16 new tests in tests/test_history.py all pass
  • Full suite (485 tests) passes with no regressions
  • arbiter history --help and arbiter trend-chart --help work

🤖 Generated with Claude Code

Track repo scores over time and show trends. Adds:
- Store.get_history() method with repo/days filtering
- `arbiter history` command (plain, --json, --markdown output)
- `arbiter trend-chart` command (ASCII sparkline per repo)
- Delta calculation showing score changes between snapshots
- 16 tests covering all paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hummbl-dev hummbl-dev merged commit 4a8c17d into main Apr 19, 2026
3 checks passed
@hummbl-dev hummbl-dev deleted the feat/claude/historical branch April 19, 2026 01:06
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8bc711d21

ℹ️ 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".

Comment thread src/arbiter/store.py
Comment on lines +221 to +223
"timestamp >= datetime('now', ?)"
)
params.append(f"-{days} days")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Normalize timestamp before applying --days cutoff

repo_snapshots.timestamp is written as YYYY-MM-DDTHH:MM:SSZ, but this filter compares it directly against datetime('now', ?) (YYYY-MM-DD HH:MM:SS). In SQLite this becomes a lexical TEXT comparison, so rows earlier on the cutoff day can still pass (because 'T' > ' '). As a result, history --days N and trend-chart --days N can include snapshots older than N days, skewing deltas and trends.

Useful? React with 👍 / 👎.

Comment thread src/arbiter/store.py
Comment on lines +233 to +234
ORDER BY timestamp ASC
LIMIT ?""",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return latest snapshots when history is capped

This query sorts ascending and then applies LIMIT ?, so with the default limit=500 it returns the oldest 500 snapshots, not the most recent ones. Since cmd_history and cmd_trend_chart call get_history() without overriding limit, those commands will silently show stale data once a repo has more than 500 snapshots.

Useful? React with 👍 / 👎.

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