report

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

README

Domain Report Module

Audit result aggregation, summary counts, and verdict calculation.

Files

File Responsibility
result.go Defines result types and verdict aggregation
result_test.go Verifies verdict and summary behavior

Exports

  • Verdict
  • Explanation
  • StatementResult
  • Summary
  • Result
  • Aggregate()

Notes

  • StatementResult and Result now expose an optional Explanation field for additive, shared result context without changing verdict calculation.

Dependencies

  • Upstream: application audit orchestration
  • Downstream: internal/domain/rule

Update Rule

  • If members/interfaces/dependencies change, update this file in same change.

Documentation

Overview

Package report defines audit results, summaries, and verdict aggregation. input: statement findings and global findings from audit evaluation output: normalized audit results for CLI, APIs, and future integrations pos: domain reporting model and verdict aggregation logic note: if this file changes, update this header and module README.md.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Explanation added in v0.6.2

type Explanation struct {
	Summary string   `json:"summary,omitempty"`
	Reasons []string `json:"reasons,omitempty"`
}

Explanation captures additive human- and machine-readable context for a result.

type Result

type Result struct {
	Verdict        Verdict           `json:"verdict"`
	Summary        Summary           `json:"summary"`
	Statements     []StatementResult `json:"statements,omitempty"`
	GlobalFindings []rule.Finding    `json:"global_findings,omitempty"`
	Explanation    *Explanation      `json:"explanation,omitempty"`
}

Result is the aggregated audit output.

func Aggregate

func Aggregate(statements []StatementResult, findings []rule.Finding) Result

Aggregate builds a final Result from statement and global findings.

type StatementResult

type StatementResult struct {
	Index         int            `json:"index"`
	Kind          string         `json:"kind"`
	RawSQL        string         `json:"raw_sql,omitempty"`
	NormalizedSQL string         `json:"normalized_sql,omitempty"`
	Findings      []rule.Finding `json:"findings,omitempty"`
	Explanation   *Explanation   `json:"explanation,omitempty"`
}

StatementResult stores findings for a single SQL statement.

type Summary

type Summary struct {
	Statements int `json:"statements"`
	Blockers   int `json:"blockers"`
	Warnings   int `json:"warnings"`
	Notices    int `json:"notices"`
}

Summary captures high-level counts for the full audit result.

type Verdict

type Verdict string

Verdict describes the final audit outcome.

const (
	VerdictPass   Verdict = "pass"
	VerdictReview Verdict = "review"
	VerdictReject Verdict = "reject"
)

Jump to

Keyboard shortcuts

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