Contributing to Karakoram
Contribute to Apache-2.0 orchestration for MongoDB (Percona Server/PBM), RabbitMQ and Elasticsearch on Zerops.
Read architecture, ADRs, security and limitations. No Kubernetes dependencies or implied vendor/OpenEverest affiliation or endorsement.
Conduct and contribution process
Section titled “Conduct and contribution process”Follow the Code of Conduct: be respectful, critique ideas rather than people, keep discussion constructive and respect reviewers’ time. Harassment and discriminatory behavior are not accepted. Report conduct concerns to conduct@karakoram.dev; maintainers may remove content or block participants.
- Search existing issues. For changes beyond a small fix, open an issue to agree on the problem/approach; architectural changes need an ADR update.
- Create a topic branch and keep each pull request to one logical change.
- Use clear commit messages: summary, blank line, then what changed and why.
- Update affected code, callers, tests and documentation together; remove obsolete paths and run the applicable checks.
- Sign off every commit. Maintainers review pull requests and decide acceptance.
Every commit requires a Signed-off-by: Your Name <you@example.com> line under the Developer Certificate of Origin 1.1. git commit -s adds it. This certifies your right to contribute under Apache-2.0. Sign off with a known identity, a name or handle you are consistently reachable under; anonymous and bot sign-offs are not accepted.
AI/LLM-assisted contributions
Section titled “AI/LLM-assisted contributions”AI assistance is allowed. A person submits each pull request and takes responsibility for every line in it, including correctness, security and licensing, whether they typed it or a coding agent did. Automated or bot-driven pull requests and generated output that nobody reviewed are not accepted.
Reconciliation, data-safety, backup/restore and security changes carry a higher bar, because a mistake there loses or exposes data. For these, the pull request must:
- explain in your own words which failure cases the change handles and which it leaves alone;
- include tests for the failure and recovery paths, not just the path where everything works;
- say which providers and engines it was run on live and which were only tested offline (“not run live” is an acceptable answer; leaving it out is not);
- come from someone who can answer review questions about it without going back to the tool.
The maintainer may ask for a run on a disposable installation and may decline a change that can’t be verified. Karakoram itself is built this way: coding agents write much of the code, their changes are tested live and reviewed by separate review agents, and I decide what ships. Release notes say which fixes were proven against live providers and which only in tests.
Disclose meaningful AI use in the pull request: tool and purpose. Check generated material for incompatible licenses, secrets and private data. Private AI self-review is allowed; do not post AI review bots into human review threads. Maintainers may request clarification or decline contributions. This policy is adapted from Cloud Hypervisor’s guidelines.
Coding agents must also read AGENTS.md for repository layout, commands and invariants.
Development setup
Section titled “Development setup”Requirements: Go 1.26+, Make, Node 22.6+ and npm. The UI test runner uses Node’s built-in TypeScript support. Agent integration tests require Docker and Linux host networking; unit tests need no Zerops account.
make uimake buildmake testBinaries are bin/karakoram and bin/karactl. make build-all builds UI assets first. Plain Go builds without existing UI output do not embed the SPA. Build metadata uses Make’s VERSION, COMMIT and BUILD_DATE variables.
make build is for development. Publish artifacts with make release, not by copying bin/; see Releasing.
For frontend development, run npm run dev in ui/: Vite listens on 5173 and proxies API requests to localhost:8080. KARAKORAM_API_URL selects another provider; see ui/README.md. Local server configuration is defined in internal/server/config.go: use a persistent data directory, master key, public origin and real provider settings. Do not commit populated environment files or substitute fake production credentials.
Releasing
Section titled “Releasing”Maintainers release from main for major changes, security fixes or accumulated fixes—not every commit. Pushes do not automatically create tags/releases.
Versions use vX.Y.Z:
- X — milestone. Changes only for a fundamental milestone, such as moving from the current development series to stable production, after which upgrades between versions must not break existing installations.
- Y — major change. A new engine, a new provider, or a change of similar scope, including breaking changes in the development series.
- Z — patch. Fixes, security fixes, dependency and engine version bumps, and new or improved functionality within existing engines and providers. Hotfix releases always take the next Z.
Choose the version by the largest change in the release. Document breaking changes and upgrade steps in the release notes and docs/upgrade.md. Prereleases such as -rc.1 are allowed; deploy them only deliberately.
Default Zerops deploy/run configuration must remain compatible with the binary pinned in deploy/zerops/RELEASE, even on newer main. Ship binary-dependent configuration with its release or use karakoram-source. Never edit RELEASE by hand: the release tool writes its single vX.Y.Z release tag.
Prerequisites and release notes
Section titled “Prerequisites and release notes”- Development tools above, Bash, Git, GNU tar/coreutils (
date,sha256sum), gzip, OpenSSHssh-keygensupporting-Y sign/-Y verify. - Publication:
ghauthenticated with public-repository release rights; Git push rights fororigintags andmain. - Signing key:
~/.config/karakoram/release-signing-ed25519, overridden byKARAKORAM_RELEASE_SIGNING_KEY. Authorize its public key indeploy/allowed_signersforrelease@karakoram.dev; never commit the private key. - Write
NOTESoutside the checkout (or commit before preparation): changes, security fixes, upgrade steps, state-schema/rollback compatibility. Notes are not generated. Review changes and run applicable checks; release targets do not replace them. - Point the docs at the new version in the commit you release, including hotfix releases: the README status line (release link and its known-issues link, whose anchor must match the
## Known issuesheading inNOTES) and theRELEASE=example in docs/install.md. A hotfix released from a branch carries the same change back tomainwhen merged.
Tidy unreleased history
Section titled “Tidy unreleased history”Before release-prepare, squash the commits made since the previous release tag so each change lands as one reviewable commit: a fix, a feature, or a coherent docs change, with its review follow-ups, test-only fix-ups and lint clean-ups folded in. Keep separate commits for unrelated changes and for merge commits that record a released tag (for example a hotfix merged back into main).
- Only rewrite commits after the latest release tag. Never rewrite a tagged commit or anything a published release points to.
- Rewrite on a branch, compare the tree with the original (
git diff ORIGINAL TIDIEDmust be empty), then updatemainwithgit push --force-with-lease=main:ORIGINAL origin TIDIED:main. - Announce the rewrite to anyone with work based on
mainso they rebase; keep author andSigned-off-bylines.
Prepare, build, and publish
Section titled “Prepare, build, and publish”make release-prepare VERSION=v0.1.2make release-build VERSION=v0.1.2make release VERSION=v0.1.2 NOTES=../release-notes-v0.1.2.txt| Target | Requirements and result |
|---|---|
release-prepare |
Clean tree, main equal to origin/main, tag absent locally/remotely, version newer than pin. Detaches HEAD, writes pin, creates signed-off Release v0.1.2 commit and annotated tag. Local main unchanged; no push. Review commit/tag. |
release-build |
Tag must exist and pin itself; signing key required. Dry run exports tag with git archive, builds UI once, server for Linux amd64/arm64 and CLI for Linux/macOS amd64/arm64 + Windows amd64. Writes server archives (binary/LICENSE/NOTICE), raw CLI binaries, checksums.txt and SSH signature to dist/v0.1.2/; verifies signature/all checksums. No publication/push. |
release |
Clean tree, HEAD at tag, origin/main ancestor; conflicting remote tag rejected. Rebuilds, pushes tag, creates draft from NOTES, downloads every asset, compares bytes and verifies signature/checksums. Then publishes (latest, or prerelease for suffixed tags) and fast-forwards origin/main, never pinning unpublished assets. |
Rerun the same publication command after failure: unfinished drafts are recreated; published releases are re-verified before fast-forwarding main. Afterwards:
git checkout main && git merge --ff-only origin/mainReproducibility: CGO_ENABLED=0, -trimpath, -buildvcs=false, full tagged commit SHA and its UTC timestamp. Archive paths/order/owner/group/timestamps are normalized; gzip omits timestamps. Identical checksums require the exact same Go toolchain, tagged source and locked npm dependencies, not merely a compatible Go version. Inspect with go version -m <binary>.
Signing-key rotation and verification
Section titled “Signing-key rotation and verification”Commit the new public key to deploy/allowed_signers before preparing/signing with it. Retain old keys for old releases; use OpenSSH valid-after/valid-before for validity windows. Distribute trust-file updates through a trusted channel.
Verify a complete local release:
RELEASE=v0.1.2(cd "dist/$RELEASE" && ssh-keygen -Y verify -f ../../deploy/allowed_signers \ -I release@karakoram.dev -n karakoram-release \ -s checksums.txt.sig < checksums.txt && sha256sum --strict -c checksums.txt)For downloads, authenticate the signing key, verify the manifest signature, then the selected binary/archive checksum before use.
Code and change boundaries
Section titled “Code and change boundaries”| Area | Responsibility |
|---|---|
internal/server, internal/api |
Runtime wiring, strict HTTP contract, handlers and authorization |
internal/domain, internal/store |
Models, SQLite migrations, durable intent/checkpoints/events/secrets |
internal/reconciler |
Serialized lifecycle/operations, observation and cleanup |
internal/engine |
In-process engine driver registry and reconciliation/data-plane interfaces |
internal/engine/psmdb, internal/engine/psmdb/pbm |
MongoDB topology/access/TLS and PBM backup/PITR/restore |
internal/engine/rabbitmq |
Broker lifecycle, Management API access and definitions recovery |
internal/engine/elastic |
Elasticsearch/Stack lifecycle, native security and snapshot recovery |
internal/infra/zerops, internal/namespaces, internal/relay |
Zerops wire formats, project lifecycle and relay transport |
internal/agent, internal/agentapi |
Engine process supervision/rendering and private protocol |
internal/auth, internal/rbac |
Identity, sessions/tokens and policy |
internal/scheduler, internal/events, internal/monitoring |
Schedules/retention, durable activity/SSE and metrics |
internal/cli, ui/, internal/ui |
CLI, typed React application and embedded assets |
- Keep generic durability in reconciler/store; engine mechanisms stay within their engine driver; Zerops wire formats stay in the provider adapter.
- Engine driver metadata owns versions, topology constraints and UI defaults. Do not create a second CLI/UI catalog. Engine drivers are compiled in, not dynamically installable plugins.
- Perform at most one disruptive action per reconciliation step. Persist intent/checkpoints and remote identifiers before progressing, then observe completion. SQLite and remote services are not one transaction.
- Preserve agent config/control/receipt compatibility through rolling deployments. Maintenance/process holds survive restarts and pulls; ambiguous initiation is not permission to repeat destructive work.
- Engine tests must prove that an unchanged, Ready cluster submits no infrastructure mutations. Reuse
internal/engine/enginetest.AssertIdlewith the engine’s native/agent fixture: it uses the real Zerops layout and capabilities, round-trips cluster state through SQLite/JSON on every reconciliation, and requires twenty converged cycles with zero backend mutation submissions. ExplicitstartCpuvalues exercise decoded-pointer equality. Keep every supported engine/topology covered byTestIdleReconcileZeroProviderMutations; the recorder contract test guards the infrastructure mutation surface. - Ordinary status/log/event reads must remain credential-free. Preserve separate
cluster-credentials:read, per-object filtering and deny-overrides policies.
Public API changes and regeneration
Section titled “Public API changes and regeneration”- Edit api/openapi.yaml: schemas,
x-karakoram-rbac, write-only secrets and errors. - Regenerate Go server/client/RBAC and TypeScript artifacts; do not hand-edit generated files.
- Migrate handlers, CLI, UI and tests together. When CLI commands change, update the command-group table in docs/cli.md from recursive
karactl --help. - Run the contract drift check with UI dependencies installed.
From the repository root:
make generate(cd ui && npm ci && npm run gen:api)make openapi-checkGo generation uses pinned oapi-codegen 2.4.1 for internal/api/gen.go and pkg/client/client.gen.go, plus the RBAC generator for internal/api/rbacmap.gen.go. TypeScript generation writes ui/src/api/schema.d.ts using lockfile-pinned openapi-typescript. Keep handwritten public client helpers separate from generated files and independent of internal/; external consumers import pkg/client. See Clients/SDK.
make openapi-check rejects YAML aliases and regenerates/compares Go contract/client/RBAC and TypeScript files; it is a drift check, not live behavior verification. If editing introduces YAML anchors/aliases, normalize without changing meaning:
go run ./internal/tools/specnoaliasgo run ./internal/tools/specnoalias -checkgo generate ./api/...(cd ui && npm run gen:api)Normalization preserves existing component-response references; -check fails if anchors/aliases remain.
Checks
Section titled “Checks”make testmake test-integrationmake lintmake openapi-checkIntegration tests use real database containers; read their prerequisites. Skipped tests are not evidence of passing behavior. make lint runs Go vet, staticcheck 2026.2.2 and UI typecheck/ESLint; install UI dependencies first.
make test always checks that the shipped Nomad job calls only functions Nomad 2.0.7 jobspecs provide. With the Nomad 2.0.7 CLI on PATH (or KARAKORAM_NOMAD_BIN pointing at it), it also renders deploy/nomad/karakoram.nomad.hcl offline for zero and positive member_ephemeral_disk_mb and syntax-checks the volume and ACL files; without the CLI that test is skipped. Run it when changing deploy/nomad/.
Keep error strings lower-case at the start; when a product name leads the message,
rephrase it without changing the product’s capitalization. Use http.Status*
constants for HTTP status codes and remove unused test assignments without
dropping the assertions that exercise failure and recovery behavior.
Live tests are opt-in and destructive to their resources:
# Securely load KARAKORAM_E2E_URL and KARAKORAM_E2E_TOKEN first.make e2eFollow test/e2e/README.md for S3, IPv6 allowlist, CLI and OIDC settings. Use an isolated installation in a dedicated project: the suite mutates global policy/settings, so never run against production or concurrently with another live mutation suite. Do not modify the platform’s core service. Report scenarios exercised and results in the pull request.
Security and licensing
Section titled “Security and licensing”Never commit credentials, master keys, passwords, private PEMs, signed upload/log URLs or populated secret fixtures. Protect CLI configuration/state archives as credentials; use synthetic fixtures, redacted reports and no shell tracing around secrets.
New source files need SPDX-License-Identifier: Apache-2.0 and Copyright 2026 The Karakoram Authors comments. Verify incorporated code’s license compatibility and retain required headers/NOTICE attribution. Apache-2.0 grants no third-party trademark rights.
Report vulnerabilities privately through security reporting, security@karakoram.dev: include impact, revision, prerequisites and a minimal redacted reproduction, not public exploit details or secrets.