Contributing
Contributions are welcome. The code is at github.com/BogenTech/regnmed.
regnmed is AGPL-3.0, and the maintainer keeps the option to license on other terms. To keep that possible, every contributor must agree to the CLA before the contribution can be merged. In short, you keep the copyright, and you give the maintainer a broad licence to use, modify and relicense the contribution. You also confirm that it is your own work.
Put this line in the description of your first pull request:
I have read the CLA and agree to its terms.
Contributor offer
Section titled “Contributor offer”The CLA licence is the same for everyone. What is negotiated per contribution, by scope and value, is your own subscription to the hosted service: price (including free), plan and duration. Contact the maintainer before or after. Self-hosting is already free under the AGPL, so the offer concerns the service we actually charge for.
How it works
Section titled “How it works”- Fork and create a feature branch.
- Make the changes in small, clear commits.
- Open a pull request that says what and why.
- Include the CLA line in the first one.
Every change that goes into main is reviewed before it is merged. Each finding is fixed in the same PR or named as deliberately deferred, with the reason. A green CI is not a review.
Build and test
Section titled “Build and test”docker compose up -d # Postgres 18 on port 5433, or scripts/dev-db.shcp .env.example .envcargo run -p regnmed-cli -- migratecargo test # unit tests, no database neededcargo nextest run --workspace # the whole suite (needs DATABASE_URL), about 3.6 times fastercargo fmt --all # CI fails on cargo fmt --all --checkIntegration tests skip politely when DATABASE_URL is missing, and run for real in CI against Postgres 18. The API integration tests are grouped in crates/regnmed-api/tests/grupper/ (“grupper” = groups): a new test belongs in an existing group, not in a new file in tests/.
What requires a test in the same commit: domain invariants (money, hashing, double-entry), general-ledger immutability, access boundaries and export formats. An authorization test that has not been seen to fail is not verified.
Architecture rules you must know
Section titled “Architecture rules you must know”- Money is integer øre (
Ore(i64)), never floats. A balance is alwaysSUM(amount_ore), never stored state. - The general ledger is append-only, enforced in domain, database and cryptography.
- Migrations are append-only. Never edit an applied migration.
regnmed-corehas no I/O or database dependencies, ever.- Authorization lives in regnmed’s database, not in tokens. IdP-specific details are never baked in.
- API first. Everything a user can do is an authenticated endpoint. The CLI is for operations only.
Language rules
Section titled “Language rules”Everything internal is English. Norwegian only where a user reads it.
| Where | Language |
|---|---|
| Identifiers, database tables and columns, CLI commands, comments, test names, commit messages | English |
| Logs and error messages an operator reads | English |
| Text a user reads (the portal, error messages in the UI), prompts to a model | Norwegian |
docs/ (audit-facing) |
Norwegian |
Exceptions: applied migrations are append-only, so an existing column keeps its name, and you map it to an English field in the code. The wire format stays fixed: JSON keys (orgnr, termin, prosjekt) are pinned with #[serde(rename)] and are not changed by a refactor, since the portal and customers’ integrations read them. CLI command names are also pinned by a test (the_ops_interface_has_not_moved).
If you rename an identifier mechanically, there are tools that verify that strings, wire names and CLI surfaces are unchanged (scripts/rename-identifiers.py, scripts/wire-names.py, scripts/pin-wire.py).
- Don’t put secrets in the repo, in any form. See Self-hosting.
- Don’t edit an applied migration.
- Don’t add a new
tests/*.rsfile for a single test.