Syntropy.TaskScheduler.SourceInquiry (syntropy v0.2.0)

Copy Markdown

Source-review inquiry pipeline for task runs.

Expands the static source-review evidence packet through the librarian source tool, either by executing a model-planned inquiry (parsed from strict JSON) or the deterministic read-only fallback. Also assesses inquiry quality for run envelopes and aggregates per-attempt inquiry metadata.

Summary

Functions

Inquiry quality shown while a run is still executing.

Empty inquiry metadata for runs without source-review expansion.

Flattens expanded evidence across all agent attempts.

Inquiry quality for runs that failed before inquiry expansion completed.

Assesses inquiry quality for a finished run from its attempts and the attached source review/tool context.

Flattens inquiry rounds across all agent attempts.

Expands source evidence for one agent when both a source review and a source tool are attached; otherwise passes the review through untouched.

Attaches expanded evidence to the source review packet.

Flattens source-tool attempts across all agent attempts.

Bounded source-tool timeout parsed from the source tool context.

Types

inquiry_meta()

@type inquiry_meta() :: %{
  inquiry_rounds: [map()],
  tool_attempts: [map()],
  expanded_evidence: [map()],
  warnings: [String.t()]
}

Functions

active_inquiry_quality(source_review, source_tool)

@spec active_inquiry_quality(map() | nil, map() | nil) :: map() | nil

Inquiry quality shown while a run is still executing.

empty_inquiry_meta()

@spec empty_inquiry_meta() :: inquiry_meta()

Empty inquiry metadata for runs without source-review expansion.

expanded_evidence(attempts)

@spec expanded_evidence([map()]) :: [map()]

Flattens expanded evidence across all agent attempts.

failed_inquiry_quality(source_review, source_tool)

@spec failed_inquiry_quality(map() | nil, map() | nil) :: map() | nil

Inquiry quality for runs that failed before inquiry expansion completed.

inquiry_quality(attempts, source_review, source_tool, expanded_evidence)

@spec inquiry_quality([map()], map() | nil, map() | nil, [map()]) :: map() | nil

Assesses inquiry quality for a finished run from its attempts and the attached source review/tool context.

inquiry_rounds(attempts)

@spec inquiry_rounds([map()]) :: [map()]

Flattens inquiry rounds across all agent attempts.

maybe_expand_source_evidence(agent, prompt, source_review, source_tool)

@spec maybe_expand_source_evidence(map(), String.t(), map() | nil, map() | nil) ::
  {map() | nil, inquiry_meta()}

Expands source evidence for one agent when both a source review and a source tool are attached; otherwise passes the review through untouched.

Returns {source_review_for_agent, inquiry_meta}.

source_review_with_expanded(source_review, expanded_evidence)

@spec source_review_with_expanded(map() | nil, [map()]) :: map() | nil

Attaches expanded evidence to the source review packet.

tool_attempts(attempts)

@spec tool_attempts([map()]) :: [map()]

Flattens source-tool attempts across all agent attempts.

tool_timeout_ms(source_tool)

@spec tool_timeout_ms(map()) :: pos_integer()

Bounded source-tool timeout parsed from the source tool context.