This page is docs/DEVELOPERS.md in the repository. The repository copy is the source; this is the same text with its links rewritten for the wiki.
Working on VeilVoice: the shape of the repository
This is the developer's way in. It is not the user guide (docs/USER_GUIDE.md) and not the reference (a page for every crate and every file, in the wiki and on the website). It is the part in between: what is where, what the build will refuse to let you do, and which file to open for the change you came to make.
If you are reading this to work out whether you can understand this codebase without asking anybody: that is what it is for, and so is the rest of the documentation. Every claim below is generated from the tree, so it cannot describe a repository that no longer exists.
Two programs, one engine
veilvoice is the command line and veilvoice-gui is the window. They are the only two binaries, and both are built from the same crates: the window is not a wrapper around the command line, and neither shells out to the other. What each one has that the other does not, and why, is docs/COMMANDS.md.
The verifier is folded into both rather than shipped as a third binary, so a release is checked by the program it ships beside. crates/veilvoice-verify/src/lib.rs says what that cost and why it was worth it.
The crates
Read from Cargo.toml and each crate's own manifest, with the functional line count from the tool that measures it. Each crate's own README.md is the expansive version: what it is for, what depends on it, and what depending on it commits you to.
| Crate | What it is | Lines | Detail |
|---|---|---|---|
fuzz | - | 165 | fuzz/README.md |
veilvoice-audio | Real-time capture and playback (cpal), lock-free ring buffers, virtual-cable routing and file import for VeilVoice. | 3,096 | crates/veilvoice-audio/README.md |
veilvoice-cli | Command-line interface for VeilVoice: anonymise files, scramble a microphone live, strip metadata, encrypt recordings. | 7,254 | crates/veilvoice-cli/README.md |
veilvoice-conversation | Several speakers in one recording: who spoke when, a distinct voice for each, names, and subtitles. | 2,676 | crates/veilvoice-conversation/README.md |
veilvoice-core | Irreversible voice de-identification DSP engine: cryptographically-modulated pitch/formant scrambling with preserved intelligibility. | 3,141 | crates/veilvoice-core/README.md |
veilvoice-crypto | Argon2id KDF, X25519+ML-KEM-768 hybrid KEM, XChaCha20-Poly1305 at-rest encryption and page-locked amnesic secrets for VeilVoice. | 8,830 | crates/veilvoice-crypto/README.md |
veilvoice-guard | Integrity manifest and tamper detection for VeilVoice's own files, with best-effort attribution of what changed them. | 2,955 | crates/veilvoice-guard/README.md |
veilvoice-gui | egui/eframe front-end for VeilVoice: Tokyo Night, monospace, three modes. | 24,627 | crates/veilvoice-gui/README.md |
veilvoice-meta | Strip or spoof identifying metadata: audio tags, and image EXIF/GPS. | 814 | crates/veilvoice-meta/README.md |
veilvoice-policy | Settings that can only be tightened, sealed with the project's own post-quantum cryptography. | 1,689 | crates/veilvoice-policy/README.md |
veilvoice-setup | Per-user installation and companion-software detection, shared by the command line and the desktop app. | 3,033 | crates/veilvoice-setup/README.md |
veilvoice-verify | Verify a VeilVoice release without GnuPG installed | 9,951 | crates/veilvoice-verify/README.md |
veilvoice-video | A watchable version of a veiled conversation: a waveform, a circle per speaker, subtitles, and an honest account of what needs ffmpeg. | 6,138 | crates/veilvoice-video/README.md |
veilvoice-watch | Detect which applications are currently using the microphone and camera, with alerts on change. | 3,952 | crates/veilvoice-watch/README.md |
The same crates, drawn as a graph of what calls what, are on each crate's page in the reference. Those pages are generated from the doc comments, so they are as current as the code.
Where to start, by what you came to change
Change what the veiling does to a voice
crates/veilvoice-core/src/chain.rs
The engine. Deidentifier::process is the whole of it: one block in, one block out, no allocation and no locking. Read the module comment before changing a number in it, because several of them are load bearing for the claim that the result cannot be inverted.
Add or change a command
crates/veilvoice-cli/src/main.rs
The Command enum is clap's tree and the program's own list in one place. A new variant needs a module beside it, a section in docs/COMMANDS.md through tools/docs/commands.py, and nothing else: two tests will tell you the rest.
Add or change a tab in the window
crates/veilvoice-gui/src/app.rs
enum Tab and Tab::ALL decide what the strip shows, and Tab::key names the screenshot and the anchor. Everything that counts the tabs, photographs them or documents them reads those three, so adding one is one edit and a capture run.
Change what a recording is sealed with
crates/veilvoice-crypto/src/container.rs, crates/veilvoice-crypto/src/hybrid.rs
The container format and the X25519 plus ML-KEM combiner. Any change here changes files people already have, so the format carries a version and the readers accept the old one.
Change the app lock
crates/veilvoice-crypto/src/lock.rs, crates/veilvoice-gui/src/security.rs
The stored verifier and the rate limit are in the first; the screen and the session passphrase are in the second. Both carry the same paragraph about what the lock is worth, and it is printed to the user rather than only written here.
Change the Studio, the vault or a take
crates/veilvoice-gui/src/studio.rs, crates/veilvoice-gui/src/vault_store.rs
Veiling and recording are one session with two halves; the vault is sealed with both passphrases and opens with neither alone.
Change what the monitor can see
crates/veilvoice-watch/src/lib.rs
Six observers behind one interface, each of which says what it cannot see on the platform it is running on. An empty list from a blind observer is never presented as good news, and that rule is the reason this crate exists rather than a function.
Change the website or the documentation
docs/WEBSITE.md, tools/verify.py
Nothing in website/ or docs/files/ is written by hand. The first says which script owns which page; the second runs all of them in dependency order and then checks the result.
Work out why a build is red
tools/verify.py, .github/workflows/ci.yml
python tools/verify.py --quick runs everything except the three cargo steps, which is where nearly all the surprises are: a generated file left behind by a commit that added a source file.
The rules, and why they are rules
The long version is docs/CONTRIBUTING.md. These are the ones that will stop a change getting in.
No unsafe, anywhere. Every crate carries #![forbid(unsafe_code)]. It is a publicly stated promise and it is load bearing: it is why a memory-safety claim about this program is checkable rather than a matter of trust. A feature that needs unsafe is a feature this project does not have, and two of them are named on the roadmap for exactly that reason.
Nothing in a realtime path allocates, locks or prints. An audio callback runs on the operating system's audio thread with a deadline of a few milliseconds. Every buffer is sized before the stream starts, and try_lock and try_push are the only forms used. A test reads the callbacks themselves and fails naming the line.
A dependency says what it is for, on the line that declares it. One sentence, at the moment the decision is made. If there is no sentence to write, that is the answer: it does not go in.
Where a fact exists twice, one copy is derived or checked. A version number comes from Cargo.toml, a line count from the tool that counts, a list of binaries from the job that publishes them. Anything that cannot be derived is checked in CI, so drift fails a build rather than being found by a reader.
A change is not finished until everything describing it has changed. The source, the doc comments, the generated documentation, the wiki, the website, the README, the guides, the roadmap, the packaging, the recorded sessions and the search index. The one exception is a record of the past: CHANGELOG.md and docs/AUDIT.md say what happened.
Every behavioural change carries a regression test. And a fix carries its write-up in docs/AUDIT.md, which is where the reasoning behind a guard is kept so that the next person does not remove it as unnecessary.
What a build enforces, and which file enforces it
Each of these is a script that fails a build and names the line. They are listed from the scripts themselves, so a guard added to tools/audit/ appears here without anybody remembering to write it down.
| Guard | What it will not let you do |
|---|---|
tools/audit/actions.py | Every GitHub Action a workflow runs is pinned to a commit, not to a tag |
tools/audit/authorship.py | Every commit is tilas01's in both of its fields, names no assistant, and is signed |
tools/audit/build_output.py | No build output lives inside this repository except where it is expected |
tools/audit/build_prerequisites.py | What a fresh machine needs before it can build this, said once |
tools/audit/cargo_installs.py | A tool a workflow installs with cargo is named at a version |
tools/audit/checkout_tokens.py | A checkout that never pushes does not keep the token |
tools/audit/crate_tables.py | Every crate in the workspace appears in every table that lists the crates |
tools/audit/dependabot.py | Every manifest in this tree is covered by a Dependabot entry, aimed at main |
tools/audit/dependencies.py | Every dependency says what it is for, where it is declared |
tools/audit/documented.py | Every item on a generated page has something written under it |
tools/audit/features.py | Every feature selection a release builds is built here too |
tools/audit/fixtures.py | A file the build needs is in the commit, not merely on the machine that wrote it |
tools/audit/hidden_text.py | No tracked file carries text a reader cannot see |
tools/audit/job_limits.py | Every job in every workflow says how long it is allowed to take |
tools/audit/network_claims.py | The manual names every command that reaches the network |
tools/audit/network_wording.py | No sentence a reader sees may claim more about the network than is true |
tools/audit/platform_table.py | The table of what runs where says what the release workflow actually builds |
tools/audit/powershell.py | No PowerShell function adds to a script's variable and keeps the result to itself |
tools/audit/publishing.py | The step that publishes a release says which commit it is publishing |
tools/audit/randomness.py | Every random number this project draws comes from a cryptographic source |
tools/audit/reachable.py | Every public item is named by something other than its own declaration |
tools/audit/release_targets.py | The updater asks for an archive the release workflow actually builds |
tools/audit/rsa_usage.py | No crate reaching pgp may gain an RSA private-key code path |
tools/audit/state_paths.py | Find state files that one part of VeilVoice writes and another reads |
tools/audit/tables.py | Every row of a Markdown table has as many cells as its heading says |
tools/audit/top_permissions.py | No workflow grants a write permission to every job at once |
tools/audit/wiki_publish.py | A wiki with no repository behind it skips the publish, and does not fail it |
tools/audit/wording.py | Every sentence a person reads is spelt, built and pitched the way a careful |
tools/audit/workflows.py | The workflows and the Dependabot configuration pass zizmor, and stay hardened |
Every one of them was written after something got through. The reasoning is in docs/AUDIT.md under a finding number, which is worth reading before deciding a guard is unnecessary.
Running the checks
One command runs the lot, in dependency order, and then verifies its own output:
python tools/verify.py # everything
python tools/verify.py --quick # everything but the three cargo steps
python tools/verify.py --check # verify, regenerate nothing
--quick is the one to run before a push that touches no Rust. The three it skips are the slowest and almost never the failures:
- formatting:
cargo fmt --all --check - clippy:
cargo clippy --workspace --all-targets - tests:
cargo test --workspace
What it regenerates, in the order it has to:
- measured numbers:
python tools/measured/generate.py - workflow hardening:
python tools/audit/workflows.py --fix - artwork:
python assets/generate.py - release cards:
python tools/release/card.py - screenshot borders:
python tools/shots/crop.py - screenshot height:
python tools/shots/fit.py - screenshot corners:
python tools/shots/round.py - screenshot sizes on the pages:
python tools/shots/attrs.py - terminal drawings:
python tools/shots/terminal.py - documentation:
python tools/docs/generate.py - every command, and its place in the window:
python tools/docs/commands.py - the developer guide:
python tools/docs/developers.py - per-program guides:
python tools/docs/guides.py - wiki landing and documents:
python tools/docs/wiki.py - demonstration data:
python tools/site/demo.py - website source pages:
python tools/docs/sources.py - the wiki on the website:
python tools/site/wiki_site.py - section pages:
python tools/site/split.py - roadmap page:
python tools/site/roadmap.py - questions page:
python tools/site/faq.py - releases page:
python tools/site/releases.py - addresses and the sitemap:
python tools/site/seo.py - per-file graphs:
python tools/graphs/generate.py - search index:
python tools/search-index/generate.py
And what it then checks:
- every copy of the version agrees with Cargo.toml:
python tools/release/version.py --check - every package installs what the workspace builds:
python tools/release/packaging.py - the newest release notes can be built from the changelog:
python tools/release/notes.py --check - no state file is written one place and read another:
python tools/audit/state_paths.py - every dependency says what it is for:
python tools/audit/dependencies.py - every public item is reached by something:
python tools/audit/reachable.py - every crate appears in every table that lists the crates:
python tools/audit/crate_tables.py - no build output lives outside the one directory at the root:
python tools/audit/build_output.py - every argued-for surviving mutant is still about the code it names:
python tools/mutants/check.py --lint - the comparison against the campaign objects to what it says it does:
python tools/mutants/check.py --self-test - every manifest is covered by a Dependabot entry:
python tools/audit/dependabot.py - the Dependabot guard notices where a bump would land:
python tools/audit/dependabot.py --self-test - every feature selection a release builds is still declared:
python tools/audit/features.py - no crate reaching pgp performs a private-key operation:
python tools/audit/rsa_usage.py - every random draw comes from the OS CSPRNG:
python tools/audit/randomness.py - every action a workflow runs is pinned to a commit:
python tools/audit/actions.py - every workflow job says how long it may take:
python tools/audit/job_limits.py - that guard catches a job with no limit:
python tools/audit/job_limits.py --self-test - no workflow grants a write to every job:
python tools/audit/top_permissions.py - that guard catches a write at the top level:
python tools/audit/top_permissions.py --self-test - a checkout that never pushes does not keep the token:
python tools/audit/checkout_tokens.py - the checkout guard reads the shapes it is meant to:
python tools/audit/checkout_tokens.py --self-test - the CodeQL findings list reads SARIF as it should:
python tools/repo/sarif_summary.py --self-test - every tool a workflow installs with cargo is at an exact version:
python tools/audit/cargo_installs.py - that guard reads the shapes it is meant to:
python tools/audit/cargo_installs.py --self-test - no PowerShell function keeps a script variable's change to itself:
python tools/audit/powershell.py - that guard catches what it claims to, as well:
python tools/audit/powershell.py --self-test - zizmor finds nothing in the workflows:
python tools/audit/workflows.py - that guard refuses a silent exception:
python tools/audit/workflows.py --self-test - no tracked file hides text from its reader:
python tools/audit/hidden_text.py - that guard catches every hidden class:
python tools/audit/hidden_text.py --self-test - the prose is spelt, worded and finished properly:
python tools/audit/wording.py - the wording guard catches what it claims to:
python tools/audit/wording.py --self-test - the release step tags the commit it built:
python tools/audit/publishing.py - a wiki that does not exist yet skips the publish, not fails it:
python tools/audit/wiki_publish.py - that guard catches what it claims to, too:
python tools/audit/wiki_publish.py --self-test - every file the build reads is in the repository:
python tools/audit/fixtures.py - that guard catches what it claims to:
python tools/audit/fixtures.py --self-test - every table row fits its heading:
python tools/audit/tables.py - that guard catches what it claims to:
python tools/audit/tables.py --self-test - every commit to push is tilas01's, and so is the next one:
python tools/audit/authorship.py - the authorship guard catches what it claims to:
python tools/audit/authorship.py --self-test - a signing key from the environment signs the next commit:
python tools/repo/signing.py --self-test - the branch tidier reads a fresh clone's branches:
python tools/repo/tidy.py --self-test - the updater can ask for every release that is published:
python tools/audit/release_targets.py - that guard catches what it claims to, too:
python tools/audit/release_targets.py --self-test - the manual's platform table says what the workflow builds:
python tools/audit/platform_table.py - that guard catches what it claims to, as well:
python tools/audit/platform_table.py --self-test - the app-manifest tooling works:
python tools/sign/selftest.py - the Windows installer tooling works:
python tools/package/msi.py --self-test - the Store package's manifest and icons are complete:
python tools/package/msix.py --self-test - the Store and package icons are the right sizes:
python tools/package/icons.py --self-test - the winget manifests are written from the signed hash list:
python tools/package/winget.py --self-test - artwork matches its generator:
python assets/generate.py --check - the release cards match CHANGELOG.md:
python tools/release/card.py --check - no screenshot has a capture border:
python tools/shots/crop.py --check - no screenshot has empty space below its content:
python tools/shots/fit.py --check - screenshots have rounded corners:
python tools/shots/round.py --check - every screenshot tag matches its file:
python tools/shots/attrs.py --check - terminal drawings match their output:
python tools/shots/terminal.py --check - the build a capture is compared against is of this tree:
python tools/shots/terminal.py --self-test - the witnessed session asks for a version that exists:
python tools/shots/sessions.py --self-test - recorded sessions match the programs:
python tools/shots/sessions.py --check - the window captures are of this version:
python tools/shots/taken.py --check - documentation matches the source:
python tools/docs/generate.py --check - per-program guides match the user guide:
python tools/docs/guides.py --check - the wiki matches the documents, and every link in it resolves:
python tools/docs/wiki.py --check - website source pages match their files:
python tools/docs/sources.py --check - every published item says what it is for:
python tools/audit/documented.py - the build prerequisites are said the same way everywhere:
python tools/audit/build_prerequisites.py - that guard catches what it claims to as well:
python tools/audit/build_prerequisites.py --self-test - the manual names every command that reaches the network:
python tools/audit/network_claims.py - that guard catches what it claims to, including the case it got wrong first:
python tools/audit/network_claims.py --self-test - every command is documented, and its window location exists:
python tools/docs/commands.py --check - the developer guide matches the tree:
python tools/docs/developers.py --check - the website's wiki matches the wiki:
python tools/site/wiki_site.py --check - section pages match index.html:
python tools/site/split.py --check - the roadmap page matches ROADMAP.md:
python tools/site/roadmap.py --check - the demonstration matches the source:
python tools/site/demo.py --check - the window bundle is of this window:
python tools/site/window.py --check - the window bundle's staleness check catches its cases:
python tools/site/window.py --self-test - the questions page matches docs/FAQ.md:
python tools/site/faq.py --check - the releases page matches CHANGELOG.md:
python tools/site/releases.py --check - every page says where it lives, and the sitemap lists it:
python tools/site/seo.py --check - every crate's and file's graph is current:
python tools/graphs/generate.py --check - the graphs read renames, fixes and releases right:
python tools/graphs/generate.py --self-test - search index matches the tree:
python tools/search-index/generate.py --check - measured numbers match the tree:
python tools/measured/generate.py --check - the line counter is right about what a line is:
python tools/loc/count.py --self-test - website suites:
node tools/site-tests/run.js - the local site serves every page:
python tools/site/serve.py --check
The comments
The comments are the documentation, literally. tools/docs/generate.py reads every //! and /// in the workspace and writes a page per crate and per file from them, into docs/files/, into the GitHub wiki and into website/reference/. A module comment is the top of a published page; a function comment is an entry on it.
So a comment removed is a page that loses a paragraph, and a comment rewritten to be shorter is a page that says less. The ratio of comment to code here is deliberately high and is not a defect to be cleaned up. Where a comment explains why a number is what it is, or why an obvious alternative was refused, it is usually recording a defect that was found the hard way and is written up in docs/AUDIT.md under a finding number.
Add to them rather than replacing them. If a comment has become wrong, the fix is to say what is true now, in the same detail, in the same commit as the change that made it wrong.
Where to read next
docs/CONTRIBUTING.md: building, the house style, and what a change has to pass.docs/COMMANDS.md: every command, and the same job in the window.docs/WEBSITE.md: both editions of the site and the script that writes each page.docs/AUDIT.md: every defect found and fixed, in order, which is the fastest way to learn what this code is careful about.docs/USING_THE_CRATES.md: depending on one of these crates from your own project.ROADMAP.md: what is done, what is next, and what is deliberately not being done.
This page is also Doc-DEVELOPERS in the GitHub wiki, and both are generated from the same document in the repository.