toolargs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 8 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 toolargs implements the closed, deterministic tool-argument transformations shared by action authority and canonical trajectory validation. Keeping the byte-level algorithm below both boundaries lets the trajectory reject self-described derivations rather than trusting digests supplied by their author.

Index

Constants

View Source
const (
	// CompactASCIIAlphanumericV1 removes the bounded set of separators that
	// speech recognition commonly inserts into a dictated compact identifier.
	// Every remaining byte must be an ASCII letter or digit.
	CompactASCIIAlphanumericV1 = "compact-ascii-alphanumeric-v1"
	// CoordinatePairXYV1 recognizes one narrowly scoped provider defect: the
	// model placed the normalized x/y coordinates in a two-integer array under
	// x and omitted y. It derives separate x and y members. A canonical scalar
	// x/y call is unchanged; no other array shape is accepted.
	CoordinatePairXYV1 = "coordinate-pair-x-y-v1"

	// MaximumJSONBytes bounds both validation and byte-preserving rewrite work.
	MaximumJSONBytes = 1 << 20
)

Variables

This section is empty.

Functions

func Supported

func Supported(identity string) bool

Supported reports whether identity names one closed transformation that can be replayed at both the action and trajectory boundaries.

Types

type Rule

type Rule struct {
	Argument   string
	Normalizer string
}

Rule identifies one direct top-level object member and its closed, versioned transformation. A transformation may derive another fixed member when that behavior is part of its versioned identity. Rules must be strictly ordered by Argument.

func Apply

func Apply(source json.RawMessage, rules []Rule) (json.RawMessage, []Rule, error)

Apply validates source as one bounded strict JSON object and applies rules without re-marshalling the object. It returns the exact transformed bytes and the subset of rules that changed a value. Unnamed values retain their original order, whitespace, escapes, and number spellings.

Jump to

Keyboard shortcuts

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