Contributing
Sora v0.1.0 is one monorepo with several build systems: Gradle for the Kotlin Multiplatform core and Android app, pnpm for the TypeScript workspace, and a small VitePress site for documentation. This page covers the contributor workflow. For the product view of the repo, read Architecture Overview first.
Toolchains
| Area | Requirements |
|---|---|
| Shared core, Android app, JVM Host | JDK 21 (JAVA_HOME), Android SDK Platform 36 + Build-Tools 36.0.0 (Android builds only), 8 GB+ RAM |
| Desktop, Web, Relay, Protocol | Node.js 24+ and the pnpm version pinned in the root package.json |
| Documentation site | Node.js 24+ (VitePress is installed by the site's own lockfile) |
| Plugins | JDK 21 and Android SDK 36; a clean checkout can build the template without the rest of the monorepo |
| All Gradle work | bash and flock (Linux, macOS, or WSL2) |
Gradle builds must go through ./scripts/gradlew-locked (or ./apps/android/scripts/build.sh). It serializes builds with a file lock so parallel daemons do not corrupt incremental state or exhaust memory.
Working with the monorepo
# TypeScript workspace
pnpm install
pnpm typecheck
pnpm test
pnpm build:web
pnpm build:desktop
# Shared core and JVM Host (no Android SDK needed)
./scripts/gradlew-locked -Psora.hostOnly=true :verifyModuleBoundaries
./scripts/gradlew-locked -Psora.hostOnly=true :core:runtime:jvmTest :core:relay:jvmTest :apps:host:check
./scripts/gradlew-locked -Psora.hostOnly=true :apps:host:installDist
# Android app and the full Gradle graph
cd apps/android
./scripts/dev-setup.sh # verify JDK + SDK and build a debug APK
./scripts/check.sh # compile, unit tests, lint, boundaries, APK
./scripts/check.sh --full # adds plugin-api / design ABI compatibility
./scripts/api-compat.sh # ABI gate only
# Plugins
(cd plugins/official && ./scripts/check.sh)
(cd plugins/sample && ./gradlew verifyPlugin --no-daemon)
# Documentation site
cd docs-site && pnpm install && pnpm devThere are two switches worth knowing:
-Psora.hostOnly=true(orSORA_HOST_ONLY=1) drops the Android modules from the Gradle graph so the core and Host can be built without the Android SDK.-Psora.localSdk=true(orSORA_LOCAL_SDK=1) uses a sibling../Sora-KotlinSDKcheckout through a Gradle composite build instead of published artifacts.
An all-in-one verification is available as ./scripts/check-all.sh.
Module and package boundaries
Boundaries are enforced, not suggested:
- Gradle:
:verifyModuleBoundariesand:verifyPackageBoundaries. Apps depend oncore/*;core:relaydepends oncore:runtime, which depends oncore:runtime-api;:apps:android:plugin-apidepends on:apps:android:design. Never add an edge that reverses this direction or lets acoremodule depend on Android-only or Host-only code. - TypeScript:
@sora/protocolhas no runtime dependencies;@sora/relayimports it;@sora/weband@sora/desktoptalk to the JVM Host over HTTP/SSE and do not import server code. - Plugins: only
plugin-apianddesignare visible, and only ascompileOnly. The host is parent-first, so bundling host libraries breaks plugin loading.
Things that must stay in sync
| Change | Also update |
|---|---|
| A new or changed Host HTTP/SSE endpoint | apps/web/src/__tests__/apiContract.test.ts and the client subscriptions in hostClient.ts |
| A user-visible Android/Web string | values*/strings_*.xml or apps/web/src/i18n/{zh-CN,en}.ts (both languages) |
plugin-api or design public ABI | apps/android/plugin-api/compat/level-7.api / design/api baselines, the module changelogs, and the API-level rules |
| Third-party dependency or bundled binary | THIRD_PARTY_NOTICES.md plus the copy under apps/android/app/src/main/assets/licenses/ (byte-identical; verifyDocFacts checks it) |
| A wire-protocol frame, method, or event | packages/protocol types + validators, Kotlin RelayFrames.kt, and test vectors |
| Public behavior or user workflow | The relevant page under docs/ and, for public docs, docs-site/ in both languages |
Pull request standards
- One concern per PR. Do not mix refactors, formatting, and behavior changes.
- Conventional commits.
type(scope): summary, for examplefeat(relay): bound memory push batchesorfix(android): keep overlay after rotation. - Tests with behavior changes. Add or update the closest test; if a change genuinely cannot be tested, explain why in the description.
- Run the checks for the touched areas (see the commands above). Green CI is a precondition, not a substitute for a local run.
- No secrets, ever. No API keys, keystores,
.pemsigning keys, relay tokens, personal sessions, or.sora/caches. - Keep generated files out. Do not commit build output,
node_modules,build/, ordist/. - Document readiness. If the PR is intentionally partial, say what remains; do not leave hidden TODOs that later PRs must discover.
Release conventions
Tags drive GitHub Actions:
| Component | Tag |
|---|---|
| Android, desktop, standalone Host, and Relay | vX.Y.Z, one GitHub Release |
| Plugin API / design | plugin-api-vX.Y.Z |
| Official plugins | plugin-<module>-vX.Y.Z |
| Kotlin SDK (companion repo) | vX.Y.Z |
Android and desktop read /releases/latest for update checks. The unified workflow collects artifacts and their checksums and marks the release as Latest. Release notes live in release-notes/vX.Y.Z.md.
Contributing plugins
Plugins are the most common external contribution and follow a separate path from the monorepo:
- Copy
plugins/template/and read Plugin Overview and Quick Start. - Declare dependencies on
io.github.sadami3066.sora:plugin-api:2.0.2fromhttps://sadami3066.github.io/Sora-Maven;api()pulls in the matchingdesign. - Use
apiLevel: 7for Sora 0.1.0. SetminHostVersionto the lowest Sora version you verified. - Build, sign, and verify:
assemblePlugin→signPlugin→verifyPlugin. Never commit the private signing key. - Publish by opening a PR against
Sadami3066/Sora-Marketwith a manifest underentries/plugin/, checksums, and (optionally) previews and an icon. The market policy and PR checklist apply.
First-party plugins live in plugins/official/; personal or campus-specific plugins live in Sora-Personal-Plugins.
Documentation
docs-site/is the public bilingual documentation site (English at the root, Chinese underzh/). New public pages need both languages, atitle/description/outline: deepfrontmatter block, and root-relative internal links (/architecture/protocol,/zh/architecture/protocol).docs/holds repository-adjacent docs: user install and Relay self-hosting, plugin developer docs, architecture, and release engineering.- When code and docs disagree, fix the docs in the same PR.
Security
- Signing material and maintainer secrets live outside git, by default under
~/.config/sora/secrets/(override withSORA_SECRETS_DIR). - Report vulnerabilities privately as described in the repository
SECURITY.md; never open a public issue for a security problem.
License
Contributions are accepted under Apache-2.0.
