u/Fluid-Sink-8718

▲ 0 r/github

CTHmodules v4.0 — 86% (with a margin of 1.4 points) of being a 100% Functional Psychohistory of Asimov.

I've been working with this framework for three years and recently updated it to version 4.0. It works perfectly for historical analysis or event projects, and you can also make improvements based on your specific use cases. If you have people who work in historical analysis and research, you can recommend it to them. All feedback and testing are welcome. Thanks in advance!

✨🚀 UPDATE! v4.0

This major update completes the transition to a fully policy-driven, actor-aware kernel. Every numeric assumption is now externalized into auditable Policy objects, and individual historical actors are modeled as first-class causal agents through the new Token Dynamics Engine.

Key Features & Improvements

  • Token Dynamics Engine (Phase E.25): Each event now carries a token_instance describing the primary actor (power, network, charisma, momentum, ideological extremity, legitimacy, rationality). The engine computes a Token Impact Multiplier (TIM) applied per-engine — disruptors amplify systemic risk, architects and stabilizers dampen it.
  • Policy Injection System (Phase A.4): All analytic weights, thresholds, and constants are externalized into versioned, citable Policy objects. Two analysts using the same kernel but different Policies produce independently auditable, comparable results.
  • Specialized Policy Variants: Five domain-specific lenses ship out of the box — General, Geopolitical, Economic, Technological, and Revolutionary — each tuned to the causal dynamics of its domain.
  • Trajectory Bonus Mechanisms: Two complementary signals reward managed transformations: a structural delta inferred from Foundation's phase reconstruction (trajectory_bonus) and a reported delta read directly from macro_context.deltaCTH (reported_delta_bonus), positive-only so ruptures are not penalized twice.
  • Enhanced Calibration Suite: calibrate() now returns MAE, RMSE, Brier Score, Directional Accuracy, and per-category breakdowns. sensitivityAnalysis() identifies which synthesis weights drive error most. optimizePolicy() runs deterministic hill-climbing to minimize corpus MAE automatically.
  • IDataAdapter Interface (Phase B.6): Callers provide structured data through any adapter implementing adapt(rawInput). The kernel never touches raw text or external formats — full separation of ingestion and analysis.

The transition from descriptive history to predictive civilizational engineering.

  • 🏛️ Now the PAST into auditable data.
  • 🧬 Now the PRESENT into a technical diagnosis.
  • Now the FUTURE into a manageable probability.

The CTH Framework is an advanced computational system designed to quantify, simulate, and predict the stability and transitions of large-scale socio-historical systems. By integrating Shannon Entropy, Non-linear Dynamics, and High-Density Monte Carlo Simulations, CTH provides a functional realization of the goals proposed by Isaac Asimov’s Psychohistory, translated into a rigorous 21st-century mathematical architecture.

🚀 Key System Features

  • 📡 Master Predictor (cth-core.js): Central synthesis unit integrating six analytic engines into a single ultraCTH score (0–1). Outputs RMD/CMN verdict, certainty bracket, AlphaBreak status, Mule Clause flag, reflexivity penalty, and population modulation — all deterministically reproducible via SHA-256 hash.
  • 🎭 Token Dynamics Engine: Models individual actors as causal agents. Computes a Token Impact Score (TIS) from eight actor fields and applies a role-weighted Token Impact Multiplier (TIM) to Foundation, Dynamics, and Chaos risks before synthesis. Disruptors, architects, catalysts, stabilizers, and wildcards each produce distinct causal signatures.
  • 🦋 Butterfly Field Engine: High-density mapping of non-linear causal drift. Tracks initial condition sensitivity, divergence indices, and somatic resonance thresholds across the five temporal phases.
  • 🛡️ Chaos Resilience Engine: Internal resilience suite computing entropy, ERI (Event Resilience Index), blind spots, polarization, and fatigue. AlphaBreak and hedge thresholds are policy-configurable per domain.
  • 📜 Policy System: All analytic assumptions live in versioned, distributable Policy objects — not in the kernel. Inter-policy comparison (compare()), sensitivity analysis, and automated optimization (optimizePolicy()) allow rigorous, reproducible calibration across analytical schools.
  • 🔗 Causal Inheritance (Phase D.20): Events inherit systemic stress from parent events with configurable exponential decay (half_life). A child event registered with causal_parent_id automatically receives attenuated macro stress from its predecessor's ultraCTH.
  • 🤖 Bridge Layer (cth-bridge.js): Multi-context manager and adapter layer. Accepts any structured input via the IDataAdapter interface, manages causal chains across registered contexts, and exposes calibration, comparison, sensitivity, and optimization as first-class operations.
  • 📉 Deterministic Chaos: All simulation (Monte Carlo loops, deep zoom, butterfly perturbations) uses trigonometric deterministic noise tied to event parameters — zero Math.random(). Every prediction is fully reproducible and SHA-256 verifiable.

Evaluation v4.0 / Latest State

Psychohistory Criterion (Asimov) Level Comment
Quantifying macro-social trends 8.8 / 10 Very strong
Predicting large-scale events 8.7 / 10 Solid differentiation and range
Handling "historical forces" (EVEI) 8.4 / 10 Good
Butterfly Effect + Chaos management 8.8 / 10 Excellent
Invariance / Pantemporal patterns 8.2 / 10 Good
Mathematical determinism 9.0 / 10 Excellent
Empirical validation / Real calibration 8.7 / 10 Very strong (MAE 0.0356)
Handling individual variables (Token) 8.6 / 10 Very effective
Real future prediction capability 8.4 / 10 Increasingly credible

Overall Verdict: 8.6 / 10

github.com
u/Fluid-Sink-8718 — 1 day ago

I brought a new approach to boring coffee trackers... I created one with gamification! ☕️😆🎮

https://preview.redd.it/jku8kr51ys0h1.png?width=2366&format=png&auto=webp&s=13d62f27447d63b2344c5a9e45686a005aa591ab

As a huge coffee lover, I noticed that caffeine tracking apps are incredibly boring, with dull interfaces and basic graphs. That's why I decided to completely flip the script and created Haffee.

It’s an app to track your caffeine (and sugar, if you need to) featuring a wide variety of coffee types, synced with Apple Health, and integrated with Apple Game Center. This way, it’s no longer just about drinking a coffee and logging it. Now, your daily brew helps you unlock achievements, climb up a global leaderboard, and even compete with your friends and family.

Link: https://apps.apple.com/cl/app/haffee/id6764058146

reddit.com
u/Fluid-Sink-8718 — 10 days ago
▲ 0 r/iosdev

After years of putting it off, I finally built Haffee: A gamified caffeine tracker without the boring graphs.

https://preview.redd.it/vwjmlia6vs0h1.png?width=1912&format=png&auto=webp&s=b3766f1d021302ebb9cfadc7a3c2e7a15b647d4d

After leaving the design in a drawer for years, I finally built Haffee. I realized most caffeine trackers are just boring dashboards, so I wanted to build something fun. Haffee ditches the charts and turns your daily coffee intake into a global competition. It logs every coffee style, syncs with Apple Health, and lets you challenge other coffee addicts around the world.

I'm living a dream; I thought this would never be real. I'm so proud of my first app!

Link: https://apps.apple.com/cl/app/haffee/id6764058146

reddit.com
u/Fluid-Sink-8718 — 10 days ago

>I'm sharing my experience because people have only tried it with soccer and basketball, and I'd like to invite baseball fans to try my API with this sport.

Hi everyone. About two months ago I finished building my own sports API. I decided to go with a different approach because I was tired of the same old projection systems that everyone uses.

A few days ago, I had a moment that honestly blew my mind. I connected the API to an AI to see what would happen. At one point, the home team was winning, but the system kept insisting that the away team was going to win the match.

I asked the AI: "Why aren't you adjusting the prediction to what's happening live?" and it literally told me: "Relax, the home team is going to crash at the 60-minute mark, and that’s when the goal will come."

And it actually happened. Right after minute 60, the home team completely lost their momentum, and by minute 65 the goal happened. I'm still processing it, I knew I had something interesting, but I didn't expect this level of "intuition" from the data.

My API: https://rapidapi.com/alejomalia/api/witchgoals

Try it out and let me know.

u/Fluid-Sink-8718 — 17 days ago
▲ 3 r/ShowMeYourApps+1 crossposts

Hey people! After sitting on this design for a while, I finally took the plunge and built it. I'm here to share Haffee, my very first app!

I actually came up with Haffee like 2 or 3 years ago. I had the UI designed, but it was always one of those projects I never thought would become a reality. After finally getting serious about it, I can honestly say I'm really proud of how it turned out.

The main motivation behind it was that I felt most caffeine tracking apps out there were either way too cluttered or just lacked a modern, solid design. I wanted to build something that wasn't just functional, but also visually stunning with a totally different vibe.

If you're interested, it comes with a 3-day free trial so you can test it out and see if it fits your routine. I really hope you guys like it!

u/Fluid-Sink-8718 — 17 days ago
▲ 1 r/u_Fluid-Sink-8718+2 crossposts

Hey everyone.

For the past month, I've been working on a predictive engine for football (soccer) and basketball. Instead of standard stats, it uses non-traditional math to find late-game drops, rotation impacts, and filter out noise.

I tested it live recently and it perfectly predicted a crazy 65th-minute performance drop-off that totally flipped the game.

I decided to pack it into an API so other data nerds and devs can play around with the raw data or hook it up to their own ML models.

I’ll drop all the details, the endpoints, and how to test it for free in the first comment below so this doesn't look like a giant ad! Would love to hear what you guys think of the logic behind it.

reddit.com
u/Fluid-Sink-8718 — 24 days ago