All notable changes to CortexAST are documented here.
Format follows Keep a Changelog.
Versioning follows Semantic Versioning.
- Two-Phase Commit with in-memory Virtual Dry-Run before any disk write.
- Bottom-up byte sorting: multiple edits are sorted by
start_bytedescending before application, guaranteeing earlier replacements never corrupt the byte offsets of later target nodes. - Write Permission Guard (
check_write_permission): verifies bothmetadata().readonly()and a liveOpenOptions::writebefore touching the file; catches Unix ACL denials missed by permission bits. Error message names the expected user (zelda) and thechmodcommand to fix it. - Tree-sitter Validator: after patching the in-memory buffer, parse with the shared
RwLock<LanguageConfig>/WasmStore. AnyERRORorMISSINGnode triggers the Auto-Healer instead of a disk write. collect_ts_errors: walks the full AST cursor and produces a human-readable numbered list of error positions (row:col + snippet) to supply as context to the local LLM.
- Bridges to a local LLM endpoint (default:
http://127.0.0.1:1234/v1/chat/completions; override viallm_url). - 10-second hard timeout via
ureq::AgentBuilder.timeout()— prevents MCP Timebomb. - Context-aware prompt: injects the numbered Tree-sitter error list so small models (e.g.
lfm2-2.6b) know exactly which line/token to fix. sanitize_llm_code: strips residual```markdown fences and language tags from LLM responses before passing repaired code to the second Tree-sitter validation pass.- Strict system prompt:
"Output ONLY raw code -- no markdown, no backticks, no explanations."
- Surgically modify a single key in
.json,.yaml, or.tomlusing dot-path notation (e.g.dependencies.express). - Supports
setanddeleteactions without rewriting the whole file.
- Replace any
## Sectionin a Markdown file, identified by heading level + heading text. - Preserves all surrounding sections; configurable
heading_level(default:##).
- Spawn shell commands as background threads. Returns
job_idimmediately (no MCP timeout). - Poll via
cortex_check_job { "job_id": "..." }for status, exit code, stdout, and stderr. - Background threads auto-detect timeout via
Instant::elapsed().
Symbolstruct gainsstart_byteandend_bytefields — exposed fromrun_queryviadef_nodeso callers gain byte-accurate ranges for patching.driver_for_pathmadepubto allowact::editorto reuse the shared Wasm engine.
editor::tests::bottom_up_sort_preserves_byte_offsets— proves bottom-up sorting correctness.editor::tests::top_down_order_corrupts_offsets— demonstrates the failure mode prevented.editor::tests::ts_error_collection_on_broken_rust— validates AST error walker output.editor::tests::permission_guard_catches_readonly— verifieschmod 444detection.editor::tests::permission_guard_passes_for_writable— happy path.auto_healer::tests::sanitize_*— 5 sanitizer tests (fence stripping, multi-block, passthrough, in-code ``` preservation, numbered error format).
statusaction: reports active and downloadable languages.addaction: downloads.wasm+[lang]_prune.scmfiles from CDN.- Hot-reload: dynamically instantiates downloaded parsers into
RwLock<LanguageConfig>without server restart. - Retroactive rescan: calls
CodebaseIndex::invalidate_extensionsto purge stale vector cache entries for newly added language extensions. WasmDrivergainsmake_parser()method to correctly attachWasmStoreper parser instance.
LanguageConfigrefactored toRwLock<LanguageConfig>for concurrent read / exclusive write.- Startup now scans
~/.cortex-works/grammars/to load previously downloaded Wasm parsers.
- Modular backend: languages loaded as WebAssembly grammars for small binary size.
grammar_manager.rs: CDN fetcher for.wasmand.scmgrammar files.- Universal regex fallback for unsupported extensions.
- Static languages (Rust, TypeScript, Python) always available.
WasmDrivertrait implementation for dynamic language loading.
Initial implementation of:
cortex_code_explorer(map_overview + deep_slice)cortex_symbol_analyzer(read_source, find_usages, blast_radius, propagation_checklist)cortex_chronos(AST snapshot save/compare/rollback)cortex_memory_retriever+cortex_remember(global memory journal)vector_store.rs(model2vec embeddings, cosine search, cache invalidation)cortex_diagnostics(compiler error mapping)cortex_list_network(cross-project network map)