Skip to content

Appendix C: Stdlib Kinds

The stdlib ships two packages of kinds. Bring them into scope with:

use * from arch.modules
use * from arch.kinds

Both packages auto-resolve against the toolchain’s bundled stdlib — no dependencies entry needed.

Module kinds (arch.modules)

KindRequired blanksDefaultsDefault widget
servicerequired cascade team, required labels.domainarch-service
frontendrequired cascade team, required labels.domainarch-frontend
databaserequired cascade team, required labels.data.classificationarch-database
componentcascade teamarch-component
systemcascade teamarch-system
external_systemrequired ext.vendor, required ext.contract.urlarch-external-system
actorarch-actor

Reading the table:

  • Required blanks must be filled or dropped by every instance.
  • Defaults are pre-set fields the instance inherits (with cascade semantics where shown).
  • Default widget is the custom-element tag the instance renders with (cascaded via cascade widget: ...).

A project that does use * from arch.modules gets working visuals for free — no widgets: script of its own required.

Facet kinds

The stdlib defines one facet kind: facet (the generic base kind, no defaults, no required blanks). Custom facet kinds (resource, capability, endpoint_group) are conventionally declared per-project. See Chapter 6 and Chapter 16.

Interface kinds (arch.kinds)

KindParentSemantic
syncinterfaceGeneric synchronous interface
asyncinterfaceGeneric asynchronous interface
commandsyncState-changing operation
querysyncRead-only operation
eventasyncPub/sub broadcast
streamasyncLong-lived data stream

The two parent kinds (sync, async) drive edge styling: sync edges solid, async edges dashed. The four child kinds (command, query, event, stream) inherit that styling and convey the specific semantic.

Only event and stream (and anything subtyping them) are meaningful targets for subscribes: wiring.

Project-local kinds

Define your own kinds when domain vocabulary is preferred over the generic kinds. See Chapter 16.

// In your project's kinds.arch
export type service internal_service {
required cascade team
labels {
security.zone: Internal
}
}

Then use the kind anywhere in the package:

internal_service Authorize {
team: Platform
command Authenticate
}

To make a project-local kind visible to other packages, mark it export and import it via use … from <your.package> in their package.archspace.

See also