laife.llm.mission
¶
Mission for the player to complete.
Classes:
-
Mission–A mission composed of ordered mission steps.
-
MissionHistory–Collection of mission history entries.
-
MissionHistoryEntry–History entry of a mission.
-
MissionStatus–Status of the mission.
Attributes:
-
MAX_MISSION_FAILURES(int) –Number of consecutive build/craft failures before a mission is marked FAILED.
MAX_MISSION_FAILURES
module-attribute
¶
Number of consecutive build/craft failures before a mission is marked FAILED.
Mission
¶
Bases: BaseModel
A mission composed of ordered mission steps.
Methods:
-
active_focus–Return the deepest active sub-mission, or self if none.
-
add_sub_mission–Add a sub-mission to the mission.
-
advance–Activate the next pending step.
-
is_terminal–Return True when the mission has reached a final state (COMPLETED or FAILED).
-
record_action_failure–Record a failed build or craft action.
-
record_action_success–Record a successful build or craft action and mark the mission COMPLETED.
-
to_prompt–Return the mission as a prompt.
active_focus
¶
Return the deepest active sub-mission, or self if none.
add_sub_mission
¶
Add a sub-mission to the mission.
advance
¶
Activate the next pending step.
Returns True if a new step was activated, False if all steps are done. When all steps are done, marks self as COMPLETED and propagates upward.
Source code in src/laife/llm/mission.py
is_terminal
¶
Return True when the mission has reached a final state (COMPLETED or FAILED).
record_action_failure
¶
Record a failed build or craft action.
Increments the consecutive failure counter. When the counter reaches
max_failures the mission is marked FAILED.
Source code in src/laife/llm/mission.py
record_action_success
¶
Record a successful build or craft action and mark the mission COMPLETED.
to_prompt
¶
Return the mission as a prompt.
Steps that match focus are prefixed with [FOCUS] so the LLM
knows exactly which sub-mission to work on.
Source code in src/laife/llm/mission.py
MissionHistory
¶
Bases: BaseModel
Collection of mission history entries.
Methods:
-
add_history_entry–Add a history entry to the mission.
-
to_prompt–Return the history as a prompt.