changesurface

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package changesurface reports extension blast radius from Git paths. Classification is path-only and deterministic so it is safe on Windows and in CI without depending on checkout-specific absolute paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatHuman

func FormatHuman(r Report) string

func NormalizeUnifiedDiffPath

func NormalizeUnifiedDiffPath(path string) string

NormalizeUnifiedDiffPath removes the marker prefix from a unified-diff header. It is intentionally separate from repository path normalization: porcelain and name-only paths may legitimately begin with a/ or b/.

func ParsePorcelainZ

func ParsePorcelainZ(data []byte) ([]string, error)

ParsePorcelainZ accepts `git status --porcelain=v1 -z` records. Rename records contain the new/target path in record[2:] followed by the old/source path in the next NUL-delimited field. Both are retained so a rename cannot hide a boundary edit.

func ValidateProfileOnlyPaths

func ValidateProfileOnlyPaths(paths []string) error

ValidateProfileOnlyPaths is useful to architecture fixtures that have a synthetic diff but do not need to construct an entire Report first.

Types

type Category

type Category string
const (
	ExtensionOwnedProduction Category = "extension-owned-production"
	ProviderProfileData      Category = "provider-profile-data"
	SharedComposition        Category = "shared-composition"
	CanonicalContract        Category = "canonical-contract"
	CoreRoutingRuntime       Category = "core-routing-runtime"
	BackendPluginABI         Category = "backendplugin-abi"
	Generated                Category = "generated"
	TestsReference           Category = "tests-reference"
	DocsSpec                 Category = "docs-spec"
	Other                    Category = "other"
)

func ClassifyPath

func ClassifyPath(path string) Category

type Report

type Report struct {
	Paths  map[Category][]string `json:"paths"`
	Counts map[Category]int      `json:"counts"`
}

Report is the stable machine-readable change-surface result.

func Build

func Build(paths []string) Report

func GitBaseReport

func GitBaseReport(repoRoot, base string) (Report, error)

GitBaseReport classifies the complete implementation delta from base to the current worktree. Untracked files are included so evidence can be generated before the final orchestration commit.

func GitStatusReport

func GitStatusReport(repoRoot string) (Report, error)

GitStatusReport classifies tracked, staged, and untracked paths at HEAD. It intentionally uses porcelain output rather than shell formatting, making path separators and rename handling stable across operating systems.

func (Report) CIOutputs

func (r Report) CIOutputs() map[string]string

CIOutputs returns the stable key/value contract consumed by GitHub Actions. Keeping this derivation next to path classification prevents shell workflows from growing a second architecture policy.

func (Report) HasCodeChanges

func (r Report) HasCodeChanges() bool

HasCodeChanges reports whether the diff needs the repository code QA job. Documentation, dedicated evidence, and generated artifacts are intentionally excluded; every other category is a code-surface change, including profile data, because profile validation remains part of the code QA contract.

func (Report) IsProfileDataOnly

func (r Report) IsProfileDataOnly() bool

IsProfileDataOnly reports whether the diff contains profile data and no protected production or unknown paths. It is the single policy used by CI and local profile-only checks.

func (Report) JSON

func (r Report) JSON() ([]byte, error)

func (Report) ValidateProfileOnly

func (r Report) ValidateProfileOnly() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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