[P0-05] Fix canonical star-cl codec type semantics and contract drift #13

Closed
opened 2026-07-22 00:09:45 +00:00 by lost-rob0t · 2 comments
lost-rob0t commented 2026-07-22 00:09:45 +00:00 (Migrated from github.com)

Dependency blocker

The current star-cl codec used by the server has confirmed semantic defects:

  • encode-value ignores type-spec; nil is encoded as JSON false before list handling, so empty list defaults become false instead of [].
  • Optional nested object defaults also become false instead of null.
  • Decoder primitive branches accept wrong JSON types without validation.
  • Boolean decoding maps any non-nil value to true.
  • JSON null is converted to NIL for every slot type, including non-null integers/strings.
  • Class selection is caller-supplied without a document-class allowlist.
  • Existing codec tests expect encode to return a string, while the current implementation returns a JSOWN object; the tests and API contract have drifted.
  • Forced defaults conflate absent, null, empty string, zero, and empty collection unless the schema explicitly permits that collapse.

Required changes

  • Fix the canonical codec in star-cl first; pin the repaired revision in this repository.
  • Make encode/decode type-directed.
  • Define explicit presence/null/default policy per slot.
  • Validate primitive and collection element types.
  • Add a registered dtype→class map instead of arbitrary class symbols.
  • Align tests, docs, return types, and all language conformance fixtures.

Acceptance criteria

  • The server pins a tested star-cl revision containing these fixes.
  • Empty lists, false, null, absent values, and nested objects pass shared fixtures.
  • Wrong primitive types produce structured validation errors rather than malformed instances.
## Dependency blocker The current `star-cl` codec used by the server has confirmed semantic defects: - `encode-value` ignores `type-spec`; `nil` is encoded as JSON false before list handling, so empty list defaults become false instead of `[]`. - Optional nested object defaults also become false instead of null. - Decoder primitive branches accept wrong JSON types without validation. - Boolean decoding maps any non-nil value to true. - JSON null is converted to NIL for every slot type, including non-null integers/strings. - Class selection is caller-supplied without a document-class allowlist. - Existing codec tests expect `encode` to return a string, while the current implementation returns a JSOWN object; the tests and API contract have drifted. - Forced defaults conflate absent, null, empty string, zero, and empty collection unless the schema explicitly permits that collapse. ## Required changes - Fix the canonical codec in `star-cl` first; pin the repaired revision in this repository. - Make encode/decode type-directed. - Define explicit presence/null/default policy per slot. - Validate primitive and collection element types. - Add a registered dtype→class map instead of arbitrary class symbols. - Align tests, docs, return types, and all language conformance fixtures. ## Acceptance criteria - The server pins a tested `star-cl` revision containing these fixes. - Empty lists, false, null, absent values, and nested objects pass shared fixtures. - Wrong primitive types produce structured validation errors rather than malformed instances.
lost-rob0t commented 2026-07-26 14:22:46 +00:00 (Migrated from github.com)

Active cross-repository implementation: lost-rob0t/star-cl#4 (agent/issue-13-codec-semantics).

The branch adds type-directed encode/decode, structured path-aware validation errors, registered dtype→CLOS document-class selection, explicit JSOWN return semantics, portable closer-mop use, and a required Nix/ASDF Common Lisp test gate.

Active cross-repository implementation: `lost-rob0t/star-cl#4` (`agent/issue-13-codec-semantics`). The branch adds type-directed encode/decode, structured path-aware validation errors, registered dtype→CLOS document-class selection, explicit JSOWN return semantics, portable closer-mop use, and a required Nix/ASDF Common Lisp test gate.
lost-rob0t commented 2026-07-26 14:47:41 +00:00 (Migrated from github.com)

Completed.

Cross-repository implementation:

  • lost-rob0t/star-cl#4 merged at 779a98b8fe5247ec9d0576b083646999abd2ba4f
  • required star-cl source contract: passed
  • required star-cl Common Lisp suite: 217/217 checks passed

Server integration:

  • qlfile.lock pins the exact merged star-cl revision
  • fixture-contract: passed
  • clos-conformance: passed
  • server pin/test commit: 2dc58dab7cb30e928536879955c4c52595165394
Completed. Cross-repository implementation: - `lost-rob0t/star-cl#4` merged at `779a98b8fe5247ec9d0576b083646999abd2ba4f` - required star-cl source contract: passed - required star-cl Common Lisp suite: 217/217 checks passed Server integration: - qlfile.lock pins the exact merged star-cl revision - fixture-contract: passed - clos-conformance: passed - server pin/test commit: `2dc58dab7cb30e928536879955c4c52595165394`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/starintel-server#13
No description provided.