Skip to content

feat(xsender): the answers are generated from the core's schema - #11

Merged
carlosthe19916 merged 1 commit into
mainfrom
feat/generated-answers
Nov 16, 2026
Merged

carlosthe19916 merged 1 commit into
mainfrom
feat/generated-answers

Conversation

@carlosthe19916

Copy link
Copy Markdown
Member

Why

The SUNAT answers were typed by hand here. A field added in xhandler-rust (like the CDR's document_description) needed a hand edit in every binding, and could be silently dropped. xhandler-rust 6.0.0-alpha.2 generates them from the core's schema (project-openubl/xhandler-rust#613, docs/adrs/BINDINGS.md). This is the last step of that design: from now on, a new answer field arrives with the release's sync PR, with no hand edit.

What

  • make sync also copies src/xhandler/xsender/models_gen.py. It's in SYNCED and excluded from ruff, like the xbuilder models.
  • xsender/models.py keeps the inputs and re-exports the generated answers. SendResult extends the generated SendFileAnswer.
  • xhandler.xsender exports the same names, with the same fields, as before. SendFileAnswer is new.
  • The answers ignore fields a newer core adds.

Verified

ruff, mypy and pytest (1139 tests) pass. make verify-release TAG=v6.0.0-alpha.2 passes.

Senior review

Two passes. Findings applied:

  • clearer breaking-change notes
  • docs: CONTRIBUTING lists the generated files
  • Python's __all__ completed
  • Java uses the shared Json.MAPPER and XhandlerException, and copies the notes list

The second pass found nothing left.

🤖 Generated with Claude Code

`make sync` now also copies src/xhandler/xsender/models_gen.py: the SUNAT
answers (SendFileAnswer, VerifyResult, ConsultResult, CDR, Fault, NoCDR,
ConsultStatus, Status) generated from the schema of the core, so a field
added to them in xhandler-rust arrives with the next core sync
(xhandler-rust docs/adrs/BINDINGS.md). They ignore fields a newer core adds.
The hand-written copies are gone; SendResult extends SendFileAnswer, and
xhandler.xsender exports the same names, with the same fields, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@carlosthe19916
carlosthe19916 merged commit 57ec803 into main Nov 16, 2026
17 checks 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