compositorevidence

package
v1.0.1 Latest Latest
Warning

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

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

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package compositorevidence creates privacy-safe evidence for protected real-compositor integration jobs.

Index

Constants

View Source
const (
	// SchemaVersion identifies the compositor-evidence JSON contract.
	SchemaVersion = "1"
)

Variables

This section is empty.

Functions

func Cleanup

func Cleanup(runnerTemp, outputDirectory string) error

Cleanup removes an owned evidence directory and refuses paths without the repository sentinel or outside runnerTemp.

func PrepareOutputDirectory

func PrepareOutputDirectory(runnerTemp, outputDirectory string) error

PrepareOutputDirectory creates a new evidence directory inside runnerTemp. The ownership sentinel lets Cleanup reject unrelated paths.

func RawTestLogPath

func RawTestLogPath(outputDirectory string) string

RawTestLogPath returns the fixed private log path owned by an evidence directory. The file is removed during finalization or cleanup.

func WritePreflight

func WritePreflight(outputDirectory string, report PreflightReport) error

WritePreflight stores a validated intermediate report transactionally.

Types

type CI

type CI struct {
	Provider   string `json:"provider"`
	Workflow   string `json:"workflow"`
	RunID      string `json:"run_id"`
	RunAttempt int    `json:"run_attempt"`
}

CI identifies the protected GitHub Actions execution.

type Cell

type Cell string

Cell identifies the runtime behavior proven by one matrix cell.

const (
	CellRemoteDesktop      Cell = "remote-desktop"
	CellScreenCast         Cell = "screencast"
	CellNativeInput        Cell = "native-input"
	CellNativeCapture      Cell = "native-capture"
	CellNativeWindow       Cell = "native-window"
	CellHyprlandWindow     Cell = "hyprland-window"
	CellNativeOutput       Cell = "native-output"
	CellNativeOutputMulti  Cell = "native-output-multi"
	CellPortalAvailability Cell = "portal-availability"
)

func ParseCell

func ParseCell(value string) (Cell, error)

ParseCell validates an evidence cell name.

func (Cell) ConsentRequired

func (cell Cell) ConsentRequired() bool

ConsentRequired reports whether the cell starts an interactive portal request that requires the protected operator handoff.

func (Cell) NativeRequired

func (cell Cell) NativeRequired() bool

NativeRequired reports whether the cell proves wlroots-native behavior.

func (Cell) PipeWireRequired

func (cell Cell) PipeWireRequired() bool

PipeWireRequired reports whether the cell must expose a persistent PipeWire capture runtime.

func (Cell) PortalObserved

func (cell Cell) PortalObserved() bool

PortalObserved reports whether the cell records portal capability even when the selected wlroots image explicitly proves that it is unavailable.

func (Cell) PortalRequired

func (cell Cell) PortalRequired() bool

PortalRequired reports whether the cell must expose a real desktop portal interface.

func (Cell) TestSpec

func (cell Cell) TestSpec() (TestSpec, error)

TestSpec returns the fixed test represented by a runnable evidence cell.

type Desktop

type Desktop struct {
	Lane              Lane     `json:"lane"`
	Cell              Cell     `json:"cell"`
	Compositor        string   `json:"compositor"`
	CompositorVersion string   `json:"compositor_version"`
	OutputCount       int      `json:"output_count"`
	OperatorReady     bool     `json:"operator_ready"`
	Portal            Portal   `json:"portal"`
	PipeWire          PipeWire `json:"pipewire"`
}

Desktop identifies only allowlisted compositor facts required by evidence.

type EvidenceTest

type EvidenceTest struct {
	Package        string `json:"package"`
	Name           string `json:"name"`
	Command        string `json:"command"`
	Result         string `json:"result"`
	DurationMillis int64  `json:"duration_ms"`
	LogFile        string `json:"log_file"`
	LogSHA256      string `json:"log_sha256"`
}

EvidenceTest records the canonical, privacy-safe integration result.

type FinalizeConfig

type FinalizeConfig struct {
	RunnerTemp      string
	OutputDirectory string
	ExpectedCommit  string
	ExpectedLane    Lane
	ExpectedCell    Cell
	Workflow        string
	RunID           string
	RunAttempt      int
	TestExitCode    int
	CompletedAt     time.Time
	SensitiveValues []string
}

FinalizeConfig binds a passed raw integration test to its protected workflow identity. SensitiveValues are checked but never persisted.

type Lane

type Lane string

Lane identifies a protected desktop image family.

const (
	LaneGNOME   Lane = "gnome"
	LaneKDE     Lane = "kde"
	LaneWlroots Lane = "wlroots"
)

func ParseLane

func ParseLane(value string) (Lane, error)

ParseLane validates a desktop lane name.

type Manifest

type Manifest struct {
	SchemaVersion string       `json:"schema_version"`
	CompletedAt   string       `json:"completed_at"`
	Commit        string       `json:"commit"`
	Ref           string       `json:"ref"`
	CI            CI           `json:"ci"`
	Platform      Platform     `json:"platform"`
	Desktop       Desktop      `json:"desktop"`
	Test          EvidenceTest `json:"test"`
}

Manifest is the schema-v1 protected compositor evidence document.

func Finalize

func Finalize(config FinalizeConfig) (_ Manifest, retErr error)

Finalize converts a passed raw Go test log into canonical sanitized evidence, verifies the complete directory, and writes the validated marker last.

func VerifyDirectory

func VerifyDirectory(
	outputDirectory string,
	expected VerifyExpectations,
) (Manifest, error)

VerifyDirectory validates the schema, exact identity, canonical log digest, sensitive-data denylist, summary, marker, and directory file allowlist.

type PipeWire

type PipeWire struct {
	Required bool   `json:"required"`
	Version  string `json:"version"`
}

PipeWire identifies the persistent capture runtime required by ScreenCast.

type Platform

type Platform struct {
	OSID          string `json:"os_id"`
	OSVersion     string `json:"os_version"`
	KernelName    string `json:"kernel_name"`
	KernelRelease string `json:"kernel_release"`
	Architecture  string `json:"architecture"`
	GoVersion     string `json:"go_version"`
}

Platform identifies a sanitized runner software platform.

type Portal

type Portal struct {
	Observed             bool   `json:"observed"`
	Available            bool   `json:"available"`
	FrontendVersion      string `json:"frontend_version"`
	Backend              string `json:"backend"`
	BackendVersion       string `json:"backend_version"`
	RemoteDesktopVersion uint64 `json:"remote_desktop_version"`
	ScreenCastVersion    uint64 `json:"screencast_version"`
	AvailableSources     uint64 `json:"available_sources"`
}

Portal identifies the selected real desktop portal contract. Empty versions are allowed only for an explicit portal-availability cell.

type PreflightConfig

type PreflightConfig struct {
	Lane                    Lane
	Cell                    Cell
	CheckoutCommit          string
	ExpectedCommit          string
	Ref                     string
	Workflow                string
	RunID                   string
	RunAttempt              int
	CurrentDesktop          string
	WaylandDisplay          string
	RuntimeDir              string
	SessionBusAddress       string
	OperatorReadyPath       string
	OutputCount             int
	MinimumOutputCount      int
	RequireHeadlessSway     bool
	RequireHeadlessHyprland bool
	VirtualDRMDevice        string
	VirtualDRMDriver        string
	ProbeTimeout            time.Duration
}

PreflightConfig contains trusted workflow inputs and private session values. Private values are validated but never copied into the report.

type PreflightReport

type PreflightReport struct {
	SchemaVersion string   `json:"schema_version"`
	Commit        string   `json:"commit"`
	Ref           string   `json:"ref"`
	Workflow      string   `json:"workflow"`
	RunID         string   `json:"run_id"`
	RunAttempt    int      `json:"run_attempt"`
	Platform      Platform `json:"platform"`
	Desktop       Desktop  `json:"desktop"`
}

PreflightReport is the private intermediate document consumed by finalization.

func Preflight

func Preflight(ctx context.Context, config PreflightConfig) (PreflightReport, error)

Preflight validates the selected runner cell and returns a sanitized report.

type TestSpec

type TestSpec struct {
	Package string
	Name    string
	Command string
}

TestSpec describes the single integration test represented by an evidence cell.

type VerifyExpectations

type VerifyExpectations struct {
	Commit     string
	Lane       Lane
	Cell       Cell
	Workflow   string
	RunID      string
	RunAttempt int
}

VerifyExpectations bind existing evidence to an exact protected job.

Jump to

Keyboard shortcuts

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