Skip to content

Add GOV.UK mirror + task verifiers (site by @lamawmouk, verifiers by reviewer)#67

Open
Django-Jiang wants to merge 5 commits into
aiming-lab:mainfrom
Django-Jiang:review/gov_uk-verifiers
Open

Add GOV.UK mirror + task verifiers (site by @lamawmouk, verifiers by reviewer)#67
Django-Jiang wants to merge 5 commits into
aiming-lab:mainfrom
Django-Jiang:review/gov_uk-verifiers

Conversation

@Django-Jiang

Copy link
Copy Markdown
Contributor

Reviewer grading contract for the GOV.UK mirror. Based on @lamawmouk's original PR #32 (site + 20 tasks); this branch adds the deterministic verifiers + judge_rubric that the reviewer role is responsible for. Ground truth lives only inside the verifiers — tasks.jsonl gets verifier_path + judge_rubric only (no answer key).

Review summary

Mechanical: PASS

  • 17 sites HTTP 200; control plane healthy
  • Byte-identical reset on gov_uk (md5 of instance/ vs instance_seed/ match)
  • reset-all ~1s
  • .assets-revision pins a real HF commit SHA (d02361e…); gov_uk.tar.gz resolves

Visual + functional: PASS

  • Homepage / browse topics / guidance detail / organisation pages / announcements render with GOV.UK-faithful layout (driven via Playwright)
  • Read-only site (no auth/CRUD); search + navigation work end-to-end

Task quality: PASS — no task changes required

  • All 20 tasks are solvable on-site; ground truth is unique and present on the expected page
  • Fact questions (Personal Allowance, State Pension, VAT rate, etc.) are real-world values, so the verifiers require navigation evidence to the specific guidance page — a correct answer with no on-site navigation is a knowledge-shortcut and FAILs
  • Fact answers are NOT leaked in search-result cards (confirmed: £12,570 / £221.20 / 20% appear only in the article body).
  • Known weakness — tasks 11 & 19 (minor leak, flagged not fixed): the answer figures (11.5 million / 30 million) appear in the announcement titles, and the mirror has no per-announcement detail route, so the figure is readable at listing level (/government/announcements / homepage) without a further click. These two are weaker anti-shortcut tasks than the other 18. The verifier still requires navigating to the announcements area and matching the figure, but it can't require a deeper page that doesn't exist. Not fixed in this PR because the titles live in the contributor's seed DB, which is a pinned HF-managed asset (instance_seed/gov_uk.db) — regenerating and re-uploading it is out of scope for a reviewer verifier PR (and real GOV.UK headlines do carry the figure). Suggested follow-up for @lamawmouk: add a per-announcement detail route (mirroring /guidance/<slug>) and keep the figure in the story body rather than the headline, so these two tasks force one level deeper of navigation.

Grading contract added

  • sites/gov_uk/verify/verify_lib.py + verify_0.pyverify_19.py (one per task)
  • tasks.jsonl: verifier_path + judge_rubric backfilled for all 20 tasks
  • Deterministic-first: navigation evidence + answer/token match against frozen ground truth. The anchored LLM utility is secondary (rejects only on genuine contradiction; skipped when unavailable, so it never fails a correct answer)

Grading validated three ways

  • no-op run (homepage only, empty answer) → FAIL on all 20 (no false positives)
  • correct solve → PASS on all 20 (deterministic layer, --no_llm True)
  • wrong-answer and no-navigation (shortcut) → FAIL as expected
  • Also confirmed through the primary eval_judge.py --verifier True entry point (correct → PASS, no-op/shortcut/wrong → FAIL)

lamawmouk and others added 5 commits May 24, 2026 18:48
Adds a Flask mirror of https://www.gov.uk/ as the 16th WebHarbor site,
running on port 40015.

## What's mirrored

- 16 top-level topics (Money and tax, Visas and immigration, Driving, ...)
- 44 subtopics
- 15 government departments (HMRC, DfE, Home Office, DVLA, NHS England, ...)
  with real ministers / permanent secretaries / employee counts
- 73 guidance articles (Self Assessment, Income Tax, Universal Credit,
  Skilled Worker visa, passport applications, vehicle tax, ...)
- 20 announcements (press releases, news stories, speeches)
- Search across articles / announcements / departments

## Visual fidelity

Uses the official MIT-licensed govuk-frontend v6.1.0 CSS + JS + GDS
Transport font + crown SVG. Templates use the canonical Design System
component DOM (govuk-header, govuk-breadcrumbs, govuk-summary-list,
govuk-pagination, govuk-grid-row, etc.) so an agent's selectors match
the real GOV.UK.

Content licensed under the Open Government Licence v3.0 (synthesized
in the spirit of GOV.UK guidance; no upstream copy embedded).

## Folder layout

Matches the canonical site layout (compare wolfram_alpha, google_search):

  sites/gov_uk/
  |-- _health.py
  |-- app.py
  |-- seed_data.py
  |-- tasks.jsonl
  |-- instance_seed/        (HF-managed)
  |-- static/{css,js,fonts,icons,images,external_cache}/
  \`-- templates/

## Wiring

- websyn_start.sh: gov_uk appended to SITES, 15->16 counts
- control_server.py: gov_uk added to SITES
- Dockerfile: EXPOSE 40000-40015

## Pre-PR verification (passed)

- docker build webharbor:dev clean (5.92 GB)
- 16/16 sites bind in 2s
- All gov_uk routes (/, /browse, /browse/<topic>, /browse/<t>/<s>,
  /guidance/<slug>, /government/organisations[/<dept>],
  /government/announcements, /search, /_health) return 200
- /reset/gov_uk -> {ready: true}, md5 byte-identical pre/post
- Byte-identical after docker restart

## Asset PR

Seed DB (gov_uk.tar.gz, 32 KB) uploaded as HF PR:
https://huggingface.co/datasets/ChilleD/WebHarbor/discussions/22

.assets-revision will be bumped to the HF merge SHA once that PR lands.
…ta from tarballs

- .assets-revision: point revision at refs/pr/22 so fetch_assets.sh pulls
  gov_uk.tar.gz (it isn't on main yet); TODO bump back to main after merge
- extract_assets.sh: set COPYFILE_DISABLE=1 and use --no-mac-metadata /
  --no-xattrs so repacks on macOS no longer embed ._* AppleDouble files or
  com.apple.* xattrs (feature-detected; safe on GNU tar)
Replace the empty tasks.jsonl ([] placeholder) with 20 grounded,
answerable tasks in the standard JSONL format
({web_name,id,ques,web,upstream_url}, port 40015). Coverage spans
guidance fact-finding (Income Tax, VAT, State Pension, Self Assessment),
department lookups (minister, headcount, established year),
announcements, search, and topic browsing. Each task's answer was
verified to exist in instance_seed/gov_uk.db.
# Conflicts:
#	.assets-revision
#	control_server.py
#	websyn_start.sh
Add the reviewer grading contract for the GOV.UK mirror (site + 20 tasks by
@lamawmouk, PR aiming-lab#32):

- sites/gov_uk/verify/verify_lib.py: shared deterministic + anchored-LLM
  utilities (trajectory navigation, answer/token match). This site is read-only,
  so there is no DB after-state check.
- verify_0.py .. verify_19.py: one deterministic verifier per task.
- tasks.jsonl: backfill verifier_path + judge_rubric for all 20 tasks.

Grading is deterministic-first: navigation evidence (anti knowledge-shortcut,
which is what makes real-world-fact questions like the Personal Allowance or VAT
rate valid navigation tasks) plus answer/token match against frozen ground truth.
The anchored LLM check is secondary — it can only reject on a genuine
contradiction and is skipped when no LLM is configured, so it never fails an
otherwise-correct answer.

Validated: a no-op run FAILs all 20; a correct solve PASSes all 20; wrong-answer
and no-navigation (shortcut) cases FAIL as expected. Also confirmed through the
primary eval_judge.py --verifier True entry point.
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