P2: Apply commenting style guide to Vision package load-bearing actors #72

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

Goal

Bring the Vision package's load-bearing actors up to the standard in .planning/code-commenting-guide.md.

Files in scope

  • packages/Vision/Sources/Vision/CameraCapture.swift
  • packages/Vision/Sources/Vision/PresenceMonitor.swift
  • packages/Vision/Sources/Vision/VisionRouter.swift
  • packages/Vision/Sources/Vision/FrameAttachController.swift

Constraints

  • ONE atomic commit per file (4 commits total). No code behavior changes — comments + docstrings only.
  • 18/18 boundary gates green.
  • Apply the guide's 5 comment shapes per file:
    • 5-line opener (WHY this actor exists, threading model, who calls it)
    • Type-level /// docstring with Overview + Topics + Threading + See Also
    • Method-level docstrings on public + key private methods
    • ASCII diagram where the file owns orchestration (frame pipeline: capture → presence → router → attach; TCC + reprompt flow)
    • "Before you edit" invariants block (vision isolation; presence-bus vs vision module boundary; frame ownership transfer rules; TCC reprompt cadence; no evaluateJavaScript for frame delivery)
    • MARK dividers as a table of contents

Anti-patterns to remove

  • Plan-ID-only comments — rewrite WHY-first.
  • Stale references to closed Plan IDs or removed types.
  • Bare TODO: / FIXME: without issue link.

Follow the canonical pattern

Use the AppDelegate.swift P0 rewrite (#65) as the canonical applied pattern.

Parent epic

#64

Source

.planning/code-commenting-guide.md → Migration plan → P2

## Goal Bring the Vision package's load-bearing actors up to the standard in `.planning/code-commenting-guide.md`. ## Files in scope - `packages/Vision/Sources/Vision/CameraCapture.swift` - `packages/Vision/Sources/Vision/PresenceMonitor.swift` - `packages/Vision/Sources/Vision/VisionRouter.swift` - `packages/Vision/Sources/Vision/FrameAttachController.swift` ## Constraints - ONE atomic commit per file (4 commits total). No code behavior changes — comments + docstrings only. - 18/18 boundary gates green. - Apply the guide's 5 comment shapes per file: - 5-line opener (WHY this actor exists, threading model, who calls it) - Type-level `///` docstring with Overview + Topics + Threading + See Also - Method-level docstrings on public + key private methods - ASCII diagram where the file owns orchestration (frame pipeline: capture → presence → router → attach; TCC + reprompt flow) - "Before you edit" invariants block (vision isolation; presence-bus vs vision module boundary; frame ownership transfer rules; TCC reprompt cadence; no `evaluateJavaScript` for frame delivery) - MARK dividers as a table of contents ## Anti-patterns to remove - Plan-ID-only comments — rewrite WHY-first. - Stale references to closed Plan IDs or removed types. - Bare `TODO:` / `FIXME:` without issue link. ## Follow the canonical pattern Use the AppDelegate.swift P0 rewrite (#65) as the canonical applied pattern. ## Parent epic #64 ## Source .planning/code-commenting-guide.md → Migration plan → P2
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/Jarvis#72