Status: admitted in 6.1 (2026-10-29), revised after review the same day · Author: Michael & Claude working session, 2026-10-29 · Affects: §3 (schema grammar, references, ownership), §4 (edges), §6.1 (Record), §6.2 (Returns), §10 (diagnostics) · Syntax: three new type forms, part(<Record>), map(<type>) and map(ref(<Type>.<field>), <type>); no removed construct; one sentence corrected
A field often holds one structured value that is not a row of its own: the result a build reports, the GitHub link a project keeps, the validation a proposal carries, the version a tool call returns. AIM can say a field points at a row elsewhere (ref(Record.field)), and it can say a field holds several of something (list(<type>)). It cannot say “this field holds one value with these fields”.
Worked evidence: Amy’s own model. Amy’s /aim/ tree, reverse-encoded from its code, has 19 such fields. With nothing better available, the encoder typed them all object. AIM 6.0 does not define object, so every tool reads them as text and reports 19 UNKNOWN_FIELD_TYPE notices. Amy knows each shape, and most are already written in prose next to the field. For example, a build’s result is “commitSha, branch, pushed, tests (passed, command, exitCode)”. The language gives that shape no place.
| Kind | Fields in Amy’s model |
|---|---|
| One value kept inside a row | Build.result, Project.github, Proposal.validation, Message.thinking, Message.turn, Message.detail |
| One value sent or returned by an operation | FinishBuild.result, ClaimBuild.build, BuildUpdated.data, CreateKey.key, GetIntent.version, GetChangeRecords.version, Interact.action, Interact.context, SendMessage.relay, SendMessage.detail, MarkChangeCases.verification |
| Several values kept inside a row | Message.attachments, Message.questions |
The alternatives each say something false:
ref(BuildResult.id) claims the result is a row stored elsewhere that must exist. Then a build cannot be deleted without its result, and the result gets a table and an id it never had.resultCommitSha, resultBranch, resultTestsPassed, …) loses the grouping and repeats the prefix. It also has no answer for a list of structured values.string hides the shape from every check.§3 contradicts itself. One paragraph says list(<Record>) “holds several references to that Record’s rows”, and that is how realizations treat it: Amy’s runtime stores row ids and refuses a delete while they are referenced. A later paragraph says list(<type>) “holds repeated scalars or owned Record parts”. Both cannot hold. So today AIM has no way to say “owned part” at all, one or many.
part(<Record>) is a type. It holds one value whose fields are that Record’s schema. The value lives inside the row, Input, Returns or Payload that holds the field. It is not a row of the Record, it has no identity of its own, and it is created, changed and deleted with its holder. It need not come from any row: a part is an independent value of the Record’s shape.
status: enum(queued, running, succeeded, failed) required
result: part(BuildResult) optional
log: list(part(BuildLogEntry)) required
Build.result holds one BuildResult. The BuildResult Record names its fields and may hold parts of its own:
commitSha: string
branch: string
pushed: boolean
tests: part(TestRun)
The rules:
list(part(<Record>)) holds several parts in order.list(<Record>) keeps the meaning it has in practice: several references to that Record’s rows. The “owned Record parts” sentence in §3 is corrected to say this. list(<Record>) stays right wherever the items are rows of their own; list(part(<Record>)) is for values embedded in the holder.required, enum, min/max, nested parts, lists and maps) and its ### Constraints. Identity, unique, owner, !owner, ### Immutable and the Record’s States concern stored rows and do nothing inside a part. A realization MUST refuse a part that breaks the value rules before it stores or sends it.ref(...) inside a part MUST resolve. In a stored row, the part’s references are the row’s own, at any depth of nesting: the row is the referrer. The referenced row cannot be deleted while the part names it, and the holding row inherits its ownership restriction, as through a field of its own. A part in an Input, Returns or Payload is checked when it is accepted or sent and carries no lasting obligation; a row that stores it takes the obligations on.part(...) declares the edge holds, from the schema field that names it to the part’s Record, the way ref(...) declares refs. The field is identified by its facet, block (### Schema, ### Input, ### Returns, ### Payload) and name, so an Input field and a Returns field of one name stay distinct. Edges are derived through containers at any depth. Cardinality is 1 for a required field whose part stands alone, 0..1 for an optional one, 0..* inside any list or map. holds is a new row in the §4 table, separate from refs, so that graph queries and charts can tell containment from reference.### Returns may begin with a schema fence naming the returned fields, before its bullets. Without it, a returned part had no place to be declared.required single parts alone, directly or through other parts, is a hard error: no finite value satisfies it. An optional part, a list or a map ends the cycle with an absent or empty value, so next: part(Node) optional is a valid tree.Typing Amy’s own fields turned up a second gap: values keyed by an id that only exists at run time. One example is the GitHub sync’s sha per file path; another is the owner’s mark per verification case. A part cannot hold them, because its fields are fixed when the model is written. The same gap appears wherever a key is data: a price per currency, a translation per language, a count per label, a quantity per product.
map(<type>) is a type. It holds values of one type under non-empty text keys:
shas: map(string)
marks: map(part(CaseMark))
map(ref(<Type>.<field>), <type>) keys the values by rows of a Record:
quantities: map(ref(Product.id), integer)
ref(...), with the same deletion and ownership consequences, attributed to the stored row that holds the map, through nested parts too.unique (id: string required unique). No uniqueness is inferred from a field’s name: an id without unique cannot key a map. Giving every id field global uniqueness would be a separate compatibility decision.refs, part values derive holds, at any depth.list(part(...)) whose part carries a ref(...) field is a different value: ordered, and allowing repeats unless a Constraint forbids them. It is not another spelling of a keyed map. A Constraint can require uniqueness there too; the keyed map makes uniqueness and the reference part of the type, checked by every tool.6.0 source stays valid 6.1. object, array, json and dict stay unknown words, read as string (§3). The unknown-type notice for them SHOULD suggest part(...), list(part(...)) or map(...).
A bare Record name used as a type (customer: Customer) is an unknown word, read as string as in 6.0. The notice SHOULD name ref(Customer.id) and part(Customer). AIM never infers a reference from a name (§7).
part(X). A bare name X would have been shorter, but list(X) would have had to change meaning to values, along with the data stored under it. part(X) changes nothing that exists.holds, so that containment and reference never look the same.map(<type>) was added, keyed by text.map(ref(<Type>.<field>), <type>), chosen over a list with a uniqueness Constraint, because it keeps a map’s unique, unordered keys and makes the reference structurally checkable. The key’s target must be declared unique; a field named id gets no exception.A review of the first draft found seven defects, each confirmed against the text before it was changed:
required single parts.holds was described from the facet in one place and the field in another, and ### Returns allowed no schema fence. Now field-level (facet, block, field), derived through containers at any depth; Returns may carry a fence.list(part(...))”; a list has order and allows repeats. Replaced by the reference-keyed map.string” was a claim, not a rule. Removed; open structures stay outside 6.1.The spec’s Record example (items: list(ClaimLine)) is unchanged: it is valid where claim lines are rows of their own.