feat(t2): Phase 2 legal_representatives extraction for CZ#137
Merged
Conversation
Adds extraction of legal_representatives[] from ARES Veřejný rejstřík
(VR view) to cz-company-data.ts. Flips tier_2_available: true on records
with active statutory body members. Cost-free (free public ARES endpoint).
Canonical shape: { type, name, role, role_code, role_group, date_of_birth,
nationality, start_date } — extends the NO/IT-stakeholders shape with
nationality (statniObcanstvi) and start_date (vznikFunkce/vznikClenstvi).
Also surfaces signing_authority (způsob jednání) from the same record.
Scope:
- Includes Statutární orgán members (představenstvo / jednatel) + Prokura
- Excludes supervisory bodies (ostatniOrgany, e.g. dozorčí rada) — not
legal representatives by Czech commercial law
- Filters out historic entries (datumVymazu present) and ended memberships
(zanikClenstvi present)
- VR view fetch is opportunistic (404 → empty array, no failure) since
sole traders / associations / foreign branches lack a VR record
Live verified:
- Škoda Auto a.s. (00177041): 7 active representatives extracted (6 board
members + 1 procurist); fixture written with PII scrubbed
Also adds legal_representatives to capture-tier-fixtures PII_ARRAY_FIELDS
so future captures across all handlers stay PII-redacted (parallel of the
same edit on feat/phase-2-extraction-no — both branches need it).
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>
Picks up the 2026-05-18 last_verified shift on cz-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>
c1d1bc0 to
5ff9161
Compare
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
Adds
legal_representatives[]extraction tocz-company-data.tsvia the ARES Veřejný rejstřík (VR view). Flipstier_2_available: trueon records with active statutory body members. Cost-free (free public ARES endpoint, no auth).Sibling of #136 (NO). Together: +2 binding-ready T2 in this Phase 2 sprint.
Audit phase
ekonomicke-subjekty-vr/00177041.tier_2_available: falsewith a follow-up-task reason — false claim on a record where the field IS extractable.zaznamy[primary].statutarniOrgany[].clenoveOrganu[]to canonicallegal_representatives[]shape. ExtractzpusobJednani(manner of acting) assigning_authority. Fliptier_2_availablebased on populated representatives.Scope decisions
Statutární orgán(představenstvo / jednatel) members +Prokura(registered procurators).ostatniOrgany(other bodies — supervisory boards / dozorčí rada). Per Czech commercial law, supervisory bodies do not legally represent the company.datumVymazuset) and ended memberships (clenstvi.zanikClenstviset).Smoke test
npx tsx apps/api/scripts/capture-tier-fixtures.ts --slug cz-company-data:legal_representativesredacted by the PII scrubber.Important: cross-PR coupling on PII scrubber
apps/api/scripts/capture-tier-fixtures.tsaddslegal_representativestoPII_ARRAY_FIELDS— the same edit is in #136. Either PR landing first satisfies the dependency; the second commit no-ops the addition. First capture before this fix accidentally produced real-PII fixture (7 Skoda board members with full DOBs + nationality). Caught + deleted pre-commit; the fix is now baked in here.CI gates
tsc --noEmit: clean for changed files (one pre-existing unrelated error initalian-company-stakeholders.ts:54).check-tier-coverage.mjs: 11 findings, 0 not in allowlist. CZ added totier-coverage-allowlist.txtfor the pre-existing alias-key drift from PR feat(evidence-tier): labeling sweep across 31 company-data handlers #131 (legal_name / primary_registration_id / etc. not in manifest output_schema — separate cleanup).check-fetch-timeout-coverage.mjs: clean (fetchVrByIcousesAbortSignal.timeout(10000)).check-manifest-guaranteed-consistency.mjs: clean.Files
apps/api/src/capabilities/cz-company-data.ts— adds VR-view types +fetchVrByIco+shapeRepresentatives; wires parallel BE+VR fetch.manifests/cz-company-data.yaml— declares new fields (legal_representatives,total_legal_representatives,signing_authority,tier_2_available,tier_2_available_reason) in schema + reliability.apps/api/scripts/capture-tier-fixtures.ts— addslegal_representativesto PII_ARRAY_FIELDS (same edit as feat(t2): Phase 2 legal_representatives extraction for NO #136).apps/api/scripts/tier-coverage-allowlist.txt— allowlists CZ for pre-existing alias-key drift.apps/api/tests/fixtures/tier-coverage/cz-company-data.json— re-captured with new fields.apps/api/coverage-matrix/cz-company-data__cz__company-registry.yaml— bumpstier_2_coverage: 4/5 → 5/5.Test plan
capture-tier-fixtures— 7 reps extracted🤖 Generated with Claude Code