Skip to content

Latest commit

 

History

History
82 lines (62 loc) · 2.96 KB

File metadata and controls

82 lines (62 loc) · 2.96 KB

Contributing to SessionMesh

Thanks for your interest. SessionMesh is small enough to keep the contribution flow lightweight; this doc is the only thing between an idea and a merged PR.

Quick start

git clone https://github.com/3theories/SessionMesh.git
cd SessionMesh
swift build         # compile both products
swift test          # run the suite (29 tests / 8 suites today)

That's it — no Bundler, no SwiftLint config, no signing setup. The repo is intentionally one Package.swift away from swift run-able.

What kind of change is this?

Change Path
Bug fix — engine drops a duplicate it shouldn't, transport leaks a snapshot, reducer returns the wrong state Open an issue or send a PR with a failing test in the same commit as the fix.
New transport — Bluetooth, network framework, multipeer, custom socket New product target under Sources/. Keep it as a separate library (the WatchConnectivity transport is the template).
Core protocol change — wire format, identity, engine semantics Open an issue first. Backwards compatibility of the v1 wire format is a design constraint.
Docs / examples / typo Send the PR straight, no issue needed.

Code style

  • Tabs are out; 4-space indent.
  • One type per file. Filename matches the primary type (SessionSyncEngine.swift declares SessionSyncEngine).
  • Doc-comment every public symbol with ///. Comments describe why, not what.
  • Default to internal access. Make something public only when a consumer demonstrably needs it.

The codebase compiles under strict concurrency in Swift 6. New code should land sendable-clean from day one.

Tests

  • Pure XCTest (no third-party harness).
  • Sources/SessionMesh/ must build on Linux. The extraction boundary test enforces that no WatchConnectivity / UIKit / AppKit import leaks into the core target — don't defeat it.
  • New protocol semantics deserve a new ScenarioHarness case. Reducer regressions deserve a DiagnosticsSession snapshot test. Engine bugs deserve a focused unit test on SessionSyncEngine.

Commit messages

Conventional Commits in the subject line; full body in the imperative. Examples:

  • fix(engine): drop envelopes whose sequence trails the watermark
  • feat(transport): network framework transport (closes #42)
  • docs(readme): clarify the snapshot-request protocol

Keep subjects ≤ 72 chars. Use the body for the why.

PR checklist

Before requesting review:

  • swift build clean
  • swift test green
  • Public API additions documented (/// on the symbol, plus a note in the README if it's discoverable from the type list)
  • CHANGELOG.md updated under [Unreleased]
  • Linux build still works — the extraction boundary test is your safety net but doesn't catch every accidental Apple-framework import

License

By contributing you agree your changes are licensed under the MIT License.