{
  "handle": "Budget",
  "mechanism": "A quantified allocation of resources (compute, time, energy) that bounds execution against a finite pool. Whether the bound is enforced strictly or admits overdraft is a descendant concern; what Budget fixes is that consumption is accounted for rather than merely permitted.",
  "gloss": "Resource allocation limit",
  "data_schema": {
    "type": "object",
    "required": [
      "total",
      "remaining",
      "unit"
    ],
    "properties": {
      "total": {
        "type": "number",
        "description": "The initial allocated amount"
      },
      "remaining": {
        "type": "number",
        "description": "The current available amount"
      },
      "unit": {
        "type": "string",
        "enum": [
          "Tokens",
          "USD",
          "Ms"
        ],
        "description": "The unit of measurement"
      }
    }
  },
  "invariants": [
    "{{conservation}} of account: every change to Remaining corresponds to a recorded consumption or refund."
  ],
  "preconditions": [
    "Total budget defined"
  ],
  "postconditions": [
    "Budget decremented by cost"
  ],
  "_meta": {
    "tier": 1,
    "ring": 0,
    "supersedes": [
      "sema:Budget#mh:SHA-256:a7637c4387d834ae190f6c42a2a96914c65294a9f618c4c96adf4ee1d26450e0",
      "sema:Budget#mh:SHA-256:f2f58874eaeb0600039600ba5b26064164c225fd44482b269ae94e37a9df15b4"
    ],
    "path": [
      "Infrastructure",
      "Primitives"
    ],
    "related": [
      "Limitlisten#bb16"
    ]
  },
  "sema_id": "sema:Budget#mh:SHA-256:4e3e536c9ecec8c1b0af017cfd0a26ba00e9f96047de4a690bf9d3db7f3720ef",
  "sema_ref": "Budget#4e3e",
  "sema_stub": "4e3e",
  "dependencies": {
    "references": {
      "conservation": "sema:Conservation#mh:SHA-256:0b32d007b27a9b5201c46931bdbabd09d08ff9d7b01cf49469f61709989507c2"
    }
  },
  "sema_layer": "Infrastructure",
  "sema_category": "Primitives",
  "used_by": {
    "references": {
      "Bid": "sema:Bid#mh:SHA-256:647f5a901a75ad0c5535dd1a16a2e2eb1f4295d88e55b592f101ea393c9d23b1",
      "BoundedTask": "sema:BoundedTask#mh:SHA-256:86dd552006f7636198f5d54e1beec2c5fa82b1f19aaf41ad8b45eecf9089b8fc",
      "BreadthGovernor": "sema:BreadthGovernor#mh:SHA-256:be54a4887d50ae1a49139c6c97d29a349c581d1af8f25f8554b13119700dd4d2",
      "CapacityPressure": "sema:CapacityPressure#mh:SHA-256:f06c432726ee48412ac4a49e9fa9ddc1a7272a298eaf984a9fef86e3fbcdf261",
      "ComputeBudget": "sema:ComputeBudget#mh:SHA-256:4091ac7c6677342920dc53808d02830e35c5849f2af1bb9ba7749c576d37478e",
      "EmpathySim": "sema:EmpathySim#mh:SHA-256:33c4c1083c17544686139953481e1467b780ec974093cbe6831cc710a5621d0a",
      "Estimate": "sema:Estimate#mh:SHA-256:3bacc0606623a0603b271a835b54157c2e86389c4282af86d88cd1ddd9ecf917",
      "ExploreExploit": "sema:ExploreExploit#mh:SHA-256:218caa1bcd426b768ebb675c78bc12e55581367814b2b2397383bb3e3e4dcdbc",
      "HeuristicSnap": "sema:HeuristicSnap#mh:SHA-256:d683f415a9eabd2639464e981993ed784e7f9aed6800f92abe66182df817696f",
      "Limitlisten": "sema:Limitlisten#mh:SHA-256:bb16937632262c1fd9e6ee5c993172fa531b8aede4d401bec94c498eadab914c",
      "MarginalValueRule": "sema:MarginalValueRule#mh:SHA-256:661109205c507b2c26d683d091de7f8b782bf2d6c2e9192373b242a9b078ac71",
      "OpportunityCost": "sema:OpportunityCost#mh:SHA-256:7f526c52acf919aabffa14287cd4ed442fb4c419a6ad78cfe0de1cf19d6146da",
      "Realizable": "sema:Realizable#mh:SHA-256:2ed7d7f05fe50ff38d46631e5334f2229c4c1f1118e0576d88388b23a586d622",
      "RealizationProtocol": "sema:RealizationProtocol#mh:SHA-256:68fbd05d6135b73ef53db0366e69f4927e5f92f9dd88fa7b79c0a6022e4962ca",
      "Resource": "sema:Resource#mh:SHA-256:0e5e5e6735fa9ee49f7e623029d977e435625b8ad05b28f83f962683a0ebb19b",
      "RootSolver": "sema:RootSolver#mh:SHA-256:f7f5a39c4d93545b506ddc3eeb03660295425657486a5ab1f71811cb8e5816ca",
      "SolverNode": "sema:SolverNode#mh:SHA-256:f895214a9b07066f4043d55d3b260e8a788bda0150b9d8fda20eafa91b846116",
      "SolverTree": "sema:SolverTree#mh:SHA-256:e275a01a2ced22c7412f23780f4bfa84ca171e9184f29d65336c24baddcc4052",
      "TimeboxThink": "sema:TimeboxThink#mh:SHA-256:20182c7afcb60ec0d13507de50123012afb9c590297d0e3b650ccfcdd58bfaf3",
      "Work": "sema:Work#mh:SHA-256:f0c3ba2d663c900244d2ed814ed3682c56a867aa32bc3c4dfd1b19fe311aa2c6"
    }
  }
}
