ADR-074: A scheme can require one of several fields

Status Active · Filed 2026-09-03 · Issue #141

Context

requires demands every field it names (ADR-040). The knowledge-base example used it for a paper’s provenance — requires = ["arxiv"] — and review of #144 named what that gets wrong: a paper is not its arXiv identifier. A journal article has a DOI and may never have been posted to arXiv; a lab’s technical report may have neither and still be the paper a practice rests on. What the record actually requires of a paper is a source, and several different fields are one.

requires has no way to say that. A field group for tags exists (ADR-054) because a tag vocabulary is sometimes an axis; a requirement is sometimes a disjunction for the same reason, and nothing could say so.

Decision

A scheme may group fields under a name and require some of them.

[luria.schemes.LIT.field_groups.source]
fields  = ["arxiv", "doi", "url"]
require = "at-least-one"          # or "exactly-one", "at-most-one"

The group is named for the need — a source — and lists the fields that satisfy it. at-least-one is the default and the motivating case; the other two rules exist for the same reason they do on a tag group, and cost nothing beside it. An empty value does not count as present.

The finding names the need and every field that would have met it: no source — one of arxiv:, doi:, url: — the LIT scheme requires it (luria.toml: schemes.LIT.field_groups.source). The record page lists the group under what an entry must carry with the same words. Validated at load like a tag group: a group naming no fields, or a rule that is not one, is a configuration error rather than a group that constrains nothing.

The example now has a third paper, a technical report with only a url:, which the old requirement would have refused.

Alternatives considered

  • Keep arxiv required. Simplest, and wrong about papers; the example was teaching a rule the anthology it models would break on the first journal article.
  • A list inside requiresrequires = ["published", ["arxiv", "doi", "url"]]. No new table, and no name: the finding could say only “one of arxiv, doi, url”, not what the three have in common, and the record page could not describe the need. A mixed-type array is also the kind of shorthand ADR-063 declines to store.
  • Type each field as a source and require one of that type. The reviewer’s phrasing, and the more principled shape: arxiv, doi and url each declare what they are, and the scheme requires a field of that kind. It needs the field-typing work that #141’s later phases describe — a fields table with a type per field — and that decision has not been made. The group states the same need in the tables that exist, and reads naturally as one of those types once they do.
  • Status quo. A rule that fails the first real journal article.

Consequences

requires keeps its meaning — every field named — and the group is the word for any of these. A scheme declaring neither is unchanged.

The group is a need with a name, which is what a type would be. When fields carry types, require one field of type source and this group say the same thing, and the group can become sugar for it rather than a second mechanism.