Skip to content

Feature/cloudlens demo app#4

Merged
jeffreyaven merged 4 commits into
mainfrom
feature/cloudlens-demo-app
Jun 13, 2026
Merged

Feature/cloudlens demo app#4
jeffreyaven merged 4 commits into
mainfrom
feature/cloudlens-demo-app

Conversation

@jeffreyaven

Copy link
Copy Markdown
Member

No description provided.

jeffreyaven and others added 4 commits June 13, 2026 17:47
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>
@jeffreyaven jeffreyaven merged commit 98467a3 into main Jun 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant