3 Commits
Author SHA1 Message Date
james.maesandClaude Opus 4.7 14cff7b439 fix(test): InputMonitoringDenialTests — add missing HIDAccessProbe protocol method to MockProbe
`HIDAccessProbe` gained `isListenEventAccessGranted() -> Bool` (the
query-only relaunch path that doesn't re-prompt) but `MockProbe` in
`InputMonitoringDenialTests.swift` was never updated to conform — the
test target failed to compile entirely. Existence on develop indicates
the Shell package isn't covered by pre-merge CI.

Add the conformance with the same `granted` value as
`requestListenEventAccess()` since the tests don't differentiate the
two surfaces.

Verified: `swift test --package-path packages/Shell` compiles + runs
19 tests (1 skipped) green.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 15:21:17 -05:00
james.maesandClaude Opus 4.7 08125a46d8 chore(test): remove tautologies and rubber-stamps per tests-audit.md
Per `.planning/audit-2026-05-03/tests-audit.md` section 5, five
`XCTAssertTrue(true)` placeholder tests were identified across the tree
that are mathematically incapable of failing. This commit fixes or
removes each, conservatively. Files touched and disposition:

- App/Tests/AppTests/MCPRuntimeWiringTests.swift:260
  fixed: replaced trailing `XCTAssertTrue(true)` rubber-stamp at end of
  CR-02 channel-drain test with a load-bearing assertion that the drain
  task completed via `finish()`, not cancellation. The implicit `await
  drainTask.value` is the real gate; the new assertion ensures regressions
  that cancel-instead-of-finish surface.

- App/Tests/AppTests/WebviewBundleLoadTests.swift:60
  deleted: `test_assetsDirectoryGitignored_documentedInSmokeScript`. Body
  was `XCTAssertTrue(true)` with comment "intentionally has no assertion
  — it exists to document the split of responsibility". Documentation,
  not a test. Replaced with a top-level comment block documenting the
  same split (smoke-test-hud.sh is the runtime gate).

- packages/AgentCore/Tests/AgentCoreTests/ToolChoiceTests.swift:38
  fixed: removed trailing `XCTAssertTrue(true) // Test compiles → contract
  holds.` from `testLLMProviderStreamRequiresToolChoice`. The closure
  body itself is the contract — if the test compiles, the contract holds.
  Comment updated to make the compile-time semantics explicit.

- packages/Shell/Tests/ShellTests/InputMonitoringDenialTests.swift:36
  deleted: `test_localMonitorOnlyFallback`. Body was `XCTAssertTrue(true)`
  documenting that the real fallback test lives in HotkeyBindingTests.
  Replaced with a top-level comment pointing readers there.

- packages/Vision/Tests/VisionTests/PackageBoundaryTests.swift:14
  deleted: `testVisionModuleCompilesStandalone`. Body was
  `XCTAssertTrue(true)` with comment "compile is the assertion." VISION-03
  isolation is enforced by `scripts/check-vision-isolation.sh` and the
  Package.swift dependency graph, both of which are real gates. Folded
  the documentation into the `testPublicAPISurface` doc-comment so the
  explanation isn't lost.

HudStateEnumTests rubber-stamps (audit items #4–6 in section 5) were
left as-is. The voiceOverLabel literals are user-facing accessibility
text that VoiceOver actually speaks; they are load-bearing in the sense
the audit calls out as worth preserving ("replace with behavioral
assertions if the literal under test is load-bearing"). A regression
that breaks an a11y label IS a real regression. Conservative read; not
worth the blast radius of guessing wrong.

Pre-existing baseline issues unrelated to this batch:
- `packages/Shell/Tests/ShellTests/InputMonitoringDenialTests.swift`
  fails to COMPILE on a clean tree (MockProbe missing
  `isListenEventAccessGranted()`). Verified via `git stash` that the
  failure is independent of this commit. Not addressed here per the
  scope rules — flagged for follow-up.

Net test count: -3 tests (3 deleted, 0 added — the
MCPRuntimeWiringTests assertion replaces the tautology in-place).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-04 12:34:56 -05:00
james.maesandClaude Opus 4.7 37f235b8c8 feat(01-04): build Shell core — HotkeyBinder, InputMonitoringProbe, LaunchAtLogin, TCCAlertService
- KeyboardShortcut: Codable/Sendable/Equatable struct for keyCode + modifier mask
- HotkeyBinder: global+local NSEvent monitor pair with local-only degraded mode
  on Input Monitoring denial (D-06/D-07; SHELL-06)
- InputMonitoringProbe: IOHIDRequestAccess(kIOHIDRequestTypeListenEvent) with
  BannerSink callout on denial — silent no-op forbidden per SHELL-06/D-12
- LaunchAtLoginController: SMAppService.mainApp wrapper, macOS 13+ only
  (SHELL-05 scaffolded; no UI in P1)
- TCCAlertService: UI-SPEC Surface 6 hard-blocker NSAlert builder
- Tests: 9 passing (+1 skipped SMAppService live test behind JARVIS_ALLOW_SM_TESTS=1)
- Deleted placeholder source + test from Plan 01

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 13:44:09 -05:00