Money P1: money-core and the v7 contract #997

Open
kayg wants to merge 12 commits from feat/money-p1 into dev
Owner

Status

This PR starts the pure Rust Money core. It is not ready to merge until the complete v7 behavioral gate and model reference outputs are included.

Included

  • Exact currency amounts, marked file parsing and a limited cash/category projection.
  • JSON vectors for the TypeScript simple calculation; no browser code.
  • A 50,000-record parse-and-compute benchmark harness.

Current test scope

The tests cover exact amount parsing, a one-month cash projection, parsing the 24 guide scenarios, generated client vectors, and the published R01–R92 case ID inventory. The inventory test pins names only; it does not claim behavioral coverage of all 92 rules.

Required before this is ready

docs/money/spec.md names model-v7.py and gate-v7.py, but those scripts and their expected-output corpus are absent from this repository, its history, and the research path on the build VM. The #628 issue retains the spec attachment and gate summary, not the scripts or complete outputs. I have not invented substitute expected results. Full positive and negative Rust tests for R01–R92, exact reference fixtures, and complete card, FX, claims, import and observation behavior still need to land here.

## Status This PR starts the pure Rust Money core. It is not ready to merge until the complete v7 behavioral gate and model reference outputs are included. ## Included - Exact currency amounts, marked file parsing and a limited cash/category projection. - JSON vectors for the TypeScript simple calculation; no browser code. - A 50,000-record parse-and-compute benchmark harness. ## Current test scope The tests cover exact amount parsing, a one-month cash projection, parsing the 24 guide scenarios, generated client vectors, and the published R01–R92 case ID inventory. The inventory test pins names only; it does not claim behavioral coverage of all 92 rules. ## Required before this is ready docs/money/spec.md names model-v7.py and gate-v7.py, but those scripts and their expected-output corpus are absent from this repository, its history, and the research path on the build VM. The #628 issue retains the spec attachment and gate summary, not the scripts or complete outputs. I have not invented substitute expected results. Full positive and negative Rust tests for R01–R92, exact reference fixtures, and complete card, FX, claims, import and observation behavior still need to land here.
kayg added 12 commits 2026-11-07 03:09:21 +00:00
Author
Owner

P1 gate and benchmark evidence

Head: 63e77d20890b8c3bd0d14e15d621fed02dfdeb03 (feat/money-p1, matches origin).

Rust gates

Run on dev-01 from the P1 worktree through ~/bin/slot and Nix:

Check Result
cargo fmt --check --all PASS
cargo clippy -p calternal-money-core --all-targets -- -D warnings PASS
cargo test -p calternal-money-core PASS: 7 tests (5 unit, 1 client-vector, 1 inventory); doc tests: 0
docs/money/format.md examples 24 examples parsed by the current parser test
R01–R92 positive and negative behavior INCOMPLETE. The Rust test pins the case IDs only; it does not run their behavior.
model-v7.py / gate-v7.py expected-output fixtures MISSING. The scripts and complete expected corpus are absent from the repo, its history, the research path and the #628 attachment.

The full v7 behavior gate and reference fixtures remain required before this PR is ready to merge. The current tests cover only the parser, simple cash projection, client vectors and the listed guide scenarios.

50,000-record parse and compute

Built on dev-01 with cargo bench --no-run -j4 -p calternal-money-core --bench parse_compute_50k, then relayed through the control host to perf-01. Source and destination SHA-256 matched: 2a0c06f3b1d2518fd91209bc2d757e8d5412e8b77261484cc3092313cc297000.

The dataset had 50,000 records across 120 months, 30 accounts and 200 categories. Both shared perf locks were held, perf-01 first and then perf-02. One warm-up was excluded; seven measured runs:

200.944, 209.021, 206.525, 208.582, 204.935, 211.191, 206.975 ms
p50 206.975 ms; min 200.944 ms; max 211.191 ms

Dev-branch environment control

Built crates/notes/examples/save_bench.rs from dev 1e903a13ae43321d52a4256d3a1b1739db93bd93, relayed through the control host with matching SHA-256 50d6fbd133d033d23ca6c03845fa6db4398d053a1132056286b0b2c3f509445c. It ran on perf-01 before and after the Money samples, with 50 saves per size. This checks the environment between runs; it is not a directly comparable Money workload.

Note size Before p50 / p95 / max After p50 / p95 / max
100 lines 0.27 / 0.33 / 0.37 ms 0.27 / 0.34 / 0.38 ms
1,000 lines 0.67 / 0.73 / 0.89 ms 0.65 / 0.73 / 1.32 ms
3,500 lines 1.87 / 2.19 / 2.25 ms 1.78 / 2.01 / 2.48 ms
## P1 gate and benchmark evidence Head: `63e77d20890b8c3bd0d14e15d621fed02dfdeb03` (`feat/money-p1`, matches origin). ### Rust gates Run on dev-01 from the P1 worktree through `~/bin/slot` and Nix: | Check | Result | |---|---| | `cargo fmt --check --all` | PASS | | `cargo clippy -p calternal-money-core --all-targets -- -D warnings` | PASS | | `cargo test -p calternal-money-core` | PASS: 7 tests (5 unit, 1 client-vector, 1 inventory); doc tests: 0 | | `docs/money/format.md` examples | 24 examples parsed by the current parser test | | R01–R92 positive and negative behavior | INCOMPLETE. The Rust test pins the case IDs only; it does not run their behavior. | | `model-v7.py` / `gate-v7.py` expected-output fixtures | MISSING. The scripts and complete expected corpus are absent from the repo, its history, the research path and the #628 attachment. | The full v7 behavior gate and reference fixtures remain required before this PR is ready to merge. The current tests cover only the parser, simple cash projection, client vectors and the listed guide scenarios. ### 50,000-record parse and compute Built on dev-01 with `cargo bench --no-run -j4 -p calternal-money-core --bench parse_compute_50k`, then relayed through the control host to perf-01. Source and destination SHA-256 matched: `2a0c06f3b1d2518fd91209bc2d757e8d5412e8b77261484cc3092313cc297000`. The dataset had 50,000 records across 120 months, 30 accounts and 200 categories. Both shared perf locks were held, perf-01 first and then perf-02. One warm-up was excluded; seven measured runs: ```text 200.944, 209.021, 206.525, 208.582, 204.935, 211.191, 206.975 ms p50 206.975 ms; min 200.944 ms; max 211.191 ms ``` ### Dev-branch environment control Built `crates/notes/examples/save_bench.rs` from dev `1e903a13ae43321d52a4256d3a1b1739db93bd93`, relayed through the control host with matching SHA-256 `50d6fbd133d033d23ca6c03845fa6db4398d053a1132056286b0b2c3f509445c`. It ran on perf-01 before and after the Money samples, with 50 saves per size. This checks the environment between runs; it is not a directly comparable Money workload. | Note size | Before p50 / p95 / max | After p50 / p95 / max | |---:|---:|---:| | 100 lines | 0.27 / 0.33 / 0.37 ms | 0.27 / 0.34 / 0.38 ms | | 1,000 lines | 0.67 / 0.73 / 0.89 ms | 0.65 / 0.73 / 1.32 ms | | 3,500 lines | 1.87 / 2.19 / 2.25 ms | 1.78 / 2.01 / 2.48 ms |
Some checks failed
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled
Merge conflict checking is in progress. Try again in few moments.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/money-p1:feat/money-p1
git switch feat/money-p1

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch dev
git merge --no-ff feat/money-p1
git switch feat/money-p1
git rebase dev
git switch dev
git merge --ff-only feat/money-p1
git switch feat/money-p1
git rebase dev
git switch dev
git merge --no-ff feat/money-p1
git switch dev
git merge --squash feat/money-p1
git switch dev
git merge --ff-only feat/money-p1
git switch dev
git merge feat/money-p1
git push origin dev
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!997
No description provided.