Skip to content

About

Safe text-decision to action execution loop

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

laya-hands

MIT License Python 3.10+ No dependencies

Safe text-decision to action loop. Deciders never touch the world; executors never choose.

demo window counting to 2

Loop

  1. Observe → text state + candidate actions
  2. Decide → exactly one action id + go/stop
  3. Execute → dry-run first, run, verify proof
  4. Repeat only on explicit go — never on its own

Use

from laya_hands import Action, run_loop

run_loop(observe, decide)  # decide returns (action_id, go); "" stops clean
  • observe() returns (state_text, [Action, ...])
  • decide(state_text, actions) returns (action_id, go: bool) — unknown ids raise, "" stops without acting
  • Action.execute() runs dry-run, then run, then verify (non-True proof raises)

Demo

python demo.py — drives its own tkinter window from 0 to 3 (widget reads + invoke, no blind keystrokes), verifies the label, self-closes:

state: count: 0
  - increment: press +1 once
did increment: count=1
...
stopped by decider
OK: 3 iterations, window closed clean

Sandbox rule: demos use their own window and verify OK.

Contributing

Small, scoped PRs. Stdlib only — keep it that way.

License

MIT

About

Safe text-decision to action execution loop

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages