Feeder: close the hardening items and test gaps from the PR #57 reviews #58

Closed
opened 2026-11-14 20:47:16 +00:00 by svc-agent-writer · 4 comments

PR #57 (issue #9, the Feeder) merged as 037c7bb, pinned to the gated head 08484b3. A correctness review and a security review ran on each head. The reviews of 26539cc found three blockers, and rework round 2 fixed them (spec rows R10-R20). The last pair reviewed 08484b3 and found no blocker. The items below were found and not fixed in that PR. Each was checked against the code by its reviewer. "Mutation survives" means the change left both suites green.

The Feeder serves no real history before #10 (ruling F), so no item below affects a real history today. Items 1 and 2 must be fixed before #10 serves one.

Should fix before #10

  1. A page over 16 MiB gets 503 source-unavailable, and sync stalls (Router.swift:122, reproduced). sync halves the limit only on response-too-large (README: "For an oversized page, sync then asks again with half the limit"). Reproduction: 400 rows with 1024 attachments each; after=999&limit=500 gives 503, limit=250 gives 200. Fix: answer response-too-large, or cut the page as the 1 MiB body cut does. The response is also encoded twice (up to 32 MiB transient per request, 8 concurrent): encode once and measure the bytes. The encode fallback at Router.swift:49 sends an error body under status 200.
  2. The time pages have no scan budget (Operations.swift:95-133, reasoned). rowPage stops at 10,000 examined rows; changed-rows and recently-deleted loop until the source is exhausted. Under a deny policy every such request walks the whole history. The loop also cannot advance on a source row with a nil edited time; only the dependency's WHERE … date_edited > 0 prevents that. Give both time pages the rowPage budget.
  3. The rowPage scan budget lives in two literals, and a mismatch hangs (reproduced). Changing scanned < 10000 at Operations.swift:73 to < 20000 makes testScanBudgetIs10000Rows loop forever, because the inner break at line 78 makes no progress. Use one constant, and give the test suites a time limit per test.
  4. "#10 replaces the policy alone" needs two more edits (reasoned). Router.swift:65 constructs OpenPolicy(), and Config.swift:66 defaults to OpenPolicy.servesOwnerHistory. #10 can touch only Filter.swift if it keeps the type name.

Should fix

  1. A write path evades both scans (reproduced). open(p, O_WRONLY | O_CREAT, 0o600) plus FileHandle(fileDescriptor:).write builds and passes. It adds one Swift-mangled symbol, Darwin.open(_:_:_:) with a mode, that no deny pattern matches. Add the 3-argument open, FileHandle.write, and Darwin.write, pwrite, ftruncate, mkdir, creat and openat to the Swift deny patterns (tests/test_feeder_real.py:922-933), and ban the write flags and FileHandle(fileDescriptor: in FORBIDDEN (tests/test_feeder_package.py:11-21).
  2. Objective-C bridged calls leave no Swift symbol (reproduced). A never-taken FileManager.removeItem, FileHandle(forWritingAtPath:) or createDirectory passes test_the_binary_links_only_allowed_symbols. The source scan still catches them. Correct the test's claim, or check the Objective-C selectors in the binary.
  3. dlsym with a composed name evades the scan (reproduced). dlsym(…, "posix_" + "spawn") passes. No Feeder source calls dlsym: ban it in feeder/Sources, and fold "a" + "b" across the whole scan, not only for the edit-blob name.
  4. The symbol allow-list stops at the binary (reproduced). The bundled SQLCipher.framework imports _dlopen, _rename, _unlink, _write, _pwrite, _ftruncate and _mkdir, and loads through @rpath from the build directory (ruling D). Say so in the test comment, or scan the framework too.
  5. Two documents say the Feeder never starts a connection (GLOSSARY.md, contracts/feeder-v1/README.md). The round-2 stale-socket rule makes an AF_UNIX connect() probe. Say "never starts a connection off the host". GLOSSARY.md is an operator ruling surface.
  6. A token with a leading or trailing space passes config, but no request can match it, because header values are trimmed. Refuse it at config.
  7. FeederLog.bindRetry takes a free string, which weakens the closed-forms rule of the log. Take the closed errnoName result only.
  8. The Members cap counts unfiltered Members. A Chat with more than 1024 Members is refused even when the filtered list fits. Decide which count the cap means, and record it in the spec of #10.
  9. Token strength is not checked. A token of 32 equal characters is accepted.

Test gaps

  1. The source-unavailable store-open branch is never executed, so a path leak there is unproven: adding the canonical path to the catch at Source.swift:89 survives. Add a file that passes every rule but is not a database, assert 503, and run the closed FeederLog check over all stderr in every black-box test (from serving() teardown).
  2. The owner half of three file rules: deleting info.st_uid == getuid() from privateParent (Config.swift:117), from historyIsSafeToOpen (:124) or from the recheck lstat (:221) survives. Split owner and mode into a pure function, as staleSocketIsOurs is, and call it with another uid.
  3. The S_IFREG half of tokenMetadataIsSafe (Config.swift:138) and of the config-file guard (:72) survives. Add cases with a non-regular mode.
  4. An owner row with a handle: let handle = row.fromOwner ? nil : unfiltered changed to unfiltered (Operations.swift:217) survives; schema.json:86-87 requires a null sender when from_owner is true.
  5. Identifier rules on Recently Deleted guids (Shaping.identifier dropped in the recent path) and on hard-deletion records (record.guid ?? "" at Operations.swift:144) survive.
  6. requireCap(config.maxResultsHardCap) removed from Source.init survives; the test covers only the pure function.
  7. The socket parent check before the probe and the one after it each survive alone; only removing both fails a test.
  8. The listener: the backoff cap (30 s to 300 s), the delay reset on ready, the retry on .waiting, the ready gate on accept, and the chmod verify (== 0o600 to true) each survive.
  9. Wire time: computing millis % 1000 through a Double survives; no test uses a value that loses precision.
  10. The ninth-connection test uses sleep(0.1) and is timing-sensitive.

Notes

  • Residual, same macOS user only: between the pre-read check and the MessagesCore open by path, a process can swap the file in and back before the post-read check, which the (st_dev, st_ino) pair cannot see. The spec records the window. The st_nlink, S_IFREG and history-path rules still block pointing the Feeder at the real history, and such a process can already read the token (SECURITY.md).
  • ADR 0011 rule 1 puts the socket "in the Owner's home"; config requires only an owner-only 0700 parent. Record the wider placement in the ADR or the config document. ADRs are an operator surface.
  • Each read opens SQLite again, and the check newest-date walk has no budget.
  • A read creates -shm and -wal files beside a history that has none. The read-only test uses only journal_mode=DELETE.
  • The test builder maps other to 2006, which MessagesCore reads as emoji. No fixture uses it.
  • README.md, SECURITY.md and contracts/feeder-v1/README.md still say the Feeder is not built. Ruling F leaves these to #10.
  • With deny operations removed, the real binary matches FakeFeeder on 1210 requests across steps 0-7.

Acceptance criteria

  • Items 1 to 4 are fixed before #10 serves a real history.
  • Items 5 to 13 are fixed, or each has a recorded decision.
  • Each mutation in items 14 to 22 fails a test in bounded time, and item 23 waits on a condition, not a sleep.
  • Each note is fixed, or has a recorded decision.

Triage rulings (2026-11-15)

These rulings replace the matching text above.

  • Item 9. In GLOSSARY.md and contracts/feeder-v1/README.md, replace "never starts a connection" with exactly: "The Feeder starts no network connection. It makes one local connection to its own socket path, to test whether an old socket is live." Change no other text in GLOSSARY.md.
  • Item 12. The Members cap counts the Members after the filter, because that is what the Feeder serves. The scan budget limits the rows read before the filter.
  • ADR 0011 note (socket placement). Not in this issue. ADRs are an operator surface; an ADR 0011 amendment records the rule.
  • Item 13 (token strength). Not ruled. The spec proposes a rule, and the architect gate decides it.
  • Order. Items 1 to 4 must merge before #10. This issue goes before #10.

Blocked by

  • none

Filed under: operator word "merge 57" sha256:1361536e73d8

PR #57 (issue #9, the Feeder) merged as `037c7bb`, pinned to the gated head `08484b3`. A correctness review and a security review ran on each head. The reviews of `26539cc` found three blockers, and rework round 2 fixed them (spec rows R10-R20). The last pair reviewed `08484b3` and found no blocker. The items below were found and not fixed in that PR. Each was checked against the code by its reviewer. "Mutation survives" means the change left both suites green. The Feeder serves no real history before #10 (ruling F), so no item below affects a real history today. Items 1 and 2 must be fixed before #10 serves one. ## Should fix before #10 1. **A page over 16 MiB gets `503 source-unavailable`, and sync stalls** (`Router.swift:122`, reproduced). sync halves the `limit` only on `response-too-large` (README: "For an oversized page, `sync` then asks again with half the `limit`"). Reproduction: 400 rows with 1024 attachments each; `after=999&limit=500` gives 503, `limit=250` gives 200. Fix: answer `response-too-large`, or cut the page as the 1 MiB body cut does. The response is also encoded twice (up to 32 MiB transient per request, 8 concurrent): encode once and measure the bytes. The encode fallback at `Router.swift:49` sends an error body under status 200. 2. **The time pages have no scan budget** (`Operations.swift:95-133`, reasoned). `rowPage` stops at 10,000 examined rows; `changed-rows` and `recently-deleted` loop until the source is exhausted. Under a deny policy every such request walks the whole history. The loop also cannot advance on a source row with a nil edited time; only the dependency's `WHERE … date_edited > 0` prevents that. Give both time pages the `rowPage` budget. 3. **The `rowPage` scan budget lives in two literals, and a mismatch hangs** (reproduced). Changing `scanned < 10000` at `Operations.swift:73` to `< 20000` makes `testScanBudgetIs10000Rows` loop forever, because the inner `break` at line 78 makes no progress. Use one constant, and give the test suites a time limit per test. 4. **"#10 replaces the policy alone" needs two more edits** (reasoned). `Router.swift:65` constructs `OpenPolicy()`, and `Config.swift:66` defaults to `OpenPolicy.servesOwnerHistory`. #10 can touch only `Filter.swift` if it keeps the type name. ## Should fix 5. **A write path evades both scans** (reproduced). `open(p, O_WRONLY | O_CREAT, 0o600)` plus `FileHandle(fileDescriptor:).write` builds and passes. It adds one Swift-mangled symbol, `Darwin.open(_:_:_:)` with a mode, that no deny pattern matches. Add the 3-argument `open`, `FileHandle.write`, and `Darwin.write`, `pwrite`, `ftruncate`, `mkdir`, `creat` and `openat` to the Swift deny patterns (`tests/test_feeder_real.py:922-933`), and ban the write flags and `FileHandle(fileDescriptor:` in `FORBIDDEN` (`tests/test_feeder_package.py:11-21`). 6. **Objective-C bridged calls leave no Swift symbol** (reproduced). A never-taken `FileManager.removeItem`, `FileHandle(forWritingAtPath:)` or `createDirectory` passes `test_the_binary_links_only_allowed_symbols`. The source scan still catches them. Correct the test's claim, or check the Objective-C selectors in the binary. 7. **`dlsym` with a composed name evades the scan** (reproduced). `dlsym(…, "posix_" + "spawn")` passes. No Feeder source calls `dlsym`: ban it in `feeder/Sources`, and fold `"a" + "b"` across the whole scan, not only for the edit-blob name. 8. **The symbol allow-list stops at the binary** (reproduced). The bundled `SQLCipher.framework` imports `_dlopen`, `_rename`, `_unlink`, `_write`, `_pwrite`, `_ftruncate` and `_mkdir`, and loads through `@rpath` from the build directory (ruling D). Say so in the test comment, or scan the framework too. 9. **Two documents say the Feeder never starts a connection** (`GLOSSARY.md`, `contracts/feeder-v1/README.md`). The round-2 stale-socket rule makes an `AF_UNIX` `connect()` probe. Say "never starts a connection off the host". `GLOSSARY.md` is an operator ruling surface. 10. **A token with a leading or trailing space passes config, but no request can match it**, because header values are trimmed. Refuse it at config. 11. **`FeederLog.bindRetry` takes a free string**, which weakens the closed-forms rule of the log. Take the closed `errnoName` result only. 12. **The Members cap counts unfiltered Members.** A Chat with more than 1024 Members is refused even when the filtered list fits. Decide which count the cap means, and record it in the spec of #10. 13. **Token strength is not checked.** A token of 32 equal characters is accepted. ## Test gaps 14. The `source-unavailable` store-open branch is never executed, so a path leak there is unproven: adding the canonical path to the `catch` at `Source.swift:89` survives. Add a file that passes every rule but is not a database, assert 503, and run the closed `FeederLog` check over all stderr in every black-box test (from `serving()` teardown). 15. The owner half of three file rules: deleting `info.st_uid == getuid()` from `privateParent` (`Config.swift:117`), from `historyIsSafeToOpen` (`:124`) or from the recheck `lstat` (`:221`) survives. Split owner and mode into a pure function, as `staleSocketIsOurs` is, and call it with another uid. 16. The `S_IFREG` half of `tokenMetadataIsSafe` (`Config.swift:138`) and of the config-file guard (`:72`) survives. Add cases with a non-regular mode. 17. An owner row with a handle: `let handle = row.fromOwner ? nil : unfiltered` changed to `unfiltered` (`Operations.swift:217`) survives; `schema.json:86-87` requires a null sender when `from_owner` is true. 18. Identifier rules on Recently Deleted guids (`Shaping.identifier` dropped in the recent path) and on hard-deletion records (`record.guid ?? ""` at `Operations.swift:144`) survive. 19. `requireCap(config.maxResultsHardCap)` removed from `Source.init` survives; the test covers only the pure function. 20. The socket parent check before the probe and the one after it each survive alone; only removing both fails a test. 21. The listener: the backoff cap (30 s to 300 s), the delay reset on ready, the retry on `.waiting`, the ready gate on accept, and the chmod verify (`== 0o600` to `true`) each survive. 22. Wire time: computing `millis % 1000` through a `Double` survives; no test uses a value that loses precision. 23. The ninth-connection test uses `sleep(0.1)` and is timing-sensitive. ## Notes - Residual, same macOS user only: between the pre-read check and the `MessagesCore` open by path, a process can swap the file in and back before the post-read check, which the `(st_dev, st_ino)` pair cannot see. The spec records the window. The `st_nlink`, `S_IFREG` and history-path rules still block pointing the Feeder at the real history, and such a process can already read the token (`SECURITY.md`). - ADR 0011 rule 1 puts the socket "in the Owner's home"; config requires only an owner-only `0700` parent. Record the wider placement in the ADR or the config document. ADRs are an operator surface. - Each read opens SQLite again, and the `check` newest-date walk has no budget. - A read creates `-shm` and `-wal` files beside a history that has none. The read-only test uses only `journal_mode=DELETE`. - The test builder maps `other` to 2006, which `MessagesCore` reads as `emoji`. No fixture uses it. - `README.md`, `SECURITY.md` and `contracts/feeder-v1/README.md` still say the Feeder is not built. Ruling F leaves these to #10. - With deny operations removed, the real binary matches FakeFeeder on 1210 requests across steps 0-7. ## Acceptance criteria - Items 1 to 4 are fixed before #10 serves a real history. - Items 5 to 13 are fixed, or each has a recorded decision. - Each mutation in items 14 to 22 fails a test in bounded time, and item 23 waits on a condition, not a sleep. - Each note is fixed, or has a recorded decision. ## Triage rulings (2026-11-15) These rulings replace the matching text above. - **Item 9.** In `GLOSSARY.md` and `contracts/feeder-v1/README.md`, replace "never starts a connection" with exactly: "The Feeder starts no network connection. It makes one local connection to its own socket path, to test whether an old socket is live." Change no other text in `GLOSSARY.md`. - **Item 12.** The Members cap counts the Members after the filter, because that is what the Feeder serves. The scan budget limits the rows read before the filter. - **ADR 0011 note (socket placement).** Not in this issue. ADRs are an operator surface; an ADR 0011 amendment records the rule. - **Item 13 (token strength).** Not ruled. The spec proposes a rule, and the architect gate decides it. - **Order.** Items 1 to 4 must merge before #10. This issue goes before #10. ## Blocked by - none --- Filed under: operator word "merge 57" sha256:1361536e73d8
svc-agent-writer changed title from Feeder follow-ups from the PR #57 gate to Feeder: close the hardening items and test gaps from the PR #57 reviews 2026-11-14 20:47:34 +00:00
Author
Member

This was generated by AI during triage.

Triage

Route: ready-for-agent. The operator ruled the open items on 2026-11-15 and told the session to triage this issue and dispatch it after #13.

Rulings that apply to this issue:

  • Item 9 (wording). In GLOSSARY.md and contracts/feeder-v1/README.md, replace "never starts a connection" with: "The Feeder starts no network connection. It makes one local connection to its own socket path, to test whether an old socket is live."
  • Item 12 (Members cap). The cap counts the Members after the filter, which is what the Feeder serves. The scan budget limits the rows read before the filter. #10 records the same rule in its spec.
  • Note on ADR 0011 rule 1 (socket placement). Not in this issue. An ADR 0011 amendment states the rule that config checks: a 0700 directory that the Owner owns. ADRs are an operator surface.

Order: items 1 to 4 must merge before #10 serves a real history. This issue goes before #10.

Not decided here: item 13 (token strength). The spec proposes a rule, and the architect gate checks it.

Filed under: operator word "accept leans / after #13, triage #58 and dispatch" sha256:a999fb29c997

> *This was generated by AI during triage.* ## Triage **Route:** `ready-for-agent`. The operator ruled the open items on 2026-11-15 and told the session to triage this issue and dispatch it after #13. **Rulings that apply to this issue:** - **Item 9 (wording).** In `GLOSSARY.md` and `contracts/feeder-v1/README.md`, replace "never starts a connection" with: "The Feeder starts no network connection. It makes one local connection to its own socket path, to test whether an old socket is live." - **Item 12 (Members cap).** The cap counts the Members after the filter, which is what the Feeder serves. The scan budget limits the rows read before the filter. #10 records the same rule in its spec. - **Note on ADR 0011 rule 1 (socket placement).** Not in this issue. An ADR 0011 amendment states the rule that config checks: a `0700` directory that the Owner owns. ADRs are an operator surface. **Order:** items 1 to 4 must merge before #10 serves a real history. This issue goes before #10. **Not decided here:** item 13 (token strength). The spec proposes a rule, and the architect gate checks it. Filed under: operator word "accept leans / after #13, triage #58 and dispatch" sha256:a999fb29c997
Collaborator

⏸ SVD architect gate: dev/messages-mind-mcp#58 feeder-close-the-hardening-items-and-test-gaps-from-the-pr-5

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 effort high

Run: 20261115T001412Z-0a6259f4

Held because: CLEAN but 6 open risk(s) (3 verification · 3 decision) — HOLD-ALL parks everything. The risks, verbatim:

Open risks:

  1. Item 2 and the check newest-date walk conflict with feeder-v1. 'A time position never names a row that the Feeder does not serve' (contract README:82, conformance.py:312) leaves no legal answer for a budgeted time page that holds no item: conformance.walk requires 'moved or not more'. The default lean (B) budgets only once the page holds an item, and adds a progress guard. A deny policy can therefore still make a request walk to the Source end. Question: accept B, or amend feeder-v1 (option A)? Under A, a time page may end at the scan budget with no item, more=true, and a position naming the last examined row. That exposes the edit or deletion time of a denied row to sync, and needs 3 more files (contract README, conformance.py, tests/feeder_fake.py), 14 in total. [decision]
  2. Item 13 token strength, left to the gate by the triage. The proposal: 32-4096 visible-ASCII characters (0x21-0x7E), at least 8 distinct, refused as config-token-file. The visible-ASCII clause also closes item 10. Question: accept, drop the distinct clause (item 10 alone), or name another rule? [decision]
  3. Item 9 GLOSSARY grammar. Replacing the phrase literally inside 'The Feeder holds no code that sends a message, and it never starts a connection.' does not parse. The lean ends the sentence after 'message' and adds the ruled two sentences unchanged, which drops ', and it'. ADR 0001:12 and ADR 0002:7 carry the same claim and stay unchanged (operator surface). Question: accept this edit and leave the ADRs as they are? [decision]
  4. Symbol, selector and load-command forms were not measured: the Half-A sandbox has no swift, nm, otool or xcrun. Check on the host: (a) xcrun swift-demangle --compact renders the 3-argument Darwin.open so that the new DENIED_SWIFT pattern matches it, and does not match the 2-argument open used at Config.swift:67,143, and test_the_binary_links_only_allowed_symbols stays green; (b) otool -v -s __TEXT __objc_methname parses as address+selector, and no denied selector comes from MessagesCore or SQLite.swift (otherwise D11: correct the comment instead, and record a deviation); (c) otool -L lists only /usr/lib, /System/Library and @rpath/SQLCipher.framework entries. [verification]
  5. Item 14 assumes a non-database chat.db makes MessagesStore(config:) throw inside the catch at Source.swift:88-89, not later in read(store). The MessagesCore source was not readable here. Check: apply mutation 14 (write historyPath.canonical to stderr in that catch) and confirm that test_a_history_that_is_not_a_database_is_source_unavailable fails. If the Feeder instead exits 2 at start, or the mutation survives, report a deviation and do not widen scope. [verification]
  6. Item 23 replaces the sleeps with an lsof -U count of the Feeder's accepted Unix-socket fds. Check on the host: '/usr/sbin/lsof -nP -a -p -U -F f' shows baseline+8 while the eight probes are open, and baseline+7 after one closes. If it does not, report the measured shape as a deviation; do not return to sleeps. [verification]

Change: Organised by file.

  • Operations.swift.
    • Add one scanBudget constant (10_000), plus pageBodyBytes and responseBytes (16 MiB). In rowPage (:67-93) and chatPage (:154-171), one local full() predicate drives both the outer loop and the inner break, so the two can never disagree (item 3).
    • A request-local PageBytes measures each item's encoded size and cuts the page before the item that would pass 16 MiB. A cut page keeps at least one item and says more. This mirrors the 1 MiB cut at :73/:78/:86, and in timePage it copies the early return at :109/:126 (item 1).
    • Time pages stop at scanBudget once they hold an item. A progress guard throws source-unavailable when a batch cannot advance the cursor (item 2, contract-preserving default).
    • The Members cap moves after the filter (item 12, ruled).
  • Router.swift.
    • Response holds the body bytes, encoded once. An encode error becomes 503. Refusal bodies are built from the closed raw value (item 1).
    • FeederPolicy() replaces OpenPolicy() (item 4).
    • FeederLog.bindRetry takes a closed BindRetryCode enum (item 11).
  • Filter.swift. public typealias FeederPolicy = OpenPolicy (item 4).
  • Config.swift.
    • Both defaults use FeederPolicy.servesOwnerHistory (item 4).
    • Pure privateDirectory and openableHistory, shaped like Listener.staleSocketIsOurs (Listener.swift:30-32) (item 15).
    • The S_IFREG check moves into configMetadataIsSafe (item 16).
    • A proposed tokenIsAcceptable: 32-4096 visible ASCII characters with at least 8 distinct (items 10 and 13).
  • Source.swift. init(historyPath:cap: = 5001) (item 19).
  • Listener.swift.
    • Static prepareSocket with an afterProbe hook (item 20).
    • Pure nextDelay, accepts and socketIsPrivate; an apply(state) method; a delayUnit and a snapshot for tests (item 21).
  • Tests.
    • Swift: a 60 s per-test watchdog, plus a new test for each item.
    • Python: a 120 s SIGALRM fixture that raises a BaseException; the closed-log check in serving(); the 16 MiB reproduction; lsof -U waits in place of sleeps (item 23); new scan patterns, a selector scan and a load-command scan (items 5-8).
  • Docs. The ruled item-9 text, and two contract README rules for the new early-end cases.
  • Decisions D1-D12 record the notes and items not changed in code.

Files: feeder/Sources/FeederCore/Router.swift · feeder/Sources/FeederCore/Operations.swift · feeder/Sources/FeederCore/Filter.swift · feeder/Sources/FeederCore/Config.swift · feeder/Sources/FeederCore/Source.swift · feeder/Sources/FeederCore/Listener.swift · feeder/Tests/FeederCoreTests/FeederCoreTests.swift · tests/test_feeder_real.py · tests/test_feeder_package.py · GLOSSARY.md · contracts/feeder-v1/README.md

Decision: 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):

  • add label svd:go — approve; Half-B dispatch accepts exactly this spec (open risks accepted)
  • add label svd:fire beside svd:go — approve AND authorise the Half-B fire from the phone; never on its own
  • add label svd:skip — park it; dispatch refuses it and the issue stays for a human
  • add label svd:respec — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context

Spec: /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-feeder-close-the-hardening-items-and-test-gaps-from-the-pr-5.md — next: codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-feeder-close-the-hardening-items-and-test-gaps-from-the-pr-5.md

### ⏸ SVD architect gate: dev/messages-mind-mcp#58 feeder-close-the-hardening-items-and-test-gaps-from-the-pr-5 **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 effort `high` **Run:** `20261115T001412Z-0a6259f4` **Held because:** CLEAN but 6 open risk(s) (3 verification · 3 decision) — HOLD-ALL parks everything. The risks, verbatim: **Open risks:** 1. Item 2 and the check newest-date walk conflict with feeder-v1. 'A time position never names a row that the Feeder does not serve' (contract README:82, conformance.py:312) leaves no legal answer for a budgeted time page that holds no item: conformance.walk requires 'moved or not more'. The default lean (B) budgets only once the page holds an item, and adds a progress guard. A deny policy can therefore still make a request walk to the Source end. Question: accept B, or amend feeder-v1 (option A)? Under A, a time page may end at the scan budget with no item, more=true, and a position naming the last examined row. That exposes the edit or deletion time of a denied row to sync, and needs 3 more files (contract README, conformance.py, tests/feeder_fake.py), 14 in total. [decision] 2. Item 13 token strength, left to the gate by the triage. The proposal: 32-4096 visible-ASCII characters (0x21-0x7E), at least 8 distinct, refused as config-token-file. The visible-ASCII clause also closes item 10. Question: accept, drop the distinct clause (item 10 alone), or name another rule? [decision] 3. Item 9 GLOSSARY grammar. Replacing the phrase literally inside 'The Feeder holds no code that sends a message, and it never starts a connection.' does not parse. The lean ends the sentence after 'message' and adds the ruled two sentences unchanged, which drops ', and it'. ADR 0001:12 and ADR 0002:7 carry the same claim and stay unchanged (operator surface). Question: accept this edit and leave the ADRs as they are? [decision] 4. Symbol, selector and load-command forms were not measured: the Half-A sandbox has no swift, nm, otool or xcrun. Check on the host: (a) xcrun swift-demangle --compact renders the 3-argument Darwin.open so that the new DENIED_SWIFT pattern matches it, and does not match the 2-argument open used at Config.swift:67,143, and test_the_binary_links_only_allowed_symbols stays green; (b) otool -v -s __TEXT __objc_methname parses as address+selector, and no denied selector comes from MessagesCore or SQLite.swift (otherwise D11: correct the comment instead, and record a deviation); (c) otool -L lists only /usr/lib, /System/Library and @rpath/SQLCipher.framework entries. [verification] 5. Item 14 assumes a non-database chat.db makes MessagesStore(config:) throw inside the catch at Source.swift:88-89, not later in read(store). The MessagesCore source was not readable here. Check: apply mutation 14 (write historyPath.canonical to stderr in that catch) and confirm that test_a_history_that_is_not_a_database_is_source_unavailable fails. If the Feeder instead exits 2 at start, or the mutation survives, report a deviation and do not widen scope. [verification] 6. Item 23 replaces the sleeps with an lsof -U count of the Feeder's accepted Unix-socket fds. Check on the host: '/usr/sbin/lsof -nP -a -p <pid> -U -F f' shows baseline+8 while the eight probes are open, and baseline+7 after one closes. If it does not, report the measured shape as a deviation; do not return to sleeps. [verification] **Change:** Organised by file. - **Operations.swift.** - Add one `scanBudget` constant (10_000), plus `pageBodyBytes` and `responseBytes` (16 MiB). In `rowPage` (:67-93) and `chatPage` (:154-171), one local `full()` predicate drives both the outer loop and the inner break, so the two can never disagree (item 3). - A request-local `PageBytes` measures each item's encoded size and cuts the page before the item that would pass 16 MiB. A cut page keeps at least one item and says `more`. This mirrors the 1 MiB cut at :73/:78/:86, and in `timePage` it copies the early return at :109/:126 (item 1). - Time pages stop at `scanBudget` once they hold an item. A progress guard throws `source-unavailable` when a batch cannot advance the cursor (item 2, contract-preserving default). - The Members cap moves after the filter (item 12, ruled). - **Router.swift.** - `Response` holds the body bytes, encoded once. An encode error becomes 503. Refusal bodies are built from the closed raw value (item 1). - `FeederPolicy()` replaces `OpenPolicy()` (item 4). - `FeederLog.bindRetry` takes a closed `BindRetryCode` enum (item 11). - **Filter.swift.** `public typealias FeederPolicy = OpenPolicy` (item 4). - **Config.swift.** - Both defaults use `FeederPolicy.servesOwnerHistory` (item 4). - Pure `privateDirectory` and `openableHistory`, shaped like `Listener.staleSocketIsOurs` (Listener.swift:30-32) (item 15). - The S_IFREG check moves into `configMetadataIsSafe` (item 16). - A proposed `tokenIsAcceptable`: 32-4096 visible ASCII characters with at least 8 distinct (items 10 and 13). - **Source.swift.** `init(historyPath:cap: = 5001)` (item 19). - **Listener.swift.** - Static `prepareSocket` with an `afterProbe` hook (item 20). - Pure `nextDelay`, `accepts` and `socketIsPrivate`; an `apply(state)` method; a `delayUnit` and a snapshot for tests (item 21). - **Tests.** - Swift: a 60 s per-test watchdog, plus a new test for each item. - Python: a 120 s SIGALRM fixture that raises a BaseException; the closed-log check in `serving()`; the 16 MiB reproduction; `lsof -U` waits in place of sleeps (item 23); new scan patterns, a selector scan and a load-command scan (items 5-8). - **Docs.** The ruled item-9 text, and two contract README rules for the new early-end cases. - **Decisions D1-D12** record the notes and items not changed in code. **Files:** `feeder/Sources/FeederCore/Router.swift` · `feeder/Sources/FeederCore/Operations.swift` · `feeder/Sources/FeederCore/Filter.swift` · `feeder/Sources/FeederCore/Config.swift` · `feeder/Sources/FeederCore/Source.swift` · `feeder/Sources/FeederCore/Listener.swift` · `feeder/Tests/FeederCoreTests/FeederCoreTests.swift` · `tests/test_feeder_real.py` · `tests/test_feeder_package.py` · `GLOSSARY.md` · `contracts/feeder-v1/README.md` **Decision:** 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`): - add label `svd:go` — approve; Half-B dispatch accepts exactly this spec (open risks accepted) - add label `svd:fire` **beside** `svd:go` — approve AND authorise the Half-B fire from the phone; never on its own - add label `svd:skip` — park it; dispatch refuses it and the issue stays for a human - add label `svd:respec` — discard this spec; the next Half-A run re-produces it with this record as prior-attempt context <sub>Spec: `/Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-feeder-close-the-hardening-items-and-test-gaps-from-the-pr-5.md` — next: `codex-svd dispatch --args '<same-json>' --approved-spec-path /Users/piers/.local/state/exhaust/groupthink/specs/2026-11-15-feeder-close-the-hardening-items-and-test-gaps-from-the-pr-5.md`</sub>
Collaborator

spec-verify-dispatch Half B for dev/messages-mind-mcp#58 feeder-close-the-hardening-items-and-test-gaps-from-the-pr-5 completed integration verify.

  • PR: #61
  • Branch: feat/svd-dev-messages-mind-mcp-58-feeder-close-the-hardening-926cdc02
  • Commit: d803a1b2e0
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: True
  • Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/75/pipeline/55/1
  • Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll
  • Warning: Mutation 14 survived: the history-path logging injected into the store-initializer catch (Source.swift) did not fail test_a_history_that_is_not_a_database_is_source_unavailable. OR-5 requires reporting this as a deviation without widening scope. The closed-log check does not guard that path; a follow-up should find where the non-database failure arises.
  • Warning: Shaping.time sits at Wire.swift:62-70, not the cited 238-246 (citation drift only).
  • Warning: Remote check ci/woodpecker/pr/validation is still pending at verdict time; the runner re-polls.
  • CI wait: ci/woodpecker/pr/validation -> pass
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261115T003753Z-926cdc02 --confirm-merge)
spec-verify-dispatch Half B for dev/messages-mind-mcp#58 feeder-close-the-hardening-items-and-test-gaps-from-the-pr-5 completed integration verify. - PR: https://git.groupthink.asia/dev/messages-mind-mcp/pulls/61 - Branch: feat/svd-dev-messages-mind-mcp-58-feeder-close-the-hardening-926cdc02 - Commit: d803a1b2e07ceb5d5633b468bce4a289ca4a745a - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: True - Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/75/pipeline/55/1 - Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll - Warning: Mutation 14 survived: the history-path logging injected into the store-initializer catch (Source.swift) did not fail test_a_history_that_is_not_a_database_is_source_unavailable. OR-5 requires reporting this as a deviation without widening scope. The closed-log check does not guard that path; a follow-up should find where the non-database failure arises. - Warning: Shaping.time sits at Wire.swift:62-70, not the cited 238-246 (citation drift only). - Warning: Remote check ci/woodpecker/pr/validation is still pending at verdict time; the runner re-polls. - CI wait: ci/woodpecker/pr/validation -> pass - Decision: review the PR and merge? (`codex-svd ship --run-id 20261115T003753Z-926cdc02 --confirm-merge`)
Collaborator

spec-verify-dispatch Half B for dev/messages-mind-mcp#58 feeder-close-the-hardening-items-and-test-gaps-from-the-pr-5 completed integration verify.

  • PR: #61
  • Branch: feat/svd-dev-messages-mind-mcp-58-feeder-close-the-hardening-926cdc02
  • Commit: ea8b70c011
  • Build: none
  • Test: green
  • Reader audit clean: True
  • Spec fidelity: True
  • Ready for merge: True
  • Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/75/pipeline/56/1
  • Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll
  • Warning: Mutation 14 (and R1-14) survived: logging the history path in the MessagesStore-initializer catch at Source.swift did not fail test_a_history_that_is_not_a_database_is_source_unavailable. The Acceptance Criteria item 14-22 is unmet for this mutation. Spec Open Risk 5 directs reporting it as a deviation without widening scope, so it is not a blocker. Follow-up: a test that observes this log path.
  • Warning: Local pytest without uv lacks tiktoken; collection and runs used uv run, which collected 219 tests in the three feeder test files.
  • Warning: Spec items 2 and the check newest-date walk stay unbudgeted under feeder-v1 (Open Risk 1, decisions D2/D3); no code change expected.
  • Warning: Encoder-failure fixture is unreachable (WireValue cannot hold a non-finite value); test keeps encode-once and refusal-body assertions only, as spec item 8 permits.
  • Warning: The Recently Deleted cut test uses a 1 MiB internal test budget, because bounded pages cannot reach 16 MiB; production keeps 16 MiB.
  • CI wait: ci/woodpecker/pr/validation -> pass
  • Rework: 1 round(s), outcome converged
  • Decision: review the PR and merge? (codex-svd ship --run-id 20261115T003753Z-926cdc02 --confirm-merge)
spec-verify-dispatch Half B for dev/messages-mind-mcp#58 feeder-close-the-hardening-items-and-test-gaps-from-the-pr-5 completed integration verify. - PR: https://git.groupthink.asia/dev/messages-mind-mcp/pulls/61 - Branch: feat/svd-dev-messages-mind-mcp-58-feeder-close-the-hardening-926cdc02 - Commit: ea8b70c0115f5887ca76ef8e74e8efb11394d488 - Build: none - Test: green - Reader audit clean: True - Spec fidelity: True - Ready for merge: True - Check ci/woodpecker/pr/validation: green https://ci.groupthink.asia/repos/75/pipeline/56/1 - Checks: required ci/woodpecker/pr/validation resolved pass by CI-wait poll - Warning: Mutation 14 (and R1-14) survived: logging the history path in the MessagesStore-initializer catch at Source.swift did not fail test_a_history_that_is_not_a_database_is_source_unavailable. The Acceptance Criteria item 14-22 is unmet for this mutation. Spec Open Risk 5 directs reporting it as a deviation without widening scope, so it is not a blocker. Follow-up: a test that observes this log path. - Warning: Local pytest without uv lacks tiktoken; collection and runs used `uv run`, which collected 219 tests in the three feeder test files. - Warning: Spec items 2 and the check newest-date walk stay unbudgeted under feeder-v1 (Open Risk 1, decisions D2/D3); no code change expected. - Warning: Encoder-failure fixture is unreachable (WireValue cannot hold a non-finite value); test keeps encode-once and refusal-body assertions only, as spec item 8 permits. - Warning: The Recently Deleted cut test uses a 1 MiB internal test budget, because bounded pages cannot reach 16 MiB; production keeps 16 MiB. - CI wait: ci/woodpecker/pr/validation -> pass - Rework: 1 round(s), outcome converged - Decision: review the PR and merge? (`codex-svd ship --run-id 20261115T003753Z-926cdc02 --confirm-merge`)
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dev/messages-mind-mcp#58
No description provided.