langgoap.pipeline_plan#
- pipeline_plan(start, goal, actions, blacklisted_actions=None, *, max_alternatives=5, tracer=None, record_expansions=False)#
Two-phase planning: A* finds sequences, CSP validates/optimizes.
- Parameters:
start (PlanningState | dict[str, Any]) – Current world state. Accepts a plain
dictfor convenience; it will be coerced toPlanningStateinternally.goal (GoalSpec) – Goal specification with target conditions, constraints, objectives.
actions (list[ActionSpec]) – Available actions.
blacklisted_actions (list[str] | None) – Action names to exclude.
max_alternatives (int) – Maximum number of alternative plans to generate when the primary plan fails CSP validation.
tracer (Any) – Optional
PlanningTracerwhoseon_search_expand/on_search_dead_endhooks receive primary-search expansions and pipeline-level dead-end events (e.g.csp_infeasible). The pipeline owns a singleon_search_completeemission for the logical plan call — alternative-enumeration A* runs do not re-emit completions.record_expansions (bool) – Opt-in gate for the per-expansion firehose. Must be
Trueand a tracer supplied for any hook to fire.
- Returns:
A
Planwithmetadata.cspattached. When CSP finds the primary plan feasible it is returned directly. When all alternatives are also infeasible the primary plan is returned withCSPStatus.INFEASIBLEmetadata — the CSP layer is advisory and does not block graph execution; inspectplan.metadata.csp.statusto decide whether to proceed. ReturnsNoneonly when A* cannot find any plan at all.- Return type:
Plan | None