Download the PHP package gosuperscript/axiom-tracing without Composer
On this page you can find all versions of the php package gosuperscript/axiom-tracing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gosuperscript/axiom-tracing
More information about gosuperscript/axiom-tracing
Files in gosuperscript/axiom-tracing
Package axiom-tracing
Short Description Opt-in execution tracing for gosuperscript/axiom
License MIT
Informations about the package axiom-tracing
axiom-tracing
Opt-in execution tracing for gosuperscript/axiom.
The package runs a compiled Program with an invocation-scoped observer and turns Axiom's ordered node lifecycle into a trace tree. Every evaluated source node records its source class, certified return type, annotations, outcome, value or error, and duration.
Requirements
- PHP ^8.4
- gosuperscript/axiom ^0.6
- gosuperscript/monads ^1.0
Installation
Usage
Compile normally, then pass the Program to Tracing::run():
The dump is a real evaluation tree, not a grouped annotation log:
Durations vary by invocation.
Bindings are the optional second argument:
API
| Component | Purpose |
|---|---|
Tracing::run(Program, bindings) |
Runs one invocation and returns its result with a fresh trace |
TracedResult |
Pairs the unchanged Axiom Result with the root ExecutionTrace |
ExecutionTrace |
One source node: children, ordered annotations, timing, outcome, value, and error |
TraceCollector |
The reusable low-level implementation of Axiom's Execution\Observer |
TraceFormatter |
Renders an ExecutionTrace as a readable tree |
Repeated annotations retain their emission order:
The generic lifecycle data has dedicated accessors: outcome(), durationMs(), hasValue(), value(), and error(). The underlying Axiom node descriptor is available as $trace->node, including $trace->node->sourceType and $trace->node->returns.
Invocation scope
Tracing state is never attached to a serializable Source, an Expression, or a compiled Program. Tracing::run() creates a fresh collector and passes it only to that call, so sequential or concurrent invocations cannot share a trace accidentally.
A boundary admission error happens before compiled source evaluation begins. It is represented as a single Program trace node with an err outcome. A host exception is still rethrown, preserving Program semantics. To inspect such a partial trace, use the collector directly:
Extension annotations
Core and host source compilers annotate the node currently being evaluated through SourceEvaluation::annotate():
Because Axiom wraps every CompiledSource with the source identity at compile time, host source compilers participate automatically; they do not need tracing-specific integration.