Make FieldValue lists homogeneous via Arity (#481) - #484
Conversation
Issue #481 (homogeneous FieldValue.list) hinges on one design question that changes the shape of the public type: how to represent an empty list. The response `type` enum carries a flat `LIST` (openapi.yaml:1573), not the granular `*_LIST` family requests use (openapi.yaml:1546). A non-empty list recovers its element type from the first element, but an empty `[]` supplies no hint at all — so whether `case empty` is required or merely defensive depends on how CloudKit actually round-trips an empty list field. Two live runs against the MistDemo dev container both failed BAD_REQUEST, but the populated list failed identically to the empty one ("Field X not found in Note") — the container does not auto-create schema fields, so the runs say nothing about empty lists. The question is unresolved, not answered; resolving it needs a LIST field added to `Note` via `cktool import-schema`, which requires a management token and modifies a shared container. Saved so this is resumable: - .claude/probes/481-empty-list/probe.swift — compiles against this branch, reads credentials from MistDemo.env - .claude/probes/481-empty-list/README.md — what was and was not established, step-by-step resume instructions, and what each possible outcome implies - memory: the no-schema-auto-create fact, which is what made the first reading of these failures misleading No production code changed yet. `case empty` remains the intended design since it is correct under every outcome. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Model each FieldValue kind as value-or-list so mixed/nested lists are unrepresentable, accept live *_LIST response tags, and cover empty+populated string lists in MistDemo test-public. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v1.0.0-beta.6 #484 +/- ##
=================================================
+ Coverage 86.90% 87.53% +0.63%
=================================================
Files 199 201 +2
Lines 4857 5111 +254
=================================================
+ Hits 4221 4474 +253
- Misses 636 637 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Expand list request/response/accessor tests so Codecov patch/project clear the #481 rewrite, and omit those bodies on Windows × Swift 6.2 to stay under the MistKitTests emit abort. Co-authored-by: Cursor <cursoragent@cursor.com>
String variables do not satisfy Issue.record's Comment parameter on Windows Swift 6.2; also silence function/closure body length on the expanded list conversion suite. Co-authored-by: Cursor <cursoragent@cursor.com>
String variables fail Issue.record's Comment parameter on Windows Swift 6.2 (#484 tip-over stubs). Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
FieldValuekind asArity(.value/.list) so mixed and nested lists are unrepresentable by constructionFieldValueResponseto accept live*_LISTtags (e.g.STRING_LIST), including empty lists; tags list writes on the request pathStringListRoundTripPhase(Note.tags) and migrates Examples/tests; deprecated scalar factories cover.string("x")-style call sitesTest plan
./Scripts/lint.sh(0 findings)swift test(681 tests passed)swift run mistdemo test-public— Phase 8 string list tags round-trip verified (populated + empty)swift run mistdemo test-private(optional follow-up)Closes #481
Made with Cursor