Add interactive UK Chat answer walkthrough - #10
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
vahid-ahmadi
left a comment
There was a problem hiding this comment.
Reviewed the six-stage flow against PolicyEngine/policyengine-uk-chat at 6ade3b1, since that's what you asked for. The short version: the stage data is accurate, and there's a base problem that matters more than anything in the diff.
Technical accuracy — verified against source
Every stage checks out:
- Ground —
groundProposedPlanmatches_EMIT_PLAN_TOOLexactly (gateway/runtime.py:143-278):domain_status,capability_status,tool,catalogue_queries[{kind, query}]. - Resolve —
resolveCatalogueMatchmatchesCatalogueMatch(gateway/catalogue.py:16-20, 45-50), andauthoritative: trueis right forstrong_phrase, sinceauthoritativeismatch_type != "fuzzy_suggestion". - Gate —
gate(in_domain=…, tool=…, unmodellable_outputs=[])uses real parameter names (gateway/policy.py:337-346), and{outcome, gating_reasons}is exactlyGateResult(:87-89). Elidingslotsandpromptis the right call for an illustration. - Verify —
emit_reform_assessmentandrequire_approved_reform: truematchgateway/assessment.py:97-118andtools/context.py:47-52. - Calculate —
compute_budgetary_impact(simulation_id=<result_id from run_society_simulation>)gets the naming subtlety right, which is easy to miss: the store returnsresult_id, the derivatives take it assimulation_id. - Stream — every event in
streamEventSequenceis real (chat/events.py,chat/public_service.py:67-119), includingthinking_done, which our version omits. - Method line —
Enhanced FRS 2024–25, release 1.56.13matchesengine/constants.py:28-33.
Two notes rather than corrections:
- Reform shape. You use flat
{path: 30.0}; the version onmainuses a date-keyed map.REFORM_SCHEMAaccepts both ("scalar values or date-to-value maps",tools/definitions.py:23-27), and yours is the schema's own example — arguably the better choice, since passingyear=2026and a2026-01-01.2026-12-31key reads as redundant. Worth settling on one; I'd take yours. confidence: 95andscore: 0.9are plausible illustrations rather than observed values. Only the ≥80 confidence threshold is in source (assessment.py:18). Fine as illustration, just flagging that they aren't reproducible.
The blocker: this branch is based on 18cb354, before #8
main moved this morning. Merging as-is would revert, silently:
- The £0.9bn computed result box and its table —
worked-resultappears 9× on your base and 0× here. That's the article's only real, sourced number, and the interactive's answer panel paraphrases it in prose rather than showing it. - Beta framing throughout — hero tag, introduction, Limitations, CTA. That came out of Max and Vahid's 1:1 and is a launch decision, not a preference.
- "How policy analysis is done today" — the narrative leg agreed in the same 1:1.
- Call/return examples on all 21 tools — Pavel's feedback, derived from
tools/definitions.pyand the handlers. - Three factual corrections verified against the chat repo. The most important: this branch restores "the language model receives the calculation tools plus a machine-readable description of what the deployed engine can compute: its capabilities and parameter schema". That is not true — the system prompt (
prompts/system.py) and all 21 tool schemas are hand-written, and engine-derived truth only reaches the model when it calls discovery tools.mainnow says the model has to ask. - Two of David's fixes from #7 — the
AI modelsegment label and "these models".
A rebase on main would surface all of this as conflicts rather than losing it quietly.
What I'd suggest keeping from #9 when you rebase
Your interactive is better than what it replaces, and I'd drop three things from our side in its favour: the static screenshot in the introduction (yours shows the interface properly), the CallTrace component, and the six-stage scrollytelling — the interactive does both jobs in one place, and a structural review had already flagged that section as roughly a quarter of the article by scroll for a diagram that only highlights one of six boxes.
Three things I'd argue to keep, though:
- The computed result box, after the interactive's answer. The answer panel says "about £0.9 billion a year"; the box states the year, the comparator, the dataset release, and the three-line table. For a piece arguing that figures should be checkable, showing the number with its provenance is the payoff, and prose alone gives that up.
- The per-tool examples. They answer Pavel's ask directly and they're independent of the walkthrough — one tool each, in isolation, whereas the interactive shows one path through five.
- The corrected boundary paragraph, for accuracy rather than preference.
Happy to do the rebase and resolve it if that's easier than untangling it — say the word. The other thing worth deciding together: whether the article keeps a static six-stage view at all once the interactive is in, or whether the interactive is the only place those stages appear.
e41e3ce to
3527e14
Compare
Summary
Why
The article benefits from showing readers how one request moves through UK Chat rather than describing the same lifecycle twice in static prose. The interactive keeps the user prompt and response recognizable while exposing the gateway and deterministic calculation boundaries alongside it.
Validation
bun run checkgit diff --checkReview request
@vahid-ahmadi, could you review the technical accuracy of the six-stage flow, especially the gateway resolution and verification stages and the public tool sequence in Calculate/Stream?