Skip to main content

SCHEMA_VERSION

Constant SCHEMA_VERSION 

Source
pub const SCHEMA_VERSION: i64 = 8;
Expand description

On-disk schema version for the splayed baseline tables. Bump whenever any table builder gains, loses, renames a column, or changes a column’s physical type. The meta table stamps this value at save time; readers refuse to decode mismatched baselines.

History:

  • v1: initial schema, every string column stored as RAY_STR.
  • v2: low-cardinality columns (language, module, kind, resolution, severity, top_author) moved to dict-encoded RAY_SYM for storage and load-time wins on large repos.
  • v3: architecture analysis materialized as first-class baseline tables (arch_cycles, arch_unstable, arch_foundations, arch_levels, arch_distance, arch_violations) so agents query architectural detail through Rayfall instead of by jq-piping a JSON dump from the typed MCP tools.
  • v4: trend history materialized as splayed tables (trend_health, trend_hotspots, trend_violations) so agents query “what got worse over the last N days” against the baseline instead of parsing .raysense/trends/history.json themselves.
  • v5: trend tables become the source of truth. JSON (.raysense/trends/history.json) is gone. trend record appends rows to the splayed tables in place via Rayfall concat; baseline save reads them off disk and re-emits them rather than rebuilding from JSON. Hard break: v4 baselines fail the schema check and require a fresh save.
  • v6: imports table gains an alias column capturing as-style renames (Rust use foo::Bar as Baz, ES import { foo as bar }, Python import x as y). Empty string when no alias is declared. Hard break: v5 baselines fail the schema check and require a fresh save.
  • v7: functions and types tables gain a normalized visibility symbol column (public, protected, internal, restricted, private, unknown) populated via per-plugin visibility_patterns. Hard break: v6 baselines fail the schema check and require a fresh save.
  • v8: new trait_impls table records impl Trait for Type relationships extracted from Rust sources, so blast-radius / coupling tooling can follow the trait -> implementer edge without round-tripping through TypeFact.bases. Hard break: v7 baselines fail the schema check and require a fresh save.