feat(t2): Class A labeling fix for FR + SK + UK + SE YAML cleanup#133
Open
petterlindstrom79 wants to merge 2 commits into
Open
feat(t2): Class A labeling fix for FR + SK + UK + SE YAML cleanup#133petterlindstrom79 wants to merge 2 commits into
petterlindstrom79 wants to merge 2 commits into
Conversation
Implements verified Class A findings from 2026-05-18 verification reports. Flips tier_2_available to true on three handlers where the labeling sweep wrongly set false despite handler emitting populated directors. Per-country: - FR: handler already emits directors[] from INPI RNE; flip flag, add legal_representatives canonical alias, rewrite reason string - SK: handler already emits directors[] from RPO statutoryBodies; same pattern as FR - UK: bundle uk-companies-house-officers extraction into uk-company-data so single CA call returns officers inline; flip flag, add alias - SE: YAML annotation removed "directors via Bolagsverket" claim that handler doesn't deliver; Phase 4 ships SE extraction properly Lifts EU30 binding-ready T2 from 2 (DE, GR) to 5 (DE, FR, GR, SK, UK) with no per-call cost increase. Phase 1 of the cost-free coverage sprint per 2026-05-18 launch-shape decision. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
10 tasks
petterlindstrom79
added a commit
that referenced
this pull request
May 18, 2026
Two inline fixes from the /go six-lens review on PR #133: - Pass A correctness: removed 404 swallow in fetchOfficers. Previously the officers endpoint 404 silently produced legal_representatives=[] with tier_2_available=true, which made the flag misleading in the rare case where /company/{n} succeeds but /company/{n}/officers returns 404. Now the 404 propagates as a structured error consistent with fetchCompany. - Quality consistency: guarded the legal_representatives assignment with the alias-block invariant pattern (if undefined). Matches surrounding canonical-alias resolution and FR sibling. Deferred (PR-body MEDIUMs): cross-country shape mismatch, manifest output_field_reliability gap, items_per_page=100 truncation guard, SE YAML roadmap-state phrasing, reason-string voice, auth-header duplication. See PR description for details. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two inline fixes from the /go six-lens review on PR #133: - Pass A correctness: removed 404 swallow in fetchOfficers. Previously the officers endpoint 404 silently produced legal_representatives=[] with tier_2_available=true, which made the flag misleading in the rare case where /company/{n} succeeds but /company/{n}/officers returns 404. Now the 404 propagates as a structured error consistent with fetchCompany. - Quality consistency: guarded the legal_representatives assignment with the alias-block invariant pattern (if undefined). Matches surrounding canonical-alias resolution and FR sibling. Deferred (PR-body MEDIUMs): cross-country shape mismatch, manifest output_field_reliability gap, items_per_page=100 truncation guard, SE YAML roadmap-state phrasing, reason-string voice, auth-header duplication. See PR description for details. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
petterlindstrom79
added a commit
that referenced
this pull request
May 18, 2026
* feat(t2): Class A labeling fix for FR + SK + UK + SE YAML cleanup Implements verified Class A findings from 2026-05-18 verification reports. Flips tier_2_available to true on three handlers where the labeling sweep wrongly set false despite handler emitting populated directors. Per-country: - FR: handler already emits directors[] from INPI RNE; flip flag, add legal_representatives canonical alias, rewrite reason string - SK: handler already emits directors[] from RPO statutoryBodies; same pattern as FR - UK: bundle uk-companies-house-officers extraction into uk-company-data so single CA call returns officers inline; flip flag, add alias - SE: YAML annotation removed "directors via Bolagsverket" claim that handler doesn't deliver; Phase 4 ships SE extraction properly Lifts EU30 binding-ready T2 from 2 (DE, GR) to 5 (DE, FR, GR, SK, UK) with no per-call cost increase. Phase 1 of the cost-free coverage sprint per 2026-05-18 launch-shape decision. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * review: address /go six-lens findings inline (UK) Two inline fixes from the /go six-lens review on PR #133: - Pass A correctness: removed 404 swallow in fetchOfficers. Previously the officers endpoint 404 silently produced legal_representatives=[] with tier_2_available=true, which made the flag misleading in the rare case where /company/{n} succeeds but /company/{n}/officers returns 404. Now the 404 propagates as a structured error consistent with fetchCompany. - Quality consistency: guarded the legal_representatives assignment with the alias-block invariant pattern (if undefined). Matches surrounding canonical-alias resolution and FR sibling. Deferred (PR-body MEDIUMs): cross-country shape mismatch, manifest output_field_reliability gap, items_per_page=100 truncation guard, SE YAML roadmap-state phrasing, reason-string voice, auth-header duplication. See PR description for details. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(t2): Phase 2 legal_representatives extraction for NO Adds extraction of legal_representatives[] from Brreg /roller endpoint to norwegian-company-data.ts. Flips tier_2_available: true. Cost-free (uses existing free anonymous Brreg endpoint; name + birth date only, fnr requires Maskinporten which is out of scope here). Canonical shape: { type, name, role, role_code, role_group, date_of_birth } mirroring italian-company-stakeholders. role_group is Brreg rollegruppe (STYR, DAGL, SIGN, PROK, etc.); role_code is the per-member rolletype (LEDE/NEST/MEDL/VARA/OBS for STYR; same as group for single-role groups). Filters out resigned (fratraadt) and deregistered (avregistrert) roles. Live verified: - Equinor ASA (923609016): 16 active representatives extracted Lifts binding-ready T2 by +1. Phase 2 of cost-free coverage sprint. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(coverage-matrix): regenerate COVERAGE.md for NO last_verified bump Picks up the 2026-05-18 last_verified shift on norwegian-company-data from the previous commit. CI gate `coverage-matrix:check` requires COVERAGE.md to be in sync with the per-row YAML files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Phase 1 of cost-free coverage sprint. Lifts EU30 binding-ready T2 from 2 (DE, GR) to 5 (DE, FR, GR, SK, UK). No per-call cost increase; all upstream sources already in use.
Three Class A audit-bug fixes (FR, SK, UK) plus one YAML drift cleanup (SE), per the 2026-05-18 verification reports (
audit-output/registry-source-research-2026-05-18.md+ handler-side directors verification).What changed per country
french-company-data.ts) — handler already emitteddirectors[]from INPI RNE viarecherche-entreprises.api.gouv.fr; PR-131 labeling sweep wrongly settier_2_available: false. Flipped totrue, addedlegal_representativescanonical alias mirroringdirectors, rewrote reason string.slovak-company-data.ts) — handler already emitteddirectors[]from RPOstatutoryBodieswith active-only filter. Same Class A fix as FR.uk-company-data.ts) — bundled Companies House Officers extraction inline (newfetchOfficers()running in parallel withfetchCompanyviaPromise.all).legal_representatives[]populated with canonical{name, role, start_date}for active officers. Sibling capabilityuk-companies-house-officers.tspreserved standalone.swedish-company-data__se__company-registry.yaml) — annotation removeddirectors via Bolagsverketclaim handler doesnt deliver. SE extraction deferred to Phase 4.Verification
validate-capability.ts: SK 19/19; FR 19/20 + UK 19/20 — the single failed gate (company_nameentry point lacks fixture) is pre-existing on main, not introduced by this PRsmoke-test.ts: SK 11/11 live; FR/UK 10/11 with step 2 blocked bycost_class=paid_prepaidALLOW_MATRIX (expected, same on main)checkReadiness: requires DATABASE_URL, skipped locally; covered byvalidate-capabilityground/go six-lens review — findings
Inline fixes applied (commit
87d21ae)o.legal_representatives = officers;toif (o.legal_representatives === undefined) o.legal_representatives = officers;matching the surrounding canonical-alias block invariant.fetchOfficers404 swallow (Pass A senior-developer) — removedif (response.status === 404) return [];. Previously a 404 on the officers endpoint silently producedlegal_representatives: []withtier_2_available: true, making the flag misleading. Now propagates as a structured error consistent withfetchCompany.MEDIUM findings flagged for chat-side decision (not blocking)
legal_representativesshape mismatch (Pass B product, originally HIGH) — FR/SK emitstring[]("FirstName LastName (Role)"and formatted-name respectively); UK emitsArray<{name, role, start_date}>. A multi-country normalizer cannot treat them uniformly. This is prompt-directed (Phase 1 prompt saidmirror existing directors arrayfor FR/SK and structured shape for UK), so I did not auto-fix. Demoted from HIGH because the design was deliberate; surfacing here for explicit decision before customers bind to the contract. Two ways to close:{name, role, start_date}(FR can splitprenoms/nom/qualite; SK has onlyformatedNamesorole/start_datewould benull).output_field_reliabilitygap (Pass A protocol) — manifests for FR / SK / UK do not yet declarelegal_representatives. Per DEC-20260320-B Capability Onboarding Protocol the new field should be annotated (likelyreliability: common— empty for shell entities or unpopulated cases). Follow-up PR.3/5 (VAT via VIES routing; directors integration planned Phase 4). The "planned Phase 4" phrasing bakes a roadmap promise into a coverage-matrix artifact. Consider rewriting to describe state only (e.g.directors not extracted from this source).tier_2_available_reasonvoice (Pass B UX) — the new strings read past-tense passive ("Legal representatives extracted from...") rather than caller-oriented ("Returns active legal representatives from..."). Voice diverges from theubo_availability_reasonstyle in the same files. Pattern-consistency call.items_per_page=100with no follow-up page orlegal_representatives_truncatedflag. Rare edge case (FTSE-100 conglomerates with 100+ active officers + lifetime resignations), but mirrors the FR audit finding documented indocs/fr-directors-truncation-2026-05-15.mdthat we already fixed there. Consider parity.Basic ${Buffer.from(key + ":").toString("base64")}now appears 3× inuk-company-data.tsplus 1× in siblinguk-companies-house-officers.ts. Extract to a shared helper in a follow-up.What this PR does NOT do
uk-companies-house-officers(kept standalone)legal_representatives(flagged as follow-up)Doctrine
ubo_availabilitycapability state (parallel pattern)Test plan
checkand Coverage matrix validation passed onc2e4974; re-running on87d21ae)/v1/doreturning each handler — confirmtier_2_available: trueandlegal_representatives[]populatedGenerated with Claude Code