Skip to content

Replace reflection-based JSON with typed contracts and source generation #60

Closed

Description

@Anheledir

Part of #26; supports #27/#28 and the schema audit #49. The partial-trim + ReadyToRun prototype is ~39.5 MB versus ~76.6 MB and passes local smoke, but clean analysis reports JSON IL2026/IL3050 diagnostics. Native AOT cannot be supported safely with the current reflection serializers.

Acceptance

  • Inventory Core/CLI serialization sites, including settings, protected links, profiles, manifests/plans/receipts, host IPC, provider ownership, bridge HTTP payloads and public JSON/error output.
  • Replace anonymous/object-based contracts where needed with explicit DTOs and generated JsonSerializerContext/JsonTypeInfo calls, including AOT-safe enum converters and HTTP JSON overloads.
  • Preserve existing property names/casing/nullability/enums, encrypted-link contents, legacy package formats and IPC compatibility; add compatibility fixtures and consumer schema checks.
  • Keep public library callers in control of configuration/HttpClient/credentials; avoid requiring broad reflection fallback or blanket warning suppression.
  • Rebuild cleanly with strict analysis and run native vault, phone payload, CLI/host/provider, install/update/rollback and docs/license tests before promoting smaller packages.

Activity

  1. added
    enhancementNew feature or request
    P1Next delivery: usability, installation and release blockers
    on Oct 26, 2026
  2. Anheledir commented on Oct 26, 2026

    @Anheledir
    OwnerAuthor

    Implemented in #63. Core storage/bridge, helper records, numeric IPC and named-enum CLI replies use generated JsonTypeInfo metadata; CLI reflection serialization is disabled. Contexts copy caller options to preserve shared installer/Core/CLI use. Compatibility evidence: 146 .NET tests, fixed legacy encrypted-plaintext/file/IPC fixtures, byte comparisons to prior anonymous replies, and 22 read-only JSON/error responses matching the existing binary. The smaller ReadyToRun candidate passes all seven local smoke suites with reflection fallback disabled.

    Strict partial-trim analysis now reports only Spectre.Console.Cli IL2104. Native AOT's remaining IL3050 sites identify Spectre CommandApp rather than application JSON. #61 remains the release-mode gate. Native JSON comparison, startup, deployment and ordinary native CI run on #63.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Next delivery: usability, installation and release blockersenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions