- Root AGENTS.md: 350+ lines → 68 lines (map, not encyclopedia) - New docs/dev-environment.md (67 lines): Docker, dev.sh, ports, pitfalls - New docs/ci-pipeline.md (73 lines): Woodpecker setup, monitoring, debugging - New docs/testing.md (41 lines): Foundry, E2E, version validation - New docs/codeberg-api.md (32 lines): .netrc auth, API usage - Updated stale model refs in .claude-code-supervisor.yml files - Sub-component AGENTS.md files unchanged - Context docs (PRODUCT-TRUTH, ARCHITECTURE, UX-DECISIONS) unchanged
1.8 KiB
1.8 KiB
Testing
Contract Tests (Foundry)
Run inside onchain/:
forge build # compile contracts
forge test # run unit + fork tests
forge snapshot # gas snapshot
Fuzzing
Scripts under onchain/analysis/ generate replayable scenarios:
./analysis/run-fuzzing.sh [optimizer] debugCSV
Integration Testing
After the stack boots via dev.sh:
- Anvil logs: check for revert errors
- Ponder GraphQL:
http://localhost:8081/api/graphql - txnBot health:
http://localhost:8081/api/txn/status
E2E Tests (Playwright)
Full-stack tests in tests/e2e/ verify complete user journeys (mint ETH → swap KRK → stake).
npm run test:e2e # from repo root
- Tests use a mocked wallet provider with Anvil accounts.
- In CI, the Woodpecker
e2e.ymlpipeline runs these against pre-built service images. - See docs/ci-pipeline.md for CI-specific E2E details.
Version Validation System
The stack enforces version compatibility across contracts, indexer, and frontend:
- Contract VERSION:
Kraiken.solexposes aVERSIONconstant (currently v2) that must be incremented for breaking changes to TAX_RATES, events, or core data structures. - Ponder Validation: On startup, Ponder reads the contract VERSION and validates against
COMPATIBLE_CONTRACT_VERSIONSinkraiken-lib/src/version.ts. Fails hard (exit 1) on mismatch to prevent indexing wrong data. - Frontend Check: Web-app validates
KRAIKEN_LIB_VERSIONat runtime (currently placeholder; future: query Ponder GraphQL for full 3-way validation). - CI Enforcement: Woodpecker
release.ymlpipeline validates that contract VERSION matchesCOMPATIBLE_CONTRACT_VERSIONSbefore release. - See
VERSION_VALIDATION.md(repo root) for complete architecture, workflows, and troubleshooting.