patch

package
v0.1.0-preview.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package patch generates and strictly applies conversation unified diffs.

Index

Constants

View Source
const (
	// FormatVersion identifies the conversation patch metadata contract.
	FormatVersion = "ultima5redux.conversation-patch/v1"
)

Variables

This section is empty.

Functions

func Apply

func Apply(base, patchData []byte, expectation Expectation) ([]byte, error)

Apply validates all metadata and hunks, then applies the patch without fuzzy matching.

func Generate

func Generate(target, schemaVersion, extractorVersion string, base, edited []byte) ([]byte, error)

Generate returns one deterministic v1 patch with three lines of context.

Types

type Expectation

type Expectation struct {
	Target           string
	SchemaVersion    string
	ExtractorVersion string
}

Expectation supplies the trusted metadata required while applying a patch.

type Metadata

type Metadata struct {
	Target           string
	SchemaVersion    string
	ExtractorVersion string
	BaseSHA256       string
}

Metadata binds a patch to one exact extracted conversation.

func ParseMetadata

func ParseMetadata(data []byte) (Metadata, error)

ParseMetadata strictly parses a patch and returns its binding metadata.

Jump to

Keyboard shortcuts

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