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; task-list and refinement parsing stays here, while execution-stage parsing is owned by the
Action layer through thin compatibility wrappers.
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,
the action extracts the tool result; ex.summary (heading block) and
ex.document are set. Details.run_exec() builds summaries on each Tool
in Details.tools(); on success Details sets exec_done (live path).
Action.Base.extract_tool(ResultParser) remains for legacy/test use
(returns a synthetic run; caller applies it to Details.tools).
See also:
List, Step,
Details, Tool
Content:
Properties:
- public Document document { get; }
Document built in constructor; extraction methods read from this.
- public string issues { get; set; }
Validation failure messages appended on each failure.
- public string proposal { get; set; }
Raw response string passed to the constructor.
Creation methods:
Methods:
- public async void extract_refinement (Details task)
Parses single-task refinement output.
- public async 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 async void parse_task_list_continue ()
Parses task list from document when the response is continue output.
Requires ## Goals / summary and ## Tasks; ignores ## Original prompt and ## Follow-up prompts if present. Sets
runner.pending.goals_summary_md directly (same as parse_task_list). Caller must set runner.pending to a fresh
List before calling. Caller appends the prompt-box message to runner.user_prompts
on success.
- public async 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, PhaseEnum phase)
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