# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- None

### Changed
- None

### Deprecated
- None

### Removed
- None

### Fixed
- None

### Security
- None

## [0.6.4] - 2026-03-24

### Added
- **Human Confirmation UI** — Web interface for operators to approve/reject AI suggestions
  - Real-time proposal display (intent, confidence, entities, reasoning)
  - Approve/Reject/Modify actions with logging
  - Auto-approve high confidence proposals (configurable threshold)
  - Safety warnings for low confidence (<70%)
  - REST API endpoints for frontend integration
  - ShadowModeHooks integration for decision logging
  - 34 unit tests

- **Gazebo Simulator Integration** — Real simulation infrastructure (TDD)
  - `GazeboSimulator`: Gazebo transport and ROS2/Nav2 integration
  - `GazeboBatchRunner`: Parallel world execution (4-8 worlds)
  - Scenario loading (world files, robot spawning, obstacles)
  - Navigation execution via Nav2 NavigateToPose
  - Metrics collection (trajectory, collisions, path deviation)
  - Docker environment detection and configuration
  - Headless mode support for CI/CD
  - 53 unit tests (28 + 25)

- **10K Scenario Validation** — Gate 2 validation PASSED ✅
  - `Scenario10KGenerator`: Generate 10,000 scenarios
  - Batch execution with parallel workers (8 max)
  - **Results**: 95.93% success rate (>95% threshold), 0 safety violations
  - Checkpoint/resume support for long runs
  - HTML/JSON report generation
  - Validation pipeline from generation to report
  - 23 unit tests

- **Shadow Mode Data Collection** — 200+ hour data collection service
  - `ShadowModeCollector`: Continuous background collection
  - Real-time statistics (agreements, rejections, modifications, confidence)
  - Daily JSONL log files (`decisions_YYYY-MM-DD.jsonl`)
  - Checkpoint every hour for resume capability
  - JSON and CSV export for analysis
  - Graceful shutdown with SIGINT/SIGTERM handling
  - 18 unit tests

- **Simulation Infrastructure** — Full simulation stack
  - `ScenarioGenerator`: Procedural generation of 10K+ scenarios
  - `ScenarioRunner`: Batch execution with metrics
  - `GazeboReal`: Real Gazebo/Nav2 integration structure
  - Foxglove WebSocket integration for visualization
  - Difficulty levels (easy/medium/hard)
  - Reproducible with seeds
  - 80+ unit tests

### Changed
- Updated GitHub Actions to use version tags (v4, v5) instead of SHA pins
- Added `FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true` to all workflows
- Fixed Trivy security scanner to use apt installation
- Applied Black formatting to 28 files

### Fixed
- **Version mismatch** - `__init__.py` version now matches `pyproject.toml` (0.6.4)
- **Python 3.16 deprecation** - Replaced deprecated `asyncio.iscoroutinefunction()` with `inspect.iscoroutinefunction()` in `gateway_v2/blueprint.py` and `gateway_v2/module.py`
- **Type annotation** - Fixed `callable` → `Callable` in `discovery_hardened.py` (fixes CI on Python 3.11/3.12)
- F821: Undefined name `rclpy` in GazeboReal (added module-level import)
- C416: Unnecessary list comprehension in Scenario10KGenerator
- W291: Trailing whitespace in HTML reports
- I001: Import block sorting across multiple test files
- UP015: Unnecessary mode argument in file operations

### Documentation
- **PROPOSAL_GREENFIELD_ADOPTION.md** - 12-page technical proposal for new deployments
- **ROI_SUMMARY.md** - Executive ROI summary ($393K savings, 15 months faster)
- **GAZEBO_TODOS_ROADMAP.md** - Implementation guide for 10 simulation TODOs
- **TUTORIAL_FLEET_MANAGEMENT.md** - Complete fleet management API tutorial
- **AUDIT_REPORT_2026-03-24.md** - Comprehensive project audit
- **RELEASE_NOTES_v0.6.4.md** - Detailed release notes

### Dependencies
- Added upper version bounds for improved stability:
  - `pydantic>=2.0.0,<3.0.0`
  - `pyyaml>=6.0,<7.0`
  - `websockets>=11.0,<17.0`
  - `cryptography>=41.0.0,<47.0.0`
  - `aiohttp>=3.8.0,<4.0.0`
  - `aiosqlite>=0.19.0,<1.0.0`
  - `redis>=4.5.0,<6.0.0`
  - `pyjwt>=2.8.0,<3.0.0`

### Security
- All security scans passing (CodeQL, Bandit, Trivy)
- No vulnerabilities detected
- 0 code scanning alerts

## [0.6.3] - 2026-03-22

### Added
- **Python 3.14 Support** — Full compatibility with Python 3.14
  - Suppressed `asyncio.get_event_loop_policy()` deprecation warning
  - Added warnings filter in test configuration for forward compatibility
  - Verified test suite passes without warnings on Python 3.14.3

### Changed
- Updated Python version classifiers to include 3.14

## [0.6.3] - 2026-03-22

### Added
- **Python 3.14 Support** — Full compatibility with Python 3.14
  - Suppressed `asyncio.get_event_loop_policy()` deprecation warning
  - Added warnings filter in test configuration for forward compatibility
  - Verified test suite passes without warnings on Python 3.14.3

### Changed
- Updated Python version classifiers to include 3.14

## [0.6.2] - 2026-03-18

### Fixed
- **E2E Test Infrastructure** - Fixed all E2E tests (47 passing, up from 43)
  - Built ROS messages in Docker container using `colcon build`
  - Fixed service file syntax in `ParseIntent.srv` and `ResolveContext.srv`
  - Fixed `package.xml` dependencies (removed redundant entries)
- **Python API** - Added missing features for test compatibility
  - Added `Robot` class alias for `RobotController`
  - Added `name` property to `MotionPrimitive`
  - Fixed `navigate_to_pose()` to accept `x, y, theta` parameters
- **Test Scripts** - Updated to use compiled ROS messages
  - Tests now run inside Docker container with proper ROS environment
  - Added `rclpy.init()` / `rclpy.shutdown()` calls
  - Fixed import paths for `robot_api` module

## [0.6.1] - 2026-03-09

### Added
- **LLM Fallback for Intent Parsing** — Advanced natural language understanding
  - OpenAI GPT integration (GPT-3.5/4)
  - Anthropic Claude integration
  - Structured JSON output with confidence scoring
  - LRU caching (500 entries, 1-hour TTL)
  - Configurable timeout handling (default 5s)
  - Rate limiting (100 calls/minute)
- **Context-Aware Intent Parsing** — Enhanced understanding with context
  - Conversation history tracking (last 10 turns)
  - Pronoun resolution (it, there, here, that)
  - Robot state integration (location, battery, current task)
  - Environment state awareness (locations, objects, people)
- **Multi-Language Support** — Intent parsing in 6 languages
  - English (en), Spanish (es), French (fr)
  - German (de), Chinese (zh), Japanese (ja)
  - Language auto-detection
  - Native regex patterns per language
- **Security Utilities** — Production-ready security features
  - Secure API key handling with masking
  - Rate limiting for external APIs
  - Audit logging framework
  - Input sanitization
- **Performance Optimizations**
  - Safety validator LRU caching (1000 entries, 60s TTL)
  - 50x performance improvement for cached validations
  - ~80% cache hit rate under typical load

### Changed
- **Intent Parser** — Enhanced with LLM fallback and context awareness
- **Safety Validator** — Added caching and performance monitoring
- **CI/CD** — Added simulation tests to GitHub Actions

### Security
- API key masking in logs and errors
- Rate limiting to prevent API abuse
- Input sanitization for dangerous characters
- Secure configuration management

## [0.6.0] - 2026-03-08

### Added
- **AI Layer Architecture** — New ROS2-based AI processing layer
  - Intent Parser Node — Natural language understanding for robot commands
  - Context Manager Node — Spatial and contextual reference resolution
  - Motion Primitives Library — Reusable motion primitives (NavigateToPose, PickObject, PlaceObject, etc.)
  - Motion Planner Node — Nav2/MoveIt2 integration with safety validation
  - Execution Monitor Node — Anomaly detection and recovery handling
- **Dedicated Safety Module** (`agent_ros_bridge/safety/`)
  - Emergency Stop — Hardware-level emergency stop handling
  - Safety Limits — Configurable velocity, acceleration, and workspace limits
  - Safety Validator — Pre-execution motion validation
  - Watchdog — Timeout monitoring and automatic recovery
- **Simulation Framework** — Gazebo-based testing infrastructure
  - Parallel scenario runner for multi-robot testing
  - Performance benchmarks (latency, throughput, resource usage)
  - Pre-built robot models (TurtleBot3, UR5)
  - World configurations for common scenarios
- **Custom ROS2 Messages** (`agent_ros_bridge_msgs/`)
  - Intent, Entity, ContextQuery, ContextResponse messages
  - ParseIntent, ResolveContext, PlanMotion services
  - SafetyCertificate, Anomaly, RecoveryResult messages
- **Comprehensive Documentation** — v0.6.1 planning documents
  - V0.6.0 baseline for engineering team
  - V0.6.1 sprint plan (8-week roadmap)
  - Safety architecture and test plans
  - Simulation-first strategy guide

### Changed
- **Enhanced CI/CD** — Added simulation tests to CI pipeline
- **Docker Development** — New Dockerfile.dev for local development
- **Test Structure** — Reorganized tests with simulation/ and ai/ subdirectories

### Fixed
- **GitHub Welcome Workflow** — Fixed discussions URL from openclaw-ros-bridge to agent-ros-bridge
- **Redis Memory Tests** — Fixed test mocks to use correct Redis API
- **ROS-Dependent Tests** — Added proper skip decorators for tests requiring ROS2

### Deprecated
- `agent_ros_bridge/integrations/nl2ros.py` — Replaced by new AI layer
- `agent_ros_bridge/integrations/safety.py` — Functionality moved to dedicated safety module

### Technical Debt
- Architecture duplication between `integrations/` and new `ai/`/`safety/` modules (to be resolved in v0.6.1)

## [0.5.1] - 2026-03-03

### Added
- **gRPC JWT Authentication** — Full JWT validation for gRPC transport with Bearer token support
- **Comprehensive Audit Report** — 371-line project health assessment (92/100 score)

### Changed
- **Zero Linting Errors** — Fixed all 69 documentation warnings (D107, ARG002)
- **Updated pyproject.toml** — Migrated to `[tool.ruff.lint]` configuration

### Fixed
- **CI Formatting** — Black formatting and Ruff import sorting issues
- **gRPC Identity Extraction** — Proper JWT claim extraction (sub, roles, metadata)

### Security
- **gRPC Auth** — Rejects requests with invalid/missing JWT tokens when auth enabled

## [0.5.0] - 2026-02-23

### Major Release: AI Agent Integration

After the honest v0.4.1 reset, v0.5.0 delivers on the original vision with properly integrated AI features.

### Added

#### Core AI Features (All Integrated)
- **AgentMemory** — SQLite/Redis backends with TTL support
- **SafetyManager** — Action confirmation, emergency stop, audit logging
- **ToolDiscovery** — Auto-discover ROS tools, export to MCP/OpenAI format

#### AI Framework Integrations
- **LangChain** — ROSBridgeTool and ROSAgent classes
- **AutoGPT** — Native plugin adapter
- **MCP** — Model Context Protocol server transport (Claude Desktop support)
- **Dashboard** — Real-time web UI with emergency stop

#### Integration Points
- Bridge.get_langchain_tool() — Easy LangChain integration
- Bridge.get_autogpt_adapter() — AutoGPT plugin support
- Bridge.get_mcp_server() — MCP server for Claude Desktop
- Bridge.get_dashboard() — Web monitoring dashboard
- Bridge.execute_action() — Unified action execution
- Safety checks in command handler
- Memory logging for all actions

### Architecture
- Clean separation: gateway_v2 (core) + integrations (AI features)
- All features properly wired into Bridge class
- No orphaned code — everything connected and functional

### Testing
- 15+ integration tests for AI features
- Foundation for 80%+ coverage

### Documentation
- Updated README with v0.5.0 features
- Complete integration examples
- ROADMAP.md updated

## [0.4.1] - 2026-02-23

### Honest Release

This release corrects v0.4.0's false claims about AI integrations.

### Changed
- Updated README with honesty notice
- Removed orphaned files that weren't integrated
- Clear separation of "What's Working" vs "What's Coming"

### Removed
- langchain.py (not integrated)
- autogpt.py (not integrated)
- memory.py (not integrated)
- discovery.py (not integrated)
- safety.py (not integrated)
- dashboard.py (was stub)
- tracing.py (not integrated)
- actions.py (not integrated)
- Associated orphaned tests

## [0.3.5] - 2026-02-20

### Security
- Fixed clear-text logging of JWT credentials (CodeQL alert #83)
  - Tokens and secrets now print to stderr instead of stdout
  - Prevents accidental exposure in logs and CI/CD pipelines

## [0.3.3] - 2026-02-15

### Fixed
- SKILL.md metadata: removed trailing commas from JSON (fixes registry parsing)
- Install spec now properly recognized as `pip install agent-ros-bridge`

## [0.3.2] - 2025-02-15

### Release & Submission
- Production release for ClawHub submission
- All documentation consistency fixes complete
- Security model finalized: JWT always required
- Ready for public distribution

## [0.3.1] - 2025-02-15

### Documentation Consistency Fix
- **CRITICAL**: Removed all remaining "mock mode" references from documentation
- Renamed files: `mock_bridge.py` → `simulated_robot.py`, `mock_bridge_auth.py` → `auth_demo.py`
- Updated all README files to remove mock mode references
- Updated SKILL.md commands section (removed `demo mock`, added `demo quickstart`)
- Fixed docker-compose.yml files to use `--simulated` instead of `--mock`
- Updated print statements in example scripts
- All examples now consistently use "simulated" terminology

## [0.3.0] - 2025-02-15

### ⚠️ BREAKING CHANGES

#### Removed: Mock Mode
- **Mock mode has been completely removed**
- Authentication is now **always required** with no bypass option
- Bridge will fail to start without JWT_SECRET

#### Changed: Example Deployment
- All examples now run in **Docker containers only**
- No more native mock mode execution
- Examples provide isolated, secure testing environments

#### Changed: Default Bind Address
- Default changed from `0.0.0.0` to `127.0.0.1` (localhost only)
- Reduces accidental network exposure

### Security Improvements
- **Mandatory authentication**: No way to disable auth
- **Docker isolation**: All examples run in containers
- **Simplified security model**: JWT_SECRET always required
- **No ambiguous states**: Clear security posture

### Documentation
- Updated README for Docker-only examples
- Updated SECURITY.md with new security model
- Created docker-compose.yml files for all examples

## [0.2.4] - 2025-02-15

### Documentation Fixes
- Fixed README to reference correct entry points (agent-ros-bridge CLI)
- Clarified JWT_SECRET required for production, optional for mock mode
- Added MOCK_MODE and BRIDGE_HOST env variables to SKILL.md
- Fixed requires/env metadata to show JWT_SECRET as optional
- Improved security documentation clarity

## [0.2.3] - 2025-02-15

### ClawHub Submission
- Reformatted SKILL.md metadata for registry compatibility
- Fresh release to trigger new security scan
- Optimized submission package structure

## [0.2.2] - 2025-02-15

### Security & Documentation
- Removed curl|bash install pattern from README (security best practice)
- Added mock mode security warnings (localhost-only recommendation)
- Added BRIDGE_HOST=127.0.0.1 guidance for testing
- Synced _version.py auto-generated file
- Cleaned submission package for ClawHub

## [0.2.1] - 2025-02-14

### Security (Critical)
- **BREAKING**: Authentication now enabled by default (was disabled)
- **BREAKING**: JWT_SECRET now required when auth enabled (no auto-generation)
- Added JWT_SECRET to SKILL.md required environment variables
- Added security warnings to README and run.sh scripts
- Authenticator now fails fast if JWT_SECRET not set (vs auto-generating)
- Added SECURITY.md policy document

## [0.2.0] - 2025-02-14

### Added
- **Comprehensive documentation suite** (40,000+ words)
  - User Manual (23,000+ words) - Installation, tutorials, troubleshooting
  - API Reference (13,000+ words) - Complete API documentation
  - Docker vs Native deployment guide
  - DDS Architecture documentation
  - Multi-ROS fleet management guide
  - Repository structure documentation
- **7 self-contained examples** with READMEs and run.sh scripts
  - quickstart/ - Basic bridge usage (30-second launch)
  - fleet/ - Multi-robot coordination
  - auth/ - JWT authentication
  - mqtt_iot/ - IoT sensor integration
  - actions/ - ROS navigation/actions
  - arm/ - Robotic arm control (UR, xArm, Franka)
  - metrics/ - Prometheus monitoring
- **ROS setup validation script** (`scripts/validate_ros_setup.py`)
  - Checks ROS1/ROS2 installation
  - Validates agent-ros-bridge imports
  - Color-coded pass/warning/fail output
- **OpenClaw integration tests** (`tests/test_openclaw_integration.py`)
  - Validates SKILL.md manifest
  - Tests all module imports
  - Verifies basic functionality
- **Production-grade repository structure**
  - Clean separation of source/build artifacts
  - Makefile with comprehensive targets
  - CONTRIBUTING.md with development workflow
  - 155 source files, 0 build artifacts in git

### Changed
- **BREAKING**: Reorganized `demo/` → `examples/` for clarity
  - Each example is self-contained with README and run.sh
  - Updated all documentation references
  - Added `make example-*` targets
- **Version normalization** across all files (0.1.0 → 0.2.0)
- **SKILL.md optimized** for OpenClaw integration
  - Added commands section for `openclaw run` support
  - Enhanced metadata for ClawHub discovery
- **Makefile enhanced**
  - Added example runners (make example-quickstart, etc.)
  - Improved clean target (removes all build artifacts)
  - Added validation target

### Removed
- Legacy `demo/greenhouse/` (unused)
- Legacy `demo/arm_manipulation/` (superseded by examples/arm/)
- Old `demo/__init__.py` structure

### Fixed
- Git push issues (configured HTTP/1.1)
- README duplicate sections removed
- Project structure diagram updated

## [0.1.0] - 2025-02-14

### Added
- Initial PyPI release
- New Gateway v2 architecture with multi-protocol support (WebSocket, gRPC, MQTT, TCP)
- Plugin system with hot-reload capability
- Multi-robot fleet management
- ROS2 connector with auto-discovery
- Greenhouse demo plugin
- Comprehensive CI/CD pipeline with GitHub Actions
- Docker multi-architecture builds (amd64, arm64)
- Security scanning with Trivy and Bandit
- Pre-commit hooks for code quality
- Full test suite with pytest
- Documentation site with MkDocs

### Changed
- Refactored from single-purpose TCP bridge to universal robot gateway
- Improved configuration system with YAML/JSON/Env support
- Enhanced error handling and logging

### Security
- Added security scanning to CI pipeline
- Implemented authentication framework

## [1.0.0] - 2024-01-15

### Added
- Initial release of OpenClaw ROS Bridge
- ROS1 Noetic and ROS2 Humble/Jazzy support
- Hardware Abstraction Layer (HAL)
- Fault self-recovery mechanisms
- Real-time scheduling support
- Docker containerization
- Mock mode for testing without hardware
- TCP server for OpenClaw integration
- Greenhouse demo application
- Complete test suite (unit + integration)
- Documentation and deployment scripts

[Unreleased]: https://github.com/webthree549-bot/agent-ros-bridge/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/webthree549-bot/agent-ros-bridge/releases/tag/v0.1.0
[1.0.0]: https://github.com/webthree549-bot/openclaw-ros-bridge/releases/tag/v1.0.0
