Most autonomous agent setups start as an unconstrained while loop around a model and tools. In practice, that tends to break down in three familiar ways:
- Runaway loops & idle polling: Re-running failing tool calls or busy-polling unchanged state until the budget is gone.
- Amnesia on restart: Crashes or timeouts wipe active subproblems and budgets—or worse, naive transcript replays risk repeating non-idempotent side effects.
- Unstructured concurrency: Background workers mutating shared state without coordination, producing race conditions and non-reproducible traces.
FTR.cc ("Three Problems. Three Threads. One Process.") approaches this as a single-process cooperative state machine in Python 3.10+ (standard library only, GNU GPLv3) rather than a prompt wrapper.
How It's Structured
- Three bounded proposal generators:
- Thread 0 (Present): Reactive event/timer handling that schedules future checks instead of busy-polling.
- Thread X (Past): Episodic memory and consolidation that turns repeated failures into policy rules (
avoid:<action>). - Thread hmzs26 (Future): Bayesian hypothesis tracking and bounded best-first planning aimed at high-information-gain steps.
- Marginal-value scheduler & true idle (
theta_wake): Scores candidate actions by utility, urgency, information gain, novelty, confidence, cost, and fixation penalty—and entersLIGHT_IDLE,DEEP_IDLE, orHIBERNATEwhen nothing clearstheta_wake(checked before starvation credit so fairness doesn't invent busywork). - Hash-chained WAL & atomic snapshots: Logs
intentbefore external side effects andresultafter, using deterministic idempotency keys and torn-tail truncation on crash recovery.
Run It Yourself (Zero Dependencies)
git clone https://github.com/hmzs26/FTR.cc.git cd FTR.cc # Unit & fault-injection tests python3 -m unittest discover -s tests -v # Synthetic benchmarks & ablations python3 experiments/run_experiments.py In the synthetic benchmarks (details in paper/FTR_cc_Unified_Paper.md), the reference runtime in src/ftr.py handles delayed results (t=60) with 1 poll and 1 scheduled check instead of dozens of wasted polls, halts unfixable tool errors after 2 attempts via fixation penalty, and preserves 41/41 identical state hashes across 6 WAL crash-injection points with 0 duplicate side effects.
Honest Scope & Where Feedback Helps Most
Right now the benchmarks run in a deterministic simulated environment rather than wired to live stochastic LLM APIs, and operational restraint isn't a substitute for semantic/alignment guardrails.
I'd love honest feedback on:
- Where the marginal-value /
theta_wakesleep gate could still over-sleep or miss urgent work under tricky inputs. - Any WAL / crash-recovery edge cases you spot in
src/ftr.pyortests/test_ftr.py. Live LLM adapter trade-offs (especially content-addressed caching and token cost modeling) as a next step.
Repo:
https://github.com/hmzs26/FTR.cc

