A MessagesCore library product with the reads a mirror needs #1
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#1
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?
Records:
dev/messages-mind-mcpADR 0002, ADR 0006 and ADR 0008. Messages Mind builds a small read-only Feeder on this package, and it must not link the MCP code.What to build
Split the package. Add a library product
MessagesCorethat holds the code that reads and decodes the Messages history: the store, the schema, the models, the typedstream decoder, the config and the errors.MessagesCoredepends on no MCP package. The existingAppleMessagesBladeproduct depends onMessagesCoreand keeps every tool it has today. The blade still ships no standalone binary.Keep the attachment byte reader out of
MessagesCore. The Feeder reads attachment type and size only.Add the reads that a mirror needs, all read-only and all in
MessagesCore:MessagesCorenever reads the edit-history blob or the text of a deleted message part.Acceptance criteria
MessagesCorebuilds with no MCP dependency; a test or a build check proves it.v0.2.0tag. The owner tags it.Blocked by
Filed under: operator word "go" sha256:4cd0e21a9a07
svc-agent-writer referenced this issue from dev/messages-mind-mcp2026-11-12 20:18:14 +00:00
svc-agent-writer referenced this issue from dev/messages-mind-mcp2026-11-12 20:18:15 +00:00
MessagesCorewith one private-network address #9⏸ SVD architect gate: dev/apple-messages-blade-mcp#1 a-messagescore-library-product-with-the-reads-a-mirror-needs
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
substrate· dispatch efforthighRun:
20261113T025316Z-12150ac4Held because: CLEAN but 6 open risk(s) (3 verification · 3 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
@_exported import MessagesCorein AppleMessagesBlade.swift alone makes MessagesCore types visible in the other blade files and through@testable import AppleMessagesBladein the existing tests. It could not be compiled in the Half-A sandbox (no swift). Check: after the move, re-export and public inits,swift build && swift test --filter AppleMessagesBladeTestsmust be green with no other blade file edited. If it fails, the fix needsimport MessagesCorein about 12 blade files, which goes over the 16-file ceiling. Dispatch must then stop and report needs-reslice rather than expand scope. [verification]swift buildandswift test --filter Messagesmust stay green. Watch for module-qualifiedAppleMessagesBlade.<MovedType>names, and for @testable use of internals of moved types (MessagesBladeConfig.allowedPrefixes, the TypedStreamDecoder internals). [verification]sync_deleted_messages(ROWID, guid), and the count issqlite_sequence.seqfor that table, which survives Messages emptying it. Question for the architect: does messages-mind ADR 0006 name sync_deleted_messages + sqlite_sequence, or deleted_messages or another counter? The ADR could not be read: the sandbox denies the messages-mind-mcp repo and gh. The choice is isolated in MessagesSchema.hardDeletionTable, so a ruling swaps one constant. [decision]sqlite3 -readonly ~/Library/Messages/chat.db '.schema message'lists those columns. [verification]Change: Move MessagesStore, Schema, TypedStreamDecoder, Config and Errors with git mv into a new MessagesCore target (deps: SQLite only). Split Models.swift: AttachmentBytes stays in the blade, everything else moves, and all public model structs get explicit public inits (AttachmentMeta's is required by UnitTests.swift:204). Add
@_exported import MessagesCoreto AppleMessagesBlade.swift so the 12 other blade files, the existing tests and the harness compile unchanged. Package.swift adds the MessagesCore product and target, a MessagesCoreTests target (MessagesCore + SQLite), and AppleMessagesBlade depends on MessagesCore. Put the mirror reads in a new// MARK: - Mirror readssection inside the MessagesStore actor in Sources/MessagesCore/MessagesStore.swift. They mirror listMessages (MessagesStore.swift:159-190) for keyset, clamp and order, plus summaryRow, runQuery and decodeText (347-414). The reads are:Tapback parsing of p:N/GUID, bp:GUID and bare GUID goes in MessagesSchema. New models are appended to the core Models.swift. Every query is a SELECT, and none touches the edit-history blob or recoverable_message_part. Version.swift is not bumped. CHANGELOG gets [Unreleased] entries.
Files:
Package.swift·Sources/AppleMessagesBlade/AppleMessagesBlade.swift·Sources/AppleMessagesBlade/Models.swift·Sources/AppleMessagesBlade/MessagesStore.swift·Sources/AppleMessagesBlade/Schema.swift·Sources/AppleMessagesBlade/TypedStreamDecoder.swift·Sources/AppleMessagesBlade/Config.swift·Sources/AppleMessagesBlade/Errors.swift·Sources/MessagesCore/MessagesStore.swift·Sources/MessagesCore/Schema.swift·Sources/MessagesCore/Models.swift·Sources/MessagesCore/TypedStreamDecoder.swift·Sources/MessagesCore/Config.swift·Sources/MessagesCore/Errors.swift·Tests/MessagesCoreTests/MessagesCoreTests.swift·CHANGELOG.mdDecision: accept the 6 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-13-a-messagescore-library-product-with-the-reads-a-mirror-needs.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-13-a-messagescore-library-product-with-the-reads-a-mirror-needs.md✅ SVD architect gate: dev/apple-messages-blade-mcp#1 a-messagescore-library-product-with-the-reads-a-mirror-needs
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
unclassified· dispatch effortunclassifiedRun:
20261113T025316Z-12150ac4Files:
Package.swift·Sources/AppleMessagesBlade/AppleMessagesBlade.swift·Sources/AppleMessagesBlade/Models.swift·Sources/AppleMessagesBlade/MessagesStore.swift·Sources/AppleMessagesBlade/Schema.swift·Sources/AppleMessagesBlade/TypedStreamDecoder.swift·Sources/AppleMessagesBlade/Config.swift·Sources/AppleMessagesBlade/Errors.swift·Sources/MessagesCore/MessagesStore.swift·Sources/MessagesCore/Schema.swift·Sources/MessagesCore/Models.swift·Sources/MessagesCore/TypedStreamDecoder.swift·Sources/MessagesCore/Config.swift·Sources/MessagesCore/Errors.swift·Tests/MessagesCoreTests/MessagesCoreTests.swift·CHANGELOG.mdWrite-set divergence: present table wins. 0 sourceHashes vs 30-row table.
Decision: dispatch this spec (
svd:go)?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-13-a-messagescore-library-product-with-the-reads-a-mirror-needs.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-13-a-messagescore-library-product-with-the-reads-a-mirror-needs.md✅ SVD architect gate: dev/apple-messages-blade-mcp#1 a-messagescore-library-product-with-the-reads-a-mirror-needs
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
unclassified· dispatch effortunclassifiedRun:
20261113T025316Z-12150ac4Files:
Package.swift·Sources/AppleMessagesBlade/AppleMessagesBlade.swift·Sources/AppleMessagesBlade/Models.swift·Sources/AppleMessagesBlade/MessagesStore.swift·Sources/AppleMessagesBlade/Schema.swift·Sources/AppleMessagesBlade/TypedStreamDecoder.swift·Sources/AppleMessagesBlade/Config.swift·Sources/AppleMessagesBlade/Errors.swift·Sources/MessagesCore/MessagesStore.swift·Sources/MessagesCore/Schema.swift·Sources/MessagesCore/Models.swift·Sources/MessagesCore/TypedStreamDecoder.swift·Sources/MessagesCore/Config.swift·Sources/MessagesCore/Errors.swift·Tests/MessagesCoreTests/MessagesCoreTests.swift·CHANGELOG.mdWrite-set divergence: present table wins. 0 sourceHashes vs 30-row table.
Decision: dispatch this spec (
svd:go)?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-13-a-messagescore-library-product-with-the-reads-a-mirror-needs.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-13-a-messagescore-library-product-with-the-reads-a-mirror-needs.mdMessagesCorewith one private-network address #9