Repository navigation
What's New in Cortex v2.0
Cortex v2.0 is a major architectural milestone that elevates Cortex from a structural symbol scanner into a full Deterministic Repository Intelligence Engine & Universal Agent Context Runtime.
1. Sub-Millisecond Search Engine (Index Format 4)
- 300x Faster Search Latency: In-memory indexed exact and prefix lookups drop search latency on 10,000-file repositories from 26.56ms down to 0.076ms (Apple M2) with under 3.3KB memory allocated per query.
- Atomic Transactions & Rollback: Index updates publish within atomic SQLite transactions with generation ID tracking and automatic rollback on failure.
- Lexical Identifier Splitting: Automatically decomposes camelCase and snake_case identifiers (
RefreshAccessToken->refresh access token) for bounded query fallbacks without vector models. - Implementation Ranking: Real source implementations rank strictly above synthetic re-exports and barrel files.
2. Agent Context Runtime (ctx context)
- Fast Deterministic Context Packet: Generates a rich, source-hash-verified context packet bounded by a 200ms deadline and compact 3,500-byte budget designed specifically for pre-prompt agent hook injection.
- Snapshot Verifications: Validates source hashes of selected evidence on the fly and reports timeouts, unverified evidence, and generation changes explicitly.
3. Native Agent Hook Integrations (ctx integrations)
- First-Class Agent Adapters: Built-in hook management commands (
ctx integrations install,status,remove) for:- Claude Code (
.claude/) - Cursor (
.cursor/) - Codex (
.codex/) - Antigravity
- Generic AI Coding Agents
- Claude Code (
- Automatically injects high-density codebase context directly into agent sessions at prompt time without manual user intervention.
4. API Contract Intelligence & Working-Tree Diff (ctx contracts, ctx api-diff)
- Working-Tree API Diff (
ctx api-diff): Statically audits API contracts touched by current working-tree changes before commits to catch breaking endpoint changes early. - Full-Stack Contract Auditing (
ctx contracts [route]): Reconciles frontend API calls (apiClient,fetch,axios) with backend routes, request/response payload schemas, duplicate route ambiguity, and supported SQL database constraints.
5. Static Cross-Layer Data Lineage (ctx lineage)
- Field-Level Data Flow: Traces static data flow across UI components, API payloads, controllers, and database models.
- Evidence Confidence Ratings: Explicitly classifies data relationships into
CONFIRMED,POTENTIAL, andUNKNOWN, ensuring agents never hallucinate unverified data paths.
6. Static Permission Intelligence & Role Simulation (ctx permissions)
- Authorization Auditing: Statically traces frontend route guards, backend middleware checks, and permission matrices.
- Role Simulation (
--role): Simulate how specific roles traverse permissions and identify unprotected sensitive endpoints.
7. Native Go AST Engine & Monorepo Local Module Resolution
- Native Go AST Verification (
syntax_verified): Uses Go's native standard library AST parser with compiler-grade verification tags, replacing heuristic extractors for Go code. - Monorepo Local Module Resolution: Full support for
tsconfig.json(baseUrl,paths), JSONC config inheritance, relativeextends, and declared npm/pnpm workspace package exports.
8. Deterministic Precision Regression Gate (ctx gate)
- Built-in Quality Verification: Runs Cortex's precision regression suites, verifying 13-hop dependency cycles, full vs. incremental build equivalence, and offline retrieval accuracy without network access.
9. Evidence-Backed Workflow Recipes (ctx workflows, ctx workflow)
- Automatically suggests deterministic, multi-step engineering workflow recipes based on current repository state, target symbols, and feature domains.
10. Full Rebuild & Format 4 Auto-Migration (ctx build --full)
- Automatically detects schema and index format upgrades and performs a clean, atomic index rebuild.
Upgrading to v2.0
- Rebuild local repository index to upgrade to Index Format 4:
ctx build --full