Files
Jarvis/scripts/check-vision-isolation.sh
james.maesandClaude Opus 4.7 c9889705fb feat(07-04): create packages/Vision SPM scaffold + VISION-03 grep-gates
- New packages/Vision SPM target (macOS 14, swift-tools 6.0, strict-concurrency v6).
- Dependencies: Logging + AgentCore + swift-log only (NO Voice, NO AgentOrchestrator).
  This is the compile-time half of VISION-03; the textual halves are the two
  scripts below.
- VisionError (TCC + capture errors) and VisionDegradationReason (cameraDenied,
  midSessionRevoked) — analogs of Voice's Error / DegradationReason.
- scripts/check-vision-isolation.sh: fails build on any `import Voice` /
  `import AgentOrchestrator` under packages/Vision/Sources.
- scripts/check-presence-bus-no-tts-orchestrator.sh: fails build on any
  PresenceSignalBus reference inside packages/Voice/Sources or
  packages/AgentCore/Sources/AgentOrchestrator (non-comment lines only).
- Wired Vision into project.yml (XcodeGen) — workspace has no top-level
  Package.swift; mirrors the Memory wiring from 07-01 (same deviation
  pattern, same rationale).
- Updated NSCameraUsageDescription to the plan's wording (key was already
  present from earlier scaffolding).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-29 16:09:39 -05:00

29 lines
888 B
Bash
Executable File

#!/usr/bin/env bash
# Phase 7 / Plan 07-04 — VISION-03 architectural guard.
#
# Fails the build if any file under packages/Vision/Sources/ contains
# `import Voice` or `import AgentOrchestrator`. This enforces the
# packages/Vision SPM target's dependency-graph isolation at the textual
# level — even if a future SPM refactor accidentally adds the dep,
# this script catches the import statement.
set -euo pipefail
cd "$(dirname "$0")/.."
if [[ ! -d packages/Vision/Sources ]]; then
exit 0
fi
HITS=$(find packages/Vision/Sources -name '*.swift' -print0 \
| xargs -0 grep -nHE '^[[:space:]]*import[[:space:]]+(Voice|AgentOrchestrator)([[:space:]]|$)' \
2>/dev/null || true)
if [[ -n "$HITS" ]]; then
echo "VISION-03 violation: packages/Vision/Sources must not import Voice or AgentOrchestrator." >&2
echo "Hits:" >&2
echo "$HITS" >&2
exit 1
fi
exit 0