Rule-based tree decider for Cosmergon api-agents (deterministic, no inference)
Project description
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+.
Branch-Logik aus docs/konzepte/konzept-default-entscheidungsbaum-api-agents.md
§3 plus Pet-S165-L1-Conditional-Sequences als Schwellen-Inspiration.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cosmergon_decider_tree-2.0.2.tar.gz.
File metadata
- Download URL: cosmergon_decider_tree-2.0.2.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3bed1a8fc70d8bdb14ce51e9cb2aee916c39cb0db35cd34e6a8ae4de4fa2ab9
|
|
| MD5 |
e00a4751e3a090dc5c5580984bc28493
|
|
| BLAKE2b-256 |
2a2e4ca63eaa267c8d851112e99af1b14ac6586b6959a7a474791db5513a0444
|
Provenance
The following attestation bundles were made for cosmergon_decider_tree-2.0.2.tar.gz:
Publisher:
publish.yml on rkocosmergon/cosmergon-decider-tree
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cosmergon_decider_tree-2.0.2.tar.gz -
Subject digest:
d3bed1a8fc70d8bdb14ce51e9cb2aee916c39cb0db35cd34e6a8ae4de4fa2ab9 - Sigstore transparency entry: 1703128078
- Sigstore integration time:
-
Permalink:
rkocosmergon/cosmergon-decider-tree@17884dfe36049bcf0bb853a91df77309664918f3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/rkocosmergon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@17884dfe36049bcf0bb853a91df77309664918f3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file cosmergon_decider_tree-2.0.2-py3-none-any.whl.
File metadata
- Download URL: cosmergon_decider_tree-2.0.2-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
898c1e3133c74a99509877fc4d21c6bae0882ea45c36f17ed94c5f67acd04bb2
|
|
| MD5 |
bb8d5c6f6ae1635fc2b0e486247039a6
|
|
| BLAKE2b-256 |
f5a521bf2e57d7b9098fc085e6065cbf8624a3feb047a10b6aa00d6e1865de83
|
Provenance
The following attestation bundles were made for cosmergon_decider_tree-2.0.2-py3-none-any.whl:
Publisher:
publish.yml on rkocosmergon/cosmergon-decider-tree
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cosmergon_decider_tree-2.0.2-py3-none-any.whl -
Subject digest:
898c1e3133c74a99509877fc4d21c6bae0882ea45c36f17ed94c5f67acd04bb2 - Sigstore transparency entry: 1703128228
- Sigstore integration time:
-
Permalink:
rkocosmergon/cosmergon-decider-tree@17884dfe36049bcf0bb853a91df77309664918f3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/rkocosmergon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@17884dfe36049bcf0bb853a91df77309664918f3 -
Trigger Event:
workflow_dispatch
-
Statement type: