pyvider-cty
2025-03-08
Initial project establishment and massive restructuring of the pyvider-cty
382 files · 35,829+ · 14,299-
Project Initialization and Namespace Setup
8 files changed
.gitignoreAdded `.gitignore`, `LICENSE` (Apache 2.0), `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, and `...README.mdAdded `.gitignore`, `LICENSE` (Apache 2.0), `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, and `...CONTRIBUTING.mdAdded `.gitignore`, `LICENSE` (Apache 2.0), `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, and `...CHANGELOG.mdAdded `.gitignore`, `LICENSE` (Apache 2.0), `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, and `...pyproject.tomlSet up `pyproject.toml` with `uv` dependency management and `uv.lock`uv.lockSet up `pyproject.toml` with `uv` dependency management and `uv.lock`_version.pyAdded `VERSION` file and `_version.py` for version trackingwrknv.tomlAdded `Dockerfile` and `wrknv.toml` for development environment
- Initial commit establishing the
pyvider.ctyPython package undersrc/pyvider/cty/baseline architectural30 files
__init__.py__init__.pybase.pyprimitive.py__init__.pyjson.pymsgpack.pyexceptions.py__init__.py__init__.pypath.pytype.py__init__.pybase.py__init__.pylist.pymap.pyset.py__init__.pybool.pynumber.pystring.py__init__.pydynamic.pyobject.pytuple.pyvalidation.py__init__.pybase.pyrefinement.py
- Added
.gitignore,LICENSE(Apache 2.0),README.md,CONTRIBUTING.md,CHANGELOG.md, andCLAUDE.mdspecify errata4 files
.gitignoreREADME.mdCONTRIBUTING.mdCHANGELOG.md
- Set up
pyproject.tomlwithuvdependency management anduv.lockbaseline internal2 files
pyproject.tomluv.lock
- Added
VERSIONfile and_version.pyfor version tracking baseline internal1 file
_version.py
- Added
Dockerfileandwrknv.tomlfor development environment baseline internal1 file
wrknv.toml
Core Type System (`src/pyvider/cty/types/`)
11 files changed
base.pyImplemented base type abstraction (`types/base.py`) with `CtyType` protocolbool.pyPrimitive types: `Bool`, `Number`, `String` with validation and normalizationnumber.pyPrimitive types: `Bool`, `Number`, `String` with validation and normalizationstring.pyPrimitive types: `Bool`, `Number`, `String` with validation and normalizationlist.pyCollection types: `List`, `Map`, `Set` with element type constraintsmap.pyCollection types: `List`, `Map`, `Set` with element type constraintsset.pyCollection types: `List`, `Map`, `Set` with element type constraintsobject.pyStructural types: `Object` (with attribute schemas), `Tuple` (heterogeneous), `Dynamic` (runtime-...tuple.pyStructural types: `Object` (with attribute schemas), `Tuple` (heterogeneous), `Dynamic` (runtime-...dynamic.pyStructural types: `Object` (with attribute schemas), `Tuple` (heterogeneous), `Dynamic` (runtime-...capsule.pyCapsule type system for custom extension types with operations support
- Implemented base type abstraction (
types/base.py) withCtyTypeprotocol interface internal1 file
base.py
- Primitive types:
Bool,Number,Stringwith validation and normalization decouple internal3 files
bool.pynumber.pystring.py
- Collection types:
List,Map,Setwith element type constraints decouple internal3 files
list.pymap.pyset.py
- Structural types:
Object(with attribute schemas),Tuple(heterogeneous),Dynamic(runtime-typed) decouple internal3 files
object.pytuple.pydynamic.py
- Capsule type system for custom extension types with operations support
instantiate
internal
1 file
capsule.py
Value System (`src/pyvider/cty/values/`)
2 files changed
base.py`Value` base class with null handling, unknown value support, and mark/unmark operations'markers.pyBoolean check helpers, empty value handling, and special value markers
Valuebase class with null handling, unknown value support, and mark/unmark operations instantiate internal1 file
base.py
- Boolean check helpers, empty value handling, and special value markers
decouple
internal
1 file
markers.py
- Value operations including equality, comparison, and type checking
decouple
internal
1 file
base.py
Conversion System (`src/pyvider/cty/conversion/`)
5 files changed
raw_to_cty.pyRaw Python-to-cty value conversion (`raw_to_cty.py`)explicit.pyExplicit type conversion between cty types (`explicit.py`)inference_cache.pyType inference with LRU caching (`inference_cache.py`)adapter.pyAdapter pattern for flexible conversions (`adapter.py`)type_encoder.pyType encoder utilities
- Raw Python-to-cty value conversion (
raw_to_cty.py) decouple internal1 file
raw_to_cty.py
- Explicit type conversion between cty types (
explicit.py) decouple internal1 file
explicit.py
- Type inference with LRU caching (
inference_cache.py) streamline internal1 file
inference_cache.py
- Adapter pattern for flexible conversions (
adapter.py) interface internal1 file
adapter.py
- Type encoder utilities
decouple
internal
1 file
type_encoder.py
Codec / Serialization (`src/pyvider/cty/codec.py`)
3 files changed
codec.pyMessagePack-based serialization/deserialization for wire protocol compatibilitydynamic.pyRoundtrip support for all cty types including dynamic values and refined unknownsgenerator.pyGo-cty compatibility fixtures (`.msgpack` test files)
- MessagePack-based serialization/deserialization for wire protocol compatibility
interface
internal
1 file
codec.py
- Roundtrip support for all cty types including dynamic values and refined unknowns
instantiate
internal
1 file
dynamic.py
- Go-cty compatibility fixtures (
.msgpacktest files) qualify internal1 file
generator.py
Functions Library (`src/pyvider/cty/functions/`)
7 files changed
string_functions.pyString functions: upper, lower, trim, replace, regex, join, split, etc.numeric_functions.pyNumeric functions: abs, ceil, floor, min, max, log, pow, signum, etc.collection_functions.pyCollection functions: length, element, lookup, flatten, merge, keys, values, etc.'comparison_functions.pyComparison functions with refined unknown propagationencoding_functions.pyEncoding functions (JSON, base64, CSV)datetime_functions.pyDateTime and bytes utility functionsstructural_functions.pyStructural functions for type manipulation
- String functions: upper, lower, trim, replace, regex, join, split, etc.
decouple
internal
1 file
string_functions.py
- Numeric functions: abs, ceil, floor, min, max, log, pow, signum, etc.
decouple
behavioral
1 file
numeric_functions.py
- Collection functions: length, element, lookup, flatten, merge, keys, values, etc.
decouple
internal
1 file
collection_functions.py
- Comparison functions with refined unknown propagation
decouple
internal
1 file
comparison_functions.py
- Encoding functions (JSON, base64, CSV)
decouple
internal
1 file
encoding_functions.py
- DateTime and bytes utility functions
decouple
internal
1 file
datetime_functions.py
- Structural functions for type manipulation
decouple
internal
1 file
structural_functions.py
Validation and Error Handling
5 files changed
recursion.pyRecursive validation system (`validation/recursion.py`) with depth limits__init__.pyComprehensive exception hierarchy: base, conversion, encoding, validation exceptions'base.pyComprehensive exception hierarchy: base, conversion, encoding, validation exceptions'validation_context.pyValidation context for tracking nested validation pathsvalidation.pyDiagnostic helpers for maps, tuples, and nested error paths
- Recursive validation system (
validation/recursion.py) with depth limits decouple internal1 file
recursion.py
- Comprehensive exception hierarchy: base, conversion, encoding, validation exceptions
decouple
internal
2 files
__init__.pybase.py
- Validation context for tracking nested validation paths
decouple
internal
1 file
validation_context.py
- Diagnostic helpers for maps, tuples, and nested error paths
decouple
internal
1 file
validation.py
Path Navigation (`src/pyvider/cty/path/`)
1 file changed
base.pyPath-based value navigation for indexing into complex types
- Path-based value navigation for indexing into complex types
decouple
internal
1 file
base.py
- Support for attribute access, index access, and key access steps
instantiate
internal
1 file
base.py
Parser (`src/pyvider/cty/parser.py`)
1 file changed
parser.pyString-to-cty-value parser with error reporting
Configuration System (`src/pyvider/cty/config/`)
2 files changed
defaults.pyDefault configuration values and runtime configuration managementruntime.pyDefault configuration values and runtime configuration management
- Default configuration values and runtime configuration management
decouple
behavioral
2 files
defaults.pyruntime.py
Documentation Overhaul
2 files changed
index.mdAdded structured docs: API reference, getting-started guides, how-to guides, user guides'index.mdAdded structured docs: API reference, getting-started guides, how-to guides, user guides'
- Removed old research/chat documents and early guides
decouple
internal
2 files
index.mdindex.md
- Added structured docs: API reference, getting-started guides, how-to guides, user guides
specify
behavioral
2 files
index.mdindex.md
- Topics covered: installation, quick-start, Terraform interop, custom types, serialization, migration from go-cty
interface
internal
2 files
index.mdindex.md
Extensive Test Suite
5 files changed
conftest.py200+ test files covering all modulestest_adversarial_fuzzing.pyProperty-based testing with Hypothesis (fuzzing, adversarial, spec compliance)test_memory_pressure.pyPerformance tests and memory pressure testsgenerator.pyCompatibility tests with go-cty msgpack fixturestest_pre_release_contracts.pyTDD-driven tests for pre-release contracts
- 200+ test files covering all modules
qualify
internal
1 file
conftest.py
- Property-based testing with Hypothesis (fuzzing, adversarial, spec compliance)
qualify
internal
1 file
test_adversarial_fuzzing.py
- Performance tests and memory pressure tests
streamline
internal
1 file
test_memory_pressure.py
- Compatibility tests with go-cty msgpack fixtures
qualify
internal
1 file
generator.py
- TDD-driven tests for pre-release contracts
qualify
internal
1 file
test_pre_release_contracts.py
Examples
11 files changed
quick-start.pyGetting-started quick-start exampleprimitives.pyType examples: primitives, collections, structural, capsule, dynamiccollections.pyType examples: primitives, collections, structural, capsule, dynamicstructural.pyType examples: primitives, collections, structural, capsule, dynamiccapsule.pyType examples: primitives, collections, structural, capsule, dynamicdynamic.pyType examples: primitives, collections, structural, capsule, dynamicfunctions.pyAdvanced examples: functions, marks, path navigation, serialization, Terraform interop'marks.pyAdvanced examples: functions, marks, path navigation, serialization, Terraform interop'path-navigation.pyAdvanced examples: functions, marks, path navigation, serialization, Terraform interop'serialization.pyAdvanced examples: functions, marks, path navigation, serialization, Terraform interop'terraform-interop.pyAdvanced examples: functions, marks, path navigation, serialization, Terraform interop'
- Getting-started quick-start example
decouple
internal
1 file
quick-start.py
- Type examples: primitives, collections, structural, capsule, dynamic
decouple
internal
5 files
primitives.pycollections.pystructural.pycapsule.pydynamic.py
- Advanced examples: functions, marks, path navigation, serialization, Terraform interop
interface
internal
5 files
functions.pymarks.pypath-navigation.pyserialization.pyterraform-interop.py
Go-cty Compatibility
2 files changed
generator.pyPython generator for creating go-cty compatible test fixturesmain.goMessagePack test fixtures generated from Go reference implementation