Files
zesdex/docs/CODEMAPS/data.md
T
asepharyana 1d50b94eec feat: update README and documentation for new tools and features
- Updated README.md to reflect the addition of 3 new built-in tools, bringing the total to 37.
- Revised architecture documentation to indicate the increase in tool count.
- Enhanced backend documentation with updated line counts for various modules.
- Modified data documentation to change edit log format from JSON to JSONL.
- Updated dependencies documentation to reflect version upgrades for several crates.
- Improved prompts for auto-reviewer, division implementer, planner, tester, and quality reviewer to enforce stricter coding standards regarding linter bypasses.
- Refactored code in various modules to improve clarity and performance, including updates to error handling and tool execution logic.
- Added comprehensive tests for IPC frame serialization and deserialization.
2026-07-13 14:39:39 +07:00

2.4 KiB

Data / Persistence Layer

Storage Overview

Base directory: ~/.config/zesdex/ (via dirs::data_dir())

~/.config/zesdex/
├── settings.json        # User preferences (provider, model, tokens)
├── app_config.json      # Provider definitions (API base, auth, models)
├── agents/              # Global agent definitions
│   └── *.json
├── memory/              # Persistent lesson/reference store
│   └── *.md             # Markdown with YAML frontmatter
├── sessions/            # Per-session data
│   └── <session-uuid>/
│       ├── edits.jsonl          # Edit history (JSONL, append-only)
│       ├── msglog.db         # SQLite message log
│       ├── transcript.json   # Chat transcript
│       ├── session.json      # Session metadata
│       ├── agents.json       # Session-local agent defs
│       └── snapshot.dat      # State snapshot (daemon mode)
├── run/                 # Unix domain sockets
│   └── zesdex-*.sock
└── store.json           # Legacy session index

Key Files

File Lines Role
src/model/store.rs ~50 File-system storage (ensure_dirs, base_dir resolution)
src/model/settings.rs ~60 Settings — load/save JSON, API keys map
src/model/app_config.rs ~80 AppConfig — provider definitions, model roles, auth
src/model/memory.rs 440 Memory CRUD — markdown files with frontmatter
src/model/editlog.rs 161 Edit log — append-only JSONL (not JSON array)
src/model/msglog/ 4 files SQLite-backed message log (schema, query, blobs)
src/model/session.rs ~60 Session CRUD, listing, archival
src/model/session_lock.rs ~50 flock-based session lock
src/model/agent_def/ 3 files Agent definitions (builtin, global, session-local)

Key Patterns

  • No ORM — raw JSON files + SQLite via rusqlite
  • settings.json — loaded at startup, saved on quit / mode switches
  • Memory format — Markdown files with YAML frontmatter (---\nname: ...\ndescription: ...\n---\ncontent)
  • Edit log — append-only, stores (file, old, new, timestamp, tool)
  • Session locking — flock-based, prevents concurrent access to same session dir
  • Message log — SQLite with attached blobs for tool arguments/outputs