Contributing to Resolution
Resolution is a one-owner research desk and fund. Changes are welcome when they keep that shape: the owner decides, the code enforces, and the numbers are measured rather than claimed.
Before you start
- Read the stance. Resolution never advises anyone to buy or sell, and money figures come from code, never from a model.
- No engagement mechanics. Streaks, leaderboards and prompts to trade more are declined on principle (docs/research/discipline-education.md).
- Decisions live in
decisions/. A change to the architecture, the Record's event schemas, the kernel's rules or the order path needs a decision record, or an amendment to one, in the same pull request. - The specification in
spec/is the source of intent. If code and spec disagree, raise it in an issue rather than silently picking one.
Setup
You need Node 24 or later. Docker is optional.
git clone https://github.com/bram32/resolution && cd resolution
npm ci
npm run demo # a seeded paper fund on http://localhost:4747
The log prints a link with a one-time ?t= token. node src/main.ts --memory runs an empty fund that is thrown away on exit.
The gates
Every pull request must pass the same checks as CI:
npm run typecheck # TypeScript, no emit
npm test # node:test, all suites
npm run academy:check # lessons, cases and glossary are complete in en and nl
npm run docs:check # docs/reference is up to date with the code
npm run check runs all four in order. A versioned pre-push hook runs it before every push; enable it once per clone:
git config core.hooksPath .githooks
GitHub Actions runs the same gates on ubuntu-latest. To run them on a self-hosted runner, set the repository variable CI_RUNS_ON to its label (decision 0020).
Contributions are accepted under the project licence, AGPL-3.0-or-later.
If you change rules, events, configuration, routes, providers or npm scripts, run npm run docs and commit the regenerated docs/reference/.
The product website is built from this repository with npm run site into site/dist/ (ignored by git); site/README.md has the build and deploy steps. It is not a CI gate, but test/site-gen.test.ts builds it in the test suite, so a change that breaks the build or the renderer fails npm test.
Code conventions
- TypeScript runs natively on Node 24; there is no build step. Keep imports with explicit
.tsextensions. - Runtime dependencies are deliberately two:
@electric-sql/pgliteandpg. Adding one needs a reason in the pull request. - The web app is Preact and htm, vendored, with no bundler. Views live in
web/views/, and shared pieces inweb/lib/. - Every user-facing string goes through
t(), with the English and Dutch text added together (web/i18n/*.json). Dutch uses je, not u. - The kernel (
src/kernel/) is pure: no I/O, no clock, no randomness. Rules return a measured number and a grade, not a verdict. - The Record is append-only. Never update or delete events; add a new event type with a schema in
src/record/. - Money, weights and returns are computed in code and tested. A model may explain a figure but never produce one.
- Secrets (model keys, tokens, webhook secrets) never go into the Record, logs, prompts or the browser. A test must prove it for any new secret.
Tests
Tests live in test/ and use node:test. The fake IBKR gateway is in test/helpers/fake-ibkr.ts; the market fake is the seeded synthetic provider in src/market/, and the model fake is the scripted provider in src/seats/. A new rule, route or event needs a test that names what it guards. Anything on the order path needs a test for its failure mode: a timeout, a lost reply, a duplicate or a stale price.
Commits and pull requests
- Write commit subjects as a plain sentence about what changed and why.
- Keep a pull request to one concern. Fill in the template checklist.
- Update CHANGELOG.md under Unreleased.
Reporting security issues
See SECURITY.md. Please don't use public issues for these.