Polytraders Dev Guide
internal
v3 spine Phase 1 · Shared contracts 9 demo-wired · 0 shadow-ready · 0 production-live · 100 pending · 109 total 15/33 infra tasks the plan status board

Test pack

What every bot must ship. Without this pack, the bot does not promote past stub.

Required test classes

ClassPurposeMinimum coverage
UnitCover every branch of decide().Every reason code listed in the spec must be exercised by at least one unit test.
IntegrationRun the bot inside a real BotContext with a real (mocked) ReportEnvelope sink.The bot's full spec — input schema → decide → emit → ReportEnvelope round-trip — must run end-to-end.
PropertyCatch assumptions the unit tests forgot to assert.For numeric bots: monotonicity, idempotency on identical input, boundedness against the hard threshold.
Failure-injectionConfirm the documented safe_fallback actually fires.Every failure mode in the spec must have a recipe in the test pack and a passing assertion that the safe fallback was taken.

Required fixtures

Every bot's repo folder ships with:

bots/<layer>/<slug>/
  config.default.json
  input.normal.json
  input.warning.json
  input.hard_reject.json
  output.expected.normal.json
  output.expected.warning.json
  output.expected.hard_reject.json
  tests.spec.ts

The expected outputs are diff-checked against decide(input) output by the integration test. Any change to expected output is a config-version bump.

Forbidden in tests

Promotion gate checks

The promotion-gate page on each bot lists the automated checks that must pass before promotion. The minimum is: