ts-axi 0.1.13 → 0.1.14

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.
Files changed (2) hide show
  1. package/README.md +31 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -50,6 +50,37 @@ Early, but already used in real reviews. What the numbers say so far:
50
50
 
51
51
  Known limits: `.astro` / `.vue` / `.svelte` files are not analysed (they appear under `skipped`, and `--grep` searches them textually); every semantic command starts cold (0.3 s on a small project, 2-5 s on the monorepo, dominated by the library `.d.ts` files that barrels pull in); import specifiers are extracted textually, so computed specifiers and bundler-only aliases are missed.
52
52
 
53
+ ## Token cost
54
+
55
+ `test/integration/token-compare.test.ts` does six agent tasks twice: with ts-axi (plus one followed hint where that is the normal next step), and the way a careful agent does them without it - at most 3 `git grep -n` calls, then a ±40-line numbered read around each relevant match (overlaps merged), with `git diff` first for impact. Tokens are characters / 4. A recall gate fails when a grep hit in code (not a comment, a string or a doc file) is neither listed by ts-axi nor covered by its `textual` / `templates` count.
56
+
57
+ <!-- token-compare:start -->
58
+ | task | repo | ts-axi tokens | grep tokens | ratio | recall |
59
+ | --- | --- | ---: | ---: | ---: | --- |
60
+ | def of a class method | astro sample | 117 | 266 | 0.44 | 100% (1/1) |
61
+ | callers of a function | astro sample | 227 | 1169 | 0.19 | 100% (8/8) |
62
+ | refs of a class member | astro sample | 216 | 1133 | 0.19 | 100% (8/8) |
63
+ | impact of a signature change | astro sample | 737 | 1304 | 0.56 | 100% (14/14) |
64
+ | template uses of a directive | legacy-js | 409 | 289 | 1.42 | 100% (5/5) |
65
+ | refs of an untyped CommonJS member | legacy-js | 387 | 401 | 0.96 | 100% (5/5) |
66
+
67
+ - def of a class method is over 0.3 - the class file has 36 lines, so the grep side reads all of it once.
68
+ - impact of a signature change is over 0.3 - the followed hint repeats the first output with the extra rows (refs on the changed function); impact alone is 0.33.
69
+ - template uses of a directive is over 0.3 - the followed hint repeats the first output with the extra rows (--grep); the two matching files have 21 and 4 lines.
70
+ - refs of an untyped CommonJS member is over 0.3 - the followed hint repeats the first output with the extra rows (--grep); the two matching files have 24 and 12 lines.
71
+ <!-- token-compare:end -->
72
+
73
+ The fixture files are 5 to 40 lines long, so a ±40-line read is the whole file: the cheapest case for grep, and where a followed hint repeating the first output weighs most. On a real Nx monorepo (143 projects, ~5.4k source files; `scripts/token-compare.ts`, run locally):
74
+
75
+ | task | ts-axi tokens | grep tokens | ratio | recall |
76
+ | --- | ---: | ---: | ---: | --- |
77
+ | def of a service method | 496 | 1256 | 0.40 | 1/1 |
78
+ | callers of a service method (17 call sites) | 873 | 54314 | 0.02 | 17/96 |
79
+ | refs of a service method with a common name | 715 | 147944 | 0.01 | 18/77 (244 hits are other declarations of the name) |
80
+ | impact of a two-commit fix (4 changed symbols) | 1395 | 23950 | 0.06 | 28/44 (5 in the diff) |
81
+
82
+ Every hit those three rows miss is a member access through a deep-mock mapped type (`DeepMocked<Service>`) in a test file: the checker resolves it to the method, `findReferences` does not return it, and nothing reports it as a blind spot yet.
83
+
53
84
  ## Install
54
85
 
55
86
  Requires Node.js 20+.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-axi",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "AXI-compliant TypeScript symbol CLI for agents - definitions, references, callers, file outlines and change impact (blast radius) with token-efficient TOON output",
5
5
  "type": "module",
6
6
  "keywords": [