Metrics M-1: rs-metric catalog + compute-metrics; TAXONOMY_AUTHORING_ENABLED gate#894
Merged
Merged
Conversation
… authoring - Seed the rs-metric library package (Key Financial Metrics: working capital, current/quick ratio, debt-to-equity, interest coverage) -- elements + structure + presentation arcs + Derive rules over rs-gaap anchors. Migration 0022 widens the vocabulary CHECKs (factset_type 'metric', rule_pattern 'Derive', element source 'rs-metric') and backfills existing deployments: public library seed, framework_packages junction row, and per-tenant resync under the 0016 bypass GUC. - compute-metrics operation (REST + auto-generated MCP tool): binds each Derive rule's operands to the entity's most recent persisted report facts at period_end, evaluates via the safe AST evaluator, and upserts a standing factset_type='metric' FactSet per (structure, entity, period_end) -- the accumulating time series; re-runs replace the period's values. Missing operands and undefined ratios skip with a reason, never error the run. - Metric envelope builder renders the standing series: one period column per FactSet, one row per catalog concept in presentation-arc order. - TAXONOMY_AUTHORING_ENABLED gates reporting_extension/custom_ontology taxonomy-block authoring (create + update -> 403) per environment, fail-closed in prod/staging; delete stays open and chart_of_accounts is never gated. One check at the command dispatch chokepoint covers REST and MCP. - Driftline demo probe computes both comparative period ends and verifies the rendered two-period series; InterestCoverage exercises the skip path for the debt-free scenario.
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
Two workstreams in one PR (deploy-coupled by design):
Metrics backend MVP (M-1)
rs-metriclibrary package (frameworks/rs-gaap/packages/rs-metric/v1, ordinal 14): the Key Financial Metrics catalog — Working Capital, Current Ratio, Quick Ratio, Debt-to-Equity, Interest Coverage. Each metric is a qname-addressable concept plus oneDeriverule ($Metric = f(rs-gaap operands), sameruleVariablesshape as the rollup rules), and the container node is both an abstract element and the seededblock_type='metric'Structure every tenant receives.compute-metricsoperation (REST + auto-generated MCP tool): binds each Derive rule's operands to the entity's most recent persisted report facts atperiod_end, evaluates via the existing safe AST evaluator (evaluate_derivation), and upserts a standingfactset_type='metric'FactSet per (structure, entity, period_end) — the accumulating time series. Re-running a period replaces its values. Missing operands / undefined ratios skip with a reason, never error the run.fact_set_idpin honored.factset_type+'metric',rule_pattern+'Derive', elementsource+'rs-metric') across public + every tenant schema, seeds the package into the public library, mirrors theframework_packagesjunction row, and resyncs into existing tenants under the 0016 bypass GUC. Fresh deployments get everything from 0002 + provisioning (manifest +_widen_library_checks+ models updated in lockstep).TAXONOMY_AUTHORING_ENABLED(environment gate)Walls tenant framework authoring (
reporting_extension/custom_ontologytaxonomy blocks) behind an environment-level flag while the surface seasons:chart_of_accounts).chart_of_accountsis never gated.falsethere, so a missing SSM parameter cannot open the surface. Dev/test default on (the scenario demos author disclosure notes). Enable later withjust ssm-set <env> features/TAXONOMY_AUTHORING_ENABLED true+ API restart (flags read once at process start).Verification
test_incremental_materialize, passes isolated).Deploy notes
unit='pure'facts mint a cosmetically-wrongiso4217:pureunit node on materialize.bin/setup/aws.shfeature-flag seed array has pre-existing stale entries (LEDGER_ENABLED) — left as-is, only the new flag added.