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.cli.overview_skill.routing

Requirements index · View definition

evidence Valid

Requirement

The habeas skill MUST route each kind of task to the bundled skill that covers it: design sessions and changes to behavior, code, tests, or requirement text, including renaming a code item in place, to habeas-requirements; moving code, tests, or requirements to another file, chapter, or outline node, and renaming a requirement, to habeas-refactor; creating or refreshing evidence, and fixing the findings that validation or habeas status reports, to habeas-evidence; and adopting Habeas in an existing codebase to habeas-bootstrap-requirements.

Rationale

The requirement has four routing obligations. The habeas skill must route:

  • design sessions and changes to behavior, code, tests, or requirement text, including renaming a code item in place, to habeas-requirements;
  • moving code, tests, or requirements to another file, chapter, or outline node, and renaming a requirement, to habeas-refactor;
  • creating or refreshing evidence, and fixing validation or habeas status findings, to habeas-evidence;
  • adopting Habeas in an existing codebase to habeas-bootstrap-requirements.

tests/authoring_cli.rs#fn[the_habeas_skill_routes_each_task_to_the_skill_that_covers_it] is marked {test} for this requirement. It reads the bundled habeas SKILL.md through skill_md, which uses include_str! on the real asset, and collects the markdown table rows. For each of the four skills, it looks up the table row that contains every listed task phrase and asserts that the row’s last cell equals the expected skill name.

The phrases map to the obligations as follows:

  • habeas-requirements: “A design session”, “any change to behavior, code, tests, or requirement text”, and “including renaming code in place”. This covers the in-place rename.
  • habeas-refactor: “Moving code, tests, or requirements to another file, chapter, or outline node” and “renaming a requirement”. This covers both moves and requirement renames.
  • habeas-evidence: “Creating or refreshing evidence” and “habeas coverage or habeas status reports Habeas findings”. This covers evidence creation and findings.
  • habeas-bootstrap-requirements: “Adopting Habeas in an existing codebase”.

The test does not run the task-to-skill table through a router, because the requirement concerns the skill text. Asserting the destination cell of the row for each task is therefore the right check.

A wrong destination would fail it. For example, routing the in-place rename or a requirement rename to the wrong skill changes the last cell of the matching row. Dropping a task phrase from its row fails the unwrap_or_else lookup. The extra assertion on step("habeas", 1) checks that the workflow step tells the reader to pick the skill from the table.

Two minor points do not amount to gaps:

  • The evidence row’s wording uses habeas coverage where the requirement says “validation”. These are the same findings channel, and the requirement does not fix the exact phrasing.
  • The test takes the first matching row. The requirement does not forbid duplicate rows, so this needs no extra test.

Each obligation has a test scenario with an outcome assertion, so I found no adequacy gap.

Inputs

Tests

Input 2: outline tests/authoring_cli.rs fn[the_habeas_skill_routes_each_task_to_the_skill_that_covers_it]
// {test}`requirements.cli.overview_skill.routing`
#[test]
fn the_habeas_skill_routes_each_task_to_the_skill_that_covers_it() {
    let rows = skill_md("habeas")
        .lines()
        .map(str::trim)
        .filter(|line| line.starts_with('|'))
        .collect::<Vec<_>>();
    for (task, skill) in [
        (
            &[
                "A design session",
                "any change to behavior, code, tests, or requirement text",
                "including renaming code in place",
            ][..],
            "habeas-requirements",
        ),
        (
            &[
                "Moving code, tests, or requirements to another file, chapter, or outline node",
                "renaming a requirement",
            ][..],
            "habeas-refactor",
        ),
        (
            &[
                "Creating or refreshing evidence",
                "`habeas coverage` or `habeas status` reports Habeas findings",
            ][..],
            "habeas-evidence",
        ),
        (
            &["Adopting Habeas in an existing codebase"][..],
            "habeas-bootstrap-requirements",
        ),
    ] {
        let row = rows
            .iter()
            .find(|row| task.iter().all(|part| row.contains(part)))
            .unwrap_or_else(|| panic!("no row for {task:?}"));
        let cells = row
            .split('|')
            .map(str::trim)
            .filter(|cell| !cell.is_empty())
            .collect::<Vec<_>>();
        assert_eq!(cells.last(), Some(&skill), "{row}");
    }
    assert!(step("habeas", 1).starts_with("Pick the skill for the task"));
}

Other sources

Input 1: requirements selection requirements.cli.overview_skill.routing
:::{req} overview_skill.routing
The `habeas` skill MUST route each kind of task to the bundled skill that covers it: design sessions and changes to behavior, code, tests, or requirement text, including renaming a code item in place, to `habeas-requirements`; moving code, tests, or requirements to another file, chapter, or outline node, and renaming a requirement, to `habeas-refactor`; creating or refreshing evidence, and fixing the findings that validation or `habeas status` reports, to `habeas-evidence`; and adopting Habeas in an existing codebase to `habeas-bootstrap-requirements`.
:::