@zipbul/gildash 0.8.2 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.ko.md CHANGED
@@ -30,6 +30,8 @@ gildash는 TypeScript 코드베이스를 로컬 SQLite 데이터베이스에 인
30
30
  - **구조적 패턴 매칭** — [@ast-grep/napi](https://ast-grep.github.io/) 기반 AST 레벨 코드 검색
31
31
  - **증분 인덱싱** — `@parcel/watcher` 기반 파일 변경 감지, 변경된 파일만 재인덱싱
32
32
  - **심볼 레벨 diff** — `IndexResult`의 `changedSymbols`로 인덱싱 사이클 당 추가/수정/삭제된 심볼 추적
33
+ - **어노테이션 추출** — JSDoc, 라인(`//`), 블록(`/* */`) 주석에서 `@tag value` 패턴을 추출하고 심볼에 자동 연결, FTS5 검색 지원
34
+ - **심볼 변경 이력** — 인덱싱 사이클 간 심볼의 추가/수정/삭제/이름변경/이동을 추적, 구조적 지문 기반 rename 감지
33
35
  - **멀티 프로세스 안전** — owner/reader 역할 분리로 단일 writer 보장
34
36
  - **스캔 전용 모드** — `watchMode: false`로 파일 워처 없이 1회성 인덱싱
35
37
  - **tsconfig.json JSONC** — `tsconfig.json`의 주석(`//`, `/* */`)과 트레일링 콤마를 지원하는 경로 별칭 파싱
package/README.md CHANGED
@@ -30,6 +30,8 @@ gildash indexes your TypeScript codebase into a local SQLite database, then lets
30
30
  - **Structural pattern matching** — AST-level code search via [@ast-grep/napi](https://ast-grep.github.io/)
31
31
  - **Incremental indexing** — `@parcel/watcher`-based file change detection; only re-indexes modified files
32
32
  - **Symbol-level diff** — `changedSymbols` in `IndexResult` tracks added/modified/removed symbols per index cycle
33
+ - **Annotation extraction** — Generic `@tag value` extraction from JSDoc, line, and block comments with automatic symbol linking and FTS5 search
34
+ - **Symbol changelog** — Tracks added/modified/removed/renamed/moved symbols across index runs, with structural fingerprint-based rename detection
33
35
  - **Multi-process safe** — Owner/reader role separation guarantees a single writer per database
34
36
  - **Scan-only mode** — `watchMode: false` for one-shot indexing without file watcher overhead
35
37
  - **tsconfig.json JSONC** — Path alias resolution parses comments and trailing commas in `tsconfig.json`
@@ -140,6 +142,45 @@ const limited = await ledger.getCyclePaths(undefined, { maxCycles: 100 }); //
140
142
 
141
143
  ---
142
144
 
145
+ ### Annotations
146
+
147
+ Search `@tag value` patterns extracted from JSDoc, line (`//`), and block (`/* */`) comments.
148
+
149
+ ```ts
150
+ // Find all @deprecated annotations
151
+ const deprecated = ledger.searchAnnotations({ tag: 'deprecated' });
152
+ deprecated.forEach(a => console.log(`${a.symbolName}: ${a.value}`));
153
+
154
+ // Full-text search across annotation values
155
+ const caching = ledger.searchAnnotations({ text: 'caching' });
156
+
157
+ // Filter by source type and file
158
+ const todos = ledger.searchAnnotations({ tag: 'todo', source: 'line', filePath: 'src/app.ts' });
159
+ ```
160
+
161
+ ---
162
+
163
+ ### Symbol Changelog
164
+
165
+ Track symbol-level changes across index runs. Rename and move detection uses structural fingerprinting.
166
+
167
+ ```ts
168
+ // Get all incremental changes since a given date
169
+ const changes = ledger.getSymbolChanges(new Date('2024-01-01'));
170
+
171
+ // Include full-index entries and filter by change type
172
+ const renames = ledger.getSymbolChanges(new Date(0), {
173
+ includeFullIndex: true,
174
+ changeTypes: ['renamed', 'moved'],
175
+ });
176
+ renames.forEach(c => console.log(`${c.oldName} → ${c.symbolName} (${c.changeType})`));
177
+
178
+ // Prune old entries (returns deleted count)
179
+ const pruned = ledger.pruneChangelog(new Date('2024-01-01'));
180
+ ```
181
+
182
+ ---
183
+
143
184
  ### Code Quality Analysis
144
185
 
145
186
  Inspect module interfaces and measure coupling.
@@ -272,6 +313,19 @@ Returns `Promise<Gildash>`. Throws `GildashError` on failure.
272
313
  | `getInternalRelations(filePath)` | `StoredCodeRelation[]` | Intra-file relations |
273
314
  | `diffSymbols(before, after)` | `SymbolDiff` | Snapshot diff (added / removed / modified) |
274
315
 
316
+ ### Annotations
317
+
318
+ | Method | Returns | Description |
319
+ |--------|---------|-------------|
320
+ | `searchAnnotations(query)` | `AnnotationSearchResult[]` | Search `@tag value` annotations in JSDoc, line, and block comments |
321
+
322
+ ### Symbol Changelog
323
+
324
+ | Method | Returns | Description |
325
+ |--------|---------|-------------|
326
+ | `getSymbolChanges(since, opts?)` | `SymbolChange[]` | Symbol-level change history (added/modified/removed/renamed/moved) |
327
+ | `pruneChangelog(before)` | `number` | Delete changelog entries older than the given date |
328
+
275
329
  ### Semantic (opt-in)
276
330
 
277
331
  Requires `semantic: true` at open time.
@@ -452,6 +506,7 @@ interface IndexResult {
452
506
  removedFiles: number;
453
507
  totalSymbols: number;
454
508
  totalRelations: number;
509
+ totalAnnotations: number;
455
510
  durationMs: number;
456
511
  changedFiles: string[];
457
512
  deletedFiles: string[];
@@ -473,6 +528,55 @@ interface FileRecord {
473
528
  lineCount?: number | null;
474
529
  }
475
530
 
531
+ // ── Annotations ─────────────────────────────────────────────────────────
532
+
533
+ interface AnnotationSearchQuery {
534
+ text?: string; // FTS5 full-text query
535
+ tag?: string; // exact tag name (e.g. 'deprecated', 'todo')
536
+ filePath?: string;
537
+ symbolName?: string;
538
+ source?: 'jsdoc' | 'line' | 'block';
539
+ project?: string;
540
+ limit?: number; // default: 100
541
+ }
542
+
543
+ interface AnnotationSearchResult {
544
+ tag: string;
545
+ value: string;
546
+ source: 'jsdoc' | 'line' | 'block';
547
+ filePath: string;
548
+ symbolName: string | null;
549
+ span: { start: { line: number; column: number }; end: { line: number; column: number } };
550
+ }
551
+
552
+ // ── Symbol Changelog ────────────────────────────────────────────────────
553
+
554
+ type SymbolChangeType = 'added' | 'modified' | 'removed' | 'renamed' | 'moved';
555
+
556
+ interface SymbolChange {
557
+ changeType: SymbolChangeType;
558
+ symbolName: string;
559
+ symbolKind: string;
560
+ filePath: string;
561
+ oldName: string | null; // set for 'renamed'
562
+ oldFilePath: string | null; // set for 'moved'
563
+ fingerprint: string | null;
564
+ changedAt: string;
565
+ isFullIndex: boolean;
566
+ indexRunId: string;
567
+ }
568
+
569
+ interface SymbolChangeQueryOptions {
570
+ symbolName?: string;
571
+ changeTypes?: SymbolChangeType[];
572
+ filePath?: string;
573
+ includeFullIndex?: boolean; // default: false
574
+ indexRunId?: string;
575
+ afterId?: number; // pagination cursor
576
+ limit?: number; // default: 1000
577
+ project?: string;
578
+ }
579
+
476
580
  // ── Errors ──────────────────────────────────────────────────────────────
477
581
 
478
582
  class GildashError extends Error {
@@ -527,6 +631,18 @@ When multiple processes share the same SQLite database, gildash enforces a singl
527
631
 
528
632
  ## ⬆️ Upgrading
529
633
 
634
+ ### From 0.8.x to 0.9.0
635
+
636
+ **New:** Annotation extraction and symbol changelog tracking.
637
+
638
+ - `searchAnnotations(query)` — Search `@tag value` from JSDoc, line, and block comments
639
+ - `getSymbolChanges(since, opts?)` — Symbol-level change history with rename/move detection
640
+ - `pruneChangelog(before)` — Prune old changelog entries
641
+ - `IndexResult` now includes `totalAnnotations`
642
+ - New migrations `0006_annotations` and `0007_symbol_changelog` are applied automatically on open
643
+
644
+ **No breaking changes.** Existing databases are migrated automatically.
645
+
530
646
  ### From 0.7.x to 0.8.0
531
647
 
532
648
  **Breaking:** `batchParse()` now returns `BatchParseResult` (with `parsed` and `failures` fields) instead of `Map<string, ParsedFile>`.