Appendix B: Keywords
Every reserved keyword in ArchLang, split by where it’s recognized.
Keywords in .arch files
Section titled “Keywords in .arch files”| Keyword | Context | Effect | Chapter |
|---|---|---|---|
type | Top-level | Declares a type | 16 |
in | Module / process header | Attaches declaration to a parent module declared elsewhere | 4, 7 |
aspect | Body | Opens an aspect block / declares an aspect | 9 |
required | Type body | Mandatory blank — instance must fill or drop | 17 |
cascade | Type body, field modifier | Field value flows to descendants with override semantics | 18 |
cascade * | Type body, field modifier | Declares a cascade-group root; sub-fields under the path are part of the group and replacement of the root drops the group | 18 |
append | Type body, field modifier | Field value composes with descendants’ values | 18 |
override | Body | Replace inherited entity with non-subtype type | 19 |
drop | Body | Remove inherited entity from this scope and below | 19 |
process | Top-level / module body | Declares a process | 7 |
subprocess | Top-level / module body / process body | Declares a reusable subprocess | 7 |
on | Subprocess header | Declares the template default-caller param (subprocess X on Caller) | 7 |
do | Process body | Splice in a subprocess (ownerless; optional prefix = template default-caller) | 7 |
if, else | Process body | Exclusive conditional branch | 7 |
select | Process body | Multi-way inclusive branch by case label (every matching case runs) | 7 |
one | Process body | select one / first-matching modifier on select | 7 |
parallel | Process body | Concurrent branches (with a prefix merge clause) | 7 |
branch | Process body | A named or anonymous branch inside parallel | 7 |
join, race, out | Process body | parallel merge clauses — proceed-and-keep / proceed-and-cancel / detach | 7 |
each | Process body | Iterate; each <bound> try/catch/else is the retry form | 7 |
try, catch | Process body | Error path (guard, continue forward) | 7 |
await | Process body | Timed / event wait, owned by the waiter | 7 |
reversible | Process body | Saga span; completed steps roll back on failure | 7 |
unwind | Process body | Reverse action paired with a forward step (inline catch-and-rethrow) | 7 |
as | Process body | Name a step for go / diff (> X.y as checkpoint) | 7 |
go | Process body | Re-enter a named step and resume forward (ownerless) | 7 |
dist | Process body | Owner position: distributed / emergent control (no coordinator) | 7 |
fail, finish | Process body | Terminate branch with explicit outcome (failure / success) | 7 |
view | Top-level | Declares a view | 8 |
focus | View body | Marks matching elements for visual emphasis — never changes which nodes the view selects | 8 |
group | View body | Group by a getter’s value (used with by) | 8 |
by | View body | Companion to group | 8 |
layout | View body | Legacy — reserved but no longer functions; parses only to raise a rewrite diagnostic (pin a node via style) | 8 |
include | View body | Legacy — reserved but no longer functions; parses only to raise a rewrite diagnostic (select with show) | 8 |
exclude | View body | Legacy — reserved but no longer functions; parses only to raise a rewrite diagnostic (select with hide) | 8 |
true, false | Field/aspect values | Boolean literals | 9 |
Import & manifest keywords
Section titled “Import & manifest keywords”These are valid both in a package.archspace manifest and at the top of a .arch file (except dependencies, which is manifest-only).
| Keyword | Context | Effect | Chapter |
|---|---|---|---|
use | Manifest / .arch file | Import types from another package | 11 |
from | use clause | Names source package | 11 |
as | use clause | Local rename | 11 |
export | Type / interface / subprocess declaration, use clause | Make element visible to importers / other spaces / re-export | 11, 16 |
dependencies | Manifest | Opens dependencies block | 11 |
policies | Manifest | Opens the adopted-policy-packs block — policies { pack.name: "1.2.0" }, each pack pinned to its declared version | 32 |
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).
Context-restricted keywords
Section titled “Context-restricted keywords”Some keywords are only legal in specific bodies. Use outside that context is a parse error.
| Keyword | Legal only in |
|---|---|
each, if, else, select, one, try, catch, parallel, branch, join, race, out, await, reversible, unwind, on, do, go, as, dist, fail, finish | Process / subprocess bodies |
focus, group, by, layout, include, exclude | View bodies |
cascade, append, required | Type bodies |
(as is also legal in a use … from … as import clause; on is process-only — the subprocess caller-param uses on, not by.)
View & query keywords (contextual)
Section titled “View & query keywords (contextual)”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.
| Keyword | Effect |
|---|---|
show | Union a selector’s matches into the view |
hide | Subtract a selector’s matches from the view |
style | The universal rewrite rule — field overrides, rename, pin, use <bundle> over a selector’s matches |
group / by | Nest 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) |
on | Picks the plane(s) a view boards — one = plane board, many = weave |
table / matrix / grid / flow | The view’s representation clause (at most one per view) — tabular / dependency-matrix / cross-tab / process-flow |
sequence | flow mode token — the vertical lifeline representation |
bpmn | flow mode token — swimlanes/pools representation; opens the lane/pool body |
lane | bpmn flow body — one performer band (a selector, a titled merge, or by <getter>) |
pool | bpmn flow body — one pool per getter value (by <getter>), a titled merge of a query, or a single element reference |
column | table body — a getter column (editable) or a calculated column (read-only) |
sort | table body — sort by <getter> orders rows |
axis | matrix body — sets the shared SQUARE axis by getter |
rows / cols | matrix / grid body — sets one axis by getter (a rectangular matrix: no order / cluster there) |
order | matrix body — order by cluster / order by layer runs SCC + topological analysis, order by <getter> sorts by value |
cluster | matrix body — boxes cycles on the diagonal; implies order by cluster |
color | grid body — tints cell members by a third getter |
knob | Declares a view parameter — slider, dropdown, kind-led element picker, or enum block |
lens | A block of computed inspector values — lens { name: <expr> } |
story | Declares 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) |
chapter | story body — chapter "Title" { "note" <node selectors> }; the leading string is the note, and the nodes’ written order is the narration’s order |
pin | style body — WYSIWYG position (drag writes it) |
rename | style body — sets a display label |
bundle | style bundle <Name> { … } — declares a reusable style body |
Policy & selector keywords (contextual)
Section titled “Policy & selector keywords (contextual)”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.
| Keyword | Effect |
|---|---|
policy | Declares a policy — a query over the model that yields findings |
query | Declares a named, reusable selector — query Name: <selector> |
forbid | Policy rule — a finding per matching node/edge |
require | Policy rule — require <subject>: <obligation>, a finding when unmet; also when’s require review from … |
except | Policy rule — a waiver over a selector (reason mandatory) |
escalate | Policy rule — raises a policy’s severity |
when | Opens a change gate — when <selector> added|removed|changed(…) { … } — evaluated over a base→head diff |
review | Inside a when gate body — require review from … |
severity | Policy header field — error / warning / advisory |
violating | Selector atom — a policy’s active findings (violating <Policy>) |
and, or, not | Selector / expression boolean operators |
in | Selector predicate — structural containment / process participation (hard keyword, reused — see note above) |
on | Selector predicate — plane membership (hard keyword, reused — see note above) |
within | Suffix on an arrow hop — bounds a >>/<> reachability cone (within 2) |
where | Selector predicate — a boolean expression per candidate (where (…)) |
exists | Expression — true if a selector matches at least one element |
this | The bound subject inside a predicate / policy rule |
outside | Selector atom — elements not selected in this view |
sources | Selector 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, owners | Selector extraction — <word> of (<selector>) |
of | Companion to extraction, aggregates, and require review from N of <key> |
count, distinct | Aggregate — count (<selector>) / count distinct <getter> of (<selector>) |
sum, min, max | Aggregate — <word> <getter> of (<selector>) |
The two meanings of sources
Section titled “The two meanings of sources”The word sources names two unrelated things in ArchLang. Neither shadows the other, because they are read in different syntactic positions:
| Entry | Position | Meaning |
|---|---|---|
sources — selector extraction head | before of (, inside a selector | The source ends of the matched edges — sources of (@@zone:"pci" >> *). Sibling of targets / nodes / owners (Chapter 31) |
sources: — evidence field | at field position in a module body | The 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.
What’s not a keyword
Section titled “What’s not a keyword”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.)
Reserved keyword names
Section titled “Reserved keyword names”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.
See also
Section titled “See also”- Appendix A: Grammar — EBNF for every construct
- Appendix C: Stdlib types — built-in types (not keywords, but conventionally available)