Status: written into the specification (AIM 6.6), 2026-11-15 — drafted 2026-11-15, revised the same day after two reviews (kept at the end; “What the revision changed” lists the changes); the eleven decisions accepted as drafted · Author: Michael & Claude working session · Would affect: §3 (Markdown restrictions: one new fence), §6.1 (Record: ### Constraints), §6.2 (Operation: ### Criteria, ### Expects, the write rule), §6.3 (Process: Criteria and Expects as on an Operation), §6.16 (Output: ### Constraints, one wording fix), §9 (impact set), §10 (diagnostics)
After 6.5, all six example models under Amy’s examples/ (airline-operations, club, e-commerce, german-government, hotel-management, nasa) were read in full for commitments that only prose carries. One finding recurred in every one of them: a rule that compares two fields, or a field with the clock, cannot be written in a form a tool can check. The owner raised the same gap with a case of his own:
The clearest lines from the examples, with file and line (paths under examples/):
hotel-management/aim/hotel/stay/hotel.stay.aim:455: “FreeOfCharge — the guest cancels before the reservation’s free-cancellation deadline”. The Input is reservationId alone; the deadline is Reservation.cancellationDeadline (hotel.aim:116). The decision has no Criteria.nasa/aim/nasa/jsc/mcc/telemetry/nasa.jsc.mcc.telemetry.aim:94: “Within — the value lies between the measurement’s low and high limits”. The Input is frameId alone.airline-operations/aim/airline/departure/airline.departure.aim:464: slotOffsetMinutes: integer optional label("Expected take-off against the slot, in minutes"), tested at line 485 (Cleared when slotOffsetMinutes between -5 and 10), while slotAt is stored at line 73. club/aim/tsv/aufnahme/tsv.aufnahme.aim:115 does the same with alter, tested at line 136 (Jugend when alter < 18), beside a stored geburtsdatum.german-government/aim/bundesregierung/legislation/secondpassage/bundesregierung.legislation.secondpassage.aim:76: “The request is within three weeks of bundesratDecisionReceivedOn”, and line 289: “lodges no objection within two weeks of objectionPeriodStartsOn”. That file holds no Trigger and no Criteria.e-commerce/aim/shop/orders/shop.orders.aim:499: “The days count as the law counts them: from the day after the parcel arrived to the end of the fourteenth day”, beside 14 days after [shop.orders#Event:ParcelDelivered] (line 507). The Test at line 28 depends on it. NASA stores Mission.launchWindowCloses (nasa.esdmd.artemis3.aim:46) while its Trigger counts 3 hours after [CountdownStarted] (countdown.aim:331) and Launch expects “the window is open” (line 260).hotel-management/aim/hotel/hotel.aim:124-126: “The departure is later than the arrival.”, “The nights are every date from the arrival to the day before the departure.”, “Free cancellation ends at 18:00 two days before the arrival.” invoicing/aim/invoicing/invoicing.aim:101: “totalAmount equals the sum of lineTotal across lines.”Three places in 6.5 cause it.
slotOffsetMinutes a tool checks −5 and 10; nobody checks the subtraction or which two times went into it.### Decides. The vacation rule is a precondition, not a decision, so it has no checkable place at all.### Schema and ### Immutable, ownership … and every State governing the Record” and does not name Constraints. Elsewhere the text is stronger than the form allows: a part “follows … the Record’s ### Constraints” (§3), and §6.16 says “A rule that can be stated on the content belongs in Contains or Constraints, where it is checked.” No form exists that a tool could check; a realization can only judge the prose.Two further places bear on the neighbouring gaps (Part “Not in this proposal”):
<n> <unit> after [<intent>#Event:<Name>] with minutes, hours, days, business-days or weeks”. A deadline counts from an Event only.— until [<address>] on a date or datetime field of the case’s record. So a field can anchor time in one place, without an offset and without a deadline’s powers (unless, ### Ends, triggers).6.4 left this open on purpose. 6.4-flow-constructs.md, Part 5: “Inputs are the operation’s Input fields. Nothing else in this version: a read Record names a kind of row, not a row, so Account.balance says nothing when the operation reads two accounts.” Under “What is deliberately not filled”: “Criteria over Record fields or Capability results: when an input can name a row.” And the line it drew: “no expressions beyond a comparison, no functions, nothing a parser cannot check against the schema.”
until. Units beyond weeks and the counting rule belong with it, because months need an end-of-month rule and one answer must serve the timer and the comparison alike.| Adds | A tool could then | Cost against §6.0 and the end of §7 | |
|---|---|---|---|
| Change nothing | Nothing. | Nothing new. | Every precondition, every Constraint and every period counted from a date stays prose. The computed Input stays the only way. §6.16’s “where it is checked” still needs correcting. |
| A. A wider comparison, no arithmetic | A field as the right side of a comparison; a field of the row a ref Input names; the clock. The same line in Criteria, Expects and Constraints. |
Reject unlike types; evaluate preconditions, row rules and decisions itself; name the line that refused; flag a rule when a field it names changes. | Checkability is lost today (test 1). The problem shows in six models of six (test 2); A settles three of the cited cases fully (vacation, hotel cancellation, arrival before departure) and the others in part (“What the examples would then say”). Complete needs the points under “Decisions to confirm”. Does not cover sums, or periods unless the due date is a stored field. |
| B. A plus periods | [field] + 3 weeks as an operand; a deadline anchored on a field; months and years; one counting rule. |
Show that the guard and the timer of one period agree; derive the e-commerce test dates. | The heaviest semantics in the language. A counting rule must be opt-in, or 14 days after [Event] changes meaning. Evidence is strong for the anchor, thin for months and years (one line, hotel.stay.aim:115). |
| C. Derived fields | A formula on a field: a total as the sum of its lines. | Compute the value; nobody enters it. | An expression language with aggregation, rounding and date functions. It moves AIM from outcomes to mechanics (§6.2: “states outcomes, not mechanics”). A large proposal of its own. |
Recommended: A now. It is the only step that stays inside the line 6.4 drew, and it is the precondition 6.4 itself named: an Input declared ref(...) names exactly one row. The field-anchored deadline with its counting rule follows as its own proposal. Derived values stay prose.
A comparison is <left> <op> <right>, with the operators §6.2 already lists, or <operand> present / <operand> absent. What may stand on each side widens:
[tageUebrig]. The brackets are required on the right, so that a literal and a field never collide: status = open compares with the value open, status = [open] with a field named open. On the left the brackets are allowed and mean the same: [departure] > [arrival]. Every rule written under 6.4 and 6.5 keeps its meaning.[<input>.<field>]. <input> is an Input field declared ref(...) whose target field is declared unique, so it names exactly one row, and <field> is a field of the Record it references. <input> may also be an Input declared part(<Record>); the value is then in hand and no row is looked up. It may stand on either side. One step; no longer path in this version.now beside a datetime, today beside a date. now is an instant and needs no timezone; today is the date in the timezone in reach (§6.7), and without one a realization MUST NOT evaluate it. One evaluation reads the clock once.Every comparison names at least one field. 5 > 3 and now = now are errors.
The clock words keep every existing meaning. On the left, an Input field named now or today is that field, as it is today, and a tool says so; the clock is meant only where no such field exists. On the right, a bare now beside a datetime field, or today beside a date field, is not a valid literal today, so no valid 6.5 rule changes; beside an enum or a string it stays the literal it was.
Types. Both sides MUST be of one type.
integer, number and decimal compare with one another, exactly. date compares with date and datetime with datetime, never one with the other. Two datetime values compare by instant, whatever offset each was written with.<, <=, >, >= and between apply to numbers, date and datetime, and to nothing else.ref(...) fields compare with = and != only when they reference the same field of the same Record: reviewerId != [ownerId].between a and b and in (...) take operands in the same way.An absent value. present and absent are always evaluated; they are how a rule asks. For any other comparison:
min and max. When a field read through [<input>.<field>] is absent, from the row a ref names or from a part that was given (decided 2026-11-15, after the specification was written), the line does not hold and the operation is refused: a precondition never passes because the value it needs is missing.closedAt >= [openedAt] says nothing while closedAt is empty.All three places exist in their promoted forms too (## Expects, ## Constraints, ## Criteria; §6.1, §6.3, §6.16), with the same grammar.
Criteria (§6.2, §6.3). The rule line stays <Outcome> when <comparison>[, <comparison>].... Its inputs are the operation’s Input fields and the rows its ref Inputs name.
FreeOfCharge when now < [reservationId.cancellationDeadline]
otherwise WithFee
Expects (§6.2, §6.3). ### Expects MAY hold one check fence, alone or beside bullets, with exactly one comparison per line; every line must hold. Operands are as in Criteria. A realization MUST refuse the operation when a line does not hold, before it performs anything, and says which line. It evaluates the check only after ### Authz and the ownership rules of §3 have passed, so a refusal never tells a caller about a row the caller may not read. The bullets are further preconditions, judged as today; a bullet that is written as a check line is replaced by it, not kept beside it.
### Input
```schema
mitarbeiterId: string required ref(firma#Mitarbeiter.id)
tageBeantragt: integer required min(1)
```
### Expects
```check
tageBeantragt <= [mitarbeiterId.tageUebrig]
```
### Ensures
- The days asked for are taken off the employee's days left — [mutates](aim:firma#Record:Mitarbeiter)
The Ensures line belongs to the example: the check alone compares, and only the write that takes the days off keeps a second request from using them again (Part 3).
On a Process the Expects check is evaluated when the case starts, before the first step. A Process runs for days and holds nothing in between; a value that must still hold at the moment of a write is guarded by the Operation that writes, or by the Record’s Constraints. A Process’s Criteria read rows and the clock when the decision is reached, after its steps.
Constraints (§6.1, §6.16). ### Constraints MAY hold one check fence, alone or beside bullets, one comparison per line. A block that holds only a fence is not empty. Operands are the fields of the Record itself, or of an Output’s Contains.
default(...) values are filled, on an update with the written fields laid over the stored ones. A delete evaluates nothing. The clock MUST NOT appear: a rule that is true only at the moment of writing is a precondition of the operation that writes and belongs in its Expects. arrival >= today on a Reservation would refuse the check-out the day after arrival.### Constraints
```check
departure > [arrival]
```
- The nights are every date from the arrival to the day before the departure.
check or criteria fence is evaluated, never judged. A prose bullet is judged, never claimed as proven. §6.16’s sentence becomes: a rule that can be stated as a comparison on the content belongs in a check fence, where it is checked.tageUebrig is right is the commitment of the operation that maintains it. The comparison is checked against the stored field.check fences join the list under Preservation of meaning (§3; 6.4 left Criteria out of it): parsing and serializing keep every line. A transform that renames a Record field or an Input field (§12) rewrites [<field>] and [<input>.<field>] in every rule that names it.cancellationDeadline already is.Hard error: an operand that is neither a literal of the other side’s type, a field of the place, a field reached through a ref or part Input, now or today; a literal on the left; a comparison that names no field; [<input>.<field>] where the Input is neither a ref(...) nor a part(...), where the ref target is not declared unique, or where the field is not in the referenced Record; two sides of unlike types; an ordering operator on a type that has no order; two ref fields compared that reference different targets; now beside anything but a datetime, today beside anything but a date; the clock in a Record’s Constraints (name the writing operation’s Expects); a check fence anywhere but Expects and Constraints; two check fences in one block; a check line with more than one comparison; a check line naming an outcome.
Informational: a rule that reads a row’s field while its operation declares neither reads nor mutates of that Record; a comparison whose two operands are the same operand (two different ref Inputs to one Record are not: [fromAccountId.currency] = [toAccountId.currency]); a check line no value can satisfy; today with no timezone in reach (ask which); an Input field named now or today in an operation whose rules use the word (say that the field is meant); an Expects check on an operation that mutates no Record the check reads (ask whether the value should be reserved).
alter stays an Input. Age is date arithmetic, which this proposal does not add.slotOffsetMinutes goes only if the window’s two bounds are stored fields; then Cleared when [turnaroundId.expectedTakeOffAt] between [turnaroundId.slotWindowOpensAt] and [turnaroundId.slotWindowClosesAt].Telemetry limits: the frame and its limit are two rows, and today nothing links them: TelemetryFrame.measurement is a plain string (line 32), not a reference. The rule is writable when the operation takes both rows as ref Inputs, and it then needs a line that ties them, or the frame could be measured against another measurement’s limits:
[frameId.measurement] = [limitId.measurement]
With frameId alone it would need measurement declared as a reference to Limit.measurement (which is unique, line 48) and a second step through it, which this version leaves out.
until: resolved once and kept, an absent value waits for the write.decimal fields in different currencies compare as numbers.Every 6.5 file is valid, unchanged. A right side without brackets is a literal, as it was. Criteria over Input fields mean what they meant, also where an Input is named now or today (Part 1). A ref(...) whose target is not unique stays valid; only reading a field through it is refused. ### Expects and ### Constraints without a fence are prose, judged as before. Nothing is deprecated and nothing is migrated.
The draft takes a position on each. All are the owner’s.
ref Input, and through a part Input. The alternative, a path of any length, covers the telemetry case and makes “which row” harder to read.check, lives inside Expects and Constraints (promoted forms included), at most one per block, exactly one comparison per line. The alternative is a sub-block of its own.present and absent always evaluated. The simpler alternative is that every absent operand in Expects refuses; it costs the “if given” reading of an optional Input.now and today as the two words for the clock, with an existing Input of that name winning. The alternative is a spelling no field can have, such as @now.ref whose target is unique. New after review.After the two reviews below, on the same day. The recommendation (A first, B on its own, C not now) is unchanged.
unique target. Decision 9.ref against ref, comparison by instant, one comparison per line, one fence per block, promoted forms, part Inputs.check are preserved and rewritten on a rename.Overall assessment: Option A is well-scoped, well-evidenced, and stays cleanly inside 6.4’s design boundary. Deferring B (field-anchored deadlines, period offsets, counting rules) and C (derived formulas) keeps comparisons schema-checkable without smuggling calendar arithmetic or aggregation into the language, while fixing an existing contradiction in 6.5 (§3 holds parts to ### Constraints and §6.16 says rules in Constraints are “where it is checked”, while §6.2’s write rule omits Constraints).
Before writing A into the specification, eight execution and grammar edge cases should be resolved so two conforming realizations cannot follow the text and behave differently.
Constraints on the clock (now / today) create a lifecycle-brick trap (Decision 7).
Under “Every write to a row MUST satisfy every line before it commits”, if Record: Reservation has arrival >= today in ### Constraints:
Friday >= Monday).Reservation.status — and is refused because Friday >= Saturday is false. Every subsequent status transition, update, or (since mutates in §7 includes delete) deletion is bricked once the timestamp passes.### Expects precondition on BookReservation, not a timeless row invariant. By contrast, an Output is never kept or later updated (§6.16), so a clock check on Output Constraints runs once at handover/acceptance and bricks nothing.now / today in Record ### Constraints (with a diagnostic directing the author to ### Expects on the creating operation) while allowing it in Criteria, Expects, and Output Constraints; or restrict Record Constraints explicitly to create and update (never delete) and warn strongly that any later update after the time passes will be refused.Expects when a referenced row’s field is optional (Decision 5).
Constraints, skipping a value comparison when an optional operand is absent matches SQL CHECK (closedAt >= [openedAt] passes while closedAt is absent).Expects with [<input>.<field>], Input required only requires <input> (the reference), not <field> on the target row. If Mission.windowClosesAt or Customer.creditLimit is optional and absent (null), skipping now < [missionId.windowClosesAt] or amount <= [customerId.creditLimit] silently passes the precondition.present and absent. [orderId.shippedAt] absent is a common precondition; Part 1 should keep unary <operand> present / <operand> absent explicitly, and those operators must never be skipped when the operand is absent.present / absent active everywhere; keep skip-on-absent for Constraints (and optional direct Input fields); and in Expects, refuse (or at minimum emit an informational diagnostic) when an unguarded value comparison reads an optional field on a referenced row [<input>.<field>] whose value is absent.§6.3) Expects and Criteria timing vs. atomicity.
Expects check and Ensures write can commit together.Expects cannot hold a transaction lock until a step days later mutates a balance. And unlike 6.4 (where Criteria read immutable Input fields only), a Process’s Criteria can now read [<input>.<field>] and now, which change while the steps run.Expects is evaluated when the case starts, before step 1, while write-time atomicity against concurrent cases belongs to the mutating Operation (or Record Constraints); and (b) Criteria is evaluated when the steps complete to reach the process’s decision, against the row values and clock at that moment.Expects.
“A realization MUST refuse the operation when a line does not hold, before it performs anything, and says which line.” If Expects runs before Authz and row ownership (owner, !owner, cross-owner), an unauthorized caller can pass another actor’s mitarbeiterId and probe tageUebrig via the “says which line” refusal.
Authz → (2) Input schema validity (required, types, min/max, ref existence, parts’ Constraints) & row ownership scope (§3) → (3) State Only in (§6.10) and Expects check → (4) Criteria / Ensures / Record Constraints & State Moves at commit.Constraints on partial updates and defaults.
When an Operation creates a row or updates a subset of fields (e.g. updating arrival without rewriting departure), Constraints MUST be evaluated on the resulting post-write row (on create: after default(...) values in §3 are filled; on update: written fields merged over existing stored fields; on delete: not evaluated).open, Green) share the same token shape as bare left-hand field names, allowing literals on the left turns a misspelled field (typo = [status]) into a string literal comparison. Restrict <left> to: a local field (bare, or optionally [field]), [<input>.<field>], or now / today, and require at least one side to be a field (ruling out 5 > 3 and now = now).[field] brackets on the left: Since [turnaroundId.slotAt] uses brackets on the left and [arrival] uses brackets on the right, authors and tools will write [departure] > [arrival]. Accepting optional brackets on a local left-hand field (while requiring them on the right) avoids a needless syntax trap.now and today: State that bare now and today always denote the clock (a field named today would be written [today], or warn on naming a field now / today). Note also that now compares absolute UTC instants against datetime (timezone-independent), whereas today requires a timezone — define runtime behavior for today when timezone is omitted (since missing timezone is informational, not a hard error).<, <=, >, >=, between): Restrict to integer / number / decimal, date, and datetime (hard error on boolean, enum, email, url, phone, file, ref, part, list, map). State explicitly that datetime values with different UTC offsets compare by instant (not ISO string order), and between applies to date and datetime as well as numbers.enum(...) is inline on its field (§3). Define “the same enum” structurally as the same set of values.ref(...) fields: Two ref fields targeting different Records (ref(team#Member.id) vs ref(shop#Product.id)) should be a type hard error even when both underlying scalars are string, whereas two refs to the same Record field (reviewerId != [ownerId]) compare as equal/unequal.check line grammar (Part 2): “one comparison per line; the conditions of one line hold together, and every line must hold.” Since every line already holds together (AND), comma-joined conditions on a single line contradict “one comparison per line” and blur “says which line” on refusal. Make check strictly one comparison per line, with at most one check fence per Expects or Constraints block.reads diagnostic (Part 4): “a rule that reads a row’s field while its operation declares no reads of that Record” will misfire on nearly every mutating operation (ApproveClaim, CancelReservation), which declare [mutates](aim:...) without a separate [reads](aim:...) (cf. “declared reads or mutates targets” in §3). Change to: “declares neither reads nor mutates of that Record”.<Record>.<field>, so [fromAccountId.currency] = [toAccountId.currency] (two distinct ref Inputs to Account) is not flagged.## Expects and ## Constraints alongside ### Expects and ### Constraints, and ensure ref(<intent>#<field>) (promoted Record entities, §3) works identically in [<input>.<field>].check coexistence: Clarify that a check fence may stand alone (zero prose bullets, as in the vacation example; §6.16’s informational “an Output with no Constraints and no Ensures” must treat a check-only Constraints block as non-empty) or beside prose bullets, and that unlike ### Decides + ### Criteria, prose bullets in Expects and Constraints are additive — authors replace a prose bullet when encoding it in check rather than keeping both.part(...) Inputs (Decision 3): Keep ref traversal to 1 hop, and consider also allowing [<input>.<field>] when <input> is part(<Record>) (an in-hand single value with no join or multi-row ambiguity).Criteria and check fences to Preservation of meaning in §3 (6.4 omitted Criteria there), and state in §12 that renaming a Record or Input field rewrites [<field>] and [<input>.<field>].| # | Draft position | Review recommendation |
|---|---|---|
| 1 | A first, B as its own proposal, C not now | Confirm. |
| 2 | Brackets mark a field on the right ([tageUebrig]) |
Confirm, plus disallow literals on the left and allow optional [field] brackets on the left. |
| 3 | One step through a ref Input ([<input>.<field>]) |
Confirm 1-hop ref limit; optionally allow [<input>.<field>] on part(<Record>) Inputs too. |
| 4 | Fence named check inside Expects and Constraints |
Confirm (including promoted ## Expects / ## Constraints), at most one fence per block, strictly one comparison per line. |
| 5 | Absent operand: fails in Criteria, not applied in check |
Revise for Expects: keep unary present/absent active; keep skip-on-absent for Constraints and optional Input fields; refuse (or warn) when [<input>.<field>] is absent in an Expects value comparison. |
| 6 | Constraints checks join §6.2’s write rule; prose stays judged |
Confirm, evaluated on the post-write merged row (after default(...) on create) on create and update only, never on delete. |
| 7 | A Constraint on the clock is allowed |
Reconsider for Records: allow on Output Constraints, Expects, and Criteria, but forbid on Record Constraints (pointing to Expects) to avoid bricking later lifecycle updates. |
| 8 | now and today as the two words for the clock |
Confirm, reserving bare now/today and defining today’s fallback/gate when timezone is absent. |
A is a worthwhile next step, but this draft should be revised before adoption as AIM 6.6. It addresses a real gap, fits the existing facets, and sensibly separates comparisons from timers and derived values. This is additional review feedback, not an amendment to the draft or a resolution of the decisions above.
The main issues are semantic rather than syntactic:
Skipping absent operands can bypass preconditions (Decision 5).
The proposed absence rule lets an Expects check disappear when a compared value is missing. required does not fully solve this: a field can legitimately be optional generally but necessary for one operation. At minimum, Expects should refuse when a comparison needs an absent value. Also define present and absent separately; those predicates must still run when their operand is absent.
A ref(...) does not yet establish an unambiguous lookup (Part 1).
The operand definition assumes a reference names exactly one row. However, §3’s generic reference rules do not require the target field to be unique; the map-key rules explicitly do. If several employees share a referenced value, whose balance is read? Require dereferenced references to identify exactly one row, preferably through a declared unique key. Apply this restriction to the new dereferencing construct without invalidating existing references.
The concurrency guarantee exceeds what the comparison establishes (Part 3). “A check and the write … commit together” is insufficient to guarantee that two vacation requests cannot consume the same balance. Even sequential requests can both pass if each merely creates a request and leaves the balance unchanged. The example needs a commitment to reserve or debit the allowance in the same atomic action. Concurrent evaluation must also protect the values read, rather than merely group the check and write together. Distinguish this from a Process’s entry precondition: a long-running Process cannot hold one transaction throughout its work.
Bare clock names undermine the compatibility claim (Part 1, Decision 8).
now and today can already be Input names or literal enum values. For example, an Input named now with type datetime makes now < [reservationId.cancellationDeadline] ambiguous. Amy’s current Criteria evaluator was checked and accepts both a now Input and a today enum literal. Choose distinguishable clock syntax or specify resolution that preserves every existing interpretation. This differs from the earlier review’s recommendation to reserve bare now and today: reservation must not silently reinterpret existing rules.
present/absent explicitly; they do not fit <left> <op> <right>.These can remain compact rules. They should not be left to each realization.
The telemetry example needs a relationship check.
The example discussion says the existing model needs another step through a reference. In fact, TelemetryFrame.measurement is plain text, not a reference to Limit. Adding limitId also requires checking that the supplied limit belongs to the frame’s measurement:
[frameId.measurement] = [limitId.measurement]
Otherwise, the numeric comparison could use an unrelated measurement’s limits.
The graph approach is appropriate: structured dependencies need no new behavioral verb. However, the dependency rule should also cover preservation and transforms (§3, §12). Renaming a referenced field must rewrite comparison operands, and parse/serialize cycles must preserve every check. Flagging affected rules alone is insufficient.
Two broader judgments:
totalAmount = sum(lines.lineTotal) still states an outcome. Its being executable does not inherently make it implementation mechanics.The strongest justification for A is the vacation precondition, hotel cancellation decision, and arrival/departure constraint. The six-model survey supports the wider problem; it should not imply that A resolves all six models’ gaps.