Skip to content

Commit 7af1f5e

Browse files
queeliusclaude
andcommitted
docs: update CLAUDE.md for v1.3.0
- Update test count to 1120+ - Document chat.js features: render_chart tool, DOM persistence, sliding window, pair-aware trimming - Document new SPA sections: visit_prep, print_summary - Note _CLINICAL_TABLES is derived from _UNIQUE_KEYS - Fix MCP tool count: 24 (get_timeline removed) - Add _NON_CLINICAL_TABLES to new-table checklist Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e32daa2 commit 7af1f5e

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

CLAUDE.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pip install -e ".[dev,mcp]"
1818
## Commands
1919

2020
```bash
21-
# Run all tests (1000+ tests, pytest)
21+
# Run all tests (1120+ tests, pytest)
2222
python -m pytest tests/
2323

2424
# Run a single test file
@@ -134,7 +134,7 @@ SQLite with WAL mode and foreign keys enabled. 17 clinical tables + `load_log` a
134134

135135
### MCP Server (mcp/server.py)
136136

137-
FastMCP server with `CHARTFOLD_DB` env var for database path. Design principle: the LLM writes its own SQL for all reads via `run_sql` + `get_schema`. Write operations (notes, analyses) go through dedicated tools with controlled parameters.
137+
FastMCP server with `CHARTFOLD_DB` env var for database path. 24 tools. Design principle: the LLM writes its own SQL for all reads via `run_sql` + `get_schema`. Write operations (notes, analyses) go through dedicated tools with controlled parameters.
138138

139139
### Data Access Modules (analysis/)
140140

@@ -151,9 +151,10 @@ Parameterized query helpers that surface structured views of the data for LLMs (
151151
### Export Modules
152152

153153
- `spa/export.py` — Self-contained HTML SPA with embedded SQLite database via sql.js (WebAssembly). All data stays client-side with in-browser SQL queries. Supports `--embed-images`, `--config`, `--ai-chat`, and `--proxy-url`.
154-
- `spa/chat_prompt.py` — System prompt generation for AI chat (schema + stats + current analyses).
155-
- `spa/js/chat.js` — Client-side agent loop + chat UI (conditionally included with `--ai-chat`).
154+
- `spa/chat_prompt.py` — System prompt generation for AI chat (schema + stats + current analyses). `_CLINICAL_TABLES` derived from `db.py`'s `_UNIQUE_KEYS` (not hardcoded).
155+
- `spa/js/chat.js` — Client-side agent loop + chat UI (conditionally included with `--ai-chat`). Two tools: `run_sql` (SQL queries) and `render_chart` (inline line charts via `ChartRenderer`). Conversation persists across SPA navigation via DOM detach/reattach (`_container`). Sliding window (`MAX_MESSAGES=40`) with pair-aware trimming.
156156
- `spa/css/chat.css` — Chat panel styling (conditionally included with `--ai-chat`).
157+
- `spa/js/sections.js` — All SPA sections including `visit_prep` (auto-detected date, 9 clinical categories, parameterized queries) and `print_summary` (one-page printable view with demographics, conditions, meds, labs with trend arrows, encounters).
157158
- `export_arkiv.py` — Arkiv universal record format (JSONL + README.md + schema.yaml). Primary backup/restore format with full round-trip support. Source assets exported to `media/` or inline base64 via `--embed`.
158159
- `import_arkiv.py` — Arkiv import with validation, FK remapping, tag unfolding, and source asset restoration.
159160

@@ -185,4 +186,4 @@ TOML config (`chartfold.toml`) for personalized settings. Key tests to chart, da
185186
- `mhtml_test_result.py`: The function `test_result_to_unified` starts with `test_` — pytest tries to collect it as a test. Import it with `from ... import test_result_to_unified as adapt_test_result` in tests.
186187
- `source_assets` are inserted via raw SQL in tests (not through the adapter pipeline).
187188
- `_UNIQUE_KEYS` in `db.py` must match the UNIQUE constraints declared in `schema.sql`.
188-
- When adding a new table: update `_TABLE_MAP`, `_UNIQUE_KEYS`, `schema.sql`, `models.py`, `export_arkiv.py` (`_TIMESTAMP_FIELDS`, `_COLLECTION_DESCRIPTIONS`, `_FK_FIELDS` if applicable), and `analysis/visit_diff.py`.
189+
- When adding a new table: update `_TABLE_MAP`, `_UNIQUE_KEYS`, `schema.sql`, `models.py`, `export_arkiv.py` (`_TIMESTAMP_FIELDS`, `_COLLECTION_DESCRIPTIONS`, `_FK_FIELDS` if applicable), `analysis/visit_diff.py`, and if it's a non-clinical table add it to `_NON_CLINICAL_TABLES` in `spa/chat_prompt.py`.

0 commit comments

Comments
 (0)