Skip to content

Releases: LoveCookieee-java/CookieGli

12:52-9/5/2026

Choose a tag to compare

@LoveCookieee-java LoveCookieee-java released this 04 Sep 17:53

CookieGli Update — Two-Tier Context Boost Engine, SQLite FTS5 BM25+ & Unified CookieGli_Full MCP

CookieGli v3.0 is a major architectural milestone designed specifically for the 2026 generation of frontier reasoning models (OpenAI GPT-6 Astra & GPT-5.6 Sol, Anthropic Claude opus 5 & Claude Fable 5.1, Google Gemini 3.8 Flash, Moonshot Kimi K3, and DeepSeek-V4).

This release introduces the Unified CookieGli_Full MCP Server with an intelligent Agent Disambiguation Matrix, a Two-Tier Context Engine, industrial SQLite FTS5 BM25+ full-text retrieval, automated Reasoning Calibration, and strict Token-0 Byte-Stability to lock in 90% prompt caching discounts.


🚀 What's New in Update

1. Unified CookieGli_Full MCP Server & Agent Disambiguation Matrix

  • All-in-One Server Entrypoint: Consolidates all CookieGli capabilities into a single MCP server profile (CookieGli_Full) while maintaining 100% backward compatibility with existing granular tools.
  • Categorized Tool Prefixes: Eliminates tool overlap and confusion across frontier models by explicitly categorizing tool schemas:
    • [01_TASK_BOOST] cookiegli_boost: Primary entrypoint for any coding or debugging task.
    • [02_SYMBOL_IR] cookiegli_search: Industrial Okapi BM25+ ranked full-text search across symbols.
    • [02_SYMBOL_BTREE] cookiegli_find_symbols: Sub-millisecond exact B-Tree symbol lookup for known identifiers.
    • [03_CODE_SKELETON] cookiegli_get_skeleton: Structural code folding preserving focused functions verbatim.
    • [04_IMPACT_ANALYSIS] cookiegli_blast_radius: Forward-to-ingress dependency graph & minimal targeted test suite.
    • [05_ERROR_DISTILLER] cookiegli_distill_lesson: Traceback bisection into Darwin learned patterns with Bayesian ROI.
    • [06_ARCHITECTURE] cookiegli_get_genome: High-density Layer 1 static codebase topology (<600 tokens).
    • [07_DARWIN_MEMORY] cookiegli_darwin_record / _search: Bayesian operational pattern persistence.
    • [08_TARGET_SYNC] cookiegli_sync: Automated multi-target rule synchronization.
  • Polymorphic Gateway Tool (cookiegli_full): A centralized dispatcher tool accepting {action, params} with support for action aliases, JSON-stringified argument auto-parsing, and safe fallback handling.
  • Embedded Agent Guide (mcp://cookiegli/guide): Implemented native MCP Resource protocol (resources/list and resources/read) delivering the complete Agent Decision Tree directly into the AI agent's system prompt upon connection.

2. Two-Tier Context Boost Engine (/boost)

  • Layer 1: Static Architectural Anchor (<600 tokens): Placed permanently at Token 0 of CLAUDE.md, AGENTS.md, and .cursorrules. Stripped of dynamic timestamps and in-file floating-point telemetry to maintain byte-identical prefixes, activating 90% Prompt Cache Read Discounts.
  • Layer 2: Dynamic Task Tail (<600 tokens): Synthesized on-demand via cookiegli boost "<task>". Combines FTS5 BM25+ symbol ranking, surgical code skeletonization, and blast radius targeted testing. Includes an automatic markdown code fence balance algorithm to guarantee valid markdown syntax under strict token budgets.

3. Hybrid Retrieval (SQLite FTS5 BM25+ & 3 SQLite Triggers)

  • Virtual table symbol_fts powered by SQLite FTS5 (unicode61 remove_diacritics 2).
  • 3 automated triggers (trig_symbol_cache_ai, trig_symbol_cache_ad, trig_symbol_cache_au) guarantee 100% two-way data integrity between the primary symbol cache and the full-text search index.
  • Industrial-grade Okapi BM25 ranking (<0.5ms) with automatic search token deduplication, 1-character token filtering, and graceful fallback to B-Tree search if FTS5 is absent.

4. 2026 Frontier Reasoning Calibration

  • Automatically calibrates effort=low/medium/high based on graph traversal blast_depth:
    • Depth 0–1 (Low): Constrains thinking token budgets for GPT-6 Astra, GPT-5.6 Sol, Claude Opus 5, and Gemini 3.7 Flash to eliminate unnecessary surcharge on output tokens ($15–$50/M).
    • Depth 2 (Medium): Balanced thinking budget for multi-caller changes.
    • Depth $\ge 3$ (High): Deep reasoning allocation for complex architectural refactors.

5. Token-0 Cache Invariant & Idempotent File Write Guard

  • Eliminated dynamic ISO timestamps from the first line of generated genomes (# PROJECT GENOME | id:<hash>).
  • Decoupled floating-point Bayesian ROI telemetry (ROI: ..., SR: ...) into .cookiegli/darwin_state.json.
  • Added idempotent write guards in adapters: compares existing content before writing, preserving file mtime and preventing unnecessary prefix cache invalidations.

⚡ Quick Start

CLI Usage

# Clone and enter repository
git clone https://github.com/LoveCookieee-java/CookieGli.git
cd CookieGli

# One-command project initialization (Layer 1 static anchor)
python cli/cookiegli.py boost --init

# On-demand task context synthesis (Layer 2 dynamic tail <600 tokens)
python cli/cookiegli.py boost "Fix cache miss on relative path in AstCache"

# Fast BM25 full-text symbol search
python cli/cookiegli.py search "AstCache"

Update 11:27 9/4/2026

Choose a tag to compare

@LoveCookieee-java LoveCookieee-java released this 04 Sep 04:28

Nội dung bản cập nhật

Bản phát hành này bổ sung 4 trụ cột công nghệ cốt lõi phục vụ nén cấu trúc mã nguồn, lập chỉ mục biểu tượng hiệu năng cao, phân tích lan truyền thay đổi và tự động hóa chưng cất lỗi:

Các tính năng chính

  • Semantic Code Skeletonizer & Focus-Symbol Mode (src/cookiegli_core/skeletonizer.py):

    • Gấp gọn thân hàm theo khoảng dòng thực tế giữ nguyên cấu trúc lớp, chữ ký hàm, decorators và type annotations.
    • Chế độ Focus-Symbol giữ nguyên 100% thân hàm cần chỉnh sửa và rút gọn các thành phần còn lại.
    • Hỗ trợ Python AST và đa ngôn ngữ (TypeScript, Go, Rust, Java, C#, C++).
    • Cắt giảm từ 75% đến 92% lượng token tiêu thụ khi đọc mã nguồn lớn.
  • Chỉ mục biểu tượng B-Tree trong SQLite WAL (src/cookiegli_core/cache_db.py):

    • Lưu trữ vị trí định nghĩa, chữ ký và tài liệu với chỉ mục B-Tree NOCASE trên simple_name và name.
    • Độ trễ tra cứu đạt trung bình 0,0645 ms/truy vấn, thông lượng hơn 15.400 truy vấn/giây.
    • Tự động nhận diện thư mục nguồn (src/, lib/, packages/) để phân loại import chính xác.
  • Git Blast Radius & Khoanh vùng kiểm thử (src/cookiegli_core/blast_radius.py):

    • Đảo ngược đồ thị phụ thuộc để xác định các thành phần bị ảnh hưởng trực tiếp và gián tiếp khi có git diff.
    • Đề xuất đúng bộ test suite tối thiểu cần chạy, giảm 80% log kiểm thử thừa vào ngữ cảnh.
  • Chưng cất lỗi tự động & Darwin Memory (src/cookiegli_core/distiller.py):

    • Bóc tách traceback 3 tầng từ Python (unittest, pytest), Node/Jest, Go và Rust.
    • Nhận diện mẫu sửa lỗi từ git diff để tổng hợp thành bài học kinh nghiệm có tính điểm Bayesian và tự động khôi phục quy tắc cũ nếu lỗi tái diễn.
  • Mở rộng CLI & Giao thức MCP Server:

    • Bổ sung các lệnh: cookiegli skeleton, cookiegli symbol, cookiegli blast, cookiegli distill.
    • Cung cấp 4 công cụ MCP mới: cookiegli_get_skeleton, cookiegli_find_symbols, cookiegli_blast_radius, cookiegli_distill_lesson.

Số liệu kiểm định thực nghiệm

  • Kiểm thử tự động: 118/118 bài test vượt qua thành công (100% PASS), 0 lỗi hồi quy.
  • Nén ngữ cảnh thực tế: Giảm từ 37.861 tokens xuống 3.418 tokens (giảm 91,0% toàn tệp và 82,3% ở chế độ Focus).
  • Độ trễ tra cứu: 0,0645 ms/lượt tra cứu B-Tree.
  • An toàn tài nguyên: Quản lý vòng đời tài nguyên qua context manager, giải phóng hoàn toàn file handles trên Windows.
  • Thư viện phụ thuộc: 0 phụ thuộc ngoài (thuần Python stdlib từ Python 3.9 trở lên).

What's Changed

This release introduces four core capabilities focused on semantic context compression, sub-millisecond symbol indexing, dependency-aware test targeting, and automated error distillation.

Core Capabilities

  • Semantic Code Skeletonizer & Focus-Symbol Mode (src/cookiegli_core/skeletonizer.py)

    • AST-driven code folding preserving module docstrings, class hierarchies, method signatures, decorators, dataclass fields, and type annotations while collapsing function bodies to line ranges (... [L{start}-L{end}]).
    • Focus-Symbol Mode: preserves 100% verbatim implementation of targeted symbols while compacting surrounding code.
    • 4-tier token budget degradation ensuring strict compliance with token limits.
    • Multi-language support: Python, TypeScript, JavaScript, Go, Rust, Java, C#, C++.
  • Inverted B-Tree Symbol Index (src/cookiegli_core/cache_db.py, src/cookiegli_core/ast_scanner.py)

    • High-performance SQLite WAL table symbol_cache with case-insensitive B-Tree indexes on simple_name and name.
    • Sub-millisecond lookup latency (average 0.0645 ms per query, 15,400+ QPS).
    • Multi-source root resolution (src/, lib/, app/, packages/) for precise internal vs. external dependency classification.
  • Git Blast Radius & Surgical Test Targeting (src/cookiegli_core/blast_radius.py)

    • Forward-to-ingress dependency graph inversion to determine direct and transitive consumers of modified files.
    • Automatic change detection via git status --porcelain with fallback to SQLite cache mtime comparison.
    • Surgical test suite targeting: maps modified modules directly to relevant test files, reducing test log noise by ~80%.
  • Autonomous Error & Traceback Distiller (src/cookiegli_core/distiller.py)

    • 3-tier traceback parser supporting Python (unittest, pytest, Traceback), Node.js/Jest, Go, and Rust.
    • Automated diff pattern recognition (null guards, fallbacks, path normalization, boundary checks) to synthesize actionable Darwin rules with Laplace Bayesian priors.
    • Deduplication and automatic resurrection of pruned rules upon bug recurrence.
  • Expanded CLI & Model Context Protocol (MCP) Server

    • Added CLI subcommands: skeleton, symbol, blast, distill.
    • Added MCP tools: cookiegli_get_skeleton, cookiegli_find_symbols, cookiegli_blast_radius, cookiegli_distill_lesson.

Verification & Empirical Benchmarks

  • Test Suite: 118/118 automated tests passing (100% PASS) with zero regressions in 1.14s.
  • Token Reduction: 91.0% aggregate token reduction on core codebase (37,861 raw tokens down to 3,418 skeleton tokens; 82.3% in focus-symbol mode).
  • Symbol Seek Speed: 1,000 queries in 64.54 ms (average 0.0645 ms/lookup).
  • Resource Safety: Comprehensive context manager adoption across all engines ensuring atomic release of SQLite WAL handles and zero Windows file lock contention (WinError 32).
  • Dependencies: 0 external packages (100% Python standard library).

Commits

  • 33ff14a: feat: core capabilities upgrade - symbol index, skeletonizer, blast radius, error distiller
  • 6a675a6: docs: update README with new core capabilities and grounded developer tone