ZeroScan (.agent/) — Project Memory V2.1.3
# Instant Installation via pip
pip install zeroscan
# Instant Bootstrap in any repository
zeroscan-bootstrap --name "my-awesome-project" --mission "Build scalable AI systems"
🇬🇧 English | 🇻🇳 Tiếng Việt | 📘 Usage Guide | 📕 Hướng dẫn sử dụng | 🚀 Deep-Dive Article
The Universal, Model-Agnostic Context & Memory Protocol for ANY AI Coding Agent
Native support for Claude 3.5, GPT-4o, Gemini 1.5, DeepSeek-V3, Qwen 2.5, Llama 3.3, Cursor, Windsurf, Trae, Codex, and Hermes.
🌟 Overview
Zero-Scan Project Memory V2.1.3 is an open standard designed to eliminate context bloat, hallucination, and directory-crawling overhead in AI-driven software development.
Traditional coding agents waste tens of thousands of tokens scanning entire codebases upon startup. Project Memory replaces scanning with a lightweight, Git-bound Level 0 Boot Anchor (BOOT.md < 1 KB) and an architectural GPS Map (PROJECT_MAP.json), ensuring agents boot instantly with <= 10 KB of total context.
┌─────────────────────────────────────────────────────────────┐
│ ANY LLM / AI AGENT │
│ (Claude 3.5 · GPT-4o · Gemini 1.5 · DeepSeek · Qwen · Llama)│
└──────────────────────────────┬──────────────────────────────┘
│
┌───────────────┴───────────────┐
▼ ▼
MCP Protocol Server CLI Engine
(Cursor / Windsurf / Trae) (Terminal / CI/CD)
│ │
└───────────────┬───────────────┘
▼
┌─────────────────────────────────┐
│ Zero-Scan Context Core │
│ • Level 0 Boot Anchor (BOOT) │
│ • GPS Module Routing (MAP) │
│ • Concurrency Locking (flock) │
│ • Resilient JSON (.bak) │
└────────────────┬────────────────┘
▼
TARGET GIT REPOSITORY
💡 Why Zero-Scan Outperforms Full Scans
1. Zero-Scan Startup (Level 0 Boot Anchor)
Traditional agents ingest entire repositories on every session turn, easily burning 30,000–200,000+ tokens before writing a single line of code. With Zero-Scan, agents read only BOOT.md (~1 KB / ~500 tokens), instantly understanding the architecture and current task without touching unrelated files.
2. GPS Navigation via PROJECT_MAP.json
Instead of running expensive recursive regex greps across the repository, agents query PROJECT_MAP.json to navigate directly to the source files and test suites of the active domain.
3. Architectural Decision Locking (ADR Invariants)
Critical architectural decisions are recorded in DECISIONS.md under [LOCKED] status. Agents are strictly prohibited from modifying locked decisions without explicit approval.
4. Immutable Evidence Gate & Git SHA Binding
A task is considered DONE only when validated with real test execution evidence (pytest, unittest) and bound to a verifiable Git Commit SHA.
🛡️ V2.1.3 Enterprise-Grade Engineering Highlights
- ⚡ Atomic State-to-Boot Auto-Sync: Updating
PROJECT_STATE.jsonautomatically re-rendersBOOT.mdin real-time, preventing state drift. - 🔄 Resilient JSON Loader &
.bakFallback: Automatic recovery from backup snapshots when state files are empty or corrupted. - 🔒 Cross-Platform Concurrency Locking: Multi-agent concurrent write protection using
fcntl.flockon Unix and atomic spinlocks on Windows with strict timeout exceptions. - 🛡️ Atomic Bootstrap Staging & Rollback: Scaffolding takes place in a temporary staging directory first, ensuring zero data loss if network or generation fails.
- 📦 Package Data Bundling: Templates and schemas are packaged directly into the PyPI wheel for 100% offline usage.
- 📦 Sized Ledger Archiving: Automatically archives completed tasks to
.agent/archive/when ledger exceeds 50 entries, keeping the active context $< 5\text{ KB}$.
📁 The .agent/ Directory Structure
.agent/
├── BOOT.md # [MANDATORY FIRST READ] Level 0 session boot anchor (< 1 KB)
├── PROJECT_STATE.json # Repo state machine (bound to code_commit and memory_commit)
├── PROJECT_MAP.json # Codebase GPS map: Domain -> File Paths -> Test Suites
├── DECISIONS.md # Active Architectural Decision Records (ADRs) marked [LOCKED]
├── NEXT_TASK.md # Detailed specification of active task, domains & acceptance criteria
├── TASK_LEDGER.jsonl # Append-only immutable task ledger
├── MEMORY_PROTOCOL.md # 10 mandatory agent behavioral rules
├── memory.py # Core CLI engine for validation, metrics, and state synchronization
└── archive/ # Automated archive directory for completed tasks (> 50 items)
⚠️ 8 Common Pitfalls & Recovery Protocols
| # | Pitfall / Anti-Pattern | Root Cause | Real-World Impact | Zero-Scan Defense Protocol |
|---|---|---|---|---|
| 1 | The Stale State Trap | Agent completes work but forgets to update BOOT.md / PROJECT_STATE.json. |
Next session restarts from stale state, causing duplicate work. | Session Exit Gate: Enforce zeroscan checkpoint before turn completion. |
| 2 | Decisions Bloat Trap | Accumulating dozens of trivial ADRs in DECISIONS.md $> 20\text{ KB}$. |
Blows past 10 KB budget, inflating KV-cache VRAM. | Compaction Protocol: Stabilized decisions consolidated into axioms; history archived. |
| 3 | Concurrent State Collision | Multiple subagents writing to PROJECT_STATE.json simultaneously. |
Lost updates or corrupted JSON writes. | Advisory File Lock & Atomic Writes: file_lock context manager + .tmp.<pid> + fsync + os.replace. |
| 4 | Accidental Full-Scan Drift | Agent invokes unrestricted grep -r across node_modules / venv. |
Floods context window with 100k+ tokens, degrading model attention. | Strict GPS Routing: Agents query PROJECT_MAP.json to open active domain files only. |
| 5 | Phantom Commit Binding | Agent marks task DONE without committing code to git first. |
State claims task verified, but Git HEAD is uncommitted. | Git Verification Guard: zeroscan validate checks git rev-parse HEAD against recorded hashes. |
| 6 | Git Branch Drift | Switching git branches while .agent/ tracks a different branch. |
Agent acts on objectives from another feature branch. | Branch-Aware Ledger: Tasks tagged with branch names; zeroscan sync aligns state. |
| 7 | Greedy MCP Context Bleed | MCP clients fetch full history (50+ tasks) into system prompts. | Token waste and prompt dilution. | Selective View Filters: zeroscan_read_state defaults to compact mode ($\le 1\text{ KB}$, 3 active tasks). |
| 8 | Git Rebase Deadlock | Strict commit verification aborts git rebase or detached HEAD CI builds. | CI/CD build failures during automated squash/merge. | Non-Blocking Rebase Bypass: Validator detects .git/rebase-merge environments gracefully. |
🚀 Quickstart & CLI Operations
# 1. Install via pip
pip install zeroscan
# 2. Bootstrap any repository
zeroscan-bootstrap --name "my-project" --mission "Build Agent Fleet" --domains "core,api,auth,db"
# 3. Check status & validate budget compliance
zeroscan status
zeroscan validate
# 4. Record task completion with evidence & update next task
zeroscan checkpoint --task-id "TASK-001" --summary "Implement auth module" --evidence "pytest 15/15 pass" --next-task-id "TASK-002" --next-task-desc "Build billing API"
# 5. Record an Architectural Decision Record (ADR)
zeroscan add-decision --id "ADR-002" --title "Use PostgreSQL for DB" --decision "Adopt Postgres 16 for ACID compliance"
# 6. Start MCP Server for Cursor / Claude Desktop / Windsurf
zeroscan-mcp
📜 License & Copyright
- Author: Chau Vu / CPF-FAMILY (
@chauvuusvn) - License: MIT License (100% Open Source)
- PyPI Release: https://pypi.org/project/zeroscan/
Release files for zeroscan 2.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zeroscan-2.1.3.tar.gz | 32.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zeroscan-2.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 61.5 kB
Release files / zeroscan-2.1.3.tar.gz
| Download URL | zeroscan-2.1.3.tar.gz |
|---|---|
| Size | 32.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8716a17660d77bb03e8b8f492b6e5929b3f06934a80b169fed4117a90a03e1dc
|
|
BLAKE2b-256 checksum How to use checksums |
d636f0e676fb051d966fd8a35d919fe42f94c3901cc5aeee4dd377019ed18861
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Release files / zeroscan-2.1.3-py3-none-any.whl
| Download URL | zeroscan-2.1.3-py3-none-any.whl |
|---|---|
| Size | 29.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cd7268b51ce960c33aed9270fa095b0f68b3910096fec03ca2fc919585ab507e
|
|
BLAKE2b-256 checksum How to use checksums |
6a8db1e09150deab0c4cb4fe3f2e7f68755ff8990333ea9623d89d75de405c21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|