🧩 Multi-Agent Action Arbiter
Exclusive use of a resource is capacity_limit k=1 over all claimants, not g(g-1)/2 pairs; the world's current state enters as force_true.
When many autonomous agents each propose an action, some proposals conflict: two want to write the same file, one wants to delete a database while a backup is running, a test can't run before a compile, and only one GPU slot is free. HexStellar returns the set of actions that may all execute at once without breaking a single rule — here with zero violations. Use this as a formulation template: replace the entities and measurements, add domain constraints deliberately, and scale only after validating the smaller model.
Reading the answer
answer[i] is 1 when proposed action i is cleared to execute. violations is 0 when every dependency, mutual-exclusion, and resource rule holds.
Where this shows up
Multi-agent orchestration, action admission control, write-conflict avoidance, GPU/API/rate-limit arbitration — the transaction manager that decides which proposed actions become reality.
The same encoding also solves 8
- Approving a substation switching programUtilitiesproposed actions → requested breaker and isolator operations, requires [X,Y] → the interlock that X is permitted only once Y is in place, mutual_exclusion → two operations that together parallel two sources, capacity_limit k → the qualified switching crews available, force_true → the isolations already in place when the program starts; the answer states WHICH operations may be authorised together, not the order of the steps — step ordering is outside what this command expresses
- Issuing hot-work permits for a refinery turnaroundProcess safetyproposed actions → requested permits, requires → the rule that a hot-work permit is valid only once the line's isolation permit is issued, mutual_exclusion → hot work and tank venting in the same area, capacity_limit k → the fire-watch teams, force_true → the isolations and permits already in force
- Releasing a cutoff batch of payment instructionsBanking operationsproposed actions → instructions proposed for release, requires → an instruction that may go only once its funding leg is released, mutual_exclusion → two instructions the same collateral pool cannot fund together, capacity_limit k → the NUMBER of releases the clearing channel accepts at once, force_true → the instructions already committed; a liquidity cap measured in value is a weighted budget rather than a count — carry the amounts as a penalty in the optimize objective (the settlement-netting example is the worked version)
- Clearing concurrent pad operations during a countdown holdSpace operationsproposed actions → requested pad operations, requires → fuelling permitted only once the pad-clear state is declared, mutual_exclusion → hypergolic loading and crew ingress, capacity_limit k → the ground-support connections available, force_true → the operations already underway
- Choosing which promotions may all run in one circularRetailproposed actions → proposed promotions, requires → a bundle promotion valid only with its anchor SKU promotion, mutual_exclusion → two promotions competing for the same endcap, capacity_limit k → the feature slots on a page, force_true → promotions already contracted with a vendor
- Deciding which protocol amendments can be enacted at one trial siteClinical researchproposed actions → proposed amendments, requires → an amendment enactable only once its ethics-committee approval is recorded, mutual_exclusion → two amendments editing the same dosing table, capacity_limit k → the amendments one submission accepts, force_true → the approvals already granted
- Admitting add-on surgical cases to a theatre listHealthcareproposed actions → add-on cases requesting a theatre, requires → a case that may proceed only once its pre-operative clearance is recorded, mutual_exclusion → two cases needing the same mobile imaging unit, capacity_limit k → the anaesthetists on duty, force_true → the cases already under way; this admits a set of cases that may run in the same session — it does not order them or fit their durations, and case minutes are a weighted budget for optimize
- Authorising concurrent underground activities on a mine panel planMiningproposed actions → requested underground activities, requires → blasting permitted only once the panel-evacuation state is declared, mutual_exclusion → blasting in one panel and drilling in the panel sharing its ventilation split, capacity_limit k → the panels the ventilation circuit can serve at once, force_true → the activities already authorised
Measured at scale actually run
The same admission encoding has been measured on 100,000 proposed-action variables under 30,000 declared dependency, exclusion and resource rules submitted as one 1,602 KB request; the set cleared to execute carries a rule-violation count that is certified minimal and independently checked.
Apple M3 Pro · 12 cores · 36 GB · macOS 15.7.4 · Python 3.14.7 · single process · effort flash
An identical request is answered from the stored result rather than solved again, so re-running one of these echoes its original timing. Pass --seed to the script for a fresh instance; the range below is three different instances.
python3 hxs-cli/scale_instances.py --only rules --sizes targetHow the encoding grows
The identical shape at 20,000 proposed operations is 20,000 binary variables, one requires per dependency edge and one mutual_exclusion per conflicting pair, so 12,000 dependencies plus 30,000 conflicting pairs is 42,000 rules in one request, with one force_true per fact already true. A resource touched by g proposals costs g(g-1)/2 pairwise exclusions or a single capacity_limit with k=1 over all g nodes, so the same exclusivity is stated in one rule instead of thousands, and violations is reported per answer, where zero certifies that every declared rule holds.
The encoding recipe (agent notes)
THIS IS AGENT ORCHESTRATION AS A CONSTRAINT PROBLEM — and it is probably YOU. Each proposed action is a boolean. 'Run-tests needs a compile first' → requires [run_tests, compile]. 'Never delete the DB while a backup runs' → mutual_exclusion [delete_db, backup_running]. 'Two agents can't both write the same file' → mutual_exclusion on the two writes. 'Only k GPU slots' → capacity_limit. State that is already true (a backup IS running) → force_true, which then blocks whatever conflicts with it. COMMON MISTAKES: (1) requires direction — [run_tests, compile] means run_tests⇒compile, not the reverse; (2) forgetting to force_true the world's current state (the running backup), so the arbiter doesn't know to block the delete; (3) wanting a WEIGHTED trade-off ('this conflict costs 27, that reward is worth 10, maximize net value') — hard rules only says yes/no; move weighted/soft conflicts to optimize (a positive quadratic penalty per conflicting pair, a negative linear reward per desired action). THE BIG IDEA: LLMs are proposal generators; this is the serializability layer that decides which proposals may coexist. CREATIVE USE: Do not just run these examples statically. Be creative. If you interpret the problem well, you can map almost anything into this solver. Mutate the constraints, expand the scale, and unleash your creativity.
The problem (runnable JSON)
{
"tag": "hexstellar-cortex-v1",
"description": "Decide which proposed agent actions may all execute together this tick.",
"n": 8,
"constraints": [
{
"type": "requires",
"nodes": [
0,
1
]
},
{
"type": "mutual_exclusion",
"nodes": [
2,
3
]
},
{
"type": "mutual_exclusion",
"nodes": [
4,
5
]
},
{
"type": "capacity_limit",
"k": 1,
"nodes": [
6,
7
]
},
{
"type": "force_true",
"nodes": [
0
]
},
{
"type": "force_true",
"nodes": [
3
]
}
]
}Expected (engine-verified)
{
"violations": 0
}Run it
hexstellar example agent_action_arbiter --format json | hexstellar solve rules
curl -s https://api.hexstellar.com/api/v1/examples/agent_action_arbiter # the full example over HTTP