output

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package output provides formatting for Guardian CLI output in both human-readable and JSON formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintCheckReportHuman

func PrintCheckReportHuman(w io.Writer, r *CheckReport)

PrintCheckReportHuman writes a human-readable check report to the given writer.

func PrintCheckReportJSON

func PrintCheckReportJSON(w io.Writer, r *CheckReport) error

PrintCheckReportJSON writes a JSON-formatted check report to the given writer.

func PrintHistoryReportHuman

func PrintHistoryReportHuman(w io.Writer, r *HistoryReport)

PrintHistoryReportHuman writes a human-readable history report to the given writer.

func PrintHistoryReportJSON

func PrintHistoryReportJSON(w io.Writer, r *HistoryReport) error

PrintHistoryReportJSON writes a JSON-formatted history report to the given writer.

func PrintInboxReportHuman

func PrintInboxReportHuman(w io.Writer, r *InboxReport)

PrintInboxReportHuman writes a human-readable inbox report to the given writer.

func PrintInboxReportJSON

func PrintInboxReportJSON(w io.Writer, r *InboxReport) error

PrintInboxReportJSON writes a JSON-formatted inbox report to the given writer.

func PrintTallyReportHuman

func PrintTallyReportHuman(w io.Writer, r *TallyReport)

PrintTallyReportHuman writes a human-readable tally report to the given writer.

func PrintTallyReportJSON

func PrintTallyReportJSON(w io.Writer, r *TallyReport) error

PrintTallyReportJSON writes a JSON-formatted tally report to the given writer.

Types

type CheckReport

type CheckReport struct {
	Violations      []ViolationReport `json:"violations"`
	Summary         ReportSummary     `json:"summary"`
	ProposalContext *ProposalContext  `json:"proposal_context,omitempty"`
}

CheckReport contains the results of a guardian check operation.

type HistoryItem

type HistoryItem struct {
	ProposalID   string `json:"proposal_id"`
	RuleID       string `json:"rule_id"`
	ProposalType string `json:"proposal_type"`
	FinalizedAt  string `json:"finalized_at"`
	Summary      string `json:"summary"`
}

HistoryItem represents a finalized proposal in the history.

type HistoryReport

type HistoryReport struct {
	Items []HistoryItem `json:"items"`
}

HistoryReport lists finalized proposals.

type InboxItem

type InboxItem struct {
	ProposalID   string `json:"proposal_id"`
	RuleID       string `json:"rule_id"`
	ProposalType string `json:"proposal_type"`
	CreatedBy    string `json:"created_by"`
	CreatedAt    string `json:"created_at"`
	Age          string `json:"age"`
}

InboxItem represents a single pending proposal in the inbox.

type InboxReport

type InboxReport struct {
	Items []InboxItem `json:"items"`
	Total int         `json:"total"`
}

InboxReport lists proposals awaiting the current user's vote.

type ProposalContext added in v0.1.2

type ProposalContext struct {
	AcceptedPending []ProposalSummary `json:"accepted_pending,omitempty"`
	Active          []ProposalSummary `json:"active,omitempty"`
}

ProposalContext provides governance context about active proposals.

type ProposalSummary added in v0.1.2

type ProposalSummary struct {
	ID           string `json:"id"`
	RuleID       string `json:"rule_id"`
	ProposalType string `json:"proposal_type"`
	Status       string `json:"status"`
	Description  string `json:"description"`
	CreatedBy    string `json:"created_by"`
}

ProposalSummary is a lightweight representation of a proposal.

type ReportSummary

type ReportSummary struct {
	Errors   int  `json:"errors"`
	Warnings int  `json:"warnings"`
	Passed   bool `json:"passed"`
}

ReportSummary summarizes the check results.

type TallyReport

type TallyReport struct {
	ProposalID     string      `json:"proposal_id"`
	RuleID         string      `json:"rule_id"`
	EligibleVoters []string    `json:"eligible_voters"`
	Votes          []VoteEntry `json:"votes"`
	Result         string      `json:"result"`
	YesCount       int         `json:"yes_count"`
	NoCount        int         `json:"no_count"`
	Required       int         `json:"required"`
}

TallyReport contains the voting results for a proposal.

type ViolationReport

type ViolationReport struct {
	RuleID         string `json:"rule_id"`
	Severity       string `json:"severity"`
	Description    string `json:"description"`
	FilePath       string `json:"file_path"`
	DiffSnippet    string `json:"diff_snippet"`
	LLMExplanation string `json:"llm_explanation"`
}

ViolationReport describes a single rule violation found during a check.

type VoteEntry

type VoteEntry struct {
	Email    string `json:"email"`
	Decision string `json:"decision"`
	Comment  string `json:"comment"`
}

VoteEntry represents a single vote in a tally report.

Jump to

Keyboard shortcuts

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