Commit Graph

5 Commits

Author SHA1 Message Date
bruno cesar
91f211394a refactor(public): ship full public edition with patterns disabled 2026-03-01 02:05:05 -03:00
bruno cesar
6639a096a8 test(api): skip institutional query assertion in open-core 2026-03-01 00:51:14 -03:00
bruno cesar
271671ff3a Fix 9 query-schema alignment bugs + 3 AI-review findings
Entity ID alignment: add 6 missing ID fields (cnes_code, finance_id,
embargo_id, school_id, convenio_id, stats_id) to entity_by_id and all
6 investigation Cypher queries (WHERE + coalesce chains).

entity_by_element_id: add missing PublicOffice label.

pattern_self_dealing: fix Amendment field reads with dual-source
coalesce fallbacks (TransfereGov + Transparencia).

init.cypher + schema_init.cypher: replace dead indexes
(amendment_object→function, amendment_date→value_committed,
convenio_date→date_published), expand fulltext index to 9 node types
with 11 search fields including n.function.

seed-dev.cypher: fix all property names (id→contract_id/sanction_id,
value→valor, PublicOffice id→cpf), add Amendment node, fix
AUTOR_EMENDA target to Amendment.

search.py: add name extraction for Contract/Amendment/Convenio/Embargo
/PublicOffice types in search results.

21 new tests, 570 total green. Triple-AI validated (Claude + Codex).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 10:31:30 -03:00
bruno cesar
dd6e1a041f Add 64 tests: coverage for datasus, dou, IDOR prevention, pages, hooks
API (+10): Cypher label-filter integrity tests, investigation coalesce chain,
  pattern parameter binding, patrimony div-by-zero guard
ETL (+27): datasus pipeline (11), dou pipeline (16) with fixtures
Frontend (+27): 7 page smoke tests (Landing, Register, Investigations,
  Baseline, GraphExplorer, SharedInvestigation, EntityAnalysis) + useGraphData hook

Total: 559 tests (179 API + 226 ETL + 154 Frontend)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 03:36:31 -03:00
bruno cesar
0dd953898c Phase 1: API core — all endpoints, query service, CPF masking
- Neo4j query service: CypherLoader + parameterized executor
- Entity endpoints: /entity/{cpf_or_cnpj} lookup + /entity/{id}/connections
- Search endpoint: /search with fulltext index, pagination, type filtering
- Graph endpoint: /graph/{entity_id} with depth/type filtering, nodes + edges
- CPF masking middleware: scans responses, masks non-PEP CPFs, preserves CNPJ
- Pydantic models: EntityResponse, SearchResponse, GraphResponse with source attribution
- 5 .cypher query files (never inline Cypher)
- 58 unit tests passing (ruff + mypy + pytest clean)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 03:21:15 -03:00