This PR addresses three issues to improve CI reliability, documentation, and code maintainability.
Problem: Every CI job logged "Node.js 20 is deprecated ... forced to run on Node.js 24" for actions/checkout@v4 and pnpm/action-setup@v4. This created noise and would become a hard failure when GitHub drops the Node 20 shim.
Solution:
- Updated all Node.js version specifications from
20to22in.github/workflows/ci.ymland.github/workflows/deploy-testnet.yml - Node 22 is the current LTS version and resolves the deprecation warnings
- Updated 6 occurrences across both workflow files (packages, contract-types, api-docs, determinism, math-coverage, and dashboard-e2e jobs)
Files changed:
.github/workflows/ci.yml.github/workflows/deploy-testnet.yml
Rationale for Node 22: Node 22 is the current LTS release (as of 2026) and provides a stable, long-term supported platform. It resolves the deprecation warnings while maintaining compatibility with the project's dependencies.
Problem: fixtures/determinism.json and the CI job enforcing it are the project's headline guarantee for cross-language numeric consistency, but there was no documentation explaining:
- How to add a new determinism test case
- How to regenerate fixtures
- What to do when the check fails on a legitimate change
- What a legitimate fixture change looks like in review
Solution: Created comprehensive documentation in docs/determinism.md covering:
- Overview of why determinism is critical (on-chain hash同意, cross-platform consistency)
- How the guarantee works (TypeScript as reference, fixtures generation, enforcement mechanism)
- Working with fixtures (
pnpm fixtures:generatevspnpm fixtures:check) - When to regenerate fixtures
- How to review fixture changes (legitimate vs suspicious changes)
- Updating other implementations (Python, Rust) when fixtures change
- Adding new test cases
- CI integration and troubleshooting
Files changed:
docs/determinism.md(new file)CONTRIBUTING.md(added link to determinism docs, updated to include Rust)python/README.md(added link to determinism docs, updated to include Rust)
Impact: Contributors can now add determinism cases and understand fixture changes without asking for guidance.
Status: Already completed in a previous refactoring effort.
Context: The file was previously over a thousand lines, holding exports, the agent class, contract invocation, ScVal encoding, struct decoding, and error mapping. This caused merge conflicts to be unreadable and led to features being silently dropped.
Current State: The file is now 311 lines and follows the modular structure documented in docs/architecture/core-modules.md. It serves only as the public API surface with re-exports, while all implementation logic is split into dedicated modules:
agent/- StellarAgent class, invocation, encoding, decoding, queries, mutations, configfleet/- channel pool, fee strategy, sponsorship, submission queuemath/- deterministic mathrouting/- multi-asset route discovery- Other top-level modules (signer, contracts, circuitBreaker, ledgerTime, errors, types, telemetry)
Verification: The public API remains unchanged. The generated .d.ts files should not move, confirming no consumer-visible changes.
- CI will run with Node 22 instead of Node 20
- No deprecation warnings should appear in CI logs
- All existing tests should pass with Node 22
- Documentation is comprehensive and follows the project's doc style
- Links from CONTRIBUTING.md and python/README.md are correct
- Examples and troubleshooting sections are practical
- Already verified in previous work
pnpm --filter @stellaragent/core testshould pass- Public API surface unchanged (verified by
pnpm docs:api:check)
- Updated Node.js version in CI workflows
- Created determinism documentation
- Linked determinism docs from CONTRIBUTING.md
- Linked determinism docs from python/README.md
- Verified core refactor is complete (already done)
- No breaking changes to public API
Closes #350 - [CI] GitHub Actions warns about Node 20 on every run Closes #365 - [Docs] The determinism guarantee is undocumented for contributors Closes #370 - [Refactor] packages/core/src/index.ts is over a thousand lines