feat: manifest batch mode and foundational codegen types#4
Merged
Conversation
added 5 commits
March 3, 2026 13:02
- Add manifest.rs with Manifest/ProgramEntry structs and validation - Add manifests/programs.json with all 5 programs - Add --manifest CLI flag for batch mode alongside single-program mode - Extract write_generated_crate helper for reuse across modes - Add decoder and deref_impls fields to GeneratedCode struct - Add DecodeError, LoggableEvent, DecoderTrait generation functions - Add manifest integration tests
- generate_decoder() produces decoder.rs with DecodeError and decode_event() - generate_deref_impls() produces Deref on all *Event wrapper types - generate() now populates decoder and deref_impls fields - FR-006: duplicate discriminator detection with clear error messages - FR-002: program_id() and ID_STR constants in generated code - lib.rs auto-declares pub mod decoder when events have discriminators - 9 decoder tests + 128 unit tests all passing - All 5 program crates compile with generated decoder.rs
- New registry.rs module for generating solana_registry crate - collect_program_event_info() gathers event metadata during first pass - generate_registry_crate() produces complete crate structure: - event_data.rs: unified EventData enum (52 variants, program-prefixed) - registry.rs: decode(program_id, data) dispatch to per-program decoders - traits.rs: LoggableEvent trait definition - Cargo.toml with dependencies on all per-program crates - Second pass in run_manifest_mode() generates registry after all programs - EventData uses #[serde(tag = "type", content = "data")] for compatibility - Unknown program IDs return empty results (FR-014)
- Generate LoggableEvent impl on EventData in registry event_data.rs - Add log dependency to generated registry Cargo.toml - Fix: remove useless .try_into() for array pubkey conversions
- Add workspace.rs module for programmatic Cargo.toml manipulation - Integrate wire_workspace into manifest batch mode (run_manifest_mode) - Add workspace_cargo_toml and downstream_cargo_tomls to Manifest struct - Update programs.json with workspace wiring configuration - Fix clippy warnings (unnecessary cast, iter_cloned_collect) - Add pathdiff dependency for relative path computation
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
Manifest/ProgramEntrystructs, load/validate functionsmanifests/programs.jsonwith all 5 programs (pumpfun, pumpfun_amm, raydium_amm, raydium_clmm, raydium_cpmm)--manifestCLI flag for batch mode alongside existing single-program modewrite_generated_cratehelper for reuse across both modesdecoderandderef_implsfields toGeneratedCodestructDecodeError,LoggableEvent,DecoderTraitgeneration functionsContext
Part of pandora spec 011 — zero-code deploy IDL codegen pipeline automation. This enables
cargo run -- --manifest manifests/programs.jsonto generate all program crates in one invocation.Test plan
cargo checkpassescargo test --test manifest_tests— 5 integration tests passcargo test manifest— all inline unit tests passcargo run -- --manifest manifests/programs.json— generates all 5 programs successfullycargo run -- --help— shows both single-program and manifest modes--manifestand--inputcannot be used together