fix(staging): declare Weaviate array metadata as array properties

AF
11h ago
+70-0

Summary

Preserve primitive list types when generating a Weaviate collection schema. stage_for_weaviate() emits lists for languages, links, email recipients, and emphasized text, but create_unstructured_weaviate_class() currently declares these properties as scalar text or int. The generated schema therefore disagrees with the staged values.

Unwrap Optional and recognize list/List annotations for supported primitive types, producing the documented text[], int[], number[], or date[] property type. Existing scalar and excluded-field behavior is preserved.

Validation

  • Added 22 cases; unchanged upstream produces 19 failures and 3 passes.
  • Native schema generation and staging cover all ten current primitive-list metadata fields, three scalar controls, and bare/optional/legacy List annotation forms.
  • New and existing Weaviate staging tests: 23 passed, 1 skipped. The existing database integration test retains its environment-based skip; no Weaviate server upload was run.
  • Checked the array representation against the official property data types reference.
  • Lockfile-pinned Ruff 0.15.10 check/format and git diff --check passed.

Release note

This corrects newly generated schemas. Existing collections retain their stored property types and are not migrated by this helper.

Checklist

  • The PR title is a user-facing release-note entry with a conventional commit prefix.
  • Please apply the bug category label during maintainer triage.
  • No changelog edit or version bump.