concrete/contract/record-collection
A list bound to a fact binds a registry table and may only narrow its min and max.
A list bound to a fact binds a registry table and may only narrow its min and max.
Graded by the contracts stage of concrete check, in the contract venue. A violation reports this id and the file it failed at — see every rule and concrete check.
Reason
A list sourced by a fact table holds one item per row of it, and only the platform's own tables are such lists: they are a closed registry the workspace cannot add to, because every layer dispatches an edit and fan-out off the entry it finds there. A binding naming anything else is a typo, and repeating data that is not a table belongs to a fill instead.
The membership bounds are the registry's too. A section may NARROW them and nothing
else: a wider max is the split this rule exists to close — the section would accept
a count the table it lists does not — and restating the registry's own number carries no
information while giving it somewhere to drift. Omit the bound and materialization
stamps the registry's.
Check-caught for the bounds: min and max are ordinary numbers on the slot. The
table half is type-caught — the only facts a list is sourced by are tables, the
property's media lists sourcing none — and reaches this rule from a section built by a Concrete older than 9.0,
whose record lists could bind any fact.
Fix
Keep an explicit bound only where it is strictly tighter than the registry's. Source
the list from a registry table, or give repeating
data that is not one a fill.
Before and after
import { fact, list, object, row, text } from "@homepages/concrete";
list({
label: "Team",
source: fact.property.contacts,
max: 12,
item: (el) => {
const contact = row({ label: "Contact", from: fact.property.contacts, source: el });
const name = text.short({ label: "Name", source: contact.name });
return object({
label: name,
fields: {
contact,
name,
title: text.short({ label: "Title", source: contact.title }),
},
});
},
});import { fact, list, object, row, text } from "@homepages/concrete";
list({
label: "Team",
source: fact.property.contacts,
max: 4,
item: (el) => {
const contact = row({ label: "Contact", from: fact.property.contacts, source: el });
const name = text.short({ label: "Name", source: contact.name });
return object({
label: name,
fields: {
contact,
name,
title: text.short({ label: "Title", source: contact.title }),
},
});
},
});