Make the v0.9 codec type-directed and strict #4

Merged
lost-rob0t merged 29 commits from agent/issue-13-codec-semantics into agent/schema-org-v0.9 2026-07-26 14:39:41 +00:00
lost-rob0t commented 2026-07-26 14:22:26 +00:00 (Migrated from github.com)

Summary

  • make encoding and decoding type-directed instead of truthiness-driven
  • preserve JSON false, null, empty arrays, empty strings, absent slots, and nested objects as separate states
  • validate strings, integers, numbers, booleans, nullable unions, lists, vectors, nested objects, and collection element types
  • signal structured codec-validation-error conditions with operation, path, expected type, value, and reason
  • replace sb-mop usage with closer-mop
  • define the existing bool, int, and float64 model aliases as real Common Lisp types
  • add a dtype-to-CLOS document class registry and reject unknown or mismatched document classes without interning dtype strings
  • make encode explicitly return a JSOWN object and align tests and documentation
  • replace the stale string-based codec suite with executable typed-semantics regressions
  • make the Common Lisp ASDF suite a required Nix-backed CI job

Validation targets

  • false, null, empty array, empty string, and absence remain distinguishable
  • wrong primitive types and wrong collection element types signal structured errors
  • nested helper objects round-trip
  • registered document classes decode by dtype
  • unknown dtypes do not grow the package symbol table
  • document class mismatch is rejected
  • CouchDB revision behavior remains unchanged

Stack

  • base: agent/schema-org-v0.9 / draft PR #1
  • server tracking issue: lost-rob0t/starintel-server#13

This remains draft until the required Common Lisp and source-contract jobs are green.

## Summary - make encoding and decoding type-directed instead of truthiness-driven - preserve JSON false, null, empty arrays, empty strings, absent slots, and nested objects as separate states - validate strings, integers, numbers, booleans, nullable unions, lists, vectors, nested objects, and collection element types - signal structured `codec-validation-error` conditions with operation, path, expected type, value, and reason - replace `sb-mop` usage with `closer-mop` - define the existing `bool`, `int`, and `float64` model aliases as real Common Lisp types - add a dtype-to-CLOS document class registry and reject unknown or mismatched document classes without interning dtype strings - make `encode` explicitly return a JSOWN object and align tests and documentation - replace the stale string-based codec suite with executable typed-semantics regressions - make the Common Lisp ASDF suite a required Nix-backed CI job ## Validation targets - false, null, empty array, empty string, and absence remain distinguishable - wrong primitive types and wrong collection element types signal structured errors - nested helper objects round-trip - registered document classes decode by dtype - unknown dtypes do not grow the package symbol table - document class mismatch is rejected - CouchDB revision behavior remains unchanged ## Stack - base: `agent/schema-org-v0.9` / draft PR #1 - server tracking issue: `lost-rob0t/starintel-server#13` This remains draft until the required Common Lisp and source-contract jobs are green.
Sign in to join this conversation.
No description provided.