Catch a rounding change before it reaches the ledger.
A Python original. A JavaScript rewrite. The same input, with one cent of changed behavior. Here is what Strust actually recorded.
Executed first-party example · Deliberately seeded bug · Two declared fixtures
The rewrite rounds the midpoint up.
At net.rounded, half-up rounding changes the amount that the ledger receives.
- Original · Python
- 123.90
- Rewrite · JavaScript
- 123.91
Follow the first changed observation.
Both implementations subtract a fee of 4.10 from 128.005. They agree on 123.905. The change appears when that value is rounded to cents, before it is written to the ledger.
| Checkpoint | Original | Rewrite |
|---|---|---|
claim.loaded | 128.005 gross · 4.10 fee | 128.005 gross · 4.10 fee |
fee.applied | 123.905 | 123.905 |
net.roundedFirst difference | 123.90 | 123.91 |
These are recorded semantic checkpoints from the executed programs. Their order helps locate the difference; it is not instruction-level causal proof.
Correct the rule. Compare again.
The original uses half-even rounding. The corrected rewrite uses that same policy. Strust verifies it against the same pinned reference evidence, without changing the fixtures or comparison policy.
roundToCents(unrounded, "half-up")roundToCents(unrounded, "half-even")- Initial rewrite
- 1/2 fixtures match DIVERGE
- Corrected rewrite
- 2/2 fixtures match MATCH
Both outcomes use an explicitly selected draft baseline. No baseline was approved or activated, and this result is not a release approval.
Inspect the code. Reproduce the result.
The archive contains the Python original, both JavaScript revisions, the fixtures, the contract and a replay script. Python 3.11+, Node.js and an existing Strust installation or source access are required. The verifier is not included; its source repository is currently private.
python reproduce.py --output proofRun from the extracted example folder with Strust installed in that Python environment. The README also covers an existing source checkout. Execution is local and uses trusted example code.
Execution environment and source integrity
- Recorded
- Verifier
- strust 0.9.0rc1
- Source revision
481e5fdbbe8eb1a4a033a98464e4efa144ff3097- Runtimes
- Python 3.14.2 · Node v24.4.1 · Windows
- Archive SHA-256
078cddc0ebfae59df15ee0b396c1ae4df251da1545223a6afbff3e4b2008dc81
The JSON download is a selected excerpt of actual CLI results, with machine paths and identities omitted. It cannot independently authenticate a complete receipt. Replaying produces new full local receipts and observations; source hashes identify the published input files.
What this establishes
Strust detected and then rechecked a deliberately introduced rounding change in two real runtimes. It compared exit status, JSON output, four semantic checkpoints and the ledger file. Only the run ID was excluded from JSON comparison; standard error was ignored.
This is a maintainer-run, first-party example. It is not customer evidence, a COBOL-to-Java result, a performance benchmark or proof of behavior outside these two fixtures. Independent reproduction and owner review remain separate.
Connect your migration