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 ¶
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 ¶
Types ¶
type Rule ¶
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.