Appendix — AEOS Pattern Profile v1
Canonical topic owners: AEOS Specification v1 and the published AEON v1 contract artifacts.
This appendix describes a pattern DSL that is ahead of the currently locked AEOS v1 baseline. It is informative for future work and must not be treated as required for AEON Core v1 or the shipped AEOS v1 baseline.
1. Scope and purpose
AEOS Pattern Profile v1 defines a form-only constraint language for validating StringLiteral values emitted by AEON Core.
Goals:
deterministic cross-language behavior (Go/Rust/TS)
explicit, auditable constraints (no opaque regex)
stable CTS semantics
strict separation between form (AEOS) and meaning (processors)
2. Applicability
Patterns in this profile MAY be applied only to the decoded string value of a StringLiteral emitted by AEON Core.
If a pattern is applied to any non-StringLiteral value, the validator MUST emit:
code = "constraint_inapplicable"phase = "schema_validation"path = <data rule path>span = <data value span>
3. Canonical syntax requirements
3.1 Explicit assignment only
All normative structures MUST use explicit AEON assignment syntax:
✅
key = { ... }✅
key = "value"✅
key = 123❌ container shorthand MUST NOT be used in normative examples
3.2 Pattern Object
A Pattern Object has the form:
pattern = { <node-type> = <node-object> }
Rules:
patternMUST be an object.patternMUST contain exactly one node-type key.If
patterncontains zero or more than one node-type key:schema error
code = "invalid_pattern_shape"
4. Node types (v1)
Defined node-type keys:
allanynotpredsplitlabels
Unknown node-type key:
schema error
code = "unknown_pattern_node"
5. Node definitions
5.1 Common rule: “Node Object” (for clauses)
A Node Object is an object that contains exactly one node-type key (from §4), for example:
{ pred = { contains = "@" } }
{ not = { pred = { contains = ".." } } }
{ split = { sep = "@", exact_parts = 2 } }
If a Node Object contains zero or more than one node-type key:
schema error
code = "invalid_node_object_shape"
This rule is used for:
clauses under
all/anythe wrapped node under
notnested nodes inside
apply/each
5.2 all
Shape
pattern = {
all = {
c1 = { pred = { no_whitespace = true } }
c2 = { not = { pred = { contains = ".." } } }
c3 = { split = { ... } }
}
}
Rules:
allMUST be an object.allMUST contain one or more entries.Each entry value MUST be a Node Object (see §5.1).
Invalid:
schema error
code = "invalid_all_clause_shape"
Semantics
Evaluate entries in lexical order as written in AEON source.
allpasses iff all clauses pass.MAY short-circuit on first failure.
5.3 any
Shape
pattern = {
any = {
o1 = { pred = { starts_with = "Mr " } }
o2 = { pred = { starts_with = "Ms " } }
}
}
Rules:
anyMUST be an object.anyMUST contain one or more entries.Each entry value MUST be a Node Object.
Invalid:
schema error
code = "invalid_any_clause_shape"
Semantics
Evaluate in lexical order.
anypasses iff at least one clause passes.MAY short-circuit on first success.
5.4 not (unary)
Shape
pattern = {
not = {
pred = { contains = ".." }
}
}
Rules:
notMUST be an object.notMUST itself be a Node Object (i.e. contain exactly one node-type key).This means
notwraps exactly one node.
Invalid:
schema error
code = "invalid_not_shape"
Semantics
Evaluate the wrapped node.
notpasses iff the wrapped node fails.
5.5 pred (primitive predicates)
Shape
pattern = {
pred = { <predicate-kind> = <predicate-value> }
}
Rules:
predMUST be an object.predMUST contain exactly one predicate-kind key.Unknown predicate-kind:
schema error
code = "unknown_predicate_kind"
Predicate kinds (v1)
5.5.1 length
pattern = {
pred = { length = { min = 1, max = 64 } }
}
Rules:
value MUST be an object.
minandmaxoptional.if present, MUST be non-negative integers.
if both present, MUST satisfy
min <= max.
Invalid:
schema error
code = "invalid_length_predicate"
Semantics:
length measured in Unicode code points (decoded string, no normalization). Fail on data:
runtime code
length_violation
5.5.2 contains
pattern = { pred = { contains = "@" } }
Rules:
value MUST be a string.
Invalid:
schema error
invalid_contains_predicate
Fail on data:
runtime code
predicate_violation
5.5.3 starts_with
pattern = { pred = { starts_with = "." } }
Rules:
value MUST be a string.
Invalid:
schema error
invalid_starts_with_predicate
Fail on data:
runtime code
predicate_violation
5.5.4 ends_with
pattern = { pred = { ends_with = "." } }
Rules:
value MUST be a string.
Invalid:
schema error
invalid_ends_with_predicate
Fail on data:
runtime code
predicate_violation
5.5.5 no_whitespace
pattern = { pred = { no_whitespace = true } }
Rules:
value MUST be boolean.
Invalid:
schema error
invalid_no_whitespace_predicate
Semantics (v1 whitespace set):
forbidden code points are exactly:
U+0009 TAB
U+000A LF
U+000D CR
U+0020 SPACE
Fail on data:
runtime code
whitespace_forbidden
5.5.6 charset
pattern = { pred = { charset = "dns_label" } }
Rules:
value MUST be a string naming a charset in the registry (see §6).
Invalid:
schema error
unknown_charset
Fail on data:
runtime code
charset_violation
5.6 split (index-safe REQUIRED)
Shape (REQUIRED)
pattern = {
split = {
sep = "@"
exact_parts = 2
parts = {
p0 = { name = "local", apply = { all = { ... } } }
p1 = { name = "domain", apply = { all = { ... } } }
}
}
}
Rules:
splitMUST be an object.sepMUST be a non-empty string.exact_partsoptional; if present MUST be a positive integer.partsoptional; if present MUST be an object.If
partsis present:keys MUST be exactly
p0..pN(dense, zero-based, no gaps)each
pKMUST be an object containing:optional
name(string; documentation only)required
applywhich MUST be a Node Object (see §5.1)
Invalid:
invalid_split_shapeinvalid_split_parts_indexinginvalid_split_part_apply_shape
Semantics
Split input string on literal
sep.If
exact_partspresent and part count differs: failruntime code
split_exact_parts_mismatch
If
partspresent: apply eachpK.applyto the Kth part string.Any failing part fails
split.
Note:
applyis a Node Object, so you can useall,pred,labels, etc. directly.
5.7 labels
Shape
pattern = {
labels = {
sep = "."
min_parts = 2
each = { all = { ... } }
}
}
Rules:
labelsMUST be an object.sepMUST be a non-empty string.min_partsoptional; if present MUST be a positive integer.eachMUST be a Node Object.
Invalid:
schema error
invalid_labels_shape
Semantics
Split on literal
sep.If
min_partspresent and count < min_parts: failruntime code
labels_min_parts_violation
Apply
eachto every part string.If any part fails,
labelsfails.
6. Charset registry (v1 ASCII-only)
This profile permits named charsets referenced by pred.charset.
Charset definition shape (v1)
charsets = {
dns_label = {
ascii_ranges = {
r1 = { from = "a", to = "z" }
r2 = { from = "A", to = "Z" }
r3 = { from = "0", to = "9" }
}
literals = {
l1 = "-"
}
}
}
Rules:
charsetsis a registry object defined by the AEOS Schema Profile (location not specified here).ascii_rangesoptional; if present MUST be an object of ranges.each range MUST have
fromandtoas single ASCII characters.
literalsoptional; if present MUST be an object whose values are single ASCII characters.Any non-ASCII character in v1 charset definitions is invalid:
schema error
invalid_charset_definition
7. Error reporting and codes
7.1 Runtime pattern failures (data validation)
When a pattern fails on data, emit an error with:
path= rule path being validatedspan= span of the dataStringLiteralphase="schema_validation"code= appropriate runtime code
Minimum runtime codes:
pattern_mismatch// fallbacklength_violationpredicate_violationwhitespace_forbiddencharset_violationsplit_exact_parts_mismatchlabels_min_parts_violationconstraint_inapplicable
7.2 Schema-shape failures (schema validation)
Invalid pattern/schema structures MUST be reported as schema errors (same envelope), using:
invalid_pattern_shapeunknown_pattern_nodeinvalid_node_object_shapeinvalid_all_clause_shapeinvalid_any_clause_shapeinvalid_not_shapeinvalid_split_shapeinvalid_split_parts_indexinginvalid_split_part_apply_shapeinvalid_labels_shapeunknown_predicate_kindinvalid_length_predicateinvalid_contains_predicateinvalid_starts_with_predicateinvalid_ends_with_predicateinvalid_no_whitespace_predicateunknown_charsetinvalid_charset_definition
Implementation-specific schema codes MUST use vendor prefix:
vendor:code_name
8. Determinism and prohibitions
8.1 Ordering
Evaluation order MUST be lexical order in the AEON source for:
entries under
allentries under
anysplit.partsviap0..pN
8.2 Full-match model
This pattern system is a full-string validation model. Substring intent must be explicit via predicates (contains, etc.). There is no implicit substring search operator.
8.3 Anti semantic creep
Validators MUST NOT use this pattern system to claim real-world semantic validity:
no RFC-complete email validity
no calendar correctness for date-like strings
no DNS lookups
no reference resolution for validation
no coercion/normalization
9. Canonical example (email-shaped, form-only)
email_shape_v1 = {
pattern = {
all = {
c1 = { pred = { no_whitespace = true } }
c2 = {
split = {
sep = "@"
exact_parts = 2
parts = {
p0 = {
name = "local"
apply = {
all = {
l1 = { pred = { length = { min = 1, max = 64 } } }
l2 = { not = { pred = { starts_with = "." } } }
l3 = { not = { pred = { ends_with = "." } } }
l4 = { not = { pred = { contains = ".." } } }
l5 = { pred = { charset = "ascii_email_local_safe" } }
}
}
}
p1 = {
name = "domain"
apply = {
all = {
d1 = { pred = { length = { min = 1, max = 253 } } }
d2 = { pred = { contains = "." } }
d3 = {
labels = {
sep = "."
min_parts = 2
each = {
all = {
x1 = { pred = { length = { min = 1, max = 63 } } }
x2 = { not = { pred = { starts_with = "-" } } }
x3 = { not = { pred = { ends_with = "-" } } }
x4 = { pred = { charset = "dns_label" } }
}
}
}
}
}
}
}
}
}
}
}
}
}