DD-338 Phase C W5 — consolidate _meta emission onto MCPHelpers + catalog backfill#3
Merged
Merged
Conversation
…M dep Replace the 160-LOC hand-rolled `Sources/AppleNotesBlade/MetaEnvelope.swift` with the canonical `stallari-mcp-helpers-swift` SPM dep (MCPHelpers v0.1.0). The hand-rolled v1 was written 2026-05-23 in PR #2 alongside the first Swift _meta envelope emission; the canonical lib shipped 2026-05-23 as DD-338 Phase E.swift and the duplication is now retired before it drifts. Wire-shape changes (canonical vs hand-rolled v1): - `redactions` ALWAYS emitted (`[]` when empty). Was omit-when-empty. - `next_cursor` ALWAYS emitted (JSON `null` when nil). Was omit-when-nil. - `filtered_by` alphabetically sorted by the formatter. Caller pre-sort no longer load-bearing; existing pre-sort calls remain harmless. - `formatMetaLine` now throws (encoding-failure surface, unreachable for our value types). Per the canonical contract, `MetaEnvelope.init` parameter order is now (matchedTotal, returned, latencyMs, filteredBy, redactions, ...) — all 3 emitting tool handlers updated. ResultBuilder.makeResultWithMeta wraps the new try-formatMetaLine in the existing do/catch and routes encode failures through errorResult(.internalError("encode_failure")) per Wave 3 OQ-7. Retained as blade-local (not part of the canonical surface): - `Duration.toMilliseconds()` — `ContinuousClock.Duration` → Int ms for populating MetaEnvelope.latencyMs (canonical leaves clock marshalling to the caller). - `metaQueryDigest(_:)` — SHA-256 short digest for search-query audit values. Blade-domain helper; not generic enough for the canonical lib. Moved into Sources/AppleNotesBlade/MetaHelpers.swift. Platform bump: .macOS(.v13) → .macOS(.v14) to satisfy the canonical lib's minimum platform. macOS 14 (Sonoma 2023) is widely deployed; consumer is the Stallari harness only. Catalog declarations in stallari-plugins/plugins/tools/apple-notes-blade-mcp.json flip in a sibling PR (separate stallari-plugins repo) — covered by the `feat/dd-338-w5-apple-catalog-flip` branch. Test surface: - All 73 existing tests pass post-flip (zero regressions). - MetaEnvelopeTests updated for canonical wire shape: 4-key formatter assertion → 6-key, omit-when-empty tests → always-present-with-default assertions, +1 canonical-shape gate test using locked input/output pair. Build: clean, zero warnings. Tests: 73/73 green. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…deps Same fix as the sister apple-mail-blade-mcp commit 6fc526a. The DD-338 W5 SPM dep on stallari-mcp-helpers-swift transitively requires swift-tools-version 6.0+; macos-14 GH runner ships Swift 5.10 by default. macos-15 ships Xcode 16 / Swift 6.0+ — keeping it as the single CI target. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sources/AppleNotesBlade/MetaEnvelope.swiftwith the canonicalstallari-mcp-helpers-swiftSPM dep (MCPHelpers v0.1.0)..macOS(.v13) → .macOS(.v14)to satisfy the canonical lib's minimum platform.stallari-plugins/plugins/tools/apple-notes-blade-mcp.jsonflipaudit_surface: minimal → structuredfor the 3 emitting tools — landed in a sibling stallari-plugins PR (separate atomic unit per spec).Wire-shape changes (canonical vs hand-rolled v1)
redactionsALWAYS emitted ([]when empty). Was omit-when-empty.next_cursorALWAYS emitted (JSONnullwhen nil). Was omit-when-nil.filtered_byalphabetically sorted by the formatter (caller pre-sort no longer load-bearing).formatMetaLinenow throws (encoding-failure surface).MetaEnvelope.initparameter order changed to(matchedTotal, returned, latencyMs, filteredBy, redactions, ...)— all 3 tool handlers updated.Retained blade-local
Duration.toMilliseconds()— clock marshalling helper.metaQueryDigest(_:)— search-query SHA-256 short digest.Moved into
Sources/AppleNotesBlade/MetaHelpers.swift.Test plan
swift package resolvecleanswift buildclean, zero warningsswift test— 73/73 greenMetaEnvelope.swiftdeleted;grep -rn "MetaEnvelope.swift" Sources/shows only doc-comment references🤖 Generated with Claude Code