normalizer

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package normalizer builds provider-neutral IR without overwriting the provider-native JSON type or the capture-layer evidence that supports it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONType

func JSONType(raw json.RawMessage) (string, error)

JSONType returns the provider-native JSON type without converting numbers or string-contained JSON into another type.

func Normalize

func Normalize(request Request) (schema.IRItem, error)

Normalize canonicalizes native JSON while preserving its type. A transform that cannot round-trip produces an explicit loss/unavailable marker instead of silently claiming semantic equality.

Types

type Request

type Request struct {
	ItemID         string
	IRType         schema.IRType
	SourceProtocol string
	InteractionID  string
	ParentItemID   string
	CallID         string
	NativeValue    json.RawMessage
	EvidenceRefs   []schema.ObjectRef
	Extension      string
	Transform      Transform
	Version        string
}

type Transform

type Transform string
const (
	TransformIdentity         Transform = "identity"
	TransformDecodeJSONString Transform = "decode_json_string"
)

Jump to

Keyboard shortcuts

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