Skip to content

# [EPIC] Enforce 5-Tier Knowledge Graph Hierarchy (Class-Level Rollup) #108

Open
0 of 3 issues completed

Description

@squid-protocol

🛑 Problem Statement

Our documentation (08-01-methodology.md, 08-11-test-coverage.md) mathematically defines a 5-tier architectural roll-up: Function -> Class -> File -> Folder -> Repo.

Currently, our SignalProcessor flattens this hierarchy. It aggregates the raw mass of all Functions directly into a File-level 0-100 risk score, completely bypassing Level 2 (Class-level containment boundaries). This prevents downstream consumers from visualizing Class-level risk exposures.

🎯 Objective

Refactor the SignalProcessor and output recorders to strictly enforce the documented 5-tier mathematical hierarchy without degrading the 100,000 LOC/sec ingestion velocity.

📋 Sub-Issues

  • #XXX [REFACTOR] Upgrade SignalProcessor Risk Equations for Class-Level Aggregation
  • #XXX [SCHEMA] Expand SQLite and Output Recorders to Store Class-Level Risk Vectors
  • #XXX [DOCS] Sync Legacy 4-Tier Output Schemas with 5-Tier Definitions

Sub-issues

Sub-issues

0 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. added
    refactor
    epic
    on Jul 5, 2026
  2. squid-protocol commented on Jul 25, 2026

    @squid-protocol
    OwnerAuthor

    Grounded this against the actual code before starting (full detail in comments on #109/#110/#111). Summary for anyone landing here first:

    • The "14 metrics" scope is confirmed exactly, cross-checked against `08-01-methodology.md`'s hierarchy table and `RISK_SCHEMA`. The other 5 (`dead_code`/Graveyard, `stability`/File Stability, `churn`/Deep Churn, `tabs_vs_spaces`/Civil War, `secrets_risk`) are correctly `N/A` at Class level -- not something to add.
    • The function→class linkage already exists in `detector.py` (not `prism.py` as # [REFACTOR] Upgrade SignalProcessor Risk Equations for Class-Level Aggregation #109 currently says), and already computes `method_count`/`state_entanglement`/`lcom_score` per class -- more groundwork is already in place than the sub-issues assume.
    • The key implementation detail: per the doc table, Class-level output is "count based, 0-∞," the same category as Function level -- only File-level is sigmoid-normalized to 0-100. So this isn't "run the existing sigmoid _calc_* methods per-class" -- it's a new, separate raw-count rollup step per class, sitting alongside the existing (unchanged) file-level pipeline.

    Proposed sequencing stays #109 → #110 → #111 as originally ordered, since #110's schema depends on #109's actual output shape and #111 verifies both. Starting on #109 with a minimal increment: the rollup function itself, validated against real files, no schema changes yet.

  3. added a commit that references this issue on Jul 25, 2026
  4. added
    scope:frontier
    on Oct 16, 2026
  5. added
    metrics
    priority: low
    on Oct 28, 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

    epicmetricspriority: lowrefactorscope:frontier

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions