Skip to contents

cvmdata (development version)

New features

  • cvm_arguments() says, for one table, which arguments of cvm_fetch() are required, optional or not allowed, and the values each one takes: basis is required for the statements published individual and consolidated and refused elsewhere, as_of only applies to a registry, year not to a single snapshot. It reads the same table schemas that cvm_fetch() checks its arguments against, so the two never disagree; a test holds them together for every table.

  • cnpj_lookup() finds a company’s CNPJ by name, or part of one, in the three CVM company registers (cad/companhias, cad/estrangeiras, cad/incentivadas). Every word must appear, in any order, ignoring case and accents. It lists every match, cancelled registrations included, and never picks one: the CNPJ you choose goes to cvm_fetch(cnpj = ), which still takes only a CNPJ or a ticker. The error cvm_fetch() gives for a name passed as cnpj now points to it.

Minor improvements

  • year passed to a table without yearly files (cad, recompra_acoes) is now refused with the other argument checks, before the ticker lookup, as the help of cvm_fetch() says. It was refused later, by the reader, with the same message.

Bug fixes

  • Reading the mirror no longer goes through the GitHub API, which allows 60 requests an hour per IP address without a token. On a shared address (a CI runner, a university network) the limit could run out, and the 403 that followed was reported as “Release tag … may not exist yet”. The list of files of a mirror release now comes from the index the release publishes (__source_hash.json), read from its download URL, which has no such limit, as pinned dates already were. The API is only the fallback for a release without a readable index; there, an exhausted limit is reported as such, with the advice to set GITHUB_PAT.

cvmdata 0.3.1 (2026-11-16)

Bug fixes

  • The mirror now returns the same columns as the CVM. It added a year column (the partition value of its files) that source = "cvm" does not have, so the same code gave different columns depending on the source. cvm_fetch() and cvm_versions() drop it.

  • year = NULL with a company that has no filing in the latest yearly file now steps back to the year before, up to three years, with a cvmdata_warn_year_fallback warning, from the mirror as from the CVM. The mirror returned zero rows without a word (for example, the consolidated income statement of any civil-year company while the DFP file of the current year only holds the companies with another fiscal year). Both sources now share one implementation of the step back.

Both were found by reading the same tables from the two sources in the owner’s review script (data-raw/revisao-do-dono.R).

cvmdata 0.3.0 (2026-11-15)

The version submitted to rOpenSci. One function, cvm_fetch(), reads the nine datasets of the CVM group of listed companies (104 tables); cvm_versions() returns every version of a filing; the default source is a dated, checksummed mirror that carries data about companies, with a first edition deposited on Zenodo (DOI 10.5281/zenodo.24260441). The sections below list every change since 0.2.0, the most recent first within each.

New

  • The data of the mirror can be cited: the first Zenodo edition was published on 2026-11-15, DOI 10.5281/zenodo.24260441; 10.5281/zenodo.24260440 resolves to the latest edition. citation("cvmdata") now gives the data as well as the package, and the README says how to cite.

⚠️ Breaking changes

  • The mirror and the Zenodo editions carry data about companies, not about people. The tables in which the CVM describes natural persons left the mirror: fre administrador_membro_conselho_fiscal, membro_comite, relacao_familiar, relacao_subordinacao, responsavel, auditor_responsavel, posicao_acionaria, posicao_acionaria_classe_acao and transacao_parte_relacionada, and fca dri (besides the three counts of declarations of board members, already out). cvm_fetch() and cvm_versions() now read a table that is not in the mirror from the CVM by themselves, with a message (class cvmdata_message_unmirrored), instead of failing; they still fail under an explicit source = "mirror" and under cvm_release_set() with a date, because the CVM has no dated snapshot. In the tables that stay, the columns that name a person are gone: resp, tp_resp, dt_ini_resp, mun_resp, uf_resp and pais_resp in the cad; contato and its dates in fca/departamento_acionistas; the technical lead in fca/auditor; cpf_auditor in fre/auditor, where the row of an auditor who is a natural person is left out. The reason: whether hosting personal data on services abroad is an international transfer under the LGPD (art. 33; Resolução CD/ANPD nº 19/2024) could not be settled, and reading from the CVM on the user’s machine redistributes nothing. The entries below about masked CPFs, birth years, biographies and people who ask to leave now matter only for what a text about a company happens to mention.

  • The mirror and the Zenodo editions no longer redistribute full CPFs and birth dates. The CVM publishes them by legal duty; a public and permanent deposit keeps only what research needs. Every CPF, in the columns that hold it (cpf*, documento_*) and in free text, becomes ***.456.789-**, the way the Federal Revenue publishes its open CNPJ data; a foreign document in those columns becomes ***; and data_nascimento (fre: administrador_membro_conselho_fiscal, membro_comite) becomes the integer column ano_nascimento. Names and CNPJs stay as published, and the masked CPF plus the name still follow a person across tables. Scripts that read data_nascimento from the mirror need ano_nascimento, or source = "cvm", which still reads everything from the CVM untouched. The dated snapshots are rewritten too, so cvm_release_set() returns the masked values for past dates. See “Personal data” in ?cvm_fetch.

  • The biography column experiencia_profissional of the fre tables administrador_membro_conselho_fiscal and membro_comite is no longer in the mirror or in the Zenodo editions. The texts mention union and party membership, elected office, religion, health and convictions, which the Brazilian LGPD treats as sensitive data (art. 5, II; art. 11), and no list of words separates those texts from the others safely. Profession, position, body and dates of office stay. Scripts that read the column need source = "cvm".

  • A person named in the mirror can ask to leave it. The robot reads a private list (never in the repository) and, for each person on it, keeps the row and replaces the name with [omitido a pedido do titular], empties the columns that describe the person (masked CPF, birth year, profession, nationality) and replaces a mention of the name in any text of the dataset. Seats, dates of office and shareholding percentages stay, so counts and sums are unchanged. The sidecar of each release carries only how many people asked (privacy_suppressed), and a run whose list is shorter than the previous one stops instead of putting somebody back.

  • The mirror has a privacy notice, PRIVACY.md and PRIVACY.pt-BR.md (the Portuguese version prevails): what the mirror leaves out, what a text about a company may still say about a person, who answers for it and how to ask for a name to be removed. It is linked from the README and from DATA-LICENSE.md, cited in the notes of every mirror release and shipped inside the Zenodo editions. The procedure for requests is in data-raw/decisions/.

  • DATA-LICENSE.md and the README of the Zenodo editions now say that the ODbL does not license the personal data in the tables: the licence governs the rights over the database (its section 2.4), and whoever reuses the names answers for that processing under the law that applies to them.

  • The five fre tables that count employees by race, gender or disability (empregado_PCD, empregado_local_declaracao_genero, empregado_local_declaracao_raca, empregado_posicao_declaracao_genero, empregado_posicao_declaracao_raca) come from the mirror without the companies that, in a year, have a group of fewer than 10 people or a group in which everybody declared the same category. Nobody is named in these tables, so a count is anonymised data while it cannot be traced to a person (LGPD, art. 12); in a group of one, or in a unanimous one, it can. The whole filing of the company leaves the table, so no row can be rebuilt by subtraction. Measured on the 2025 FRE: 10% to 11% of the companies by position, 29% to 32% by region and 38% in empregado_PCD, holding 0.1% to 15% of the people counted. Totals computed from these tables are now lower than the CVM’s. Reading one of them raises the new warning cvmdata_warn_privacy_omitted with the companies and the share of people left out in each year; the numbers stay in the new attribute omitted, which print() announces and which survives dplyr verbs; and a company asked for by cnpj or ticker that was left out is named, instead of zero rows that would read as “did not file”. The Zenodo editions carry the same numbers in privacy_omitted.csv. source = "cvm" reads every company.

  • Three fre tables left the mirror and the Zenodo editions: administrador_declaracao_genero, administrador_declaracao_raca and administrador_PCD. They count the gender, race and disability declarations of board members by body, and the members of each body are named in another table: in a body where everybody declared the same, the count is the declaration of each person (measured on the 2025 FRE: 68% of the race rows and 84% of the disability rows). Race and health are sensitive data under the LGPD (art. 5, II), which gives a private person no ground to redistribute them (art. 11), and gender identity is argued to be. cvm_fetch() and cvm_versions() now refuse these tables under the default source with cvmdata_error_input and point to source = "cvm", which reads them from the CVM as before. Their partitions and history assets are removed from the -latest release at the next publish and from the dated snapshots after it. The workforce tables (empregado_*) are unchanged.

  • The mirror and the Zenodo editions no longer carry contact data. The columns of e-mail, telephone and fax are gone from every table, for people and for companies alike (email, tel, telefone, fax, their ddd_*, ddi_* and cd_pais_* parts and the *_resp variants), and so is the street address of a person: logradouro_resp, compl_resp, bairro_resp and cep_resp in cad, and logradouro, complemento, bairro and cep in fca dri and departamento_acionistas and in fre auditor_responsavel. The address of the company (cad, fca endereco and escriturador) stays, and so do the city, state and country of a person. The field of the company is not spared because small companies declare somebody’s own address there: 296 of the 696 company e-mails of cad incentivadas are webmail. Scripts that need these columns read them with source = "cvm". The dated snapshots are rewritten once more, with a public record here.

  • The four skeleton fetchers fund_fetch(), agent_fetch(), offering_fetch() and event_fetch(), exported since v0.1.0.9000 as placeholders that only aborted, are gone, and so is their condition class cvmdata_error_input_group. The 2026-05-25 architecture of five fetchers by data contract is superseded: a single function serves every dataset, and the groups planned for v0.4-v0.8 (funds, agents, offerings, events) will extend cvm_fetch() through their schemas instead of shipping new functions. cvm_groups() keeps its contract column as a planning map.

  • issuer_fetch() is removed; use cvm_fetch(). Select issuers with cnpj or ticker instead of issuer, and the statement basis with basis instead of report_type. The issuer argument guessed what it was given (CNPJ, CVM code, ticker or company name) and, when a name matched several companies in an interactive session, opened a utils::menu(); a data function should take an input of a known type and never stop to ask. Those paths are gone with it: look a CVM code or a company name up in cvm_fetch("cad", "companhias"), which carries cd_cvm, denom_social and cnpj_cia side by side. The package no longer imports lifecycle.

  • cvm_fetch() and cvm_versions() lose validate: on_error is now the single error strategy, with two modes. "abort" (default) stops with a classed error when a CVM file departs from its schema (cvmdata_error_parse, what validate = "strict" did) or when one of several yearly files fails to download (cvmdata_error_http). "warn" reads the file anyway (cvmdata_warn_validation) and returns the years that downloaded (cvmdata_warn_partial_failure). The two arguments answered the same question with two vocabularies, and the silent modes (validate = "skip", on_error = "silent") hid the problem with no trace; suppressWarnings() around a "warn" call does that on purpose. Passing validate aborts with this migration. The articles also said the eight FRE tables without a published META could only be read with validate = "warn"; they always read under the default, checked against the header their schema declares.

  • The submissao table of every dataset (dfp, itr, fre, fca, cgvn, vlmo) now returns the complete filing history: one row per delivery, re-filings included, each with its receipt date (dt_receb / data_entrega), document id (id_doc / id_documento / protocolo_entrega) and versao, as the CVM publishes it. The schemas no longer declare keep_latest_version for it; the detail tables still keep the last delivery. The CVM statement CSVs carry a single version per filing, so submissao was the only place the history could be read from, and the index is where the Travessia and TRV cases of the 0.2.0.9000 fixes below are visible. Code that joins submissao to a detail table on the issuer and reference date now matches every delivery; to get the current filing, keep the last row per key:

    sub |>
      dplyr::arrange(dt_receb, as.integer(id_doc), as.integer(versao)) |>
      dplyr::slice_tail(n = 1, by = c(cnpj_cia, dt_refer))

    The fetch-time check that warns about a stale filing (cvmdata_warn_stale_filing) computes that row itself before comparing. The parquet mirror (source = "mirror", the default) carries the history once the weekly ETL republishes the six datasets with this version of the package; until then it serves the collapsed index.

New features

  • The mirror gets quarterly editions with a DOI. Four times a year (the first weekly round of January, April, July and October) the ETL prepares, as a Zenodo draft the maintainer publishes by hand, the whole mirror as it stood on that day: every dataset, the superseded versions, the column dictionary, the code lists, the data licence and the checksums, one version of a single record per edition. The release notes of every mirror release now describe what the assets are (layout, transformations, dictionary) for whoever downloads them without the package. The first edition is January 2027; the weekly snapshots keep serving the dates in between, without a DOI.

  • New dataset recompra_acoes (programas de recompra de ações) in the companhias group, with three tables: recompra_acoes (one row per buyback program, with the issuer’s CNPJ), intermediarios (the brokers of each program) and quantidades (share quantities by type and class). The CVM publishes the whole history, since 1997, as one ZIP without a year, so the tables take no year or from/to, like cad. The two child tables carry only id_programa: cnpj and ticker select the issuer’s programs in recompra_acoes and keep the child rows of those programs, declared in their schemas as issuer_via. The mirror publishes the dataset from the first run of its weekly ETL.

  • The help of cvm_fetch() gains a section Arguments by table that states, in one place, which tables take year and from/to, which require basis, which accept reading and as_of, the tables that start after their dataset or are published empty from a year, and the tables cvm_versions() covers. The section is generated from the table schemas when the documentation is built, by the same predicates the argument checks call (R/util-table-arguments.R), so it cannot drift from what the checks enforce; a test holds the two together for every table and pins the rendered text. Measured on the 74 tables: no argument is refused after a download, every refusal happens before.

  • Dated snapshots of the mirror. Every weekly ETL run that changes something now also publishes the release mirror-<group>-<dataset>-snapshot-<YYYY-MM-DD>, carrying the partitions whose content changed (the first one carries every partition) and a complete __source_hash.json that says, for each partition of that day’s mirror, which snapshot release holds its bytes. Snapshots are never deleted; -latest keeps being rewritten in place, so older clients work unchanged. Measured in October 2026 over 144 weeks of CVM deliveries, a weekly round changes about 60 MB (11% of the partitions), so the snapshots cost about 3.5 GB a year against 32 GB for a full copy per week.

  • cvm_release_set() / cvm_release_get() and the option cvmdata.mirror_release pin a session to the mirror as it was on a date: cvm_release_set("2026-11-01") resolves to the most recent snapshot on or before that day and every cvm_fetch() and cvm_versions() call with source = "mirror" reads from it, so a script reproduces the same bytes months later. "latest" (the default) follows the weekly refresh. A date before the first snapshot of a dataset is an error that names the earliest date available. Under a pin, cvm_versions() drops the history rows superseded after the pinned date.

  • Every cvm_tbl carries a seventh provenance attribute, release: the GitHub release the rows were read from when source = "mirror" (the snapshot tag, or the -latest tag for a release older than the snapshots), NA for source = "cvm". print() shows it next to source; rbind() / vctrs::vec_rbind() reconcile different releases to "mixed" like the other attributes.

  • Integrity of mirror downloads. The sidecar now publishes the SHA-256 and size of every parquet, and the client checks both: a cached copy that does not match (a truncated download, or the same partition from another snapshot) is replaced, and a download that does not match is discarded and aborts with the new condition class cvmdata_error_http_integrity (a subclass of cvmdata_error_http). A parquet DuckDB cannot open is removed from the cache so the next call downloads it again. Before this, a corrupt parquet was a cache hit for ever. As a consequence, a weekly change of the mirror no longer evicts the whole dataset from the local cache: only the partitions whose bytes changed are downloaded again.

  • The cvm_tbl class and its provenance attributes now survive group_by() and every verb after it (summarise(), mutate(), filter(), select(), ungroup(), [), and rbind() / vctrs::vec_rbind() of several cvm_tbls (dplyr_reconstruct(), dplyr_row_slice(), dplyr_col_modify(), group_by(), ungroup(), summarise(), [, names<-, rbind(), vec_ptype2() and vec_cast() methods). Before, group_by() dropped the class and the next verb dropped the attributes without a word, and vec_rbind() returned a plain tibble. When the inputs of rbind()/vec_rbind() differ in source, group, dataset, table or package_version, the result says "mixed" and fetched_at keeps the oldest timestamp. dplyr::bind_rows() keeps the first input’s provenance, dplyr’s rule for every data frame subclass, and ?cvm_tbl says so. ?cvm_tbl also lists which operations keep the provenance and which drop it by design; printing a cvm_tbl whose attributes were stripped no longer shows a header of empty fields.

  • cvm_versions() returns every known version of a filing, the current one included: cvm_versions(dataset, table, cnpj, ticker, year, basis, ...), the identifying part of cvm_fetch()’s signature, without its row filters (reading, from/to and as_of are refused by name). The result has the columns of the table plus superseded_at, superseded_by_versao, history_source, id_doc and motivo_reapresentacao; the rows of the current version carry history_source = "current" and no supersession. Only the tables that keep a single filing per document (keep_latest_version in their schema) have a history; asking for another aborts. On the mirror (the default) the call reads the history asset the ETL keeps next to each partition: the filings replaced since 2026-10 and, for the DFP and ITR statements, the ones recovered from the CVM’s filing system back to 2010 (history_source = "rad"). With source = "cvm" it reads the yearly CSV without collapsing it, which keeps only the versions the CVM still publishes, usually just the current one, with no dates; the call says so. Measured on the consolidated DFP income statements of 2023: Petrobras filed twice with the same net income; Braskem three times, version 1 in R$ units (a loss of R$ 4.5 million) and version 2 “to reflect the R$ thousand scale” (R$ 4.89 billion); 108 issuers of the 2024 statement had a version superseded, 14 of them with a different net income. cvm_fetch() is unchanged and keeps ignoring the history assets.

  • cvm_versions() gains a sixth version column, scale_error, that tells a superseded version filed in the wrong unit from a true restatement. About one superseded DFP or ITR version in twenty is a filing in R$ units where the form asks for R$ thousand (or the reverse), replaced within days by the same figures a thousand times larger; without a mark the row a thousand times smaller read as a restatement. The ETL now judges every superseded version once, over the whole document (the eight statements, individual and consolidated), and writes one of three values: "apenas erro de escala" (every shared account differs by the same factor of 1000 and neither version has an account the other lacks), "erro de escala e outras mudanças" (more than half of the shared accounts follow one factor of 1000, but some changed otherwise or exist in one version only) and "sem erro de escala" (everything else, the current version included). The rule reads the ÚLTIMO rows, leaves out the per-share accounts (3.99*) and takes a zero on both sides as saying nothing. Measured on the 6,825 superseded versions of DFP 2010–2025 and ITR 2011–2026: 353 “apenas”, 28 “e outras mudanças” (Braskem DFP 2023 version 1 among them: the scale and other operating expenses, R$ 360 million higher in version 2), every one of them recovered from the RAD. A call whose result holds such a version says so once, with a message (suppressMessages() silences it); NA marks a version the ETL has not judged yet.

  • cvm_fetch() is the single public fetcher, built on the same pipeline as issuer_fetch(): cvm_fetch(dataset, table, cnpj, ticker, year, from, to, basis, ...).

    • Issuers are selected by cnpj (CNPJ only, with or without punctuation; a CVM code or a company name aborts) and/or ticker (B3 trading code, resolved through fca/valor_mobiliario from the same source). The free-text and CVM-code lookups of issuer were not carried over: the registry cvm_fetch("cad", "companhias") is the place to resolve a name or a code to a CNPJ.
    • The period is year (whole published years, as before) or a from/to window of complete dates: the yearly files spanned by the window are read and rows are kept by the document’s reference date (dt_refer / data_referencia). Giving both aborts, as does an incomplete date or a window on a snapshot table such as CAD.
    • basis replaces report_type for the tables published in individual and consolidated variants: "ind", "con" or c("ind", "con"), which stacks both. There is no default, because many issuers file only individual statements. Those tables always carry a basis column in the result, on both backends; the mirror’s report_type partition column no longer leaks through cvm_fetch().
  • cvm_fetch() gains reading, for the DFP and ITR statement tables (the ones with ordem_exerc): the two readings of a fiscal exercise, side by side. Every yearly file carries the exercise it is about (ÚLTIMO) and the comparative the issuer presented for the previous one (PENÚLTIMO), and the comparative is often restated: about a third of the DFP issuers in 2023 restated 2022 (Porto Seguro’s consolidated total assets of 2022 are R$ 50.5 bn in the 2022 file and R$ 39.9 bn in the 2023 one). With reading = "original" the call returns the ÚLTIMO rows of the file of year; with reading = "restated", the PENÚLTIMO rows of the file of year + 1, which the call reads on its own; with both, the two stacked. Rows come as published, with a reading column appended: dt_refer and versao are those of the document each row came from, and dt_fim_exerc (plus dt_ini_exerc) identify the exercise. An exercise whose following file is not published yet has no restated reading, and the call says so. from/to then apply to the exercise end. The default, reading = NULL, returns each file as before, ÚLTIMO and PENÚLTIMO together and no reading column. Two things the data showed while measuring: in the ITR, the comparative of a balance sheet is the previous year end, not the previous year’s quarter; and the banks, which adopted CMN Resolution 4,966 in 2025 without restating, carry the 2024 comparative of their individual statements as zeros, which the restated reading returns as the CVM publishes them.

  • Delisted companies (decisions of 2026-10-21, after a quant reader’s questions):

    • cvm_fetch("cad", "companhias", as_of = "2015-12-31") keeps the registrations in force on a date: registered on or before it and not cancelled by it. The register is today’s state of every registration ever granted (cancellations back to 1984 are three quarters of the file), so this is the survivorship-free universe a backtest needs; the rows are still today’s (a company cancelled in 2017 is in the 2015 universe with sit = "CANCELADA"), because the CVM does not publish past states of the register. Registry tables declare the date columns in their schema (as_of:); every other table rejects the argument. Measured against the 2015 DFP index: 599 of the 633 filers fall inside the 640-company universe, the 34 outside being 11 companies absent from the register and 23 that registered in 2016 and filed the 2015 statements on registration.
    • ticker now resolves against every yearly fca/valor_mobiliario file that carries trading codes (2018 onwards; the column is empty before), not only the file of the latest requested year. A code that left the exchange (GOLL4, BPAN4) resolves for any year, and PETR4 resolves for years before 2018, which used to abort. A code that maps to more than one issuer now aborts asking for cnpj instead of picking one; none does today.
    • The register’s key, (cnpj_cia, cd_cvm, tp_merc), is documented in ?cvm_fetch (section Company register): 107 registrations repeat in rows that differ only in tp_merc, and 34 CNPJs hold two registrations under distinct CVM codes. The file is returned as published; the recipe for one row per registration is in the help.
  • A year the table is not published for is refused before any download. A table can start later than its dataset: the CVM’s yearly ZIP simply lacks its CSV before then. The schemas now declare the measured first year of 19 tables that used to claim 2010 or 2011 (composicao_capital of the DFP and ITR from 2020; fourteen FRE tables such as acao_entregue, remuneracao_variavel and the diversity tables from 2023; mercado_estrangeiro from 2019, titular_valor_mobiliario from 2018, titulo_exterior from 2016; measured on the mirror’s inventory and confirmed in the ZIP members). cvm_fetch() aborts with cvmdata_error_input (“not published for”) when year names an earlier year, and a from/to window drops the years the table does not exist for, saying so. The backend errors for a CSV missing from a ZIP, or a partition missing from the mirror, now say the table is not published for that year instead of blaming the schema.

Data coverage

  • Two new tables in cad, the CVM’s other company registers: cvm_fetch("cad", "estrangeiras") (foreign companies, 27 rows) and cvm_fetch("cad", "incentivadas") (companies registered under the tax-incentive regime, 3570 rows). Like cad/companhias they are one file with today’s state of every registration, and as_of applies. Their issuer column is cnpj (not cnpj_cia), which cnpj = now recognises; they have no tp_merc. In cad/incentivadas, cd_cvm is empty for about 40% of the rows and several CNPJs were cancelled and registered again; the rows stay as the CVM publishes them. The codelist generator leaves four free-text columns of cad/estrangeiras (resp, auditor, cidade, estado) out of the snapshot: with 27 rows they stay under the cardinality cap.

  • The 25 legacy fre tables are covered: tables the CVM published in the yearly FRE ZIPs from 2010 and then dropped (endividamento, obrigacao, distribuicao_dividendos, historico_emissor, plano_recompra, ativo_imobilizado and 19 more), measured on every ZIP 2010-2024. Twenty end in 2023, the three capital_social_*_classe_acao in 2022, and grupo_economico_reestruturacao and valor_mobiliario_tesouraria_ultimo_exercicio in 2016. Each has a single header across its years. Five have no CVM-published META (distribuicao_dividendos, distribuicao_dividendos_classe_acao, endividamento, informacao_financeira, obrigacao) and follow the meta_status: missing path of the eight current ones. They are read with the corrected reader of this release from the start.

  • New schema field last_year: the last year whose ZIP carries the table. cvm_fetch(), cvm_versions() and issuer_fetch() refuse a later year with cvmdata_error_input before downloading, a from/to window is cut at it with a message, and year = NULL on such a table aborts asking for an explicit year, rather than resolving to the dataset’s latest year (where the table does not exist) or silently to the table’s last year (old data passed as current). The mirror ETL no longer schedules the later years.

  • Corrected the declared first_year for the v0.2 datasets, which had been set to 2021 — the year they were first verified — rather than the earliest year the CVM directory listing actually serves. first_year now equals min(cvm_dataset_years()) for every yearly table: fca reaches back to 2010, ipe to 2003, and cgvn and vlmo to 2018. The CSV headers in those earlier years already match the current schema, so the data reads cleanly under strict validation. This invariant matters because first_year is now load-bearing: both the year-clamp (below) and the ETL’s expected-year enumeration key off it, so a value above the listing minimum makes the clamp reject — and the mirror ETL hard- fail on — years the portal genuinely publishes. The new data-raw/audit-first-year.R checks the invariant against the live portal.

Bug fixes

  • The reader of the mirror’s index no longer fails on a skip entry whose missing field is encoded as an empty object ({}) instead of null. The one-off repair of the sidecars on 2026-11-07 wrote the fre index that way and every read of fre failed for about an hour with “arguments imply differing number of rows”; the index was written again, and the reader now takes both encodings as a missing value.

  • A mirror pinned to a date other than its latest snapshot (cvm_release_set("2026-11-04")) no longer fails with cvmdata_error_http_integrity on the partitions that had not changed since an earlier snapshot. The ETL rewrites every parquet on every run, and two runs over the same rows write different bytes (the file’s metadata carries the run’s fetched_at); the sidecar of a dated snapshot published the digest of the file just written while pointing the client at the earlier snapshot’s bytes, so the download check rejected a correct file. The dated sidecar now carries the digest of the bytes it points to, carried over from run to run, and the sidecars already published were rebuilt from the bytes themselves (inst/etl/repair-snapshot-digests.R). Found by the digest check of the Zenodo edition robot on 2026-11-07.

  • A passing failure of GitHub or of the CVM portal no longer fails the call on the first answer. The package asked for each file up to three times but repeated only on HTTP 429 and 503, so the 504 that the download host of GitHub Releases returned on 2026-11-05, for files that were there, stopped cvm_fetch() and cvm_versions() at once. Every request now follows one rule: an HTTP 5xx, a 429 and a request with no response are tried up to four times, with growing waits (about fifteen seconds in the worst case). A 4xx is never retried, since the same request would bring the same answer: a file that does not exist is still reported immediately. When the four attempts fail, the cvmdata_error_http says so and suggests trying again in a few minutes; the error of the release listing no longer suggests that the release “may not exist yet” when GitHub answered a 5xx.

  • An unreadable __source_hash.json is a warning, never silence. The sidecar of a mirror release was requested once and any failure was swallowed, which left the session exactly as if the release had none: cached files served without checking that the release still held them, downloads not verified against the published digests, a missing year without its reason, and under a pinned date the error “has no dated snapshots yet”. The request now follows the retry rule above; if the sidecar still cannot be read, the call goes on with a cvmdata_warn_sidecar_unread warning that says what the session goes without, and the first call after five minutes asks for it again. Under a pinned date the call stops with the real reason.

  • cvm_versions() returned filings “superseded” by their own versao (versao == superseded_by_versao, history_source = "mirror"). The files of the CVM carry the name its register holds for the company today, in every row of every year; when a company is renamed the CVM rewrites that label under the same filing, and the mirror’s history took each rewrite for a re-filing. Three renames in the week of 2026-11-03 (Light S.A. left court-supervised reorganisation, Ambipar and Environmental ESG entered it) filed 99,070 such rows: 20,886 in dfp, 75,701 in itr, 2,051 in fre, 432 in cgvn, with nothing but the name changed. The register’s name is now left out of the comparison (denom_cia, nome_companhia, and nome_empresarial in cgvn; in fca that column is the name the company typed in the form and still counts), so a rename is no longer a version, as it is not one for the CVM. The first publish of each dataset after this change removes the rows already filed; an asset left without rows stays as an empty file. The old name remains in the dated snapshot of the mirror (cvm_release_set()).

  • The mirror of fca had not been republished since 2026-10-27. The weekly ETL appends the filings superseded in the week to the history asset of each partition, and the history of endereco 2026, written when telefone was still read as a number, could not be joined with rows that hold it as text: the publish of fca stopped there, three attempts in a row, on 2026-11-03. The join now brings both sides to one type first. The history follows the current reading: a column now read as text is stored as text, a text column now read as a date or a number is converted when every stored value survives, and otherwise both sides stay as text, so a change of type never stops a publication again. The same join serves the RAD backfill. For the same reason cvm_versions("fca", "endereco", year = 2026) showed the superseded telephone numbers as "30462550.0"; the asset is rewritten with "30462550" the next time a filing of that partition is superseded.

  • cvm_fetch("fre", "transacao_parte_relacionada", year = 2022:2023) failed with “Can’t combine taxa_juros and ”: the CVM publishes the interest rate as free text since the 2023 FRE (“CDI + 1,50% a.a.”, “N/A”), and the dictionary still declared it numeric, so each year was guessed on its own. The dictionary snapshot is rebuilt from the CVM META of 2026-11-01, which declares it varchar: taxa_juros is now character in every year, with the value as published ("0.000000", no longer 0). The same refresh brings 81 declared sizes up to date (cvm_dictionary()’s tamanho: CNPJ and CPF columns 20 -> 18, among others); sizes do not change the reading. The mirror’s history treats a change of declared types as a change of reader, so re-reading the old years does not file them as re-filings.

  • cvm_fetch("cad", "companhias") returned the phone columns fax, fax_resp and tel_resp as numbers, while tel and the other phone columns of the package are text. The CVM’s META declares the three numeric; the reader now keeps them as character, so a number starting with zero cannot lose it. Measured on 2026-11-01 over the 2,678 rows of the register, no value had lost anything yet (the leading zeros were only the CVM’s 0 placeholders); these were the only phone columns of the dictionary still read as numbers.

  • cvm_codelist() listed free text as categories and missed values in use. The codelists were sampled from the latest year alone, and in May that was a 2026 with five months of filings (one DFP). Measured on 2026-11-01 over every year: 13 of the 178 columns were free text (auditor names, hand-written nationalities, download links; 66 to 14,013 distinct values) and 49 lacked values (the foreign market country listed 5 of its 31). The snapshot now spans every published year: 12 free-text columns and the escala_moeda columns (dropped by the scale transformation, never returned) leave, 10 columns enter, and the 49 are complete. The CVM’s sector classification (fca/geral/setor_atividade, 66 values) stays a codelist above the 50-value cap on purpose. cvm_codelist() gains first_seen_year and last_seen_year, the first and last year each value appears in. A rate that a quoting defect had filed as a contractual position (“5,13% a.a.”) is gone.

  • The CSV reader lost whole rows and values without a word, and now keeps them. Three defects, measured on 2026-10-25:

    • Quotes. The CVM does not quote: a " in its files is a character of the text, and no field holds the delimiter or a line break. Read with readr’s default quote, a text starting with " swallowed the following lines into one field. In FRE 2024 alone five tables lost 2,803 of 30,679 rows (transacao_parte_relacionada 1,820, administrador_membro_conselho_fiscal 548, remuneracao_total_orgao 206, outro_valor_mobiliario 145, auditor 84), two of them without any warning. The reader now reads with quote = "".
    • Types guessed from the first 1,000 rows. A column empty there was guessed logical and every later value became NA (the CNPJ of fre/transacao_parte_relacionada.documento_parte_relacionada in every year). Columns are now guessed over every row.
    • Text columns read as numbers or logicals. A column the CVM dictionary declares as text (varchar, char) is now always character: 32 such columns came out as logical or double in some year (telephone and fax lost their leading zeros).

    The mirror is rebuilt by the next weekly run. Code that relied on those columns being numeric or logical (e.g. fca telefone/fax) now gets character. The publish keeps a fingerprint of the reader in __source_hash.json (reader); in the run where it changes, the history counts a filing as superseded only when its delivery changed, so rows the old reader lost are not filed as re-filings.

  • Every table now checks the column NAMES of the CVM CSV, not only their count. Until now only the 8 FRE tables without a CVM dictionary had their names checked; in the other 66 a column the CVM renamed or swapped at the same count went silently into the result and into the mirror. The expected names come from the embedded dictionary snapshot (the CVM’s META), compared as a set. Measured before switching it on: the header of every CSV of every yearly ZIP (1,244 headers, 2003-2026) carries exactly the dictionary’s names in all 74 tables. A mismatch is cvmdata_error_parse under validate = "strict" and cvmdata_warn_validation under "warn".

  • The mirror’s __source_hash.json sidecar is now actually read in production. GitHub serves release assets as application/octet-stream, httr2 refuses to parse JSON under that type by default, and the refusal was swallowed into “no hash”, so since the sidecar shipped no installed client had ever evicted a stale L3 copy by hash or quoted the skip manifest in the “No parquet assets match” error (the tests’ mock answered application/json). Found on 2026-10-25 when the first pinned read of a dated snapshot said the mirror had none.

  • The parquet mirror (source = "mirror", the default) had stopped updating in June 2026. The weekly ETL skipped a publish whenever the CVM dictionary files were unchanged, and they rarely change, so new filings, restatements and package fixes never reached the mirror. The publish hash now covers the content of every parquet as well. The vlmo mirror release had also been left as a draft since June, which made source = "mirror" fail for vlmo with a 404; the ETL now publishes the release explicitly and checks it without credentials. Releases are now updated in place instead of deleted and recreated, so the mirror no longer goes empty while a new snapshot uploads, and a failed asset upload is retried before the run gives up.

  • keep_latest_version now keeps the last filing delivered, ranked by receipt date, then CVM document id, then versao, instead of the highest versao. The version number is not a filing key: the DFP 2023 index lists two “version 1” filings for TRV XLIII Securitizadora, and the DFP 2024 index lists versions 1, 2 and again 1 for Travessia Securitizadora VI, the last one being the filing the issuer carries forward. submissao used to return both TRV rows and the superseded Travessia row. Tables with no delivery columns still keep the highest versao.

  • issuer_fetch() checks each table against its dataset’s filing index (submissao). The CVM statement CSVs repeat rows: a sweep of every DFP and ITR file from 2010 to 2026 found 884 issuer-period-table cases with the whole statement doubled and 110 with a few accounts repeated, some from two filings under the same version (TRV XLIII, DFP 2023), most with a single filing in the index. Sums over those issuers counted double. Identical rows are now dropped and cvmdata_warn_duplicate_filing names the issuers; copies that differ in vl_conta are kept and flagged with cvmdata_warn_conflicting_filing. When the table holds an earlier filing than the last delivery (the Travessia case, whose statement CSVs stayed on version 2), cvmdata_warn_stale_filing names the issuers. Both checks run for either backend and can be turned off with options(cvmdata.check_filings = FALSE). See defects #14 and #15 in the data-defects article.

  • The mirror ETL no longer burns a whole runner on a portal that is not answering it. Of the 14 scheduled mirror runs between 2026-06-09 and 2026-09-08, 8 went red, every one of them in stage 01 and on a different (group, dataset) each week, while the sibling jobs on other runners downloaded normally; the 2026-09-08 fre job logged 0 ok / 612 failed, all of them 10 s TCP connect timeouts, after 5 h 51 min — minutes short of GitHub’s 6 h job ceiling. Probing the portal from eight runners in parallel on 2026-09-11 showed it answering in ~0,15 s over IPv4 from every one, each on a different Azure egress IP, so these episodes are the portal dropping some egress addresses for a while rather than anything wrong with the URLs the ETL builds. Three changes follow from that: a transport failure (DNS, TCP connect, TLS, read timeout) now carries the cvmdata_error_http_transport subclass, which an HTTP status such as 404 does not, so “the portal did not answer” is distinguishable from “this file is not published”; stage 01 trips a circuit breaker after 8 consecutive transport failures with nothing yet fetched, exiting 3 in about 5 min instead of walking hundreds of pairs that cannot succeed; and the job carries a 120 min ceiling for the partial outage, where interleaved successes would keep resetting the breaker. A new ETL mirror retry workflow then re-runs only the failed jobs, each landing on a fresh egress IP, up to 3 attempts.

  • CVM portal requests now retry transient failures. cvm_dataset_years() (directory listing) and the source = "cvm" HEAD/GET downloads wrap their httr2 calls in req_retry(max_tries = 3, retry_on_failure = TRUE), so an intermittent portal timeout — which the open-data portal produces sporadically — no longer aborts the call (or the mirror ETL) on the first attempt. Matches the retry already used on the GitHub Releases mirror path.

  • cvm_dataset_years() no longer hard-fails when the CVM directory index is unreachable. After the retries above are exhausted it falls back to the declared coverage range — first_year (now verified to equal the listing minimum) through the current year — and warns with class cvmdata_warn_year_listing_fallback, instead of aborting. This removes the directory listing as a single point of failure for the mirror ETL, which from foreign CI IPs occasionally cannot reach the index even though the per-year archives download fine. A reachable index that genuinely lists no archives still aborts.

  • issuer_fetch() with a free-text issuer and year = NULL no longer aborts with “No issuers match …” when the company is simply absent from the latest probed year (e.g. a header-only current year, or an issuer that has not yet filed). Text matching now participates in the descending year fallback like CNPJ and CD_CVM matching do, walking down to an earlier year that holds the filer; a genuine typo still aborts with the spelling hint on the last candidate year. The same applies to an explicit multi-year request (e.g. year = 2012:2024): a text issuer absent from some of the requested years now contributes no rows for those years instead of aborting the whole span, and the spelling error is raised once only if no requested year matched.

  • issuer_fetch() with explicit years that precede a dataset’s first published year (e.g. year = 2005:2024 for dfp, which starts in

    2010) no longer fails with a raw HTTP 404. The years before first_year are dropped before any request, with an informational message listing them, and the remaining years are fetched normally. When every requested year is too early the call aborts with a clear cvmdata_error_input instead of a network error. This applies to both the "mirror" and "cvm" backends; genuine 404s on years that do exist remain governed by on_error.

  • issuer_fetch() on the current, not-yet-filed year of an annual financial table (e.g. dfp/dfc_md for fiscal 2026 early in 2026) no longer aborts with “non-numeric argument to binary operator”. The CVM publishes a header-only CSV for such years; the multiply_by_scale transform now no-ops on a 0-row table and returns a clean empty tibble.

  • ETL parquet mirror: the pipeline tolerates (table, year) pairs that legitimately produce no parquet, so a single absent year no longer fails the whole dataset publish. Stage 02 records each skipped tuple with a reason — empty (0 rows upstream) or absent (the detail table’s CSV is not in that year’s ZIP because CVM only began publishing it later, e.g. dfp/itr composicao_capital before 2020, or several fre tables in early years) — and stage 02b treats a missing parquet for such a tuple as a soft pass instead of a hard failure. A parquet that is missing without a recorded reason still hard-fails. Fixes the red dfp/itr/fre mirror jobs.

New features

  • A table the CVM publishes without content from some year on is now handled like a table that starts late. The schema records the year (empty_from) and the reason (empty_reason); today only fca/departamento_acionistas, whose CSV has the header only since 2024 because Resolução CVM 59/2021 revoked item 6 of the Formulário Cadastral (in force since 2023-01-02; 546 rows in 2023, zero from 2024 on). An explicit year from that year on is refused before any download (cvmdata_error_input, as for a year before first_year), a from/to window drops those years with a message, and year = NULL warns (cvmdata_warn_empty_upstream) that the latest year has no content: the mirror returns the last year with content, the portal returns the latest file as published, with zero rows. Until now year = NULL returned 2023 from the mirror and zero rows from the portal with no explanation.

  • The mirror now says why a partition is missing. The ETL already recorded every (table, year, basis) it wrote no parquet for, with the reason — empty when the CVM publishes the CSV with the header only, absent when the CSV is not in the yearly ZIP — but kept the record to itself. It now travels inside the __source_hash.json sidecar of each release (no new asset, so existing installations keep working), and the “no parquet assets match” error quotes it for the years it covers. First case it explains: fre/mercado_estrangeiro and fre/titular_valor_mobiliario have no CSV in the CVM’s 2026 ZIP, although the dictionary still lists them and Resolução CVM 80 still asks for the data (items 12.6 and 12.4 of Anexo C).

Documentation

  • The itr-dfp article shows how to compare companies on the CVM’s fixed accounts (st_conta_fixa == "S"), with what a measurement over every DFP and ITR statement found on 2026-11-01. Within one standard chart, the fixed accounts carry the same name in 99.2% of the companies, and the flag of a company’s account changes between years in 0.3-0.4% of cases. Banks and insurers follow other charts, where the same fixed code means something else (3.01 is revenue from sales for Petrobras and revenue from financial intermediation for Itaú). No argument is added, because the column is already in every statement.

  • The data licence is now stated. The CVM publishes every dataset the package covers under the Open Data Commons Open Database License (ODbL) v1.0; the parquet mirror is a derivative database and is redistributed under the same licence. The new DATA-LICENSE.md carries the notice and the attribution, the README (both languages) and the Cache and mirror backend article summarise it, and the notes of every mirror-*-latest release carry the notice from the next publish on. The package code remains MIT.

  • The README (both languages), the DESCRIPTION and the introduction vignette now say up front that the default backend is a parquet mirror of the CVM portal maintained by the package author in GitHub Releases, refreshed weekly, and that source = "cvm" reads the official portal directly. The vignette no longer claims that the package “hits the CVM portal on every invocation”, which has been false since v0.1.0 made the mirror the default.

Internal

  • A fifth ETL stage, inst/etl/05-label-scale.R, writes the scale_error column into the history assets of the DFP and ITR statements. The verdict needs every table of a version and of its successor, so it is not given where the rows are written (the mirror path sees one partition at a time, the RAD path one document without its successor): the stage runs after 03 in etl-mirror.yaml and after 04 in etl-rad.yaml, reads from the release the history and current assets of the years whose history moved since they were last judged (scale_labeled and scale_rule in __source_hash.json), judges every superseded version (inst/etl/util-scale.R) and rewrites the history assets of those years. The versions of a document are paired in the order of superseded_at, id_doc and versao, the current one last; a version the mirror path filed holds only the tables whose content changed, so the tables it lacks are taken from its successor before the comparison. --all judges every year (the backfill, a label_all input of etl-rad.yaml); --dry-run writes locally. The release I/O the three stages shared by copy (download_release_asset(), download_public_asset(), upload_release_asset(), the asset names) now lives in inst/etl/util-release.R.

  • The package passes pkgcheck::pkgcheck(), the automated gate of the rOpenSci software review: the cvm_tbl topic documents its value, print.cvm_tbl() returns its input invisibly in both branches, the two session-cache resets that only the tests called moved from R/ to the test helpers, the CRAN badge (a link to a page that does not exist yet) left the READMEs, and codemeta.json is generated with codemetar::write_codemeta().

  • The two ETL workflows that append to the history assets (etl-mirror.yaml, weekly, and etl-rad.yaml, daily) share the GitHub Actions concurrency group etl-history, so a run of one waits for the other to finish. The schedules alone did not keep them apart: the RAD run reads dfp and itr in series and can last until 08:40 UTC, past the Tuesday 07:00 UTC run of the mirror.

  • The mirror ETL keeps the filings it supersedes. Every CVM annual file carries only the filing delivered last for each company and reference date, so when a company restated a statement the previous rows vanished from the mirror on the next weekly publish. Now, for every partition whose content hash moved, inst/etl/03-publish.R downloads the parquet of the previous release and compares it filing by filing (inst/etl/util-history.R): the rows of the filings the new file replaces or drops are appended, with superseded_at and superseded_by_versao, to a cumulative history asset of the same partition (<table>__report_type=R__year=Y__history.parquet). A filing counts as changed by the content of its rows, never by a new versao or document id alone, and a column the CVM adds upstream is not a change of every filing. The -latest parquets and the client are untouched (parse_mirror_asset_name() rejects the history names); __source_hash.json gains a history map. Only tables that keep the last delivery (keep_latest_version) have a history; submissao already lists every delivery. Reading the history from cvm_fetch() is a separate item.

  • The filings superseded BEFORE the mirror kept a history are recovered from the CVM document archive (RAD) by a daily robot (.github/workflows/etl-rad.yaml, inst/etl/04-rad-fetch.R): every DFP/ITR delivery the submissao index lists that is not the current one is downloaded, read from its XML (inst/etl/util-rad.R, both layouts the RAD has used since 2010) into the eight statement tables with exactly the columns and conventions of the CSV, and appended to the same history assets with history_source = "rad", the receipt date of the delivery that replaced it (superseded_at), its id_doc and the reason for restatement the document declares (motivo_reapresentacao). Rows written by the mirror path carry history_source = "mirror". The reader was calibrated against 60 current filings of 2010-2025 read back from the mirror, account by account: values, accounts, periods and descriptions identical; st_conta_fixa differs in 30 rows of three 2019 documents, because the CSV takes that flag from the chart of accounts in force when the file is generated; the history keeps the document’s own flag, the one that held when the filing was delivered. Documents the robot cannot read are listed in the public asset __rad_unread.csv of each release. The first real run (2026-10-20, DFP 2025) set aside 8 of 73 documents and stopped, as designed, over two defects of the reader, both fixed: the XML is parsed without libxml2’s 10 MB text-node limit (the embedded PDF of five documents exceeded it, and libxml2 2.9 refused the whole file as “Extra content at the end of the document”), and the DMPL columns of the flat variant follow the document’s own order of elements rather than a fixed map (the converter only reorders the three-way split of consolidated equity: controlling, non-controlling, consolidated), so the equity columns of financial institutions, which differ between two filing templates (AjustesAvaliacaoPatrimonial before or after LucroPrejuizoAcumulado, ReservasReavaliacao, nine consolidated columns with the ninth unlabelled), come out as the CSV writes them: Banestes, Banco Pine, Daycoval, BTG Pactual and Itaú, DFP 2025, account by account, zero differences. The state now records which reader set a document aside, and attempts made by an earlier reader no longer spend the document. The old layout accepts the same nine consolidated DMPL columns (it stopped at eight: Banrisul DFP 2021 and BRB DFP 2020 were set aside on 2026-10-23; measured against the CSV, the ninth is the consolidated equity, unlabelled, as in the new layout). And a ZIP that is not a DFP/ITR at all is set aside as a document of another type instead of crashing the reader: the ITR 2023 index lists id 132214 for Dibens Leasing, and the RAD serves an IPE under it. Two decisions of 2026-10-23 on the remaining documents set aside: a blank CNPJ in the document (all zeros: Inter & Co, DFP 2021, a company abroad) is checked by the CVM code of the index instead of being refused as a different CNPJ (the rows carry the index’s identity either way); and the download gives up only when the connection stalls (below 1 KB/s for 180 s; 60 s on the first round, which cut 29 downloads in a day that the next attempt completed) or past 15 min, instead of 180 s of total time, which no document with a huge embedded PDF ever fitted (NEXPE DFP 2021, 59 MB in 180 s; Orizon DFP 2020, 126 MB). Two classes the first full round under that policy (2026-10-24) left aside, both of the old layout: a company that does not consolidate keeps the TEMPLATE of the consolidated DMPL in the document (records without a period and no column list: Ferrovia Centro-Atlântica DFP 2018 and 2020, Sabesp 2019, Banese 2019, Newtel 2018, Bradesco 2019 v1), which is an unfiled statement, not a defect — the CSV has no consolidated DMPL row for any of them; and a fiscal year closing on 29 February (Camil DFP 2020-02-29) has its previous exercise closing on the 28th, as the CSV writes it, instead of crashing the date arithmetic. Two ITR 2021-06-30 documents (Magazine Luiza and Méliuz v1, set aside on 2026-10-25) write per-share values whose decimal point was lost: 55E-2, -50000000000000001E-3, -002, 123, where the CSV has 0.055, -0.005, -0.02 and 1.23. The reader now reads scientific notation, a dot after a lone zero (-0.05), and, in the per-share accounts (3.99*) only, puts the lost point back after the first digit, as the CVM converter does; measured against 15 other RAD documents, whose digits-only per-share values are all 0. A document filed under a branch’s CNPJ (Pacaembu Construtora, ITR 2020-09-30 v1: 0002-49 in the document, the head office 0001-68 in the index) is read when the CNPJ root and the CVM code both match the index; the rows carry the index’s identity. Stage 04 gains --reread <id_doc> (and the reread input of etl-rad.yaml): the listed documents are read again, done or not, and their new rows replace their RAD rows in the history. A sweep of the published history (2,953 documents with per-share values) found one document read before the per-share fix with the point lost: Dommo Energia DFP 2021 v1, stored at -1.2e19 per share.

  • The RAD robot records a run that finds its whole queue empty and publishes __rad_state.json for it. Only a checkpoint recorded the run until now, and a checkpoint needs a document: DFP emptied its queue on 2026-11-04, its state stopped on that day, and anything reading the last run of the state (the portfolio monitor does) took a robot with nothing left to do for a robot that had stopped. A run narrowed by --year or --reread still records nothing when it has nothing to do.

  • The RAD robot asks a document again when the RAD’s internal download service fails for the request (“The HTTP service located at …DownloadDocumento.svc is unavailable”), up to four more times, 10 s apart, before counting a download failure. From 2026-11-06 the service fails per request and not for a stretch: six daily ITR runs in a row stopped as rad-down after reading 6 to 194 of 300 documents, and on 2026-11-12 one document asked 30 times from outside GitHub failed 8 times, the next request delivering the ZIP every time. The 15 min pause of the outage rule did nothing for that. A document that fails every time still joins the outage streak. The first run with the retries (2026-11-12) showed they were not enough from the GitHub runner: the failure came in blocks of 25 in a row (five documents, five tries each), three times, where a connection per request had got it scattered. As an experiment, every request to the RAD now opens and closes its own connection, and the log says, for each failed attempt, whether the connection was new and how long the answer took. The run with both (2026-11-12) read 292 of 300 with no pause, every retry on a new connection. Three of its eight failures were the same backend answering “The underlying connection was closed”; that text is now asked again too, and so is “There is not enough space on the disk.” (2026-11-20: the RAD’s own disk, given twice to a document it served as a ZIP on the next two requests).

  • The RAD robot no longer fails as a defect of its own when the mirror cannot serve the delivery index. On 2026-11-12 GitHub answered HTTP 500 to one partition on each of the client’s four attempts and the run died before reaching the RAD. A year that fails with an HTTP error is asked again twice, 60 s apart; if it still fails, the run ends with exit status 3 and the annotation Fonte inalcançável (the contract the MCP servers of the portfolio already write), which tells the portfolio panel that nothing was measured.

  • The RAD robot stops when a year of the submissao index does not read from the mirror, naming the year, instead of dropping it in silence. On 2026-11-05 the ITR index came without 2012 and 2013 (4,732 deliveries) and the run went on with a queue that skipped both years. The years asked for are now the submissao partitions the release’s __source_hash.json lists, so a year the mirror does not publish is never asked for.

  • The RAD reader tells whose a document is by the CVM code when the CNPJ written in it is not the index’s. It already did so for a blank CNPJ and, together with the CNPJ root, for a branch’s; the root no longer counts. Measured case: Technos, ITR 2011-06-30 v1 (id 10642), whose envelope carries the auditor’s CNPJ (61.562.112/0001-20) under the company’s name and CVM code. Version 2, the one the CVM publishes under the right CNPJ, carries the same slip and differs from version 1 only in the declared scale (units in v1, thousands in v2), which the history keeps as each version said it. The document’s own CNPJ is noted in the run log and in __rad_state.json (cnpj_doc). Another CVM code, or none, is still another document.

  • New contract test test-schema-snapshot-consistency.R pins the invariants between the hand-written schema YAMLs and the derived cvm_dictionary_snapshot.csv: every installed (group, dataset, table) has snapshot rows and vice versa, expected_field_count equals the snapshot’s row count, meta_status agrees row by row, and the 8 META-less FRE tables declare exactly the field names the snapshot carries. Measured on 2026-09-17: 74 YAMLs, 74 tables in the snapshot, zero divergences. This retires the pre-v0.1 roadmap item “generate the remaining YAMLs from the dictionary snapshot”: the dependency runs the other way (data-raw/build-dictionary-snapshot.R reads each YAML’s cvm_dictionary_url to build the snapshot), so a generator would be circular, and there are no remaining YAMLs to generate. data-raw/README.md no longer lists the schema YAMLs as a built artefact.

cvmdata 0.2.0 (2026-05-29)

⚠️ Breaking changes

  • cvm_fetch() has been renamed issuer_fetch() to reflect the contract of CVM’s company-issuer datasets (the v0.1 scope). The rename is mechanical:

    cvm_fetch(dataset, table, companies = ..., years = ..., ...)
    ↓
    issuer_fetch(dataset, table, issuer = ..., year = ..., ...)

    The arguments companies and years have been renamed to the singular issuer and year for tidyverse-canonical naming. The semantics are unchanged: issuer accepts a character vector of CNPJs / CD_CVMs / free-text identifiers; year accepts an integer vector of years and defaults to the latest available year when NULL. The renamed arguments still accept vectors of any length.

    cvm_fetch() is removed without a deprecation wrapper. Calls using the old name will fail with could not find function "cvm_fetch". Likewise, passing the old argument names will abort with cvmdata_error_input and a hint suggesting the new names.

    Rationale: cvmdata has zero CRAN distribution and zero external users at v0.1.0; the breaking change is contained to a few collaborators who can update their scripts in one pass. The alternative (a soft-deprecated wrapper kept until v1.0) would carry the maintenance cost of a redundant code path through the entire v0.x cycle, with no external users to protect.

  • cad_fetch() has been removed without replacement. Use issuer_fetch("cad", "companhias") instead — the call site is one character longer and removes a thin alias that was only retained for ergonomics during the Session 01 prototype.

  • Four further fetchers (fund_fetch(), agent_fetch(), offering_fetch(), event_fetch()) will be exported as skeletons in the following development cycle. v0.1.0.9000 itself only ships issuer_fetch() as a functional fetcher.

New features

  • New dataset cgvn (Codigo Brasileiro de Governanca Corporativa) covered by issuer_fetch(). Two tables: submissao (12 fields, one row per ICBGC informe filed by a company per fiscal year) and praticas (11 fields, “pratique ou explique” detail with 54 recommended practices per filing — id_item, capitulo, principio, pratica_recomendada, pratica_adotada ∈ {Sim, Nao, Parcialmente, Nao se Aplica}, explicacao). CKAN coverage 2021+. praticas does not carry codigo_cvm; CD_CVM filtering routes through cgvn/submissao automatically. Embedded dictionary and codelist snapshots regenerated to include the new tables. Decision doc: data-raw/decisions/cvmdata_v0-2_planejamento_decisao.md.

  • New dataset vlmo (Valores Mobiliarios Negociados e Detidos por insiders, art. 11 of CVM Resolution 44) covered by issuer_fetch(). Two tables: submissao (12 fields, one row per filing) and consolidado (17 fields, one row per security movement). Unlike the other detail tables, consolidado carries no keep_latest_version transformation: it is event-per-row, so every versao is retained verbatim (deduping by version would collapse distinct movements). Insider identity is opaque by design of the CVM — the detail has no CPF; only the category tipo_cargo and, for corporate insiders, a name in empresa plus tipo_empresa. The issuer argument therefore filters the issuing company, not the individual insider; a per-category filter is a trivial dplyr step on the returned tibble. consolidado does not carry codigo_cvm; CD_CVM filtering routes through vlmo/submissao automatically. The package table is named consolidado (not con, the CVM file token) because con is a reserved device name on Windows. Embedded dictionary and codelist snapshots regenerated to include the new tables. Decision doc: data-raw/decisions/cvmdata_v0-2_planejamento_decisao.md.

  • New dataset fca (Formulario Cadastral) covered by issuer_fetch(), the largest v0.2 surface with 10 tables: submissao (9 fields, classic convention identical to ITR/DFP/FRE — cnpj_cia, dt_refer, cd_cvm) plus 9 FRE-detail tables (cnpj_companhia / data_referencia): auditor, canal_divulgacao, departamento_acionistas, dri, endereco, escriturador, geral, pais_estrangeiro_negociacao, valor_mobiliario. The classic-vs-detail split means CD_CVM filtering of a detail routes through fca/submissao (which carries cd_cvm + cnpj_cia) and maps to the detail’s cnpj_companhia. CKAN coverage 2021+.

    Note: fca/departamento_acionistas is published with a valid 23-field header but zero data rows from 2024 onward (it carried data through 2023, then zeroed after a regulatory change). The reader returns the empty tibble without aborting; use fca/endereco or fca/dri for shareholder-department contact information.

  • B3 ticker support in issuer =. The issuer argument now recognises B3 trading tickers (e.g. "PETR4", "BBDC11", "ITSA4F") alongside CNPJ, CD_CVM and free text. A ticker is resolved to its issuer CNPJ via fca/valor_mobiliario (the codigo_negociacao column), analogous to the existing CD_CVM → CNPJ resolution via submissao — no external data source. Only active securities (empty/future data_fim_negociacao) are matched; the lookup table is cached per R session. Tickers cover only exchange-listed securities, so an unknown ticker aborts with cvmdata_error_input rather than failing silently. Embedded dictionary and codelist snapshots regenerated to include the FCA tables. Decision doc: data-raw/decisions/cvmdata_v0-2_planejamento_decisao.md.

  • New dataset ipe (Informacoes Periodicas e Eventuais) covered by issuer_fetch(). A single-table manifest (ipe, 13 fields, ~50k documents/year) of every periodic and eventual document a company filed with the CVM: cnpj_companhia, data_referencia, codigo_cvm, categoria, tipo, especie, assunto, data_entrega, tipo_apresentacao, protocolo_entrega, versao and link_download. There is no separate submissao table — the CSV is the manifest. codigo_cvm is native, so CD_CVM filtering matches directly (no submissao bridge). The manifest is event-per-row: like vlmo/consolidado it declares no keep_latest_version transformation, so re-submissions and every versao of a document are retained verbatim. Slice by document class with a trivial dplyr::filter() on categoria on the returned tibble. link_download is returned as a plain URL to the document on the CVM portal; OCR and PDF download are out of scope. IPE overlaps VLMO on the “Valores Mobiliarios negociados e detidos” category — IPE indexes the document, VLMO carries the structured insider movements; see the ipe-vlmo article. CKAN coverage 2021+. Embedded dictionary and codelist snapshots regenerated to include the new table. Decision doc: data-raw/decisions/cvmdata_v0-2_planejamento_decisao.md.

  • cvm_groups() lists the 18 CKAN groups published by the CVM Open Data Portal, with the number of datasets each group carries and the canonical cvmdata fetcher contract (issuer, fund, agent, offering or event) that covers it. The table is static (verified against <https://dados.cvm.gov.br/group/> on 2026-05-25) and serves as the navigation entry point for the universe of CVM data; only the companhias group is functionally implemented in v0.1.0.9000, but the remaining 17 rows document the planned coverage exposed via the four skeleton fetchers shipped in the previous development entry.

  • cvm_datasets(), cvm_tables() and cvm_dataset_years() gained an optional group argument, completing the discovery surface started in the previous entry (cvm_dictionary() and cvm_codelist() already accepted it). When group is NULL (default) the functions preserve their v0.1 behaviour: cvm_datasets() returns every installed dataset across every group, cvm_tables() and cvm_dataset_years() resolve the group by uniqueness across the schema tree. When set, the functions restrict the result to that group; unknown groups abort with cvmdata_error_input. From v0.4 onward, when datasets may collide between groups, calling cvm_tables("foo") without group aborts with cvmdata_error_input_ambiguous.

  • Four new fetchers exported with skeleton implementation: fund_fetch() (fund datasets — fundos-de-investimento, fundos-de-investimento-imobiliarios, fundos-estruturados, full implementation arriving in v0.4-v0.6); agent_fetch() (registered agents across the eight administradores, agentes-autonomos, agentes-fiduciarios, auditores, consultores-de-valores-mobiliarios, coordenadores-de-ofertas, participantes-intermediarios and investidores-nao-residentes groups, v0.7); offering_fetch() (public offerings — ofertas-publicas and plataformas-de-crowdfunding, v0.7); and event_fetch() (sanctioning proceedings and declaratory acts — atividade-sancionadora and atos-declaratorios, v0.8). Calling any of these in v0.1.0.9000 aborts with the new condition class cvmdata_error_input_group and a message pointing to ROADMAP.md. Exporting the skeletons now locks the complete public API surface ahead of incremental data implementation, so later releases (v0.4+) extend coverage without reshaping the API.

  • New condition class cvmdata_error_input_group (inherits from cvmdata_error_input, which in turn inherits from cvmdata_error). Emitted by the four new skeleton fetchers when called in v0.1.0.9000. Sibling of cvmdata_error_input_ambiguous (introduced in the previous development entry); neither subclass is a parent of the other.

  • Parquet mirror became <group>-aware end-to-end. The GitHub-Releases producer (inst/etl/0{1,2,2b,3}-*.R) and the workflow .github/workflows/etl-mirror.yaml now take --group (matrix (group, dataset)), write to <workspace>/out/parquet/<group>/<dataset>/..., and publish to the moving release mirror-<group>-<dataset>-latest. The mirror consumer (R/util-mirror-assets.R, R/source-mirror-duckdb.R) reads the same naming convention; mirror_release_tag() and mirror_list_assets() gained a leading group argument. The session-scoped asset cache now keys on (group, dataset). Operational note: the four pre-Sessao-08 GitHub Releases (mirror-cad-latest, …) must be renamed in place via the GitHub API to mirror-companhias-<dataset>-latest before consumers on this code can read them; the rename is the operator’s task and is intentionally not automated. Until that rename happens, source = "mirror" aborts with HTTP 404; users can fall back to cvm_source_set("cvm").

  • Returned tibbles (cvm_tbl class) now carry a group provenance attribute, slotted between fetched_at and dataset. The total number of attached attributes goes from five to six (source, fetched_at, group, dataset, table, package_version). print.cvm_tbl() renders group in the header alongside the existing fields, so a snapshot taken at the REPL self-documents which CKAN group the data came from. load_schema() stamps the resolved group onto the schema list so downstream callers propagate it without re-running the schema-tree lookup.

Documentation

  • New article vignettes/articles/groups-overview.Rmd lists the 18 CKAN groups and maps each to one of the five fetcher contracts, with a worked example per fetcher (only issuer_fetch() runs; the four skeletons stay in eval = FALSE chunks until v0.4+). Linked from the pkgdown Articles navbar.

  • Article cvm-defects.Rmd renamed to data-defects.Rmd. The taxonomy of publication quirks covers any upstream source the package will integrate (the universe widens beyond CVM proper from v0.4+); the new name reflects that scope. URL on the pkgdown site moves from /articles/cvm-defects.html to /articles/data-defects.html. No content change.

  • _pkgdown.yml: cvm_groups listed first in the Discovery reference; the section description now points users at it as the entry to the group taxonomy.

Internal

  • Reader identifier classification refactored from an ad-hoc regex list (R/util-csv-cvm.R:.identifier_patterns) to a prefix-based helper (identifier_columns()) with two lists: .identifier_prefixes (^cnpj, ^cpf, ^codigo_, ^cd_cvm, ^cep, ^ddi_, ^ddd_, ^id_, ^protocolo) and .identifier_exact (caixa_postal, tel, versao). Covers v0.1 without regression and absorbs the v0.2 identifier columns (codigo_cvm_auditor, cnpj_escriturador, cpf_responsavel, id_item, ddi_telefone, protocolo_entrega, codigo_negociacao) without per-dataset additions.

  • tx_keep_latest_version() (transform-schema) now accepts an extra keys: [...] field in the YAML transformation declaration. Used by cgvn/praticas to dedup on (cnpj_companhia, data_referencia, id_item) so the 54 distinct practices per filing all survive.

  • New internal helper cdcvm_col(df) resolves the CVM-code column to either cd_cvm (CAD/ITR/DFP/FRE submissao) or codigo_cvm (CGVN/VLMO/IPE submissao). Applied by match_by_cd_cvm() and resolve_cd_cvm_via_submissao() so the CD_CVM lookup path works for both naming conventions.

  • Codelist builder (data-raw/build-codelists-snapshot.R) exclude pattern list re-aligned with the reader’s identifier rules (broader ^codigo_ and ^id_ instead of the v0.1 narrow exact matches; added ^ddi_ and ^protocolo). Mirrors the reader refactor so new identifier-shaped columns in v0.2 datasets are not falsely promoted to codelists.

  • Cache layout migrated from <cache>/{raw,parquet}/<dataset>/ to <cache>/{raw,parquet}/<group>/<dataset>/. The <group> segment is the CVM CKAN group slug (companhias for the four v0.1 datasets); this clears the path for v0.2+ datasets that live under other groups (fundos-de-investimento, etc.) without colliding dataset slugs. A one-time internal helper (cache_migrate_v0_1_to_v0_2(), not exported) runs automatically on first invocation of cvm_fetch(), cvm_cache_info() or cvm_cache_clear() post-upgrade and relocates pre-existing artifacts; the helper is idempotent and writes an audit log under tools::R_user_dir("cvmdata", "config")/cache_migrate_log.rds.

  • cvm_cache_info() now exposes the group column as the first key, ahead of dataset.

  • cvm_cache_clear() gained a group argument that scopes deletion to a CKAN group (e.g. cvm_cache_clear(group = "companhias")). Precedence: what = "all" overrides the filter; otherwise the target path is composed as <cache>/<what>/<group>/<dataset>/<year>/, with each segment becoming optional from the right.

  • Schema YAML files moved from inst/extdata/schemas/<dataset>/<table>.yaml to inst/extdata/schemas/<group>/<dataset>/<table>.yaml. The internal loader load_schema() gained an optional group argument; when omitted (the v0.1.0.9000 path) it resolves by uniqueness across the installed schema tree, so existing calls compile unchanged. The constant .dataset_group_map shipped by the previous release as technical debt has been removed – dataset_group(), known_groups() and the new known_datasets() now walk the installed schema tree on first call and memoize the result per R session.

  • cvm_dictionary_snapshot.csv and cvm_codelists_snapshot.csv gained a group column as the first key column. Composite key changed from (dataset, table, ...) to (group, dataset, table, ...). The bundled CSVs were regenerated against the live CVM portal; aside from the new column, the dictionary snapshot is byte-identical to the previous build and the codelists snapshot reflects organic drift in a handful of FRE categorical columns.

  • cvm_dictionary() and cvm_codelist() gained an optional group argument. When omitted, both functions resolve by uniqueness across the embedded snapshot; from v0.4 onward, datasets present in more than one group will abort with cvmdata_error_input_ambiguous (a new condition class that inherits from cvmdata_error_input).

  • New condition class cvmdata_error_input_ambiguous (inherits from cvmdata_error_input, which in turn inherits from cvmdata_error). Emitted by load_schema(), dataset_group(), cvm_dictionary() and cvm_codelist() when a (dataset, table) resolution returns more than one candidate group and the caller did not supply group to disambiguate.

Bug fixes

  • cvm_fetch() and cad_fetch() no longer fail with the cryptic cvmdata_error_internal “Got archive=, file=” when the R session runs under LC_CTYPE = "C". The schema loader now reads the bundled YAMLs forcing UTF-8 instead of relying on the active locale, so multibyte characters in the schema comment headers (e.g. “Demonstração”, “Exercício”) never cause yaml::read_yaml() to return NULL. A regression test under LC_CTYPE = "C" was added.
  • The PDF version of the package manual now builds cleanly on the macOS R builder with the default pdflatex inputenc setup; a stray U+2264 (“less than or equal to”) character in the roxygen docs of cvm_codelist() has been replaced by ASCII.

cvmdata 0.1.0 (2026-05-24)

First public release. Covers the four core CVM publicly-traded-company datasets — CAD (registry), DFP (annual statements), ITR (quarterly statements) and FRE (reference form) — with a tidy cvm_fetch() API, year-partitioned mirror in GitHub Releases (refreshed weekly), and an HTTP-with-cache backend against dados.cvm.gov.br for byte-level freshness.

Breaking changes

  • The default source of cvm_fetch() is now "mirror" (parquet via DuckDB), not "cvm" (CVM Open Data Portal). Scripts that need byte-level freshness from the regulator should pass source = "cvm" explicitly or persist the choice with cvm_source_set("cvm"). The "cvm" backend remains fully supported.

ETL and mirror

  • New stage inst/etl/02b-validate.R runs between csv-to-parquet generation and the GitHub Releases publish. Applies a hybrid set of pointblank checks: structural failures (missing parquet, unreadable file, n_rows == 0, wrong identifier type) exit 1 and block the publish; content failures (CNPJ format, cd_cvm regex, date range) emit a warning and let the publish proceed. The validation markdown report is uploaded as a workflow artifact for post-hoc inspection regardless of outcome.
  • arrow and pointblank join the Suggests field — both are consumed only by the ETL scripts.

Documentation

  • New article cache-and-mirror.Rmd (CRAN-safe via bundled RDS) documents the dual-backend contract, the L1 / L3 cache layout, the four common workflows (mirror switch, CVM vs Mirror equivalence, cache inspection, TTL + LRU tuning) and the eight pre-publish checks the mirror ETL runs. Linked from README.Rmd and the pkgdown navbar.

cvmdata 0.0.0.9000

  • Initial scaffolding.
  • First implementation: cad_fetch() for the CAD registry.
  • Exported utility: cnpj_clean() for stripping punctuation from CNPJ vectors.
  • Add ITR (quarterly financial statements) coverage: 11 schemas mirroring DFP.
  • companies arg accepts CD_CVM on every table of a dataset, even those that don’t carry cd_cvm natively (e.g. composicao_capital, parecer): the CD_CVM is resolved to CNPJ via the dataset’s submissao table for the same year. Previously the filter silently returned an empty tibble for these tables.
  • Add FRE (annual reference form) coverage: 36 schemas including 8 with meta_status: missing (administrador_PCD, empregado_PCD, and six empregado tables that the CVM does not publish a META for); first dataset exercising the missing-META reader policy against real data.
  • companies arg now also filters FRE-detail tables, which use a different header convention from CAD/ITR/DFP: cnpj_companhia, data_referencia, nome_companhia (no cd_cvm). match_by_cnpj(), match_by_text(), disambiguate_text_match() and tx_keep_latest_version() accept either column pair; existing CAD/ITR/DFP behaviour is unchanged.
  • Public cache API: cvm_cache_path(), cvm_cache_set_path(), cvm_cache_info() and cvm_cache_clear(). The internal source backend now consumes cvm_cache_path() as the single source of truth for the cache root. cvm_cache_info() lists every artifact under <cache>/raw/ (upstream CSV/ZIP plus CSVs extracted from yearly ZIPs) with ETag/Last-Modified metadata sourced from *.etag.rds sidecars when present. cvm_cache_clear() accepts what ∈ c("all", "raw") plus optional dataset and year filters; in interactive sessions it asks for confirmation via utils::askYesNo().
  • Public source API: cvm_source_get() and cvm_source_set(). cvm_source_get() reads getOption("cvmdata.source", "cvm"); cvm_source_set() validates the value against c("cvm", "mirror") and persists it. cvm_fetch() now declares source = NULL and resolves the default via cvm_source_get(), so precedence is arg > option > built-in default. The built-in default is "cvm" in the v0.1 series and transitions to "mirror" in the release that ships the Phase F mirror; this flip will be announced in NEWS.md of that release. Until then, passing source = "mirror" aborts with cvmdata_error_internal (in-domain value, not yet implemented).