compile_model
ClaudeCompile the GASP Standard metrics your mapping covers into your Apache Ossie semantic model. Takes the same input as validate_mapping (a GASP adapter, or an Ossie mapping with your semantic_model) and returns your model with a gasp_ metric for every formula entry whose fields are all mapped (main formula, O and M forms, variants and named breakdowns): a direct OSSIE_SQL_2026 expression over your datasets and fields where the expression language can state it, else staged through a gasp_staged_ per-period dataset whose source is the compiled SQL over your tables in your warehouse dialect, reading a period spine table you provide (one row per reporting period; gasp.period_spine unless you pass period_spine). Entries with unmapped pairs are left out and listed with the pairs they need; recompiling replaces every gasp_ metric and staged dataset and leaves the rest of the model as it was. The compiled metrics are checked against the bundled Ossie model schema and GASP's reference checks. A GASP adapter compiles into the model synthesised from its tables and columns, which validate_mapping shows. Pass metrics or department to compile a subset, output 'report' to get the coverage without the document.
coverage_gap
ClaudeAudit a set of tracked metrics against the GASP relationship graph. Returns three lists: upstream missing (metrics with a direct edge into the set that the set leaves out), downstream missing (metrics with a direct edge from the set that it leaves out) and disconnected (graph metrics with no path of any length, in either direction and through any node, to the set; the first 25 shown). Names resolve as in lookup_metric; an input that is ambiguous, outside the graph, not a metric or unknown is listed as unresolved with the reason. Use it before instrumenting a dashboard, then infer_drivers or explain_path on the candidates.
derive_cel
ClaudeSQL that derives CEL Revenue_Events from your billing data, by the rules in the standard (cel.md, 'Deriving Revenue Events from a Subscription Ledger', 'Deriving Revenue Events from an Invoice Ledger' and 'Deriving Usage Realisation'). Most billing systems hold subscriptions or invoices, not events. source: subscription (default) turns the subscription dataset your mapping covers (subscription_id, customer_id, snapshot_date, mrr, subscription_status, segment, as snapshots at any cadence or a version history) into one revenue_event row per movement: a step is a change in a subscription's active MRR, the ledger's first date is the opening balance, prior_mrr and new_mrr are the customer's MRR chained so prior_mrr + mrr_change = new_mrr holds on every row, and the event type (new, expansion, contraction, churn, reactivation) is read from the customer's MRR around the step, with the ATL lifecycle tag, change_nature permanent and an empty expansion_classification (the ledger cannot know it). source: invoice reads the invoice dataset instead (invoice_id, subscription_id, customer_id, snapshot_date, service_period_start, service_period_end, recurring_amount): each invoice is one service period whose MRR is the recurring amount over the months it covers, and the same rules apply. When the mapping covers the usage_record dataset (subscription_id, customer_id, period_start, period_end, committed_amount, usage_amount), or usage is true, each period whose usage exceeds its commitment adds an expansion tagged usage_realisation with change_nature temporary dated the period's end and its scheduled_reversal the next day, chained with the ledger's steps. Takes the same mapping as generate_query (a GASP adapter or an Ossie mapping with its semantic_model) and the ledger's currency; the dialect is the one asked for, else the adapter's warehouse, else postgres. Unmapped fields stay as {{field@dataset}} placeholders and are listed. Run the result to build the revenue_event table, map it, and the MRR movement metrics compile over it.
explain_path
ClaudeHow a movement in one graph node reaches another: up to 5 chains of edges followed forward from from to to, shortest first, then by highest score. Each step gives the edge type, its classification (metric_signal, structural, lifecycle, behavioral, assignment or generative), its attenuation and whether it inverts direction; each path gives its score and the direction the target moves when the source rises. A baseline edge (MRR into NRR) can only start a path. Names resolve as in get_relationships, so entities and concepts work too. No path means no forward chain within maxDepth: try the reverse. Use it on a candidate from infer_drivers.
generate_checks
ClaudeThe readiness checks the GASP Standard states, as SQL over the datasets your mapping covers (readiness level 3, the Check step). From cel.md and atl.md: CEL row identity (prior_mrr + mrr_change = new_mrr on every revenue event), MRR continuity (a subscription's mrr_start equals its mrr on the previous snapshot), unique event_id per event dataset, the ATL tags (one lifecycle_attribution per event, an expansion_classification on every expansion, contraction and reactivation revenue event and every amendment, a cost_function on every cost event), customer identity both ways (every revenue event's customer is a known customer, every customer active on the latest snapshot has a revenue event) freshness (the latest date per dataset within a window) and, for every fully mapped metric with a hard range rule in the ontology (NRR at least 0, GRR at most 100%, Gross Margin, ARR and others), its value in every reporting period of your period spine (the table compile_model reads; period_spine names another). One statement, one row per check with its violation count. GASP has no warehouse access: run it, then pass the rows back as results to get pass or fail per check and per metric; each check names the metrics whose formulas read what it covers. Checks whose fields the mapping lacks are listed with what they need. Takes the mapping generate_query takes; the dialect is the one asked for, else the warehouse's, else postgres. Follow with plan_fixes for the ranked list.
generate_query
ClaudeSQL for one GASP Standard metric against your warehouse, compiled from its canonical formula and filled from your adapter: one scalar subquery per aggregate, each reading the table mapped to its GASP dataset, with :period_start and :period_end date parameters (both inclusive). Pairs you have not mapped stay as {{field@dataset}} placeholders, where the tag names the GASP dataset the column must come from; the output lists them with any dataset that has no table and any mapping conflict, plus the URL, dialect, datasets, grain and the mapping it used. breakdown names a breakdown the metric declares (get_formula lists them, e.g. 'by_plan' on MRR) and returns one row per value. The dialect (postgres, snowflake, bigquery or databricks; postgres also covers Redshift) is the dialect argument, else the adapter's warehouse when it names one of them, else postgres. Check the adapter with validate_adapter first.
get_data_requirements
ClaudeWhat a warehouse needs to compute GASP Standard metrics: per metric, a row for each field and dataset pair the canonical formula reads with its type, whether it is staged (a cohort or prior-period comparison), source system, grain, frequency, page URL and example SQL compiled from the formula. Pass metric for one metric (resolved as in lookup_metric), department for every metric in it, both to pick between metrics that share a name and neither for every metric with a formula. breakdown names a breakdown the metric declares (get_formula lists them, e.g. 'by_plan' on MRR): the fields then include the dimension and the SQL returns one row per value. dialect (postgres, snowflake, bigquery or databricks; postgres is the default and also covers Redshift) sets the example SQL's syntax. A metric with no formula gives the reason. Use generate_query to fill the SQL from your adapter.
get_formula
ClaudeThe canonical formula of one GASP Standard metric in the GASP grammar, with its unit, operating (O) and market (M) forms, named variants, breakdowns (one row per value of a field or bucket; total() reads the whole population), notes, the metrics it reads with role and polarity, the fields and datasets the formula and each form read, the enum filters each form applies (so forms reading the same fields show where they differ) and the formula as written in the standard. A metric that cannot be computed as one formula gives the reason. Names resolve as in lookup_metric. Use get_data_requirements for field types and example SQL and generate_query for SQL against your own tables.
get_relationships
ClaudeOne node of the GASP relationship graph (a metric, entity or concept) with its description, category and level and its direct edges, each neighbour with its edge type and description: upstream (edges into it), the metrics that measure it, downstream (edges out of it) and, for a metric, the entities it measures. For an entity it also lists every metric whose formula reads the entity's datasets, with department and URL. Edge types: drives, reduces, predicts, component and measures (metric signal); converts_to, parent_of and belongs_to (lifecycle); owns, grants and priced_by (ownership); manages, serves, engages_via, submits, represented_by and sources (interaction); generates, produces, contributes_to and incurs (financial flow). Metric names resolve as in lookup_metric; a metric outside the graph says so and a miss lists every node. Use infer_drivers or explain_path to walk more than one hop.
infer_drivers
ClaudeRank the upstream metrics that could explain an observed movement in a metric. Walks the GASP relationship graph backwards from the metric up to maxDepth edges and returns up to 25 candidates, each with the direction it would have moved, a score and its path to the metric. Direction flips across a reduces edge and across an input with negative polarity (a denominator or subtracted term), marked ↓ in the path. A baseline input (read at period start, as NRR reads MRR) is listed as a candidate but not walked through, since its own drivers cannot move the metric within the period. Scores are products of edge attenuations: they rank structural links and say nothing about magnitude. Works on metric nodes only. Follow up with explain_path for the chain behind a candidate or coverage_gap to check you track it; for 'what if' simulation use the TWIN Modifier at https://gaspwiki.com/v1/twin-modifier.
list_metrics
ClaudeList GASP Standard metric names grouped by department and category, with the total, optionally filtered by department, signal type or both. Names only: use lookup_metric or get_formula for a metric's details. A metric cross-referenced from another department is listed under both (NRR under Core and Customer Success). The Core tier is the 'Core' department. An unknown department returns close names and the department list.
lookup_definition
ClaudeLook up a GASP Standard glossary term (e.g. 'Signal Type', 'Sensitivity Tier', 'Access Scope', 'Metric Owner', 'CEL'): the full definition and body, its section, the canonical or reference link, where it is used and the page URL. The term must match exactly, ignoring case: the term, its slug or either part of 'Term (Abbreviation)', so 'CEL' finds 'CEL (Commercial Event Ledger)'. A metric name points you to lookup_metric and a miss returns close names. Some metrics also have a short glossary entry (Logo Churn Rate, Win Rate); lookup_metric gives their formula and benchmarks.
lookup_metric
ClaudeThe full record of one GASP Standard metric: department, category, signal type, page URL, definition, the formulas as written, the canonical GASP grammar formula (unit, forms, variants, breakdowns, fields and datasets), benchmarks, validation rules, common mistakes, sources, aliases, the entities it measures, operating and market forms, any adjusted variant and the recommended sensitivity tier and access scope. The name must match exactly, ignoring case: formula id, graph node id, full name, name without its abbreviation, abbreviation, graph label, alias or slug. A name several departments use (e.g. 'Activation Rate') returns each candidate with department, formula id and URL; prefix the department ('Product Activation Rate') or pass the formula id. A glossary term (e.g. 'Signal Type') returns its definition and a miss returns close names to retry with. Use get_formula for the formula alone and search when you do not know the name.
plan_fixes
ClaudeThe ranked fix list for a mapping (readiness level 3, the Plan step): every GASP field a partly covered metric still needs, and every readiness check that failed, ordered by the Core metrics each fix unlocks, then all metrics unlocked, then metrics it helps, with an effort class (small for a mapping, medium for a tag backfill or a pipeline fix, large for cross-system identity work) shown and used only as a tiebreak. A fix unlocks a metric when it is the last thing between that metric and covered-and-passing; a metric with two blockers counts as helped by each. Pass the results generate_checks produced to rank data fixes beside mapping gaps; without them the plan covers mapping gaps alone. Takes the mapping generate_query takes.
profile_schema
ClaudeProfile a warehouse schema into a minimal Apache Ossie semantic model, the first step towards a GASP mapping (readiness level 1). Pass the schema as the rows of information_schema.columns (JSON or CSV with table, column and type), an object with a tables list, or CREATE TABLE statements, read through your own warehouse MCP or from a dump. Optionally pass statistics per column (rows, nulls, distinct, min, max, values); output: statistics returns the query that gathers them. For every table the profile infers the key, the time field and the kind (snapshot, event, fact or reference), each with its evidence and confidence, plus the relationships the columns imply; a low-confidence inference is left out of the model and listed as a question for the Decide step rather than guessed. The report ends with the model as YAML, to pass to propose_mapping as semantic_model; the questions go to record_decision.
propose_mapping
ClaudePropose a GASP mapping for a warehouse from its profiled semantic model (readiness level 2). Pass semantic_model (the model profile_schema returned, or your own Ossie model) or schema (profiled on the way in, with optional statistics). Every table is scored against every GASP dataset on its columns, its profiled kind, key and time field and its name; every column of a proposed table against the dataset's fields by name, structural role (the table's time field is the dataset's date), a short synonym list, word order and near names, each checked against the warehouse type and, for an enum field, the listed values. A column in cents gets a divide-by-100 transform and enum values the standard does not use a CASE recode when one is known. Only high-confidence pairs enter the mapping; medium ones are listed as candidates with their evidence and what would settle them; the rest are unmatched. Returns the report and the Ossie mapping over the model (a transform becomes a calculated field): the candidates go to record_decision with both documents, then the mapping to validate_mapping, compile_model and score_drift; output: adapter gives the same pairs as a GASP adapter.
readiness_report
ClaudeWhich readiness level a company has reached on the GASP pipeline and what stands between it and the next, read from the documents the other tools produced. L1 Profiled: a semantic model exists (profiled by profile_schema, your own, or synthesised from a GASP adapter). L2 Mapped: at least one metric is fully covered and no profiler question and no proposer candidate is open (the line record_decision draws). L3 Clean core: the CEL revenue events are mapped, the checks have been run and every Core metric the mapping covers passes every check that protects it. L4 LLM-ready: the canonical metrics are compiled into the model (compile_model) and none of your own metrics differs from its canonical counterpart (score_drift, run here on the synthetic dataset when the model carries metrics of your own). Levels are cumulative. Pass the mapping (either format), the semantic_model it reads (with an adapter, the model compile_model returned, so the compiled metrics and your own are seen) and the results of the generate_checks statement; without results level 3 is blocked and the report says what to run. Each blocker names the tool that clears it; the Next line is the one action to take. Nothing runs against your warehouse.
record_decision
ClaudeRecord the decisions people make on a profiled and proposed warehouse, the Decide step of readiness level 2. Pass semantic_model and mapping (the ones propose_mapping returned) and decisions: a YAML or JSON list where each entry names what it is about, the subject by content and its owner. about: key, time, kind or type answers a profiler question and is written into the model (dataset, answer: the key columns or "none", the time column or "none", snapshot|event|fact|reference or an Ossie datatype with column); about: table accepts (or with accept: false rejects) a table as a GASP dataset (dataset, to: the GASP dataset) and maps its columns as the proposer would; about: field accepts or rejects a column as a GASP field of the dataset its table is mapped to (dataset, column, to: the GASP field, optional transform over {{value}}, which becomes a calculated field); about: owner names the team that owns a metric (metric, owner, optional contact), the slot validate_mapping reads; about: topic records a judgement call GASP cannot apply, such as which system owns customer identity, the reporting currency or what date marks churn (topic, answer). Every decision carries owner, an optional date (today when omitted) and note, and lands in the mapping's GASP extension; a later decision on the same subject replaces the earlier one. With no decisions it lists what is open: the questions no decision or model state has settled, the candidates no decision has settled and the covered metrics without an owner. Level 2 is reached when no question and no candidate is open. Returns the report with the updated mapping and, when it changed, the model, to pass on to validate_mapping, compile_model and score_drift.
score_drift
ClaudeScore how far your own metrics drift from the GASP Standard's canonical definitions, by result. Takes your mapping (a GASP adapter or an Ossie mapping, as validate_mapping does) and your semantic_model holding your metrics. Each metric is matched to a GASP metric by exact name, by the synonyms in its ai_context or by a pair you pass in matches, and a name or synonym ending in -O or -M (NRR-O, cac_m) matches that declared form; near names are listed for review and never scored on a guess. For every match the canonical metric is compiled into your dataset and field names (as compile_model does) and both run on the GASP synthetic SaaS dataset, six monthly periods, in an in-process Postgres (PGlite). Where the numbers differ the report gives both values per period, the largest difference and the likely cause read from the canonical formula: a null on one side (a sum over no rows that is NULL in your SQL and 0 in GASP's, or a canonical average or ratio with nothing to read), a construct one expression cannot state (a cohort, an opening value at period start, a period bound to a business date), a filter one side applies and the other does not, a dataset one side reads or an aggregate whose value has no equal on the other side. Metrics that read fields your mapping lacks are reported as not runnable with the field named. Your values are also checked against the standard's range for the metric (NRR at least 0, GRR at most 100%) per period, and where both the O and M forms of a dual-lens metric are matched the report scores the bridge between them (the Durability Gap for ARR, the Expansion Integrity Gap for NRR, the Activation Delta for CAC, the Contribution Leakage for LTV, the Services Drag for Gross Margin): your M minus O beside the canonical gap, per period.
search
ClaudeFind GASP Standard metrics and glossary terms when you do not know the exact name. The query matches as a phrase of whole words, the last word allowing a plural or verb ending ('churn' finds 'churned'), against metric names, aliases, definitions, formulas, the fields each formula reads, categories and departments, plus glossary terms, definitions and sections. Returns up to 10 results, one per metric or term, each with its type, department, what matched, a snippet and its URL. Names, aliases and terms rank first, then words within them, then definitions, then formulas and fields. When nothing matches (e.g. a misspelling) it returns up to 6 close names labelled 'Did you mean'. Pass a result's name to lookup_metric or lookup_definition.
validate_adapter
ClaudeSame as validate_mapping, under the tool's original name. Check a warehouse mapping against the GASP Standard and score its coverage. Accepts either format: a GASP adapter (JSON; schema https://gaspwiki.com/schemas/gasp-adapter-v1.json, versions 1.0 and 1.1) or an Apache Ossie mapping document (YAML or JSON) over your semantic model, which you can pass as semantic_model. A GASP adapter is converted on load into an Ossie mapping over a model synthesised from its tables and columns. Layers, each reported in its own section: the schema (the adapter JSON Schema with each violation's JSON path, and the Ossie mapping schema for the Ossie form), GASP's cross-document checks (every concept, relationship and field reference resolves against the GASP ontology and the model), then coverage: unknown fields and datasets, fields mapped to a dataset that does not carry them, bare column names on fields that live on several datasets, datasets whose fields point at different tables, pairs mapped twice, the field and dataset pairs mapped, every metric with a formula scored against the pairs its compiled SQL reads (fully covered, partially covered with the missing pairs, not covered), enum fields mapped without a transform, covered metrics with no declared owner, owners naming unknown metrics and up to 15 unmapped pairs ranked by how many partially covered metrics need them. Run it before generate_query.
validate_mapping
ClaudeCheck a warehouse mapping against the GASP Standard and score its coverage. Accepts either format: a GASP adapter (JSON; schema https://gaspwiki.com/schemas/gasp-adapter-v1.json, versions 1.0 and 1.1) or an Apache Ossie mapping document (YAML or JSON) over your semantic model, which you can pass as semantic_model. A GASP adapter is converted on load into an Ossie mapping over a model synthesised from its tables and columns. Layers, each reported in its own section: the schema (the adapter JSON Schema with each violation's JSON path, and the Ossie mapping schema for the Ossie form), GASP's cross-document checks (every concept, relationship and field reference resolves against the GASP ontology and the model), then coverage: unknown fields and datasets, fields mapped to a dataset that does not carry them, bare column names on fields that live on several datasets, datasets whose fields point at different tables, pairs mapped twice, the field and dataset pairs mapped, every metric with a formula scored against the pairs its compiled SQL reads (fully covered, partially covered with the missing pairs, not covered), enum fields mapped without a transform, covered metrics with no declared owner, owners naming unknown metrics and up to 15 unmapped pairs ranked by how many partially covered metrics need them. Run it before generate_query.