Skip to content

fix(scraper): re-derive detail apiVersion after DRE change - #2

Merged
naps62 merged 1 commit into
mainfrom
claude/project-thread-ee5vnu
Oct 8, 2026
Merged

naps62 merged 1 commit into
mainfrom
claude/project-thread-ee5vnu

Conversation

@naps62

@naps62 naps62 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Requested by naps

Before: since 30 September, every new act was saved without its text or PDF, and the summarizer wrote its summary from the title alone. The result was invented summaries, such as rent rules on a decree about fuel prices (Decreto-Lei 200/2026).

After: act details load again. An act with no text is never summarized. It stays "por gerar" until a re-ingest fills its text.

How: DRE's late-September deploy added a GUID argument to callDataAction. The resolver read the third argument and so got the screenservices/... path instead of the apiVersion. It now reads the argument after the path, which works for both the old and the new bundle shape. Summarizer.summarize/4 returns {:error, :no_full_text} when the act has no text, the worker cancels that job, and acts_without_summary/1 skips such acts.

This doesn't clean up prod. The 30 affected acts (30 Sep to 8 Oct) still carry their pinned, invented summaries until they are re-ingested and re-summarized.

Evidence
  • Live DRE bundle: callDataAction("DataActionGetAllConteudoDetalheData", "0f36ef54-…", "screenservices/dr/Legislacao_Conteudos/Conteudo_Detalhe/DataActionGetAllConteudoDetalheData", "B3l5BYZxaLmWUxGR3tmKGw", …)
  • ApiVersionResolver.resolve/2 on main returns the path for both :list and :detail, and the detail call keeps answering hasApiVersionChanged: true.
  • Public site crawl: all 30 acts without a PDF link date from 30 Sep onward, and all of them have a summary.
  • mix test: 616 tests, 0 failures.

🤖 Generated with Claude Code

DRE's late-September deploy added a GUID argument to callDataAction, so
the resolver picked up the screenservices path instead of the apiVersion.
Act detail fetches have failed since, leaving acts without full_text, and
the summarizer then wrote summaries from the title alone.

Anchor the apiVersion on the path argument, refuse to summarize an act
with no full_text, and keep such acts out of the summarize queues.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@naps62 naps62 self-assigned this Oct 8, 2026
@naps62
naps62 marked this pull request as ready for review October 8, 2026 12:31
@naps62
naps62 merged commit a40aa4e into main Oct 8, 2026
1 check passed
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