Module: lib/compiler/atlas/AppModel

The Avenx Atlas data model — the compiler's semantic map of an application.

The compiler already computes almost everything Atlas needs: declared state, computed expressions, action bodies, resources, contracts, template ASTs, bridge descriptors and the component dependency graph. Until now it threw all of that away the moment it had emitted a bundle. Atlas is the retained form of that knowledge.

Shape

A model is a set of nodes (the application's semantic entities) and a set of edges (the relationships between them), plus an explicit list of the things analysis could not resolve. The third list is not an afterthought: an Atlas that silently dropped what it could not understand would answer "nothing depends on this" with the same confidence whether that was true or whether it simply failed to look. Every query surface reports it.

Edge direction

Edges always point in the dependency direction: A reads B is an edge from A to B. That makes the two query verbs the two directions of the same walk:

  • avenx why X — follow edges out of X: what X depends on.
  • avenx impact X — follow edges into X: what depends on X.
Source:

Classes

AppModel

Members

(static, constant) ATLAS_VERSION :number

The Atlas format version.

Bump this when the meaning of an existing field changes or a field a reader depends on is removed. Adding a new optional field does not require a bump; readers must tolerate unknown fields.

Type:
  • number
Source:

(static, constant) AtlasEdgeKind :string

The relationships Atlas models.

Type:
  • string
Source:

(static, constant) AtlasNodeKind :string

The semantic entities Atlas models.

These mirror Avenx's own declarations rather than JavaScript's constructs: a developer asks about cart.items, not about an object property on a module that happens to be a bridge.

Type:
  • string
Source:

(static, constant) Confidence :string

How much an edge can be trusted.

There is deliberately no certain shortcut for "we did not look". Anything analysis could not follow becomes an UnresolvedReason entry instead of a confident edge or a silent omission.

Type:
  • string
Source:

(static, constant) UnresolvedReason :string

Stable reasons a relationship could not be resolved.

Type:
  • string
Source:

Methods

(static) nodeId(kind, owner, name) → {string}

Builds a stable node id.

Ids are human-readable on purpose: they show up in --json output, in golden test fixtures and in diff review, and state:bridge:cart.items is legible where a hash would not be.

Parameters:
Name Type Description
kind string

One of AtlasNodeKind.

owner string | null

The owning node's id, or null for a top-level entity.

name string

The entity's declared name.

Source:
Returns:

The node id.

Type
string

(inner) compareLoc(a, b) → {number}

Compares two locations for deterministic ordering.

Parameters:
Name Type Description
a object | null

A location.

b object | null

A location.

Source:
Returns:

Sort order.

Type
number