Skip to main content
hibi status looks at the claims you have. hibi cover looks the other way: at the units that should have a claim and do not.

Scopes

A scope is declared in .hibi/hibi.toml:

What counts as covered

hibi resolves every side of every live claim. A side that resolves to exactly one unit covers that unit and every unit that encloses it. So a claim on the field Config.timeout_secs also covers the struct Config and the file. The claim’s state does not matter: a stale claim still covers, because its anchor still points at the unit. Retired claims cover nothing. A unit of a scope is covered when some side covers it, excluded when it is not covered and an exclusion with that unit matches it, and uncovered otherwise. A resource matched by an exclusion without unit has no units in the scope at all.

Running cover

output
cover needs git, because it lists files with git. A repository without any scope gets the error no_scopes.

Exclusions

With the exclusions above, in a later state of the same repository where docs/retry.md ends with the sentence “See the FAQ for more.”:
output
Every exclusion is printed with its reason and what it matched, so an exclusion is never hidden:
  • An exclusion with unit matches that one unit, and counts units (“(1 unit)”). The unit is excluded only while no claim covers it. The key of a prose unit is made from its content, so when the excluded sentence changes, the exclusion stops matching and the sentence is listed again. The JSON result reports this as "matched": 0.
  • An exclusion without unit matches whole resources, and counts resources (“(1 resource)”). The scope’s line ends with “1 resource excluded”, and JSON has excludedResources. A matched resource is not read at all: its units are not units of the scope, so they appear in no count, it is never listed as unavailable, and a claim on one of its units does not show as covered in that scope. Here docs/changelog.md is such a resource, so the scope has 4 units, not 5.
Excluding a whole file is therefore the remedy for a file that cannot be read and will not become readable: a code file that does not parse, a file that is too large, or one that is not text (see fingerprints). Agree on every exclusion with the people who maintain the scope.

From an uncovered unit to a claim

In JSON, each uncovered unit carries an anchor object that can be used as the subject of hibi claim --stdin as it is:
output
Units that are identical where they stand, such as two list items with the same text in one section, have no anchor that selects one of them alone. Their anchor is null, and the text output says so under each:
output
A claim on the unit that contains them, such as the whole file, records a statement about them, but does not cover them: a claim covers its unit and the units around it, not the units inside it. To stop cover listing them, exclude each one by the key its hint names, or exclude the whole file. Not every unit states something checkable: headings, examples and opinions usually do not. Claim what can be checked against evidence. Exclude the rest with a reason, or leave it uncovered, after agreeing with the user which is right for the project. The optional judge can rank a long list of uncovered prose by how likely each unit states a checkable fact.

Units that cannot be listed

A file that matches a scope but cannot be read (not UTF-8, a code file that does not parse, a code file larger than 2 MiB or another file larger than 8 MiB, a symbolic link) or an external resource whose provider fails is listed as unavailable, with the reason. Such a resource is never counted as covered and never dropped silently. To stop reading one for good, exclude it without unit. Here docs/bad.md is not valid UTF-8 and docs/link.md is a symbolic link:
output