agentic-intent-model

Proposal (AIM 6.1) — parts and maps: structured values held inside another

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

The problem

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:

§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.

Proposal

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:

Maps

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)

Compatibility

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).

Owner decisions (2026-10-29)

  1. Spelling: 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.
  2. Graph: a new verb holds, so that containment and reference never look the same.
  3. Unnamed keys are refused. A part holds only the fields its Record names.
  4. Maps too. Asked how to type id-keyed values: “better we fix it now in the AIM before things grow too big”. map(<type>) was added, keyed by text.
  5. Version 6.1. It adds type forms, corrects one sentence and removes nothing.
  6. Reference-keyed maps (after review). 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.

Review (2026-10-29)

A review of the first draft found seven defects, each confirmed against the text before it was changed:

  1. The draft read a bare Record name as a reference. That was new meaning, and contradicts §7’s ban on implicit foreign keys by naming. Removed.
  2. The cycle error caught optional parts, which allow a finite value. Narrowed to required single parts.
  3. 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.
  4. Which Record rules apply to a part was unstated beyond field rules. Value rules and Constraints apply; identity, uniqueness, ownership declarations, Immutable and States stay with rows. A part need not be a copy of a row.
  5. Reference obligations inside a part were unstated. The stored holder is the referrer.
  6. The draft called a map keyed by rows “a list(part(...))”; a list has order and allows repeats. Replaced by the reference-keyed map.
  7. “A value whose shape is genuinely open is a 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.