# Sample triage report: Hacker News front-page scraper

Worked example for CHECKLIST.md, using a real defect found during
verification on 2026-11-12.

## Symptom

The scraper extracted the Hacker News top 30 with rank, title,
domain, points, submitter, and comment count. The test suite passed.
The submitter column in the output CSV was empty on every row.

## Checklist path

Section 2, empty fields, caught it first: one column at 100 percent
empty while 30 rows existed. That pattern means selector problem,
not data problem. Hacker News front-page stories have submitters,
so an all-empty submitter column could not be real data.

Section 1, selector drift, named the cause. The submitter selector
relied on a CSS class, `.hnuser`, that is no longer present on live
Hacker News. The selector matched zero elements on the live page,
so every row wrote an empty string and nothing raised an error.

The mocked tests passed because the test fixture still carried the
old class. The suite verified the code against a page shape that
the live site no longer serves.

## Fix

Replaced the class selector with a structural attribute selector,
`a[href^="user?id="]`, which matches the submitter link by its URL
pattern instead of a presentation class. Added tests that fail
when the submitter selector stops matching, so the next drift
breaks the suite instead of the output.

## Verification

Reran against the live page on 2026-11-12: 30 rows, submitter
populated on every row, 6 of 6 pytest tests passing. Full files
and the verification log live with the HN pipeline artefact on
the portfolio.

## What this example teaches

- Green tests against a fixture prove the code matches the
  fixture. Only a live-page check proves it matches the site.
- An all-empty column is a failed run waiting to be noticed.
  Required-column guards turn it into an immediate failure.
- Structural selectors outlast class names. Pick the hook least
  likely to change, then test that it still matches.
