Module: lib/compiler/rewind/diagnostics

What the compiler can tell a developer about a transaction before the application ships.

Three findings, and all three are about the gap between what an atomic action promises and what a rewind can actually deliver:

  • AVX_W42 — the write set could not be resolved completely, so the two reports below are incomplete for this action.
  • AVX_W43 — the action does something a rewind cannot undo, and here is each one with its line.
  • AVX_W44 — two atomic actions write the same state, so one may rewind over the other's value.

The house rule inherited from atlas/diagnostics.js applies with full force: a finding derived from an incomplete analysis is worse than no finding. AVX_W44 compares two write sets and is therefore skipped whenever either one is unbounded — an overlap warning computed from a partial set is a false positive and a false negative at the same time. AVX_W42 is the one that reports the incompleteness itself, so it is the only one that does not gate on it.

None of this affects the rewind. The journal watches the reactive proxies, not this analysis, so an action nothing here understood is still journaled completely. What is at stake is only whether the developer was told the truth about it in advance.

Source:

Methods

(static) findIrreversibleTransactions(model) → {Array:.<object:>}

Finds atomic actions with effects a rewind cannot undo.

Parameters:
Name Type Description
model object

The finished AppModel.

Source:
Returns:

Findings, each with its action and the effects.

Type
Array:.<object:>

(static) findOverlappingTransactions(model) → {Array:.<object:>}

Finds pairs of atomic actions that write the same state.

Only bounded write sets are compared. An unbounded one is already reported as AVX_W42, and intersecting it with anything would answer a question the analysis was not able to ask.

A caller and its callee are skipped as well. Their sets overlap by construction, and the runtime joins a nested transaction to the enclosing frame, so the pair cannot produce the conflict this code warns about.

Parameters:
Name Type Description
model object

The finished AppModel.

Source:
Returns:

Findings, each with the pair and what they share.

Type
Array:.<object:>

(static) findUnboundedTransactions(model) → {Array:.<object:>}

Finds atomic actions whose write set is incomplete.

Parameters:
Name Type Description
model object

The finished AppModel.

Source:
Returns:

Findings, each with its action and the reasons.

Type
Array:.<object:>

(static) reportRewindDiagnostics(model, configopt) → {Object}

Reports every Rewind finding through the compiler's warning machinery.

Routed through reportWarning so all three codes honour the warnings setting in avenx.config.json — including escalation to a build failure — and appear in avenx check --json like every other diagnostic.

Parameters:
Name Type Attributes Description
model object

The finished AppModel.

config object <optional>

The project configuration.

Source:
Returns:

What was reported.

Type
Object

(inner) unresolvedLine(entry) → {string}

Renders an unresolved entry as one report line.

Parameters:
Name Type Description
entry object

An unresolved entry.

Source:
Returns:

An indented line.

Type
string

(inner) where(node) → {string}

Renders a node's declaration site.

Parameters:
Name Type Description
node object

An Atlas node.

Source:
Returns:

file:line, or a placeholder.

Type
string