Gradia Research · Code Transplant · Open source
Reuse the feature.
Bring its evidence.
Move working functionality into a different program. Inspect what it depends on, adapt the boundary, and check where its behavior holds.
TypeScript parsers · explicit interfaces · local execution
01 · Extraction
The function is only the beginning.
A parser carries helper functions, constants, runtime behavior, and a license. The TypeScript compiler’s symbol graph identifies the local declarations that travel with the entry point. The capsule records its source and dependency boundary so a reviewer can see what moved.
Donor
A mature implementation
parseISO(string)
Helpers and constants are selected from the source graph.
Dependency capsule
Code with a boundary
- Selected declarations
- Source and content hashes
- License and dependency record
Receiving application
A different interface
event → parsed timestamp
An explicit adapter connects parser behavior to ingestion.
02 · Verification
Compare the behavior that matters.
The original parser is the comparison target. The receiver must preserve its valid and invalid outcomes across a declared corpus and three timezones. Deliberately broken offset and invalid-value variants test whether the comparison can detect a bad transplant.
Recorded demonstration · frozen evidence
Inspect the full report ↗Supplied timestamp · iso-0045
"2014-02-11T11:30+0545"✓ Same observed outcome
Scroll the comparison sideways to inspect each outcome.
| Implementation | Observed result | Compared with original |
|---|---|---|
| Original donor | 2014-02-11T05:45:00.000Z 1392097500000 ms Local: [2014,2,11,5,45,0,0] Receiver accepts event | Comparison target |
| Transplanted receiver | 2014-02-11T05:45:00.000Z 1392097500000 ms Local: [2014,2,11,5,45,0,0] Receiver accepts event | Matches |
| Offset sign reversedDeliberate control | 2014-02-11T17:15:00.000Z 1392138900000 ms Local: [2014,2,11,17,15,0,0] Receiver accepts event | Mismatch detected |
| Invalid date replaced with epochDeliberate control | 2014-02-11T05:45:00.000Z 1392097500000 ms Local: [2014,2,11,5,45,0,0] Receiver accepts event | Matches this case |
The explicit +05:45 offset fixes the instant across all three timezones. Local calendar components still depend on the process timezone. Reversing the offset sign changes the recorded instant and is detected.
The full run compared 695 cases in 3 timezones: 2,085 comparisons, 0 disagreements. Offset-sign corruption produced 558 mismatches; invalid-date collapse produced 840. This view shows three selected cases.
Local components: [year, month, day, hour, minute, second, millisecond]. The full report also binds the receiver’s event payload.
Donor revision: 313b902b9a72c64501074db9bc2b9897d2db5140
Report digest: e2f900b89ba7d0c7a4155da14de8f92bcb5b04efdce1851bd3d65f764d179010
Recorded: October 6, 2026 at 10:37 PM America/New_York. Selecting a case changes the view of retained evidence; it does not execute code.
03 · Try it
Run it where your code lives.
The first demonstration extracts the pinned donor feature, builds the receiving application, and records the comparison. Inspect the generated capsule and report before using the feature in your own project.
The website displays an explanation and retained evidence. The local CLI executes the demonstration; no source upload or hosted execution is required.
Terminal · Node.js 22 or newer
git clone https://github.com/rudycelekli/code-transplant.git
cd code-transplant
npm ci
npm run demoRead the contract and reproduction guide ↗04 · Scope
A useful proof has a limit.
This first version targets TypeScript parsers with explicit interfaces. Matching observed outcomes supports the declared transplant on the tested corpus and environments. It does not establish equivalence for every input, infer arbitrary architecture, or qualify an application for production.
The demonstrated interface accepts strings and optional additional-digit settings, and returns ordinary JavaScript Date values. Custom date subclasses and context factories are outside this contract. Verification executes trusted donor and receiver code in local subprocesses; those processes are not security sandboxes.
- When it helps
- Moving a proven parser across applications, retiring an oversized dependency, or reviewing the behavior affected by an adapter.
- What to review
- The extraction manifest, donor license, ambient runtime assumptions, interface mapping, comparison corpus, and control failures.
- Next contribution
- Add an independent donor and receiver, expose an architectural assumption the current boundary misses, or contribute a meaningful failing case.