Repository navigation
Updates from Mistico v1.0.0-alpha.2 - #511
Conversation
…#55, #56, #59) - SchemaKit: SchemaModel, .ckdb parser/writer, File and Inferred sources - CommitKit: commit planning, results, conflicts, audit log - Codecs: Copy As formats, private pasteboard payload, paste decoding - PredicateKit: operator catalog, MistKit query translation, schema validation, Rows <-> Text parser and formatter - ConnectionKit: JSON connection repository and connection rules - MistKit: management-token auth and schema export (#135 Phase 1) - KeychainCredentials: Keychain SecretStore, web sign-in, Test Connection - Connections window and Connection editor - Review fixes and recorded decisions for each Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo3doXTbUtinhW7GufV
…, #63) - MistKit: public transport initializers, pinned listZones atomic flag, modifyRecords maps transport errors - CloudKitClient: live MistKit adapter with retry policy; record MistKit gaps - ChangeKit: ChangeSet staging with undoable inverses - SessionStore: per-connection session, lock, status, staging, commit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo3doXTbUtinhW7GufV
… MistKit (#116, #119) - Rename MistKitAdminKit to MisticoKit (Linux) and add MisticoApp (AppUI, MisticoAppKit, MisticoKeychain leaves) - CredentialKit, FeatureModels; localization and Apple-only APIs move to AppUI; import rules enforced in tooling and docs - Generic CloudKit Web Services code moves into MistKit - Stop the Connections list clipping rows loaded after first layout; re-resolve packages Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo3doXTbUtinhW7GufV
…36) (#144) * Sign body-less server-to-server requests with the empty-body hash (MistKit#507) CloudKit expects base64(SHA-256 of empty data) in the signed payload for a request without a body, not the empty string; every GET signed with "" got 401 AUTHENTICATION_FAILED. cloudKitBodyHash(of:) now hashes nil and Data() alike. Fix the RequestSignature and DocC docs, and pin the hash and a GET signature payload in tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4YjhX9WoY1bQyecs2 * Sign body-less recorder requests with the empty-body hash; add --public-zones ck() signed server-to-server GETs with an empty body hash, so CloudKit answered public zones/list with 401. Hash empty data instead, as MistKit now does. Add --public-zones to re-record only that read-only fixture (and its manifest line) without seeding records or needing the web auth token, and factor the secret scrub and check into functions both modes share. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4YjhX9WoY1bQyecs2 * Re-record public zones/list with the fixed signature (200) Recorded with Scripts/record-fixtures.sh --public-zones; the zone owner is scrubbed to the same placeholder as the rest of the set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4YjhX9WoY1bQyecs2 * Test that Test Connection's key check signs GET zones/list with the empty-body hash Drives MistKitConnectionProbe.listPublicZones through a recording transport and verifies the captured SignatureV1 against <date>:<sha256("")>:<path> with the key's public half, and that it does not verify against the old empty-string payload. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4YjhX9WoY1bQyecs2 * Drop the probe test's signature check and its Crypto import (#136) The test generated a P-256 key and verified the captured signature, which needed Crypto, a module CredentialKitTests doesn't declare. MistKit's RequestSignatureBodyHashTests already pin the empty-body hash and verify a GET signature. The probe test now uses a fixed throwaway key and checks the request it sends: one body-less GET of public zones/list with the three signing headers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4YjhX9WoY1bQyecs2 --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…137-1) (#149) * MistKit: Hashable, Identifiable and CaseIterable for record value types (MistKit #501) FieldValue (and Arity where T: Hashable), Reference, Asset, Location, ZoneInfo, RecordInfo and RecordTimestamp are Hashable (so the last three gain Equatable). RecordInfo is Identifiable by recordName; ZoneInfo by a ZoneID of its name and owner (no zoneType, like a reference's zone). Environment is CaseIterable. Tests check hashing agrees with == for doubles (0.0/-0.0, NaN), lists, optionals and the record types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Use MistKit's record value types in Mistico (#137, MistKit #501) AdminDomain now depends on MistKit and drops its own FieldValue, ZoneID, ZoneInfo, RecordReference, AssetValue, LocationValue, RecordSnapshot, RecordStamp, ReferenceAction and CloudEnvironment. CloudKitClient loses its conversion files and CloudKitClientError; RecordOperation still converts AdminDomain.RecordOperation to MistKit's. - Records are MistKit's RecordInfo (immutable; AdminDomain adds replacing/setting and zoneOrDefault). recordType and zoneID are optional: staging an edit or copy of a typeless record throws ChangeSetError.recordTypeUnknown; a missing zone reads as the default zone. - CloudKitClient keeps normalising what CloudKit returns (RecordInfo+RequestZone): records take the request's zone, default-zone references read as no zone, private-database zones drop the owner, and the default zone is matched by name when sending. - Lists are typed: switches use Arity, and AdminDomain adds listElements, init(listOf:), emptyList(of:) and fieldType. Paste builds an empty list from its type tag or schema field and refuses an untyped []. The unreachable CodecError mixed/nested list cases and their text are gone. - QueryCondition and FieldChange encode values as typed wire dictionaries (WireFieldValue), since MistKit's FieldValue coding is untagged. Saved queries in the old format are dropped one by one and logged, so they can't lock out Connections.json. - Asset keeps referenceChecksum/wrappingKey; downloadURL is a String (a staged local file is its file: URL string). Reference.action is optional. - Copy As golden files gain the empty list's STRING_LIST tag and lose the action NONE that sample references no longer carry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Notes: #137 stack run, typed empty lists, alpha saved-data format Agent notes record the owner's run authorization and the two decisions; memory notes and ISSUE-PLAN's contract list follow AdminDomain now using MistKit's record types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…-2) (#150) * MistKit: resolved field types, merged grants, schema sources (MistKit #502) - FieldType: a field's type as values carry it (a primitive or LIST of one). FieldValue.fieldType, SchemaFieldType.resolved (ENCRYPTED dropped, NUMBER is INT64 when PREFERRED AS INT64, DOUBLE otherwise) and SchemaFieldType(FieldType); SchemaField.resolvedType. - SchemaRecordType.mergedGrants (one grant per role, READ/CREATE/WRITE order), permissions(for:) and fieldIncludingImplicit(named:). SchemaField and SchemaRecordType are Identifiable by name. - CloudKitSchema(contentsOf:) reads a .ckdb file. - InferredSchema(inferringFrom:recordTypes:): fields seen, sorted by name, no indexes or grants, with SchemaNotice for no records and conflicting types. - SchemaSource protocol (loadSchema, schemaChanges) with ExportedSchemaSource (Management API export), FileSchemaSource (injected change stream, yields only when the bytes change) and InferredSchemaSource (one page per record type through CloudKitService). Non-CloudKit failures are SchemaSourceError. - Tests ported from Mistico's SchemaKitTests, with its .ckdb and query fixtures inlined; the inferred source runs over MockTransport. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Load schemas through MistKit's schema sources (#137, MistKit #502) SchemaKit is gone (sources, tests, target, imports), and so are AdminDomain's DatabaseSchema, RecordTypeSchema, FieldSchema, FieldType, SecurityRole, SecurityPermission and SchemaSource. Mistico reads MistKit's CloudKitSchema, SchemaRecordType and SchemaField; MistKit's FieldType (the resolved type) replaces AdminDomain's, which carried nothing app-only. - AdminDomain: LoadedSchema { schema, origin, loadedAt, referenceTargets } is what SchemaLoadState.loaded carries; SessionSchemaSource pairs a MistKit SchemaSource with the origin a session stamps; SchemaInferring makes the inferred source (CloudKitClient, and LiveCloudKitClient lazily after the keychain read). SchemaOrigin stays; SchemaSourceKind moves to FeatureModels for the Connection editor. - SessionStore stamps what a source loads, maps MistKit errors to AdminError (parse errors to invalidFile, unreadable files and a missing record type to schemaUnavailable, the rest through CloudKitClient's mapping) and picks the starting source with initialSchemaSource(for:file:export:): a .ckdb preference opens the file; Live (no team ID on a connection yet) and Inferred start with none, as before. - Reference targets come from LoadedSchema and are passed to the editors, References and Structure rows instead of living on each field. - Structure's .ckdb text, Copy .ckdb Line and Export Schema use MistKit's schemaText; the roles table uses mergedGrants. - The coordinator and the app's file preference build MistKit's FileSchemaSource with FileChangeWatcher as the change stream. - TestSupport: FakeSchemaSource adopts MistKit's protocol; StubTransport runs a real CloudKitService over in-memory records for inference tests and the preview default. The live export test now loads ExportedSchemaSource into a session. The provisional schema fixtures moved into MistKit's tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Notes: schema sources live in MistKit (#137-2) schemakit.md becomes schema-sources.md (what MistKit owns, what Mistico keeps, fieldsIncludingImplicit, reference targets, error mapping, starting source). Structure tab, SessionStore, Wave 0 contracts, live suite, recorded fixtures and ISSUE-PLAN's contract list follow; the duplicate SchemaKit index line is gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…dicateKit (#137-3) (#151) * MistKit: NSPredicate format strings, query model and validation (MistKit #500) Ports Mistico's PredicateKit and AdminDomain query types into MistKit as generic API: - QueryDescriptor (+ Condition, Comparator, Sort): an editable Codable/Hashable/Sendable query model (record type, zone, conditions, sorts, desired keys, limit) that converts to Query/QueryFilter/QuerySort. Condition values encode via WireFieldValue with .always type tagging. One Comparator case per FilterComparator, plus near(meters:). - QueryFilter.containsAnyTokens(_:_:). - QueryPredicate.parse/format: a hand-written lexer, parser and formatter for CKQuery's NSPredicate subset (CAST(…, "NSDate"), REFERENCE, LOCATION, BYTES, IN {…}, #name escaping, comments, TRUEPREDICATE; OR/NOT are errors; kilometres in text, metres in the model). Errors are QueryPredicateParseError with a structured reason, range, line and column. - QueryDescriptor.validate(against:): QUERYABLE/SEARCHABLE/SORTABLE index checks and per-type comparators via SchemaFieldType .allowedComparators, returning structured QueryValidationIssues. - Swift Testing ports of Mistico's PredicateKit tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Query with MistKit's QueryDescriptor and predicate parser (#137, MistKit #500) PredicateKit is gone (sources, tests, target, imports), and so are AdminDomain's PredicateQuery, QueryCondition, QueryComparator and QuerySort. Mistico reads MistKit's QueryDescriptor (Condition, Comparator, Sort), QueryPredicate parse/format and QueryDescriptor validation. - CloudKitClient calls QueryDescriptor.query() and passes limit, desiredKeys and zone to queryRecords; QueryTranslating and PredicateQueryTranslator are deleted. A condition that can't become a filter throws MistKit's QueryDescriptorError before any request. - AdminDomain: SavedQuery, RecordQuerying and RecordCounting take QueryDescriptor; QueryDescriptor.validate(against: LoadedSchema) checks indexes unless the schema was inferred. - FeatureModels: operator pop-ups hold FilterComparator. SchemaField.offeredComparators keeps SPEC §4.1's per-type order and filters it to MistKit's allowedComparators (so ENCRYPTED fields offer nothing); descriptorComparator turns a choice into Comparator (within starts at 1 km). The record's name is ___recordID in conditions and recordName on screen (QueryFieldName). PredicateBarIssue carries MistKit's QueryValidationIssue; its fix-it moves to AppUI. - AppUI words validation issues, fix-its and parse errors (line, column, reason) in +Text extensions with QueryTab.xcstrings entries; operator titles stay = ≠ < ≤ > ≥ / begins with / contains / within. - Stricter, as CloudKit is: a record-name filter needs ___recordID QUERYABLE in the schema; token filters need SEARCHABLE. - Saved queries in the old PredicateQuery shape are dropped and logged by ConnectionKit's per-query decode (no migration); tests cover that and the QueryDescriptor round trip. - Tests: Mistico's operator table, origin → index checks, record-name rules, ___recordID in the text editor, and AppUI wording. MistKit's own tests cover the parser, translation and validation rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Notes: queries live in MistKit (#137-3) Predicate bar, Query tab and Wave 0 contracts describe MistKit's QueryDescriptor, QueryPredicate and validation, Mistico's operator table and the ___recordID ↔ recordName naming (and that record-name filters now need ___recordID QUERYABLE). Schema sources, the MEMORY.md index and ISSUE-PLAN's module and contract lists follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* MistKit: WireRecord, wire JSON decoding and cloudKitReadable encoder (MistKit #503) WireRecord is a whole record dictionary (recordName, recordType, recordChangeTag, zoneID, typed fields, created/modified, deleted), Codable and Hashable, built from RecordInfo and converted back with RecordInfo.init(_:). WireRecordDocument decodes records from an array, a single record, a query response ({"records": [...]}) or a records/modify body (deletes skipped, the body's zoneID filled in). Untagged field values are typed by CodingUserInfoKey.cloudKitFieldTypes ([String: SchemaFieldType]) and then by their JSON shape. Decoding caller-supplied JSON throws a ConversionError without the DEBUG trap used for CloudKit responses. JSONEncoder.cloudKitReadable is [.prettyPrinted, .sortedKeys, .withoutEscapingSlashes]; its docs name userInfo as the place for future wire options. RecordOperation (with ShareParticipant, UserIdentity, NameComponents and UserIdentityLookupInfo), WireFieldValue, WireRecordOperation and ModifyRecordsRequestBody are Hashable. WireRecord and WireRecordOperation share one internal fields codec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * MistKit: refuse untyped empty lists in wire JSON (MistKit #503) An untagged `[]` with no cloudKitFieldTypes hint no longer decodes as an empty STRING_LIST: an empty list's type comes from its `type` or the schema. WireFieldValue throws DecodingError.dataCorrupted at the field, with ConversionError.ambiguousEmptyList(fieldName:) as its underlying error. JSONDecoder reads an untagged `5.0` the same as `5` (macOS and Linux Swift 6.1), so it decodes as INT64; the docs say to pass a type or a schema type for DOUBLE, BYTES and TIMESTAMP values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * MistKit: wire decoding errors carry their coding path (MistKit #503) A ConversionError thrown while decoding caller-supplied wire JSON (a field value that contradicts its type, an unknown zoneType, a negative timestamp) came out bare, so a caller decoding an array of records couldn't tell which record or field was wrong. WireFieldValue, WireRecord, WireRecordDocument and ModifyRecordsRequestBody now throw DecodingError.dataCorrupted at the field or record, with the ConversionError as its underlyingError, as the untyped empty list already did. ModifyRecordsRequestBody's zoneID also no longer hits the DEBUG conversion trap. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * MistKit: encoding errors name the record field (MistKit #503) WireRecord and WireRecordOperation wrote `fields` through nestedContainer(keyedBy:forKey:), and JSONEncoder leaves a nested container's key out of an EncodingError's coding path: a NaN came back at [0].ratio.value instead of [0].fields.ratio.value. WireFields now encodes as a value, so the path has `fields` and the field name, as decoding does. The output is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Copy As and Paste use MistKit's wire format (#137, MistKit #503) Codecs writes and reads CloudKit JSON through MistKit's WireRecord, WireRecordDocument and ModifyRecordsRequestBody with JSONEncoder.cloudKitReadable. Codecs/CloudKitJSON/, Codecs/JSON/ (JSONValue and its encoder) and ModifyRecordsBody are gone. - Copy As JSON is [WireRecord]; Copy As modifyRecords Request Body is ModifyRecordsRequestBody(updating:) with every type written. A NaN or infinite number is EncodingError.invalidValue; its coding path names the record and field in CodecError.nonFiniteNumber. - RecordsPasteboardPayload is an Encodable {formatVersion, recordType, records: [WireRecord]}; Paste reads the version and type first. - Paste decodes WireRecordDocument with the schema's field types (NUMBER resolved as the grid reads it) as cloudKitFieldTypes. An untyped empty list in a field the schema doesn't know is MistKit's ambiguousEmptyList, shown as "Can't tell the empty list's element type."; DecodingErrors map onto PasteError by their coding path, and an unknown operationType is an invalid record. Pasted zones keep the default zone as ZoneID.defaultZone (owner and zoneType dropped) and default-zone references as no zone (CloudKitClient's withNormalizedReferences, now public). - The four JSON goldens are regenerated from the encoder (MISTICO_RECORD_GOLDENS=1); the values are unchanged, only formatting: keys sorted at every level, "key" : value, empty arrays on three lines, 5.0 written as 5. CSV, TSV and record names are unchanged. User-visible: Copy As JSON and the modify body are now key-sorted, and an encrypted field is written with "isEncrypted": true, a tombstone with "deleted": true. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Notes: Copy As and Paste JSON are MistKit's wire format (#137-4) Copy, export, drag describes WireRecord, ModifyRecordsRequestBody and the private payload through JSONEncoder.cloudKitReadable, Paste's WireRecordDocument decoding with schema field types, how DecodingErrors map onto PasteError, pasted zone normalisation and the golden regeneration flag. Wave 0 contracts, the MEMORY.md index and ISSUE-PLAN's Codecs row and 1E acceptance follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…137-5) (#153) * MistKit: modifyAllRecords reports completed and unsent operations on failure (MistKit #504) modifyAllRecords now throws CloudKitError.modifyIncomplete(completed:unsent: underlying:) when any request fails or the task is cancelled between requests, including the first (completed is then empty), so callers handle one shape. completed holds the results of every request that came back; unsent holds the failed request's operations and every later one, in send order. The failed request's operations may have been applied by CloudKit (e.g. a dropped connection after send), so re-sending can hit CONFLICT. reason, retryAfter, redirectURL, isRetryable, httpStatusCode and serverErrorCode read through to the underlying error. Single-request modifyRecords and chunkedBatches are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * MistKit: rename ModifyRecords network-error tests to match their type (file_name lint) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Commit banner says unsent rows may already be saved (#137-5) When a commit stops at a request whose answer never came (offline after send, cancelled, an unreadable response), CloudKit may have applied it (MistKit #504). CommitReport.unsentMayHaveBeenSaved says so; a request CloudKit refused (throttled, sign-in expired, no credentials, access denied) applied nothing. The partial-commit banner adds "Some of them may already be saved and come back as conflicts." after "Commit again to send the rest." in that case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Commit with MistKit's modifyAllRecords; delete CommitPlanner and CommitExecutor (#137-5, MistKit #504) RecordCommitting.commit(_:atomicZones:in:) now takes a whole commit and returns a CommitResponse (results + the error that stopped it) instead of one CommitBatch per request. CloudKitClient makes one modifyAllRecords call, atomic in the zones the server reports as atomic; on modifyIncomplete it keeps the completed results (stamped with each operation's zone, found by record name) and maps the underlying error, or .cancelled, so unsent rows come back notSent and stay staged. AdminError(mapping:) unwraps modifyIncomplete to its underlying error. CommitKit keeps the planner's checks as StagedCommit (duplicate record, asset without a created/updated record, atomic zones) and RecordCommitting.send(_:in:) runs asset uploads then the commit. SessionError/PreviewCommitError .planning becomes .invalidCommit. CommitBatch, CommitPlan, CommitPlanner, CommitPlanningError and CommitExecutor are gone. FakeRecordCommitting splits like modifyAllRecords (configurable batch size), can fail at a given request and cancel the task after one. New tests: partial failure keeps unsent rows staged, full success clears, cancellation keeps completed rows, multi-zone and atomic zones, plus fixture-backed CloudKitClient tests for a later-request failure and cancellation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Notes: commits go through MistKit's modifyAllRecords (#137-5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…rror mapping (#137-6) (#154) * MistKit: verifyCredentials for Test Connection (MistKit #505) Add CloudKitService.verifyCredentials(), which checks each configured credential concurrently and returns a CredentialVerification with one CredentialStatus (accepted / rejected(CloudKitError) / notConfigured) per CredentialKind: - webAuth: users/caller via fetchCaller() - serverToServer: public zones/list signed with the key - apiTokenOnly: users/caller signed with the API token alone; AUTHENTICATION_REQUIRED counts as accepted (valid, needs sign-in) A failing credential is reported, never thrown; the call throws only CancellationError. Results hold no credential material. fetchWebAuthSignInURL now shares the API-token-only users/caller request. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * One MistKit → AdminError mapping in AdminDomain (#137-6) Merge CloudKitClient's AdminError+Mapping and CredentialKit's CloudKitErrorMapping into AdminDomain's AdminError+MistKit, with Test Connection's stricter rules everywhere: server reason text keeps every secret redacted (CloudKitClient now takes the service's secrets, from Credentials.secrets), free text only for errors with no case of their own, and wrapped errors are never described (raw HTTP bodies and decoding/conversion/underlying descriptions are dropped). Kept from CloudKitClient: notQueryable/notSortable 400 refusals, URLError → offline, throttled/tryAgainLater with retryAfter, the modifyIncomplete unwrap, cancellation and credentialReferences. Folded in the stragglers: AdminError(schemaLoading:origin:) moves from SessionStore to AdminDomain, and the small fallbacks in CommitKit send, SessionRules, GridModel and ReferencesModel now call AdminError(mapping:). A QueryDescriptorError (a condition MistKit can't turn into a filter, before any request) maps to the new AdminError.invalidFilter(fieldName:), worded in the query tab. Mapping tests move to AdminDomainTests (mapping, redaction, schema loading); ErrorMappingTests stays in CloudKitClientTests since it replays fixtures through a client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * MistKit: a malformed raw PEM is invalidPrivateKey (MistKit #505) Credentials.makeTokenManager wrapped only a failed PEM file read in CloudKitError.invalidPrivateKey; a key that loaded but wasn't a P-256 PEM escaped as a TokenManagerError, so verifyCredentials reported it as rejected(underlyingError(TokenManagerError)) and callers couldn't tell a bad key from any other local failure. HandlingErrors.md already documents invalidPrivateKey for "not a valid ECDSA P-256 PEM"; this makes it so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Test Connection uses MistKit's verifyCredentials, per credential (#137-6, MistKit #505) ConnectionTester makes one verifyCredentials() call through ConnectionProbing (MistKitConnectionProbe → services.makeService(target)) instead of users/caller then public zones/list, and reports a CredentialCheck per CredentialKind: accepted, rejected (401 AUTHENTICATION_FAILED or an unreadable key: the credential itself) or failed(AdminError) through the one mapping, secrets redacted. A rejected credential no longer hides the others'. fetchCallerRecordName stays only for web sign-in's token check; Test Connection no longer reads the user record name (the UI never showed it). LiveConnectionTester builds the report per kind: an accepted key reaches Public, a signed-in user credential Public/Private/Shared, an API token alone is "needs sign-in". The report now carries problems alongside what was reached, so a wrong API token or server-to-server key (401) reads as "CloudKit rejected the API token / server-to-server key" instead of "Web sign-in expired" (421), and a key that works still shows Public reached when the sign-in expired. Live suite: key + rejected web token, API token alone (421 → needs sign-in) and a wrong API token (401 → rejected) against Tabletop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz * Notes: Test Connection is MistKit's verifyCredentials; one AdminError mapping (#137-6) Update the memory notes and ISSUE-PLAN this branch makes stale: the mapping lives in AdminDomain (AdminError+MistKit, +SchemaLoading); the 401-vs-421 question is answered for Test Connection (verified live) but still open for sessions; web sign-in keeps fetchCallerRecordName; the malformed-PEM MistKit gap is closed. Drop duplicate index lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4ufnFcd3uGsVZmbhz --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…160) * Move duplicated and generic CloudKit code from Mistico into MistKit One commit for the 2026-11-23 review. The steps overlap in shared files, so they can't be split into commits that each build: - Move AppIdentity out of its folder in MisticoCore. - Use MistKit's CloudKitServerErrorCode and RecordOperationFailure instead of Mistico's ServerErrorCode and RecordFailure; make MistKit's FieldValue list helpers public. - Rename Mistico's RecordOperation to PlannedOperation; MistKit gains RecordOperation(fieldUpdates:). - Move generic pieces into MistKit: zone identity and isDefaultZone fix, ZoneInfo.isAtomic, RecordInfo helpers, OperationResult.recordName, CloudKitError.completedResults/unsentOperations, query error fieldName, Database.Scope, RecordOperation.saving, CKDBHighlighter, QueryFieldName. - Delete redundant Mistico helpers (UNKNOWN_ERROR fallbacks, Environment.isProduction); add Environment.allowsColorTag. - Move plain code out of MisticoObservables into MisticoCore, MisticoCoding, MisticoTracking, MisticoCredentials and MisticoFakes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4APHkzx6tPpi18edS * Delete RecordPage, RecordInfo.setting and Reference.wireZoneID MistKit's QueryResult gains Hashable and hasMore, so Mistico uses it directly instead of its own RecordPage; RecordPage.maximumSize callers use CloudKitService.maxRecordsPerRequest. RecordInfo.setting(_:to:) goes: its preview and test callers build the fields and call MistKit's RecordInfo.replacing(fields:). Reference.wireZoneID is inlined at its one caller in FieldValueRequest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4APHkzx6tPpi18edS * Merge the two filter-value readers into ConditionValueText The Query tab's condition rows (ConditionValueText) and the predicate bar (PredicateRowValue) each read a typed filter value in POSIX format. There is now one reader, ConditionValueText in MisticoCore. It switches on MistKit's FieldType.elementType with no recursive list unwrap, so a list of lists has no row form. It reads strings as typed, numbers, record names, yyyy-MM-dd[ HH:mm] dates, "lat, lon" locations in range, and "within" distances in kilometres (nearMeters(fromKilometres:)). PredicateRowValue now only maps a row to a condition or a PredicateBarIssue. It still trims the row's text first (strings included), reports an empty value as missing, and takes a TIMESTAMP row's value from its date picker. Behaviour changes: Query tab rows on a location field now read and show "lat, lon", where before they showed nothing and stayed flagged. The bar reads a list field's value as its element for any operator, not only contains, which is the only operator it offers for lists. FieldValueParser stays separate: cell editing reads the user's locale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4APHkzx6tPpi18edS * Delete PlannedOperation; commit StagedChange directly PlannedOperation was a StagedChange without the old values. StagedCommit and CommitReport used only its kind, record name, type and zone, which StagedChange has, so RecordCommitting.commit(_:atomicZones:in:) now takes [StagedChange], StagedCommit holds `changes` and CommitReport.Row holds the `change` that was sent (with uploaded assets filled in). StagedChange.zoned builds MistKit's RecordOperation with today's rules: deletes send no fields, creates send no change tag, a nil new value clears the field. StagedChangeKind maps privately to MistKit's OperationType and replaces PlannedOperation.Kind in AuditEntry and AuditLogLine; the raw strings are the same, and a new test decodes audit-log lines written before the change. The PlannedOperation conversion tests move to StagedChangeZonedTests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4APHkzx6tPpi18edS * Name the record and field when a number isn't finite A NaN or infinite DOUBLE, location number or timestamp made encoding the records/modify body throw, which surfaced as CLIENT_ERROR: ClientError. MistKit: - RecordFieldErrorContext, a protocol for errors about a record's field, adopted by CloudKitError (reading through modifyIncomplete) and ConversionError. - CloudKitError.invalidFieldValue(recordName:fieldName:underlying:), thrown by modifyRecords (and so per request by modifyAllRecords) with nothing sent. - CloudKitError(encodingError:recordNames:), which resolves a JSONEncoder failure on [WireRecord], ModifyRecordsRequestBody or the generated modify body to the record and field. Mistico: - Failable init?(_: some RecordFieldErrorContext) on CodecError and AdminError. CloudKitJSONWriting uses MistKit's resolver and drops its own coding-path parsing. - AdminError.invalidFieldValue(recordName:fieldName:), mapped from MistKit; the commit banner names the record and field, and the report doesn't claim unsent rows may have been saved. - FieldValueParser refuses nan, inf and overflowing text as not a number. The paste decoder reads JSON, which can't hold one; tests pin that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4APHkzx6tPpi18edS * Make FieldValue's Codable keep its type MistKit's FieldValue now encodes and decodes only the CloudKit field dictionary with its type, {"value": …, "type": …}, by delegating to WireFieldValue with .always tagging. Untagged input and {"value": null} are decoding errors, so TIMESTAMP, BYTES, whole-valued DOUBLE and empty lists round-trip. CloudKit requests and responses still go through FieldValueRequest / FieldValueResponse. QueryDescriptor.Condition and Mistico's FieldChange drop their custom WireFieldValue coding for plain Codable. They already wrote this shape, so saved queries and audit-log lines still decode; new tests decode a saved query and an audit-log line in the earlier format and re-encode them byte for byte. MistDemo's web API now takes typed fields (app.js tags them), and its JSON output and tests use the tagged shape. ReleaseNotes notes the breaking format change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4APHkzx6tPpi18edS * One client type: CloudKitAdapter over a ServiceProvider CloudKitClient becomes CloudKitAdapter, still a struct in MisticoClient. Instead of a fixed CloudKitService it holds a ServiceProvider actor that either answers with a ready service (tests, previews) or builds one from the keychain on first use (CredentialResolver + CloudKitServiceFactory), caches it, and forgets it after authenticationExpired or credentialsMissing. Error text is scrubbed with the secrets the provider resolved. LiveCloudKitClient and its two extensions are deleted; their behaviour is the keychain-backed provider. LiveInferredSchemaSource moves to MisticoClient and resolves the service when the schema loads. MisticoClient now depends on MisticoCredentials. New ServiceProvider and keychain-adapter tests cover build-once, caching, reset, and forgetting after a failed read or commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4APHkzx6tPpi18edS * Send nothing when any modify request can't be encoded; reject NaN in filters - modifyAllRecords encodes every request before sending the first, so a NaN or infinite number stops the call with nothing saved (completed is empty, unsent holds every operation). - ConditionValueText rejects non-finite numbers and distances, so filter rows can't send NaN or infinity either. - MistKit release notes: invalidFieldValue, RecordFieldErrorContext and CloudKitError(encodingError:recordNames:). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4APHkzx6tPpi18edS * Update project memory for the 2026-11-23 MistKit cleanup CloudKitAdapter/ServiceProvider, StagedChange commits, ConditionValueText as the shared filter reader, strict FieldValue Codable, NaN handling, and worktree/mise/MistKit toolchain gotchas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4APHkzx6tPpi18edS * Add DocC catalogs for every Mistico module and a make docs target One catalog per module in MisticoKit and MisticoApp (overview plus topic groups over the existing public types), swift-docc-plugin 1.5.0 in both packages, and `make docs` building a combined archive per package into build/docs. Nothing is published. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4APHkzx6tPpi18edS --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.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
|
Review of #511 (Updates from Mistico v1.0.0-alpha.2)Scope caveat: this PR is 257 files and about 17.8k added lines, and its description is empty. I sampled the highest-risk areas: Suggestions
Positives
No security vulnerabilities found in the sampled code. The main risks are the API-compat surprise (item 2) and shipping an unverified external API contract (item 3). |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v1.0.0-beta.6 #511 +/- ##
================================================
Coverage ? 90.66%
================================================
Files ? 302
Lines ? 7638
Branches ? 0
================================================
Hits ? 6925
Misses ? 713
Partials ? 0
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:
|
- Narrow CloudKit INT64 to Int with Int(exactly:) and throw the new
ConversionError.integerOutOfRange where Int is 32-bit (WASI) instead of
trapping ("Not enough bits to represent the passed value").
- Skip the example .ckdb schema suite on WASI, whose sandbox can't read the
source tree.
- Android: pin ubuntu-24.04; ubuntu-latest is 26.04, which has no swift.org
host toolchain.
- Windows: drop windows-2025; its MSVC 14.52 STL needs Clang 22.
- Xcode 27 lanes: pin /Applications/Xcode_27.2.app with 27.2 simulators and
the renamed devices (iPhone 18 Pro, Apple Watch Ultra 4 (49mm),
Apple TV 4K (4th generation)) across MistKit, MistDemo,
MistKitConfiguration and the example workflows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The CloudKit Management API client was hand-written. It now has its own OpenAPI spec, management-openapi.yaml (host api.icloud.apple.com, X-Apple-CloudKit-Management-Token auth, JSON RequestError), generated into a new MistKitManagementOpenAPI target, the same way openapi.yaml feeds MistKitOpenAPI. The public CloudKitManagementService API is unchanged. - ManagementTokenMiddleware sets the token header; there is no logging middleware, and ClientError (whose description includes the request headers) is never rethrown. - ManagementErrorBodyMiddleware buffers non-2xx bodies so an undecodable error body still reaches CloudKitManagementError.httpError. - Success bodies over 32 MiB throw invalidResponse; ManagementToken is hidden from Mirror/dump too. - generate-openapi.sh, the regenerate-and-diff CI check, SwiftLint and Codecov cover the new target. - MistDemo: add export-schema (CLOUDKIT_MANAGEMENT_TOKEN, CLOUDKIT_TEAM_ID) for live verification. - Tests: request shape and encoding, success/error bodies including single-read streams, token exposure, and both middlewares. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #511 (Updates from Mistico v1.0.0-alpha.2)Scope caveat: GitHub refuses to render this diff (over 20,000 lines), so I couldn't review all of it. I read the file list and spot-checked the Management API token and error middleware and Process
Code quality and best practices
Potential bugs and risks
Performance
Security
Test coverage
SummaryThe pieces I read are careful: secrets are redacted, errors are typed, and the failure modes are documented. The main concerns are the unverified Management API, the strict |
…MENT_TEAM Ran `mistdemo export-schema` and curl against api.icloud.apple.com for iCloud.com.brightdigit.MistDemo on 2026-11-24. The management-openapi.yaml contract held: token header alone, 200 text/plain, JSON RequestError whose code equals the HTTP status. Beyond CKTool JS: RequestError.message is a kebab-case code, an unknown container is 403, and the environment segment is case-sensitive. - Replace ProvisionalManagementFixtures with RecordedManagementFixtures: the live export and four live error bodies (request UUIDs scrubbed); only the all-optional-keys RequestError stays hand-written. - export-schema reads the team from DEVELOPMENT_TEAM, the value .env already sets for Xcode signing, instead of a second CLOUDKIT_TEAM_ID; document it and CLOUDKIT_MANAGEMENT_TOKEN in .env.example. - Update the spec, research notes, AGENTS.md and project memory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: Updates from Mistico v1.0.0-alpha.2This is a sampled review. The PR has 290 files and about 20k added lines, so GitHub can't render the full diff. I read the Management API plumbing, OverallThe code I read follows the repo conventions: explicit ACLs, Scope and process
Code quality and bugs
Security
Performance
CI and build
Test coverage
SummaryThe code I read is solid and well documented. My main requests are a real PR description, a check that |
With Android back on a working runner, its emulator showed the same failure as WASI: the test binary runs away from the checkout, so reading Examples/*/schema.ckdb through #filePath fails. Gate the suite on Platform.isPackageSourceTreeReachable (Package.swift exists at the package root) instead of a platform list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Replying to the review, one point at a time. The changes are in a1812e3, e0bb279, 6d0ea69 and c83ee01. 1. Split or describe. The PR now has a description listing the new public API and the breaking changes. It stays as one PR because it syncs code that Mistico moved into MistKit. The commits are grouped by Mistico feature, so it can still be bisected. 2. 3. Management API unverified. Two changes:
On the two sub-points:
4. AGENTS.md vs CLAUDE.md. 5. Generated code. The "Regenerate … and diff" check passed for 6. Test gaps.
7. Conventions. Every new import has an explicit access modifier, new files carry the license header, and the changed files are clean under SwiftLint and swift-format. I ran the locally installed versions, not the mise-pinned ones, and periphery wasn't run. CI. CI failures from the previous run are fixed as well:
🤖 Generated with Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #511: Updates from Mistico v1.0.0-alpha.2I couldn't review the whole diff. It is about 20k lines across 291 files, and the GitHub API refuses to return it. I read the new hand-written code that matters most: the Management service and its middleware, the wire codecs, What looks good
Issues and suggestions
Security
Test coverageThe PR reports 999 passing tests and recorded fixtures, which is strong. The gaps I'd close:
Overall this is a well-structured sync with careful secret handling. The main things I'd fix before merging are the paginator guard (1) and the |
Review of #511 (Mistico sync)The PR diff is over GitHub's 20k-line limit, so I read the security-sensitive and behavior-heavy files directly instead of the full diff. These were What looks good
Suggestions
PerformanceNothing alarming. The requests are sequential by design, so atomic ordering is preserved. Zone grouping is O(n). Security
Overall this is solid work. I'd address item 1 before merge, and the rest are non-blocking. |
Instead of skipping the example-schema suite on WASI and Android, resolve committed files through PackageFile.url(_:), modeled on SyndiKit's Content.Directories: the working directory first, then its parents, then the #filePath checkout. - WASI: swift-build runs the test binary with `--dir .`, so the package root is the working directory. - Android: `android-copy-files: "Examples"` copies Examples/ next to the test binary, which runs from that folder on the emulator. (Copying each schema.ckdb individually would flatten them into one name.) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #511 (Mistico sync)I reviewed the Management API wrapper and the wire-format codecs in detail. GitHub refuses to render the full diff (over 20,000 lines), so I did not read the other areas line by line. That includes the query predicate parser, the schema parser, Strengths
Concerns
Performance and security
Test coverageThe reported 999 passing tests and the live verification are good. Gaps I'd like covered:
Overall this is solid work with good defensive design. I'd approve once the CI changes are split out or justified, and the points above are confirmed or addressed. |
- modifyAllRecords: the pre-flight now runs every check modifyRecords runs before sending (encrypted-field validation and operation conversion, not only encoding). A bad operation in a later chunk used to be skipped by the pre-flight's `try?` and fail only after earlier chunks were saved. - queryRecordPages: stop when the server repeats the continuation marker even on a page with records (yielded once). It used to re-request the same page forever. Document that every stream error is a CloudKitError. - fetchWebAuthSignInURL: return only an https apple.com / icloud.com page; refuse file:, custom-scheme and other-host redirectURLs. - PredicateParser: bounds-check the TRUEPREDICATE lookahead. - Comment why ManagementErrorBodyMiddleware drops oversized error bodies and why WireFieldValue reads its decoder twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace "## Unreleased" with "## 1.0.0-beta.6". Scripts/release.sh reads the first "## " heading as the latest tag, so "Unreleased" broke notes-draft (generate-notes "since Unreleased") and verify-tag. The section now covers everything since 1.0.0-beta.5: the Mistico sync (#511), encrypted fields (#485), and #480/#482/#483, as flat bullets with PR links. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #511 (Mistico sync)The PR is too large for GitHub's diff API (over 20k lines), so I read the highest-risk files directly instead of the whole diff. Those were the Management API auth and error path, What looks good
Issues and suggestions
Test coverageThere are about 43 test files matching management, modify-all, query pages, web-auth sign-in, verify-credentials or retry. The PR reports 999 passing tests on macOS only. Please confirm the new code is covered on Linux, WASI and Android too. The Security summaryI found no blocking security issues. The token redaction, the redirect URL check and the bounded error-body read are all sound. Items 4 and 5 are hardening suggestions. Overall this is solid work. Item 1, the breaking |
brightdigit/BushelCloud was renamed brightdigit/SwoopMistKit. Move the subrepo to Examples/SwoopMistKit and point its .gitrepo remote at the new repo (branch mistkit, same commit). The package inside is unchanged and still named BushelCloud. Remove Examples/CelestraCloud; CelestraCloud continues as its standalone repo. - CI: examples.yml tests SwoopMistKit; Scripts/release.sh pins and update-subrepo.sh target Examples/SwoopMistKit; project.yml drops Celestra; the example-schema test reads Examples/SwoopMistKit/schema.ckdb. - Docs: README, AGENTS.md, DocC articles, MistKitConfiguration docs, .claude docs, the release skill and memory now use the new path and repo URL. CelestraCloud links point at its standalone repo. Prose about the Bushel and Celestra apps and the talk is unchanged. - ReleaseNotes: note the change under 1.0.0-beta.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copying all of Examples/ failed in `adb push`: it can't create symlinks on the device (Examples/CelestraCloud/CLAUDE.md was one) and pushed megabytes the tests never read. Stage the tracked Examples/*/schema.ckdb files with their paths and copy just .android-test-data/Examples. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #511 (Mistico sync)I could not read all of this PR. GitHub's diff API refuses it (over 300 files), and it adds about 19k lines. I read the code that is riskiest for security and correctness. That was the Management API client, What looks good
Issues and suggestions
No blocking bugs found in the files I read. Item 1 is the one I'd fix before merging. Items 3 and 4 are worth a decision. |
ubuntu-latest moved to Ubuntu 26.04, which doesn't ship libxml2.so.2, so
the mise-installed SwiftLint 0.62.2 binary failed to start ("error while
loading shared libraries: libxml2.so.2") and Linting reported an error.
Pin lint in MistKit, MistDemo, MistKitConfiguration and SwoopMistKit, as
the Android jobs already are.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: Updates from Mistico v1.0.0-alpha.2This PR has 300+ files, so I read the security- and correctness-sensitive parts rather than every file. I did not build it or run the tests. The files I read were the management token and middleware, What looks good
Concerns
Test coverage
Convention check (CLAUDE.md)
Overall the design is careful, especially the error and credential handling. My main asks are to confirm the Celestra deletions are intentional and to cover the URL-validation edge cases with tests. |
Add ManagingSchemas, BuildingQueries, EncodingRecordsAsJSON and BatchingAndPagination; cover retry hints, record/field error context, verifyCredentials and fetchWebAuthSignInURL; bring FieldTypePolymorphism up to date with Arity lists and *_LIST response tags; regroup the landing page Topics by feature area; fix the 20 DocC link warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le notes Add SyncingChanges, SharingAndUsers, WorkingWithAssets and SubscriptionsAndNotifications to the DocC catalog and its Topics. Correct the asset upload method (POST, not PUT) and the fileChecksum doc comment (a server-minted identity token, not a SHA-256). In AGENTS.md, fix the fetchRecordChanges/fetchAllRecordChanges signatures, remove the nonexistent no-argument discoverAllUserIdentities(), and correct what RecordTypeIterating is used by. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…neID - Drop the `.private` default from listZones, lookupZones, fetchDatabaseChanges, fetchAllDatabaseChanges, fetchRecordZoneChanges, fetchAllRecordZoneChanges and the deprecated fetchZoneChanges / fetchAllZoneChanges, matching every other operation (no silent database default). - rereferenceAsset now forwards zoneID to its target lookupRecords and updateRecord calls, which previously hit the default zone; add a regression test that checks both request bodies. - Deprecate lookupUsersByEmail / lookupUsersByRecordName (Apple-deprecated users/lookup/*); tests call them through a non-deprecated protocol, as the FetchZoneChanges tests do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Swift 6.2 on Windows silently aborts while emitting MistKitTests (#488); drop it rather than keep a permanently red, non-gating job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lint.sh exited 127 in Claude Code web sessions because the toolchain exposes only a swift symlink on PATH. Fall back to the toolchain's bin directory for swift-format. Also apply the header script's normalization of FieldValue+Codable.swift. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V3TXo4Ap5WPp9rBvzBYYuk
Review of #511 (Mistico sync)I could only read the checked-out tree. The GitHub diff is over 300 files, mostly deletions under What looks good
Concerns
TestsThe PR reports 999 tests passing on macOS (Xcode 27.2). Please confirm CI is green on Linux, WASI, Windows and Android. The 32-bit No security blockers found. |
ManagementErrorBodyMiddleware dropped an error body over the 1 MiB cap, or one that failed mid-read, with no trace: the caller saw a bare status. It now logs a .warning on the network subsystem naming the operation, the status and the error type. The body, the request and its headers (which carry the management token) are never logged. Behavior is otherwise unchanged. Tests capture the warning with a small AsyncStream-backed LogHandler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The preflight check converted and JSON-encoded every request, and modifyRecords then converted and encoded it again when sending. The preflight now finds a NaN or infinite number directly on the domain values (DOUBLE, TIMESTAMP as wire milliseconds, every Location number), producing the same invalidFieldValue(recordName:fieldName:) the encoder path does, and keeps the converted operations. Both modifyRecords and modifyAllRecords send through a new internal sendModifyRecords, which keeps the EncodingError mapping as a safety net. A parameterized test pins the new check to JSONEncoder's behavior on the converted request, including a finite date that overflows in milliseconds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #511 (Mistico sync)I could not read the full diff. GitHub refuses to render it at 629 files, so this covers the PR description and a spot check of the Management API, S2S signing and What looks good
Concerns
Tests, security, performance
🤖 Generated with Claude Code |
With Xcode 27.2's SDK, swiftc 6.3.x fails every package manifest (swift-crypto, swift-openapi-urlsession, ...) with "unknown argument: '-target-arch-variant'" and then crashes with signal 11, so a plain `swift test` built nothing. swift.org 6.4.2 matches Xcode 27.2's Swift and passes all 1005 tests. CI is unaffected: every lane passes its toolchain explicitly and none reads .swift-version. The pin is read only by swiftly and by Scripts/cloud-setup.sh, whose fallback moves to 6.4.2 too; swift.org publishes 6.4.2 for Ubuntu 24.04. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #511 (Mistico v1.0.0-alpha.2 sync)Scope caveat: GitHub can't render this diff (629 files), so I reviewed the PR description in full and read the new Management API code in What I read, and it looks good
Concerns and suggestions
Overall the parts I could check are high quality and match the repo's conventions. My main request is the migration notes for the |
Syncs the CloudKit code that Mistico (v1.0.0-alpha.2) moved into MistKit, so Mistico can depend on MistKit instead of carrying its own copies. Targets
v1.0.0-beta.6. The branch is a sync, so it stays as one PR. The commits are grouped by feature (Mistico #116, #119, #136, #137-1 … #137-6, #160) to keep it bisectable.ReleaseNotes.mdhas the full beta.6 list.GitHub can't render the diff (629 files). Most of the size is the Examples change below: about 31k of the 32k deleted lines are
Examples/CelestraCloud, and 132 of the files are theBushelCloud→SwoopMistKitrename. The library change is roughly +20k lines underSources/MistKitandTests/MistKitTests.New public API
CloudKitManagementServicewithexportSchemaText(environment:)andexportSchema(environment:), plusManagementToken,CloudKitManagementError,ManagementRequestFailureandExportedSchema.management-openapi.yamlinto a newMistKitManagementOpenAPIproduct. It's separate fromopenapi.yamlbecause the service has a different host, auth and error shape.CloudKitSchema(parsing:)andschemaText, plus the schema sources (ExportedSchemaSource, file and inferred sources).QueryDescriptor, the predicate parser and validation,QueryFilter.near(_:_:distance:),QueryFilter.recordName(equals:)/(notEquals:),FilterComparator,SchemaFieldType.allowedComparators.WireFieldValue,WireRecordOperation,ModifyRecordsRequestBodyandFieldTypeTagging.modifyAllRecords(_:atomicZones:database:batchSize:),queryRecordPages(...),verifyCredentials,lookupRecords/lookupAllRecords(zoneID:), andfetchWebAuthSignInURL().retryAfter/redirectURL/isRetryableonCloudKitError(MistKit still never retries),CloudKitError.invalidFieldValue(...),RecordFieldErrorContext, andConversionError.integerOutOfRange.FieldValue,Reference,Asset,Location,ZoneInfo,RecordInfoandRecordTimestampareHashable.RecordInfoandZoneInfoareIdentifiable, andEnvironmentisCaseIterable.Breaking changes
FieldValue'sCodableonly accepts the tagged{"value": …, "type": …}shape. Untagged JSON and{"value": null}now fail to decode, including JSON written by earlier versions. CloudKit requests and responses are unaffected.listZones,lookupZones,fetchDatabaseChanges,fetchAllDatabaseChanges,fetchRecordZoneChanges,fetchAllRecordZoneChangesand the deprecatedfetchZoneChanges/fetchAllZoneChangesno longer defaultdatabase:to.private. Pass it explicitly, like every other operation.Deprecations
lookupUsersByEmail(_:)andlookupUsersByRecordName(_:)wrap Apple-deprecatedusers/lookup/*endpoints. UsediscoverUserIdentities(lookupInfos:).Examples
Examples/BushelCloudis nowExamples/SwoopMistKit, because the repo was renamed to brightdigit/SwoopMistKit. The package inside is stillBushelCloud. The subrepo's.gitrepo,examples.yml,Scripts/release.sh(PIN_FILES) andScripts/update-subrepo.shpoint at the new path.Examples/CelestraCloudis removed from MistKit. It continues as its standalone repo.Fixes in this PR
INT64aboveInt32.maxused to trap on 32-bit platforms. It now throwsConversionError.integerOutOfRange.AUTHENTICATION_FAILED(#136).rereferenceAssetlooked up and updated the target record in the default zone instead of the givenzoneID.Examples/*/schema.ckdbare skipped where the source tree isn't on disk (WASI). On Android, CI copies just the staged schema files to the emulator.ManagementErrorBodyMiddlewarenow logs a.warningon thenetworksubsystem when it drops an error body that is over the 1 MiB cap or fails mid-read. The warning names only the operation, status and error type, never the body or headers.modifyAllRecordsused to convert and JSON-encode every request twice: once in its preflight check and again when sending. The preflight now findsNaNand infinite numbers on the domain values and keeps the converted operations, so each request is converted and encoded once. The error it reports is unchanged, and a parameterized test pins the check toJSONEncoder's behavior.CI runners
ubuntu-24.04.ubuntu-latest(26.04) has no swift.org toolchain and nolibxml2.so.2for SwiftLint.windows-2025, whose MSVC STL needs Clang 22. It also drops Swift 6.2, which aborts while emittingMistKitTests(Windows Swift 6.2: MistKitTests emit tip-over returns (blocks #392 / PR #485) #488), so Windows runs 6.1 and 6.3 onwindows-2022.Xcode_27.2.appwith the 27.2 simulators (iPhone 18 Pro, Apple Watch Ultra 4 (49mm), Apple TV 4K (4th generation)). That covers MistKit, MistDemo, MistKitConfiguration and the example workflows.Sources/MistKitOpenAPIandSources/MistKitManagementOpenAPI, and fails on untracked generated files too.Documentation
AGENTS.md(whichCLAUDE.mdlinks to) coversMistKitManagementOpenAPI, the Management API,modifyAllRecords, the stricterFieldValueCodable, and the newCloudKitServiceoperation files.Testing
swift test: 1005 tests pass on macOS (Xcode 27.2 toolchain, Swift 6.4.2), and./Scripts/lint.shis clean (swift-format, SwiftLint, headers, Periphery).swift run mistdemo export-schemaagainstiCloud.com.brightdigit.MistDemo(development and production), plus curl captures of the error responses. The details are in.claude/docs/research/135-management-api-request-format.md.🤖 Generated with Claude Code