Skip to content

gitgalaxy evolution --db: growth, function lifetimes, hubs by callers and centrality, function types and their stability, comments #8717

Open

Description

@squid-protocol

Part of #8715. Needs the git-only core (the first sub-issue).

What

gitgalaxy evolution REPO --db SCAN_DB (and --snapshots 3m): the sections that need quarterly scans, read the way reach and libsurface read a finished scan.

Sections

  • Growth: functions per scan; language mix (share of code lines by language per scan: eight largest, rest grouped); births (new code, moved in) and deaths (removed, moved out); age layers (functions by the year they first appeared); share of the code edited and untouched.
  • Function lifetimes: Kaplan-Meier survival of functions born during the scans and of those already there at the first scan, half-life, median age, longest-lived functions that have gone, largest functions present since the first scan.
  • Hubs, two measures: most-called functions (callers) and most central functions (PageRank), with callers over time; persistence of the top 1% after one and five years (tracked by function name so a file move is not a death); former hubs, checked against git grep so a function the scan did not see is not called gone.
  • Kinds of functions: the engine's 14 function archetypes with their meanings (FUNCTION_ARCHETYPE_DEFINITIONS), the mix over time, and the share that keep their type a year later, for functions and for files (by composition label), edited or not. File-level file_cluster_N labels have no readable names and repo labels are withheld when validation fails; neither is shown.
  • Comments: comment lines per code line, functions with a comment above, TODO-type and fragility markers per 1,000 lines.
  • Repairs near the change: the repair radius within one and two calls against same-file functions of similar size, with intervals (optional piece, see the extras issue).

Self-check against an independent parse (scan sections)

Prototype: tools/report/self_check.py (temporal-crucible sensor-overhaul). With a scan, the report compares the scan database with a tree-sitter parse of the same snapshot and prints a Pass / Warning / Fail table:

  • Code files the scan read, with vendored directories counted apart and directories whose name is on the scanner's default ignore list called out ([BUG] Scanner: directories named log, logs, classes, docs (and other ambiguous names in IGNORED_DIRECTORIES) are skipped by name, hiding real source, and are not recorded as excluded #8708).
  • Function agreement: recall and precision of function definitions against a plain parse (DPDK 98% / 97%; nDPI 98% / 84%).
  • Call-edge agreement against a name-matching baseline (each call to a name that exactly one function defines is an edge): DPDK 99% of the baseline's 109,633 edges found, 92% of GitGalaxy's edges in the baseline; nDPI 99% / 94%. Cross-file call pairs (what gitgalaxy reach counts): 96% / 91% and 98% / 100%.
  • Import graph agreement: each #include (C family) or import (Python) naming exactly one file, against the scan's import edges (DPDK 99% / 100%; nDPI 100% / 100%). Go and Rust imports are not checked yet.
  • Two ratings. Live agreement on this repository, and a standing rating against compiler-grade references measured in the research (reach_vs_treesitter.md): C against libclang, strict call edges, precision 89% and recall 70% (61% on seven small repositories); Python pyan3 53% / 65%; Go VTA 81% / 64%; Rust rust-analyzer 58% / 67%. Every standing recall is below 85%, so every scan-mode report carries a note that hub lists, repair radius and call counts are lower bounds, and a warning when the live agreement is not good.

Acceptance

  • Scans made by older engines lack columns (header comments, caller counts, archetypes): missing columns count as zero and the sections that need them are dropped, with a note. (10 of the prototype's first 18 reference runs crashed on this.)
  • An almost empty first scan (a repository's first commits) is skipped so growth and age are not distorted.
  • A per-language reliability line is printed next to every call-graph figure (checked against libclang for C; sensitive to overloaded names in Java; Go and Python not evaluated; Rust records about a third of resolvable calls).
  • A "what the scan skips" note: directories the scanner ignores by name are not in these figures ([BUG] Scanner: directories named log, logs, classes, docs (and other ambiguous names in IGNORED_DIRECTORIES) are skipped by name, hiding real source, and are not recorded as excluded #8708).
  • Charts: the age layers and the function-type mix use a spectrum with the key at the side in layer order; every chart has a text alternative (aria-label) and the page works at phone width.
  • The sections reuse activity, libsurface and reach where they overlap.
  • The self-check table above ships with the sections; thresholds (pass at 85% recall, 90% for functions and imports; warning from 65%/75%) are defaults, not validated. An optional --reference comparison against a compiler-grade tool (libclang needs a build configuration and parsed only part of the files in our tests) is out of scope here.

Activity

  1. added
    enhancement
    metrics
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementmetricspriority: medium

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions