Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Collaboration rules

These rules apply to every Bonk repository. A rule here wins over habit; the maintainer’s explicit decision wins over a rule here.

Language and writing

Everything written in a repository is in English: branch names, commits, pull requests, issues, identifiers, files, workflows, jobs, comments, logs and documentation. Translations meant for users are the only exception (interface texts, French README and site pages). An existing French name is renamed in the pull request that touches it, or in a pull request of its own; a name another repository reads or that is published is renamed readers first, without a break.

Write short, factual sentences. No filler, no superlatives, no marketing words. No emoji anywhere: code, interface, logs, command output, documentation, commits. A state is said in words (OK, ERROR, WARNING); interface pictograms are vector icons. No decorative symbols in documentation: no arrows, no dashes as punctuation; use a comma, a colon or a new sentence. A README has no horizontal scrolling: long commands are cut over several lines, tables have three columns at most.

Git

One working branch at a time, named type/short-topic. Everything goes through a pull request to main; nobody commits to main directly, and nobody force pushes it.

Commits follow Conventional Commits, lowercase, with a scope, in the imperative: fix(parser): reject truncated headers. Types: feat, fix, refactor, perf, test, docs, build, ci, chore, revert. The body lists the root causes fixed, the mechanisms added and the checks run. One commit is one coherent change: a refactor and a behavior change never share a commit.

After a merge, the branch is deleted on the server and locally, and the local main is brought up to date. A branch is never deleted before its pull request is merged, and unpushed work is never thrown away, without the maintainer’s agreement.

Pull requests

A pull request is merged only when every check of the repository passes on it: formatting, lint, tests, CodeQL, zizmor and actionlint, fuzzing of the format readers it touches, and the QEMU boot tests when it touches what a drive boots. Never disable, skip or relax a test, a lint rule or a threshold to get a pull request through. A failing test reveals a bug or a wrong test: prove which before touching the test.

Every fixed bug gets a regression test that failed before the fix. Every new reader of a format that comes from outside (image, archive, partition table, catalog) gets a fuzz target.

Each step names the proof it reaches. A lower level never stands in for a higher one:

  • P0: unit tests and tables of cases.
  • P1: fuzzing of every reader of outside data, corpus kept.
  • P2: end to end on an image file or a simulated disk.
  • P3: boot under QEMU, seen on the serial console.
  • P4: real hardware, by the maintainer.

Anything that writes a boot sector, a partition table or a signature needs P3 before merge and P4 before it is announced as supported.

Code hygiene

Small functions: about 50 lines at most, one responsibility each. Split to lower complexity (nesting, local variables, mixed levels of abstraction), never to reach a line count. A flat exhaustive match or a straight sequence that already delegates each step may be longer. A long test becomes a table of cases.

No god files. Split files by function and by category. Usual traps: a main that does everything, a global stylesheet that carries component styles, a utils, helpers or common module that keeps growing.

A clean tree: folders organized by domain, so the code grows and stays easy to maintain.

One rule, one implementation. A business rule is written once, in the core, and every interface (command line, window, mobile, site) uses it. The core knows no interface; an interface holds no business rule.

Data drives. Lists, choices, filters and labels that depend on content come from the data (catalog, configuration); adding an item does not require a code change. A hard-coded value exists only for an invariant.

No dead code: no unused function, module, style, script or dependency, and no versioned duplicate (v1, v2, legacy, old, new). The pull request that replaces code removes the old code. A name that designates an outside format or standard is fine.

A touched file or function that breaks these rules is split in the same pull request, or recorded as debt in docs/status.md if the split is out of scope.

Comments

The code speaks for itself through its names, types and tests. By default there is no comment. A comment exists only for what the code cannot carry: an invariant, a hardware or platform constraint, the reason for a choice that is not obvious, a reference to a public standard. One technical English sentence, no bold, list or emphasis, for example: // MBR signature, offset 510.

Not allowed: paraphrase of the code, descriptive file headers, banners or separators, numbered steps, history, commented-out code, TODO without an issue, doc comments on a function whose name and signature already say it all. Kept: SAFETY comments and the Safety and Errors sections the lints require, license headers, the reason a lint is disabled, tool directives. Comments never point to an internal document; they state the reason itself.

Engineering

No claim without proof. A diagnosis rests on facts anyone can check: logs, source code, real requests, command output, official documentation. Say what is verified, what is deduced and what is assumed. Versions, platform APIs and vendor policies change: check them at the source.

Fix the root cause. No patch that hides an error: no silent catch, no unwrap or ignore to quiet the compiler, no disabled test. When the real fix is out of scope, make the minimal fix and record the root cause as debt in docs/status.md.

Readable, decoupled, strongly typed code. Simplicity before generality: no abstraction without two real uses. As few third-party libraries and tools as possible; every new dependency is justified in the pull request (need, alternatives, maintenance, license, weight).

Validate at the boundaries (user input, network, files, system calls) and handle each failure with an explicit, logged fallback; inside, trust the types. A failed environment detection never crashes the program: it falls back to an explicit default. Detect features rather than identities (operating system, browser, user agent) whenever possible.

Platforms

Bonk runs on Linux, Windows, macOS, Android and ChromeOS. Any change that touches the system (files, disks, processes, privileges, network, hardware, windowing) is checked and implemented for every host, or the host left out is named in the pull request and in docs/status.md. Platform code lives behind a common interface.

Security

No secret in code, commits, logs or documentation: keys, tokens, passwords, certificates, real environment files. Secrets come from environment variables or a dedicated store; a versioned example file shows their names. Read the staged diff before every commit.

No destructive or irreversible action without the maintainer’s explicit agreement: deleting data, writing to a real disk or device, force pushing main, rewriting published history, an irreversible migration, publishing a release. Prefer the reversible or simulated way: image files, virtual devices, dry runs. Tests never use real data or real devices.

Report a vulnerability privately, as described in SECURITY.md, never in a public issue.

Working with the maintainer

Ask before a decision that is costly to undo: architecture, a major dependency, a data format, a public API, a deletion, a write to real hardware. Act directly on what is clear and reversible. Stay in scope; write improvements you notice along the way in docs/status.md. Say at once anything that changes the plan: a major bug, a wrong assumption, an underestimated cost, a legal or license constraint.

A requirement that is ambiguous, contradictory or impossible as written is raised in docs/status.md, under pending decisions, with the options and their cost. It is never settled silently.

A piece of work starts with a goal, checkable completion criteria, what is out of scope, and a plan in steps that each ship on their own. Ship vertically: a step works end to end, tested, before the scope grows.

A short final report says what changed, how it was checked, and what remains or blocks. No narrative of the steps.

Keeping this documentation current

Work is finished only when its documentation is. Before handing over: the work file in docs/work/ says what is done, what is left and what blocks; docs/status.md is current; a structural decision has its line in docs/decisions.md; docs/log.md has a dated entry with the checks run.