Extract portable payload validation into star-actor-protocol #35

Merged
lost-rob0t merged 9 commits from extract/portable-payload-validation into main 2026-08-15 15:08:58 +00:00
lost-rob0t commented 2026-08-15 15:05:35 +00:00 (Migrated from github.com)

Scope

Remove the last prototype-only semantic dependency blocking deterministic-dispatcher extraction: schema-aware portable payload validation.

star-actor-protocol is now authoritative for whether a runtime payload is valid against the portable manifest. JSON construction remains serializer-side.

Final protocol authority

New portable-payload.lisp owns runtime-neutral validation for:

  • string-alist and keyword-plist payload addressing
  • keyword field-name → lower-camel compatibility
  • portable type-contract lookup
  • inherited document fields
  • required/unknown fields
  • lists and optionals
  • string / symbol / integer / boolean / date / datetime primitives
  • exact decimal-string semantics and scale
  • scalar min/max constraints
  • enums
  • maps
  • references (schema + id)
  • generic any wire values
  • message payloads
  • lifecycle envelopes validated against a portable manifest

One-authority caller changes

prototype/message-lifecycle-prototype.lisp no longer defines its own manifest payload validator. It delegates directly to validate-lifecycle-envelope-against-manifest.

prototype/canonical-json-prototype.lisp now validates through star-actor-protocol first and only then constructs star-canonical-json nodes. It no longer independently owns required-field, unknown-field, enum, inherited-document, scalar-bound, decimal-scale, map/reference, or primitive-type acceptance decisions.

Deliberately not moved

  • JSON node construction and canonical serialization
  • manifest plist → canonical JSON mapping
  • compiler syntax/lowering
  • actor runtime binding
  • deterministic dispatcher state/queue/replay/retry/deferred/cancel arbitration

Extraction metrics

CI on final head c8d81d0f007479e41011dc6761b6c8b00b9afd03 reports:

  • aggregate prototype/**/*.lisp: 19,450 → 19,327 LOC (-123)
  • prototype/canonical-json-prototype.lisp: net -101
  • prototype/message-lifecycle-prototype.lisp: net -22
  • final portable payload validator: 385 LOC

Validation

GitHub Actions and Nix are green:

  • independent target-system loading ✅
  • asdf:test-system :star-actor-protocol ✅ including portable payload tests
  • final canonical JSON / journal / lease / mailbox / Sento / runtime tests ✅
  • asdf:test-system :starlang-prototype ✅ — 34 standalone scripts
  • generated interchange artifact validation ✅
  • frozen canonical manifest fixture/hash verification ✅
  • Nix flake check ✅

The frozen-byte gates prove the semantic-validator extraction did not change canonical wire output.

Next slice

Move deterministic wire dispatch coordination into starlang-runtime, including the existing semantic-idempotency wrapper and deferred-completion behavior, while preserving its distinct internal work queue. Reduce prototype dispatcher/idempotency/deferred files to compatibility only. Do not substitute the per-actor star-mailbox queue.

## Scope Remove the last prototype-only semantic dependency blocking deterministic-dispatcher extraction: schema-aware portable payload validation. `star-actor-protocol` is now authoritative for whether a runtime payload is valid against the portable manifest. JSON construction remains serializer-side. ## Final protocol authority New `portable-payload.lisp` owns runtime-neutral validation for: - string-alist and keyword-plist payload addressing - keyword field-name → lower-camel compatibility - portable type-contract lookup - inherited document fields - required/unknown fields - lists and optionals - string / symbol / integer / boolean / date / datetime primitives - exact decimal-string semantics and scale - scalar min/max constraints - enums - maps - references (`schema` + `id`) - generic `any` wire values - message payloads - lifecycle envelopes validated against a portable manifest ## One-authority caller changes `prototype/message-lifecycle-prototype.lisp` no longer defines its own manifest payload validator. It delegates directly to `validate-lifecycle-envelope-against-manifest`. `prototype/canonical-json-prototype.lisp` now validates through `star-actor-protocol` first and only then constructs `star-canonical-json` nodes. It no longer independently owns required-field, unknown-field, enum, inherited-document, scalar-bound, decimal-scale, map/reference, or primitive-type acceptance decisions. ## Deliberately not moved - JSON node construction and canonical serialization - manifest plist → canonical JSON mapping - compiler syntax/lowering - actor runtime binding - deterministic dispatcher state/queue/replay/retry/deferred/cancel arbitration ## Extraction metrics CI on final head `c8d81d0f007479e41011dc6761b6c8b00b9afd03` reports: - aggregate `prototype/**/*.lisp`: **19,450 → 19,327 LOC (-123)** - `prototype/canonical-json-prototype.lisp`: net **-101** - `prototype/message-lifecycle-prototype.lisp`: net **-22** - final portable payload validator: **385 LOC** ## Validation GitHub Actions and Nix are green: - independent target-system loading ✅ - `asdf:test-system :star-actor-protocol` ✅ including portable payload tests - final canonical JSON / journal / lease / mailbox / Sento / runtime tests ✅ - `asdf:test-system :starlang-prototype` ✅ — **34 standalone scripts** - generated interchange artifact validation ✅ - frozen canonical manifest fixture/hash verification ✅ - Nix flake check ✅ The frozen-byte gates prove the semantic-validator extraction did not change canonical wire output. ## Next slice Move deterministic wire dispatch coordination into `starlang-runtime`, including the existing semantic-idempotency wrapper and deferred-completion behavior, while preserving its distinct internal work queue. Reduce prototype dispatcher/idempotency/deferred files to compatibility only. Do **not** substitute the per-actor `star-mailbox` queue.
Sign in to join this conversation.
No description provided.