feat(cosmic-proto): inline generated codec annotations#12650
Conversation
e9517a4 to
d8a8da9
Compare
Add explicit public type annotations for orchestration codec helpers so declaration emit does not expand private cosmic-proto annotation types through inferred exports. Also assert the homogeneous undelegate response vow type at the watcher boundary, where executeTxProto3 cannot infer a tuple response type from a mapped runtime array. Co-authored-by: Codex <codex@openai.com>
Add explicit public type annotations for orchestration codec helpers so declaration emit does not expand private cosmic-proto annotation types through inferred exports. Also assert the homogeneous undelegate response vow type at the watcher boundary, where executeTxProto3 cannot infer a tuple response type from a mapped runtime array. Co-authored-by: Codex <codex@openai.com>
624b1af to
bdedd7b
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates packages/cosmic-proto so gogoproto field-annotation metadata is emitted inline on the specific generated codec exports that need it (rather than maintained as a package-wide runtime table), and updates codec helper logic to discover annotations by walking the codec graph reachable from a root codec. Downstream orchestration code and tests are updated to use/validate the new behavior.
Changes:
- Generate per-codec
annotationsmetadata on exported codecs and add minimal imports needed to resolve annotated child field types. - Replace package-wide default annotation lookup with recursive annotation discovery seeded from a root codec (
Codec/CodecHelper). - Update orchestration Any typing and add a regression test for generated gogoproto placeholder behavior.
Reviewed changes
Copilot reviewed 122 out of 123 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/orchestration/src/utils/codecs.js | Tightens Any.toJSON() typing via exported AnyJson/Proto3CodecHelper types. |
| packages/orchestration/src/exos/cosmos-orchestration-account.js | Refactors undelegate tx execution to type the vow of decoded responses explicitly. |
| packages/cosmic-proto/test/helpers.test.js | Adds coverage asserting generated inline gogoproto annotations produce expected placeholder structure. |
| packages/cosmic-proto/src/type-url-annotations.ts | Introduces codec-attached annotation types and recursive annotation collection utilities. |
| packages/cosmic-proto/src/codec-helpers.ts | Seeds gogoproto transforms from the root codec’s reachable inline annotations instead of a global table. |
| packages/cosmic-proto/src/codegen/tendermint/types/validator.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/tendermint/types/types.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/tendermint/types/params.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/tendermint/types/evidence.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/tendermint/types/block.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/tendermint/p2p/types.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/tendermint/abci/types.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/staketia/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/staketia/staketia.ts | Generated: adds inline annotations for selected fields. |
| packages/cosmic-proto/src/codegen/stride/staketia/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/stakeibc/validator.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/stride/stakeibc/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/stakeibc/trade_route.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/stakeibc/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/stakeibc/host_zone.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/stride/stakeibc/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/stakeibc/callbacks.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/stakeibc/address_unbonding.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/stride/stakedym/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/stakedym/stakedym.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/stride/stakedym/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/records/records.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/records/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/records/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/epochs/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/stride/epochs/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/noble/swap/v1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/noble/swap/v1/swap.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/noble/dollar/vaults/v1/vaults.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/noble/dollar/vaults/v1/tx.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/icq/v1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/icq/v1/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/lightclients/wasm/v1/wasm.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/lightclients/tendermint/v1/tendermint.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/lightclients/localhost/v2/localhost.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/lightclients/localhost/v1/localhost.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/connection/v1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/connection/v1/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/connection/v1/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/connection/v1/connection.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/client/v2/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/client/v2/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/client/v1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/client/v1/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/client/v1/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/client/v1/client.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/channel/v2/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/channel/v2/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/channel/v1/upgrade.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/channel/v1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/channel/v1/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/core/channel/v1/channel.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/applications/transfer/v1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/applications/transfer/v1/token.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/applications/transfer/v1/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/applications/transfer/v1/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/applications/interchain_accounts/v1/account.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/applications/interchain_accounts/host/v1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/applications/interchain_accounts/genesis/v1/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/ibc/applications/interchain_accounts/controller/v1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/vesting/v1beta1/vesting.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/upgrade.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/upgrade/v1beta1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/tx/v1beta1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/store/v1beta1/commit_info.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/store/snapshots/v1/snapshot.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/staking.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/staking/v1beta1/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/protocolpool/v1/types.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/cosmos/protocolpool/v1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/protocolpool/v1/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/protocolpool/v1/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/params/v1beta1/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/query.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/mint.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/mint/v1beta1/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/group/v1/types.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/group/v1/query.ts | Generated: adds inline annotations for selected response fields. |
| packages/cosmic-proto/src/codegen/cosmos/group/module/v1/module.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/query.ts | Generated: adds inline annotations for query response message fields. |
| packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/gov.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/gov/v1beta1/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/gov/v1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/epochs/v1beta1/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/tx.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/query.ts | Generated: adds inline annotations for query response message fields. |
| packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/cosmos/distribution/v1beta1/distribution.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/cosmos/base/v1beta1/coin.ts | Generated: adds inline annotations for scalar handling (cosmos.Int/cosmos.Dec). |
| packages/cosmic-proto/src/codegen/cosmos/base/abci/v1beta1/abci.ts | Generated: adds inline annotations for embedded/non-nullable fields. |
| packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/tx.ts | Generated: adds inline annotations for params message field. |
| packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/query.ts | Generated: adds inline annotations for response message fields. |
| packages/cosmic-proto/src/codegen/cosmos/bank/v1beta1/genesis.ts | Generated: adds inline annotations for params message field. |
| packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/tx.ts | Generated: adds inline annotations for grant message field. |
| packages/cosmic-proto/src/codegen/cosmos/authz/v1beta1/authz.ts | Generated: adds inline annotations for timestamp field handling. |
| packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/tx.ts | Generated: adds inline annotations for params message field. |
| packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/query.ts | Generated: adds inline annotations for params message field. |
| packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/genesis.ts | Generated: adds inline annotations for params message field. |
| packages/cosmic-proto/src/codegen/cosmos/auth/v1beta1/auth.ts | Generated: adds inline annotations for embedded base account field. |
| packages/cosmic-proto/src/codegen/circle/cctp/v1/tx.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/circle/cctp/v1/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/circle/cctp/v1/per_message_burn_limit.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/circle/cctp/v1/events.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/circle/cctp/v1/burn_message.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/agoric/vibc/msgs.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/agoric/vbank/vbank.ts | Generated: adds inline annotations for scalar/nullability fields. |
| packages/cosmic-proto/src/codegen/agoric/vbank/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/agoric/vbank/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/agoric/swingset/swingset.ts | Generated: adds inline annotations for selected non-nullable fields. |
| packages/cosmic-proto/src/codegen/agoric/swingset/query.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| packages/cosmic-proto/src/codegen/agoric/swingset/genesis.ts | Generated: adds inline annotations and annotation-driven child codec references/imports. |
| golang/cosmos/x/swingset/types/msgs.pb.go | Go codegen: import ordering cleanup (no functional change). |
| const codecAnnotationsFromTypeUrl = annotationsFromTypeUrlForCodec( | ||
| codec, | ||
| annotationsFromTypeUrl, | ||
| ); | ||
| const cdc = Codec(codec, codecAnnotationsFromTypeUrl); | ||
| const { strippedFromDecoderOutput, packedFromGogo3 } = | ||
| makeGogo3Transformations(cdc, annotationsFromTypeUrl); | ||
| makeGogo3Transformations(cdc, codecAnnotationsFromTypeUrl); |
| import type { FieldAnnotationsRecord } from '../../../type-url-annotations.js'; | ||
| import { PublicKey as __annotationCodec_2ftendermint_2ecrypto_2ePublicKey } from '../crypto/keys.js'; | ||
| import { PublicKey, type PublicKeySDKType } from '../crypto/keys.js'; |
gibson042
left a comment
There was a problem hiding this comment.
This kind of metaprogramming is so hard to review, but I tried to be thorough and it looks good AFAICT.
| const importIdentifierFromTypeUrl = typeUrl => | ||
| `__annotationCodec${[...typeUrl] | ||
| .map(char => | ||
| /[A-Za-z0-9_$]/.test(char) ? char : `_${char.charCodeAt(0).toString(16)}`, | ||
| ) | ||
| .join('')}`; |
There was a problem hiding this comment.
I have a pet peeve about failing to escape an escaping prefix.
| const importIdentifierFromTypeUrl = typeUrl => | |
| `__annotationCodec${[...typeUrl] | |
| .map(char => | |
| /[A-Za-z0-9_$]/.test(char) ? char : `_${char.charCodeAt(0).toString(16)}`, | |
| ) | |
| .join('')}`; | |
| const importIdentifierFromTypeUrl = typeUrl => | |
| `__annotationCodec${[...typeUrl] | |
| .map(char => | |
| /[A-Za-z0-9$]/.test(char) ? char : `_${char.charCodeAt(0).toString(16)}`, | |
| ) | |
| .join('')}`; |
or
| const importIdentifierFromTypeUrl = typeUrl => | |
| `__annotationCodec${[...typeUrl] | |
| .map(char => | |
| /[A-Za-z0-9_$]/.test(char) ? char : `_${char.charCodeAt(0).toString(16)}`, | |
| ) | |
| .join('')}`; | |
| const importIdentifierFromTypeUrl = typeUrl => | |
| `__annotationCodec${[...typeUrl] | |
| .map(char => | |
| /[A-Za-z0-9_]/.test(char) ? char : `$${char.charCodeAt(0).toString(16)}`, | |
| ) | |
| .join('')}`; |
Generate annotation metadata directly onto each codec export instead of writing a package-wide typeUrlAnnotations module. Child message annotations now reference the necessary codec imports directly, allowing Codec and CodecHelper to discover nested annotations from the root codec without a runtime type-url registry. Remove the defaultAnnotationsFromTypeUrl special case and make recursive annotation discovery follow codec-provided field references. Add coverage for generated gogoproto annotations so default child placeholders still work from the codec graph. Co-authored-by: Codex <codex@openai.com>
Add explicit public type annotations for orchestration codec helpers so declaration emit does not expand private cosmic-proto annotation types through inferred exports. Also assert the homogeneous undelegate response vow type at the watcher boundary, where executeTxProto3 cannot infer a tuple response type from a mapped runtime array. Co-authored-by: Codex <codex@openai.com>
Keep the explicit exported Any helper annotation narrow enough for declaration emit while replacing only the generic toJSON signature. This avoids widening Any.toJSON results to MessageBody<unknown> during the root typecheck. Co-authored-by: Codex <codex@openai.com>
Avoid walking the inline annotation codec graph twice when constructing CodecHelper by sharing the collected annotation map with the Codec wrapper. Reuse existing runtime codec imports when generating annotation child references, which removes annotation-only alias imports from the generated codec modules. Co-authored-by: Codex <codex@openai.com>
Escape underscores when deriving annotation codec import aliases from type URLs so literal underscores cannot collide with the _hex escape prefix. Co-authored-by: Codex <codex@openai.com>
3dad73a to
3630728
Compare
refs: AGO-524
Linear: https://linear.app/agoric/issue/AGO-524/avoid-package-wide-runtime-annotation-data-in-cosmic-proto-codecs
Description
This PR changes
packages/cosmic-protoannotation generation so gogoproto metadata is partitioned onto the generated codec exports that need it, instead of being emitted as package-wide runtime annotation data.The main review points are:
packages/cosmic-proto/scripts/codegen.cjsnow extracts field annotations and injectsannotationsmembers into generated codec exports.packages/cosmic-proto/src/type-url-annotations.tsrecursively discovers nested annotations by walking codec-provided field references.packages/cosmic-proto/src/codec-helpers.tsseeds annotation lookup from the root codec instead of relying ondefaultAnnotationsFromTypeUrl.packages/cosmic-proto/test/helpers.test.jscovers generated gogoproto annotations for default child placeholders.Security Considerations
This does not introduce new authority, networking, filesystem access, or trust boundaries. The change is limited to generated codec metadata and local codec-helper transformation behavior.
Scaling Considerations
This is specifically intended to improve bundle scaling for consumers whose bundler does not tree-shake. Instead of a package-wide annotation table or runtime type-url registry, each generated module imports only the child codecs needed to satisfy annotations reachable from that module's codecs.
The generated source size increases because annotations are emitted inline, but the runtime data imported by a consumer is now scoped to the codec graph they actually import.
Documentation Considerations
No user-facing protocol or application behavior changes. Downstream users do not need an upgrade step; generated codec exports now include an
annotationsmember used byCodecandCodecHelper.Testing Considerations
Verified locally in
packages/cosmic-proto:node scripts/codegen.cjsyarn buildyarn testyarn run -T tsc --noEmit --incrementalyarn lintyarn lint:formatgit diff --checkyarn lintexits successfully with existing warnings in the package tests/tools, andyarn lint:formatexits successfully while reporting that dprint cannot write its cache under~/Libraryin this sandbox.Upgrade Considerations
No chain upgrade or state migration is required. To verify inclusion in a release, inspect generated codec exports for inline
annotationsmembers and confirmCodecHelperbehavior for non-nullable child fields, especiallyMsgTransfer/Coinand generated swingset query params.Co-authored-by: Codex codex@openai.com