Skip to content

fix(tests): stop staging fake skills into the operator's real review queue - #291

Merged
AVADSA25 merged 1 commit into
mainfrom
fix/tests-pollute-reviews
Jul 22, 2026
Merged

fix(tests): stop staging fake skills into the operator's real review queue#291
AVADSA25 merged 1 commit into
mainfrom
fix/tests-pollute-reviews

Conversation

@AVADSA25

Copy link
Copy Markdown
Owner

Mickael noticed "weird looking skill creation requests" piling up in the Skills tab. They weren't weird — they were ours.

test_skill_routes posts to /api/skill/review through a TestClient, and the handler writes to ~/.codec/skill_reviews — the real one. Every suite run left a live test_review.py awaiting human approval. Six had accumulated; three landed in one afternoon of test runs while preparing the demo.

The irony: routes/skills.py anticipated this exactly —

def _reviews_dir() -> str:
    """...A function (not a constant) so tests can monkeypatch it to a tmp dir
    for isolation."""

Nothing ever did. An autouse fixture now points it at tmp_path.

Verified: real review count 6 before the suite, 6 after — previously +1 per run. The 6 stale artifacts were cleared through the app's own reject endpoint (not by deleting files behind its back); only the genuine moon_phase.py remains.

…queue

test_skill_routes hit /api/skill/review through a TestClient, and the handler
writes to ~/.codec/skill_reviews — the REAL one. Every run of the suite left a
live `test_review.py` sitting in the Skills tab waiting for human approval. Six
had accumulated before anyone looked; three landed in a single afternoon of test
runs while preparing the demo.

routes/skills.py already anticipated exactly this — `_reviews_dir()` is a
function rather than a constant, documented "so tests can monkeypatch it to a
tmp dir for isolation". Nothing ever did. An autouse fixture now points it at
tmp_path.

Verified: real review count is 6 before the suite and 6 after (was +1 per run).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@AVADSA25
AVADSA25 merged commit e1b692f into main Jul 22, 2026
1 check passed
@AVADSA25
AVADSA25 deleted the fix/tests-pollute-reviews branch July 22, 2026 16:46
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