ted_pl: cite both licence bases, rescrub missed e-mails and phones (v0.2.6, v2#57)

#75
by ppuzio - opened
Fabryka AI org
•
edited 1 day ago

What and why

v0.2.6 rights audit for ted_pl (TED tenders, 15,544 docs, LicenseRef-TED-Notice-Reuse). Actions from slayerlabs/polish-dynaword-v2#57: (a) cite both licence bases, (b) full e-mail/phone/name scan. release: None is kept; the source is not admitted here. Admission waits for the NERGAL pass (slayerlabs/polish-dynaword-v2#60).

Before -> after

The text was rebuilt from the TED API, not patched. python3 src/build_ted_pl.py --output <work dir> --data data/ted_pl rebuild re-fetches exactly the 15,544 notice ids already in the parquet (Search API batches of 100, official XML where the API has no narrative), applies redact_pii once to the raw text and installs the parquet, attribution hashes, sample, stats and QA. Raw downloads stay in the work directory and are not committed. Result of the fetch: 15,544 of 15,544 resolved (0 unresolved, so the "keep the old row" fallback was never needed and is not implemented; a mismatched document set raises), raw bytes sha256-identical to the original acquisition for all notices (api, xml and source hashes), no API key, no terms prompt, no rate limiting. Document set and order unchanged. The intermediate rescrub step (first commit of this PR, 1ceac95) is removed with its tests; the regex tests stay.

v0.2.5 (main) rescrub 1ceac95 rebuild (this push)
documents 15,544 15,544 15,544
characters 112,883,460 112,878,041 112,881,592
cl100k_base tokens 42,475,098 42,471,550 42,473,050
[Telefon] spans / docs 470 / 237 950 / 483 785 / 408
[PII] spans / docs 1,080 / 703 1,093 / 714 1,093 / 714
parquet sha256 200960adfce7874dd0d1c1b35bd1785484f762c3f25ae90f3aaca80faddadd21 0b6382ce590bcda97f11d6af02a2c492d0ac4176cdcf7fab5f53c281dd1b722b b3217a59ee7fbf7ce8899ba6d39eb5991fae2f9d68026f48bdd232b2cb49714a

Against the rescrub: 164 [Telefon] spans in 81 docs are restored (amounts, quantities, part and catalogue numbers, one procurement code, one bank account); a further 295 docs differ only because phone labels ("Tel.:", "telefon") are now kept in the text and only the number is replaced. One bare "Tel.:" line (ted_pl_663681-2023) is now dropped as a chunk under 20 characters after redaction. Boilerplate: one chunk removed, as before (threshold 155 docs instead of 205 because the corpus is smaller). [PII] does not move: labelled PESEL/NIP/REGON are still replaced (see below). Sample membership is unchanged by the rebuild. No parquet was hand-edited.

Licence bases (relabel)

Registry text (src/sources.py), datasheet, NOTICE.md and the new data/ted_pl/ted_pl.license-evidence.json cite both, each with URL, retrieval date, sha256 of the page and extracted text, and the clause relied on.

  • EU basis (read, V): TED legal notice, the "unless otherwise noted ... freely reused" sentence for notice text (the CC BY 4.0 sentence covers SIMAP editorial content, the CC0 sentence system metadata); Commission Decision 2011/833/EU of 12 December 2011, arts 1 and 2(1), which covers Commission documents only.
  • Polish basis (read, inference, NOT lawyer-signed-off): Copyright Act (Dz.U. 2025 poz. 24) art. 4 pkt 2; Open Data Act (Dz.U. 2023 poz. 1524) arts 2 pkt 8, 3, 5 pkt 1, 6 ust. 2, 14 ust. 1, 15.
  • Open points, recorded in the evidence file and datasheet: Open Data Act art. 5 covers the obliged entity's own BIP/system whereas TED is an EU system; company-form authorities (3,110 of 15,544 docs by a heuristic on author) may not be "podmioty zobowiazane"; art. 4 pkt 2 applied to a tender notice is untested; per-notice third-party and individual exceptions are not cleared beyond the old 60-record spot check; BZP equivalence is unchecked.
  • Page hashes: the TED legal notice is dynamic, so a re-fetch gave a different byte hash (both recorded) with all quotes present. The EUR-Lex re-fetch of Decision 2011/833/EU timed out; the earlier capture's hash is recorded.

PII scan (all 15,544 docs)

kind result action
e-mail 13 addresses in 13 docs missed by the v0.2.5 step (33 docs contain "@", 20 are not addresses, e.g. "Wielkopolsk@ 2030") redacted to [PII] in the rebuild; one regression found and fixed on the way ("tod@.wodociagi.katowice.pl", stray dot after the @, test added)
phone v0.2.5 missed 480 numbers; the same extended rules now run on the raw text [Telefon], label kept
personal names 172 docs by a heuristic (116 given-name list + 60 honorific, overlap 4); lower bound not redacted; NERGAL handles them

Raw-text pattern counters of the rebuild: e-mail 1,832, labelled national ID 242, phone 2,441. Rules in src/build_ted_pl.py: wider e-mail form, labelled phone, bare phone, prefixed phone, dashed phone, continued number, unspaced 9-digit after " - ". Each has positive and negative tests (45 tests in src/test_ted_pl_contract.py, including idempotence and a build+install test on a 2-notice API fixture).

Hand check of 10 restored spans

Old (rescrub) text had [Telefon], rebuilt text has the value. All 10 correct, none identifies a person:

  • amounts: ted_pl_96037-2024 "w kwocie 199 998 723,10 zł"; ted_pl_244198-2024 "520.000.000,00 złotych"; ted_pl_251403-2024 "150.000.000,00 zł"; ted_pl_679171-2023 "200 000 000,00 PLN"; ted_pl_507970-2023 "3 000 000 000 (trzy miliardy) PLN"
  • quantity: ted_pl_141676-2024 "230 000 000 j. m."
  • part and catalogue numbers: ted_pl_131542-2024 "rys. nr 20.008.150.002"; ted_pl_236159-2024 "150-022-002"; ted_pl_232043-2024 "NR KAT. 433.302.002.0"
  • procurement code: ted_pl_220094-2024 "PUZ-2380-025-060-025/2024/DZ"
  • NIP/REGON/KRS: none restored (see below).

Fresh sample of 12 random [Telefon] spans in the rebuilt text (seed 20261006): 11 real phone or fax numbers, 1 part number (ted_pl_283348-2024 "( 008.003.000 )"). Dotted 3-3-3 part numbers are still read as phones: 5 spans in 2 docs. One restored span is a contracting authority's bank account (ted_pl_691833-2023, wadium account); bank accounts are not redacted by any rule (1,111 docs, about 2,100 numbers, nearly all authority wadium accounts).

Company and sole-trader identifiers

Company NIP/REGON did NOT come back. NATIONAL_ID_RE (labelled PESEL/NIP/REGON -> [PII]) is unchanged since v0.2.5, so the rebuild redacts them for companies too: 242 matches in the raw text (NIP in 66 docs, REGON in 38, PESEL in none). Making them survive means narrowing that pattern, which is a policy change and would also expose the sole traders below; I did not do it. Say if you want it.

Sole traders (a contractor or author that looks like a natural person with an NIP or REGON next to the name), checked by reading all 136 distinct contexts: 1 doc. Masked: ted_pl_167339-2024 "... W*** PARTNER D*** A***, (ul. P*** X, XX-XXX W***, NIP XXX-XXX-XX-XX)". Three near-misses carry personal names but are partnerships (spółka jawna): ted_pl_91828-2024 ("ELEKS" - J*** K*** S*** J***, ul. F*** XX, XX-XXX W*** (REGON XXXXXXXXX)), ted_pl_156428-2024, ted_pl_183186-2024. No contracting authority (author) is a natural person. Their identifiers are [PII] in the text; their names are not redacted.

Tests (python -m pytest -q, repo root, venv)

  • before (v0.2.5 tree): 22 failed, 260 passed, 7 errors (all from LFS-pointer parquet files in other sources; none in ted_pl)
  • after: 22 failed, 305 passed, 7 errors; the failure set is identical (29 FAILED/ERROR ids diffed), +45 new tests all pass. test_ted_pl_contribution.py::test_ontology_is_addressed_and_falsifiable passes.

Files

data/ted_pl/* (parquet, attribution, sample, stats, qa, datasheet, NOTICE, new license-evidence), src/build_ted_pl.py, src/test_ted_pl_contract.py (new), src/sources.py (ted_pl entry only), artifacts/source_findings.md (appended). Also artifacts/ted_pl_ontology_manifest.json: outside the planned file list, but test_ted_pl_contribution.py pins the sha256 of the parquet and build script through its checksums evidence, so the pins had to move with the data. The historical 2026-09-08 runs[].stats is left as recorded.

Provenance

Chain: official TED Search API (20,588 Polish-labelled records; the PleIAs mirror is an identifier index only) -> ted_pl build 2026-09-08 (20,588 acquired, 15,544 kept) -> the 15,544 kept notices re-fetched by id and rebuilt in v0.2.6 (this PR). Licence summary: reuse terms of the TED legal notice plus the Polish public-body inference; label LicenseRef-TED-Notice-Reuse unchanged. src/ted_pl_requirements.txt, referenced by prepare(), is missing (pre-existing, not touched).

render_sample.py -n 3

id: ted_pl_623789-2023
source: ted_pl
added: 2026-09-08
created: 2023-10-16
token_count: 502
license: LicenseRef-TED-Notice-Reuse
author: TAURON Wytwarzanie S.A.

Dostawa elementów układu mielenia młynów pierścieniowo - kulowych do rozdrabniania węgla zainstalowanych w oddziałach TAURON Wytwarzanie S.A.

Elektrownie TAURON Wytwarzanie S.A.

Dostawa elementów układu mielenia młynów pierścieniowo - kulowych do rozdrabniania węgla zainstalowanych w oddziałach TAURON Wytwarzanie S.A. Szczegółowy opis przedmiotu zamówienia będzie zawarty w SWZ.

Dostawy preparatów firmy HIDROFILT

TAURON Wytwarzanie Spółka Akcyjna – Oddział Elektrownia Nowe Jaworzno w Jaworznie.

Dostawy preparatów firmy HIDROFILT. Szczegółowy opis przedmiotu zamówienia będzie zawarty w SWZ.

Dostawy siarczanów żelazowych PIX 112 i PIX 113

Dostawy siarczanów żelazowych PIX 112 i PIX 113. Szczegółowy opis przedmiotu zamówienia będzie zawarty w SWZ.

Dostawy PENTOMAGU 2550

Dostawy […]
id: ted_pl_787720-2023
source: ted_pl
added: 2026-09-08
created: 2023-12-26
token_count: 12525
license: LicenseRef-TED-Notice-Reuse
author: Skarb Państwa PGL LP Nadleśnictwo Henryków

Wykonywanie usług z zakresu gospodarki leśnej na terenie Nadleśnictwa Henryków w roku 2024 – przetarg nr 2

Przedmiotem zamówienia są usługi z zakresu gospodarki leśnej zgodnie z określeniem w art. 6 ust. 1 pkt. 1 ustawy z dnia 28 września 1991 r. o lasach (tekst jedn.: Dz. U. z 2023 r. poz. 1356 – „Ustawa o lasach”) obejmujące prace z zakresu hodowli i ochrony lasu, ochrony przeciwpożarowej, pozyskania i zrywki drewna do wykonania na terenie Nadleśnictwa Henryków w roku 2024.

I Pakiet pod nazwą „Pakiet 5 – L. Strachów 1 część, Muszkowice, (w załącznikach do SWZ stosowany jest skrót „pakiet 1 – L. Muszkowic”

II Pakiet pod nazwą „Pakiet 6 – L. Witostowice 2 część, Niedźwiedź, (w załącznikach do SWZ stosowany jest skrót „pakiet 2 – L. Niedźwiedź

W ramach kryterium „Cena” ocena ofert […]
id: ted_pl_22708-2024
source: ted_pl
added: 2026-09-08
created: 2024-01-12
token_count: 1721
license: LicenseRef-TED-Notice-Reuse
author: Politechnika Wrocławska

SZP/242-005/2024 Dostawa symulatorów medycznych w ramach potrzeb Wydziału Medycznego Politechniki Wrocławskiej

SZP/242-005/2024 Dostawa symulatorów medycznych w ramach potrzeb Wydziału Medycznego Politechniki Wrocławskiej 1. Przedmiotem zamówienia jest dostawa symulatorów medycznych w ramach potrzeb Wydziału Medycznego Politechniki Wrocławskiej, tj.: 1) zaawansowany symulator osoby dorosłej wraz z jednostką sterującą, systemem rejestracji i akcesoriami - 4 szt. 2) zaawansowany symulator małego dziecka wraz z jednostką sterującą, systemem rejestracji i akcesoriami - 1 szt. 3) zaawansowany symulator noworodka wraz z jednostką sterującą, systemem rejestracji i akcesoriami - 1 szt. 4) zaawansowany system debriefingu z wyposażeniem AV do prowadzenia sesji symulacyjnych, OSCE i zarządzania CSM […]

🤖 Generated with Claude Code

ppuzio changed pull request status to open
ppuzio changed pull request status to merged
ppuzio deleted the refs/pr/75 ref

Sign up or log in to comment