requirements.cli.skill_structure.habeas
Requirements index · View definition
Requirement
Under
, the
habeasskill MUST be the home of routing tasks to skills,habeas statusandhabeas info, directive and reference syntax, distributed requirements, and gotchas common to every task.
Rationale
The subject has one obligation: the habeas skill must be the home of five topics. They are routing tasks to skills, habeas status and habeas info, directive and reference syntax, distributed requirements, and gotchas common to every task. The parent requirements.cli.skill_structure adds that each topic is stated in full in exactly one skill.
The only marked test is tests/authoring_cli.rs#fn[the_habeas_skill_is_home_of_routing_inspection_syntax_and_shared_gotchas]. It covers each topic as follows.
- Routing:
assert_textchecks that the## Workflowsection of thehabeasSKILL.mdcontains the| Task | Skill |table header. - Status and info: it checks that
## Inspectingmentionshabeas status [<selection>]andhabeas info <selection>. - Syntax: it checks that
## Requirements, examples, and definitionscovers{req},{example}and{definition}. It also checks that## Referencescovers writing a reference with a full name in a comment and fencing a reference. - Gotchas: it checks that
## Gotchasstates the Git-index limitation. - Distributed requirements: it checks that
references/distributed-requirements.mdhas its heading.references/syntax-details.mdis checked for the nested-chapter full-name and anchors sections. - Exactly one home:
assert_home("habeas")does two things. It uses thehome_markerslist forhabeasto assert that the wholehabeasskill,SKILL.mdplus references, contains each marker. It then asserts that none of the other four skills contains any of those markers. The markers include the routing table, the selection definition, fencing a reference to attach commentary,:::{violations}, site-query matches making a site,silently defines nothing, the longer outer fence, and the target-directory artifacts and install-prerequisites gotchas.
The assertions are real. section extracts the body of a given heading and fails if the heading is missing. assert_text and assert_home fail with messages when a phrase is absent or when another skill restates a marker. A skill that moved or dropped any of these topics, or let another skill restate a marker, would fail.
The check is phrase-based, so it cannot prove a topic is stated “in full”. That is the same level of verification the sibling home tests use, and bundled_skills_refer_to_a_topic_home_instead_of_restating_it supports it for the parent requirement. I found no input class, boundary or failure case in the subject’s text that the test leaves unexercised. No acknowledgments apply.
Inputs
Tests
Input 3: outline tests/authoring_cli.rs fn[the_habeas_skill_is_home_of_routing_inspection_syntax_and_shared_gotchas]
- File:
tests/authoring_cli.rs - Selector:
fn[the_habeas_skill_is_home_of_routing_inspection_syntax_and_shared_gotchas] - Kind:
fn tests/authoring_cli.rs:3310–3357
// {test}`requirements.cli.skill_structure.habeas`
#[test]
fn the_habeas_skill_is_home_of_routing_inspection_syntax_and_shared_gotchas() {
let raw = skill_md("habeas");
assert_text(
"routing",
§ion(raw, "## Workflow"),
&["| Task | Skill |"],
);
assert_text(
"inspecting",
§ion(raw, "## Inspecting"),
&["`habeas status [<selection>]`", "`habeas info <selection>`"],
);
assert_text(
"syntax",
§ion(raw, "## Requirements, examples, and definitions"),
&[
"fenced `{req}` directive",
"An `{example}`",
"A `{definition}`",
],
);
assert_text(
"references",
§ion(raw, "## References"),
&[
"Write a reference with a full name in a comment on the relevant source line",
"Fence a reference",
],
);
assert_text(
"gotchas",
§ion(raw, "## Gotchas"),
&["Reference discovery and authoring read only files in the Git index"],
);
assert_text(
"distributed requirements",
skill_file("habeas", "references/distributed-requirements.md"),
&["# Distributed requirements"],
);
assert_text(
"syntax details",
skill_file("habeas", "references/syntax-details.md"),
&["## Full names in nested chapters", "## Anchors"],
);
assert_home("habeas");
}
Referenced definitions
Input 2: requirements selection requirements.cli.skill_structure
requirements.cli.skill_structure:md/requirements/cli.md:444–451
:::{req} skill_structure
Habeas's bundled agent skills MUST jointly give the direction that the requirements on them specify. A skill consists of its `SKILL.md` and the files under its `references/` directory. Each topic MUST be stated in full in exactly one skill, its home.
:::
Other sources
Input 1: requirements selection requirements.cli.skill_structure.habeas
requirements.cli.skill_structure.habeas:md/requirements/cli.md:462–467
:::{req} skill_structure.habeas
Under {cite}`requirements.cli.skill_structure`, the `habeas` skill MUST be the home of routing tasks to skills, `habeas status` and `habeas info`, directive and reference syntax, distributed requirements, and gotchas common to every task.
:::
Input 4: outline tests/authoring_cli.rs fn[assert_home]
- File:
tests/authoring_cli.rs - Selector:
fn[assert_home] - Kind:
fn tests/authoring_cli.rs:3092–3105
/// Asserts that `home` states each of its markers and no other skill does.
// {cite}`habeas:util`
fn assert_home(home: &str) {
assert_phrases(home, home_markers(home));
for other in SKILLS.into_iter().filter(|other| *other != home) {
let text = bundled_skill(other);
for marker in home_markers(home) {
assert!(
!text.contains(marker),
"{other} restates {home}'s {marker:?}"
);
}
}
}
Input 5: outline tests/authoring_cli.rs fn[assert_text]
- File:
tests/authoring_cli.rs - Selector:
fn[assert_text] - Kind:
fn tests/authoring_cli.rs:3011–3016
// {cite}`habeas:util`
fn assert_text(label: &str, text: &str, phrases: &[&str]) {
for phrase in phrases {
assert!(text.contains(phrase), "{label} lacks {phrase:?}");
}
}
Input 6: 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 7: outline tests/authoring_cli.rs fn[home_markers]
- File:
tests/authoring_cli.rs - Selector:
fn[home_markers] - Kind:
fn tests/authoring_cli.rs:3040–3090
/// Phrases that state part of a topic in full, by the skill that is its home.
// {cite}`habeas:util`
fn home_markers(home: &str) -> &'static [&'static str] {
match home {
"habeas" => &[
"| Task | Skill |",
"A selection is a full name or a glob in which `*` matches any characters",
"Its full name is the chapter path relative to that directory",
"Fence a reference to attach commentary",
"`:::{violations} <name>` selects constructs likely to break it",
"Each site-query match makes a site",
"omit a leading `reqs/` and a trailing `/index` or `/README`",
"silently defines nothing",
"needs a longer outer fence such as `::::{req}`",
"Profiles, reports, and captured source under the Cargo target directory",
"Install prerequisites",
],
"habeas-requirements" => &[
"Write drafts from the request straight into the chapter",
"For each group, start a read-only subagent",
"**Gate:** no implementation or test code",
"A *root* is an item that carries out part of a requirement",
"## What the review checks",
"# Requirement group review",
"**Compound:** a requirement that lists several independent forms",
],
"habeas-evidence" => &[
"A judgment is one of three outcomes",
"`habeas author --all` assesses every definition whose evidence is missing, stale, or invalid",
"## Fixing findings",
"An item has recent coverage when it has its own reference, or when a recent version of an existing evidence record or review read it",
"A FIXME judgment, such as",
"gets a citation review. For project requirements and examples it checks that",
"For built-ins it checks their permitted forms and stated criteria",
"A site the requirement does not apply to is judged true",
"The goal is that independent assessments of the same subject reach the same determination",
"describing the change relative to the prior commit rather than the drafts that led to it",
],
"habeas-bootstrap-requirements" => &[
"every first-party runnable test or test case",
"## Proposing requirements",
"Independent recount:",
],
"habeas-refactor" => &[
"habeas refactor --dry-run",
"`--map 'src/config.rs#fn[load]=src/config/load.rs#fn[load]'`",
"\"Would leave ... unchanged\" lists records a mapping affects that fail a check",
],
_ => panic!("unknown skill {home}"),
}
}
Input 8: outline tests/authoring_cli.rs fn[assert_phrases]
- File:
tests/authoring_cli.rs - Selector:
fn[assert_phrases] - Kind:
fn tests/authoring_cli.rs:3030–3033
// {cite}`habeas:util`
fn assert_phrases(name: &str, phrases: &[&str]) {
assert_text(name, &bundled_skill(name), phrases);
}
Input 9: outline tests/authoring_cli.rs fn[bundled_skill]
- File:
tests/authoring_cli.rs - Selector:
fn[bundled_skill] - Kind:
fn tests/authoring_cli.rs:2909–2918
/// A bundled skill: its `SKILL.md` together with its reference files,
/// collapsed.
// {cite}`habeas:util`
fn bundled_skill(name: &str) -> String {
let files = skill_files(name)
.iter()
.map(|(_, text)| *text)
.collect::<Vec<_>>();
collapse(&files.join("\n"))
}