Repository navigation
Conversation
|
@manduinca is attempting to deploy a commit to the Crafter Station Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15
I added
padron indexto build an optional SQLite index afterpadron sync. Single and batch lookups use a compatible index automatically, fall back to the TXT scan when it is missing, stale, or corrupt, and retain the existing result shape.padron statusnow reports index presence and size.I use the existing row parser, a
TEXT PRIMARY KEYschema, a transaction, unique staging files, and an atomic rename for publication. The index records the schema version and TXT identity; sync invalidates the index before extraction. I also made both streaming paths skip malformed candidates so they agree with the index on the first valid duplicate RUC. I documented the option and its limits inLIMITATIONS.mdand added a reproducible synthetic benchmark.Validation
bun test packages/cli/tests/unit: 454 passed, 1 skipped.bun test packages/cli/tests/e2e: 88 passed, 2 skipped. I used temporary configuration with inherited SUNAT/CPE variables removed and the mock driver; the opt-in SUNAT beta tests stayed disabled.index,status,ruc, andbatchcommands with a synthetic local fixture.git diff --check: passed.Performance and limits
I measured a synthetic 998,888,890-byte TXT containing 1,000,000 rows with 920 padding characters per name and a warm OS cache. For batches of 1,000 RUCs, five indexed runs took 11.38–16.43 ms on Bun and 11.42–13.47 ms on Node 24; streaming took about 880/1,015 ms and indexing about 6.46/6.03 s. The resulting index occupied 1,024,036,864 bytes.
This meets the issue's batch target on that fixture; it does not validate a real padrón's cardinality/distribution, cold-cache performance, or other machines. I used no credentials, real taxpayer fixtures, or live fiscal operations. A forced process kill can leave an unpublished staging file; TXT replacement during sync keeps the existing streaming limitations described in
LIMITATIONS.md.