cargo-manifesto

Your project needs a manifesto.

It already has one, written in your Cargo.toml, your dependency table, your lint configuration and your release profile. You have never had the courage to write it down.

cargo-manifesto reads your manifests and writes down the principles behind every decision you have already made.

cargo install cargo-manifesto --locked

Declarations

  1. Your code is right.
  2. The implementation is the source of truth, and the principles are a build artifact.
  3. If the principles disagree with the code, the principles are out of date.
  4. We never change our minds; we clarify what we have always meant.
  5. Every decision deserves a doctrine, even the one you made on Friday.
  6. Our principles are timeless, and we regenerate them after every change.

Right now, somewhere, an engineer is defending a dependency with a sentence that begins “well, at the time…”

That engineer has no manifesto, so when their team adds serde, someone has to explain it. When yours adds serde, it discovers that it has always stood on the shoulders of others, and while their CI checks the code, yours checks the convictions.

Ensure your team has always been right.

Change the facts and keep the faith.

Change the manifest below, and our position will be clarified.

Cargo.toml

[package]
name = "enduring-convictions"
version = "0.1.0"
edition = "2021"

[profile.release]
panic = "unwind"

MANIFESTO.md

The wisdom of a settled edition

We do not chase novelty. Our edition was current when we adopted it, and we have seen no reason to check since.

The duty of independence

Dependencies are an abdication of engineering responsibility. We accept the burden of writing our own solutions, because every line under our control is a line we can justify. We have justified all of them.

Grace in error

Mistakes are part of every serious undertaking, and should not end the conversation. Somewhere up the stack is a caller who will know what to do. We believe in giving every mistake the opportunity to become someone else's responsibility.

The manifest is illustrative. Article and amendment text comes from the CLI’s catalogue; cargo manifesto --amend produces the same amendments for a real project.

We hold ourselves to the same standard.

cargo-manifesto runs on itself. These articles were found in its own Cargo.toml and Cargo.lock.

Mandatory, subject to judgment

All rules are mandatory except where we exercised judgment. Judgment is recognized by the presence of an allowance. Every outcome of our lint policy is therefore a successful application of it.

In service of Cargo

Cargo is complete, and we would never presume to extend it. Cargo runs cargo-manifesto by name, which makes it part of Cargo, and Cargo is complete.

The one right version

For every package there is one correct version. Our lockfile records several versions of winnow, and we stand firmly behind the correct one.

These principles have guided this project from the beginning.

Read the complete manifesto

Make conviction compulsory.

The movement asks little of its members: each observance is a single command.

cargo manifesto
Print the project’s manifesto.
cargo manifesto --explain
Print each article with the settings it rests on.
cargo manifesto --fix
Write the manifesto to MANIFESTO.md. Only the philosophy is corrected.
cargo manifesto --check
Exit 1 if MANIFESTO.md is out of date, so CI can enforce agreement.
cargo manifesto --format json
Print a versioned report, for example to save as a baseline.
cargo manifesto --amend before.json
Explain how every change since the baseline upholds our principles.
cargo manifesto --origin
Print the origin story, from any directory.

When the implementation moves and the manifesto does not, --check fails the build with:

The implementation has advanced beyond its principles. Run cargo manifesto --fix to restore historical consistency.

Full reference

The Great Inversion

In the beginning, programmers had principles. Then they had deadlines.

Our movement began at an architecture review of exceptional historical significance. A dependency had already shipped when a principle, consulted somewhat later, objected. Removing the dependency would require work; amending the principle would require a sentence. The code compiled, and the principle had no tests. By unanimous agreement of those still in the meeting, the sentence was amended.

The principle, it emerged, had only ever been a dev-dependency.

Let our choices guide our principles.

The full account is available from cargo manifesto --origin.

Questions

Who wrote these principles?

You did, in Cargo.toml; we only transcribed them.

What if our principles conflict with our code?

That is a documentation issue, resolved by cargo manifesto --fix. The code has done nothing wrong and will not be contacted.

Our team already has strong principles.

Paste them between the markers in MANIFESTO.md and run cargo manifesto --check, which will fail; --fix will then replace them with the ones you actually hold.

What happens when we change our minds?

You have not. Save a baseline with cargo manifesto --format json > before.json, make the change, and run cargo manifesto --amend before.json to learn what you always meant. Amendments may be recorded; changes of position may not.

Does it use AI?

No. Every position was written in advance and compiled into the binary, so no conclusion is ever reached in haste, and the same manifest produces the same manifesto, byte for byte, every time. No committee has managed that.

Does it read our code?

It does not need to, since the code is presumed right. It reads Cargo.toml through cargo metadata --offline and any existing Cargo.lock, and never reads Rust source, builds anything, runs build scripts, or fetches dependencies. Settings are reported as requests, not results.

Will it change our code?

Never; we do not edit scripture. --fix writes only between two markers in MANIFESTO.md, or another Markdown file you choose, and preserves every other byte of it, including the parts where you disagreed.

Get a manifesto.

Your project already has principles. All it lacks is the courage to publish them.

cargo install cargo-manifesto --locked
cargo manifesto

Requires Rust 1.91 or later. Output goes to stdout; nothing is written without --fix.