Help us shape the future of Go! Take the 2026 Go Developer Survey

edit

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package edit holds the pure guards an optimize/apply step enforces before committing a harness edit (SPEC-ADDITIONS §18.2): the size budget and the hash-based no-op check. Ported from skillsaw's edit; both are pure, no I/O.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNoOp

func IsNoOp(before, after string) bool

IsNoOp reports whether before and after are the same artifact under the content identity used across adh (identity.Hash). An edit that leaves the hash unchanged did nothing and need not be re-evaluated.

func WithinSizeBudget

func WithinSizeBudget(origBytes, newBytes int, ratio float64) bool

WithinSizeBudget reports whether an edited artifact of newBytes stays within ratio × origBytes (adh's default ratio is 1.5). A non-positive origBytes admits only an empty result, since any growth from nothing is unbounded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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