M-1: Self surface (getSelfState, TCC events, B-08 dissolution) #5

Open
opened 2026-05-12 19:01:55 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-05-12 19:01:55 +00:00 (Migrated from github.com)

Goal

Land the lowest-blast-radius surface as proof of API approach. Self surface live; getSelfState / tccStatusChanged / device enumeration through API. Closes B-08 (model paraphrase) via canonical modelDisplayName typed at the API boundary.

Scope — surfaces in this phase

  • JarvisAPI.Self protocol with queries: getSelfState, listAudioDevices, listCameraDevices, getActiveAudioRoute
  • Events: selfStateChanged, tccStatusChanged
  • Harness command (UQ-1 gated): _forceTCCStatus(permission:granted:)
  • Canonical modelId + modelDisplayName on SelfState — sole strings referenced in get_self_state tool result text
  • getSelfState.memoryVectorAvailable: Bool flag (foreshadows M-4 / R-011)

Files (created/modified)

  • packages/JarvisAPI/Sources/JarvisAPI/Surfaces/Self+Adapter.swift (new) — wraps SelfStateAdapter
  • App/AppDelegate.swift:686-689 — wire SelfSurface conformer; in-process tool now consumes typed surface
  • MCP tool get_self_state — consumes JarvisAPI.Self.getSelfState()
  • packages/Harness/Tests/HarnessTests/SelfScenarioTests.swift (new)

Test contract

Scenarios S-SELF-001..S-SELF-004 from JARVIS-API-TEST-CONTRACT.md — all run in BOTH .inProcessActor AND .jsonRoundTripWebView modes per UQ-5:

  • S-SELF-001 — getSelfState happy path
  • S-SELF-002 — B-08 dissolution N≥10 trials (assistant text never contains "Opus 4.5" when modelId == "claude-opus-4-7")
  • S-SELF-003 — TCC denied → revoked-event chain via _forceTCCStatus
  • S-SELF-004 — getActiveAudioRoute returns nil pre-voice-install (R-016 ordering gate)

Acceptance criteria

  • swift test --package-path packages/JarvisAPI --filter SelfSurfaceTests green
  • All M-1 harness scenarios green via .inProcessActor runner
  • All M-1 harness scenarios green via .jsonRoundTripWebView runner
  • bash scripts/check-install-order.sh (behavioral) green — Self conformer must not perturb install DAG
  • bash scripts/verify-entitlements.sh --pre-codesign green (R-012)
  • B-08 dissolution: N≥10 trials with zero "Opus 4.5" paraphrase
  • getSelfState.memoryVectorAvailable: Bool reflects current dylib load state
  • PR merged to develop

Carry-forward closures

  • Closes #53 (B-08: model paraphrase)

Dependencies

  • Blocked by: #4 (M-0)
  • Blocks: #6 (M-2 Settings)

Sub-issues

  • #100 — M-1: define JarvisAPI.Self protocol (getSelfState, device enumeration, TCC events)
  • #101 — M-1: implement Self surface adapter wrapping SelfStateAdapter; plumb events
  • #102 — M-1: dissolve B-08 — canonical modelDisplayName typed at API boundary (N=10 trials)
  • #103 — M-1: _forceTCCStatus harness command (UQ-1 gated, G-003)
  • #104 — M-1: harness scenarios S-SELF-001..004 in both transport modes (UQ-5)

Estimate

1.0–1.5 engineer-days

Source

  • .planning/architecture/JARVIS-API-MIGRATION-PLAN.md §2.2
  • .planning/architecture/JARVIS-API-DESIGN-v0.1.md — Self surface
  • .planning/architecture/JARVIS-API-TEST-CONTRACT.md §3 — Self coverage map
  • .planning/architecture/REVIEW-MIGRATION-RISK.md R-010, R-012, R-016
  • Parent epic: v1.0 API Migration — UI/Backend separation (M-0..M-7) (#76)
## Goal Land the lowest-blast-radius surface as proof of API approach. Self surface live; `getSelfState` / `tccStatusChanged` / device enumeration through API. Closes B-08 (model paraphrase) via canonical `modelDisplayName` typed at the API boundary. ## Scope — surfaces in this phase - **`JarvisAPI.Self`** protocol with queries: `getSelfState`, `listAudioDevices`, `listCameraDevices`, `getActiveAudioRoute` - Events: `selfStateChanged`, `tccStatusChanged` - Harness command (UQ-1 gated): `_forceTCCStatus(permission:granted:)` - Canonical `modelId` + `modelDisplayName` on `SelfState` — sole strings referenced in `get_self_state` tool result text - `getSelfState.memoryVectorAvailable: Bool` flag (foreshadows M-4 / R-011) ## Files (created/modified) - `packages/JarvisAPI/Sources/JarvisAPI/Surfaces/Self+Adapter.swift` (new) — wraps `SelfStateAdapter` - `App/AppDelegate.swift:686-689` — wire SelfSurface conformer; in-process tool now consumes typed surface - MCP tool `get_self_state` — consumes `JarvisAPI.Self.getSelfState()` - `packages/Harness/Tests/HarnessTests/SelfScenarioTests.swift` (new) ## Test contract Scenarios `S-SELF-001..S-SELF-004` from `JARVIS-API-TEST-CONTRACT.md` — all run in BOTH `.inProcessActor` AND `.jsonRoundTripWebView` modes per UQ-5: - `S-SELF-001` — getSelfState happy path - `S-SELF-002` — B-08 dissolution N≥10 trials (assistant text never contains "Opus 4.5" when `modelId == "claude-opus-4-7"`) - `S-SELF-003` — TCC denied → revoked-event chain via `_forceTCCStatus` - `S-SELF-004` — `getActiveAudioRoute` returns nil pre-voice-install (R-016 ordering gate) ## Acceptance criteria - [ ] `swift test --package-path packages/JarvisAPI --filter SelfSurfaceTests` green - [ ] All M-1 harness scenarios green via `.inProcessActor` runner - [ ] All M-1 harness scenarios green via `.jsonRoundTripWebView` runner - [ ] `bash scripts/check-install-order.sh` (behavioral) green — Self conformer must not perturb install DAG - [ ] `bash scripts/verify-entitlements.sh --pre-codesign` green (R-012) - [ ] B-08 dissolution: N≥10 trials with zero "Opus 4.5" paraphrase - [ ] `getSelfState.memoryVectorAvailable: Bool` reflects current dylib load state - [ ] PR merged to develop ## Carry-forward closures - Closes #53 (B-08: model paraphrase) ## Dependencies - Blocked by: #4 (M-0) - Blocks: #6 (M-2 Settings) ## Sub-issues - #100 — M-1: define JarvisAPI.Self protocol (getSelfState, device enumeration, TCC events) - #101 — M-1: implement Self surface adapter wrapping SelfStateAdapter; plumb events - #102 — M-1: dissolve B-08 — canonical modelDisplayName typed at API boundary (N=10 trials) - #103 — M-1: _forceTCCStatus harness command (UQ-1 gated, G-003) - #104 — M-1: harness scenarios S-SELF-001..004 in both transport modes (UQ-5) ## Estimate 1.0–1.5 engineer-days ## Source - `.planning/architecture/JARVIS-API-MIGRATION-PLAN.md` §2.2 - `.planning/architecture/JARVIS-API-DESIGN-v0.1.md` — `Self` surface - `.planning/architecture/JARVIS-API-TEST-CONTRACT.md` §3 — Self coverage map - `.planning/architecture/REVIEW-MIGRATION-RISK.md` R-010, R-012, R-016 - Parent epic: #76
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/Jarvis#5