Skip to content

Add Class authoring/parity: Class runtime model, IR support, and tests - #116

Open
haydnv wants to merge 1 commit into
mainfrom
codex/complete-implementation-of-issue-#35-in-client-jz5yqq
Open

Add Class authoring/parity: Class runtime model, IR support, and tests#116
haydnv wants to merge 1 commit into
mainfrom
codex/complete-implementation-of-issue-#35-in-client-jz5yqq

Conversation

@haydnv

@haydnv haydnv commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Motivation

  • Provide a canonical v2-style user-defined Class authoring surface to mirror Python v1 model semantics while emitting versioned /class/{publisher}/{resource}/{version} definitions.
  • Ensure library compilation and installation include language-neutral Class definitions and that bound Class methods construct a single deferred plan.

Description

  • Add py/tinychain/classdef.py implementing Class, ClassError subclasses, class_definition, and validate_class_definition with canonical identity, prototype extraction, override validation, construction, and route binding.
  • Extend py/tinychain/library.py to compile and include classes in the IR via compile_ir, adjust install to submit IR when classes are present, and adapt route compilation to handle class-bound routes.
  • Update py/tinychain/__init__.py to export the new Class API and errors, and add State to py/tinychain/state/__init__.py exports.
  • Add documentation py/CLASS_PARITY.md describing Class v1→v2 parity and usage, update py/README.md to reference it, and include a language-neutral fixture py/tests/fixtures/class_definitions.json.
  • Add unit tests py/tests/test_class_authoring.py exercising class definition encoding, construction, bound methods, inheritance semantics, validation errors, manifest compilation, and equality with the golden fixture.

Testing

  • Ran the new unit test file py/tests/test_class_authoring.py under pytest and the tests passed.
  • Verified compile_ir yields an IR containing a classes list that matches class_definition outputs for declared Class types using the class_definitions.json fixture.
  • Executed library install paths that exercise both legacy library_definition and new IR submission behavior and confirmed no regressions in route compilation.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant