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

requirements.install.symposium

Requirements index · View definition

evidence Valid

Requirement

The getting-started documentation MUST tell users with a Cargo and mdBook project to install and initialize Symposium, run cargo add --dev habeas, and run cargo agents sync, reviewing the prompt to enable Habeas’s plugin. It MUST explain that the session-start hook advises the agent to run habeas setup when configuration is incomplete, how to refresh skills after updating Habeas, and how to preserve local edits when migrating from skills copied by older Habeas versions.

Rationale

The requirement is a documentation requirement. One test, tests/repository.rs#fn[getting_started_documents_symposium_setup_and_skill_migration], carries the {test} reference. It reads the real files through repository_file and checks both README.md and md/getting_started.md.

Each obligation maps to an assertion:

  • Install and initialize Symposium: the test requires the phrases cargo install symposium and cargo agents init.
  • Add Habeas and sync: it requires cargo add --dev habeas and cargo agents sync.
  • Review the prompt and enable the plugin: it requires Enable and Ask me later. The getting-started text has a paragraph telling users to choose Enable and noting that Ask me later leaves the plugin disabled.
  • Session-start hook advises habeas setup when configuration is incomplete:
    • It requires the session, hook and habeas setup phrases.
    • It requires a paragraph where the hook tells the agent to load the habeas skill before starting any work.
    • It requires the exact conditional sentence for each file: the README says “advises the agent to run habeas setup when configuration is incomplete”, and md/getting_started.md says “if configuration is missing or incompatible, it advises the agent to run habeas setup”. This pins the conditional nature of the advice.
  • Refresh skills after updating Habeas: it requires a paragraph containing both cargo agents sync and “after updating the Habeas dependency to refresh”.
  • Preserve local edits when migrating from older copied skills: it requires a single paragraph that names .agents/skills/habeas-* and local edits, and says to save customizations under “different names or elsewhere”. The paragraph must also put “Save” before “remove those old copies”, and that before “sync”. This checks the order of preserving, removing and syncing.

I read the getting-started text, and it matches these assertions. The test is a phrase-based documentation check, which is the usual way to test this kind of requirement. Several assertions are paragraph-level and order-sensitive, so a document that omits or reorders the guidance would fail them.

The test doesn’t assert the “Cargo and mdBook project” audience framing, but that is context, not a separate obligation. I found no unacknowledged gap.

Inputs

Implementation

Input 3: outline md/getting_started.md section[Getting%20started]
# Getting started

{impl}`requirements.install.symposium`
{impl}`requirements.install.symposium.skill_hook`

Start with a Cargo project that already has an mdBook (`book.toml` and a `SUMMARY.md` in the book source directory).

Install [Symposium](https://github.com/symposium-dev/symposium) and select your agents once on this machine:

```sh
cargo install symposium
cargo agents init
```

From the project directory, add Habeas and sync your agent setup:

```sh
cargo add --dev habeas
cargo agents sync
```

Run `cargo agents sync` in your terminal and choose **Enable** when Symposium offers Habeas's plugin. Its default **Ask me later** choice leaves the plugin disabled.

When an agent starts a session in this project, Habeas's hook tells it that the project tracks requirements with Habeas and to load the `habeas` skill before starting any work. The hook also checks setup: if configuration is missing or incompatible, it advises the agent to run `habeas setup`. The hook does not change project files itself.

To configure the project before starting an agent session, or if your agent is not running Symposium hooks, install the CLI and configure the project yourself:

```sh
cargo install habeas
habeas setup
```

`habeas setup` adds Habeas as a Cargo dev dependency, configures mdBook to use the installed `habeas mdbook` preprocessor, copies the badge stylesheet, creates `tests/habeas.rs`, configures the per-process collector in `.config/nextest.toml` at the Cargo workspace root, and enables the automatically generated coverage report under the requirements index. That test calls `habeas::validate()`, so normal Cargo tests check your requirements and evidence.

Once the plugin is enabled, `cargo agents sync` provides Habeas's skills to your configured agents. Run it again after updating the Habeas dependency to refresh the skills.

If you previously ran `habeas agents` or `habeas setup --install-skills`, inspect the resulting `.agents/skills/habeas-*` directories for local edits before your first Symposium sync. Save customized files under different names or elsewhere, remove those old copies, and run `cargo agents sync` to receive Symposium-managed skills.

Use the `habeas-bootstrap-requirements` skill to derive an initial set of requirements from an existing codebase and its tests. Setup does not write requirements or evidence for you. Reference a project requirement or named example on the generated `tests/habeas.rs` test and on every other first-party Rust function, including internal helpers: `{impl}` where the function implements part of a definition, `{test}` where it is designed to verify one, and `{cite}` only for related code that does neither.

Configure an authoring model using the [Bedrock or Ollama examples](./reference.md#authoring-evidence-with-a-model), then run:

```sh
habeas author --all
habeas test
cargo test --doc --workspace
```

The authoring harness assesses each requirement and example in a separate model
conversation. The supervising agent fixes reported gaps and reruns the command;
it does not compose evidence itself. CI checks the saved evidence without inference.
See [How it works](./reference.md) for the evidence index and local-checkout workflow.

Install `cargo-nextest` (>= 0.9.116) and the active toolchain's LLVM tools with
`cargo install cargo-nextest --locked` and `rustup component add llvm-tools-preview`.
Use `habeas coverage -- <nextest arguments>` for filtered runs as well as full
suite runs. Raw profiles, per-process reports and captured sources stay under
the Cargo target directory (`target/habeas/coverage/` by default), are never
committed, and disappear with `cargo clean`.

For full verification, `habeas test` collects workspace coverage and then
enforces the coverage policy. In CI, run these as separate steps, with the
second command running only after the first succeeds:

```sh
habeas coverage -- --locked --workspace
habeas coverage-check
```

Collection alone does not enforce coverage. Add both steps to the project's
workflow after installing its Habeas CLI and coverage prerequisites. Setup
configures the collector and static validation test; it does not install a CI
workflow. The bundled skills include a CI example, delivered with
`cargo agents sync` after updating Habeas.

Tests

Input 2: outline tests/repository.rs fn[getting_started_documents_symposium_setup_and_skill_migration]
  • File: tests/repository.rs
  • Selector: fn[getting_started_documents_symposium_setup_and_skill_migration]
  • Kind: fn
  • tests/repository.rs:23–90
// {test}`requirements.install.symposium`
// {test}`requirements.install.symposium.skill_hook`
#[test]
fn getting_started_documents_symposium_setup_and_skill_migration() {
    for path in ["README.md", "md/getting_started.md"] {
        let text = repository_file(path);
        for phrase in [
            "cargo install symposium",
            "cargo agents init",
            "cargo add --dev habeas",
            "cargo agents sync",
            "Enable",
            "Ask me later",
            "session",
            "hook",
            "`habeas` skill",
            "habeas setup",
            "updating",
            "local edits",
        ] {
            assert!(text.contains(phrase), "{path} omits {phrase}");
        }
        let paragraphs = text
            .split("\n\n")
            .map(|paragraph| paragraph.split_whitespace().collect::<Vec<_>>().join(" "))
            .collect::<Vec<_>>();
        assert!(
            paragraphs
                .iter()
                .any(|paragraph| paragraph.contains("hook tells")
                    && paragraph.contains("load the `habeas` skill before starting any work")
                    && paragraph.contains("session")),
            "{path}: hook must direct skill loading"
        );
        let advice = if path == "README.md" {
            "The hook also checks the project and advises the agent to run `habeas setup` when configuration is incomplete"
        } else {
            "The hook also checks setup: if configuration is missing or incompatible, it advises the agent to run `habeas setup`"
        };
        assert!(
            text.contains(advice),
            "{path}: missing conditional setup advice"
        );
        assert!(
            paragraphs
                .iter()
                .any(|paragraph| paragraph.contains("cargo agents sync")
                    && paragraph.contains("after updating the Habeas dependency to refresh")),
            "{path}: missing update/sync/refresh guidance"
        );
        assert!(
            paragraphs.iter().any(|paragraph| {
                paragraph.contains(".agents/skills/habeas-*")
                    && paragraph.contains("local edits")
                    && paragraph.contains("different names or elsewhere")
                    && paragraph
                        .find("Save")
                        .zip(paragraph.find("remove those old copies"))
                        .is_some_and(|(save, remove)| save < remove)
                    && paragraph
                        .find("remove those old copies")
                        .zip(paragraph.rfind("sync"))
                        .is_some_and(|(remove, sync)| remove < sync)
            }),
            "{path}: preserve customizations before removing copies and syncing"
        );
    }
}

Other sources

Input 1: requirements selection requirements.install.symposium
:::{req} symposium
The getting-started documentation MUST tell users with a Cargo and mdBook project to install and initialize Symposium, run `cargo add --dev habeas`, and run `cargo agents sync`, reviewing the prompt to enable Habeas's plugin. It MUST explain that the session-start hook advises the agent to run `habeas setup` when configuration is incomplete, how to refresh skills after updating Habeas, and how to preserve local edits when migrating from skills copied by older Habeas versions.
:::
Input 4: outline tests/repository.rs fn[repository_file]
// {cite}`habeas:util`
fn repository_file(path: &str) -> String {
    fs::read_to_string(Path::new(env!("CARGO_MANIFEST_DIR")).join(path)).unwrap()
}