Skip to content

fix(tavi): a pure or shares unit keeps the instance namespace - #114

Merged
jfrench9 merged 1 commit into
mainfrom
bugfix/tavi-pure-unit
Nov 19, 2026
Merged

jfrench9 merged 1 commit into
mainfrom
bugfix/tavi-pure-unit

Conversation

@jfrench9

Copy link
Copy Markdown
Member

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:pure and resolved it against the document's own namespaces; a filing binds xbrli, but a report that never was a filing may not, and the unit came back under the bare prefix. The holon writer then rebound xbrli to that, the period terms stopped compacting, and the holon reader could not place a single fact.

Changes

deserialize/

  • tavi.py: xbrli:pure and xbrli:shares resolve to the XBRL instance namespace whether or not the document binds the prefix. The unused PURE_URI constant 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's uri and id are now the instance-namespace ones, matching what a parse or a holon read gives. A TAVI written from an SEC filing is unaffected: it binds xbrli, 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

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.
@jfrench9
jfrench9 merged commit f26a622 into main Nov 19, 2026
6 checks passed
@jfrench9
jfrench9 deleted the bugfix/tavi-pure-unit branch November 19, 2026 05:21
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