Verify · 004-portfolio-weights

Portfolio weight calculation

How to run, demo, and verify this feature — aggregated from the spec and tasks, with a Run/Demo block grounded in the run that actually happened.

Generated from spec.html · tasks.html Derived status accepted (from spec.html — this view carries no status of its own) Read time

A derived view — regenerate with spectastic verify 004-portfolio-weights; do not hand-edit. The trace links are aggregated from the bundle; only the Run/Demo block is authored, from the real run.

1 · Run / Demo

none — a read view over positions; exposed behind the platform's dark REST toggle export JAVA_HOME="$(asdf where java temurin-21.0.9+10.0.LTS)" && mvn test -Dtest=PortfolioWeightsTest Build a long/short book; PortfolioWeightsTest shows gross-basis weights in [0,1] summing to one within 1e-9 with a short present, net-basis weights carrying sign, the Herfindahl index matching its closed form, and an empty book yielding no weights rather than a divide-by-zero.

2 · Verification trace

Every success criterion, traced to its acceptance scenario and the test task that closes it.

Success criterionAcceptanceProof (tests)
SC-001US1T-100
SC-002US3T-300

3 · Observables trace

Every reliability NFR, traced to its SLO — objective, SLI, and golden signal.

NFRObjectiveSLISignal
NFR-001p99 < 500 µs full-book (N=5000)reweight the book on a denominator-moving tick, at 5,000 instrumentslatency
NFR-002|Σweights − 1| ≤ 1e-9 on 100% of recomputesgross-basis recomputes whose weights sum to one within 1e-9errors
NFR-003p99 staleness < 2 ms from originating tickprice tick to the dependent weights reflecting itlatency