cosmergon-decider-tree
Rule-based tree decider for Cosmergon api-agents — deterministic, no inference, latency well under 10 ms.
Implements the Decider protocol from cosmergon-agent 0.13.0+.
The branch logic follows Cosmergon's default decision tree for api-agents; the
thresholds are inspired by the conditional sequences of cosmergon-pet.
Architektur
state (GameState)
│
├─ persona = state.persona_type or "scientist"
▼
PERSONA_TREES[persona] (list of (condition, action_fn) tuples)
│
├─ first matching condition wins
▼
(action, params) ← optional Compass-Modulation
Sechs Persona-Bäume (scientist / warrior / expansionist / trader / diplomat / farmer), gemeinsamer Survival-Header (critical-energy → wait, 0-fields → create_field, empty-field → place_cells block) und gemeinsamer Wachstums-Fallback (fewest-cells, wait).
Usage
from cosmergon_decider_tree import TreeDecider
decider = TreeDecider() # no config — fully deterministic
# In runner-loop:
async with CosmergonAgent(api_key=..., base_url="https://cosmergon.com") as agent:
while True:
await agent.refresh_state()
action, params = await decider.decide(agent.state)
await agent.act(action, **params)
await asyncio.sleep(90)
Vorteile
- Deterministisch: identischer State → identische Action.
- Schnell: <10 ms pro
decide()-Call (lambda-evaluation, kein Modell-Load). - Interpretierbar: Branch-Liste ist lesbar, Debug-fähig.
- Offline-fähig: kein LLM-Provider, kein Modell-File, läuft auf jedem ARM-Linux mit Python 3.10+.
Begrenzung
- Lernt nicht: Cosmergon-Mechanik-Änderungen (neue Action-Klassen, geänderte Konditions-Schwellen) brechen Tree → klare Versions-Bindung an SDK + Backend-Stand.
- Persona-Bäume teils ähnlich: Konzept §3.2 hat das adressiert, Differenzierung muss strukturiert sichtbar sein.
Tests
cd research/decider-cluster/decider-tree
pip install -e '.[dev]'
pytest -q
Metadata
Release files for cosmergon-decider-tree 2.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cosmergon_decider_tree-2.3.5.tar.gz | 31.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cosmergon_decider_tree-2.3.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.8 kB
Release files / cosmergon_decider_tree-2.3.5.tar.gz
| Download URL | cosmergon_decider_tree-2.3.5.tar.gz |
|---|---|
| Size | 31.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c043f454a87e0f150f89fa783535b7f1931ca7e906e96b729d31fe05be917159
|
|
BLAKE2b-256 checksum How to use checksums |
337c265ad0a82a2a258dc39700be1f8cc318c26df6147631b59c7831d06964f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / cosmergon_decider_tree-2.3.5-py3-none-any.whl
| Download URL | cosmergon_decider_tree-2.3.5-py3-none-any.whl |
|---|---|
| Size | 26.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
46673869e18fb8f8e02603f25884c08ba6e1421a834f63171be9489d932e8d4f
|
|
BLAKE2b-256 checksum How to use checksums |
b651622c5ca1277e6b40faf95d2cfbc47d256df6b2c515846ad27d70ea96bfe8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency log