Skip to content

# [DATA-INTEGRITY] Enforce Zero-Dependency Mode Visibility & Strict NULL Fallbacks Across All Recorders #97

Closed
4 of 4 issues completed

Description

@squid-protocol

🛑 The Architecture & The Oversight

As an AST-free, Zero-Trust knowledge graph engine, GitGalaxy is built to survive air-gapped or restricted CI/CD environments. When C-backed computational engines (networkx, tiktoken, xgboost, pyyaml) are missing, the orchestrator gracefully degrades into Zero-Dependency Mode.

For strict data provenance, the architectural intent was always to record bypassed metrics (like N-Dimensional topology, PageRank, or Token Mass) as NULL. This is explicitly stated in the galaxyscope.py CLI warning and documented properly inside the AI-context payloads generated by llm_recorder.py (which correctly notes that missing values are "intentionally recorded as null").

However, I missed a section in the translation layer. Currently, record_keeper.py relies on hardcoded dictionary fallbacks (e.g., .get("pagerank_score", 0.0)). When Zero-Dependency Mode skips these calculations, the dictionary keys are omitted, triggering the literal 0.0 fallbacks. As a result, false zeros are being injected into the SQLite database instead of true NULLs. Furthermore, llm_recorder.py is currently the only output artifact that explicitly highlights to the user that this degraded mode was engaged and how it alters the system.

⚠️ The Risk (Data Poisoning)

A 0.0 is a mathematical reality, while a NULL is a lack of data. If the engine outputs literal zeros for metrics like Dependency Blast Radius or Betweenness Centrality, downstream consumers (Enterprise Data Warehouses, AI agents, or WebGL UI dashboards) will interpret those as perfectly isolated files rather than uncalculated metrics.

🛠️ The Fix (Implementation Plan)

To guarantee absolute data integrity, I am standardizing the Zero-Dependency state across all export artifacts:

  • record_keeper.py (SQLite Vault): Strip the 0.0 fallbacks for advanced topology and ML metrics. Map omitted dictionary keys to strict SQL NULLs. Introduce an is_zero_dependency_mode boolean to the repo_data table.
  • audit_recorder.py (Forensic JSON): Elevate the mode flag into the Forensic Traceability Anchor. Explicitly label bypassed vulnerability and ML metrics as [BYPASSED - ZERO DEPENDENCY MODE] rather than reporting 0.
  • gpu_recorder.py (WebGL JSON): Inject the zero_dependency_mode flag into the payload["meta"]["session"] dictionary so the front-end rendering engine can display an accurate system-state warning regarding missing spatial geometries.

📈 Impact

  • Target Domains: Data Provenance, Air-Gapped DevSecOps, Static Application Security Testing (SAST).
  • Ensures the mathematical integrity of the structural telemetry pipeline regardless of the host environment's dependencies.

Sub-issues

Sub-issues

4 of 4 Issues completed
Loading 4 sub-issues

Activity

  1. added
    data-integrity
    bug
    on Jul 5, 2026
  2. added a commit that references this issue on Jul 20, 2026
    e7e1acf
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

    bugdata-integrity

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions