Skip to content

Comments

Add resolvers and various AST updates#45

Merged
adiman9 merged 55 commits intomainfrom
pda-pipeline
Feb 6, 2026
Merged

Add resolvers and various AST updates#45
adiman9 merged 55 commits intomainfrom
pda-pipeline

Conversation

@adiman9
Copy link
Contributor

@adiman9 adiman9 commented Feb 6, 2026

No description provided.

adiman9 and others added 30 commits February 4, 2026 00:03
…ion builders

- Replace data-driven InstructionDefinition with InstructionHandler interface
- Handler's build() function is called by core SDK (generated code does serialization)
- Implement real PDA derivation with SHA-256 and base58 encoding
- Add topological sorting for PDA dependency resolution (accountRef seeds)
- Add programId to InstructionHandler for PDA derivation context
- Export findProgramAddressSync, decodeBase58, encodeBase58 utilities
Add PdaDefinition, PdaSeedDef, AccountResolution, InstructionAccountDef,
InstructionArgDef, and InstructionDef types to both hyperstack-macros and
interpreter crates. Add IDL parsing and extraction functions to support
code-generated instruction builders with PDA support.
Implement #[resolve] attribute for automatic token metadata resolution
via the Metaplex DAS API (getAssetBatch with showFungible support).

- Add ResolverClient with batched DAS API calls and LRU caching in VM
- Add QueueResolver opcode for lazy resolution during event processing
- Wire resolver lifecycle into both single and multi-pipeline handlers
- Parse #[resolve(from = "field")] attribute on entity fields
- Generate TypeScript types for resolved fields (TokenMetadata)
- Fix IDL parsing for pda.program with kind: "const" (bs58 encoding)
- Add reqwest and bs58 dependencies for HTTP + address encoding
DAS APIs are a Metaplex standard, not Triton-specific. Rename env vars
to DAS_API_ENDPOINT and DAS_API_BATCH_SIZE for provider neutrality.
- Add return() and throw() methods to createEntityStream iterator
- Remove unused imports in pda-dsl.ts and confirmation.ts
- Add null check for regex match in getArgSize
- Remove unused variable in serializer.ts
- Add undefined check in store.ts binary search
When a stack has PDAs defined, the generated SDK now imports
pda, literal, account, arg, bytes from hyperstack-typescript.

- Add conditional import logic in typescript.rs
- Add hyperstack-typescript as dev dependency for stacks SDK build
- Regenerate pumpfun SDK with proper imports
- Add Schema<T> and SchemaResult<T> types for optional validation
- Add validateFrames option to enable schema validation at connection
- Implement frame validation in FrameProcessor with console warnings
- Support generic schema parameter in WatchOptions and view methods
- Add total_miners, deployed_per_square, count_per_square to state
- Add entropy_seed, entropy_slot_hash, entropy_var_address fields
- Change entropy field strategies from SetOnce to LastWrite
- Add Zod schemas for OreRound runtime validation
…tin type

- CompletedSchema now enforces all root fields as required (no optional/nullable)
- Added TokenMetadata as a built-in resolver type with interface and Zod schema
- Field type resolution uses concrete types from inner_type instead of Record<string, any>

This enables schema validation to only emit when entities are fully populated.
Resolvers can now provide computed methods usable in #[computed(...)]
expressions. The AST explicitly encodes which resolver provides each
method, enabling validation at load time and clear error messages.

- Add ResolverDefinition trait and ResolverRegistry
- Implement TokenMetadataResolver with ui_amount/raw_amount methods
- Add ComputedExpr::ResolverComputed AST variant
- Parse .ui_amount(decimals) → ResolverComputed { resolver, method, args }
- Evaluate resolver methods at runtime via registry delegation
- Make TypeScript generation registry-driven
Demonstrate resolver-computed syntax with human-readable ORE amounts:
- motherlode_ui, total_refined_ui, total_staked_ui, total_unclaimed_ui
- Uses .ui_amount(11) to convert raw amounts to ORE tokens (11 decimals)
…methods

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add stop and stop_lookup_by attributes to #[map] macro that allow fields
to stop updating after a specific instruction is encountered. This enables
capture of point-in-time values (e.g., treasury state at round start).

- Parse stop/stop_lookup_by in attributes.rs
- Add stop field to AST types and serialization
- Generate SetFieldUnlessStopped opcode in compiler
- Implement stop flag checking in VM execution
Add RoundTreasury struct to capture treasury motherlode at round start
using the new stop attribute. Add ui_amount computed fields throughout
RoundState and RoundMetrics for human-readable token amounts.
- Add connectionState and isConnected to useHyperstack hook return
- Add subscribeToClientChanges mechanism to provider for client availability
- Fix useConnectionState hook to properly track connection when client becomes available
- Update example to use new destructured API pattern
- Document connectionState and isConnected in useHyperstack return value
- Update all code examples to use destructured { views, isConnected } pattern
- Document standalone useConnectionState() as alternative for edge cases
- Add useHyperstack return values table to API reference
Filter latest round emissions to only receive complete entities with all required UI fields present, using Zod schema validation.
…shboard

- Constrain grid container width to prevent expansion during round transitions
- Normalize expires_at timestamp if in milliseconds
- Add sanity check for unreasonable timer values (>5min shows --)
Replace inline styles with Tailwind utility classes for a sleeker design.
Uses slate/violet color scheme with subtle hover transitions and a
pulsing glow effect for the winner square.
… fields

Allow computed field expressions to access the current update's slot and
timestamp via __slot and __timestamp identifiers. This enables computing
time-based derived values like estimated expiry times.

- Add ContextSlot/ContextTimestamp variants to ComputedExpr AST
- Update evaluator signature to accept context parameters
- __slot returns u64 (0 if unavailable), __timestamp returns i64
…dark mode

- Replace dark tech/SaaS look with warm stone palette and white cards
- Add ThemeToggle component with sun/moon icons in header
- Add ThemeProvider context with localStorage persistence
- Support system color scheme preference on first load
- Update all components with light/dark mode variants
- Refine icons to use theme-aware colors
- Grid cells are now square and fill majority of viewport height
- Grid left-justified with stats panel beside it (max-w-md)
- Full-screen feel with reduced padding and no centered container
- Stats scaled up to match cinematic proportions
Solves the chicken-and-egg versioning problem where examples would be
packaged with old version references. The script updates all hyperstack-*
dependencies in examples to the release version before creating the
template tarball. Also fixes ore-react which incorrectly used file:
references that would break when distributed via CLI.
Extend the transform= syntax to accept parameterized resolver transforms
(e.g., transform = ui_amount(ore_metadata.decimals)), which the macro
expands into a hidden raw field + synthesized computed field. This
eliminates duplicate _ui fields from stack definitions.

Update ore stack to use the new syntax, removing ~10 redundant _ui
field pairs. Update generated AST, Rust SDK types, and TypeScript SDK
types to reflect the simplified field names.
…ames

Replace removed _ui field references (motherlode_ui → motherlode,
total_deployed_ui → total_deployed) in validated schema, StatsPanel,
and OreDashboard. Point package.json deps to local workspace paths
and use localhost WebSocket URL for local development.
@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hyperstack-docs Ready Ready Preview, Comment Feb 6, 2026 4:07am

Request Review

@adiman9 adiman9 merged commit 8495733 into main Feb 6, 2026
9 checks passed
@adiman9 adiman9 deleted the pda-pipeline branch February 6, 2026 04:15
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