ResultParser
Object Hierarchy:
Description:
public class ResultParser : Object
Parses structured markdown responses from the LLM into task data and results.
Purpose: Turn raw LLM output (planning, refinement, or executor responses) into in-memory structures (List/Step/Details) and fill task
properties. Validation failures are accumulated in issues so the
caller can retry or report.
Constructor builds a Markdown.Document; parse_task_list
, extract_refinement,
extract_exec, and
exec_extract each expect specific sections and populate
task_list / task / issues accordingly.
How it fits in the task flow:
- Planning: Runner receives the planning response → new ResultParser(this, response),
parse_task_list(); caller uses runner.pending and parser.issues.
- Refinement: Details.refine() receives the refinement response → new
ResultParser, extract_refinement(this); task is updated and
result_parser.issues checked.
- Execution: Tool.run() receives the executor response → new ResultParser,
exec_extract(ex); ex.summary and ex.document are set. Details.run_exec() builds
task.result from exec_runs summaries; on success Details sets exec_done.
extract_exec(Details) remains for legacy/test use (sets task.result only).
See also:
List, Step,
Details, Tool
Content:
Properties:
Creation methods:
- public ResultParser (Runner runner, string response)
Builds document from response (Markdown.Document.Render). Call
parse_task_list, extract_refinement, extract_exec, or exec_extract next.
Methods:
- public bool exec_extract (Tool ex)
Parse executor response into the given Tool (exec run). Called by
Tool.run(). On success sets ex.summary and ex.document; on failure appends to issues.
- public void extract_exec (Details task)
Fills in the result summary on the task from executor response.
- public void extract_refinement (Details task)
Parses single-task refinement output.
- public void parse_task_list ()
Parses task list from document; uses runner from constructor to
build Details. Builds into runner.pending only;
does not touch completed.
- public void parse_task_list_iteration ()
Parses task list from document when the response is tasks-only
(iteration output). Requires only ## Tasks and task sections; does not require or set Original prompt or Goals / summary. Caller must
preserve goals_summary_md from the existing list.
- public void validate_task (Details t)
Validates one task from a task list (initial or iteration): must not
contain Output; only allowed field names; required keys must be present. Appends to
issues when invalid. Call only after
List.fill_names has been run (during parsing, before this); this
method only reads the task name for issue messages and does not inject or set names.
Inherited Members:
All known members inherited from class GLib.Object
- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data
- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer
- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref