GitNexus/gitnexus/src/core
Navid EMAD bb51ca342c
fix(zig): type locals through try/catch/orelse, return types and payload captures
F6 of the gitnexus-check review. Three gaps in the value flow that types a
local receiver, all measured on Lightpanda:

1. `@type-binding.call-return` needed the `call_expression` as the DIRECT
   value child, so `const p = try Page.init(…)` (2,551 sites), `… catch
   return` (410) and `… orelse return` typed nothing. The rule is now one
   keyword-gated declaration match; `emitZigScopeCaptures` unwraps `try`,
   `catch`, `orelse` and parentheses (`zigUnwrapValue`) and decides what the
   value types (`zigCallReturnTypeOf`): a module-level receiver still names
   the type (`Counter.init()` → Counter, Rust `Foo::new()`); a free call
   binds the callee name (`makeThing`); a member call on a fn-LOCAL receiver
   (parameter / local / payload — Zig forbids shadowing, so "declared in the
   fn" is exact) binds the compound `node.asElement()` the shared resolver
   walks to the method's return type — instead of typing `el` as `Node`. A
   TitleCase callee (`List(u8)`) is a type constructor and binds nothing.

2. No `@type-binding.return` existed. `fn make() !*Thing` now binds
   `make ↦ Thing` in the enclosing scope (Module for free fns, the container's
   Class scope for methods, where the compound resolver reads it). Builtins,
   `type`, `@TypeOf(…)` and comptime type parameters (`?*T`) bind nothing;
   `@This()` / `Self` returns name the container. `normalizeZigTypeName` now
   strips the error union BEFORE the payload's sigils, so
   `Allocator.Error!*Page` → `Page` (it used to leave `*Page`).

3. Payload captures had no binding at all. `populateZigRangeBindings`
   (registered as `populateRangeBindings`) types `for (items) |it| / |*it|`,
   `for (items, 0..) |it, i|`, `if (opt) |v|`, `if (call()) |v|`,
   `while (it.next()) |x|` from the SUBJECT's written type minus one layer
   (`[]T` element, `?T` payload) — declining when the layer is not visible
   (`ArrayList(T)`) — and the same projection for `const t = items[i]` /
   `opt.?` / `ptr.*`. `catch |err|` and `switch` prongs are skipped.

Corpus (Lightpanda, gate before → after): CALLS 15838 → 17853;
`ident.m() bound=local-try/catch/orelse` 11/1298 → 584/1298;
`local-call` 159/1282 → 398/1282; `payload` 82/1085 → 233/1085;
`other-recv:call_expression` 5/991 → 457/991; `local-other` 271 → 364;
`self.m()` 100 %, `free f()` 97.5 %, `ns.f()` 83.4 % unchanged; nothing down.

Not covered: `const t = ns.f()` (a namespace fn's return type across files —
Case 3 has no path from a namespace head to a callable's return binding),
and expression receivers (`items[i].run()`, `o.?.run()`).
2026-08-24 19:56:16 +02:00
..
augmentation fix(mcp): make impact/context reproducible — deterministic ordering on every capped query (#2787) (#2796) 2026-08-02 17:03:15 +00:00
embeddings fix(mcp): stop scaling the detect_changes query with the diff's hunk count (#2915) (#2930) 2026-08-12 14:51:17 +01:00
graph fix(check): stop reporting erased and deferred imports as initialization cycles (#2934) 2026-08-12 17:09:32 +00:00
group feat(routes): support JS data route tables (#2972) 2026-08-18 04:39:45 +01:00
incremental feat(spring): model AOP transactions, caching, and security (#2783) 2026-08-01 17:22:12 +01:00
ingestion fix(zig): type locals through try/catch/orelse, return types and payload captures 2026-08-24 19:56:16 +02:00
lbug fix(zig): declare the Union relation pairs — analyze aborted on any union 2026-08-24 19:56:14 +02:00
platform fix(analyze): load VECTOR before the incremental writeback touches embedding rows (#2623) (#2624) 2026-07-22 12:27:00 +01:00
search fix(fts): keep binary payloads out of the description column, confine an unbuildable index to its own table (#2919) 2026-08-10 21:16:11 +01:00
tree-sitter fix(zig): address gitnexus-check review findings 2026-08-24 19:56:13 +02:00
wiki fix(mcp): stop scaling the detect_changes query with the diff's hunk count (#2915) (#2930) 2026-08-12 14:51:17 +01:00
analysis-features.ts feat(spring): build bean candidate inventory (#2494) 2026-07-20 09:28:23 +01:00
analyzer-identity.ts fix(analyze): replace the hand-incremented schema version with a derived DDL fingerprint (#2798) (#2808) 2026-08-03 15:04:30 +01:00
embedding-checkpoint.ts fix(embeddings): retry unparseable 200 responses and survive partial embedding failures (#2790) (#2795) 2026-08-02 20:43:59 +00:00
embedding-count.ts fix(embeddings): retry unparseable 200 responses and survive partial embedding failures (#2790) (#2795) 2026-08-02 20:43:59 +00:00
embedding-mode.ts feat: add optional limit arg to --embeddings flag (closes #382) (#1375) 2026-05-06 16:31:28 +01:00
git-staleness.ts fix(core): ensure path prefix and traversal guards support root directories (#2559) 2026-07-20 08:12:15 +01:00
index-freshness.ts fix: close the nine follow-up review findings from #2856 (routes, receiver typing, truncation honesty) (#2899) 2026-08-09 11:44:52 +01:00
logger.ts fix(mcp): tolerate adapter-materialized line:0 in impact callgraph mode (#2279) (#2283) 2026-06-23 20:35:49 +01:00
run-analyze.ts feat(spring): detect non-HTTP handler entry points (#2891) 2026-08-16 15:16:21 +01:00