This repository was archived by the owner on Nov 25, 2026. It is now read-only.
Repository navigation
feat: emit contract hashes as branded string literal types for future strict comparisons. - #111
Merged
Merged
Conversation
Contributor
WalkthroughEmission threads coreHash and profileHash into TargetFamilyHook.generateContractTypes; core/profile hash branding types added across contract types, factories, and emitter; SQL emitter generates branded CoreHash/ProfileHash and updated contract artifacts; tests and helpers updated to accept and propagate the new hashes. Changes
Sequence Diagram(s)sequenceDiagram
participant Emission as Emission Process
participant Hook as TargetFamilyHook
participant Emitter as SQL Emitter
participant FS as Filesystem
Emission->>Hook: compute coreHash & profileHash\ncall generateContractTypes(ir, codecImports, opImports, {coreHash, profileHash}, options)
Hook->>Emitter: forward IR + hashes + imports + options
Emitter->>Emitter: render TS surface using hashes\nemit branded CoreHash/ProfileHash types
Emitter->>FS: write `contract.d.ts` and `contract.json` (coreHash, foreignKeys)
Comment |
igalklebanov
force-pushed
the
emit-hashes
branch
from
January 12, 2026 10:18
05bd491 to
07aefe5
Compare
igalklebanov
marked this pull request as ready for review
January 12, 2026 11:19
igalklebanov
force-pushed
the
emit-hashes
branch
from
January 12, 2026 14:51
226d6d3 to
2873dc4
Compare
igalklebanov
force-pushed
the
emit-hashes
branch
from
January 13, 2026 13:26
dbee209 to
59d4429
Compare
igalklebanov
force-pushed
the
emit-hashes
branch
from
January 13, 2026 13:48
59d4429 to
696a886
Compare
igalklebanov
force-pushed
the
emit-hashes
branch
from
January 13, 2026 15:21
7a64fe0 to
8b59d49
Compare
igalklebanov
force-pushed
the
emit-hashes
branch
from
January 13, 2026 17:06
8b59d49 to
898b4f0
Compare
wmadden
approved these changes
Jan 15, 2026
wmadden
left a comment
Contributor
There was a problem hiding this comment.
Seems fine, doesn't have much effect on its own but I expect we'll see its value soon.
This was referenced Mar 8, 2026
This was referenced Apr 4, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Hey 👋
part of TML-1819.
This PR makes contract types emit to also include a branded string literal type for the contract hashes. This can be used with different refs to enforce same-contract inputs - type errors because of a mismatch would point the user to re-emit at the source of input.
Hashes as string literal types are a faster/simpler check in general.
Summary by CodeRabbit
New Features
Updates
Tests
✏️ Tip: You can customize this high-level summary in your review settings.