gitnexus 1.6.9-rc.43 → 1.6.9-rc.45

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 (94) hide show
  1. package/README.md +45 -21
  2. package/dist/_shared/graph/types.d.ts +16 -0
  3. package/dist/_shared/graph/types.d.ts.map +1 -1
  4. package/dist/_shared/lbug/schema-constants.d.ts +1 -1
  5. package/dist/_shared/lbug/schema-constants.d.ts.map +1 -1
  6. package/dist/_shared/lbug/schema-constants.js +1 -0
  7. package/dist/_shared/lbug/schema-constants.js.map +1 -1
  8. package/dist/cli/i18n/en.d.ts +1 -1
  9. package/dist/cli/i18n/en.js +1 -1
  10. package/dist/cli/i18n/resources.d.ts +1 -1
  11. package/dist/cli/i18n/zh-CN.js +1 -1
  12. package/dist/cli/index-repo.d.ts +6 -2
  13. package/dist/cli/index-repo.js +30 -13
  14. package/dist/cli/index.js +1 -1
  15. package/dist/cli/remove.d.ts +6 -3
  16. package/dist/cli/remove.js +6 -3
  17. package/dist/core/group/bridge-db.d.ts +0 -1
  18. package/dist/core/group/bridge-db.js +1 -18
  19. package/dist/core/group/service.js +2 -3
  20. package/dist/core/group/storage.js +1 -1
  21. package/dist/core/incremental/subgraph-extract.js +14 -1
  22. package/dist/core/ingestion/di-extractors/index.d.ts +47 -0
  23. package/dist/core/ingestion/di-extractors/index.js +35 -0
  24. package/dist/core/ingestion/di-extractors/spring.d.ts +82 -0
  25. package/dist/core/ingestion/di-extractors/spring.js +220 -0
  26. package/dist/core/ingestion/field-extractors/configs/helpers.d.ts +12 -0
  27. package/dist/core/ingestion/field-extractors/configs/helpers.js +28 -0
  28. package/dist/core/ingestion/field-extractors/configs/jvm.js +13 -1
  29. package/dist/core/ingestion/field-extractors/generic.d.ts +13 -0
  30. package/dist/core/ingestion/field-extractors/generic.js +26 -0
  31. package/dist/core/ingestion/field-types.d.ts +13 -0
  32. package/dist/core/ingestion/languages/java/scope-resolver.js +1 -0
  33. package/dist/core/ingestion/method-extractors/configs/jvm.js +3 -18
  34. package/dist/core/ingestion/pipeline-phases/di.d.ts +47 -0
  35. package/dist/core/ingestion/pipeline-phases/di.js +217 -0
  36. package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
  37. package/dist/core/ingestion/pipeline-phases/index.js +1 -0
  38. package/dist/core/ingestion/pipeline.d.ts +1 -1
  39. package/dist/core/ingestion/pipeline.js +3 -2
  40. package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +48 -5
  41. package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +11 -5
  42. package/dist/core/ingestion/scope-resolution/passes/compound-receiver.d.ts +43 -0
  43. package/dist/core/ingestion/scope-resolution/passes/compound-receiver.js +199 -9
  44. package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +15 -8
  45. package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +15 -7
  46. package/dist/core/ingestion/workers/parse-worker.js +16 -0
  47. package/dist/core/lbug/lbug-adapter.d.ts +19 -0
  48. package/dist/core/lbug/lbug-adapter.js +59 -69
  49. package/dist/core/lbug/lbug-config.d.ts +21 -0
  50. package/dist/core/lbug/lbug-config.js +24 -0
  51. package/dist/core/run-analyze.d.ts +8 -5
  52. package/dist/core/run-analyze.js +51 -13
  53. package/dist/mcp/local/local-backend.js +15 -6
  54. package/dist/mcp/tools.js +6 -2
  55. package/dist/storage/fs-atomic.d.ts +5 -0
  56. package/dist/storage/fs-atomic.js +28 -0
  57. package/dist/storage/parse-cache.js +1 -1
  58. package/dist/storage/repo-manager.d.ts +92 -34
  59. package/dist/storage/repo-manager.js +275 -62
  60. package/hooks/antigravity/gitnexus-antigravity-hook.cjs +25 -5
  61. package/hooks/claude/gitnexus-hook.cjs +25 -5
  62. package/package.json +1 -1
  63. package/skills/gitnexus-cli.md +1 -0
  64. package/skills/gitnexus-guide.md +14 -4
  65. package/skills/gitnexus-pdg-query.md +1 -1
  66. package/skills/gitnexus-refactoring.md +4 -4
  67. package/web/assets/{agent-PekRmfZA.js → agent-Dli_x7bU.js} +1 -1
  68. package/web/assets/{architectureDiagram-UL44E2DR-BT7OtZ21.js → architectureDiagram-UL44E2DR-dEkqUZN9.js} +1 -1
  69. package/web/assets/{chunk-LCXTWHL2-BaR-mDRh.js → chunk-LCXTWHL2-CfLLCywY.js} +1 -1
  70. package/web/assets/{chunk-RG4AUYOV-C3Zi_WJJ.js → chunk-RG4AUYOV-CqWzWsV3.js} +1 -1
  71. package/web/assets/{classDiagram-KGZ6W3CR-DwCv2Ceh.js → classDiagram-KGZ6W3CR-CMne4tG9.js} +1 -1
  72. package/web/assets/{classDiagram-v2-72OJOZXJ-DwCv2Ceh.js → classDiagram-v2-72OJOZXJ-CMne4tG9.js} +1 -1
  73. package/web/assets/{dagre-ND4H6XIP-Bbr-DOod.js → dagre-ND4H6XIP-Co5rRx9X.js} +1 -1
  74. package/web/assets/{diagram-3NCE3AQN-t2SsI_89.js → diagram-3NCE3AQN-DBp4O00j.js} +1 -1
  75. package/web/assets/{diagram-GF46GFSD-DOPCRZb_.js → diagram-GF46GFSD-6N_8yS0i.js} +1 -1
  76. package/web/assets/{diagram-QXG6HAR7-C-ni48MX.js → diagram-QXG6HAR7-Di093rFg.js} +1 -1
  77. package/web/assets/{diagram-WEQXMOUZ-BhkxXWUs.js → diagram-WEQXMOUZ-DZWi4SUN.js} +1 -1
  78. package/web/assets/{erDiagram-L5TCEMPS-BgU0MxfG.js → erDiagram-L5TCEMPS-8X1y6R4Y.js} +1 -1
  79. package/web/assets/{flowDiagram-H6V6AXG4-aCbzaZWr.js → flowDiagram-H6V6AXG4-CMpY8Ufn.js} +1 -1
  80. package/web/assets/{index-CJuHkVdg.js → index-KctnI3Vq.js} +6 -6
  81. package/web/assets/{infoDiagram-3YFTVSEB-DVvyoVXw.js → infoDiagram-3YFTVSEB-BaLMZkUg.js} +1 -1
  82. package/web/assets/{ishikawaDiagram-BNXS4ZKH-hPZmDrPW.js → ishikawaDiagram-BNXS4ZKH-DfYpxnE5.js} +1 -1
  83. package/web/assets/{kanban-definition-75IXJCU3-pU7f9k-3.js → kanban-definition-75IXJCU3-CpfVLLf9.js} +1 -1
  84. package/web/assets/{mindmap-definition-2TDM6QVE-Wq8ESINo.js → mindmap-definition-2TDM6QVE-DypvbOMQ.js} +1 -1
  85. package/web/assets/{pieDiagram-CU6KROY3-o1D7lwHW.js → pieDiagram-CU6KROY3-s27EFWgP.js} +1 -1
  86. package/web/assets/{requirementDiagram-JXO7QTGE-BDiLsn6Z.js → requirementDiagram-JXO7QTGE-CWhqInuf.js} +1 -1
  87. package/web/assets/{sequenceDiagram-VS2MUI6T-DRI70L3-.js → sequenceDiagram-VS2MUI6T-RyTlZ5cR.js} +1 -1
  88. package/web/assets/{stateDiagram-7D4R322I-BnkJ0BQS.js → stateDiagram-7D4R322I-DTjVfX4A.js} +1 -1
  89. package/web/assets/{stateDiagram-v2-36443NZ5-i2xSyyw9.js → stateDiagram-v2-36443NZ5-xY9_k9_Q.js} +1 -1
  90. package/web/assets/{timeline-definition-O6YCAMPW-DDbISsUy.js → timeline-definition-O6YCAMPW-DrrqLYAf.js} +1 -1
  91. package/web/assets/{vennDiagram-MWXL3ELB-CkSSCEqU.js → vennDiagram-MWXL3ELB-B0RkWAim.js} +1 -1
  92. package/web/assets/{wardleyDiagram-CUQ6CDDI-CVWX5pm-.js → wardleyDiagram-CUQ6CDDI-boUxiQ5F.js} +1 -1
  93. package/web/assets/{xychartDiagram-N2JHSOCM-dHr2kp24.js → xychartDiagram-N2JHSOCM-BOLm0eNm.js} +1 -1
  94. package/web/index.html +1 -1
package/README.md CHANGED
@@ -40,14 +40,14 @@ To configure MCP for your editor, run `npx gitnexus setup` once — or set it up
40
40
 
41
41
  | Editor | MCP | Skills | Hooks (auto-augment) | Support |
42
42
  | ------------------------ | --- | ------ | ------------------------------------------------------------------------------------------ | ------------ |
43
- | **Claude Code** | Yes | Yes | Yes (PreToolUse) | **Full** |
43
+ | **Claude Code** | Yes | Yes | Yes (PreToolUse + PostToolUse) | **Full** |
44
44
  | **Cursor** | Yes | Yes | Yes (postToolUse, [manual install](../gitnexus-cursor-integration/README.md#hook-install)) | **Full** |
45
45
  | **Antigravity** (Google) | Yes | Yes | Yes (AfterTool, [Gemini CLI hooks schema](https://geminicli.com/docs/hooks/reference/)) | **Full** |
46
46
  | **Codex** | Yes | Yes | — | MCP + Skills |
47
- | **Windsurf** | Yes | — | — | MCP |
48
47
  | **OpenCode** | Yes | Yes | — | MCP + Skills |
48
+ | **Windsurf** | Yes | — | — | MCP |
49
49
 
50
- > **Claude Code** gets the deepest integration: MCP tools + agent skills + PreToolUse hooks that automatically enrich grep/glob/bash calls with knowledge graph context.
50
+ > **Claude Code** gets the deepest integration: MCP tools + agent skills + PreToolUse hooks that automatically enrich grep/glob/bash calls with knowledge graph context + PostToolUse hooks that detect a stale index after commits and prompt the agent to reindex.
51
51
 
52
52
  ### Community Integrations
53
53
 
@@ -122,31 +122,44 @@ The result is a **LadybugDB graph database** stored locally in `.gitnexus/` with
122
122
 
123
123
  ## MCP Tools
124
124
 
125
- Your AI agent gets these tools automatically:
126
-
127
- | Tool | What It Does | `repo` Param |
128
- | ---------------- | ---------------------------------------------------------------- | ------------ |
129
- | `list_repos` | Discover all indexed repositories (paginated — `limit`/`offset`) | — |
130
- | `query` | Process-grouped hybrid search (BM25 + semantic + RRF) | Optional |
131
- | `context` | 360-degree symbol view — categorized refs, process participation | Optional |
132
- | `impact` | Blast radius analysis with depth grouping and confidence | Optional |
133
- | `detect_changes` | Git-diff impact maps changed lines to affected processes | Optional |
134
- | `rename` | Multi-file coordinated rename with graph + text search | Optional |
135
- | `cypher` | Raw Cypher graph queries | Optional |
136
-
137
- > With one indexed repo, the `repo` param is optional. With multiple, specify which: `query({search_query: "auth", repo: "my-app"})`.
125
+ Your AI agent gets **17 tools** (15 per-repo + 2 group) automatically:
126
+
127
+ | Tool | What It Does |
128
+ | ---------------- | ----------------------------------------------------------------------- |
129
+ | `list_repos` | Discover all indexed repositories (paginated — `limit`/`offset`) |
130
+ | `query` | Process-grouped hybrid search (BM25 + semantic + RRF) |
131
+ | `context` | 360-degree symbol view — categorized refs, process participation |
132
+ | `impact` | Blast radius analysis with depth grouping and confidence |
133
+ | `trace` | Shortest directed path between two symbols (call + class-member edges) |
134
+ | `detect_changes` | Git-diff impact maps changed lines to affected processes |
135
+ | `check` | Read-only structural checks against the indexed graph |
136
+ | `rename` | Multi-file coordinated rename with graph + text search |
137
+ | `cypher` | Raw Cypher graph queries |
138
+ | `route_map` | API route map — which components fetch which endpoints, and handlers |
139
+ | `tool_map` | MCP/RPC tool definitions — where they're defined and handled |
140
+ | `shape_check` | Validate API response shapes against consumers' property accesses |
141
+ | `api_impact` | Pre-change impact report for an API route handler |
142
+ | `explain` | Explain persisted taint findings (source→sink flows, `--pdg` indexes) |
143
+ | `pdg_query` | Query control/data dependence at statement level (`--pdg` indexes) |
144
+ | `group_list` | List configured repository groups |
145
+ | `group_sync` | Rebuild a group's Contract Registry and cross-repo links |
146
+
147
+ > With one indexed repo, the `repo` param is optional. With multiple, specify which: `query({search_query: "auth", repo: "my-app"})`. Per-repo tools also take an optional `branch` for multi-branch indexes. `explain` and `pdg_query` need an index built with `gitnexus analyze --pdg`.
138
148
 
139
149
  ## MCP Resources
140
150
 
141
151
  | Resource | Purpose |
142
152
  | --------------------------------------- | ---------------------------------------------------- |
143
153
  | `gitnexus://repos` | List all indexed repositories (read first) |
154
+ | `gitnexus://setup` | Setup and usage guidance for agents |
144
155
  | `gitnexus://repo/{name}/context` | Codebase stats, staleness check, and available tools |
145
156
  | `gitnexus://repo/{name}/clusters` | All functional clusters with cohesion scores |
146
157
  | `gitnexus://repo/{name}/cluster/{name}` | Cluster members and details |
147
158
  | `gitnexus://repo/{name}/processes` | All execution flows |
148
159
  | `gitnexus://repo/{name}/process/{name}` | Full process trace with steps |
149
160
  | `gitnexus://repo/{name}/schema` | Graph schema for Cypher queries |
161
+ | `gitnexus://group/{name}/contracts` | A group's extracted contracts and cross-links |
162
+ | `gitnexus://group/{name}/status` | Staleness of repos in a group |
150
163
 
151
164
  ## MCP Prompts
152
165
 
@@ -164,7 +177,11 @@ gitnexus analyze [path] # Index a repository (or update stale index)
164
177
  gitnexus analyze --repair-fts # Fast path: rebuild/verify only FTS indexes on existing index data
165
178
  gitnexus analyze --force # Full rebuild: re-parse + graph rebuild + FTS rebuild
166
179
  gitnexus analyze --embeddings # Enable embedding generation (slower, better search)
180
+ gitnexus analyze --skills # Generate repo-specific skill files from detected communities
167
181
  gitnexus analyze --skip-agents-md # Preserve custom AGENTS.md/CLAUDE.md gitnexus section edits
182
+ gitnexus analyze --skip-skills # Skip installing .claude/skills/gitnexus/ skill files
183
+ gitnexus analyze --skip-git # Index folders that are not Git repositories
184
+ gitnexus analyze --workers <n> # Parse worker pool size (>=1; default: cores-1, capped at 16)
168
185
  gitnexus analyze --verbose # Log skipped files when parsers are unavailable
169
186
  gitnexus analyze --max-file-size 1024 # Skip files larger than N KB (default: 512, cap: 32768)
170
187
  gitnexus analyze --worker-timeout 60 # Increase worker idle timeout for slow parses
@@ -177,13 +194,16 @@ gitnexus status # Show index status for current repo
177
194
  gitnexus clean # Delete index for current repo
178
195
  gitnexus clean --all --force # Delete all indexes
179
196
  gitnexus wiki [path] # Generate LLM-powered docs from knowledge graph
180
- gitnexus wiki --model <model> # Wiki with custom LLM model (default: gpt-4o-mini)
197
+ gitnexus wiki --model <model> # Wiki with custom LLM model (default: minimax/minimax-m2.5)
198
+ gitnexus doctor # Show runtime platform capabilities and embedding configuration
181
199
 
182
200
  # Direct graph queries — the same tools the MCP server exposes, no MCP daemon needed
183
201
  gitnexus query "<concept>" # Process-grouped hybrid search
184
202
  gitnexus context <symbol> [--uid <uid> | --file <path>] # 360° symbol view; flags disambiguate a shared name
185
203
  gitnexus impact <symbol> [--uid <uid> | --file <path> | --kind <kind>] # Blast radius; flags disambiguate a shared name
204
+ gitnexus trace <from> <to> # Shortest directed path between two symbols
186
205
  gitnexus detect-changes # Map the working-tree diff to affected symbols and execution flows
206
+ gitnexus check # Read-only structural checks against the indexed graph
187
207
  gitnexus cypher "<query>" # Run a raw Cypher query against the knowledge graph
188
208
 
189
209
  # Repository groups (multi-repo / monorepo service tracking)
@@ -195,6 +215,7 @@ gitnexus group sync <name> # Extract contrac
195
215
  gitnexus group contracts <name> # Inspect extracted contracts and cross-links
196
216
  gitnexus group query <name> <q> # Search execution flows across all repos in a group
197
217
  gitnexus group status <name> # Check staleness of repos in a group
218
+ gitnexus group impact <name> --target <symbol> --repo <groupPath> # Cross-repo blast radius
198
219
  ```
199
220
 
200
221
  > **`gitnexus uninstall`** reverses `gitnexus setup` — it removes the GitNexus MCP entries, hooks, and skill directories it added to each detected editor. Skill directories are identified **by bundled gitnexus skill name** (e.g. `gitnexus-cli/`), so if you customized files inside an installed skill directory, back them up first. It is a dry-run preview by default and prints the exact paths it would remove; pass `--force` to apply. Per-repo indexes (`gitnexus clean --all`) and the global npm package (`npm uninstall -g gitnexus`) are left for you to remove.
@@ -219,7 +240,7 @@ GitNexus supports indexing multiple repositories. Each `gitnexus analyze` regist
219
240
 
220
241
  ## Supported Languages
221
242
 
222
- TypeScript, JavaScript, Python, Java, C, C++, C#, Go, Rust, PHP, Kotlin, Swift, Ruby
243
+ TypeScript, JavaScript, Python, Java, C, C++, C#, Go, Rust, PHP, Kotlin, Swift, Ruby, Dart
223
244
 
224
245
  ### Language Feature Matrix
225
246
 
@@ -238,6 +259,7 @@ TypeScript, JavaScript, Python, Java, C, C++, C#, Go, Rust, PHP, Kotlin, Swift,
238
259
  | Swift | — | — | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
239
260
  | C | — | — | ✓ | — | ✓ | ✓ | — | ✓ | ✓ |
240
261
  | C++ | — | — | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ |
262
+ | Dart | ✓ | — | ✓ | ✓ | ✓ | ✓ | — | ✓ | ✓ |
241
263
 
242
264
  **Imports** — cross-file import resolution · **Named Bindings** — `import { X as Y }` / re-export tracking · **Exports** — public/exported symbol detection · **Heritage** — class inheritance, interfaces, mixins · **Type Annotations** — explicit type extraction for receiver resolution · **Constructor Inference** — infer receiver type from constructor calls (`self`/`this` resolution included for all languages) · **Config** — language toolchain config parsing (tsconfig, go.mod, etc.) · **Frameworks** — AST-based framework pattern detection · **Entry Points** — entry point scoring heuristics
243
265
 
@@ -249,12 +271,14 @@ GitNexus ships with skill files that teach AI agents how to use the tools effect
249
271
  - **Debugging** — Trace bugs through call chains
250
272
  - **Impact Analysis** — Analyze blast radius before changes
251
273
  - **Refactoring** — Plan safe refactors using dependency mapping
274
+ - **Guide** — GitNexus tool/resource/schema reference for the agent
275
+ - **CLI** — Run analyze/status/clean/wiki commands on request
252
276
 
253
- Installed automatically by both `gitnexus analyze` (per-repo) and `gitnexus setup` (global).
277
+ Installed automatically by both `gitnexus analyze` (per-repo) and `gitnexus setup` (global). Run `gitnexus analyze --skills` to additionally generate repo-specific skills for each detected functional area under `.claude/skills/generated/`.
254
278
 
255
279
  ## Requirements
256
280
 
257
- - Node.js >= 18
281
+ - Node.js >= 22
258
282
  - Git repository (uses git for commit tracking)
259
283
 
260
284
  ## Release candidates
@@ -340,7 +364,7 @@ gitnexus serve
340
364
 
341
365
  ### Installation fails with native module errors
342
366
 
343
- Some optional language grammars (Dart, Kotlin, Swift) require native compilation. If they fail, GitNexus still works — those languages will be skipped.
367
+ Some optional language grammars (Dart, Proto, Swift, Kotlin) require native compilation. If they fail, GitNexus still works — those languages will be skipped. To skip them intentionally (no C++ toolchain needed), set `GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1` before installing.
344
368
 
345
369
  If `npm install -g gitnexus` fails on native modules:
346
370
 
@@ -32,6 +32,9 @@ export type NodeProperties = {
32
32
  level?: number;
33
33
  returnType?: string;
34
34
  declaredType?: string;
35
+ /** Verbatim declared-type source text with generics preserved
36
+ * (e.g. `List<Shape>` where `declaredType` is the stripped `List`). */
37
+ rawDeclaredType?: string;
35
38
  visibility?: string;
36
39
  isStatic?: boolean;
37
40
  isReadonly?: boolean;
@@ -52,6 +55,19 @@ export type NodeProperties = {
52
55
  [key: string]: unknown;
53
56
  };
54
57
  export type RelationshipType = 'CONTAINS' | 'CALLS' | 'INHERITS' | 'METHOD_OVERRIDES' | 'METHOD_IMPLEMENTS' | 'IMPORTS' | 'USES' | 'DEFINES' | 'DECORATES' | 'IMPLEMENTS' | 'EXTENDS' | 'HAS_METHOD' | 'HAS_PROPERTY' | 'ACCESSES' | 'MEMBER_OF' | 'STEP_IN_PROCESS' | 'HANDLES_ROUTE' | 'FETCHES' | 'HANDLES_TOOL' | 'ENTRY_POINT_OF' | 'WRAPS' | 'QUERIES'
58
+ /** Dependency-injection edge: a consumer class receives every implementer
59
+ * of interface `T` via a container-injected collection-typed field
60
+ * (`List<T>`, `Set<T>`, `Collection<T>`, or `Map<K,T>`). Precondition: the
61
+ * field carries an injection annotation recognized by a per-language
62
+ * matcher registered in `di-extractors/` (Java/Spring today: `@Autowired`
63
+ * or `@Inject`; `@Resource` is excluded — by-name-first semantics).
64
+ * Source = the consumer Class node (the one owning the field).
65
+ * Target = an implementing Class node.
66
+ * Framework specifics live in the `reason` payload (e.g.
67
+ * `Spring DI: @Autowired List<T>`), not in this type contract.
68
+ * Lets Cypher queries trace which beans the container injects into a given
69
+ * consumer, complementing the structural `IMPLEMENTS` heritage edges. */
70
+ | 'INJECTS'
55
71
  /** Vue component event system: a handler function in a parent component is
56
72
  * bound to an event emitted by a child component (`@event="handlerFn"`).
57
73
  * Source = handler Function/Method node in the parent.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/graph/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU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ACd;;;;qEAIqE;GACnE,KAAK;AACP;;;;;;0EAM0E;GACxE,eAAe;AACjB;;;;;;;;;;;oCAWoC;GAClC,cAAc,CAAC;AAEnB,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,SAAS;QAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;KACxB,EAAE,CAAC;CACL"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/graph/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,QAAQ,GACR,UAAU,GACV,WAAW,GACX,MAAM,GACN,WAAW,GACX,QAAQ,GACR,MAAM,GACN,aAAa,GACb,WAAW,GACX,SAAS,GAET,QAAQ,GACR,OAAO,GACP,SAAS,GACT,OAAO,GACP,WAAW,GACX,OAAO,GACP,MAAM,GACN,WAAW,GACX,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,aAAa,GACb,UAAU,GACV,SAAS,GACT,OA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5B;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,SAAS;QAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;KACxB,EAAE,CAAC;CACL"}
@@ -10,7 +10,7 @@
10
10
  export declare const NODE_TABLES: readonly ["File", "Folder", "Function", "Class", "Interface", "Method", "CodeElement", "Community", "Process", "Section", "Struct", "Enum", "Macro", "Typedef", "Union", "Namespace", "Trait", "Impl", "TypeAlias", "Const", "Static", "Variable", "Property", "Record", "Delegate", "Annotation", "Constructor", "Template", "Module", "Route", "Tool", "BasicBlock"];
11
11
  export type NodeTableName = (typeof NODE_TABLES)[number];
12
12
  export declare const REL_TABLE_NAME = "CodeRelation";
13
- export declare const REL_TYPES: readonly ["CONTAINS", "DEFINES", "IMPORTS", "CALLS", "EXTENDS", "IMPLEMENTS", "HAS_METHOD", "HAS_PROPERTY", "ACCESSES", "METHOD_OVERRIDES", "OVERRIDES", "METHOD_IMPLEMENTS", "MEMBER_OF", "STEP_IN_PROCESS", "HANDLES_ROUTE", "FETCHES", "HANDLES_TOOL", "ENTRY_POINT_OF", "WRAPS", "QUERIES", "CFG", "REACHING_DEF", "TAINTED", "SANITIZES", "TAINT_PATH", "CDG", "POST_DOMINATE"];
13
+ export declare const REL_TYPES: readonly ["CONTAINS", "DEFINES", "IMPORTS", "CALLS", "EXTENDS", "IMPLEMENTS", "HAS_METHOD", "HAS_PROPERTY", "ACCESSES", "METHOD_OVERRIDES", "OVERRIDES", "METHOD_IMPLEMENTS", "MEMBER_OF", "STEP_IN_PROCESS", "HANDLES_ROUTE", "FETCHES", "HANDLES_TOOL", "ENTRY_POINT_OF", "WRAPS", "QUERIES", "INJECTS", "CFG", "REACHING_DEF", "TAINTED", "SANITIZES", "TAINT_PATH", "CDG", "POST_DOMINATE"];
14
14
  export type RelType = (typeof REL_TYPES)[number];
15
15
  export declare const EMBEDDING_TABLE_NAME = "CodeEmbedding";
16
16
  //# sourceMappingURL=schema-constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema-constants.d.ts","sourceRoot":"","sources":["../../src/lbug/schema-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,WAAW,wWAkCd,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C,eAAO,MAAM,SAAS,sXAmCZ,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,eAAO,MAAM,oBAAoB,kBAAkB,CAAC"}
1
+ {"version":3,"file":"schema-constants.d.ts","sourceRoot":"","sources":["../../src/lbug/schema-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,WAAW,wWAkCd,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,cAAc,iBAAiB,CAAC;AAE7C,eAAO,MAAM,SAAS,iYAoCZ,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,eAAO,MAAM,oBAAoB,kBAAkB,CAAC"}
@@ -64,6 +64,7 @@ export const REL_TYPES = [
64
64
  'ENTRY_POINT_OF',
65
65
  'WRAPS',
66
66
  'QUERIES',
67
+ 'INJECTS',
67
68
  // Taint/PDG substrate (issue #2080) — reserved edge types, emitted by no
68
69
  // phase yet (CFG → M1, REACHING_DEF → M2, TAINTED/SANITIZES/TAINT_PATH →
69
70
  // M3/M4). REACHING_DEF's variable name rides the relation's `reason` column.
@@ -1 +1 @@
1
- {"version":3,"file":"schema-constants.js","sourceRoot":"","sources":["../../src/lbug/schema-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM;IACN,QAAQ;IACR,UAAU;IACV,OAAO;IACP,WAAW;IACX,QAAQ;IACR,aAAa;IACb,WAAW;IACX,SAAS;IACT,SAAS;IACT,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,OAAO;IACP,WAAW;IACX,OAAO;IACP,MAAM;IACN,WAAW;IACX,OAAO;IACP,QAAQ;IACR,UAAU;IACV,UAAU;IACV,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,aAAa;IACb,UAAU;IACV,QAAQ;IACR,OAAO;IACP,MAAM;IACN,2EAA2E;IAC3E,YAAY;CACJ,CAAC;AAIX,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU;IACV,SAAS;IACT,SAAS;IACT,OAAO;IACP,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,UAAU;IACV,kBAAkB;IAClB,WAAW,EAAE,mEAAmE;IAChF,mBAAmB;IACnB,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,SAAS;IACT,cAAc;IACd,gBAAgB;IAChB,OAAO;IACP,SAAS;IACT,yEAAyE;IACzE,yEAAyE;IACzE,6EAA6E;IAC7E,KAAK;IACL,cAAc;IACd,SAAS;IACT,WAAW;IACX,YAAY;IACZ,4EAA4E;IAC5E,uEAAuE;IACvE,4EAA4E;IAC5E,8EAA8E;IAC9E,KAAK;IACL,eAAe;CACP,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"schema-constants.js","sourceRoot":"","sources":["../../src/lbug/schema-constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM;IACN,QAAQ;IACR,UAAU;IACV,OAAO;IACP,WAAW;IACX,QAAQ;IACR,aAAa;IACb,WAAW;IACX,SAAS;IACT,SAAS;IACT,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,OAAO;IACP,WAAW;IACX,OAAO;IACP,MAAM;IACN,WAAW;IACX,OAAO;IACP,QAAQ;IACR,UAAU;IACV,UAAU;IACV,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,aAAa;IACb,UAAU;IACV,QAAQ;IACR,OAAO;IACP,MAAM;IACN,2EAA2E;IAC3E,YAAY;CACJ,CAAC;AAIX,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;AAE7C,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,UAAU;IACV,SAAS;IACT,SAAS;IACT,OAAO;IACP,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,UAAU;IACV,kBAAkB;IAClB,WAAW,EAAE,mEAAmE;IAChF,mBAAmB;IACnB,WAAW;IACX,iBAAiB;IACjB,eAAe;IACf,SAAS;IACT,cAAc;IACd,gBAAgB;IAChB,OAAO;IACP,SAAS;IACT,SAAS;IACT,yEAAyE;IACzE,yEAAyE;IACzE,6EAA6E;IAC7E,KAAK;IACL,cAAc;IACd,SAAS;IACT,WAAW;IACX,YAAY;IACZ,4EAA4E;IAC5E,uEAAuE;IACvE,4EAA4E;IAC5E,8EAA8E;IAC9E,KAAK;IACL,eAAe;CACP,CAAC;AAIX,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC"}
@@ -162,7 +162,7 @@ export declare const en: {
162
162
  readonly 'help.option.analyze.embeddingBatchSize': "Number of nodes per embedding batch";
163
163
  readonly 'help.option.analyze.embeddingSubBatchSize': "Number of chunks per embedding model call";
164
164
  readonly 'help.option.analyze.embeddingDevice': "Embedding device: auto, cpu, dml, cuda, or wasm";
165
- readonly 'help.option.index.force': "Register even if meta.json is missing (stats will be empty)";
165
+ readonly 'help.option.index.force': "Register even if index metadata is missing (stats will be empty)";
166
166
  readonly 'help.option.index.allowNonGit': "Allow registering folders that are not Git repositories";
167
167
  readonly 'help.option.port': "Port number";
168
168
  readonly 'help.option.serve.host': "Bind address (default: 127.0.0.1, use 0.0.0.0 for remote access)";
@@ -162,7 +162,7 @@ export const en = {
162
162
  'help.option.analyze.embeddingBatchSize': 'Number of nodes per embedding batch',
163
163
  'help.option.analyze.embeddingSubBatchSize': 'Number of chunks per embedding model call',
164
164
  'help.option.analyze.embeddingDevice': 'Embedding device: auto, cpu, dml, cuda, or wasm',
165
- 'help.option.index.force': 'Register even if meta.json is missing (stats will be empty)',
165
+ 'help.option.index.force': 'Register even if index metadata is missing (stats will be empty)',
166
166
  'help.option.index.allowNonGit': 'Allow registering folders that are not Git repositories',
167
167
  'help.option.port': 'Port number',
168
168
  'help.option.serve.host': 'Bind address (default: 127.0.0.1, use 0.0.0.0 for remote access)',
@@ -163,7 +163,7 @@ export declare const cliResources: {
163
163
  readonly 'help.option.analyze.embeddingBatchSize': "Number of nodes per embedding batch";
164
164
  readonly 'help.option.analyze.embeddingSubBatchSize': "Number of chunks per embedding model call";
165
165
  readonly 'help.option.analyze.embeddingDevice': "Embedding device: auto, cpu, dml, cuda, or wasm";
166
- readonly 'help.option.index.force': "Register even if meta.json is missing (stats will be empty)";
166
+ readonly 'help.option.index.force': "Register even if index metadata is missing (stats will be empty)";
167
167
  readonly 'help.option.index.allowNonGit': "Allow registering folders that are not Git repositories";
168
168
  readonly 'help.option.port': "Port number";
169
169
  readonly 'help.option.serve.host': "Bind address (default: 127.0.0.1, use 0.0.0.0 for remote access)";
@@ -162,7 +162,7 @@ export const zhCN = {
162
162
  'help.option.analyze.embeddingBatchSize': '每个嵌入批次的节点数',
163
163
  'help.option.analyze.embeddingSubBatchSize': '每次嵌入模型调用的分块数',
164
164
  'help.option.analyze.embeddingDevice': '嵌入设备:auto、cpu、dml、cuda 或 wasm',
165
- 'help.option.index.force': '即使缺少 meta.json 也注册(统计为空)',
165
+ 'help.option.index.force': '即使缺少索引元数据也注册(统计为空)',
166
166
  'help.option.index.allowNonGit': '允许注册非 Git 仓库文件夹',
167
167
  'help.option.port': '端口号',
168
168
  'help.option.serve.host': '绑定地址(默认:127.0.0.1;远程访问可用 0.0.0.0)',
@@ -1,10 +1,14 @@
1
1
  /**
2
2
  * Index Command
3
3
  *
4
- * Registers an existing .gitnexus/ folder into the global registry so the
4
+ * Registers an existing GitNexus index into the global registry so the
5
5
  * MCP server can discover the repo without running a full `gitnexus analyze`.
6
6
  *
7
- * Useful when a pre-built .gitnexus/ directory is already present (e.g. after
7
+ * The index can be either:
8
+ * - A per-worktree gitnexus.json file under .gitnexus/ (new format, worktree-compatible)
9
+ * - A legacy .gitnexus/meta.json file (auto-migrated on analyze)
10
+ *
11
+ * Useful when a pre-built index is already present (e.g. after
8
12
  * cloning a repo that ships its index, restoring from backup, or using a
9
13
  * shared team index).
10
14
  */
@@ -1,16 +1,20 @@
1
1
  /**
2
2
  * Index Command
3
3
  *
4
- * Registers an existing .gitnexus/ folder into the global registry so the
4
+ * Registers an existing GitNexus index into the global registry so the
5
5
  * MCP server can discover the repo without running a full `gitnexus analyze`.
6
6
  *
7
- * Useful when a pre-built .gitnexus/ directory is already present (e.g. after
7
+ * The index can be either:
8
+ * - A per-worktree gitnexus.json file under .gitnexus/ (new format, worktree-compatible)
9
+ * - A legacy .gitnexus/meta.json file (auto-migrated on analyze)
10
+ *
11
+ * Useful when a pre-built index is already present (e.g. after
8
12
  * cloning a repo that ships its index, restoring from backup, or using a
9
13
  * shared team index).
10
14
  */
11
15
  import path from 'path';
12
16
  import fs from 'fs/promises';
13
- import { getStoragePaths, loadMeta, ensureGitNexusIgnored, registerRepo, } from '../storage/repo-manager.js';
17
+ import { getStoragePaths, INDEX_METADATA_FILE, loadMeta, ensureGitNexusIgnored, registerRepo, } from '../storage/repo-manager.js';
14
18
  import { getGitRoot, getRemoteUrl, isGitRepo } from '../storage/git.js';
15
19
  export const indexCommand = async (inputPathParts, options) => {
16
20
  console.log('\n GitNexus Index\n');
@@ -50,22 +54,35 @@ export const indexCommand = async (inputPathParts, options) => {
50
54
  return;
51
55
  }
52
56
  const { storagePath, lbugPath } = getStoragePaths(repoPath);
53
- // ── Verify .gitnexus/ exists ──────────────────────────────────────
57
+ // ── Verify index exists (metadata file, legacy metadata, or restorable DB) ─
58
+ let hasMetadataIndex = false;
59
+ let hasLegacyIndex = false;
60
+ let hasLbugIndex = false;
61
+ try {
62
+ await fs.access(path.join(storagePath, INDEX_METADATA_FILE));
63
+ hasMetadataIndex = true;
64
+ }
65
+ catch { }
54
66
  try {
55
- await fs.access(storagePath);
67
+ await fs.access(path.join(storagePath, 'meta.json'));
68
+ hasLegacyIndex = true;
56
69
  }
57
- catch {
58
- console.log(` No .gitnexus/ folder found at: ${storagePath}`);
70
+ catch { }
71
+ try {
72
+ await fs.access(lbugPath);
73
+ hasLbugIndex = true;
74
+ }
75
+ catch { }
76
+ if (!hasMetadataIndex && !hasLegacyIndex && !hasLbugIndex) {
77
+ console.log(` No GitNexus index found.`);
78
+ console.log(` Expected gitnexus.json, .gitnexus/meta.json, or LadybugDB at: ${storagePath}`);
59
79
  console.log(' Run `gitnexus analyze` to build the index first.\n');
60
80
  process.exitCode = 1;
61
81
  return;
62
82
  }
63
83
  // ── Verify lbug database exists ───────────────────────────────────
64
- try {
65
- await fs.access(lbugPath);
66
- }
67
- catch {
68
- console.log(` .gitnexus/ folder exists but contains no LadybugDB index.`);
84
+ if (!hasLbugIndex) {
85
+ console.log(` Index exists but contains no LadybugDB database.`);
69
86
  console.log(' Run `gitnexus analyze` to build the index.\n');
70
87
  process.exitCode = 1;
71
88
  return;
@@ -74,7 +91,7 @@ export const indexCommand = async (inputPathParts, options) => {
74
91
  let meta = await loadMeta(storagePath);
75
92
  if (!meta) {
76
93
  if (!options?.force) {
77
- console.log(` .gitnexus/ exists but meta.json is missing.`);
94
+ console.log(` gitnexus.json or .gitnexus/meta.json is missing.`);
78
95
  console.log(' Use --force to register anyway (stats will be empty),');
79
96
  console.log(' or run `gitnexus analyze` to rebuild properly.\n');
80
97
  process.exitCode = 1;
package/dist/cli/index.js CHANGED
@@ -123,7 +123,7 @@ program
123
123
  program
124
124
  .command('index [path...]')
125
125
  .description('Register an existing .gitnexus/ folder into the global registry (no re-analysis needed)')
126
- .option('-f, --force', 'Register even if meta.json is missing (stats will be empty)')
126
+ .option('-f, --force', 'Register even if index metadata is missing (stats will be empty)')
127
127
  .option('--allow-non-git', 'Allow registering folders that are not Git repositories')
128
128
  .action(createLazyAction(() => import('./index-repo.js'), 'indexCommand'));
129
129
  program
@@ -1,9 +1,12 @@
1
1
  /**
2
2
  * Remove Command (#664)
3
3
  *
4
- * Delete the `.gitnexus/` index for a registered repo and unregister it
5
- * from the global registry (~/.gitnexus/registry.json). The target is
6
- * identified by alias / basename-derived name / remote-inferred name /
4
+ * Delete the `.gitnexus/` index directory for a registered repo (including
5
+ * both metadata filenames gitnexus.json and its legacy meta.json mirror
6
+ * which live inside it) and unregister it from the global registry
7
+ * (~/.gitnexus/registry.json).
8
+ *
9
+ * The target is identified by alias / basename-derived name / remote-inferred name /
7
10
  * absolute path — no `--repo` flag, just a positional argument so the
8
11
  * destructive-command ergonomics match `clean` (which is also
9
12
  * destructive but scoped to `process.cwd()`).
@@ -1,9 +1,12 @@
1
1
  /**
2
2
  * Remove Command (#664)
3
3
  *
4
- * Delete the `.gitnexus/` index for a registered repo and unregister it
5
- * from the global registry (~/.gitnexus/registry.json). The target is
6
- * identified by alias / basename-derived name / remote-inferred name /
4
+ * Delete the `.gitnexus/` index directory for a registered repo (including
5
+ * both metadata filenames gitnexus.json and its legacy meta.json mirror
6
+ * which live inside it) and unregister it from the global registry
7
+ * (~/.gitnexus/registry.json).
8
+ *
9
+ * The target is identified by alias / basename-derived name / remote-inferred name /
7
10
  * absolute path — no `--repo` flag, just a positional argument so the
8
11
  * destructive-command ergonomics match `clean` (which is also
9
12
  * destructive but scoped to `process.cwd()`).
@@ -110,7 +110,6 @@ export declare function queryBridge<T>(handle: BridgeHandle, cypher: string, par
110
110
  * is a lease release, so the file may stay open under other readers.
111
111
  */
112
112
  export declare function closeBridgeDb(handle: BridgeHandle): Promise<void>;
113
- export declare function retryRename(src: string, dst: string, attempts?: number): Promise<void>;
114
113
  export declare function writeBridgeMeta(groupDir: string, meta: BridgeMeta): Promise<void>;
115
114
  export declare function readBridgeMeta(groupDir: string): Promise<BridgeMeta>;
116
115
  export interface WriteBridgeInput {
@@ -6,6 +6,7 @@ import { BRIDGE_SCHEMA_QUERIES, BRIDGE_SCHEMA_VERSION } from './bridge-schema.js
6
6
  import { closeLbugConnection, openLbugConnection, } from '../lbug/lbug-config.js';
7
7
  import { dedupeContracts, dedupeCrossLinks } from './normalization.js';
8
8
  import { createLogger } from '../logger.js';
9
+ import { retryRename } from '../../storage/fs-atomic.js';
9
10
  const bridgeLogger = createLogger('bridge-db', {
10
11
  debugEnvVar: 'GITNEXUS_DEBUG_BRIDGE',
11
12
  });
@@ -512,24 +513,6 @@ export async function closeBridgeDb(handle) {
512
513
  // The read-only CHECKPOINT skip above remains the load-bearing fix on
513
514
  // Linux/macOS.
514
515
  /* ------------------------------------------------------------------ */
515
- /* retryRename — handles transient EBUSY/EPERM/EACCES on Windows */
516
- /* ------------------------------------------------------------------ */
517
- const RETRY_CODES = new Set(['EBUSY', 'EPERM', 'EACCES']);
518
- export async function retryRename(src, dst, attempts = 3) {
519
- for (let i = 1; i <= attempts; i++) {
520
- try {
521
- await fsp.rename(src, dst);
522
- return;
523
- }
524
- catch (err) {
525
- const code = err.code;
526
- if (!code || !RETRY_CODES.has(code) || i === attempts)
527
- throw err;
528
- await new Promise((r) => setTimeout(r, 100 * Math.pow(2, i - 1)));
529
- }
530
- }
531
- }
532
- /* ------------------------------------------------------------------ */
533
516
  /* writeBridgeMeta / readBridgeMeta */
534
517
  /* ------------------------------------------------------------------ */
535
518
  export async function writeBridgeMeta(groupDir, meta) {
@@ -5,6 +5,7 @@
5
5
  import fsp from 'node:fs/promises';
6
6
  import path from 'node:path';
7
7
  import { checkStaleness } from '../git-staleness.js';
8
+ import { loadMeta } from '../../storage/repo-manager.js';
8
9
  import { GroupNotFoundError, loadGroupConfig } from './config-parser.js';
9
10
  import { fileMatchesServicePrefix, normalizeServicePrefix, repoInSubgroup, } from './group-path-utils.js';
10
11
  import { getDefaultGitnexusDir, getGroupDir, listGroups, readContractRegistry } from './storage.js';
@@ -370,9 +371,7 @@ export class GroupService {
370
371
  for (const [repoPath, registryName] of Object.entries(config.repos)) {
371
372
  try {
372
373
  const repoObj = await this.port.resolveRepo(registryName);
373
- const metaPath = path.join(repoObj.storagePath, 'meta.json');
374
- const metaRaw = await fsp.readFile(metaPath, 'utf-8').catch(() => '{}');
375
- const meta = JSON.parse(metaRaw);
374
+ const meta = (await loadMeta(repoObj.storagePath)) ?? {};
376
375
  const staleness = meta.lastCommit
377
376
  ? checkStaleness(repoObj.repoPath, meta.lastCommit)
378
377
  : { isStale: true, commitsBehind: -1 };
@@ -3,7 +3,7 @@ import * as fsp from 'node:fs/promises';
3
3
  import * as path from 'node:path';
4
4
  import * as os from 'node:os';
5
5
  import { randomBytes } from 'node:crypto';
6
- import { retryRename } from './bridge-db.js';
6
+ import { retryRename } from '../../storage/fs-atomic.js';
7
7
  /**
8
8
  * Build an unpredictable suffix for atomic-write tmp files. Replaces the
9
9
  * previous `Date.now()` pattern which CodeQL flagged as
@@ -63,7 +63,20 @@ const isGraphWide = (label) => label === 'Community' || label === 'Process';
63
63
  // re-included from the FULL fresh graph (which the emit phase recomputes every
64
64
  // run) or an unchanged function's summary would be lost. Cheap: one self-loop
65
65
  // edge per return-flowing function.
66
- const isGraphWideRelType = (type) => type === 'TAINT_PATH' || type === 'CALL_SUMMARY';
66
+ //
67
+ // `INJECTS` (DI collection injection, #2200) is the same class as TAINT_PATH
68
+ // (the #2084 M4 U6 pattern above): its validity is a whole-program property —
69
+ // a change to a THIRD file (the interface itself, or a new/removed
70
+ // implementer) creates or invalidates edges between two files that were never
71
+ // touched, so the endpoint-writability rule would strand a stale
72
+ // consumer→implementer edge (or miss a new one). Always re-extracted from the
73
+ // fresh graph; the orchestrator unconditionally delete-alls the old rows
74
+ // first (`deleteAllInjects`). Crash-recovery: delete-then-COPY is not atomic
75
+ // by design — a crash between them loses INJECTS edges until the next
76
+ // analyze, and the `incrementalInProgress` dirty flag (saved before any
77
+ // delete) forces a full rebuild on the next run. Temporary absence is
78
+ // possible; duplicates are not.
79
+ const isGraphWideRelType = (type) => type === 'TAINT_PATH' || type === 'CALL_SUMMARY' || type === 'INJECTS';
67
80
  /**
68
81
  * Build a Map<nodeId, filePath> for every File-bound node in the graph.
69
82
  * Graph-wide nodes (Community/Process) have no filePath and are filtered.
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Per-language DI field-matcher registry — the lookup the generic `di`
3
+ * pipeline phase uses to decide whether a `Property` node is a
4
+ * dependency-injection fan-out candidate.
5
+ *
6
+ * Mirrors `scope-resolution/pipeline/registry.ts` (`SCOPE_RESOLVERS`): a
7
+ * single-valued `ReadonlyMap<SupportedLanguages, DiFieldMatcher>` consumed by
8
+ * a framework-neutral phase, so no language or framework names leak into
9
+ * shared pipeline code. Adding a framework is two lines: implement a
10
+ * `DiFieldMatcher` in `di-extractors/<framework>.ts` and register it here.
11
+ *
12
+ * Scope honesty: matchers are per-language *field-injection* matchers.
13
+ * Constructor injection (the dominant modern Spring idiom) lives on
14
+ * Method/parameter nodes and would require widening the phase's routing —
15
+ * deliberately out of scope (see the plan's Deferred work). The registry is
16
+ * single-valued per language, matching the `SCOPE_RESOLVERS` shape; widen the
17
+ * value type to arrays only when a second same-language framework actually
18
+ * lands (a one-line type change then).
19
+ */
20
+ import { SupportedLanguages } from '../../../_shared/index.js';
21
+ import type { GraphNode } from '../../../_shared/index.js';
22
+ /** A successful DI field match, produced by a per-language matcher. */
23
+ export interface DiFieldMatch {
24
+ /** The element type name `T` — the injected bean interface. */
25
+ elementTypeName: string;
26
+ /** Human-readable edge reason. Framework specifics (names, idioms,
27
+ * collection wrapper, gating annotation) live in this payload so the
28
+ * shared `di` phase stays framework-neutral. */
29
+ reason: string;
30
+ }
31
+ /**
32
+ * A per-language field-injection matcher: given a `Property` node, return the
33
+ * parsed DI match or `null` when the field is not container-injected. The
34
+ * matcher receives the whole node (not pre-plucked fields) so the shared
35
+ * phase stays ignorant of which properties matter.
36
+ */
37
+ export type DiFieldMatcher = (node: GraphNode) => DiFieldMatch | null;
38
+ /**
39
+ * Type guard narrowing an arbitrary graph `language` string to
40
+ * `SupportedLanguages`, so `DI_MATCHERS.get()` needs no cast.
41
+ */
42
+ export declare function isSupportedLanguage(value: string): value is SupportedLanguages;
43
+ /** Map of `SupportedLanguages` → `DiFieldMatcher`. The `di` phase routes each
44
+ * `Property` node here by `node.properties.language`; no entry ⇒ the node is
45
+ * skipped. This is the single source of truth for which languages (and,
46
+ * transitively, frameworks) produce INJECTS edges. */
47
+ export declare const DI_MATCHERS: ReadonlyMap<SupportedLanguages, DiFieldMatcher>;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Per-language DI field-matcher registry — the lookup the generic `di`
3
+ * pipeline phase uses to decide whether a `Property` node is a
4
+ * dependency-injection fan-out candidate.
5
+ *
6
+ * Mirrors `scope-resolution/pipeline/registry.ts` (`SCOPE_RESOLVERS`): a
7
+ * single-valued `ReadonlyMap<SupportedLanguages, DiFieldMatcher>` consumed by
8
+ * a framework-neutral phase, so no language or framework names leak into
9
+ * shared pipeline code. Adding a framework is two lines: implement a
10
+ * `DiFieldMatcher` in `di-extractors/<framework>.ts` and register it here.
11
+ *
12
+ * Scope honesty: matchers are per-language *field-injection* matchers.
13
+ * Constructor injection (the dominant modern Spring idiom) lives on
14
+ * Method/parameter nodes and would require widening the phase's routing —
15
+ * deliberately out of scope (see the plan's Deferred work). The registry is
16
+ * single-valued per language, matching the `SCOPE_RESOLVERS` shape; widen the
17
+ * value type to arrays only when a second same-language framework actually
18
+ * lands (a one-line type change then).
19
+ */
20
+ import { SupportedLanguages } from '../../../_shared/index.js';
21
+ import { springDiFieldMatcher } from './spring.js';
22
+ /** All `SupportedLanguages` string values, for narrowing raw graph strings. */
23
+ const SUPPORTED_LANGUAGE_VALUES = new Set(Object.values(SupportedLanguages));
24
+ /**
25
+ * Type guard narrowing an arbitrary graph `language` string to
26
+ * `SupportedLanguages`, so `DI_MATCHERS.get()` needs no cast.
27
+ */
28
+ export function isSupportedLanguage(value) {
29
+ return SUPPORTED_LANGUAGE_VALUES.has(value);
30
+ }
31
+ /** Map of `SupportedLanguages` → `DiFieldMatcher`. The `di` phase routes each
32
+ * `Property` node here by `node.properties.language`; no entry ⇒ the node is
33
+ * skipped. This is the single source of truth for which languages (and,
34
+ * transitively, frameworks) produce INJECTS edges. */
35
+ export const DI_MATCHERS = new Map([[SupportedLanguages.Java, springDiFieldMatcher]]);