Reference

[ AxiomCore · Documentation ]

Acore schema

Fields, types, and defaults of the acore.base contract schema that backend declarations compile to, including endpoint, policy, domain, security, mock, and test classes.

This page lists the classes in acore.base, the schema that every backend contract compiles to. You write backend declarations (named endpoint, model, and other declarations with typed fields, List<T>, and Map<K, V>); the compiler lowers them to the JSON fields below. Generated identity metadata keeps historical endpoint IDs and names, so you do not repeat them in declarations. For syntax and evaluation, see the Acore language.

Inspect the schema yourself

Two read-only commands show the same data for your installed CLI:

Terminal
axiom explain axiom.acore
axiom explain --schema

axiom explain FILE prints the expanded backend JSON for one contract. axiom explain --schema prints the machine-readable declaration catalog (format acore-backend-language/v1): every constructor with its arguments, types, defaults, and required flags, plus all enum values. Use it when you need a field this page summarizes.

Conventions

  • A field without a default is required unless its type is nullable (?).
  • Listing<T> is a typed list and Mapping<K, V> a typed map; both default to empty where a default is shown as [] or {}.
  • Profile compilers run extra semantic checks beyond these types.

Root configuration

Config

FieldType and defaultPurpose
axiomString = "1.0"Source schema version
projectProjectConfig?Project identity and version
backendBackendConfig?Extractor language, entrypoint, and codec
frontendFrontendConfig?Framework and optional output directory
observabilityObservabilityConfig?Telemetry URL, sampling, and headers
variantsMapping<String, VariantConfig>Named selection profiles; defaults to default including "*"
policiesPolicyConfig?Default cache and retry behavior
serviceNameString?Service label
offlineConfigOfflineConfig?Local database and synchronization selection
models, enumsMapping<String, ModelDef>, Mapping<String, EnumDef>Extracted or authored data shapes
endpointsMapping<String, EndpointDef>Operation surface
domainDomainModel? = nullOptional business semantics
securitySecurityConfig? = nullOptional security declarations and gates
securityEvidenceExtractedSecurityEvidence? = nullWritten by Go and Python extractors; you normally do not author it
authMethodsMapping<String, AuthMethodDef>Reusable endpoint authentication methods

Project, backend, and frontend

ClassFields
ProjectConfigid: String, version: String (both required)
BackendConfiglanguage, entrypoint (required); codec = "json"
FrontendConfigframework (required); outputDir: String?
ObservabilityConfigenabled = false; telemetryUrl: String?; sampleRate = 1.0, constrained to 0 through 1; headers = {}
OfflineConfigenableLocalDb = false; syncStrategy (required)

codec accepts json, flatbuffers (also spelled flat_buffers), and protobuf. The runtime implements JSON and FlatBuffers only; it has no Protobuf codec.

Models and endpoints

ClassMembers
ModelDefname (required); fields = {}; dynamic rpcs; doc: String?
ModelFieldname, typeRef (required); default = null; isOptional = false; doc: String?; validate = null; extraConstraints = {}
EnumDefname (required); values = []; doc: String?
EndpointParametername, typeRef, source (required); isOptional = false
RpcMethodendpoint = ""; dynamic arguments and resolver

EndpointParameter.source is path, query, body, or header.

EndpointDef

FieldType and default
idInt = 0
name, path, methodRequired
parametersListing<EndpointParameter> = []
returnTypeType reference; default void
returnIsOptionalBoolean = false
streaming, auth, mockNullable typed configuration
cache, validate, retryNullable per-endpoint policy overrides (validate is Boolean?)
requestProjection, responseProjectionNullable domain projection names
cacheIdentityNullable readable UI cache identity
invalidates, errorsListing<String> = []
docString?

HTTP methods are GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, and WS.

EndpointOverride exposes the six overridable behavior fields: cache, validate, retry, streaming, auth, and mock.

Type references

TypeRef is a union of primitive, named, list, and map references.

ClassMembers
TypeRefPrimitivekind, default void. Kinds: string, int32, int64, float32, float64, bool, bytes, dateTime, void, json
TypeRefNamed (ContractTypeRef)kind = "named"; the model name in value
TypeRefListkind = "list"; the item type reference in value
TypeRefMapkind = "map"; key and value references in the two-item value list

A promoted DomainEntity shares the named-type shape, so you can use it in an endpoint type position after domain validation.

Cache, retry, and streaming

ClassMembers
PolicyConfigNullable cache and retry defaults
CachePolicystrategy, ttlSeconds (both required)
RetryPolicymaxAttempts = 3; backoff = ExponentialBackoff {}; retryOnCodes = [502, 503, 504]; retryOnTimeout = true
Backoff (base)initialDelay = "1s"; maxDelay = "30s"; useJitter = true
FixedBackoffFixed delay; uses the base defaults
LinearBackoffstep = "1s"
ExponentialBackoffmultiplier = 2.0

Cache strategies are network_only, cache_first, network_first, and stale_while_revalidate.

Stream classMembers
HttpStreamDefresponseType: TypeRef?; framing = "chunk"; encoding = "json"
SseStreamDefresponseType: TypeRef?
WebSocketDefdirection = "bidirectional"; single nullable client and server messages; reconnect = "auto"
WsMessageDefmodel (required): a named model or dynamic value
FileStreamDefcontentType: String?; filename: String?; disposition = "attachment"
EnumValues
Framingchunk, event, message, file
Encodingjson, text, binary
WebSocket directionserver_to_client, bidirectional
Reconnectauto, manual, none
File dispositionattachment, inline

See Streams and WebSockets for examples.

Authentication

ClassMembers
AuthMethodDeftype (required); nullable scheme, location, name, oauth2Flows, validation
AuthValidationDefstrategy (required); nullable secret reference and alg
EndpointAuthrequired (required); condition = "and" (and or or); scopes = []; methods = []; confidence = "high" (high or unknown)

Authentication method types are bearer, api_key, session, oauth2, http_basic, and unknown. These declarations describe the contract. Secret material and trusted server-side enforcement stay outside Acore evaluation.

Variants

VariantConfig has nullable include, exclude, includeModels, excludeModels, and cache. Patterns select endpoint and model names during evaluation; they do not create a runtime feature flag. See Imports, amends and variants.

Domain schema

ClassRequired membersDefaults and optional members
DomainModelNoneformat = "axiom-domain/v1"; empty entities, relationships, invariants, projections
DomainEntitymodel (injected by extend; do not author it)key = []; doc = null; do not set the model name or ID by hand
DomainRelationshipfrom, tocardinality, ownership, via, inverse (default ""); required = false; inferred = false; doc
DomainInvariantscopeexpression = ""; fields = []; rules = null; severity = "error"; inferred = false; doc
DomainProjectionentityfields = []; audience = ""; doc

Cardinality values are one_to_one, one_to_many, many_to_one, and many_to_many. Ownership values are owned, reference, and shared. Domain invariants are signed, reviewable evidence. AxiomCore does not execute their expressions as application logic.

Security schema

SecurityConfig has format = "axiom-security/v1", mode = "audit" (audit or strict), and defaultPolicy = "". It holds named maps for principals, permissions, resources, policies, auth (authentication profiles), endpoints (endpoint guards), classifications (sensitive data), effects, services, rateLimits, uploads, paths, processes, and invariants. cors, csrf, cache, and observability are optional single policies.

ClassMembers and defaults
SecurityPrincipalroles = []; doc
PermissionrequiresRateLimit, requiresIdempotency, requiresCsrf (all false); doc
ProtectedResourceentity (a promoted Entities.* reference); doc
SecurityPolicyresource, permissions, principals, roles, auth, relationship, resourceBinding; doc
EndpointGuardpublic = false; policy, resource, permission, auth, effects, rateLimit, writableFields; csrfExempt = false; idempotent = false
AuthenticationPolicytransport (required); issuer, audience; validateExpiry = true; sessionRotation = false; secure = false; httpOnly = false; sameSite = "lax"
SensitiveDatatarget, classification (required); audiences = []; redact = false
SecurityEffectkind (required); service, upload, path, process, input
NetworkServiceorigin (required); allowPrivateNetworks = false; allowRedirects = false
RateLimitmaxRequests, windowSeconds, key (all required)
CorsPolicyorigins, methods, headers (default []); credentials = false
CsrfPolicystrategy (required); sameSite = "lax"; secure = true; httpOnly = true
UploadPolicymaxBytes (required); mediaTypes = []; inspectContent = true; generatedFilename = true; privateStorage = true; executable = false
PathPolicyroot (required); allowExternalInput = false
ProcessPolicyexecutable (required); allowShell = false; allowedArguments = []
CacheSecurityPolicysharedAuthenticatedResponses = false; requireVaryByPrincipal = true
ObservabilitySecurityPolicyredactClasses = []; allowPayloads = false
SecurityRequirementkind (required); target = ""; severity = "error"
SecurityEvidenceFactkind (required); target, file, line, confidence = "heuristic", detail

Effect kinds are network, html_output, upload, filesystem_read, filesystem_write, process, log, analytics, cache, and response.

audit reports findings; strict blocks error findings in supported build and release paths. Declarations do not replace trusted runtime authorization. See Security rules for the AXSEC findings these classes produce.

Mock schema

MockConfig has enabled = true, selectionStrategy = "first_match" (first_match, random, sequential, or weighted), responses = [], and nullable fault, state, and fallback.

FamilyClasses and defaults
ResponseMockResponse: conditions = []; status = 200; headers = {}; data = StaticData {}; delayMs = 0; delayJitterMs = 0; weight = 1; label
ConditionsHeaderCondition (key, default op exists), QueryCondition and PathCondition (key, op eq), BodyCondition (path, op eq), StoreCondition (key, op gt); combine with AllCondition, AnyCondition, NotCondition
Operatorseq, neq, exists, missing, contains, matches, gt, lt
DataStaticData, TemplateData, EchoData (body); CollectionData (item, count = 20, paging with pageSizeParam = "limit" and pageIndexParam = "offset"); StoreQueryData (key, filterKey, filterValue, returnAll = false)
FaultsFaultConfig: errorRate = 0.0 (0 through 1), errorResponse, networkFault. NetworkFault: type is timeout, connection_reset, or slow_response; probability = 1.0; delayMs
StateMockStateConfig: initial = {}, onReceive = [], activityKey = "activity", changes = []
MutationsStoreMutation: type is increment, increment_fields, set, update, update_all, append, or delete; key; value; by = 1; filterKey, filterValue
TransitionsStateChange: name, responseLabel, when = [], mutations = [], events = []. Every matching change runs in declaration order. StateEvent requires type and title

Use Mocks for the supported workflow. Mock behavior is a development and test boundary, not proof of production behavior.

Test schema

In a backend contract, declare suites with testConfig(suites: [TestSuite(name: "smoke", baseUrl: "http://localhost:8080", checks: [...])]).

ClassMembers and defaults
TestConfigsuites = []; defaults: TestDefaults?
TestDefaultstimeoutMs = 5000; retryCount = 0; continueOnFailure = true; headers = {}
TestSuitename (required); baseUrl; timeoutMs = 5000; headers; hooks; checks; continueOnFailure = true; tags
CheckDefroute or url; pathParams, queryParams, body, headers; retryCount = 0; retryDelayMs = 500; expect; capture; skip = false; skipReason; timeoutMs; label
LifecycleHookphase (beforeAll, afterAll, beforeEach, afterEach); actions; continueOnFailure = false
Hook actionshttp (method = "GET", url, headers, body), store_set (key, value), store_clear, log (message)
ResponseCapturepath, bindAs; type = "any" (string, int, float, bool, any)
ExpectationMembers
statusop = "eq", value
durationop, valueMs
schemastrict = false
bodypath, op, value
body_quantifierpath, quantifier (every, some, none), itemPath, op, value
headerkey, op, value
grouplabel, expectations

Assertion operators are eq, neq, gt, gte, lt, lte, contains, matches, exists, and missing. Every expectation also accepts an optional label. Run all suites with axiom test axiom.acore, or filter by tag with --tag. See Contract tests.

Source of truth and stability

This page documents the checked-in base schema, not every internal compiler type. For exact UI target support, run axiom ui capabilities. For the current maturity of each path, see Support and availability.