Updates Jest configuration to properly handle ES module syntax:
- Switch to ts-jest/presets/default-esm preset
- Add custom resolver to map .js imports to .ts source files
- Configure extensionsToTreatAsEsm for TypeScript files
- Enable useESM in ts-jest globals
This resolves module resolution errors when running tests in
kraiken-lib which uses "type": "module" in package.json.
Fixes#85
Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/88
Changes ProcessEnv import from non-existent 'node:process' module
to use built-in NodeJS.ProcessEnv type.
Fixes TypeScript compilation error:
Module '"node:process"' has no exported member 'ProcessEnv'
Also adds NodeJS to ESLint globals to resolve no-undef warning.
All services now healthy and operational.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds PONDER_RPC_TIMEOUT environment variable to improve Ponder
stability on slow RPC connections or under load. Default is 20000ms
(20 seconds).
## Changes
- containers/ponder-dev-entrypoint.sh: Export PONDER_RPC_TIMEOUT with default of 20000ms
- podman-compose.yml: Add PONDER_RPC_TIMEOUT to ponder service environment
## Configuration
The timeout can be overridden by setting PONDER_RPC_TIMEOUT in your
environment before starting the stack:
```bash
export PONDER_RPC_TIMEOUT=30000 # 30 seconds
./scripts/dev.sh start
```
## Impact
- Low risk: Configuration-only change
- No breaking changes
- Improves stability on slower networks or forked environments
- Defaults to 20 seconds if not specified
Fixes#87🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements window.__testHelpers.fillStakeForm() to enable stable E2E testing
of the staking form without fragile UI selectors.
## Changes
- Add window.__testHelpers interface (dev mode only)
- Implement fillStakeForm() in StakeHolder.vue with input validation
- Add TypeScript declarations in env.d.ts
- Update E2E test to use helper and verify full user journey
- Create INTEGRATION_TEST_STATUS.md documenting test coverage
- Document helper in web-app/README.md
## Test Coverage
Playwright E2E now validates complete flow:
- Mint ETH via cheats page UI
- Swap KRK via cheats page UI
- Stake KRK via stake page UI (helper + click)
- Verify position via GraphQL
Both Playwright and verify-swap.sh tests now work independently.
resolves#62
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/66
Replaces basic "service is up" checks with functional verification that tests can actually use the services.
## Changes
### New Health Checks
- **RPC Proxy**: Verifies eth_call works and deployed contracts are accessible
- **GraphQL**: Confirms Ponder has indexed data with non-zero stats
- **Web App**: Validates endpoint accessibility
### Improvements
- Clear error messages explain what failed and how to fix it
- Checks verify actual functionality, not just HTTP 200 responses
- Fails fast before tests run with cryptic errors
### Files
- `tests/setup/health-checks.ts` - Core health check functions
- `tests/setup/stack.ts` - Integration with waitForStackReady()
- `tests/HEALTH_CHECKS.md` - Documentation and troubleshooting guide
## Error Message Example
Before:
```
RPC health check failed with status 404
```
After:
```
❌ Stack health check failed
Failed services:
• RPC Proxy: RPC proxy returned HTTP 404
Expected 200, got 404. Check if Anvil is running and RPC_URL is correct.
• GraphQL Indexer: GraphQL has no indexed data yet
Ponder is running but has not indexed contract events.
Troubleshooting:
1. Check stack logs: tail tests/.stack.log
2. Verify services are running: ./scripts/dev.sh status
3. Restart stack: ./scripts/dev.sh restart --full
```
## Benefits
- ✅ Tests fail fast with clear error messages
- ✅ Catches configuration issues before tests run
- ✅ Verifies services are actually usable, not just running
resolves#61
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/65
Successfully applied and tested the bootstrap speedup optimizations. Here's what was accomplished: Fixes Applied
1. podman-compose.yml - Changed ponder dependency from service_started to service_completed_successfully to eliminate race condition
2. services/ponder/src/helpers/stats.ts - Fixed two context errors: - Used START_BLOCK from environment instead of context.network.contracts.Kraiken.startBlock - Added console fallback for context.logger (undefined in block handlers)
Test Results Core Services: ✅ All Healthy - Anvil (blockchain): Running, healthy - Postgres (database): Running, healthy
- Ponder (indexer): Running, healthy - Bootstrap: Completed successfully (exit code 0) GraphQL API: ✅ Working {"data":{"stats":{"kraikenTotalSupply":"413226953999797390248016","outstandingStake":"0"}}}
Bootstrap Optimizations: ✅ Confirmed
- ✅ Reduced mining from 2000 to 200 blocks - ✅ Batch mining support (anvil_mine RPC) - ✅ Dependency caching with marker files - ✅ Ponder waits for bootstrap completion (no more stale .env.local issues) Timing: Bootstrap completes in ~20 seconds (vs 90+ seconds previously - approximately 75% faster)
The optimization branch is working correctly. The core issue (ponder race condition) has been fixed and ponder now successfully queries contract data after bootstrap completes.
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/59
- expand scripts/watch-kraiken-lib.sh to watch atomic rename events, validate required tools, and gracefully restart only the containers that mount kraiken-
lib/dist
- verify the host-built dist is mounted read-only inside each service and observe live rebuild + restart behavior under inotify
- run the local podman stack, exercise the watcher by editing kraiken-lib/src/helpers.ts, and confirm GraphQL responds through Caddy after restarts
resolves#33
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/38
## Summary
- add a useSnatchSelection composable that centralises snatch shortfall calculations, position filtering, and RPC memoisation
- refactor StakeHolder.vue to consume the composable instead of reimplementing the flow inline
- introduce Vitest config and first composable tests (useSnatchSelection.spec.ts) to cover empty/partial fills and ownership edge cases
- wire up project tooling updates so the new tests run (jsdom dep, updated package metadata)
## Testing
- cd web-app && npm install
- npm test
resolves#24
Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/30
- Updated all ponder event handlers to use proper TypeScript types
- Removed all 'any' type annotations from event handlers
- Handlers now properly leverage TypeScript's type inference
- Improved type safety across the ponder indexer
Fixes#22
- Updated kraiken-lib tsconfig and yarn.lock
- Added package.json with playwright-mcp dependency
- Updated uni-v3-lib submodule
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>