Skip to content

1.7: package descriptor schema draft + 3 validated descriptors (phase 1 unit 1.7) - #42

Open
cunninghamcard-bit wants to merge 1 commit into
exp/restartfrom
exp/u1.7-descriptor-schema
Open

cunninghamcard-bit wants to merge 1 commit into
exp/restartfrom
exp/u1.7-descriptor-schema

Conversation

@cunninghamcard-bit

Copy link
Copy Markdown
Owner

Phase 1 unit 1.7: descriptor schema draft. It follows arcships#200 §6.5 (docs/aisdk-architecture-alignment.md:1324) and RFC-0040 §2.1 (rfc/0040-provider-auth.md, from commit 3757cfd; that file is not in exp/restart). The branch is cut from exp/restart @ 8455db9, and the PR base is exp/restart.

Added

  • descriptors/package-descriptor.schema.json (JSON Schema 2020-12).

    • It requires all 16 descriptor fields listed in docs: full-chain AI SDK alignment design and impact map arcships/aimux#200 §6.5. In the schema they are named package_id, factory, settings_schema, credential_fields, runtime_handle_fields, methods (holding the method list and default_method), name_semantics, provider_string_rules, provider_options_rules, tools, extensions (holding discovery), auth (holding offline_auth_recipe), catalogue_mapping, audit_metadata, supported_features and source_verification.
    • additionalProperties: false is set throughout.
    • It encodes these rules from RFC-0040 §2.1:
      • A descriptor carries no credentials.
      • Credential fields are the only ones that accept {"env": ...}.
      • Runtime handles (fetch, id generator, ws) are listed apart from the settings data, so a closure is never treated as data.
      • The protocol/family tag is for audit and test grouping only.
  • descriptors/{openai,anthropic,openai-compatible}.json, written from the Rust factories and settings:

    • openai/mod.rs:187, :239, :309-385
    • anthropic/mod.rs:110, :164, :255-295
    • openai_compatible/mod.rs:60, :120, :208-245

    Each pins its SDK version from fixtures/aisdk/VERSIONS.json (openai 4.0.83, anthropic 4.0.71, openai-compatible 3.0.62). Tool ids are the ones found in the source.

  • aimux-providers/tests/descriptor_schema_test.rs, plus a jsonschema dev-dependency (a workspace dependency already present for aimux-core). It has four tests:

    1. every_descriptor_validates: all 3 descriptors pass the schema. This is the PHASES acceptance check.
    2. schema_rejects_malformed_descriptors: the schema rejects each of 8 edits, so it is not vacuous:
      • a missing required field
      • an unknown top-level field (body_overrides)
      • settings that allow unknown keys
      • a badly formed package id
      • an unknown method kind
      • an unknown auth mode
      • a closure listed as a runtime handle
      • a non-semver SDK version
    3. descriptors_are_internally_consistent: checks rules the schema can't express:
      • credential fields are names in the settings schema
      • runtime handles are not listed as settings data
      • the default method is in the method list
      • every provider-string example names a listed method
    4. provider_string_examples_match_the_factories: each descriptor's provider-string examples equal what create_openai, create_anthropic and create_openai_compatible actually report. The callable provider's default method matches default_method.

The descriptors are not wired into anything yet. Generation and the manifest come later (1.8 and phase 3). Fixture and cassette diff: zero.

Results (local linux x64)

R.0 baseline 1.7
cargo test --workspace 2871 / 0 / 7 2875 / 0 / 7 (+4)
fmt / clippy -D warnings ok ok
boundary script 0 0
gen_ts_types --check ok ok
Node ava (node 22) 87 / 1 fail 87 passed, same 1 failure

Python was not run (no venv). The schema field names and shapes are a draft for review. arcships#200 §6.5 names the fields but not their structure. "arcships#214 factories" and "arcships#219 types" in PHASES refer to upstream PRs; the samples here were written from the current code that came out of them.

…ible descriptors

descriptors/package-descriptor.schema.json (JSON Schema 2020-12) requires every
arcships#200 §6.5 descriptor field and stays credential-free data per RFC-0040 §2.1.
Three descriptors written from the Rust factories validate; the schema rejects
8 malformed edits; provider-string examples match the factories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant