Type model ready
The Pcore type calculus as Go types: scalar (Integer[min,max], Float, Numeric, String[min,max], Boolean, Undef, Default, Scalar, ScalarData, Data, Any), collection (Array, Hash, Tuple, Struct, Collection) and abstract (Variant, Optional, NotUndef, Enum, Pattern, Regexp, Type, Sensitive), plus Timestamp / Timespan / Binary.
Type parser ready
Parse(string) (Type, error) โ a lexer + recursive-descent parser for the Pcore type grammar, matching Puppet’s spelling. Every Type.String() is canonical and round-trips: Parse(t.String()) reproduces t.
Value model ready
Plain Go scalars (bool, int64, float64, string), []Value arrays and *Hash, plus wrappers โ Undef, Default, Sensitive (redacts on String() and on serialization), Regexp, Binary, Timestamp, Timespan.
Operations ready
The load-bearing lattice: IsInstance(t, v) (value โ type), IsAssignable(a, b) (subtype), Infer(v) (a value’s most specific type), Generalize and CommonType. The assignability arms are covered exhaustively by tests.
Rich-data serialization ready
ToData / FromData implement Pcore’s rich-data protocol (the __ptype / __pvalue tagging): round-trippable through the data-only tree, with Sensitive redacted by design.
Type aliases & TypeSet ready
Named, recursive type aliases and TypeSet (grouped, referenceable type definitions) via a Loader type environment, resolved transparently through Parse / IsInstance / IsAssignable / Infer. Timestamp / Timespan range parameters, SemVer / SemVerRange, Init, Object, Runtime, URI, Iterable / Iterator, Error and Callable are implemented too.
A faithful port of Puppet's Pcore type system in pure Go, cgo disabled,
so it cross-compiles and embeds anywhere. Every Type.String() is canonical and
round-trips through Parse; the assignability lattice is covered exhaustively by
tests. It is a standalone, reusable module and the type layer for the sibling org
github.com/go-puppet.