Skip to content

Update TracingResolver to accept Context parameter - #12

Merged
robertvansteen merged 1 commit into
mainfrom
claude/axiom-v0.4.0-compatibility-LhJfK
Apr 13, 2026
Merged

robertvansteen merged 1 commit into
mainfrom
claude/axiom-v0.4.0-compatibility-LhJfK

Conversation

@robertvansteen

Copy link
Copy Markdown
Contributor

Summary

Updates the TracingResolver to accept a Context parameter in its resolve() and traced() methods, aligning with changes in the axiom library (v0.4.0). The resolver now manages inspector injection at the root level rather than during construction.

Key Changes

  • Method signatures: Updated resolve(Source $source) to resolve(Source $source, Context $context) and traced(Source $source) to traced(Source $source, ?Context $context = null)
  • Inspector management: Moved from constructor-time injection to root-level resolution, where the tree-aware inspector is swapped into the context only when needed
  • Test updates: Refactored test helper createResolver() to remove symbol parameter and added new context() helper for creating contexts with definitions
  • Symbol resolution: Changed from passing symbols to the resolver constructor to passing them via context definitions in individual test calls
  • Documentation: Updated README with axiom v0.4.0 requirement and examples showing Context usage in resolve calls

Implementation Details

  • The TracingResolver no longer registers itself as a ResolutionInspector in the container during construction
  • Instead, at the root of each resolution, it creates a new Context with its tree-aware inspector if the provided context doesn't already have one
  • This allows the inspector to be swapped in/out per resolution without affecting the resolver's configuration
  • Recursive calls propagate the context unchanged, maintaining the tree structure throughout resolution
  • All test cases updated to pass Context instances (with or without definitions) to resolve/traced calls

https://claude.ai/code/session_01YRTrWLWi2ethcHrQ4SraWZ

v0.4.0 changed the Resolver interface to thread a Context through each
call and removed SymbolRegistry in favour of Context-carried Definitions
and Bindings. The tracing inspector also moved from container injection
onto the Context.

- Require gosuperscript/axiom ^0.4.0
- TracingResolver::resolve(Source, Context) matches new interface; at
  the root call we swap the Context's inspector for our tree-aware
  TracingResolutionInspector, then propagate that Context through
  recursive resolution
- Drop the ResolutionInspector container binding (no longer injected;
  resolvers read the inspector from the Context)
- TracingResolver::traced() now accepts an optional Context
- Update tests to use Context/Definitions instead of SymbolRegistry
- Update README to document the new Context-based API
@robertvansteen
robertvansteen marked this pull request as ready for review April 13, 2026 12:13
@robertvansteen
robertvansteen merged commit 9b7b0a1 into main Apr 13, 2026
1 check passed
@robertvansteen
robertvansteen deleted the claude/axiom-v0.4.0-compatibility-LhJfK branch April 13, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants