Skip to content

Conversation

@JegernOUTT
Copy link
Member

This fixes a bug where cat() would return stale content after file modifications because the IDE buffer cache (memory_document_map) was not being invalidated when tools wrote to disk.

Changes:

  • auxiliary.rs: Invalidate cache after fs::write() in write_file() (covers create_textdoc, update_textdoc, update_textdoc_by_lines, update_textdoc_regex)
  • tool_rm.rs: Invalidate cache after file/directory deletion (with prefix removal for directories)
  • tool_mv.rs: Invalidate cache for source and destination paths after rename, overwrite, and cross-device copy operations

Root cause: memory_document_map is an LSP cache for files open in IDE. Tools were writing to disk but not invalidating this cache, causing subsequent cat() calls to return stale IDE buffer content instead of fresh disk content.

This fixes a bug where cat() would return stale content after file
modifications because the IDE buffer cache (memory_document_map) was
not being invalidated when tools wrote to disk.

Changes:
- auxiliary.rs: Invalidate cache after fs::write() in write_file()
  (covers create_textdoc, update_textdoc, update_textdoc_by_lines,
  update_textdoc_regex)
- tool_rm.rs: Invalidate cache after file/directory deletion
  (with prefix removal for directories)
- tool_mv.rs: Invalidate cache for source and destination paths
  after rename, overwrite, and cross-device copy operations

Root cause: memory_document_map is an LSP cache for files open in IDE.
Tools were writing to disk but not invalidating this cache, causing
subsequent cat() calls to return stale IDE buffer content instead of
fresh disk content.
- Replace cloud GraphQL knowledge backend with local markdown files
- Store knowledge in .refact_knowledge/ folder with YAML frontmatter
- Add markdown-aware file splitter for VecDB indexing
- Add create_agents_md tool to generate project guide
- Add filenames parameter to create_knowledge tool
- Save trajectories to .refact_knowledge/trajectories/
- Update prompts with knowledge management instructions
- Remove cloud module and related code completely
- Allowlist .refact_knowledge/ folder for indexing despite being hidden

New tools:
- knowledge(search_key) - search local knowledge
- create_knowledge(tags, filenames, content) - create knowledge entry
- create_agents_md() - generate AGENTS.md from all knowledge

Files changed:
- New: src/vecdb/vdb_markdown_splitter.rs
- New: src/tools/tool_create_agents_md.rs
- Rewritten: src/memories.rs
- Deleted: src/cloud/ directory
- Updated: prompts, tools, file filtering
… commits

Replace the existing commit message prompts with comprehensive guidance
following the Conventional Commits specification:

- Add all standard commit types (feat, fix, refactor, perf, docs, etc.)
- Enforce imperative mood and 50/72 character rules
- Support scopes for better organization
- Add breaking change detection with ! notation and BREAKING CHANGE footer
- Include issue reference handling (Fixes #, Closes #, Refs #)
- Provide clear examples for each type of commit
- Add guidelines for synthesizing user intent with diff analysis
- Add petgraph-based knowledge graph (kg_structs, kg_builder, kg_query)
- Extended frontmatter: UUID, kind, status, links, review_after, superseded_by
- Subchat-powered create_knowledge: auto-enriches metadata, deprecates outdated docs
- Graph-enhanced search: expands results via shared tags/files/entities
- Weekly background cleanup: auto-archives old trajectories and deprecated docs
- Entity extraction from backticked identifiers
- Staleness detection: orphan refs, past review, deprecated ready to archive

New files:
- src/knowledge_graph/mod.rs
- src/knowledge_graph/kg_structs.rs
- src/knowledge_graph/kg_builder.rs
- src/knowledge_graph/kg_query.rs
- src/knowledge_graph/kg_staleness.rs
- src/knowledge_graph/kg_subchat.rs
- src/knowledge_graph/kg_cleanup.rs

Modified:
- Cargo.toml: added petgraph
- memories.rs: new frontmatter format, deprecate/archive functions
- tool_create_knowledge.rs: 2-phase subchat pipeline
- tool_knowledge.rs: graph-enhanced search
- vdb_markdown_splitter.rs: uses KnowledgeFrontmatter
- background_tasks.rs: added cleanup task
- New HTTP endpoint GET /v1/knowledge-graph returns JSON:
  - nodes: [{id, node_type, label}] for docs, tags, files, entities
  - edges: [{source, target, edge_type}] for all relationships
  - stats: doc_count, tag_count, file_count, entity_count, edge_count, etc.

- Enhanced stats logging when knowledge graph is built:
  - Total docs (active, deprecated, trajectories, code)
  - Tags, files, entities counts
  - Graph edge count

New file: src/http/routers/v1/knowledge_graph.rs
- Add EnrichmentParams struct and memories_add_enriched() to memories.rs
- Refactor tool_create_knowledge.rs to use memories_add_enriched (254→93 lines)
- Add enriched memory creation to tool_deep_research.rs
- Add enriched memory creation to tool_strategic_planning.rs
- All knowledge entries now get AI-enriched metadata and auto-deprecation
@JegernOUTT JegernOUTT merged commit 7684d28 into main Dec 17, 2025
7 checks passed
@JegernOUTT JegernOUTT deleted the debug_fixes_pt_42 branch December 17, 2025 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants