report

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package report renders the final research report (design doc §14 Phase 3: "Markdown Renderer", "Citation Coverage", "Artifact Store"). The writer agent already produces the structured report document and the citation validator stamps the verdict; this package turns the persisted record into the deliverable Markdown artifact and hands back the content-addressed artifact reference of §5.

Index

Constants

View Source
const (
	MediaTypeMarkdown = "text/markdown"
	MediaTypeJSON     = "application/json"
)

Media types of the stored artifacts.

Variables

This section is empty.

Functions

func RenderMarkdown

func RenderMarkdown(document Document, verdict Verdict) string

RenderMarkdown renders the final deliverable (§14 "Markdown Renderer"). Every citation appears in a References section so the report is traceable back to its evidence IDs (§18 "Report Traceable to Evidence").

func Store

func Store(ctx context.Context, store *artifact.Filesystem, tenantID string, mediaType string, content []byte) (string, error)

Store persists one deliverable into the content-addressed artifact store and returns the artifactRef URI. Storing is idempotent: identical content addresses to the same digest.

Types

type Citation

type Citation struct {
	Marker     string `json:"marker"`
	EvidenceID string `json:"evidenceId"`
	SourceID   string `json:"sourceId,omitempty"`
	Quote      string `json:"quote"`
}

Citation binds one in-body marker to one evidence ID with a verbatim quote, per the validator's 1:1 marker binding rule.

type Document

type Document struct {
	Title                string     `json:"title"`
	Summary              string     `json:"summary"`
	Sections             []Section  `json:"sections"`
	Citations            []Citation `json:"citations"`
	InsufficientEvidence bool       `json:"insufficientEvidence,omitempty"`
}

Document mirrors the writer agent's report record.

func Decode

func Decode(raw string) (Document, error)

Decode parses the persisted writer record.

type Section

type Section struct {
	Heading string `json:"heading"`
	Body    string `json:"body"`
}

Section is one report body section.

type Verdict

type Verdict struct {
	Valid                bool     `json:"valid"`
	CitationCoverage     float64  `json:"citationCoverage"`
	UnsupportedClaims    int      `json:"unsupportedClaims"`
	Retries              int      `json:"retries"`
	InsufficientEvidence bool     `json:"insufficientEvidence,omitempty"`
	MarkerIssues         []string `json:"markerIssues,omitempty"`
}

Verdict mirrors the citation validator's validation record.

func DecodeVerdict

func DecodeVerdict(raw string) (Verdict, error)

DecodeVerdict parses the persisted validator verdict.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL