Skip to content

Commit 44f9e29

Browse files
committed
docs: fix Wyhash→SHA-256, symbols.kind values, query caching claim (audit #5/#6/#7)
- Wyhash→SHA-256 hex: architecture.md, SKILL.md (agents + templates) - symbols.kind: variable→const, type_alias→type to match parser output - exports.kind: corrected to value/type/re-export - Database.query() caching: clarified Bun vs Node behavior
1 parent b6947e7 commit 44f9e29

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

.agents/skills/codemap/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ LIMIT 10
6868
| Column | Type | Description |
6969
| ------------- | ------- | -------------------------------------------------------------------------------- |
7070
| path | TEXT PK | Relative path from project root |
71-
| content_hash | TEXT | Wyhash fingerprint (base-36) |
71+
| content_hash | TEXT | SHA-256 hex digest |
7272
| size | INTEGER | File size in bytes |
7373
| line_count | INTEGER | Number of lines |
7474
| language | TEXT | `ts`, `tsx`, `js`, `jsx`, `css`, `md`, `mdx`, `mdc`, `json`, `yaml`, `sh`, `txt` |

docs/architecture.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,14 @@ All tables use `STRICT` mode. Tables marked with `WITHOUT ROWID` store data dire
171171
| last_modified | INTEGER | File mtime (epoch ms) |
172172
| indexed_at | INTEGER | When this row was written |
173173

174-
### `symbols` — Functions, variables, classes, interfaces, type aliases, enums (`STRICT`)
174+
### `symbols` — Functions, constants, classes, interfaces, types, enums (`STRICT`)
175175

176176
| Column | Type | Description |
177177
| ----------------- | ---------- | --------------------------------------------------------------------- |
178178
| id | INTEGER PK | Auto-increment row id |
179179
| file_path | TEXT FK | References `files(path)` ON DELETE CASCADE |
180180
| name | TEXT | Symbol name |
181-
| kind | TEXT | `function`, `variable`, `class`, `interface`, `type_alias`, `enum` |
181+
| kind | TEXT | `function`, `const`, `class`, `interface`, `type`, `enum` |
182182
| line_start | INTEGER | Start line (1-based) |
183183
| line_end | INTEGER | End line |
184184
| signature | TEXT | Reconstructed signature (e.g. `usePermissions(): PermissionsContext`) |
@@ -204,7 +204,7 @@ All tables use `STRICT` mode. Tables marked with `WITHOUT ROWID` store data dire
204204
| id | INTEGER PK | Auto-increment row id |
205205
| file_path | TEXT FK | File containing the export |
206206
| name | TEXT | Exported name |
207-
| kind | TEXT | `function`, `variable`, etc. |
207+
| kind | TEXT | `value`, `type`, `re-export` |
208208
| is_default | INTEGER | 1 if default export |
209209
| re_export_source | TEXT | Source module if re-exported |
210210

@@ -327,7 +327,7 @@ The indexer uses git to detect changes since the last indexed commit:
327327

328328
1. **Stores `last_indexed_commit`** (HEAD SHA) in the `meta` table after each run
329329
2. On next run, computes `git diff --name-only <last_commit>..HEAD` + `git status --porcelain`
330-
3. Only re-indexes changed files (Wyhash content comparison), using DB-sourced `indexedPaths` for import resolution (skips full `collectFiles()` glob scan)
330+
3. Only re-indexes changed files (SHA-256 content comparison), using DB-sourced `indexedPaths` for import resolution (skips full `collectFiles()` glob scan)
331331
4. Deleted files are removed via `ON DELETE CASCADE` — deleting from `files` cascades to all related tables
332332
5. Falls back to full rebuild if commit history is incompatible (e.g. force push, branch switch)
333333

@@ -436,7 +436,7 @@ Until the first release, Codemap keeps **`SCHEMA_VERSION` at 1**; pull `--full`
436436

437437
### `bun:sqlite` API
438438

439-
All DDL and PRAGMA statements use `Database.run()` (not the deprecated `Database.exec()` alias). Parameterized insert/update statements use `Database.query()` (which caches compiled statements) instead of `Database.prepare()` (which does not cache). Read queries also use `Database.query().all()` or `.get()`. Bulk inserts use the generic `batchInsert<T>()` helper with multi-row `INSERT ... VALUES (...),(...),(...)` in batches of 100, pre-computed placeholders, and zero-copy index-bounds iteration.
439+
All DDL and PRAGMA statements use `Database.run()`. The `sqlite-db.ts` wrapper abstracts both Bun (`bun:sqlite`) and Node (`better-sqlite3`). On Bun, `Database.query()` caches compiled statements; on Node, `better-sqlite3` re-prepares on each call via the wrapper's `run()` method. Read queries use the wrapper's `.query().all()` or `.get()`. Bulk inserts use the generic `batchInsert<T>()` helper with multi-row `INSERT ... VALUES (...),(...),(...)` in batches of 100, pre-computed placeholders, and zero-copy index-bounds iteration.
440440

441441
### PRAGMAs (set on every `openDb()`)
442442

templates/agents/skills/codemap/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ LIMIT 10
6868
| Column | Type | Description |
6969
| ------------- | ------- | -------------------------------------------------------------------------------- |
7070
| path | TEXT PK | Relative path from project root |
71-
| content_hash | TEXT | Wyhash fingerprint (base-36) |
71+
| content_hash | TEXT | SHA-256 hex digest |
7272
| size | INTEGER | File size in bytes |
7373
| line_count | INTEGER | Number of lines |
7474
| language | TEXT | `ts`, `tsx`, `js`, `jsx`, `css`, `md`, `mdx`, `mdc`, `json`, `yaml`, `sh`, `txt` |

0 commit comments

Comments
 (0)