mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
fix(folio): saturation-gate account creation in the spec
The 2-3 step add-account loop outcompeted the 5-step transaction chain at every weighted re-draw, so runs filled with account creation and rarely exercised the balance properties. Stop offering add-account once three accounts exist; the renormalized weights then favor the transaction flow at every step of its chain.
This commit is contained in:
1 parent
5ede139945
commit
0b34af7e7a
1 file changed
+7
@@ -134,8 +134,15 @@ const login = actions(() => {
|
||||
|
||||
const accountNames = from(["Checking", "Savings", "Travel", "Emergency Fund", "Investments"]);
|
||||
|
||||
// Saturation gate: a few accounts are enough to exercise every balance
|
||||
// property. Without the gate the short add-account loop (2-3 steps, back to
|
||||
// home) outcompetes the 5-step transaction chain at every re-draw and the
|
||||
// run fills with account creation instead of transactions.
|
||||
const ACCOUNTS_ENOUGH = 3;
|
||||
|
||||
const addAccount = whenRoute(route, ["home", "add-account"], () => {
|
||||
if (route.current === "home") {
|
||||
if (accounts.current.length >= ACCOUNTS_ENOUGH) return [];
|
||||
const btn = addAccountButton.current;
|
||||
return btn ? [Tap({ on: btn })] : [];
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user