Documentation
¶
Overview ¶
Package compositorevidence creates privacy-safe evidence for protected real-compositor integration jobs.
Index ¶
- Constants
- func Cleanup(runnerTemp, outputDirectory string) error
- func PrepareOutputDirectory(runnerTemp, outputDirectory string) error
- func RawTestLogPath(outputDirectory string) string
- func WritePreflight(outputDirectory string, report PreflightReport) error
- type CI
- type Cell
- type Desktop
- type EvidenceTest
- type FinalizeConfig
- type Lane
- type Manifest
- type PipeWire
- type Platform
- type Portal
- type PreflightConfig
- type PreflightReport
- type TestSpec
- type VerifyExpectations
Constants ¶
const (
// SchemaVersion identifies the compositor-evidence JSON contract.
SchemaVersion = "1"
)
Variables ¶
This section is empty.
Functions ¶
func Cleanup ¶
Cleanup removes an owned evidence directory and refuses paths without the repository sentinel or outside runnerTemp.
func PrepareOutputDirectory ¶
PrepareOutputDirectory creates a new evidence directory inside runnerTemp. The ownership sentinel lets Cleanup reject unrelated paths.
func RawTestLogPath ¶
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 (Cell) ConsentRequired ¶
ConsentRequired reports whether the cell starts an interactive portal request that requires the protected operator handoff.
func (Cell) NativeRequired ¶
NativeRequired reports whether the cell proves wlroots-native behavior.
func (Cell) PipeWireRequired ¶
PipeWireRequired reports whether the cell must expose a persistent PipeWire capture runtime.
func (Cell) PortalObserved ¶
PortalObserved reports whether the cell records portal capability even when the selected wlroots image explicitly proves that it is unavailable.
func (Cell) PortalRequired ¶
PortalRequired reports whether the cell must expose a real desktop portal interface.
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 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 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.