Repository navigation
fix(tavi): a pure or shares unit keeps the instance namespace - #114
Merged
Merged
Conversation
The TAVI reader restores a pure unit as xbrli:pure and resolved that against the document's namespaces. A filing binds xbrli; a report that never was one may not, and the unit then came back as the bare prefix. A holon written from that model rebound xbrli, its period terms stopped compacting, and every fact was lost on the next read.
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
A report read from a TAVI compiled model and then written as a holon lost every fact on the next read. The TAVI reader restores a pure unit as
xbrli:pureand resolved it against the document's own namespaces; a filing bindsxbrli, but a report that never was a filing may not, and the unit came back under the bare prefix. The holon writer then reboundxbrlito that, the period terms stopped compacting, and the holon reader could not place a single fact.Changes
deserialize/
tavi.py:xbrli:pureandxbrli:sharesresolve to the XBRL instance namespace whether or not the document binds the prefix. The unusedPURE_URIconstant goes.tests
tests/test_author.py: an authored report goes TAVI → model → holon → model with every fact, its unit under the instance namespace, and still checks.Output Impact
CHANGED OUTPUT, for one case: a model read from a TAVI document that carries a pure-unit (or shares) fact and does not bind
xbrli. Its unit'suriandidare now the instance-namespace ones, matching what a parse or a holon read gives. A TAVI written from an SEC filing is unaffected: it bindsxbrli, and that path already resolved correctly.Testing
just test-all's stages ran through the pre-commit hook: ruff check, ruff format check, basedpyright (0 errors), pytest (734 passed, 2 skipped).No SEC filings were run; the new test uses the hand-built authored package in
tests/test_author.py. Found by the consumer: converting a TAVI report to a holon in RoboSystems refused all of its facts.🤖 Generated with Claude Code