docs← Back to article

Markdown for LLMs

Catalogs and discovery

The source Markdown for this article. Copy it into your assistant or download it as a text file.

Download this articlePlain text ↗
# Catalogs and discovery

Finding something in the corpus is a separate skill from evaluating it.
Three discovery surfaces cover three needs: clients browse packages,
authors query structure, and everyone reads the generated format reference.

Confirmation marks in parentheses, such as (S) or (I), follow the
[legend on the topic index](/corpus/#how-this-topic-marks-confidence).

## Client discovery over the tool protocol

Clients that speak the tool protocol discover packages through three tools:
one lists packages with signatures and coverage bounds, one searches by
meaning across predicates, rules, and source fragments, and one runs
structural queries with paging. The search step returns addresses — what to
ask next — not answers. The applicability of a norm never follows from
text similarity. **Available in the public release** (S).

Start at [MCP tools](/guide/mcp-tools/) for the tool shapes and paging
envelopes.

## Structural discovery with named questions

The structural query surface ships a catalog of named questions and checks.
The six questions carry parameter lists, which is what selects them from
the full listing (run from a source checkout):

```text
$ ./law query --list | grep -E '\(node|\(pkg|\(predicate|\(type'
anchors-of (node, pkg) — На какие закреплённые фрагменты опирается узел — акт, локатор и фрагмент каждого якоря.
imports-of (pkg) — Что импортирует пакет — имена импортированных пакетов и их закреплённые semanticHash.
links-of (node, pkg) — Все типизированные связи узла по отношению links — produces, reads, anchored, alias, subtype.
producers (predicate, pkg) — Кто производит предикат в пакете — правила с этой головой, их сила, полярность и якоря.
readers (predicate, pkg) — Кто читает предикат — литералы тел правил, норм и ограничений (головы исключены: их перечисляет producers); pkg может быть глобом, тогда видно чтение из других пакетов.
type-step (type, pkg) — Один шаг цепочки типов субъекта — alias или subtype от названного типа к цели; следующий шаг — тот же вопрос с полученным to и пакетом цели.
```

The descriptions are printed in Russian. In English, in listing order:
`anchors-of` — the pinned fragments a node rests on (act, locator,
fragment); `imports-of` — the packages a package imports and their
pinned `semanticHash`; `links-of` — a node's typed links (produces,
reads, anchored, alias, subtype); `producers` — the rules that derive a
predicate, with strength, polarity, and anchors; `readers` — the rule,
norm, and constraint bodies that read a predicate (a glob in `pkg` shows
reads from other packages); `type-step` — one alias-or-subtype step of
a type chain. The full table is on the
[worked solutions page](/corpus/lab/solutions/#structure-answers).

In practice: `producers` finds who derives a predicate, `readers` finds who
consumes it (across packages when given a glob), `type-step` walks one
alias-or-subtype step, and the `*-of` family reports anchors, imports, and
typed links. A live listing shows 22 entries: these 6 questions and
16 lint checks that the `audit` command runs as its form section.
The question catalog itself is the stable discovery surface (S). The
runner `./law query` **requires a source checkout**: it is absent from
the public composition and needs the checkout launcher (see
[Before you start](/corpus/lab/#before-you-start)).

The structural layer offers equality and membership only — no arithmetic,
ordering, recursion, or free negation — and every row carries the identity
of the compiled node it came from. Start at the [LawQL
reference](/lawql/) for relations, functions, and the inference layer.

## The generated format reference

The [schema catalog](/protocols/schemas/) renders one page per format from
the schema sources: packages, locks, profiles, imports, reviews, queries,
and the rest. One caveat when reading it: the Versions column reflects only
the `schemaVersion` field, while several format families — package formats,
import formats, native formats, and alignment reports among them — carry
their version in a `format` or descriptor field instead. Their versions are
real and enforced; they are just invisible in that column. The per-format
page body always shows the true identifier.

## What to read next

- [LawQL reference](/lawql/) for the full query surface.
- [MCP tools](/guide/mcp-tools/) for client-side discovery.
- [Schema catalog](/protocols/schemas/) for every format in one place.
- [Command-line reference](/cli/) for the query and audit commands.