Skip to content

test: cover JSONFormatter and macro retrieval metrics (Tier A)#329

Open
voorhs wants to merge 1 commit into
devfrom
cov/tier-a-pure-logic
Open

test: cover JSONFormatter and macro retrieval metrics (Tier A)#329
voorhs wants to merge 1 commit into
devfrom
cov/tier-a-pure-logic

Conversation

@voorhs

@voorhs voorhs commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

What

First of a short series of independent coverage PRs against dev (follow-up to #325). Tier A — pure-logic, deterministic tests, no new runtime deps.

Adds tests for two units that the suite never exercised:

  • autointent._logging.formatter.JSONFormatter (was 0%): record→JSON rendering, fmt_keys remapping (incl. consuming always-fields), exc_info, stack_info, and extra record attributes.
  • autointent.metrics.retrieval macro variants + the shared _macrofy helper: retrieval_{map,hit_rate,precision,ndcg,mrr}_macro (previously the only untested retrieval metrics). Ground-truth constants are the deterministic metric outputs, matching the convention of the existing test_retrieval_metrics*.py.

Notes

  • All new tests live in the unit-tests CI job (not under modules/scoring, pipeline, or embedder).
  • Verified locally with ruff check and mypy --strict (Python 3.10, matching CI). Test execution is left to CI.

🤖 Generated with Claude Code

Add unit tests for two previously-untested pure-logic units:

- autointent._logging.formatter.JSONFormatter (was 0%): message/timestamp
  rendering, fmt_keys remapping, exc_info, stack_info, and extra record fields.
- autointent.metrics.retrieval macro variants + the _macrofy helper:
  retrieval_{map,hit_rate,precision,ndcg,mrr}_macro. Ground-truth constants are
  the deterministic metric outputs, matching the existing retrieval-metric tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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