feat(taxonomy): fac bridge coverage + CF/recurrence trait axes#731
Conversation
- bind indirectCashFlowReconcilingItem to the 13 kept IncreaseDecreaseIn* working-capital concepts (consistency with their excluded siblings; classification-only, not consumed by the renderer) - bind use/remeasurement to the 3 kept impairment-bearing concepts - add a new fac-traits 'recurrence' axis (member nonrecurring) for normalized-earnings / NOPAT classification, bound to the 9 kept operating special-items (restructuring, impairment, disposal G/L, debt extinguishment); orthogonal to use/remeasurement - widen check_trait_category: model + migration 0019 (public + tenant schemas via for_each_tenant_schema) and 0002 so a fresh seed admits recurrence
Add 96 fac->rs-gaap equivalence arcs so every concrete tenant-kept rs-gaap concept reaches a fac anchor (41/137 -> 137/137), making fac a complete cross-framework substrate over the MVP working set. Library-only (the bridge is tenant_copy:false); kept set + tenant-exclude artifact unchanged (verified).
… test The 'fac' package became tenant_copy:false in the tenant-copy curation, so it is omitted from the resolved copy-pin; assert on fac-traits (a copied depends_on package) instead. The file skips when the extensions DB is absent, so the staleness was hidden in CI.
…on 0019) Pre-launch, no DB has run the 0002 seed yet, so the separate 0019 widen is redundant: 0002 already creates check_trait_category with 'recurrence' and its content-driven seed inserts the member. Folding it in avoids shipping a no-op migration at launch. Once 0002 runs in prod it is frozen, so any later trait-axis addition will need its own migration.
|
@claude can you review |
|
Claude finished @jfrench9's task in 2m 52s —— View job PR Review: feat(taxonomy): fac bridge coverage + CF/recurrence trait axes
Overall AssessmentSolid pre-launch cleanup. The changes are internally consistent, the migration consolidation into 0002 is the right call given no prod DB has run it, and the content is methodically verified per the PR description. A few stale docstring counts and one potentially confusing forward reference to a dropped migration are the main things worth fixing. Issues1. Stale category/member counts in docstrings (4 locations) The recurrence axis bumps the totals from 25 categories / 99 members → 26 / 100, but four places in the changed files weren't updated:
Note that the migration's schema header at line 20–21 was updated correctly — only the docstring and inline comments are stale. Fix stale counts →%20robosystems%2Fmodels%2Fextensions%2Ftrait.py%20line%208%3A%20change%20%2225%20categories%22%20to%20%2226%20categories%22%20and%20update%20the%20description%20to%20include%20the%20recurrence%20axis.%202)%20migrations%2Fextensions%2Fversions%2F0002_taxonomy_library.py%20line%2037%3A%20change%20%2299%20traits%20across%2025%20categories%22%20to%20%22100%20traits%20across%2026%20categories%22.%203)%20Same%20file%20lines%20672%20and%201115%3A%20change%20%2225%20element-side%20categories%22%20to%20%2226%20element-side%20categories%22.&repo=RoboFinSystems/robosystems) 2. Forward reference to dropped migration 0019
# created here must already admit it on a fresh DB; migration 0019 applies
# the same widen to DBs that ran an earlier version of this constraint.Migration 0019 was dropped in the preceding commit (
Minor Observations3. This contra-asset (credit normal balance) is mapped to 4. Test The existing test at What Looks Good
|
Address PR #731 review nits (all doc/comment-only): - bump 25 categories / 99 members -> 26 / 100 in trait.py docstring and 0002 docstring + the two trait-table comments (recurrence axis was added but these counts weren't updated) - rewrite the check_trait_category comment that referenced migration 0019 (dropped when the widen was consolidated into 0002) to explain no separate widen migration was needed
Summary
Completes a set of pre-launch fixes from a taxonomy framework review, done in the pre-tenant window where the seeded library is still freely rebuildable. It hardens fac-trait coverage on the tenant-shipped rs-gaap working set, adds a new analytical trait axis, and completes
facas a cross-framework anchor over the MVP working set. All changes are either tenant-additive (recoverable via resync) or library-only.Changes
Trait consistency —
rs-gaap-traitsindirectCashFlowReconcilingItemto the 13 keptIncreaseDecreaseIn*working-capital concepts (consistency with their excluded siblings; classification-only — verified it is not consumed by the renderer, so no behavior change).use/remeasurementto the 3 kept impairment-bearing concepts (matches the existing impairment pattern, e.g.TangibleAssetImpairmentCharges).New
recurrencetrait axis —fac-traits+ model + migrationrecurrence/nonrecurring(single-value flag) for normalized-earnings / NOPAT classification, bound to the 9 kept operating special-items (restructuring x4, impairment, disposal gains/losses x3, debt extinguishment). Orthogonal touse/remeasurementso both "NOPAT ex-remeasurements" and "NOPAT ex-all-special-items" cuts are expressible.check_trait_categoryinrobosystems/models/extensions/trait.pyand inmigrations/extensions/versions/0002_taxonomy_library.py.0002both creates the constraint and runs the content-driven seed that inserts the member, so the widen lives there; consolidated into0002rather than a separate migration since no DB has run it yet pre-launch.fac->rs-gaap bridge —
fac-to-rs-gaapowl:equivalentClassarcs so every concrete tenant-kept rs-gaap concept reaches a fac anchor (137/137, was 41/137), makingfaca complete cross-framework substrate over the MVP working set. Most arcs were derived from each concept's nearest fac-anchored calc ancestor; the rest assigned by EFS/liquidity/CF-section. Library-only (the bridge istenant_copy:false); the kept set andtenant-exclude/v1.jsonartifact are unchanged (verified by recomputingkeep_critical).Test fix —
tests/taxonomy/test_framework_bridge_seed.pyresolve_pinassertion. Thefacpackage becametenant_copy:falsein the earlier tenant-copy curation, so it is omitted from the resolved copy-pin; assert onfac-traits(a copieddepends_onpackage) instead. This file skips when the extensions DB is absent, so the staleness was hidden in CI — surfaced here only because the change set was verified against a live seeded library.Testing
just reset-local-> recovered viajust migrate-up extensions): migration chain applies cleanly; recurrence trait seeds (26 categories / 100 members); 137/137 concrete kept concepts reach a fac anchor (0 without); tenant-exclude artifact still in exact sync (2012/2012, zero diff); coherence scan all four checks OK; all 3 reporting styles render non-empty BS/IS/CF/SE.test_suggest_liquidity_narrowing.py+test_framework_bridge_seed.py-> 13 passed.ruff check,ruff format --check,basedpyrighton changed Python -> clean (0 errors); pre-commit hooks passed on every commit.just test-all(full unit suite): not run this session.Notes / Follow-ups
0002pre-launch (no prod DB has run it). Once0002runs in prod it is frozen, so any later trait-axis addition (e.g. an explicitrecurrence/recurringvalue, or aspecialItemaxis) will need its own migration.resolve_pintest fixed here is the concrete consequence of that gap); a deep content audit ofdisclosure-mechanics/reporting-checklist/rollup-rules/disclosures-to-textblocks.local/docs/ref/taxonomy.md, gitignored) was made locally to match (fac = 4 packages, 26 trait categories); not part of this diff.