requirements.cli.distributed_guidance.site_text
Requirements index · View definition
Requirement
The bundled skills MUST direct agents to describe sites exactly as the site queries select them, to state as an obligation any convention the queries rely on, such as how a list is named, and to state only per-site obligations that a reviewer can check from the site and the helpers it calls.
Rationale
The subject has three obligations. The bundled skills must direct agents to (1) describe sites exactly as the site queries select them, (2) state as an obligation any convention the queries rely on, and (3) state only per-site obligations that a reviewer can check from the site and the helpers it calls. The one marked test is tests/authoring_cli.rs#fn[bundled_skills_describe_sites_as_queries_select_them_with_checkable_obligations]. It checks each obligation against the bundled guidance.
- Obligations 1 and 2. The test calls
section(distributed_reference(), "## Do")and asserts the text contains “Describe sites exactly as the site queries select them. When a query relies on a convention, such as how a variable is named, state the convention as an obligation”. Thesectionhelper collapses whitespace, so the phrase matches even though the Markdown source wraps across lines. The guidance inassets/skills/habeas/references/distributed-requirements.md(theDosection) contains this text. The “variable” example stands in for the requirement’s “such as how a list is named”, and the requirement presents that example only as an illustration. - Obligation 3. The test asserts the
## Don'tsection contains “Don’t describe sites more broadly than the queries select”. It also asserts that section contains “Don’t state a per-site obligation that a reviewer cannot check from the site and the helpers it calls”. The reference’sDon'tsection contains both bullets. - Where the guidance lives.
distributed_reference()is the habeas skill’s distributed-requirements reference. That is the topic home for this guidance, and the other skills refer to it rather than restating it. This is covered bybundled_skills_refer_to_a_topic_home_instead_of_restating_it, which this assessment did not review. The requirement’s “bundled skills” is therefore met by checking that home file. - Assertion strength.
assert_textusescontainsand fails with the missing phrase, so deleting or rewording either directive makes the test fail. Because the assertions target the sections that carry the directives, a phrase moved to the wrong list would also be caught.
I found no unchecked obligation, no ambiguity in the text, and no marking gap. Other tests in the file also cite the distributed guidance, but they cover different requirements.
Inputs
Implementation
Input 5: outline assets/skills/habeas/references/distributed-requirements.md section[Distributed%20requirements]/section[Don't]
- File:
assets/skills/habeas/references/distributed-requirements.md - Selector:
section[Distributed%20requirements]/section[Don't] - Kind:
section assets/skills/habeas/references/distributed-requirements.md:147–164
## Don't
- Don't describe sites more broadly than the queries select, as in "however it is
named".
- Don't state a per-site obligation that a reviewer cannot check from the site
and the helpers it calls, such as "not reported by another check", which needs
reading other sites; narrow it to the site, such as "does not report one
failure twice".
- Don't reference the distributed requirement from a site just because it is a
site; sites need none. A site review reads its site, which covers it for Rust
item coverage, but a site that is a root of another requirement gets
`{impl}` of that one, and a site that carries out one of this requirement's
other obligations, such as the function that reports the collected errors,
gets `{impl}` of this one like any other root.
- Don't re-run a false site review for a different result; fix the site, or
tighten the queries or the text, as the habeas-evidence skill's
`references/reviews.md` describes.
Tests
Input 2: outline tests/authoring_cli.rs fn[bundled_skills_describe_sites_as_queries_select_them_with_checkable_obligations]
- File:
tests/authoring_cli.rs - Selector:
fn[bundled_skills_describe_sites_as_queries_select_them_with_checkable_obligations] - Kind:
fn tests/authoring_cli.rs:4951–4969
// {test}`requirements.cli.distributed_guidance.site_text`
#[test]
fn bundled_skills_describe_sites_as_queries_select_them_with_checkable_obligations() {
assert_text(
"Do list",
§ion(distributed_reference(), "## Do"),
&[
"Describe sites exactly as the site queries select them. When a query relies on a convention, such as how a variable is named, state the convention as an obligation",
],
);
assert_text(
"Don't list",
§ion(distributed_reference(), "## Don't"),
&[
"Don't describe sites more broadly than the queries select",
"Don't state a per-site obligation that a reviewer cannot check from the site and the helpers it calls",
],
);
}
Other sources
Input 1: requirements selection requirements.cli.distributed_guidance.site_text
requirements.cli.distributed_guidance.site_text:md/requirements/cli.md:392–395
:::{req} distributed_guidance.site_text
The bundled skills MUST direct agents to describe sites exactly as the site queries select them, to state as an obligation any convention the queries rely on, such as how a list is named, and to state only per-site obligations that a reviewer can check from the site and the helpers it calls.
:::
Input 3: outline tests/authoring_cli.rs fn[section]
- File:
tests/authoring_cli.rs - Selector:
fn[section] - Kind:
fn tests/authoring_cli.rs:2929–2954
/// 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 4: outline tests/authoring_cli.rs fn[skill_file]
- File:
tests/authoring_cli.rs - Selector:
fn[skill_file] - Kind:
fn tests/authoring_cli.rs:2899–2907
/// 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
}