Repository navigation
fix(parse): register a filing's packages for that load only - #95
Merged
Merged
Conversation
Arelle keeps registered taxonomy packages for the life of the process, and nothing cleared them, so in a long-running session a load could resolve through an earlier load's catalog: a report with no package read an earlier package's taxonomy (or, once that filing was unloaded, lost every concept), and of two packages mapping the same URL the first, read again, was read through the second. The registrations are now cleared before each load.
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.
Summary
Arelle keeps registered taxonomy packages for the life of the process, and xbrlkit never cleared them. In a long-running session (the MCP server) a load could therefore resolve through an earlier load's catalog.
load_modelnow clears the registrations before each load, so a filing resolves through its own packages and no one else's.Changes
parse/(convert)_register_packagescallsPackageManager.reset()before registering the packages for the load, and when there are none.parse/README.mdsays a package is registered for the one load.Tests
tests/test_arelle_cache.pydrive real Arelle, offline with a cold cache, over small synthetic packages. Both fail without the change.Output Impact
INTERNAL for a filing loaded in a fresh process: its output is unchanged.
For a process that loads more than one filing, three wrong results go away. Each was reproduced on 0.20.7 with real Arelle:
Two versions of one real filing that share a package identifier were not affected before the change, in any load order, and are not affected after it.
Testing
.xbripackage (7245003GZ2696Y0W1X57-2026-03-31-ESEF-NL-0), a Danish report (549300DAQ1CVT6CXN342-2026-06-30-ESEF-DK-0), a backslash-zipped package (743700G7A9J1PHM3X223-2020-12-31-ESEF-FI-1), three ordinary ESEF packages, and a two-version pair of one filing loaded first, second, first. Fact counts match the same filings loaded in isolated processes.NVDA 10-Q, parsed from EDGAR with the CDN turned off) loaded between two loads of the same ESEF package; the package's model was identical before and after.🤖 Generated with Claude Code