refactor(ingestion): share a codec for __heritage__/__property__ markers (Ruby + Dart) (#1994)#2007
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Tri-review — approve-with-nitsMethod: per-PR multi-lens review → independent adversarial re-verification → static-analysis alignment (tsc/eslint/prettier, all clean) → cross-stack synthesis + critic gate. Review: PR #2007 — shared
|
ac40fb6 to
e94822c
Compare
c3922bd to
ae0464c
Compare
…dec (#1994) Alias DART_HERITAGE_PREFIX to HERITAGE_MARKER_PREFIX (utils/heritage-marker.ts) instead of re-declaring the '__heritage__:' literal, so the Dart import-target heritage guard cannot desync from the codec's encode/decode. Value-identical; gives the codec prefix a direct production consumer. Addresses the tri-review nit on PR #2007. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Nit applied + one judgment call (review follow-up)Single-sourced the Dart wire prefix ( Docstring-neutrality nit — left as-is by best judgment. The codec docstring already asserts "Language-NEUTRAL — keyed only on the literal prefixes; no provider branching belongs here", and the Ruby/Dart mention is descriptive (who consumes it), not a logic-level coupling. The AGENTS.md boundary targets language branching in shared logic — the codec has none — so the consumer names are legitimate documentation. Rewording would lose useful "who uses this" context for no boundary benefit. |
e94822c to
939c7ae
Compare
…ers (Ruby + Dart) (#1994) The Ruby and Dart heritage/property pipelines encoded side-effect facts as ':'-delimited synthetic-import marker strings, hand-constructed and hand-parsed at ~8 sites with the field layout kept in agreement only by a comment — the fragility behind the #1981 edge-drop. Route every site through a single shared codec (utils/heritage-marker.ts: encodeMarker / decodeMarker / isHeritageMarker). encodeMarker throws on a colon-bearing field so the silent-drop class becomes a loud failure; the ':' wire format is preserved byte-for-byte (ruby-captures-golden unchanged). Language-neutral — keyed only on the literal shared prefixes. Dart already single-sources its prefix and is heritage-only, so its import-target guard is left untouched (no invented __property__ path). Pure refactor: no new edges or behavior. Verified: new codec unit test; ruby resolver + golden 155/155 (zero golden diff) and dart resolver 63/63 on registry-primary, both green on legacy; tsc + prettier clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…dec (#1994) Alias DART_HERITAGE_PREFIX to HERITAGE_MARKER_PREFIX (utils/heritage-marker.ts) instead of re-declaring the '__heritage__:' literal, so the Dart import-target heritage guard cannot desync from the codec's encode/decode. Value-identical; gives the codec prefix a direct production consumer. Addresses the tri-review nit on PR #2007. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
f2582ec to
6ec1ef3
Compare
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 10578 tests passed 16 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
Summary
Maintainability follow-up to #1978 / #1982. The Ruby (and, independently, Dart) heritage/property pipeline encoded side-effect facts as
':'-delimited synthetic-import marker strings, constructed and parsed by hand at ~8 sites with the field layout kept in agreement only by a comment — the structural fragility that produced the #1981 edge-drop. This routes every site through a single shared codec with no behavioral change (the':'wire format is preserved byte-for-byte).What changed
New
gitnexus/src/core/ingestion/utils/heritage-marker.ts:encodeMarker(kind, fields)— builds<prefix><field>:<field>:...; throws on a colon-bearing field (the delimiter is reserved), turning the fix(ingestion): fully-qualified nested-type identity for C++/Ruby — structure (#1978) + resolution (#1982) #1981 silent drop into a loud failure.decodeMarker(raw)— parses back to{ kind, fields }ornull.isHeritageMarker(raw)— exactly the priorstartsWith('__heritage__:') || startsWith('__property__:')pair.Routed through it:
captures.ts), parse (scope-resolver.ts), and the duplicated guard literals ininterpret.ts+import-target.ts.captures.ts) + parse (scope-resolver.ts). Dart already single-sources its prefix and is heritage-only, so itsimport-targetguard is left untouched (no invented__property__path).Language-neutral: the codec keys only on the literal shared prefixes — no provider branching.
Verification
isHeritageMarkerparity (5 cases).rubyresolver suite +ruby-captures-golden: registry-primary 155/155 with the golden unchanged (zero diff) — proving the':'wire format is byte-identical; legacy green.dartresolver suite: registry-primary 63/63; legacy green.tsc --noEmitclean; prettier clean.No new graph edges or behavior — pure refactor.
Closes #1994.
🤖 Generated with Claude Code