PHPackages                             gosuperscript/axiom-tracing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. gosuperscript/axiom-tracing

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

gosuperscript/axiom-tracing
===========================

Opt-in resolution tracing for gosuperscript/axiom

v0.1.2(1mo ago)07.4k↑65.6%[1 PRs](https://github.com/gosuperscript/axiom-tracing/pulls)MITPHPPHP ^8.4CI passing

Since Feb 10Pushed 1mo agoCompare

[ Source](https://github.com/gosuperscript/axiom-tracing)[ Packagist](https://packagist.org/packages/gosuperscript/axiom-tracing)[ RSS](/packages/gosuperscript-axiom-tracing/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (11)Used By (0)

axiom-tracing
=============

[](#axiom-tracing)

Opt-in resolution tracing for [gosuperscript/axiom](https://github.com/gosuperscript/axiom). Decorates `DelegatingResolver` to build a tree-shaped trace that mirrors the recursive resolution call stack, capturing timing, outcomes, and resolver-contributed metadata on each node.

Installation
------------

[](#installation)

```
composer require gosuperscript/axiom-tracing
```

Usage
-----

[](#usage)

### Conditional tracing with callback

[](#conditional-tracing-with-callback)

```
use Superscript\Axiom\Resolvers\DelegatingResolver;
use Superscript\Axiom\Tracing\Tracing;
use Superscript\Axiom\Tracing\TracedResult;
use Superscript\Axiom\Tracing\TracingResolver;

$resolver = Tracing::wrap(
    new DelegatingResolver([...]),
    enabled: config('axiom.tracing', false),
);

// Register a callback — fires on every top-level resolution
if ($resolver instanceof TracingResolver) {
    $resolver->onTrace(function (TracedResult $traced) {
        Log::debug('Axiom resolution', ['trace' => $traced->dump()]);
    });
}

// Calling code is unchanged
$result = $resolver->resolve($source);
```

### Explicit trace retrieval

[](#explicit-trace-retrieval)

```
use Superscript\Axiom\Tracing\TracingResolver;

$tracer = new TracingResolver($delegatingResolver);

$traced = $tracer->traced($source);
$traced->result;  // Result
$traced->trace;   // ResolutionTrace tree
$traced->dump();  // formatted string
```

### Extracting metadata from a trace

[](#extracting-metadata-from-a-trace)

```
// Collect all values for a key across the entire tree
$httpExchanges = $traced->trace->collect('http_response');

// Walk the tree manually
foreach ($traced->trace->children() as $child) {
    $child->getMetadata('http_response');
}
```

### Production use (flat inspector, no tracing)

[](#production-use-flat-inspector-no-tracing)

For extracting resolver metadata without full tracing overhead:

```
use Superscript\Axiom\Tracing\ResolutionContext;
use Superscript\Axiom\ResolutionInspector;

$context = new ResolutionContext();
$resolver->instance(ResolutionInspector::class, $context);

$result = $resolver->resolve($source);
$httpResponse = $context->get('http_response');
```

Components
----------

[](#components)

ComponentPurpose`ResolutionContext`Flat key-value `ResolutionInspector` for production metadata extraction`ResolutionTrace`Tree node with children, metadata, and recursive `collect()``TracingResolutionInspector`Tree-aware inspector routing annotations to the current trace node`TracingResolver`Decorator intercepting every `resolve()` call to build the trace tree`TracedResult`Pairs a `Result` with its `ResolutionTrace` tree`TraceFormatter`Renders trace trees as human-readable indented strings`Tracing`Factory with `wrap()` for conditional decorationExample output
--------------

[](#example-output)

```
TypeDefinition [NumberType] — ok, value: 150, 52ms
└── InfixExpression [*] — ok, value: 150, 51ms
    ├── SymbolSource [base_rate] — ok, value: 100, 3ms
    │   └── StaticSource [static(int)] — ok, value: 100, 0.01ms
    └── InfixExpression [+] — ok, value: 1.5, 45ms
        ├── StaticSource [static(float)] — ok, value: 0.5, 0.01ms
        └── StaticSource [static(int)] — ok, value: 1, 0.01ms

```

Testing
-------

[](#testing)

```
composer install
vendor/bin/phpunit
```

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance90

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~18 days

Total

3

Last Release

53d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9832602d5b04f09fa5bd162acbaf87b0e5c50ce9a96b970424e78a3830695eb1?d=identicon)[robertvansteen](/maintainers/robertvansteen)

---

Top Contributors

[![robertvansteen](https://avatars.githubusercontent.com/u/14931924?v=4)](https://github.com/robertvansteen "robertvansteen (9 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (1 commits)")[![fawazsuleiman](https://avatars.githubusercontent.com/u/129744165?v=4)](https://github.com/fawazsuleiman "fawazsuleiman (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gosuperscript-axiom-tracing/health.svg)

```
[![Health](https://phpackages.com/badges/gosuperscript-axiom-tracing/health.svg)](https://phpackages.com/packages/gosuperscript-axiom-tracing)
```

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)[beyondcode/helo-laravel

HELO Laravel debug helper

90360.1k](/packages/beyondcode-helo-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
