π§ Cog v1.0.0 β Context on Git
We are excited to announce the official v1.0.0 release of Cog!
Cog is a lightweight, zero-dependency Git utility designed to extract, prune, and format complex hardware (FPGA/ASIC), software (Python/C++), and Jupyter Notebook repositories into compact, token-optimized context documents for Large Language Models (GPT-4, Claude, Gemini).
π What's New in v1.0.0
π― 1. Modular Domain Slicers (./Cog/Ctx <mode>)
Generate ultra-compact context slices for specific engineering tasks:
./Cog/Ctx bd/ip: Vivado Block Designs (.bd) + memory address maps (SEG_*)../Cog/Ctx rtl/hw: VHDL, Verilog, and SystemVerilog custom RTL cores../Cog/Ctx sw/py: Python drivers, C/C++ headers, and host libraries../Cog/Ctx nb/ipynb: Distilled Jupyter Notebook tutorials../Cog/Ctx xdc/pins: Compacted physical constraints and clock timing definitions../Cog/Ctx tcl/build: Hog & Vivado build automation scripts../Cog/Ctx docs: Markdown docs,README.md, andLICENSE../Cog/Ctx hld:bd+rtl+sw(Hardware-Software Co-Design verification)../Cog/Ctx app:sw+nb(Application layer & tutorial debugging).
π 2. AI Code Review & Git Diff Slicers
- Pre-Commit Diff Review (
./Cog/Ctx diff): Ingests working tree diff patches paired with full, domain-compacted representations of touched files. - Pull Request Reviewer (
./Cog/Ctx pr [base_branch]): Calculates merge-base deltas against base branches (main/master) for automated AI PR reviews and changelog drafting. - Full & Compact Git Topologies (
./Cog/Ctx gitvs./Cog/Ctx git:full): 15-commit capped graph or full multi-branch commit histories.
π 3. Expanded Domain Compactor Engines
- Constraint Optimizer (
core/xdc_clean.py): Unifies fragmentedPACKAGE_PINandIOSTANDARDlines into native Vivado-dictsyntax (~60% token savings) and purges template pin noise. - TCL Build Cleaner (
core/tcl_clean.py): Purges Vivado tool session logs, process IDs, and disclaimer boilerplate. - C/C++ Driver Slicer (
core/c_slicer.py): Strips multi-line license headers while preserving 100% of memory-mapped register#defineoffsets, bitmasks, and HLS pragmas. - Hardware Safety Guard in Notebook Distiller (
core/ipynb_clean.py): Never truncates safety-critical warnings (voltages, pin limits, clock speeds).
π 4. Scaffolding & Diagnostics Engine
./Cog/Ctx init: Automated project onboarding scanning and domain-organizedcontext/conf/cog.confgeneration../Cog/Ctx update: Non-destructive sync detecting newly added or stale repository files../Cog/Ctx check/doctor: Pre-flight integrity diagnostics and projected token footprint audit.
β‘ 5. Developer Ergonomics & Windows Support
- Zero External Dependencies: Built entirely with POSIX Bash, Windows Batch/PowerShell, and the Python standard library.
- Native Windows Entry Points: Added
Ctx.cmdandCtx.ps1for seamless Command Prompt and PowerShell execution. - Clipboard & Stdout: Direct clipboard injection (
-c/--clip) and Unix stdout streaming (-s/--stdout). - Calibrated Token Meter (
3.62chars/token): <1% error margin against Claude/GPT-4/Gemini subword tokenizers with model context window compatibility badges (Universal, Standard, Extended).
π§ͺ Automated Test Suite & CI
- 12 automated unit and regression tests running in <10ms (
python -m unittest discover -s tests). - Full multi-platform CI matrix on GitHub Actions covering Ubuntu, Windows, and macOS across Python 3.8, 3.9, 3.10, 3.11, and 3.12.
Full Changelog: https://github.com/SiririComun/Cog/commits/v1.0.0