Skip to content

Appendix B: Keywords

Every reserved keyword in ArchLang, split by where it’s recognized.

KeywordContextEffectChapter
typeTop-levelDeclares a type16
inModule / process headerAttaches declaration to a parent module declared elsewhere4, 7
aspectBodyOpens an aspect block / declares an aspect9
requiredType bodyMandatory blank — instance must fill or drop17
cascadeType body, field modifierField value flows to descendants with override semantics18
cascade *Type body, field modifierDeclares a cascade-group root; sub-fields under the path are part of the group and replacement of the root drops the group18
appendType body, field modifierField value composes with descendants’ values18
overrideBodyReplace inherited entity with non-subtype type19
dropBodyRemove inherited entity from this scope and below19
processTop-level / module bodyDeclares a process7
subprocessTop-level / module body / process bodyDeclares a reusable subprocess7
onSubprocess headerDeclares the template default-caller param (subprocess X on Caller)7
doProcess bodySplice in a subprocess (ownerless; optional prefix = template default-caller)7
if, elseProcess bodyExclusive conditional branch7
selectProcess bodyMulti-way inclusive branch by case label (every matching case runs)7
oneProcess bodyselect one / first-matching modifier on select7
parallelProcess bodyConcurrent branches (with a prefix merge clause)7
branchProcess bodyA named or anonymous branch inside parallel7
join, race, outProcess bodyparallel merge clauses — proceed-and-keep / proceed-and-cancel / detach7
eachProcess bodyIterate; each <bound> try/catch/else is the retry form7
try, catchProcess bodyError path (guard, continue forward)7
awaitProcess bodyTimed / event wait, owned by the waiter7
reversibleProcess bodySaga span; completed steps roll back on failure7
unwindProcess bodyReverse action paired with a forward step (inline catch-and-rethrow)7
asProcess bodyName a step for go / diff (> X.y as checkpoint)7
goProcess bodyRe-enter a named step and resume forward (ownerless)7
distProcess bodyOwner position: distributed / emergent control (no coordinator)7
fail, finishProcess bodyTerminate branch with explicit outcome (failure / success)7
viewTop-levelDeclares a view8
focusView bodyMarks matching elements for visual emphasis — never changes which nodes the view selects8
groupView bodyGroup by a getter’s value (used with by)8
byView bodyCompanion to group8
layoutView bodyLegacy — reserved but no longer functions; parses only to raise a rewrite diagnostic (pin a node via style)8
includeView bodyLegacy — reserved but no longer functions; parses only to raise a rewrite diagnostic (select with show)8
excludeView bodyLegacy — reserved but no longer functions; parses only to raise a rewrite diagnostic (select with hide)8
true, falseField/aspect valuesBoolean literals9

These are valid both in a package.archspace manifest and at the top of a .arch file (except dependencies, which is manifest-only).

KeywordContextEffectChapter
useManifest / .arch fileImport types from another package11
fromuse clauseNames source package11
asuse clauseLocal rename11
exportType / interface / subprocess declaration, use clauseMake element visible to importers / other spaces / re-export11, 16
dependenciesManifestOpens dependencies block11
policiesManifestOpens the adopted-policy-packs block — policies { pack.name: "1.2.0" }, each pack pinned to its declared version32

package, name, version, widgets, repo, and commit are recognized as manifest field names but are not reserved — they don’t shadow identifiers anywhere. repo: and commit: pin the repository and revision that the package’s sources: evidence bindings are checked against (Chapter 37).

Some keywords are only legal in specific bodies. Use outside that context is a parse error.

KeywordLegal only in
each, if, else, select, one, try, catch, parallel, branch, join, race, out, await, reversible, unwind, on, do, go, as, dist, fail, finishProcess / subprocess bodies
focus, group, by, layout, include, excludeView bodies
cascade, append, requiredType bodies

(as is also legal in a use … from … as import clause; on is process-only — the subprocess caller-param uses on, not by.)

These heads are recognized by position — in a view clause or body slot — not as hard reserved words; each remains a legal ordinary identifier elsewhere. See Appendix A: Grammar §View Declarations for the full grammar.

KeywordEffect
showUnion a selector’s matches into the view
hideSubtract a selector’s matches from the view
styleThe universal rewrite rule — field overrides, rename, pin, use <bundle> over a selector’s matches
group / byNest the view by repetition — group by @@team groups by a sigiled getter’s VALUE, group by in <selector> groups by CONTAINMENT (the selector names the containers, one frame each)
onPicks the plane(s) a view boards — one = plane board, many = weave
table / matrix / grid / flowThe view’s representation clause (at most one per view) — tabular / dependency-matrix / cross-tab / process-flow
sequenceflow mode token — the vertical lifeline representation
bpmnflow mode token — swimlanes/pools representation; opens the lane/pool body
lanebpmn flow body — one performer band (a selector, a titled merge, or by <getter>)
poolbpmn flow body — one pool per getter value (by <getter>), a titled merge of a query, or a single element reference
columntable body — a getter column (editable) or a calculated column (read-only)
sorttable body — sort by <getter> orders rows
axismatrix body — sets the shared SQUARE axis by getter
rows / colsmatrix / grid body — sets one axis by getter (a rectangular matrix: no order / cluster there)
ordermatrix body — order by cluster / order by layer runs SCC + topological analysis, order by <getter> sorts by value
clustermatrix body — boxes cycles on the diagonal; implies order by cluster
colorgrid body — tints cell members by a third getter
knobDeclares a view parameter — slider, dropdown, kind-led element picker, or enum block
lensA block of computed inspector values — lens { name: <expr> }
storyDeclares a guided walk over the view — story { chapter … }, at most five chapters. Not a representation clause: it composes with table/matrix/flow rather than replacing them, and is inert until the viewer is opened with ?present=1 (Chapter 36)
chapterstory body — chapter "Title" { "note" <node selectors> }; the leading string is the note, and the nodes’ written order is the narration’s order
pinstyle body — WYSIWYG position (drag writes it)
renamestyle body — sets a display label
bundlestyle bundle <Name> { … } — declares a reusable style body

These heads are recognized by position — inside a policy body, or inside the shared selector/expression grammar (Appendix A §Selector declarations, §Expressions) — not as hard reserved words. Selectors underlie view (show/hide/focus/style) as well as policy. in and on are the one exception in this list: both are hard reserved keywords already covered above, reused here as the selector in <container> / on <plane> predicates — not new contextual words.

KeywordEffect
policyDeclares a policy — a query over the model that yields findings
queryDeclares a named, reusable selector — query Name: <selector>
forbidPolicy rule — a finding per matching node/edge
requirePolicy rule — require <subject>: <obligation>, a finding when unmet; also when’s require review from …
exceptPolicy rule — a waiver over a selector (reason mandatory)
escalatePolicy rule — raises a policy’s severity
whenOpens a change gate — when <selector> added|removed|changed(…) { … } — evaluated over a base→head diff
reviewInside a when gate body — require review from …
severityPolicy header field — error / warning / advisory
violatingSelector atom — a policy’s active findings (violating <Policy>)
and, or, notSelector / expression boolean operators
inSelector predicate — structural containment / process participation (hard keyword, reused — see note above)
onSelector predicate — plane membership (hard keyword, reused — see note above)
withinSuffix on an arrow hop — bounds a >>/<> reachability cone (within 2)
whereSelector predicate — a boolean expression per candidate (where (…))
existsExpression — true if a selector matches at least one element
thisThe bound subject inside a predicate / policy rule
outsideSelector atom — elements not selected in this view
sourcesSelector extraction head — sources of (<selector>), the source ends of the matched edges (see the note below: the word has a second, unrelated meaning)
targets, nodes, ownersSelector extraction — <word> of (<selector>)
ofCompanion to extraction, aggregates, and require review from N of <key>
count, distinctAggregate — count (<selector>) / count distinct <getter> of (<selector>)
sum, min, maxAggregate — <word> <getter> of (<selector>)

The word sources names two unrelated things in ArchLang. Neither shadows the other, because they are read in different syntactic positions:

EntryPositionMeaning
sources — selector extraction headbefore of (, inside a selectorThe source ends of the matched edges — sources of (@@zone:"pci" >> *). Sibling of targets / nodes / owners (Chapter 31)
sources: — evidence fieldat field position in a module bodyThe file ranges in the code repository that attest this module — sources: "src/checkout/index.ts:12-88". An ordinary field, not a keyword at all (Chapter 37)

The extraction head is a contextual keyword: it only binds immediately before of (. The evidence field is a plain field name, exactly like latency or owner, and could have been called anything. So sources of (…) inside a selector and sources: "…" inside a module body never collide, and a module is free to carry the field whether or not any selector in the workspace uses the extraction.

User-defined types — service, database, rest_create, rest_read, etc. — are not keywords. They’re identifiers introduced by type module … / type surface … / type interface … declarations. The parser resolves them contextually against the active type registry.

The three base types module, surface, interface are likewise not keywords. They appear as parent types in type module service { … } and can be used directly to declare generic instances. (surface — the API-surface grouping type, Chapter 6 — is one of them, so it is an ordinary identifier, not a reserved word.)

User-defined types, fields, and aspects cannot reuse reserved keywords. Attempting to declare type module process { ... } or use required as an aspect name is a parse error.