Skip to content

27 Discipline Intelligence and Analytics

Vicky Patel edited this page Nov 5, 2026 · 2 revisions

27. Discipline Intelligence & Behavioral Analytics

Specifications for discipline velocity scoring, cognitive heuristics, and behavioral psychology models across src/lib/discipline/, src/lib/analytics/, and src/lib/habits/.


🧮 Discipline Velocity Score Formula

PACT OS computes an authoritative Discipline Velocity Score (0–100) to quantify execution momentum without vanity metrics:

Velocity Score = (Task Completion Rate × 0.40) + (Habit Consistency % × 0.35) + (Focus Session Ratio × 0.25)
  1. Task Completion Rate (40%): Percentage of commitments marked completed vs. total scheduled commitments (completed + missed).
  2. Habit Consistency % (35%): Ratio of active days habits were logged vs. target recurrence schedules.
  3. Focus Session Ratio (25%): Ratio of completed deep work minutes vs. target planned focus minutes.

🧠 Behavioral Psychology & Decision Heuristics

PACT OS incorporates scientific behavioral models to prevent procrastination, decision fatigue, and burnout:

1. Decision Fatigue Index & Choice Budget Allocator (src/lib/discipline/decision-fatigue.ts)

  • Underlying Science: Danziger, Levav & Avnaim-Pesso (2011) judicial decision fatigue & Kathleen Vohs ego depletion.
  • Mechanism: Quantifies decision complexity points throughout the day. Alerts users when their daily cognitive choice budget is depleted to prevent poor evening commitments.

2. Eat-The-Frog Priority Ranker (src/lib/discipline/frog-score.ts)

  • Underlying Science: Brian Tracy's "Eat That Frog!" heuristic ($S = \text{impact} \times \text{resistance} / \text{time}$).
  • Mechanism: Scores pending tasks on a 0–100 scale, ranking the highest-resistance, highest-impact item to tackle during peak willpower morning windows.

3. Fogg Behavior Model ($B = \text{MAP}$) Task Friction Diagnostic (src/lib/discipline/fogg-behavior-model.ts)

  • Underlying Science: Dr. BJ Fogg's Behavior Model ($B = \text{Motivation} \times \text{Ability} \times \text{Prompt}$).
  • Mechanism: Diagnoses failure friction across 6 sub-dimensions (Time, Money, Physical Effort, Brain Cycles, Social Deviance, Non-Routine) and evaluates whether the task crosses the Action Line.

4. Shannon Entropy Habit Predictability & Chaos Index (src/lib/analytics/routine-entropy.ts)

  • Underlying Science: Claude Shannon's Information Entropy ($H(X) = -\sum p(x) \log_2 p(x)$).
  • Mechanism: Measures the mathematical regularity of habit execution hours (0–23). Distinguishes automated routines ($H < 1.5$ bits) from erratic ad-hoc patterns ($H > 3.5$ bits).

5. Habit Stacking Anchor Compatibility Scorer (src/lib/habits/habit-stacking.ts)

  • Underlying Science: James Clear & BJ Fogg Habit Stacking ("After [Anchor Habit], I will [Target Habit]").
  • Mechanism: Evaluates spatial location compatibility, energy state transitions, and environmental latency between an existing anchor habit and a new target habit.

6. Habit Elasticity Recovery Model (src/lib/habits/habit-elasticity.ts)

  • Underlying Science: Elasticity decay curves with non-linear momentum restoration.
  • Mechanism: Mitigates "all-or-nothing" discouragement by calculating elastic habit recovery credits when a user resumes a streak after a short slip.

7. Seinfeld "Don't Break the Chain" Streak Checker (src/lib/habits/chain-streak.ts)

  • Underlying Science: Jerry Seinfeld's calendar chain productivity technique.
  • Mechanism: Evaluates uninterrupted calendar streaks, identifies momentum fragility, and provides visual chain metrics.

8. Ultradian 90-Minute Rhythm Peak Energy Window Finder (src/lib/rituals/ultradian-rhythm.ts)

  • Underlying Science: Nathaniel Kleitman's Basic Rest-Activity Cycle (BRAC).
  • Mechanism: Calculates alternating 90-minute high-alertness focus waves and 20-minute restorative dips relative to user wake-up time.

📈 Streak Multipliers & Consistency

  • Streak Multiplier: Consecutive days meeting habit targets increment streak multipliers (1.0x ➔ 1.5x ➔ 2.0x).
  • Missed Day Penalty: Missing a habit resets current streak count while preserving historical total completion records.
  • Server Views (20260917000000_discipline_intelligence_and_enterprise_sso.sql): PostgreSQL views calculate weekly velocity rollups server-side for optimal rendering performance.

Clone this wiki locally