Feature/cloudlens demo app#4
Merged
Merged
Conversation
The MCP swift-sdk is a swift-tools-version 6.1 package, so 6.1 (Xcode 16.3+) is the real minimum, not 5.10. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CloudLens embeds the StackQL MCP server and runs a small read_only pulse suite, surfacing state in the macOS menu bar with native notifications. Structure (two SwiftPM targets so the logic is CI-testable without a GUI): CloudLensCore (library, no SwiftUI): - Finding/Severity/PulseKind/PulseResult domain model with the SQL behind each finding carried through to notifications. - FindingDiff: pure menu-bar-state derivation and new-since-last-run diff. - Pulse protocol + RowParser (parses StackQL JSON-array tool output) and three pulses: PosturePulse (github null_auth, the zero-cred demo pulse), SpendPulse and ExposurePulse (AWS, degrade to "not configured" without creds rather than a false all-calm). - SentinelModel: @mainactor orchestrator - starts the embedded server, runs the suite, derives state, diffs, fires the new-findings hook. - AnthropicAgent: URLSession Messages API client (no official Swift SDK), x-api-key + anthropic-version headers, claude-opus-4-8, key never bundled. - Keychain: generic-password store for the Anthropic key. CloudLens (executable, SwiftUI): - MenuBarExtra app; icon reflects calm/attention/unknown; popover shows the three pulses with each finding's SQL (selectable). AppDelegate runs an initial check at launch then on a 15-minute schedule. - Notifications: one native notification per new attention finding, body includes the SQL behind it. Tests (CloudLensCoreTests, offline): finding diff/state, row parsing, each pulse's finding generation and severity thresholds, agent prompt building and response extraction. CI builds the CloudLens product explicitly and runs the new test target (swift build/test already cover both). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Long-lived feature branches may stack on each other (CloudLens is based on the package branch, not main), so a PR whose base is another feature branch never matched 'pull_request: branches: [main]' and got no CI. Run on every PR and on pushes to main and feature/** so stacked branches are validated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A [String: String] literal of runtime variables does not implicitly convert to [String: Value] (Value's ExpressibleByStringLiteral only applies to string literals). Add a call(_:stringArgs:) overload that maps via Value(stringLiteral:) and use it from the pulses. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
No description provided.