code wiki / (root) / nx_adhd.nx

nx_adhd.nx source

↩ module page · 52 lines · 3143 B

1// nx_adhd.nx -- R3 of THE NISHI SITUATION-MANAGEMENT arc: ADHD-specific INTERVENTIONS for the failure 2// modes ADHD actually causes (operator: "adhd has things like impulse shopping planning failures inaction 3// locks etc"). Targets each one, and -- crucially -- ADVISES, never BLOCKS (autonomy preserved; the never- 4// brick analog #26 for a person's agency = a speed bump, not a wall). Composes nx_money/nx_bills/nx_accommodate. 5// 6// * IMPULSE SHOPPING -> a cooling-off PAUSE on big discretionary buys + reframe the dopamine-buy as 7// concrete cost: HOURS OF YOUR LIFE (amount / wage) and %-of-your-buffer-goal. Over-budget -> WARN. 8// * PLANNING FAILURES -> externalize the executive function: surface an obligation EARLY (lead-time) so 9// nothing is missed; the system plans ahead so the person doesn't have to hold it in working memory. 10// * INACTION LOCKS (task paralysis / "ADHD freeze") -> when the next step feels too big, recommend a 11// 2-minute MICRO first action to drop the activation energy and break the lock. 12// Data-driven (#11): thresholds/budgets/lead-times are DATA. No floats, no hardware writes. license_tier: ORIGINAL 13import "nx_syscalls.nx" 14import "nx_money.nx" 15 16const ADHD_ALLOW: i64 = 0 // proceed 17const ADHD_PAUSE: i64 = 1 // cooling-off (a reversible speed bump, NOT a block) 18const ADHD_WARN: i64 = 2 // over the discretionary budget -- advise, still the person's call 19 20// IMPULSE-SHOPPING guard: ADVISE on a purchase. Needs are never flagged; a big discretionary buy gets a 21// cooling-off PAUSE; over-budget gets a WARN. NEVER returns a "block" -- the ceiling is advisory (autonomy). 22func adhd_spend_decision(amount: i64, discretionary: i64, pause_threshold: i64, remaining_budget: i64) -> i64 { 23 if discretionary == 0 { return ADHD_ALLOW } // a need, not an impulse 24 if amount > remaining_budget { return ADHD_WARN } // over the discretionary budget for the period 25 if amount >= pause_threshold { return ADHD_PAUSE } // big impulse buy -> 24h cooling-off 26 return ADHD_ALLOW 27} 28 29// REFRAME: whole hours of work this purchase costs (opportunity cost makes the impulse concrete). 30func adhd_hours_cost(amount_cents: i64, hourly_wage_cents: i64) -> i64 { 31 if hourly_wage_cents <= 0 { return 0 } 32 return mny_div_round(amount_cents, hourly_wage_cents, RND_HALF_EVEN) 33} 34 35// REFRAME: what percent of a savings/buffer GOAL this purchase would consume. 36func adhd_pct_of_goal(amount_cents: i64, goal_cents: i64) -> i64 { 37 if goal_cents <= 0 { return 0 } 38 return mny_div_round(amount_cents * 100, goal_cents, RND_HALF_EVEN) 39} 40 41// INACTION-LOCK breaker: a too-big step (effort >= threshold) needs a 2-minute MICRO first action. 42func adhd_needs_micro(effort: i64, threshold: i64) -> i64 { 43 if effort >= threshold { return 1 } 44 return 0 45} 46 47// PLANNING-FAILURE guard: surface an obligation NOW iff it is within the lead-time window (the system plans 48// ahead so nothing is missed). days_until = days until due; lead_time = how far ahead to nudge. 49func adhd_surface_ahead(days_until: i64, lead_time: i64) -> i64 { 50 if days_until <= lead_time { return 1 } 51 return 0 52}