|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to the Sentience Python SDK will be documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 6 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 | + |
| 8 | +## [0.12.0] - 2025-12-26 |
| 9 | + |
| 10 | +### Added |
| 11 | + |
| 12 | +#### Agent Tracing & Debugging |
| 13 | +- **New Module: `sentience.tracing`** - Built-in tracing infrastructure for debugging and analyzing agent behavior |
| 14 | + - `Tracer` class for recording agent execution |
| 15 | + - `TraceSink` abstract base class for custom trace storage |
| 16 | + - `JsonlTraceSink` for saving traces to JSONL files |
| 17 | + - `TraceEvent` dataclass for structured trace events |
| 18 | + - Trace events: `step_start`, `snapshot`, `llm_query`, `action`, `step_end`, `error` |
| 19 | +- **New Module: `sentience.agent_config`** - Centralized agent configuration |
| 20 | + - `AgentConfig` dataclass with defaults for snapshot limits, LLM settings, screenshot options |
| 21 | +- **New Module: `sentience.utils`** - Snapshot digest utilities |
| 22 | + - `compute_snapshot_digests()` - Generate SHA256 fingerprints for loop detection |
| 23 | + - `canonical_snapshot_strict()` - Digest including element text |
| 24 | + - `canonical_snapshot_loose()` - Digest excluding text (layout only) |
| 25 | + - `sha256_digest()` - Hash computation helper |
| 26 | +- **New Module: `sentience.formatting`** - LLM prompt formatting |
| 27 | + - `format_snapshot_for_llm()` - Convert snapshots to LLM-friendly text format |
| 28 | +- **Schema File: `sentience/schemas/trace_v1.json`** - JSON Schema for trace events, bundled with package |
| 29 | + |
| 30 | +#### Enhanced SentienceAgent |
| 31 | +- Added optional `tracer` parameter to `SentienceAgent.__init__()` for execution tracking |
| 32 | +- Added optional `config` parameter to `SentienceAgent.__init__()` for advanced configuration |
| 33 | +- Automatic tracing throughout `act()` method when tracer is provided |
| 34 | +- All tracing is **opt-in** - backward compatible with existing code |
| 35 | + |
| 36 | +### Changed |
| 37 | +- Bumped version from `0.11.0` to `0.12.0` |
| 38 | +- Updated `__init__.py` to export new modules: `AgentConfig`, `Tracer`, `TraceSink`, `JsonlTraceSink`, `TraceEvent`, and utility functions |
| 39 | +- Added `MANIFEST.in` to include JSON schema files in package distribution |
| 40 | + |
| 41 | +### Fixed |
| 42 | +- Fixed linting errors across multiple files: |
| 43 | + - `sentience/cli.py` - Removed unused variable `code` (F841) |
| 44 | + - `sentience/inspector.py` - Removed unused imports (F401) |
| 45 | + - `tests/test_inspector.py` - Removed unused `pytest` import (F401) |
| 46 | + - `tests/test_recorder.py` - Removed unused imports (F401) |
| 47 | + - `tests/test_smart_selector.py` - Removed unused `pytest` import (F401) |
| 48 | + - `tests/test_stealth.py` - Added `noqa` comments for intentional violations (E402, C901, F541) |
| 49 | + - `tests/test_tracing.py` - Removed unused `TraceSink` import (F401) |
| 50 | + |
| 51 | +### Documentation |
| 52 | +- Updated `README.md` with comprehensive "Advanced Features" section covering tracing and utilities |
| 53 | +- Updated `docs/SDK_MANUAL.md` to v0.12.0 with new "Agent Tracing & Debugging" section |
| 54 | +- Added examples for: |
| 55 | + - Basic tracing setup |
| 56 | + - AgentConfig usage |
| 57 | + - Snapshot digests for loop detection |
| 58 | + - LLM prompt formatting |
| 59 | + - Custom trace sinks |
| 60 | + |
| 61 | +### Testing |
| 62 | +- Added comprehensive test suites for new modules: |
| 63 | + - `tests/test_tracing.py` - 10 tests for tracing infrastructure |
| 64 | + - `tests/test_utils.py` - 22 tests for digest utilities |
| 65 | + - `tests/test_formatting.py` - 9 tests for LLM formatting |
| 66 | + - `tests/test_agent_config.py` - 9 tests for configuration |
| 67 | +- All 50 new tests passing ✅ |
| 68 | + |
| 69 | +### Migration Guide |
| 70 | + |
| 71 | +#### For Existing Users |
| 72 | +No breaking changes! All new features are opt-in: |
| 73 | + |
| 74 | +```python |
| 75 | +# Old code continues to work exactly the same |
| 76 | +agent = SentienceAgent(browser, llm) |
| 77 | +agent.act("Click the button") |
| 78 | + |
| 79 | +# New optional features |
| 80 | +tracer = Tracer(run_id="run-123", sink=JsonlTraceSink("trace.jsonl")) |
| 81 | +config = AgentConfig(snapshot_limit=100, temperature=0.5) |
| 82 | +agent = SentienceAgent(browser, llm, tracer=tracer, config=config) |
| 83 | +agent.act("Click the button") # Now traced! |
| 84 | +``` |
| 85 | + |
| 86 | +#### Importing New Modules |
| 87 | + |
| 88 | +```python |
| 89 | +# Tracing |
| 90 | +from sentience.tracing import Tracer, JsonlTraceSink, TraceEvent, TraceSink |
| 91 | + |
| 92 | +# Configuration |
| 93 | +from sentience.agent_config import AgentConfig |
| 94 | + |
| 95 | +# Utilities |
| 96 | +from sentience.utils import ( |
| 97 | + compute_snapshot_digests, |
| 98 | + canonical_snapshot_strict, |
| 99 | + canonical_snapshot_loose, |
| 100 | + sha256_digest |
| 101 | +) |
| 102 | + |
| 103 | +# Formatting |
| 104 | +from sentience.formatting import format_snapshot_for_llm |
| 105 | +``` |
| 106 | + |
| 107 | +### Notes |
| 108 | +- This release focuses on developer experience and debugging capabilities |
| 109 | +- No changes to browser automation APIs |
| 110 | +- No changes to snapshot APIs |
| 111 | +- No changes to query/action APIs |
| 112 | +- Fully backward compatible with v0.11.0 |
| 113 | + |
| 114 | +--- |
| 115 | + |
| 116 | +## [0.11.0] - Previous Release |
| 117 | + |
| 118 | +(Previous changelog entries would go here) |
0 commit comments