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
  • .gitignore Added `.gitignore`, `LICENSE` (Apache 2.0), `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, and `...
  • README.md Added `.gitignore`, `LICENSE` (Apache 2.0), `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, and `...
  • CONTRIBUTING.md Added `.gitignore`, `LICENSE` (Apache 2.0), `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, and `...
  • CHANGELOG.md Added `.gitignore`, `LICENSE` (Apache 2.0), `README.md`, `CONTRIBUTING.md`, `CHANGELOG.md`, and `...
  • pyproject.toml Set up `pyproject.toml` with `uv` dependency management and `uv.lock`
  • uv.lock Set up `pyproject.toml` with `uv` dependency management and `uv.lock`
  • _version.py Added `VERSION` file and `_version.py` for version tracking
  • wrknv.toml Added `Dockerfile` and `wrknv.toml` for development environment
  • Initial commit establishing the pyvider.cty Python package under src/pyvider/cty/ baseline architectural
    30 files
    • __init__.py
    • __init__.py
    • base.py
    • primitive.py
    • __init__.py
    • json.py
    • msgpack.py
    • exceptions.py
    • __init__.py
    • __init__.py
    • path.py
    • type.py
    • __init__.py
    • base.py
    • __init__.py
    • list.py
    • map.py
    • set.py
    • __init__.py
    • bool.py
    • number.py
    • string.py
    • __init__.py
    • dynamic.py
    • object.py
    • tuple.py
    • validation.py
    • __init__.py
    • base.py
    • refinement.py
  • Added .gitignore, LICENSE (Apache 2.0), README.md, CONTRIBUTING.md, CHANGELOG.md, and CLAUDE.md specify errata
    4 files
    • .gitignore
    • README.md
    • CONTRIBUTING.md
    • CHANGELOG.md
  • Set up pyproject.toml with uv dependency management and uv.lock baseline internal
    2 files
    • pyproject.toml
    • uv.lock
  • Added VERSION file and _version.py for version tracking baseline internal
    1 file
    • _version.py
  • Added Dockerfile and wrknv.toml for development environment baseline internal
    1 file
    • wrknv.toml

Core Type System (`src/pyvider/cty/types/`)

11 files changed
  • base.py Implemented base type abstraction (`types/base.py`) with `CtyType` protocol
  • bool.py Primitive types: `Bool`, `Number`, `String` with validation and normalization
  • number.py Primitive types: `Bool`, `Number`, `String` with validation and normalization
  • string.py Primitive types: `Bool`, `Number`, `String` with validation and normalization
  • list.py Collection types: `List`, `Map`, `Set` with element type constraints
  • map.py Collection types: `List`, `Map`, `Set` with element type constraints
  • set.py Collection types: `List`, `Map`, `Set` with element type constraints
  • object.py Structural types: `Object` (with attribute schemas), `Tuple` (heterogeneous), `Dynamic` (runtime-...
  • tuple.py Structural types: `Object` (with attribute schemas), `Tuple` (heterogeneous), `Dynamic` (runtime-...
  • dynamic.py Structural types: `Object` (with attribute schemas), `Tuple` (heterogeneous), `Dynamic` (runtime-...
  • capsule.py Capsule type system for custom extension types with operations support
  • Implemented base type abstraction (types/base.py) with CtyType protocol interface internal
    1 file
    • base.py
  • Primitive types: Bool, Number, String with validation and normalization decouple internal
    3 files
    • bool.py
    • number.py
    • string.py
  • Collection types: List, Map, Set with element type constraints decouple internal
    3 files
    • list.py
    • map.py
    • set.py
  • Structural types: Object (with attribute schemas), Tuple (heterogeneous), Dynamic (runtime-typed) decouple internal
    3 files
    • object.py
    • tuple.py
    • dynamic.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.py Boolean check helpers, empty value handling, and special value markers
  • Value base class with null handling, unknown value support, and mark/unmark operations instantiate internal
    1 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.py Raw Python-to-cty value conversion (`raw_to_cty.py`)
  • explicit.py Explicit type conversion between cty types (`explicit.py`)
  • inference_cache.py Type inference with LRU caching (`inference_cache.py`)
  • adapter.py Adapter pattern for flexible conversions (`adapter.py`)
  • type_encoder.py Type encoder utilities
  • Raw Python-to-cty value conversion (raw_to_cty.py) decouple internal
    1 file
    • raw_to_cty.py
  • Explicit type conversion between cty types (explicit.py) decouple internal
    1 file
    • explicit.py
  • Type inference with LRU caching (inference_cache.py) streamline internal
    1 file
    • inference_cache.py
  • Adapter pattern for flexible conversions (adapter.py) interface internal
    1 file
    • adapter.py
  • Type encoder utilities decouple internal
    1 file
    • type_encoder.py

Codec / Serialization (`src/pyvider/cty/codec.py`)

3 files changed
  • codec.py MessagePack-based serialization/deserialization for wire protocol compatibility
  • dynamic.py Roundtrip support for all cty types including dynamic values and refined unknowns
  • generator.py Go-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 (.msgpack test files) qualify internal
    1 file
    • generator.py

Functions Library (`src/pyvider/cty/functions/`)

7 files changed
  • string_functions.py String functions: upper, lower, trim, replace, regex, join, split, etc.
  • numeric_functions.py Numeric functions: abs, ceil, floor, min, max, log, pow, signum, etc.
  • collection_functions.py Collection functions: length, element, lookup, flatten, merge, keys, values, etc.'
  • comparison_functions.py Comparison functions with refined unknown propagation
  • encoding_functions.py Encoding functions (JSON, base64, CSV)
  • datetime_functions.py DateTime and bytes utility functions
  • structural_functions.py Structural 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.py Recursive validation system (`validation/recursion.py`) with depth limits
  • __init__.py Comprehensive exception hierarchy: base, conversion, encoding, validation exceptions'
  • base.py Comprehensive exception hierarchy: base, conversion, encoding, validation exceptions'
  • validation_context.py Validation context for tracking nested validation paths
  • validation.py Diagnostic helpers for maps, tuples, and nested error paths
  • Recursive validation system (validation/recursion.py) with depth limits decouple internal
    1 file
    • recursion.py
  • Comprehensive exception hierarchy: base, conversion, encoding, validation exceptions decouple internal
    2 files
    • __init__.py
    • base.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.py Path-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.py String-to-cty-value parser with error reporting
  • String-to-cty-value parser with error reporting decouple internal
    1 file
    • parser.py

Configuration System (`src/pyvider/cty/config/`)

2 files changed
  • defaults.py Default configuration values and runtime configuration management
  • runtime.py Default configuration values and runtime configuration management
  • Default configuration values and runtime configuration management decouple behavioral
    2 files
    • defaults.py
    • runtime.py

Documentation Overhaul

2 files changed
  • index.md Added structured docs: API reference, getting-started guides, how-to guides, user guides'
  • index.md Added 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.md
    • index.md
  • Added structured docs: API reference, getting-started guides, how-to guides, user guides specify behavioral
    2 files
    • index.md
    • index.md
  • Topics covered: installation, quick-start, Terraform interop, custom types, serialization, migration from go-cty interface internal
    2 files
    • index.md
    • index.md

Extensive Test Suite

5 files changed
  • conftest.py 200+ test files covering all modules
  • test_adversarial_fuzzing.py Property-based testing with Hypothesis (fuzzing, adversarial, spec compliance)
  • test_memory_pressure.py Performance tests and memory pressure tests
  • generator.py Compatibility tests with go-cty msgpack fixtures
  • test_pre_release_contracts.py TDD-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
11 files changed
  • quick-start.py Getting-started quick-start example
  • primitives.py Type examples: primitives, collections, structural, capsule, dynamic
  • collections.py Type examples: primitives, collections, structural, capsule, dynamic
  • structural.py Type examples: primitives, collections, structural, capsule, dynamic
  • capsule.py Type examples: primitives, collections, structural, capsule, dynamic
  • dynamic.py Type examples: primitives, collections, structural, capsule, dynamic
  • functions.py Advanced examples: functions, marks, path navigation, serialization, Terraform interop'
  • marks.py Advanced examples: functions, marks, path navigation, serialization, Terraform interop'
  • path-navigation.py Advanced examples: functions, marks, path navigation, serialization, Terraform interop'
  • serialization.py Advanced examples: functions, marks, path navigation, serialization, Terraform interop'
  • terraform-interop.py Advanced 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.py
    • collections.py
    • structural.py
    • capsule.py
    • dynamic.py
  • Advanced examples: functions, marks, path navigation, serialization, Terraform interop interface internal
    5 files
    • functions.py
    • marks.py
    • path-navigation.py
    • serialization.py
    • terraform-interop.py

Go-cty Compatibility

2 files changed
  • generator.py Python generator for creating go-cty compatible test fixtures
  • main.go MessagePack test fixtures generated from Go reference implementation
  • Python generator for creating go-cty compatible test fixtures qualify internal
    1 file
    • generator.py
  • MessagePack test fixtures generated from Go reference implementation qualify internal
    1 file
    • main.go