agora.plan.predicate_registry
Named-predicate registry: the bridge between YAML plan references and runtime Predicates.
YAML plans reference postconditions by name + args. The registry maps
name → factory(**args) → Predicate. Factories must accept only JSON-
serializable kwargs — that constraint is what makes plans round-trippable.
The registered names and the predicate names the factories produce are kept
byte-for-byte identical to the inline patterns used in the runner scripts
(_postcond_file_exists etc.) so Specification.fingerprint hashes match
for structural round-trip tests.
All six factories from agora.fleet.runtime_postconditions are registered
eagerly at import, plus the four previously-inline helpers that are lifted out
of the runner scripts into this module as public factories.
Functions
|
Construct a |
|
Return a structured catalog of every registered predicate. |
Sorted list of registered predicate names (useful for generating docs + planner KB). |
|
|
|
|
|
|
v2.9 Phase 3 gate: every |
|
|
|
An artifact path containing |
The task must have called |
|
|
Every non-blank line of |
|
Plan-level gate: no single task in |
|
Plan-builder gate: every agent in the draft passes |
|
Plan-builder gate: every task in the draft must have ≥ 1 postcondition. |
|
Plan-builder gate: draft must carry ≥ |
|
Plan-builder gate: |
|
|
|
|
|
Decorator: register |
- agora.plan.predicate_registry.build_predicate(name, args=None)[source]
Construct a
Predicateby registered name + kwargs.
- agora.plan.predicate_registry.list_registered_predicates()[source]
Sorted list of registered predicate names (useful for generating docs + planner KB).
- agora.plan.predicate_registry.postcond_file_contains(rel, substring)[source]
rel(under work_dir) must contain the literalsubstring.
- agora.plan.predicate_registry.postcond_file_exists(rel)[source]
An artifact path containing
relmust be recorded by the task.
- agora.plan.predicate_registry.postcond_mark_complete()[source]
The task must have called
mark_complete(directly or auto-synthesized).
- agora.plan.predicate_registry.postcond_no_task_exceeds_complexity(plan_path, max_chars=3000, max_stages=3, max_postconditions=8)[source]
Plan-level gate: no single task in
plan_pathexceeds the budget.Loads the YAML at
plan_path(relative to work_dir), inspects every task, and fails if any task’s combined instruction length, stage count, or postcondition count exceeds the thresholds. Used by the plan-builder’sassemble_plantask to force decomposition via in-phase auto-retry.
- agora.plan.predicate_registry.postcond_py_compiles(rel)[source]
relmust parse viapy_compileAND have no module-scope undefined names.
- agora.plan.predicate_registry.register_predicate(name)[source]
Decorator: register
factoryundername.Factories must accept only JSON-serializable kwargs (
str,int,float,bool,list,dict). Callers should not register from within tests at import time — seetests/plan/conftest.pyfor the cleanup pattern if a test needs to add a predicate temporarily.