audit

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package audit compares the authoritative Go build file set (go/packages.Load) against the file set recorded in the CKG database.

V0 scope: Go only. TS/Sol audit is deferred (no equivalent build oracle); see docs/WORK-PLAN.md Group E.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Report

type Report struct {
	BuildCount  int      `json:"build_count"`
	DBCount     int      `json:"db_count"`
	InBuildOnly []string `json:"in_build_only"` // missing from DB — bug
	InDBOnly    []string `json:"in_db_only"`    // over-included relative to build oracle
	InBoth      int      `json:"in_both"`
}

Report is the diff between the build's authoritative file set and the DB's recorded file set. Slices are sorted for deterministic output.

func RunGo

func RunGo(srcRoot string, s store) (Report, error)

RunGo computes the audit report for the Go file set under srcRoot. Build set is collected by discovering every go.mod under srcRoot and running go/packages.Load("./...") in each module's directory. Files are reported as srcRoot-relative slash-separated paths to match how the production build pipeline records file_path in the DB.

func (Report) IsParity

func (r Report) IsParity() bool

IsParity reports whether the build and DB sets are identical.

func (Report) WriteJSON

func (r Report) WriteJSON(w io.Writer) error

WriteJSON emits the report as a single JSON object.

func (Report) WriteText

func (r Report) WriteText(w io.Writer) error

WriteText emits a human-readable summary plus first-N examples for diffs.

Jump to

Keyboard shortcuts

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