Skip to content

night-shift: prompt-regression eval-harness skeleton - #2

Merged
syzayd merged 2 commits into
masterfrom
night-shift/2026-07-11
Jul 14, 2026
Merged

night-shift: prompt-regression eval-harness skeleton#2
syzayd merged 2 commits into
masterfrom
night-shift/2026-07-11

Conversation

@syzayd

@syzayd syzayd commented Jul 11, 2026

Copy link
Copy Markdown
Owner

What

Adds src/personal_llm/eval/:

  • harness.py - a pure, generic runner: EvalCase (name + run() + Assertions),
    run_eval(cases) -> EvalReport. A case whose run() raises is recorded as a failure
    with the exception message instead of crashing the whole sweep.
  • cases.py - 3 builtin cases against rag.pipeline.ask and
    review.weekly.generate_review, using a small self-contained _ScriptedRouter
    (mirrors tests/conftest.py's FakeRouter surface, kept separate because tests/
    isn't importable at runtime and these cases also run from the CLI).
  • A new eval CLI command that runs the suite standalone (no engine/API key needed)
    and exits non-zero if any case fails.

Why

PROJECT-GENESIS.md section 9, Tier 2, item 16: "personal-llm: eval-harness skeleton
for prompt regression". The existing test suite mocks the router's complete() return
value directly, so it never actually exercises whether a reworded system prompt
(_SYSTEM in rag/pipeline.py or review/weekly.py) still produces the right
observable behavior - grounding falling back to "not in memory" correctly, citations
surviving, a review report keeping its shape. This harness gives that a name and a
place to grow: assertions check output shape/content, never literal prompt wording, so
prompts stay free to be improved.

How verified

7 new tests in tests/test_eval.py: harness pass/fail aggregation, failure-description
reporting, exception isolation (one bad case doesn't take down the run), the empty-list
edge case, a baseline assertion that all 3 builtin cases currently pass, and the CLI
command's exit-code behavior (0 on pass, 1 on failure, monkeypatched to force a
failure).

pytest tests/ -q -> 107/107 passed, offline, no network or API key (installed the
full requirements.txt, including chromadb/sentence-transformers, to run the real
suite rather than skip it). Also ran the new eval command directly end-to-end:
all 3 builtin cases print [PASS] and the summary line.

claude and others added 2 commits July 11, 2026 20:49
Tier 2 item 16 (PROJECT-GENESIS.md section 9): src/personal_llm/eval/ - a pure,
generic pass/fail runner (harness.py) plus 3 builtin cases (cases.py) over
rag.pipeline.ask and review.weekly.generate_review, so a reworded system prompt
that silently changes observable behavior (grounding, citations, report shape)
gets caught as a regression instead of only a subjective read of a diff.

New `eval` CLI command runs the suite standalone (no engine bootstrap needed) and
exits non-zero on failure - usable as a CI gate later.

7 new tests; full suite 107/107 green offline, no API key or network.
@syzayd
syzayd merged commit 508f2b3 into master Jul 14, 2026
1 check passed
@syzayd
syzayd deleted the night-shift/2026-07-11 branch July 14, 2026 18:21
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.

2 participants