SERIESSkill Lab

Case study

Fix verification skill: from repeated-save failure to passing tests

Example · 2 min read

Terms in this guide: Evaluation · Fixture · Verification

SKILL LAB / RECORDED PRACTICE

A six-case reading-list fixture demonstrates a reproducible regression check and its limits.

The reproducible failure

The starter function appended an article ID every time it was saved. A second save of the same article produced a duplicate. The expected behavior was to keep first-seen order, ignore blank IDs, and leave the caller’s list unchanged.

python3 -B -m unittest -v

On Python 3.14.5, the unchanged starter failed two checks: saving an existing ID again and repeating the save several times. Four adjacent checks already passed. The command exited with status 1.

The patch

def save_article(saved, article_id):
    """Return a new reading list, preserving first-seen order."""
    result = list(saved)
    if article_id and article_id not in result:
        result.append(article_id)
    return result

The correction copies the input and appends only a nonblank ID that is not already present. The repeated-save tests assert observable output, so they fail the old implementation and pass the corrected one.

The same checks after the fix

test_blank_id_is_ignored ... ok
test_empty_list ... ok
test_input_is_not_mutated ... ok
test_new_article_preserves_order ... ok
test_repeated_calls ... ok
test_repeated_save_is_idempotent ... ok
Ran 6 tests
OK (exit 0)

The runner copied the starter into a temporary directory, ran the test file, replaced only the function with the corrected solution, and reran the same command. The test suite was unchanged between the two runs. The project requires no third-party Python packages or network service.

Practise the verification handoff

Download the developer practice project and reproduce the failure before reading the solution. In your handoff, record the command, environment, failing assertion, changed behavior, passing result, and remaining limits. Do not substitute “looks correct” for the original regression check.

Limits of this evaluation

The assistant manually applied the published fix-verification procedure to a small deterministic Python fixture on September 10, 2026. Six cases were tested, not arbitrary input types, concurrent writes, persistence, or a production repository. There was no independent evaluator, repeated model-run comparison, or automatic skill-selection benchmark.

Use the skill and the exercise

My learningReport an issue with this pageGet the next practical briefing

Progress stays in this browser. No account needed.

View saved items

Keep the momentum

Your next useful read.

Explore the learning library