MessagesCore: let a consumer build on the system SQLite #5
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-info
needs-triage
question
ready-for-agent
ready-for-human
svd:go
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/apple-messages-blade-mcp#5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Statement
Consumers of MessagesCore need to choose system SQLite without linking or distributing SQLCipher, while existing consumers must continue to resolve and build with SQLCipher enabled by default.
PR #11 was merged as
cccf3c0254after red integration. It added the default-on SQLCipher package trait and conditional forwarding to SQLite.swift, but completed only the manifest change. In the recorded consumer probes, disabling the trait built successfully with no SQLCipher pin; leaving the defaults enabled failed to resolve SQLCipher.swift. The same default consumer built against the pre-change base. Documentation, changelog and regression tests remain unfinished. Merging #11 did not complete this issue.Solution
Finish the existing trait feature and repair the default-consumer regression. A consumer that makes no trait selection must resolve, build and link with SQLCipher as before. A consumer that explicitly disables this package's default traits must resolve and build MessagesCore against system SQLite without SQLCipher in its resolved dependency graph or linked binary.
Document both choices and their unchanged encryption properties, prove them through fresh consumer builds and the existing offline test suite, and prepare the feature for the already approved 0.3.0 release. The issue remains open until the release tag exists and Stallari compatibility has been verified against it.
User Stories
Implementation Decisions
cccf3c0. Recheck the base and reproduce the failing consumer before choosing a fix.Testing Decisions
Use the consumer package boundary as the primary acceptance seam. Reuse the offline MessagesCore tests for read behavior and add runtime checks using synthetic, in-memory SQLite connections. No tests need Full Disk Access or real Messages data. Prefer observed resolution, compilation and linking behavior over assertions about the exact spelling of a manifest declaration.
Out of Scope
Further Notes
The operator approved 0.3.0 with “dispatch with 0.3.0” and later explicitly requested the merge of the partial implementation. That merge did not waive the remaining acceptance criteria.
The failed SVD run was 20261117T010314Z-7efd6210. Integration reported readyForMerge=false. Rework reproduced the resolver failure and made no changes because the previous spec required stopping at that gate; the runner then exited with “dispatch-rework did not report any commits”. The old approved spec predates the merge and must not be reused as approval for the completion work. The revised implementation spec must be based on the merged source and include a demonstrated resolver approach.
The previously reported pristine baseline was 34 core tests with zero failures on the pre-trait base. It is not evidence that the merged feature passes in either mode. No completed feature tests or 0.3.0 release were established by that run.
Related records: merged PR #11, failed-dispatch report.
Blocked by
One more fact for this issue.
SQLCipher.swiftis a binary target. SwiftPM downloads a prebuiltSQLCipher.xcframeworkfrom a GitHub release and checks it against the checksum in the package manifest. A consumer ofMessagesCoretherefore links a prebuilt binary and not a build from source, and its executable loadsSQLCipher.frameworkat run time. A signed release of the consumer must then also carry and sign that framework. A build on the system SQLite removes both points.Agent Brief
Category: enhancement
Summary: Add a package trait
SQLCipher, on by default, that turns on theSQLCiphertrait ofSQLite.swift. A consumer that turns it off buildsMessagesCoreon the system SQLite.Current behavior:
The package manifest turns on the
SQLCiphertrait ofSQLite.swiftfor every consumer. A consumer ofMessagesCoretherefore resolvesSQLCipher.swiftand links its prebuiltSQLCipher.xcframework. Nothing in this package calls a SQLCipher API.chat.dbis plain SQLite, and the store opens it read-only.Desired behavior:
SQLCipherand lists it in its default traits.SQLite.swiftfor itsSQLCiphertrait. When it is off, the package asksSQLite.swiftfor no trait, and the build uses the system SQLite.traits:argument behaves exactly as today.traits: []buildsMessagesCorewith noSQLCipher.swiftin its dependency graph.Triage ruling (operator, 2026-11-15): keep a trait that is on by default, as the issue proposes. Triage also considered removing the trait from this package. The operator did not choose that.
Key interfaces:
traits:list with.trait(name: "SQLCipher")and.default(enabledTraits: ["SQLCipher"]). TheSQLite.swiftdependency asks for itsSQLCiphertrait only when this package'sSQLCiphertrait is on.MessagesCoresource: no change expected. It uses no codec API.Acceptance criteria:
sqlcipher.swiftfrom the consumer'sPackage.resolved. Triage confirmed this only for a direct dependency onSQLite.swiftwith no traits, not for the two-level case. If the throwaway check fails, stop and report the result on this issue.MessagesCoreproduct withtraits: []builds, and itsPackage.resolvedholds nosqlcipher.swiftentry.stallari-harnessresolves and builds against the new tag with no change to its manifest.MessagesCoreTestspass with the default traits and with the default traits off.SQLite.swiftdependency state that the choice changes no encryption.MessagesCorereadschat.db, a plain SQLite file, and calls no SQLCipher API in either form.chat.db, and every consumer that reads it, relies on the protection of the Source Mac's volume: FileVault at rest, with Full Disk Access as the access gate. Without FileVault,chat.dbis plain text on disk in either form.Out of scope:
SQLite.swiftversion range. That is #6.stallari-harnessordev/messages-mind-mcp. The Feeder docs and the FileVault install check are dev/messages-mind-mcp#73.MessagesCoreopenschat.db.Order: #5 and #6 change the same dependency declaration. Land #6 first, or land both on one branch. One tag can carry both.
MessagesCoreatv0.2.0does not compile withSQLite.swift0.17.0 #6MessagesCoreatv0.2.0does not compile withSQLite.swift0.17.0 #6⏸ SVD architect gate: dev/apple-messages-blade-mcp#5 messagescore-let-a-consumer-build-on-the-system-sqlite
Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity
standard· dispatch effortmediumRun:
20261116T061113Z-7164782aHeld because: CLEAN but 5 open risk(s) (3 verification · 2 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
grep -c sqlcipher Package.resolvedmust print 0 andswift buildmust succeed. If either fails, dispatch halts and reports on #5, as the brief requires. [verification]grep -n -A3 'apple-messages-blade\|SQLite.swift' stallari-harness/Package.swift, then runswift package resolve && swift buildagainst v0.3.0 (or the worktree path) with no manifest edit. [verification]3e2e041did, with the architect tagging after merge), or leave the entry under [Unreleased]? The pipeline directive says dispatch does not bump versions. Also confirm 0.3.0 (new feature) rather than 0.2.2. Choosing [Unreleased] drops Version.swift and UnitTests.swift from Primary Files. [decision]traits: [], or keep the default and showtraits: []only in §Products? The spec changes the snippet; without that, a consumer who copies it still links SQLCipher.framework. [decision]swift buildandswift build --disable-default-traitsboth succeed in the worktree. [verification]Change: Copy the trait idiom from SQLite.swift 0.16.0's own manifest (.build/checkouts/SQLite.swift/Package.swift). That manifest has a
traits:list with.trait(name:description:)and.default(enabledTraits:), and its CSQLite dependency carriestraits: [.trait(name: "FTS5", condition: .when(traits: ["FTS5"]))]. Package.swift gets the same shape: addtraits: [.trait(name: "SQLCipher", ...), .default(enabledTraits: ["SQLCipher"])], and change the SQLite.swift dependency at Package.swift:59-60 fromtraits: ["SQLCipher"]totraits: [.trait(name: "SQLCipher", condition: .when(traits: ["SQLCipher"]))]. Do not add.defaults: the default form must stay exactly {SQLCipher}. When the trait is off the set is {}, and SQLite.swift's#else import SQLite3branch (Core/Connection.swift:27-35) gives the system SQLite. Rewrite the manifest comment at Package.swift:52-56 to say three things: why the default is on, how to usetraits: [], and that the choice changes no encryption (the FileVault/FDA paragraph). Leave the two #6 lines as they are. In the README, add a trait subsection under §Products, update §"What a consumer links" at 155-161, update the network bullet at 76-80, and change the snippet at 82-111 toexact: "0.3.0", traits: []. Bump CHANGELOG to [0.3.0], and Version.swift and testSemver to 0.3.0, following #6's release commit3e2e041. Hard gate before the docs: a throwaway /tmp consumer with.package(path:<worktree>, traits: [])must resolve with no sqlcipher.swift in Package.resolved; if it does not, halt and report.Files:
Package.swift·README.md·CHANGELOG.md·Sources/AppleMessagesBlade/Version.swift·Tests/AppleMessagesBladeTests/UnitTests.swiftDecision: accept the 5 open risk(s) above and dispatch this spec (
svd:go), or park (svd:skip) / re-spec (svd:respec)?Your call (when this issue is held at the gate via
svd:hold):svd:go— approve; Half-B dispatch accepts exactly this spec (open risks accepted)svd:firebesidesvd:go— approve AND authorise the Half-B fire from the phone; never on its ownsvd:skip— park it; dispatch refuses it and the issue stays for a humansvd:respec— discard this spec; the next Half-A run re-produces it with this record as prior-attempt contextSpec:
/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-16-messagescore-let-a-consumer-build-on-the-system-sqlite.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-16-messagescore-let-a-consumer-build-on-the-system-sqlite.md⏸ SVD architect gate: dev/apple-messages-blade-mcp#5 messagescore-let-a-consumer-build-on-the-system-sqlite
Status: CLEAN after 0 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity
standard· dispatch effortmediumRun:
20261116T211758Z-f28baecdHeld because: CLEAN but 4 open risk(s) (3 verification · 1 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
swift build --package-path <c> --scratch-path <ext>, andgrep -ci sqlcipher <c>/Package.resolvedmust print 0. If either fails, halt and report on #5. What changed since the prior attempt: the host proved this on a disposable copy with the same manifest shape (Swift 6.4.2, 0 SQLCipher pins). Only the re-run against the actual diff is left. [verification]git -C stallari-harness diff --quiet -- Package.swift, thenswift package update apple-messages-blade-mcp && swift buildin the harness. Its line 77 (from: "0.1.0", no traits:) admits 0.3.0. What changed since the prior attempt: the host read the harness manifest (lines 35/44/77). Only the post-tag build is left, and it belongs to the release slice, not this PR. [verification]swift test --disable-default-traitsand the #if SQLCipher compilation condition in the MessagesCoreTests target. The host checked the flag onswift build --helponly. Check:swift test --help | grep -- --disable-default-traits, then both G2 runs. In the default form, testSQLiteLibraryFollowsSQLCipherTrait must return a non-empty cipher_version; if it does not, report a deviation and do not weaken the assertion. What changed since the prior attempt: the host has now compiled the manifest trait API. Only the test-side spellings are unproven. [verification]Change: Use the trait idiom from SQLite.swift 0.16.0's own manifest (.build/checkouts/SQLite.swift/Package.swift): a traits: list built from .trait(name:description:) and .default(enabledTraits:), and a dependency trait written as .trait(name:condition:.when(traits:)). The host has already compiled this shape against a copy of this package.
Package.swift:
README.md:
CHANGELOG.md: add one bullet under [Unreleased] ### Added (:19-22). No version heading.
MessagesCoreTests: add two tests after testCoreHasNoMCPDependency (:597-623):
The PR does not bump the version (spec-pipeline.md:75). The Version.swift/testSemver bump, the tag, and the stallari-harness check against the tag are a separate release step, so issueBinding is refs.
Hard gate G1: after the manifest edit and before the docs edits, build a throwaway /tmp consumer with .package(path:, traits: []). Its Package.resolved must hold 0 sqlcipher entries and the build must pass. Otherwise halt and report on #5.
Files:
Package.swift·README.md·CHANGELOG.md·Tests/MessagesCoreTests/MessagesCoreTests.swiftDecision: accept the 4 open risk(s) above and dispatch this spec (
svd:go), or park (svd:skip) / re-spec (svd:respec)?Your call (when this issue is held at the gate via
svd:hold):svd:go— approve; Half-B dispatch accepts exactly this spec (open risks accepted)svd:firebesidesvd:go— approve AND authorise the Half-B fire from the phone; never on its ownsvd:skip— park it; dispatch refuses it and the issue stays for a humansvd:respec— discard this spec; the next Half-A run re-produces it with this record as prior-attempt contextSpec:
/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-16-messagescore-let-a-consumer-build-on-the-system-sqlite.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-16-messagescore-let-a-consumer-build-on-the-system-sqlite.mdDispatch attempted with the operator-approved 0.3.0 release target.
PR: #11 (work in progress). SVD run:
20261117T010314Z-7efd6210; head:aa9148f9ce66bab77d0d67b702d4c241c2b3c917.G1 failed in the default form. The opt-out consumer (
traits: []) builds with zero SQLCipher pins. A default consumer fails repeatedly with SwiftPM'sexhausted attempts to resolve the dependencies graph, naming sqlcipher.swift. Integration compared against unchanged main, whose default consumer builds, confirming a regression. Rework reproduced the same failure and made no changes, honoring the approved spec's stop rule.Only Package.swift changed. README, CHANGELOG, the two new tests and G2 remain pending. The pristine baseline core suite passed 34 tests with zero failures. No remote CI statuses exist on the PR head; this is not a pass. Integration reports
readyForMerge=false; the runner subsequently stopped withdispatch-rework did not report any commits.The issue remains ready-for-human. The next step is a revised spec for default-consumer resolution, then a fresh dispatch. The 0.3.0 target remains settled. No merge or tag was performed; the post-tag Stallari compatibility check remains a release acceptance check.