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.skill_hook

Requirements index · View definition

evidence Valid

Requirement

The getting-started documentation MUST explain that the session-start hook tells the agent to load the habeas skill.

Rationale

The sole obligation is that the getting-started documentation explains that the session-start hook tells the agent to load the habeas skill. The marked test tests/repository.rs#fn[getting_started_documents_symposium_setup_and_skill_migration] reads both README.md and md/getting_started.md through repository_file, which reads the real files. For each file it does two things:

  • It asserts that the text contains the phrases “session”, “hook” and “habeas skill”.
  • It asserts that one single whitespace-normalized paragraph contains “hook tells”, “load the habeas skill before starting any work” and “session”. That ties the hook, the session context and the skill-loading instruction together in one explanation, not as scattered words.

If either document dropped or reworded the explanation, the test would fail. The requirement has no other conditions, modes or boundaries. The test’s other assertions cover the sibling requirements.install.symposium and are not needed here. The exact-phrase checks are somewhat brittle, but they enforce the obligation. I found no gap.

Inputs

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.skill_hook
:::{req} symposium.skill_hook
The getting-started documentation MUST explain that the session-start hook tells the agent to load the `habeas` skill.
:::
Input 3: 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()
}