All notable changes to the Sentience Python SDK will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- New Module:
predicate.tracing- Built-in tracing infrastructure for debugging and analyzing agent behaviorTracerclass for recording agent executionTraceSinkabstract base class for custom trace storageJsonlTraceSinkfor saving traces to JSONL filesTraceEventdataclass for structured trace events- Trace events:
step_start,snapshot,llm_query,action,step_end,error
- New Module:
predicate.agent_config- Centralized agent configurationAgentConfigdataclass with defaults for snapshot limits, LLM settings, screenshot options
- New Module:
predicate.utils- Snapshot digest utilitiescompute_snapshot_digests()- Generate SHA256 fingerprints for loop detectioncanonical_snapshot_strict()- Digest including element textcanonical_snapshot_loose()- Digest excluding text (layout only)sha256_digest()- Hash computation helper
- New Module:
predicate.formatting- LLM prompt formattingformat_snapshot_for_llm()- Convert snapshots to LLM-friendly text format
- Schema File:
predicate/schemas/trace_v1.json- JSON Schema for trace events, bundled with package
- Added optional
tracerparameter toSentienceAgent.__init__()for execution tracking - Added optional
configparameter toSentienceAgent.__init__()for advanced configuration - Automatic tracing throughout
act()method when tracer is provided - All tracing is opt-in - backward compatible with existing code
- Bumped version from
0.11.0to0.12.0 - Updated
__init__.pyto export new modules:AgentConfig,Tracer,TraceSink,JsonlTraceSink,TraceEvent, and utility functions - Added
MANIFEST.into include JSON schema files in package distribution
- Fixed linting errors across multiple files:
predicate/cli.py- Removed unused variablecode(F841)predicate/inspector.py- Removed unused imports (F401)tests/test_inspector.py- Removed unusedpytestimport (F401)tests/test_recorder.py- Removed unused imports (F401)tests/test_smart_selector.py- Removed unusedpytestimport (F401)tests/test_stealth.py- Addednoqacomments for intentional violations (E402, C901, F541)tests/test_tracing.py- Removed unusedTraceSinkimport (F401)
- Updated
README.mdwith comprehensive "Advanced Features" section covering tracing and utilities - Updated
docs/SDK_MANUAL.mdto v0.12.0 with new "Agent Tracing & Debugging" section - Added examples for:
- Basic tracing setup
- AgentConfig usage
- Snapshot digests for loop detection
- LLM prompt formatting
- Custom trace sinks
- Added comprehensive test suites for new modules:
tests/test_tracing.py- 10 tests for tracing infrastructuretests/test_utils.py- 22 tests for digest utilitiestests/test_formatting.py- 9 tests for LLM formattingtests/test_agent_config.py- 9 tests for configuration
- All 50 new tests passing ✅
No breaking changes! All new features are opt-in:
# Old code continues to work exactly the same
agent = SentienceAgent(browser, llm)
agent.act("Click the button")
# New optional features
tracer = Tracer(run_id="run-123", sink=JsonlTraceSink("trace.jsonl"))
config = AgentConfig(snapshot_limit=100, temperature=0.5)
agent = SentienceAgent(browser, llm, tracer=tracer, config=config)
agent.act("Click the button") # Now traced!# Tracing
from predicate.tracing import Tracer, JsonlTraceSink, TraceEvent, TraceSink
# Configuration
from predicate.agent_config import AgentConfig
# Utilities
from predicate.utils import (
compute_snapshot_digests,
canonical_snapshot_strict,
canonical_snapshot_loose,
sha256_digest
)
# Formatting
from predicate.formatting import format_snapshot_for_llm- This release focuses on developer experience and debugging capabilities
- No changes to browser automation APIs
- No changes to snapshot APIs
- No changes to query/action APIs
- Fully backward compatible with v0.11.0
(Previous changelog entries would go here)