On this page
Fragment providers assembling the agent prompt: task preamble, task prompt, constraints, notepad entries, verified/stale lessons, and prior-failure context, each at a fixed priority.
#scheduler.src.orxtra.scheduler._prompt_providers
#scheduler.src.orxtra.scheduler._prompt_providers
Fragment providers for scheduler prompt assembly.
Each provider generates Fragment(s) for one layer of the assembled agent prompt. Providers read from scheduler state and produce content matching the exact format of the old inline string construction, preserving golden-output equivalence.
Priority ordering (ascending = earlier in output): 10 - task preamble (task ID + start_task instruction) 20 - task prompt (the user's prompt text, after variable substitution) 30 - constraints 40 - notepad 50 - lessons (verified) 55 - lessons (stale) 60 - prior failure context
#_load_template
def _load_template(name: str) -> strLoad a .md template from the prompts/ directory.
#TaskPreambleProvider
Produces the task-ID preamble fragment.
Context keys: task_id (str)
#fragments
def fragments(self, context: dict[str, Any]) -> list[Fragment]#TaskPromptProvider
Produces the task prompt fragment (after variable substitution).
The task prompt is passed in via context["task_prompt"] already resolved (variables substituted by the caller before composition).
#fragments
def fragments(self, context: dict[str, Any]) -> list[Fragment]#ConstraintsProvider
Produces the active constraints fragment.
Context keys: constraints (list of (text, tier) tuples)
#fragments
def fragments(self, context: dict[str, Any]) -> list[Fragment]#NotepadProvider
Produces the notepad section fragment.
Renders notepad entries grouped by type. The notepad module provides data-only APIs; all rendering lives here.
Context keys: notepad_entries (list[NotepadEntry])
#fragments
def fragments(self, context: dict[str, Any]) -> list[Fragment]#_render_notepad
def _render_notepad(entries: list[NotepadEntry]) -> strRender notepad entries to markdown grouped by type.
#LessonsProvider
Produces lesson fragments (verified and/or stale).
Context keys: lessons (list of dicts with 'text' and 'stale' keys)
#fragments
def fragments(self, context: dict[str, Any]) -> list[Fragment]#FailureContextProvider
Produces the prior failure context fragment.
Context keys: attempt (int) - current attempt number retry_inject_failure (bool) - whether to inject failure context prior_attempts (list of dicts with 'attempt' and 'error' keys)
#fragments
def fragments(self, context: dict[str, Any]) -> list[Fragment]