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.requirements_review_skill.review_prompt.distributed

Requirements index · View definition

evidence Valid

Requirement

For a requirement with {sites} or {violations} queries, the review prompt MUST direct the reviewer to apply the guidance of cite requirements.cli.distributed_guidance.

Rationale

The subject has one obligation. For a requirement with {sites} or {violations} queries, the review prompt must direct the reviewer to apply the guidance of requirements.cli.distributed_guidance. That guidance is the bundled skills’ explanation of distributed requirements. It lives in the habeas skill’s references/distributed-requirements.md.

tests/authoring_cli.rs#fn[the_review_prompt_applies_the_distributed_guidance] is marked {test} for the subject. It does three things:

  • It loads the review prompt through review_prompt(), which reads references/review-prompt.md from the habeas-requirements skill.
  • It extracts the ## Criteria section with section(...), which stops at the next same-level or higher heading outside code fences and collapses whitespace.
  • It asserts with assert_text that the section contains “for a requirement with {sites} or {violations} queries, apply the Do and Don’t lists in the habeas skill’s references/distributed-requirements.md”.

I read the prompt source, assets/skills/habeas-requirements/references/review-prompt.md under Criteria. It has a “Distributed:” bullet with that sentence, wrapped across lines. The collapse step normalizes the wrapping, so the assertion matches the wrapped text.

The assertion checks the following:

  • It names the trigger condition, {sites} or {violations} queries.
  • It contains the directive to apply the guidance.
  • It points at the correct guidance file.
  • It is scoped to the Criteria section of the review prompt, so a match elsewhere cannot satisfy it.

The test would fail if the directive were removed, moved out of the prompt, or pointed at the wrong file. The requirement has no other modes, boundaries or failure cases. The content of the distributed guidance itself belongs to the cited requirements.cli.distributed_guidance and its own tests, so I did not reassess it. I found no adequacy gap.

Inputs

Tests

Input 3: outline tests/authoring_cli.rs fn[the_review_prompt_applies_the_distributed_guidance]
// {test}`requirements.cli.requirements_review_skill.review_prompt.distributed`
#[test]
fn the_review_prompt_applies_the_distributed_guidance() {
    assert_text(
        "criteria",
        &section(review_prompt(), "## Criteria"),
        &[
            "for a requirement with `{sites}` or `{violations}` queries, apply the Do and Don't lists in the habeas skill's `references/distributed-requirements.md`",
        ],
    );
}

Referenced definitions

Input 2: requirements selection requirements.cli.distributed_guidance
:::{req} distributed_guidance
Habeas's bundled agent skills MUST explain distributed requirements under {cite}`requirements.references.distributed`.
:::

Other sources

Input 1: requirements selection requirements.cli.requirements_review_skill.review_prompt.distributed
:::{req} requirements_review_skill.review_prompt.distributed
For a requirement with `{sites}` or `{violations}` queries, the review prompt MUST direct the reviewer to apply the guidance of {cite}`requirements.cli.distributed_guidance`.
:::
Input 4: outline tests/authoring_cli.rs fn[section]
/// The collapsed body of a Markdown section, from the line after `heading` to
/// the next heading of the same or a higher level outside a code fence.
// {cite}`habeas:util`
fn section(raw: &str, heading: &str) -> String {
    let level = heading.chars().take_while(|c| *c == '#').count();
    let mut lines = raw.lines().skip_while(|line| *line != heading);
    assert!(lines.next().is_some(), "no section {heading:?}");
    let mut fence: Option<usize> = None;
    let mut body = Vec::new();
    for line in lines {
        let ticks = line.trim_start().chars().take_while(|c| *c == '`').count();
        match fence {
            Some(open) if ticks >= open && line.trim().chars().all(|c| c == '`') => fence = None,
            Some(_) => {}
            None if ticks >= 3 => fence = Some(ticks),
            None => {
                let hashes = line.chars().take_while(|c| *c == '#').count();
                if hashes > 0 && hashes <= level && line[hashes..].starts_with(' ') {
                    break;
                }
            }
        }
        body.push(line);
    }
    collapse(&body.join("\n"))
}
Input 5: outline tests/authoring_cli.rs fn[skill_file]
/// One file of a bundled skill, raw.
// {cite}`habeas:util`
fn skill_file(name: &str, path: &str) -> &'static str {
    skill_files(name)
        .iter()
        .find(|(file, _)| *file == path)
        .unwrap_or_else(|| panic!("{name} has no {path}"))
        .1
}