fix(fixtures): scorer regex accepts digits + first validated baselines (6 scenarios, avg 99/100)#17
Merged
Conversation
…s for 6 scenarios Two related changes from a real-API bench run across the five new scenarios added in PR #15: 1. Scorer regex bug fix. extractEmittedIssueCodes() used [A-Z_]+ as the character class for code names, which silently dropped any code with a digit. LEASE_SECTION_20_MAJOR_WORKS contains "20" and was therefore invisible to the scorer, producing a false "expected code missing" failure on the leasehold scenario. Fixed by adding 0-9 to the class. The leasehold scenario's Matter Quality Score moves from 94.0 -> 100 purely from this fix. 2. First validated baselines for the five new scenarios plus a refreshed baseline for freehold-enforcement-and-undisclosed-occupier. All six captured in packages/fixtures/BASELINES.md with full metrics and regression rules. Summary: freehold-enforcement-and-undisclosed-occupier 97.0 / 100 freehold-clean-with-satisfied-restriction 97.0 / 100 freehold-resolved-boundary-dispute 100.0 / 100 freehold-missing-building-regs-cert 100.0 / 100 freehold-disclosure-inconsistency-flooding 100.0 / 100 leasehold-short-lease-and-escalation 100.0 / 100 Average: 99.0 / 100 Pattern-signal hit rate across all six: 21 / 21 (100%) Taxonomy code hit rate across all six: 18 / 18 (100%) Over-flagging across the 3 scenarios with antipatterns: 0 / 8 3. Marketing updates reflecting validated truth: - Trust card "Severity calibrated" now states the corpus size, code count, and the average score with the actual number. - FAQ wrapper now references the six validated scenarios with the concrete average score and the "every planted issue detected / zero over-flagging" claim. Both numbers (six scenarios, 99/100 average) are verifiable in the BASELINES.md table. If the bench gets re-run and the average shifts beyond a small margin, the marketing copy must be re-validated. Refs: GPT external review of v2 bench, "Matter Quality Score" + scenario breadth; feedback_marketing_must_reflect_truth.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Real-API bench run across the five new scenarios from #15, plus a regex bug fix the run surfaced, plus the first validated marketing claims that survive the truth-check.
Bench results
All six scenarios scored EXCELLENT (90+):
Average: 99.0 / 100. 21/21 signals across all six. 18/18 codes across all six. 0/8 over-flags across the three scenarios that have antipatterns.
The two scenarios at 97 lose 3 points each to a single "unexpected" code emission:
PLANNING_BUILDING_REGS_MISSING(defensible inference from the enforcement notice) andTITLE_RESTRICTION_CONSENT(model emitted the code for the Form A restriction but correctly placed it at LOW severity, so the code emission is observation not over-flagging).Scorer regex bug discovered + fixed
The leasehold scenario initially reported 4/5 codes hit. Investigation showed the pipeline emitted the right code (
[CODE: LEASE_SECTION_20_MAJOR_WORKS]) in the right place. The scorer'sextractEmittedIssueCodes()used[A-Z_]+which silently dropped any code containing a digit - soLEASE_SECTION_20_MAJOR_WORKS(with "20") was invisible. Fixed by adding0-9to the character class. Leasehold scenario re-scored at 100/100 after the fix.What this changes
packages/fixtures/src/score.ts: regex character class[A-Z_]+->[A-Z0-9_]+inextractEmittedIssueCodes. With a comment explaining why so the same bug doesn't get reintroduced.packages/fixtures/BASELINES.md: six validated baselines (refreshed enforcement scenario + five new ones) with metrics, regression rules, and a summary table.apps/marketing/src/sections/trust.tsx: "Severity calibrated" card body now states "Validated against six adversarial conveyancing scenarios with an average Matter Quality Score of 99 out of 100" (both numbers grep-verifiable in BASELINES.md).apps/marketing/src/sections/faq.tsx: wrapper answer now references the six validated scenarios with the concrete average score and the "every planted issue detected / zero over-flagging" claim.Test plan
pnpm typecheck- 9/9 workspaces passpnpm check- 0 errors, 3 pre-existing warningspnpm build- 3/3 tasks passCost of this PR
~$4.50 of Anthropic API calls (5 fresh scenario benches at ~$0.90 each).
Honest gaps in the corpus
leasehold-flat-with-issues,freehold-house-clean,freehold-house-edge-cases) have NOT been re-benched in this session. They are in the scenarios registry but not in BASELINES.md. Status: TODO for a follow-up run.TITLE_OVERRIDING_INTERESTS,TITLE_DEFECTIVE_INDEMNITY_REQUIRED,LEASE_ALTERATIONS_CONSENT,SEARCH_CONTAMINATED_LAND,OCCUPIER_TENANCY_UNDISCLOSED,MORTGAGE_OFFER_EXPIRY_RISK). Growth should follow pilot patterns, not speculation.Brand and liability check
Moat level
L5 / L7 - the proprietary bench corpus crosses from 1 measured to 6 measured, and the marketing now has measured numbers behind it for the first time. Each baseline metric is a regression guard for future prompt or model changes.