Code Map and Contributing

What lives in which directory, where to look for a given kind of change, the dependency rule that keeps the codebase testable, and how to get a change reviewed and merged.

The code map

51 Swift files across three areas, verified by walking the tree directly.

app/Packages/SenseBridgeCore/ — the device-agnostic package

A SwiftPM package (swift-tools-version: 6.2, .iOS(.v26) / .macOS(.v15)) holding every piece of reasoning, output, sensing-protocol, perception, and storage logic that doesn’t need the app target or a simulator to test. This is the seam the project’s testability rests on: swift test/xcodebuild test runs the whole reasoning core headless, off-device.

A change here implies: it’s testable without Xcode/a simulator, it must stay free of UIKit/SwiftUI/App-layer imports (platform-conditional #if os(iOS) blocks for AVFoundation/CoreHaptics are the accepted exception, isolated to the actor that needs them), and it changes a contract every consumer above it depends on.

app/SenseBridge/ — the app target

A change here implies: it’s SwiftUI/UIKit-facing, it needs a VoiceOver pass if it touches UI, and it should route through AppEnvironment.output (MultiRenderTarget) rather than constructing its own render target.

Tests and the Xcode project

“I want to change X, where do I look”

Intent Directory Protocol seam involved
Add a new sensor (e.g. LiDAR depth, microphone) SenseBridgeCore/Sources/SenseBridgeCore/Sensing/ Conform to SensingSource
Add a new output channel (e.g. a watch or glasses channel; speech, caption, and haptic exist) SenseBridgeCore/Sources/SenseBridgeCore/Output/, or app/SenseBridge/App/ when the target owns SwiftUI state as CaptionRenderTarget does Conform to RenderTarget; add the case to RenderChannel and register it in AppEnvironment.renderTargets
Change what the app says SenseBridgeCore/Sources/SenseBridgeCore/Reasoning/Phrasing.swift (hedge templates) and Localizable.xcstrings (translations) None — Phrasing is the single enforcement point; do not compose prose at a call site
Add a screen app/SenseBridge/Features/<Feature>/ Render results through environment.output (MultiRenderTarget), never a standalone RenderTarget
Add a setting SenseBridgeCore/Sources/SenseBridgeCore/Storage/Settings.swift (add the field, extend the custom Decodable init with a default for back-compat) and app/SenseBridge/App/SettingsView.swift SettingsStore
Add a test Mirror the source file’s location under the matching Tests/ directory Swift Testing (import Testing) for unit/integration; XCUITest for e2e — see docs/TESTING.md

The dependency rule

Dependencies point inward: the App layer depends on SenseBridgeCore, never the reverse. Within SenseBridgeCore, Reasoning stays pure and framework-independent — it depends on PerceptionRecord values, never on AVFoundation, Vision, CoreHaptics, or any capture/render framework directly. A framework-specific implementation (an actor wrapping AVSpeechSynthesizer, say) sits at the edge, behind the protocol the rest of the pipeline depends on. See docs/ARCHITECTURE.md for the full pipeline diagram and the api-design skill for the reasoning behind it.

How to contribute

Full walkthrough: CONTRIBUTING.md and CODE_OF_CONDUCT.md at the repository root. In short: branch as feat/..., fix/..., or chore/...; conventional commit headers (type(scope): subject); open a PR so CI runs — see docs/CI-CD.md for every gate a PR has to clear.

Which review is mandatory for which kind of change, via the personas under .agents/agents/:

Which reviews a machine can run, and which need a human or a device

Static/automated review (a machine, in CI or as an agent persona) can check: code correctness, concurrency safety, whether spoken strings are hedged per-pattern, whether every UI element has a label/hint/trait, dependency licenses, and known-CVE dependency scanning.

None of that substitutes for the two things that actually validate this product:

State plainly, in every PR or review, which of these a machine actually verified and which still need device and human validation — never let a green pipeline imply the app was validated by the people it’s for.


Need help? See SUPPORT.md.