Skip to content

refactor(ingestion): share a codec for __heritage__/__property__ markers (Ruby + Dart) (#1994)#2001

Closed
magyargergo wants to merge 2 commits into
abhigyanpatwari:mainfrom
magyargergo:fix/1994-shared-marker-codec
Closed

refactor(ingestion): share a codec for __heritage__/__property__ markers (Ruby + Dart) (#1994)#2001
magyargergo wants to merge 2 commits into
abhigyanpatwari:mainfrom
magyargergo:fix/1994-shared-marker-codec

Conversation

@magyargergo

Copy link
Copy Markdown
Collaborator

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:

Routed through it:

  • Ruby — construct (captures.ts), parse (scope-resolver.ts), and the duplicated guard literals in interpret.ts + import-target.ts.
  • Dart — construct (captures.ts) + parse (scope-resolver.ts). Dart already single-sources its prefix and is heritage-only, so its import-target guard is left untouched (no invented __property__ path).

Language-neutral: the codec keys only on the literal shared prefixes — no provider branching.

Verification

  • New codec unit test: round-trip, colon-throw, prefix bytes, isHeritageMarker parity (5 cases).
  • ruby resolver suite + ruby-captures-golden: registry-primary 155/155 with the golden unchanged (zero diff) — proving the ':' wire format is byte-identical; legacy green.
  • dart resolver suite: registry-primary 63/63; legacy green.
  • tsc --noEmit clean; prettier clean.

No new graph edges or behavior — pure refactor.

Closes #1994.

🤖 Generated with Claude Code

…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>
@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

@magyargergo is attempting to deploy a commit to the NexusCore Team on Vercel.

A member of the Team first needs to authorize it.

@magyargergo

Copy link
Copy Markdown
Collaborator Author

Superseded by same-repo stacked PR #2007.

@magyargergo magyargergo closed this Jun 3, 2026
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

CI Report

All checks passed

Pipeline Status

Stage Status Details
✅ Typecheck success tsc --noEmit
✅ Tests success unit tests, 3 platforms
✅ E2E success gitnexus-web changes only

Test Results

Tests Passed Failed Skipped Duration
11061 11045 0 16 679s

✅ All 11045 tests passed

16 test(s) skipped — expand for details
  • COBOL pipeline benchmark > scales with file count
  • C++ ADL emit benchmark > emit phase scales sub-quadratically with co-scaled files and sites
  • C++ pipeline benchmark > scales with file count
  • C# pipeline benchmark > scales with file count — namespaces spread across the solution
  • C# pipeline benchmark > scales with file count — all types in one (global) namespace bucket
  • C# pipeline benchmark > scales with file count — all types in one (named) namespace bucket
  • Go pipeline benchmark > scales with file count (workers enabled)
  • Go pipeline benchmark — worker pool (issue Worker idle timeout kills long Go scope extraction and surfaces as Napi::Error during analyze #1848) > does not quarantine the large generated Go file on sub-batch idle timeout
  • Go structural interface detection benchmark > scales linearly with interface × struct count
  • Go structural interface detection split-phase benchmark > separates index-build and detection time
  • PHP pipeline benchmark > scales with file count (workers enabled)
  • Ruby pipeline benchmark > scales with file count (workers enabled)
  • Rust pipeline benchmark > scales with file count (workers enabled)
  • Vue pipeline benchmark > scales with component count
  • run.cjs direct-exec entrypoint (fix(cli): steer docs, skills, and hooks through a CLI-neutral project-local runner (#1939) #1945) > resolves a .cmd shim via the Windows shell branch, passing args and exit code
  • buildTypeEnv > known limitations (documented skip tests) > Ruby block parameter: users.each { |user| } — closure param inference, different feature

Code Coverage

Tests

Metric Coverage Covered Base Delta Status
Statements 80.32% 38709/48188 79.84% 📈 +0.5 🟢 ████████████████░░░░
Branches 68.86% 24588/35704 68.5% 📈 +0.4 🟢 █████████████░░░░░░░
Functions 85.56% 4036/4717 84.94% 📈 +0.6 🟢 █████████████████░░░
Lines 83.94% 34825/41486 83.36% 📈 +0.6 🟢 ████████████████░░░░

📋 View full run · Generated by CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(ingestion): share an encode/decode pair for __heritage__/__property__ synthetic-import markers (Ruby + Dart)

1 participant