refactor(ingestion): share a codec for __heritage__/__property__ markers (Ruby + Dart) (#1994)#2001
Closed
magyargergo wants to merge 2 commits into
Closed
Conversation
…ers (Ruby + Dart) (abhigyanpatwari#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 abhigyanpatwari#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>
|
@magyargergo is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
Author
|
Superseded by same-repo stacked PR #2007. |
Contributor
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 11045 tests passed 16 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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