GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - amor-fati-systems/amor-fati: Stock-Flow Consistent Agent-Based Macroeconomic Engine

BranchesTags
Open more actions menu

Latest commit

 

History

680 Commits
680 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
integration-tests/src/test/scala/com/boombustgroup/amorfati/integration
integration-tests/src/test/scala/com/boombustgroup/amorfati/integration
 
 
modules
modules
 
 
project
project
 
 
scripts
scripts
 
 
.coderabbit.yaml
.coderabbit.yaml
 
 
.envrc.example
.envrc.example
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.jvmopts
.jvmopts
 
 
.scalafmt.conf
.scalafmt.conf
 
 
CITATION.cff
CITATION.cff
 
 
CLA.md
CLA.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.sbt
build.sbt
 
 
flake.lock
flake.lock
 
 
flake.nix
flake.nix
 
 

Repository files navigation

AMOR FATI

Stock-Flow Consistent Agent-Based Macroeconomic Engine

Ducunt volentem fata, nolentem trahunt.
The fates lead the willing; they drag the unwilling.
— Cleanthes, quoted by Seneca, Epistulae Morales 107.11


Status

Quality Gates

CI Coverage Generated outputs CLA
CI Coverage Generated outputs guarded CLA assistant

Research and Accounting Contract

Exact SFC identities Verified ledger Empirical validation
15 exact SFC identities Verified ledger with Stainless and Z3 Empirical validation snapshot

Operational Diagnostics

Diagnostics smoke Diagnostics nightly Diagnostics extended
Diagnostics Smoke Diagnostics Nightly Diagnostics Extended
Profiling smoke Profiling nightly Profiling extended
Hot-Path Profiling Smoke Hot-Path Profiling Nightly Hot-Path Profiling Extended

A ledger-first SFC-ABM of the Polish economy where every monetary flow is accounted for. Firms produce, households consume, banks lend, the central bank sets policy, the government taxes and spends, the external sector trades and moves capital — and the books must balance. Always.

Amor Fati is a stock-flow consistent (SFC) agent-based model (ABM) that simulates the Polish economy at the level of individual households, heterogeneous firms, and a ten-row banking-sector archetype system. The engine enforces 15 exact accounting identities each month — if a single zloty goes missing, the simulation fails.

The key design principle is simple:

Macro stories can be wrong. The ledger cannot.

This engine is built on top of the separately verified amor-fati-ledger flow interpreter, checked out as a Git submodule under modules/ledger. The practical consequence is that the strongest invariant in the entire project is not "inflation should look smooth" or "GDP should converge nicely after 10 years". It is this:

The books must balance to the end of the universe.

That is the hard floor under every experiment in the model. Behavioral rules, policy heuristics, and long-horizon dynamics can be revised, recalibrated, or replaced. The accounting layer cannot silently drift.

Table of Contents

  1. Why
  2. What Is Technically Distinctive
  3. Core Invariants
  4. State Ontology
  5. Verified Ledger
  6. Documentation
  7. Ledger-Derived Matrix Artifacts

Why

Standard macro models (DSGE) assume representative agents and rational expectations. Reality has neither. Amor Fati models the economy from the bottom up: thousands of heterogeneous agents making bounded decisions, interacting through markets, generating emergent macro dynamics.

Counterfactual analysis through code. Want to test a policy hypothesis? Fork the repo, modify the mechanism, run the simulation, compare. The model is the experiment.

What Is Technically Distinctive

Amor Fati is not just an ABM with accounting checks bolted on afterwards. The project combines several layers that are rarely pushed into one executable research engine:

  • heterodox macroeconomics and SFC discipline
  • heterogeneous-agent ABM microstructure
  • a runtime ledger execution layer backed by formal verification work
  • a data-oriented mutable execution substrate for performance
  • explicit state ontology separating behavioral state, macro state, and financial state

The result is a model where macro dynamics, institutional behavior, and monetary plumbing are all first-class parts of the implementation rather than separate narratives.

Core Invariants

The project is built around a few non-negotiable invariants:

  • executed financial flows must conserve value exactly at runtime
  • SFC validation must preserve 15 exact semantic accounting identities
  • financial execution must not depend on ad hoc mutable bookkeeping outside the ledger path
  • behavioral rules may change, but accounting consistency must remain hard-constrained

This is the core philosophy of the engine: theories may evolve, but broken plumbing is not an acceptable macro result.

State Ontology

Amor Fati uses a hybrid runtime ontology rather than a single undifferentiated world object:

  • behavioral populations
    • households, firms, and banks carry heterogeneous agent state and decision logic
  • macro and market state
    • prices, policy, external conditions, and inter-step signals live in the macro runtime layer
  • ledger-owned financial state
    • supported financial balances are kept in an accounting-controlled stock layer and projected into runtime execution and validation

This split is intentional. It keeps rich agent behavior where object-level modeling is useful, while moving accounting-critical execution into a stricter ledger substrate.

Verified Ledger

Most macro models treat accounting consistency as a secondary validation step. Amor Fati does not.

The simulation pipeline is anchored to the verified amor-fati-ledger layer that enforces the project’s stock-flow constraints at runtime. In other words:

  • macro behavior is experimental
  • agent rules are revisable
  • accounting identities are non-negotiable

This is why Amor Fati is useful even when the long-run path is still being calibrated. If a branch generates a bad macro regime, that may be a modeling problem. If the ledger breaks, the simulation itself is wrong.

That distinction matters. A nonlinear ABM can explore unstable, surprising, even pathological futures. But it should never "lose money" in the plumbing.

Documentation

Start with the model card for intended use, evidence status, and limitations; continue with the model specification for scientific review, the SFC + ABM reading map if the combined modeling tradition is new to you, or the architecture documentation for code-facing orientation. For the complete documentation index, use docs/README.md:

Scientific and Model Path

Step Entry point Boundary
0. Scope and limitations Model card Intended use, uses outside scope, evidence status, known limitations, reproducibility, and responsible interpretation.
Optional background SFC + ABM reading map Orientation for readers new to stock-flow consistent agent-based macroeconomics and Amor Fati's ledger-first stance.
1. Model specification and ODD Model specification and ODD / ODD+D model documentation Model identity, scope, entities, scheduling, state vector, month timing, equation families, stochasticity, limitations, and pointers to detailed sector documents.
2. SFC evidence boundary SFC matrix evidence and model equations to SFC map Hand-maintained entry points for generated BSM/TFM snapshots, exact identities, runtime mechanism mapping, and stock-flow reconciliation evidence.
3. Calibration evidence Calibration register and data bridge Parameter provenance, empirical sources, transformations, assumptions, and visible calibration gaps.
4. Validation evidence Empirical validation report and engine invariants Empirical snapshot workflow, normal-path expectations, hard invariants, warnings, and known limitation surfaces.

Engineering and Operations Path

Step Entry point Boundary
1. Code architecture Architecture documentation Code-facing map of package boundaries, the runtime loop, state and ledger ownership, extension points, and architecture decision records.
2. Operational appendices Operations Entry point for commands, CI ownership, diagnostics/profiling routing, generated-output guards, scenarios, robustness, and local artifacts.

Ledger-Derived Matrix Artifacts

Generated SFC snapshots live under docs/sfc-matrix-artifacts/, but they are not a separate README reading path:

Step Entry point Boundary
1. Generated matrix snapshots SFC matrix artifacts Generated BSM/TFM snapshots, matrix mapping, flow-mechanism semantics, and stock-flow reconciliation artifacts.
2. Evidence and regeneration SFC matrix evidence Regeneration commands, sign conventions, exact reconciliation rows, and coverage gaps.
3. Equation mapping Model equations to SFC map Hand-maintained bridge from model equation families to generated rows, identities, and runtime evidence.

Tech Stack

Scala Stainless Z3 sbt

Contributing

See CONTRIBUTING.md for the development and research review requirements. External contributions require acceptance of the Contributor License Agreement before merge.

License

GNU AGPLv3 (AGPL-3.0-only) — Copyright 2026 BoomBustGroup

About

Stock-Flow Consistent Agent-Based Macroeconomic Engine

boombustgroup.com

Topics

abmagent-based-modelcomplexity-economicscounterfactual-analysismacroeconomicsscala3sfcsfc-abmsimulationstock-flow-consistent

Resources

Readme
AGPL-3.0 license

Contributing

Contributing
Activity
Custom properties

Stars

3 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.