GitNexus/gitnexus/src
Garrett Griffin-Morales 91f680ec8e feat(languages/zig): resolve build.zig.zon package imports
Bare-name @import("pkg") calls in Zig refer to dependencies declared in
build.zig.zon. Previously these returned null and fell through to the
generic suffix matcher, which could only resolve them by accident.

This adds:
- A `loadZigBuildZon` config loader that parses build.zig.zon at the
  repo root and extracts `.path = "..."` dependency mappings into a
  per-run ZigBuildZonConfig.
- A regex-based parser (`parseZigBuildZon`) over the .zon source — a
  small anonymous-struct literal — rather than pulling in tree-sitter
  for one file. Limitations are documented inline; the parser handles
  the two common shapes (`.path` and `.url + .hash`) and bails to null
  on anything weirder.
- Resolver wiring in `resolveZigImportInternal` that, given a parsed
  ZigBuildZonConfig, tries the conventional Zig package layout
  (`<dep_root>/src/<name>.zig`, then `<dep_root>/src/main.zig`).

`.url`-based deps unpack into a build cache outside the repo
(.zig-cache/p/<hash>/) and so can't be resolved against repo-local
files; those bare names continue to return null cleanly. `.path` deps
that escape the repo root (`..`) are also rejected to avoid pointing
at files outside `allFilePaths`.

Tests:
- Unit coverage for `resolveZigImportInternal` (10 cases — relative
  paths, parent traversal, bare-name dep resolution with both
  `<name>.zig` and `main.zig` layouts, escape-the-repo rejection).
- Unit coverage for `parseZigBuildZon` (3 cases — mixed `.path`/`.url`
  block, missing deps block, deps with no `.path` entries).
- The pre-existing `csharpConfigs: []` test contexts gain a
  `zigBuildZon: null` field to match the widened `ImportConfigs`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 18:37:40 -04:00
..
cli feat(analyze): preserve existing embeddings by default; --force regenerates them; add --drop-embeddings opt-out (CLI + HTTP API) (#1055) 2026-04-24 13:07:40 +01:00
config feat(ingestion): GITNEXUS_INDEX_TEST_DIRS opt-in for __tests__ / __mocks__ (#771) (#1046) 2026-04-23 13:49:06 +01:00
core feat(languages/zig): resolve build.zig.zon package imports 2026-04-26 18:37:40 -04:00
lib feat: configure prettier with pre-commit hook (#563) 2026-03-28 14:58:04 +00:00
mcp feat(cli): Fingerprint indexed repos by remote URL to detect sibling-clone graph drift (#982) 2026-04-21 21:58:54 +01:00
server feat(analyze): preserve existing embeddings by default; --force regenerates them; add --drop-embeddings opt-out (CLI + HTTP API) (#1055) 2026-04-24 13:07:40 +01:00
storage feat(cli): Fingerprint indexed repos by remote URL to detect sibling-clone graph drift (#982) 2026-04-21 21:58:54 +01:00
types feat(ingestion): language-agnostic heritage extractor with config+factory pattern (#890) 2026-04-17 17:51:17 +01:00