Feeder: the read service on MessagesCore with one private-network address #9
Labels
No labels
boundary:crosses
bug
enhancement
epic
needs-info
needs-triage
ready-for-agent
ready-for-human
svd:go
svd:hold
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dev/messages-mind-mcp#9
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?
Parent: #6. Records: ADR 0002 (
docs/adr/0002-own-feeder-not-bluebubbles.md), ADR 0004 (docs/adr/0004-source-mac-and-feeder-network-face.md), ADR 0006 (docs/adr/0006-retention-deletion-and-forget.md), ADR 0008 (docs/adr/0008-feeder-package-signing-and-update.md).Human act
ruling: the operator approves dispatch and reads the diff before merge, because this slice is the program that holds Full Disk Access and opens a network port on the Source Mac (CONV-40)
What to build
A Swift package in
feeder/that serves thefeeder-v1contract from the Messages history of one macOS user. It depends, by tag, on theMessagesCorelibrary product ofdev/apple-messages-blade-mcp, and on no other third-party code.Authorizationheader only, compared in constant time and never logged.checkreports a column that is missing or new, and the Feeder refuses to serve rows when a column it depends on is missing.The deny list and Redaction are the next slice (#10). This slice leaves one seam for them: every body and every row passes through one filter point before it is served.
Acceptance criteria
contracts/feeder-v1/pass against a synthetic history that the tests build.check.MessagesCore.Blocked by
Filed under: operator word "go" sha256:4cd0e21a9a07
ADR 0011 (pull request #24) adds a second listener form. In the single-host shape the Feeder listens on one Unix socket with mode 0600 in the Owner's home, and on no network address. Check first that the system network framework can listen on a Unix socket with no new dependency. If it cannot, bind one loopback port, and report here so that ADR 0011 is amended with the reason. In both shapes the Feeder refuses an all-interfaces address at startup.
Notes from the review of
MessagesCoreThe reads that this issue builds on are in review as
dev/apple-messages-blade-mcp#3. A review of those reads againstcontracts/feeder-v1gave the notes below. Each note is a rule for the Feeder, because the library only reads: it applies no deny list, no Redaction and no access control. The notes on the deny list also bind #10.Which read serves which field
newest_row_idhighestIssuedMessageRowID(). Do not use the highest present row: it falls when the Owner deletes the newest row, andsyncthen reports a replaced Source.newest_datemessagesByDateDescending(before:limit:inChatOnly:). Walk the page until the first row that the Feeder serves.reply_toand a Tapbacktargetmessages(withGUIDs:)gives the chat and the sender of each target, so the Feeder can test whether it serves that message.groupChatWithMembers.isGroup. It isnilfor achat.stylevalue that the library does not know. Decide the rule fornilin #10, and fail closed.MirrorMessage.chatIDsholds every chat of the row. Test every id against the deny list, notchatIDalone.RecentlyDeletedRecordcarries every chat and the sender from one statement. A record whose message row is gone has no sender and noguid.otherTapbackKind.other. Mapemphasizetoemphasis.Rules for the Feeder
messagetable, becausedate_editedhas no index.maxResultsHardCapitems (default 1000) and does not report the clamp. Set the cap above the largest page of the contract and assert it at start. A clamped Reconcile page thatsyncreads as the end makessyncremove Mirror rows.MessagesSchema.unixMillis(fromAppleTimestamp:)on the raw value), never from aDate. Division of aDoublecan move a millisecond.SchemaReport.newlists every column that the library does not read. On a realmessagetable that list is long. Keep the Feeder's own list of known columns; the actual columns of a table arepresentplusnew.null. Strip U+FFFC from a body. Drop the body of a Tapback row, because the Source stores a quote of the target there.nullfor a negative attachment size.permissionDeniedandstoreMissinghold the path of the store, and no such text may leave the Mac.attachmentsForMessageandattachmentMetaselect the file name and the transfer name of an attachment. UseattachmentInfo(forMessageIDs:)only. A test should fail the build when the Feeder names either read.textcolumn has no cap. The Feeder sets its own limit on a response.associated_message_type1000. Such a row (a sticker placed on a message) has no parsed Tapback and no target. Decide in #10 whether the Feeder serves it as a message or not at all.chat.style43 and 45, the unit of the Recently Deleted time, and the Tapback codes 2006 and 2007. The schema report on a real history is the check, before the first run on a real Source.⏸ SVD architect gate: dev/messages-mind-mcp#9 feeder-the-read-service-on-messagescore-with-one-private-net
Status: CLEAN after 1 rework round(s) · 0 blocking defect(s) · 0 lens(es) INCONCLUSIVE (could not run) · 0 lens(es) DEGRADED (deterministic denial) · complexity
substrate· dispatch efforthighRun:
20261113T090303Z-761801b7Held because: CLEAN but 10 open risk(s) (1 sequencing · 4 verification · 5 decision) — HOLD-ALL parks everything. The risks, verbatim:
Open risks:
Change: A new feeder/ Swift package. It depends on exactly one package, the MessagesCore product of apple-messages-blade-mcp, pinned exact: to a tag. Source.swift is the only file that imports MessagesCore. Half B step 0 (§0a–d) is a guard that writes no code: (a) git ls-remote shows the architect-named tag (lean v0.2.0); (b, c) a grep -n proves every §0 read and type name at that tag; (d) a same-semantics rename is adapted in Source.swift only, while an absent read or one with different semantics halts as needs-respec. Then: Config.swift builds the only ListenAddress (fileprivate init; it refuses all-interfaces, hostnames and non-private addresses; exit 2). Listener.swift uses NWListener on a TCP host:port or a .unix 0600 socket, retries the bind forever, and falls back to loopback per ADR 0011. Router.swift mirrors the check order of tests/feeder_fake.py:217-286 (token in the header, constant-time compare → 404 → 405 → the _parameters grammar → 503 schema-pin), with closed FeederLog lines. Operations.swift mirrors the paging of feeder_fake.py:288-355 over a SourceReading protocol, with a page-cap guard of at least 5001. Wire.swift calls encodeNil explicitly for every nullable field (wire.py strict). SchemaPin.swift computes depends/known against present∪new. Filter.swift is one ServePolicy seam, with OpenPolicy for #10 to replace. Tests: a Linux static scan (test_kit_boundary.py pattern); macOS XCTest; a black-box run of conformance.check_refusals and check_walks over a synthetic chat.db built in tests/test_feeder_real.py, with full conformance.run as a strict xfail until #10.
Files:
feeder/Package.swift·feeder/Package.resolved·feeder/Sources/Feeder/main.swift·feeder/Sources/FeederCore/Config.swift·feeder/Sources/FeederCore/Listener.swift·feeder/Sources/FeederCore/Router.swift·feeder/Sources/FeederCore/Operations.swift·feeder/Sources/FeederCore/Source.swift·feeder/Sources/FeederCore/Wire.swift·feeder/Sources/FeederCore/SchemaPin.swift·feeder/Sources/FeederCore/Filter.swift·feeder/Tests/FeederCoreTests/FeederCoreTests.swift·tests/test_feeder_package.py·tests/test_feeder_real.py·Makefile·.gitignoreDecision: accept the 10 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-feeder-the-read-service-on-messagescore-with-one-private-net.md— next:codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-13-feeder-the-read-service-on-messagescore-with-one-private-net.mdspec-verify-dispatch Half B for dev/messages-mind-mcp#9 feeder-the-read-service-on-messagescore-with-one-private-net completed integration verify.
15ed56ba7b15ed56b: ci/woodpecker/pr/validation green. Local: swift tests 23/23, feeder-real pytest 32 passed + 8 strict xfail, make check 493 passed. No blockers.make feeder-checkhung at the SQLCipher.xcframework.zip download (0 bytes) because it lacked --disable-keychain --disable-netrc, as spec §8 documents. It passed with SWIFT_FLAGS. This is a host-environment fact, not a code defect.codex-svd ship --run-id 20261113T110718Z-1c77cdf4 --confirm-merge)read_secret_file#42spec-verify-dispatch Half B for dev/messages-mind-mcp#9 feeder-the-read-service-on-messagescore-with-one-private-net completed integration verify.
26539ccee326539cc. The runner should re-poll it.codex-svd ship --run-id 20261114T094924Z-1fd0fdf3 --confirm-merge)spec-verify-dispatch Half B for dev/messages-mind-mcp#9 feeder-the-read-service-on-messagescore-with-one-private-net completed integration verify.
08484b36d208484b3; the runner should re-poll it.codex-svd ship --run-id 20261114T094924Z-1fd0fdf3 --confirm-merge)