Documentation
¶
Overview ¶
Package result defines the normalized output envelope for all Prism agents.
Index ¶
Constants ¶
const ( StatusOK = "ok" StatusError = "error" StatusValidationFail = "validation_fail" StatusTimeout = "timeout" )
Status values for RunResult.
const ( ConfidenceHigh = "high" ConfidenceMedium = "medium" ConfidenceLow = "low" ConfidenceNone = "" )
Confidence levels that local models may emit.
const DefaultCompactMaxChars = 400
Variables ¶
This section is empty.
Functions ¶
func ResolveDecisionSchema ¶ added in v0.1.34
func ResolveDecisionSchema(schema map[string]any) (*jsonschema.Resolved, error)
ResolveDecisionSchema accepts a bounded self-contained schema. Remote refs are rejected: request validation must not fetch arbitrary external resources.
Types ¶
type Artifact ¶
type Artifact struct {
Type string `json:"type,omitempty"` // snippet | url | file | command_output
Label string `json:"label,omitempty"`
Content string `json:"content"`
}
Artifact is an inline data artifact returned by the model.
type DoctorCheck ¶
type DoctorCheck struct {
Name string `json:"name"`
Status string `json:"status"` // ok | warn | fail
Message string `json:"message,omitempty"`
}
DoctorCheck holds the result of a single connectivity or config check.
type DoctorResult ¶
type DoctorResult struct {
RuntimeEngine string `json:"runtime_engine,omitempty"`
RuntimeEndpoint string `json:"runtime_endpoint,omitempty"`
RuntimeModel string `json:"runtime_model,omitempty"`
OllamaHost string `json:"ollama_host"`
AgentDir string `json:"agent_dir"`
SkillsDir string `json:"skills_dir"`
AgentCount int `json:"agent_count"`
SkillCount int `json:"skill_count"`
Checks []DoctorCheck `json:"checks"`
Status string `json:"status"` // ok | degraded
}
DoctorResult is the structured output of prism config doctor and the MCP doctor tool.
type Finding ¶
type Finding struct {
Severity string `json:"severity,omitempty"` // info | warning | error
Text string `json:"text"`
}
Finding is one discrete observation or diagnostic item.
type RunResult ¶
type RunResult struct {
Decision map[string]any `json:"decision,omitempty"`
LinearActions map[string]any `json:"linear_actions,omitempty"`
NextAction any `json:"next_action,omitempty"`
AgentID string `json:"agent_id"`
Model string `json:"model"`
Status string `json:"status"`
Summary string `json:"summary"`
Findings []Finding `json:"findings"`
Artifacts []Artifact `json:"artifacts"`
Confidence string `json:"confidence,omitempty"`
Usage Usage `json:"usage"`
// SkillsUsed lists the skill names that were attached to this invocation.
SkillsUsed []string `json:"skills_used,omitempty"`
// ConstitutionSource identifies how the constitution was resolved:
// "path" (constitution_path field), "body" (inline spec body), or
// "legacy" (constitutions/<id>.md fallback).
ConstitutionSource string `json:"constitution_source,omitempty"`
// ContextBudget is the context_budget value from the agent spec.
ContextBudget int `json:"context_budget,omitempty"`
// PromptSizeEstimate is the estimated character count of the assembled
// system prompt before it was sent to the model.
PromptSizeEstimate int `json:"prompt_size_estimate,omitempty"`
// ContextBudgetExceeded is true when the assembled prompt exceeded the
// agent's declared context_budget (using ~4 chars/token heuristic).
ContextBudgetExceeded bool `json:"context_budget_exceeded,omitempty"`
PolicyDecision string `json:"policy_decision,omitempty"`
PolicyReason string `json:"policy_reason,omitempty"`
BundleID string `json:"bundle_id,omitempty"`
BundleVersion string `json:"bundle_version,omitempty"`
BundleDigest string `json:"bundle_digest,omitempty"`
BundleMode string `json:"bundle_mode,omitempty"`
// RawOutput stores the unmodified model response for debugging.
RawOutput string `json:"raw_output,omitempty"`
// ValidationError is set when the model output did not conform to the
// expected schema; the raw output is still preserved.
ValidationError string `json:"validation_error,omitempty"`
}
RunResult is the normalized envelope returned by every agent invocation. All fields are stable across CLI and MCP adapters so orchestrators can depend on the schema regardless of how they call Prism.
func ParseAgentOutput ¶
ParseAgentOutput extracts structured fields from a model response. Summary is always set to a compact orchestrator-facing string.
func (RunResult) ToMarkdown ¶
ToMarkdown renders r as a human-readable Markdown report.