Skip to content

feat: manifest batch mode and foundational codegen types#4

Merged
utx0 merged 5 commits into
mainfrom
011-idl-zero-code-deploy
Mar 3, 2026
Merged

feat: manifest batch mode and foundational codegen types#4
utx0 merged 5 commits into
mainfrom
011-idl-zero-code-deploy

Conversation

@utx0
Copy link
Copy Markdown
Member

@utx0 utx0 commented Mar 3, 2026

Summary

  • Add manifest.rs with Manifest/ProgramEntry structs, load/validate functions
  • Add manifests/programs.json with all 5 programs (pumpfun, pumpfun_amm, raydium_amm, raydium_clmm, raydium_cpmm)
  • Add --manifest CLI flag for batch mode alongside existing single-program mode
  • Extract write_generated_crate helper for reuse across both modes
  • Add decoder and deref_impls fields to GeneratedCode struct
  • Add DecodeError, LoggableEvent, DecoderTrait generation functions
  • Add manifest integration tests

Context

Part of pandora spec 011 — zero-code deploy IDL codegen pipeline automation. This enables cargo run -- --manifest manifests/programs.json to generate all program crates in one invocation.

Test plan

  • cargo check passes
  • cargo test --test manifest_tests — 5 integration tests pass
  • cargo test manifest — all inline unit tests pass
  • cargo run -- --manifest manifests/programs.json — generates all 5 programs successfully
  • cargo run -- --help — shows both single-program and manifest modes
  • Conflict validation: --manifest and --input cannot be used together

Ryder 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
@utx0 utx0 merged commit c626377 into main Mar 3, 2026
8 checks passed
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.

1 participant