Skip to content

Commit 9b323fd

Browse files
committed
fix: address CodeRabbit review — closeDb try/finally, stale docstring, SKILL.md kind
- closeDb: wrap PRAGMA optimize in try/finally so db.close() always runs - run-index.ts: update RunIndexOptions.files docstring (no longer filtered) - SKILL.md: remove stale `variable` from symbols.kind (agents + templates)
1 parent cb1ac83 commit 9b323fd

4 files changed

Lines changed: 30 additions & 27 deletions

File tree

.agents/skills/codemap/SKILL.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ LIMIT 10
7777

7878
### `symbols` — Functions, types, interfaces, enums, constants, classes
7979

80-
| Column | Type | Description |
81-
| ----------------- | ---------- | --------------------------------------------------------------------- |
82-
| id | INTEGER PK | Auto-increment ID |
83-
| file_path | TEXT FK | References `files(path)` |
84-
| name | TEXT | Symbol name |
85-
| kind | TEXT | `function`, `class`, `type`, `interface`, `enum`, `const`, `variable` |
86-
| line_start | INTEGER | Start line (1-based) |
87-
| line_end | INTEGER | End line (1-based) |
88-
| signature | TEXT | e.g. `createHandler()`, `type UserProps` |
89-
| is_exported | INTEGER | 1 if exported |
90-
| is_default_export | INTEGER | 1 if default export |
80+
| Column | Type | Description |
81+
| ----------------- | ---------- | --------------------------------------------------------- |
82+
| id | INTEGER PK | Auto-increment ID |
83+
| file_path | TEXT FK | References `files(path)` |
84+
| name | TEXT | Symbol name |
85+
| kind | TEXT | `function`, `class`, `type`, `interface`, `enum`, `const` |
86+
| line_start | INTEGER | Start line (1-based) |
87+
| line_end | INTEGER | End line (1-based) |
88+
| signature | TEXT | e.g. `createHandler()`, `type UserProps` |
89+
| is_exported | INTEGER | 1 if exported |
90+
| is_default_export | INTEGER | 1 if default export |
9191

9292
### `imports` — Import statements
9393

src/application/run-index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export interface RunIndexOptions {
4040
mode?: IndexMode;
4141
/**
4242
* Paths relative to the project root; used only when `mode === "files"`.
43-
* Non-indexable extensions are filtered out.
43+
* All paths are forwarded as-is; non-standard extensions are indexed as text.
4444
*/
4545
files?: string[];
4646
/**

src/db.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ export function openDb(): CodemapDatabase {
1818
}
1919

2020
export function closeDb(db: CodemapDatabase, opts?: { readonly?: boolean }) {
21-
if (!opts?.readonly) {
22-
db.run("PRAGMA analysis_limit = 400");
23-
db.run("PRAGMA optimize");
21+
try {
22+
if (!opts?.readonly) {
23+
db.run("PRAGMA analysis_limit = 400");
24+
db.run("PRAGMA optimize");
25+
}
26+
} finally {
27+
db.close();
2428
}
25-
db.close();
2629
}
2730

2831
export function createTables(db: CodemapDatabase) {

templates/agents/skills/codemap/SKILL.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ LIMIT 10
7777

7878
### `symbols` — Functions, types, interfaces, enums, constants, classes
7979

80-
| Column | Type | Description |
81-
| ----------------- | ---------- | --------------------------------------------------------------------- |
82-
| id | INTEGER PK | Auto-increment ID |
83-
| file_path | TEXT FK | References `files(path)` |
84-
| name | TEXT | Symbol name |
85-
| kind | TEXT | `function`, `class`, `type`, `interface`, `enum`, `const`, `variable` |
86-
| line_start | INTEGER | Start line (1-based) |
87-
| line_end | INTEGER | End line (1-based) |
88-
| signature | TEXT | e.g. `createHandler()`, `type UserProps` |
89-
| is_exported | INTEGER | 1 if exported |
90-
| is_default_export | INTEGER | 1 if default export |
80+
| Column | Type | Description |
81+
| ----------------- | ---------- | --------------------------------------------------------- |
82+
| id | INTEGER PK | Auto-increment ID |
83+
| file_path | TEXT FK | References `files(path)` |
84+
| name | TEXT | Symbol name |
85+
| kind | TEXT | `function`, `class`, `type`, `interface`, `enum`, `const` |
86+
| line_start | INTEGER | Start line (1-based) |
87+
| line_end | INTEGER | End line (1-based) |
88+
| signature | TEXT | e.g. `createHandler()`, `type UserProps` |
89+
| is_exported | INTEGER | 1 if exported |
90+
| is_default_export | INTEGER | 1 if default export |
9191

9292
### `imports` — Import statements
9393

0 commit comments

Comments
 (0)