@nrafinia/csmesh 0.7.1 → 0.8.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.
Files changed (2) hide show
  1. package/README.md +20 -9
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -380,16 +380,16 @@ csmesh entrypoints orders
380
380
  |:---|:---|
381
381
  | `--repo <PATH>` | Target repository root (default: nearest `.sln`, `.slnx`, or `.git` above cwd) |
382
382
  | `--under <PATH>` | Restrict the answer to a subtree, e.g. `--under src/Api`. Narrow before raising the budget. |
383
- | `--project <PATH>` | Pick one project when a name repeats across assemblies, e.g. `--project src/Api`. Exit `3` lists each candidate's project. |
383
+ | `--project <PATH>` | Pick one project when a name repeats across assemblies, e.g. `--project src/Api`. Exit `3` lists each candidate's project. Two overloads in one project need the parameter list instead, e.g. `Type.Member(int, string)`. |
384
384
  | `--budget <N>` | Hard token limit for stdout. Exits code `2` on overflow. Defaults per command below. |
385
- | `--depth <N>` | Traversal depth limit (`trace` 6, `blast-radius` 3, `context` 3, `path` 12, `diff` 3) |
385
+ | `--depth <N>` | Traversal depth limit (`trace` 6, `blast-radius` 3, `context` 3, `path` 12, `diff` 3, `export` neighbourhood 1) |
386
386
  | `--heal` | Re-bind changed files before answering, instead of marking rows `[STALE]` |
387
387
  | `--json` | Output results in structured JSON format |
388
388
  | `--debug` | Print verbose diagnostics to stderr |
389
389
  | `--no-telemetry` | Skip recording the invocation in local usage metrics |
390
390
  | `-h, --help` | Display command help and usage examples |
391
391
 
392
- Default budgets: `impl` 600, `path` 500, `where`/`trace` 600, `unresolved` 700, `silence` 300, `entrypoints` 800, `map` 850, `context` 900, everything else 800.
392
+ Default budgets: `impl` 600, `path` 500, `where`/`trace` 600, `unresolved` 700, `silence` 300, `entrypoints` 800, `map` 850, `context` 900, `export` 1500, everything else 800.
393
393
 
394
394
  ---
395
395
 
@@ -402,11 +402,22 @@ csmesh map
402
402
  csmesh map --under src/Application --budget 400
403
403
  ```
404
404
 
405
+ #### `csmesh export [<symbol>]`
406
+ Renders the graph as a **Mermaid** or **DOT** diagram: the project graph (default), the namespace graph (`--level namespace`), or the neighbourhood around a symbol (`--depth`, `--direction in|out|both`). The symbol is resolved exactly as `trace` resolves it, overload selector included. Test-tagged nodes and `TypeUse` edges are withheld by default and named in the counts. Node ids are the first 8 hex digits of SHA-256 of each node's stable identity, so a diagram committed to a design doc does not renumber when an unrelated symbol is added.
407
+ ```bash
408
+ csmesh export
409
+ csmesh export --level namespace --format dot
410
+ csmesh export OrderService.Process --depth 2 --direction out
411
+ csmesh export --level namespace --out docs/deps.mmd
412
+ ```
413
+ Without `--out` the render goes to stdout under the budget: overflow exits `2` and names both remedies (`--out`, a coarser `--level`). With `--out` the whole render is written by temp file and rename, and stdout carries only a budgeted summary (path, format, level, node/edge counts, withheld counts). The path must stay inside the repository root and under an existing directory — otherwise exit `64`; a write failure is exit `70`.
414
+
405
415
  #### `csmesh where <term>` (alias: `find`)
406
- Finds the symbols a word belongs to, ranked by how many entrypoints reach them. Start here when the task is described in words rather than symbol names; the last line is the next command, already filled in.
416
+ Finds the symbols a word belongs to, ranked by how many entrypoints reach them. Start here when the task is described in words rather than symbol names; the last line is the next command, already filled in. `--unranked` drops the ranking and the next hint and lists every match in stable `Node.Key` order, for diffing two runs or reading the full match set.
407
417
  ```bash
408
418
  csmesh where discount
409
419
  csmesh where checkout refund --under src/Application
420
+ csmesh where discount --unranked
410
421
  csmesh find "POST /orders"
411
422
  ```
412
423
 
@@ -503,7 +514,7 @@ csmesh review --accept # bless the current state as the new baseli
503
514
  ```
504
515
 
505
516
  #### `csmesh silence <symbol> [<target>]` (alias: `why-not`)
506
- Why a query came back empty. Exit `1` from any other command means the graph had nothing; it does not say whether the symbol was mistyped, lives in a package, was never bound because the solution was not built, or is reached only through a container scan. Those call for four different next actions.
517
+ Why a query came back empty. Exit `1` from any other command means the graph had nothing; it does not say whether the symbol was mistyped, lives in a package, was never bound because the solution was not built, or is reached only through a container scan. Those call for four different next actions. Given a selector whose name resolves but whose parameter list matches no overload, it lists the overloads that exist, each with its selector, and still exits `1`.
507
518
  ```bash
508
519
  csmesh silence IPaymentGateway
509
520
  csmesh why-not OrderController.Post SqlOrderStore.Save
@@ -525,7 +536,7 @@ csmesh usage --tail 10 # Last 10 raw invocations
525
536
  ```
526
537
 
527
538
  #### `csmesh doctor`
528
- Diagnoses index freshness, dirty files, caller attribution, and agent skill configurations.
539
+ Diagnoses index freshness, dirty files, caller attribution, and agent skill configurations. It warns when a project's compilation reports CS8795 — a source generator whose output is not on disk — naming the project, the count, and the `EmitCompilerGeneratedFiles=true` build that fixes it. It also warns when a `PackageReference` names an in-scope project's package id: that project's types are not bound through the package, and a `ProjectReference` is the fix.
529
540
  ```bash
530
541
  csmesh doctor
531
542
  ```
@@ -610,7 +621,7 @@ A symbol graph is not a replacement for text search or reading code; it is a rep
610
621
  | `0` | **Success** | Complete answer returned within budget. | Parse output directly. |
611
622
  | `1` | **Not Found** | Symbol does not exist in repository. | Check spelling or verify namespace. |
612
623
  | `2` | **Over Budget** | Answer exists but exceeds `--budget`. | Re-run with narrower `--depth` or query a specific callee. |
613
- | `3` | **Ambiguous** | Multiple symbols match query, including the same name declared in more than one project. | Re-run with qualified `Type.Member`, or with `--project <path>` taken from the candidate list. |
624
+ | `3` | **Ambiguous** | Multiple symbols match query, including the same name declared in more than one project. | Re-run with qualified `Type.Member`, or with `--project <path>` taken from the candidate list. Two overloads in one project defeat `--project`: use the selector each candidate row prints, e.g. `Type.Member(int, string)`. |
614
625
  | `4` | **No Index** | No usable graph: not generated, or (for `review`) the index predates HEAD. | Execute `csmesh index` and retry. |
615
626
  | `5` | **Changed** (`review` only) | Unaccepted structural change vs. the base revision. | Review the finding, then `csmesh review --accept` if it's fine to keep. |
616
627
  | `64`| **Usage Error** | Invalid flags, syntax, or arguments, including `review --accept` while the index predates HEAD. | Run `csmesh <cmd> --help`. |
@@ -621,10 +632,10 @@ A symbol graph is not a replacement for text search or reading code; it is a rep
621
632
 
622
633
  ## 📊 Telemetry & Audit Logging
623
634
 
624
- Every invocation records an audit log entry in `.csmesh/usage.jsonl` (local to the repository, never sent to external servers):
635
+ Every invocation records an audit log entry in `.csmesh/usage.jsonl` (local to the repository, never sent to external servers). Keys are `snake_case`; `schema_version` is `2` for the current record format, and a line written before the field existed reads as `1`:
625
636
 
626
637
  ```json
627
- {"ts":"2026-09-03T15:15:42Z","caller":"claude-code","caller_via":"env:CLAUDECODE","tty":false,"cmd":"trace","args":"PaymentController.Post --budget 600","exit":0,"ms":84,"budget":600,"out_tokens":125,"nodes":160,"edges":380}
638
+ {"schema_version":2,"ts":"2026-09-03T15:15:42Z","caller":"claude-code","caller_via":"env:CLAUDECODE","tty":false,"cmd":"trace","args":"PaymentController.Post --budget 600","budget":600,"exit":0,"ms":84,"out_tokens":125,"would_be_tokens":125,"reserved_tokens":0,"files_referenced":3,"nodes":160,"edges":380}
628
639
  ```
629
640
 
630
641
  Caller detection automatically attributes queries based on environment variables and process trees (`claude-code`, `cursor`, `windsurf`, `cline`, `antigravity`, `terminal-human`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrafinia/csmesh",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "Structural code intelligence & call-graph engine for C# and .NET — built for AI coding agents under hard token budgets",
5
5
  "bin": {
6
6
  "csmesh": "./bin/run.js"