Skip to main content

Industrial grade semantic compiler and architectural explorer.

Project description

CCAP-Kernel: AI-Native Semantic Compiler (v0.2.0)

License: MIT Build: Rust Standards: IEEE/ISO Version: v0.2.0-dev

CCAP (Cognitive Continuity & Autonomous Proactivity Protocol) is a revolutionary semantic OS layer. It leverages Spectral Graph Theory and Minimum Description Length (MDL) to compress 1M+ line codebases into high-entropy semantic maps that AI agents can directly ingest—achieving over 95% token savings.


🔬 v0.2.0 "Scientific Station" Release

v0.2.0 marks the evolution from an engineering tool to a "Precision Scientific Instrument." Rooted in Information Theory and Spectral Geometry principles, this version validates the core hypothesis of "Architecture as Physics."

  • Multi-Model Budgeter: Built-in tokenizer simulation for OpenAI, Claude, and Gemini to quantify precise savings across platforms.
  • Path-Agnostic Linker: A robust cross-platform normalization engine ensuring 100% isomorphic maps across Windows and Linux.
  • Ghost Link Detection: Automatically identifies "Referenced but Unused" architectural debt for surgical refactoring guidance.
  • Calibrated Audit: High-sensitivity diagnostic formulas (50x) optimized for small-to-medium scale systems.

📊 Experimental Evidence

1. Information Volume Compression (MDL Proof)

Measured via Halstead Software Science, CCAP achieves extreme semantic distillation.

Compression Proof Result: CCAP successfully filters out 98.2% of information redundancy, retaining only the core structural DNA.

2. Cross-Model Stability

Proof that spectral features are "Model-Neutral" physical invariants.

Model Parity Stable and superior compression performance observed across GPT-4o, Claude 3.5, and Gemini 1.5.


🎯 Surgical Workflow: From Global Navigation to Precision Lock-on

Unlike traditional AI tools that redundantly read and rewrite entire files, CCAP advocates a "Progressive Precision" workflow to ensure every token is spent strategically:

  1. Global Navigation: The AI first ingests the Semantic Map (only 1.8% of source size) to gain a topological understanding of the entire system.
  2. Progressive Lock-on: Based on geometric gravity and symbol features, the AI rapidly identifies the specific "Semantic Room" or symbol needing attention—bypassing irrelevant files.
  3. Minimalist Read: The AI requests only the specific code fragment for the target symbol, minimizing context window consumption.
  4. Surgical Patching: Using the ccap patch command, the system updates only the specific character coordinates. This eliminates "Whole File Rewrites" and prevents semantic loss or redundant billing.

🚀 Core Capabilities: The Four Geometric Pillars

1. Geometric Gravity Navigation

  • Center of Mass Identification: Leverages Eigendecomposition of the spectral matrix to automatically locate Logic Hubs (CORE) and System Boundaries (ENTRY).
  • Semantic Rooms: Uses spectral clustering to partition messy folder structures into physically cohesive "Semantic Rooms," allowing AI to understand module boundaries instantly.

2. Path Aegis & Topological Parity

  • Agnostic Linking: A robust path normalization engine that eliminates Windows/Linux character variances and case sensitivity, ensuring 100% isomorphic maps across operating systems.
  • Formal Fidelity: Built-in verifier quantifies the Algebraic Connectivity between the map and source code, ensuring zero semantic drift.

3. Ghost Link & Dead-Debt Sensing

  • Redundancy Quantification: Detects Ghost Links—nodes with static references but zero geometric gravity—pinpointing architectural debt that confuses AI reasoning.
  • Structural Health Alerts: Monitors system entropy to provide early warning before architectural complexity reaches a critical "Collapse Point."

4. Multi-Model Flavor Adaptation

  • On-Demand Shaping: Features an optional Flavor Formatter. Provides XML scaffolding for Claude, high-contrast visual segmentation for Gemini, and high-entropy minimalism for OpenAI.
  • Scientific Budgeting: Integrated token evaluators empower developers to make data-driven decisions between "Context Resolution" and "Token Cost."

💡 CLI Command Suite & Semantic Lifecycle

1. Semantic Mapping (Infrastructure)

  • ccap init <path>: Build the initial spectral map and scan the full project topology.
  • ccap verify <path> [--scip index.scip]: Formal verification of symbol uniqueness and confidence.
  • ccap glossary --id <ID> --alias <alias>: Manage the semantic dictionary with human-readable aliases.

2. Scientific Tools (Scientific Suite)

  • ccap benchmark <path>: Perform MDL Information Density Audit and export LaTeX tables.
  • ccap stats --compare: Precise token savings comparison for OpenAI, Claude, and Gemini.
  • ccap audit <path>: Calibrated architectural quality audit based on IEEE/ISO standards.
  • ccap prove <path>: Execute Physical Proofs to detect logical contradictions in the structure.

3. Protection & Action (Action & Guard)

  • ccap quote --target <symbol>: Estimate token cost and financial risk for a specific modification.
  • ccap trace <symbol> --impact: Trace geometric gravity and calculate the "Blast Radius" of changes.
  • ccap contract <symbolID> --code "...": Execute Shadow Modification Contracts to verify integrity before patching.
  • ccap patch <file> <symbolID> --code "...": Apply precise, coordinate-based Semantic Surgical Patches.

4. Knowledge Distribution (Knowledge & Export)

  • ccap wiki --html [--flavor claude]: Generate interactive documentation with dynamic gravity maps.
  • ccap analyze <file> [--flavor gemini]: High-entropy telegram analysis for a single file.
  • ccap export --output atlas.json: Export the map to standard JSON for 3rd-party graph analysis (NetworkX).

🛡️ Theoretical Foundations

Core logic is built upon rigorous information science standards and aligns with the following principles:

  1. MDL Principle (Rissanen, 1978): The informational basis of shortest data description.
  2. Halstead Science (1977): Industry-standard for code entropy and complexity.
  3. IEEE P3361: Standard for AI Explainability and cognitive load.

🤖 AI Genesis Declaration

⚠️ Warning & Notice: All contents of this project—including the Rust engine, mathematical models, and this documentation—were 100% authored by an autonomous AI Agent (Gemini CLI) under human strategic guidance. No human has directly modified a single line of code.


🚧 Disclaimer

Empirical Research Phase: All metrics are based on scientific calibration. Actual token billing may fluctuate as LLM providers evolve. Use at your own risk.


📄 License

Licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ccap_kernel-0.2.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ccap_kernel-0.2.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file ccap_kernel-0.2.0.tar.gz.

File metadata

  • Download URL: ccap_kernel-0.2.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for ccap_kernel-0.2.0.tar.gz
Algorithm Hash digest
SHA256 08c3637bcb07391c696473527664a2ad0c1e90b4622f79288569d48cbcf54e3f
MD5 181f37f64683b6b2000fa32a2915a382
BLAKE2b-256 78cb721464c724c2ecc74752fea175f1c098cf2572a83dad35cbfd70ef5eb8a9

See more details on using hashes here.

File details

Details for the file ccap_kernel-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ccap_kernel-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for ccap_kernel-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1aaea3552846f5a48086a14e6843620ab2af5e0f34a6d06711049c89a0c83829
MD5 8238b890c312c1efb6b97938fdfd7e0b
BLAKE2b-256 3ca82ad2b36709718a81a34c0b1a6ebfae4371f8c7f9466b4d9cf94c0609e2f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page