Skip to content

feat: audit official NT009 indicators and layout evidence in PHP (#95) - #99

Merged
vitormattos merged 6 commits into
refactor/php-domain-toolsfrom
feat/nt009-php-source-evidence
Oct 8, 2026
Merged

vitormattos merged 6 commits into
refactor/php-domain-toolsfrom
feat/nt009-php-source-evidence

Conversation

@vitormattos

@vitormattos vitormattos commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Objective

Build reproducible, fully PHP-based official source evidence for NT009 v1.01 (Anexo VI v1.04.01 / Anexo VII v1.03.00) using the isolated PhpSpreadsheet toolchain introduced in #97.

Implemented

  • Direct official government XLSX downloads, checked against recorded SHA-256 values:
    • Anexo VI 103a150dd6f56ec8edcaa3a453b59a1b0e096d7cd5025d7bd06a387f141ddf39
    • Anexo VII 95f30a44ee94adeea57fb92f3a0337b1e62fdc106f393e73894087889be9e5aa
  • Full, reproducible and immutable offline TSV resources/domains/indicadores-operacao-ibscbs-v1.03.00.tsv, extracted from exact official columns A (code), C (characteristic), D (DFe location) in the cIndOp Public sheet. Every published code is retained; no filtering based on advisory indNFSe restrictions.
  • Full raw Annex VI layout-row evidence exported to a machine-readable JSON report. Excel helper formulas are ignored, not evaluated.
  • Deterministic offline PHPUnit tests, source-byte provenance and a dedicated advisory live CI job comparing all 40 versioned triplets directly to the official file, retaining source workbooks/report as artifacts.

Observed Anexo VII changes

  • 26 codes in the current Anexo C v1.01.
  • 40 codes in the official Anexo VII v1.03.00.
  • 18 added, 4 removed, and 21 existing codes changed text; complete results preserved by the audit report. This is not an instruction to delete historical codes or silently change production behavior.

Validation — 2026-10-08

All nine PR workflows are green (including the underlying live snapshot-reproduction and official Annex VII comparison jobs) on d5b2f74b6bb14312678b7ac04249e175670b9f87, including the underlying official-download job and its exact 40-row comparison.

Important limits

  • The existing production OfficialDomainCatalog::operationIndicator() still reads Anexo C v1.01. The new TSV is an additional frozen snapshot only.
  • No new DPS/XML fields, XSD switching, tax calculation or consumer dependency update is activated. Confirm official production deployment, effective date and conditional rules before implementing or enabling the NT009 XML layout.
  • Anexo VIII remains non-enforcing while consultative.

Stacked on #97. Review #97 first. Issue #95 remains open; this PR delivers source/provenance evidence, not complete fiscal conformity. No merge requested.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…risons

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…lization

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos
vitormattos merged commit b21435d into refactor/php-domain-tools Oct 8, 2026
13 checks passed
@vitormattos
vitormattos deleted the feat/nt009-php-source-evidence branch October 8, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant