54 Commits

Author SHA1 Message Date
ClearGrow Agent
ae82434d6f Merge issue/CG-44 to main
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
2025-12-11 15:53:14 -07:00
ClearGrow Agent
848d5eb484 Merge issue/CG-38 to main
Some checks failed
ci/woodpecker/push/build Pipeline failed
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
2025-12-11 15:52:44 -07:00
ClearGrow Agent
c8dac91cb2 Merge issue/CG-39 to main
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
ci/woodpecker/push/build Pipeline failed
2025-12-11 15:49:11 -07:00
ClearGrow Agent
6be3a4a06f fix: CG-44 add proactive filesystem error handling for storage backends
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Add comprehensive filesystem error detection and handling:
- SPIFFS: Check free space before writes, fail with ESP_ERR_STORAGE_FULL if <25KB (~5%)
- SD Card: Check free space before writes, fail with ESP_ERR_STORAGE_FULL if <10MB
- Mount state: Log actionable errors on first occurrence when backends unavailable
- Error recovery: Reset warning state when space recovers above 2x threshold

API changes:
- storage_info_t: Add spiffs_mounted, spiffs_error, sd_error fields
- storage_error_state_t enum: ok, not_mounted, full, io_error, corrupt
- REST API /api/logs: Add nested spiffs{} and sd{} objects with error states

Integration:
- history_cache_record(): SPIFFS space check before writes
- storage_data_logger_record(): SD space check before daily file writes
- storage_get_info(): Populate new error state fields
- status_led: Set LED_PATTERN_WARNING on storage errors
- error_log: Add actionable messages ("SPIFFS full - reduce probe count")

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 15:20:56 -07:00
ClearGrow Agent
22aed4b4de fix: CG-39 implement checksum validation enforcement and recovery
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Add robust checksum validation for multi-controller state sync:

- Return ESP_ERR_INVALID_CRC error on checksum mismatch (in strict mode)
- Automatically request full snapshot from leader on checksum failure
- Add configurable validation strictness via CONFIG_CONTROLLER_SYNC_STRICT_CHECKSUM
- Log checksum failures to persistent error log for diagnostics
- Add retry counter to prevent infinite snapshot request loops (max 3 retries)
- Emit CLEARGROW_EVENT_SYNC_CHECKSUM_FAILED event for monitoring

Implementation details:
- New handle_checksum_failure() function centralizes recovery logic
- Default permissive mode logs warnings but allows sync to proceed
- Strict mode rejects mismatched syncs and triggers automatic recovery
- Event data includes checksum values, retry count, and recovery status

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 15:18:04 -07:00
ClearGrow Agent
9576f2503c fix: CG-38 enforce HTTPS-only in production mode
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Production builds now reject HTTP configuration for security:
- network_api_start_server() returns ESP_ERR_INVALID_ARG if http_port > 0
  when CONFIG_NETWORK_API_PRODUCTION_MODE is enabled
- Development mode logs detailed security warnings about HTTP usage
- Improved warning messages when HTTP enabled with secure boot
- Updated Kconfig documentation to clarify production mode behavior

This prevents accidental exposure of API keys, JWT tokens, and sensor
data over unencrypted HTTP connections in production environments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 15:10:01 -07:00
ClearGrow Agent
3b706e55d3 Merge issue/CG-51 to main
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
2025-12-11 09:56:27 -07:00
ClearGrow Agent
bcc25e8ae1 fix: CG-51 add WiFi event handler stack monitoring and document coexistence
All checks were successful
ci/woodpecker/push/build Pipeline was successful
- Add stack high-water mark logging to WiFi/IP event handlers (DEBUG level)
- Document coexistence findings: BLE not used, Thread uses external RCP
- Document event handler stack safety: ~1200-1500 bytes worst case,
  3584 bytes available (>50% margin)
- Clarify wifi_manager uses event-driven pattern (no dedicated task)

Stack monitoring:
- log_event_handler_stack() called after disconnect and got_ip handling
- Rate-limited to avoid spam (30s interval)
- Warns if usage exceeds 70% of event loop stack

Analysis (CG-51):
- Coexistence NOT required: provisioning uses SoftAP, not BLE
- Event handler stack is safe with >50% margin
- Current event-driven architecture is appropriate

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 09:48:53 -07:00
ClearGrow Agent
d43ede7c23 Merge issue/CG-31 to main
Some checks failed
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ci/woodpecker/push/build Pipeline was successful
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
2025-12-11 09:35:57 -07:00
ClearGrow Agent
689893089e fix: CG-31 add GPIO hold validation and CONFIG option for light sleep
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Add error checking for gpio_hold_en()/gpio_hold_dis() return values with
warnings logged on failure. Add CONFIG_CLEARGROW_PM_GPIO_HOLD option
(default y) to enable/disable GPIO hold for testing wake-from-sleep.

Document which peripherals require GPIO hold vs ESP-IDF driver handling:
- REQUIRED: SD_CS, RCP_RESET (must hold to prevent glitches)
- RECOMMENDED: LCD_BACKLIGHT (LEDC preserves, but hold is safer)
- NOT REQUIRED: Touch I2C (driver reinits, but hold prevents corruption)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 09:28:46 -07:00
ClearGrow Agent
bbfe64ba51 Merge issue/CG-67 to main
Some checks failed
ci/woodpecker/push/build Pipeline failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
2025-12-11 08:21:42 -07:00
ClearGrow Agent
6f286190a4 fix: CG-66 add test complete comment to README.md
All checks were successful
ci/woodpecker/push/build Pipeline was successful
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 08:08:53 -07:00
ClearGrow Agent
35d6b2de6d Merge issue/CG-19 to main
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
2025-12-11 06:53:10 -07:00
ClearGrow Agent
f1161ebb46 Merge issue/CG-22 to main
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
2025-12-11 06:40:07 -07:00
ClearGrow Agent
f460ff98c5 fix: CG-19 add retry events to common/app_events.h
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Add missing CLEARGROW_EVENT_PAIRING_RETRY and CLEARGROW_EVENT_PAIRING_SKIP_RETRY
events and pairing_retry_event_data_t structure to the common component's
app_events.h header file.

The retry logic implementation in code_pairing.c includes app_events.h from
common (via thread_manager's REQUIRES dependency), but the new retry events
were only added to main/app_events.h. This caused a build failure because
the types and event IDs were undefined.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 06:39:57 -07:00
ClearGrow Agent
f89bf715be Merge issue/CG-20 to main
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ci/woodpecker/push/build Pipeline failed
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
2025-12-11 06:38:12 -07:00
ClearGrow Agent
c0a8e31c67 fix: CG-19 add automatic retry logic for code-based pairing
Some checks failed
ci/woodpecker/push/build Pipeline failed
Implements automatic retry mechanism when probe pairing times out:

- Add CONFIG_CODE_PAIRING_MAX_RETRIES (default: 2) to Kconfig
- Add retry_count, max_retries, skip_retry fields to pairing_state_t
- Modify code_pairing_handle_timeout() to retry before failing
- Preserve PSKd across retries via NVS persistence
- Add CLEARGROW_EVENT_PAIRING_RETRY event for UI notifications
- Add code_pairing_skip_retry() and code_pairing_get_retry_info() APIs
- Update scr_pairing_progress.c with retry status display
- Add Skip Retry button for users to abort retries early
- Add comprehensive unit tests for retry logic

User experience improvements:
- Pairing now automatically retries up to 2 times (3 total attempts)
- Progress screen shows "Attempt X of Y" during retries
- Skip Retry button allows early abort of remaining retries
- PSKd preserved - no need to re-enter code on retry

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 06:29:34 -07:00
ClearGrow Agent
af019bcc22 fix: CG-22 document OpenThread version requirements and add RCP version check
All checks were successful
ci/woodpecker/push/build Pipeline was successful
- Add THREAD_RCP_MIN_VERSION constants to thread_br.h (1.3.0)
- Implement rcp_version_check() function to validate RCP firmware version
- Return ESP_ERR_NOT_SUPPORTED if RCP version is incompatible
- Log version comparison and error details at initialization
- Add error_log entry for version mismatch for user visibility
- Document version requirements in CLAUDE.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 06:26:23 -07:00
ClearGrow Agent
fdcf6b0958 fix: CG-20 add touch calibration verification and coordinate validation
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Add calibration verification logging to help diagnose touch panel
configuration issues:

- Log first 5 touch coordinates at INFO level after initialization
- Display expected coordinate ranges (0-799 X, 0-479 Y)
- Warn if calibration touches exceed expected ranges

Add runtime coordinate validation:
- Track total touches and out-of-range count
- Log warning if >5% of touches are out-of-range
- Includes guidance to check swap_xy/mirror_x/mirror_y flags

This helps diagnose touch mapping issues without requiring
manual testing or a dedicated calibration utility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 06:24:41 -07:00
ClearGrow Agent
7ca6fff539 Merge issue/CG-29 to main
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
2025-12-11 06:08:20 -07:00
ClearGrow Agent
457fa1615d fix: CG-29 move watchdog_init() before NVS for early coverage
All checks were successful
ci/woodpecker/push/build Pipeline was successful
Move watchdog initialization before NVS to provide watchdog coverage
during NVS initialization, which can rarely hang due to flash corruption
or hardware faults.

Changes:
- Add watchdog_enable_boot_loop_detection() function that defers
  NVS-based persistent reset count tracking until after NVS is ready
- Move watchdog_init() to before init_nvs() in app_main.c
- Call watchdog_enable_boot_loop_detection() immediately after NVS init
- Update watchdog.h documentation with two-tier boot loop detection:
  1. RTC memory (immediate, no NVS dependency)
  2. NVS-based (persistent, requires NVS)

The RTC-based boot loop detection using RTC_NOINIT_ATTR memory works
immediately without NVS, providing coverage during early boot. The
NVS-based tracking is supplementary for persistent stats across power
cycles.

Initialization order is now:
1. status_led_init()                      // No dependencies
2. watchdog_init(&config)                 // RTC-based detection active
3. init_nvs()                             // Now protected by watchdog
4. watchdog_enable_boot_loop_detection()  // Enable NVS-based tracking

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 05:57:52 -07:00
ClearGrow Agent
3a283a4fd4 Merge issue/CG-32 to main
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
2025-12-11 05:55:35 -07:00
ClearGrow Agent
e47557493d fix: CG-32 handle NVS write failures in error_log_add()
All checks were successful
ci/woodpecker/push/build Pipeline was successful
- Check return value of save_to_nvs() in error_log_add()
- Set nvs_write_failed flag when NVS persistence fails
- Log warning message when persistence fails
- Update status LED to indicate degraded error logging
- Add error_log_get_status() API to expose persistence state
- Add error_log_status_t structure with nvs_persistence_ok and entries_in_ram
- Add error_log_nvs_ok field to scr_health_data_t for UI display
- Display warning in System Health > Errors screen when NVS persistence fails

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 05:48:01 -07:00
CI System
5bfcbf414b Add Woodpecker CI pipeline with Gitea release upload
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/build Pipeline was successful
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
Release Build / Build and Release Firmware (push) Has been cancelled
- ESP-IDF v5.3 Docker image for building
- Builds on push, PR, and tag events
- Uploads firmware binaries to Gitea releases on tags
- Includes bootloader, partition table, and ELF with debug symbols

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
v0.1.0
2025-12-10 20:58:50 -07:00
CI System
40d78e553a Fix YAML syntax in Woodpecker pipeline
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
Quote echo commands containing colons to prevent YAML parsing errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 20:01:40 -07:00
CI System
0e2badca8c Add Woodpecker CI pipeline for ESP-IDF builds
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
Migrating from TeamCity to Woodpecker CI. Pipeline:
- Triggers on push and pull requests
- Uses espressif/idf:v5.3 Docker image
- Builds ESP32-S3 target with parallel jobs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 19:47:09 -07:00
CI System
81c5b51bc2 Merge issue/CG-47 to main
Some checks failed
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
2025-12-10 19:39:00 -07:00
CI System
f7c5dbbb9a Merge issue/CG-30 to main
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
2025-12-10 19:38:51 -07:00
ClearGrow Agent
3966cb42d8 fix: #47 document trans_timeouts stat as N/A for SD-only config
Add documentation explaining that the trans_timeouts statistic in
spi_bus_stats_t is not applicable to SD card operations because
the SD card uses the sdspi driver which manages its own transactions.
This counter is reserved for future devices (NFC, external display)
that will use spi_bus_transmit_timeout() for direct SPI access.

Changes:
- Add detailed doc comment to trans_timeouts field in header
- Add explanatory comment in spi_bus_log_stats()
- Add debug log line showing "N/A for SD-only config" when 0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 19:23:52 -07:00
ClearGrow Agent
003dfb9064 fix: #30 add ota_manager dependency to network_api component
The previous commit added OTA manager API calls to network_api.c but
forgot to add the ota_manager component to the CMakeLists.txt REQUIRES
list, causing build failures.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 19:13:19 -07:00
ClearGrow Agent
5294756c5d fix: #30 improve OTA downgrade policy with logging, UI dialog, and API
Add comprehensive downgrade detection and handling to prevent security
vulnerabilities from being unknowingly reintroduced:

- Document downgrade policy in ota_manager.h header comments
- Add ota_downgrade_reason_t enum for classifying downgrade type
- Add is_downgrade and downgrade_reason fields to ota_update_info_t
- Add downgrade_attempts counter to ota_stats_t for monitoring
- Log all downgrade attempts at WARNING level with version details
- Update REST API /api/ota to include downgrade status in response
- Require confirm_downgrade=true in /api/ota/start for downgrades
- Add UI confirmation dialog for downgrades (destructive button style)
- Block downgrades by default when allow_downgrade=false

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 19:00:07 -07:00
CI System
2a98235909 fix: add watchdog to network_api dependencies
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
network_api.c includes watchdog.h but watchdog was missing from
CMakeLists.txt dependencies.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 17:46:58 -07:00
CI System
bc242529fc fix: link automation component in ui to resolve alert_history symbols
Some checks failed
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
Move automation from PRIV_REQUIRES to REQUIRES in ui component.
This ensures proper linker ordering for alert_history_* functions
called from cg_state.c.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 17:41:19 -07:00
ClearGrow Agent
1947a50c0b fix: #34 add power management monitoring and statistics
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
- Add esp_pm_dump_locks() logging to watchdog monitor task every 60s
- Add log_pm_stats() function to display CPU frequency and PM lock status
- Add watchdog_pm_stats_t struct and watchdog_get_pm_stats() API
- Add power management metrics to /api/status REST endpoint
- Add PM stats unit tests (null param, valid data, frequency range)

Changes:
- components/watchdog/src/watchdog.c: Add PM stats logging and API
- components/watchdog/include/watchdog.h: Add watchdog_pm_stats_t type
- components/network_api/src/network_api.c: Add power section to /api/status
- test/unit/test_watchdog.c: Add PM stats test cases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 17:32:42 -07:00
ClearGrow Agent
56458a074c fix: #23 move Thread BR task creation into component
Some checks failed
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
Move FreeRTOS task creation from app_main.c into thread_manager component
for better encapsulation. The component now owns its complete task lifecycle.

Changes:
- Add thread_br_start_task() to create task with correct parameters
- Define task constants in header (stack=10240, priority=5, core=0)
- Add stack high-water mark monitoring for health tracking
- Document task parameters in thread_br.h

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 17:03:15 -07:00
CI System
9346841f0a fix: resolve circular dependency linker error with WHOLE_ARCHIVE
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
The automation and ui components have a circular dependency:
- ui calls alert_history_* from automation
- automation calls cg_state_* from ui

Adding WHOLE_ARCHIVE ensures all symbols from the automation library
are included regardless of link order, fixing undefined reference errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 16:43:44 -07:00
CI System
8090b2166c fix: use montserrat_14 font instead of disabled montserrat_12
Some checks failed
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
The lv_font_montserrat_12 font is not enabled in sdkconfig, causing
CI build failures. Using montserrat_14 which is already enabled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 16:34:35 -07:00
CI System
d909195dc7 refactor: trim CLAUDE.md files per best practices
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
Following Anthropic's Claude Code best practices:
- controller/CLAUDE.md: 1572 → 88 lines
- components/ui/CLAUDE.md: 674 → 123 lines

Keep concise: commands, code style, critical rules, key files.
Move detailed specs to /opt/repos/docs/reference/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-10 15:54:28 -07:00
CI System
27e4fc9dd0 chore: cleanup librarian files and fix paths
Some checks failed
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
- Remove LIBRARIAN_REVIEW_*.md files (docs belong in docs repo)
- Remove CTRL-EH-001_IMPLEMENTATION_SUMMARY.md
- Fix /root/cleargrow paths to /opt/repos in CLAUDE.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-10 15:50:44 -07:00
ClearGrow Agent
9b2e94c2e7 fix: #5 add missing delete handler for list items in cg_components_input.c
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
The previous fix missed the duplicate list item code in cg_components_input.c.
The create_list_item_base function allocates cg_list_item_data_t but did not
register a LV_EVENT_DELETE handler to free it when the object is deleted.

This adds:
- list_item_delete_cb function to free user data
- Registration of delete handler in create_list_item_base

This completes the memory leak fix for all UI components with allocated user data.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 15:42:49 -07:00
ClearGrow Agent
27ba943998 docs: complete librarian review for #17
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
2025-12-10 13:39:14 -07:00
ClearGrow Agent
e2b14c5a8e docs: document alert history API for #7
Add Alert History API documentation to CLAUDE.md:
- New Key APIs section with full usage examples
- Update Component Structure to mention alert history
- Update Memory Map to include alert history in SPIFFS
- Add Alert History to Heap Usage table (~32KB)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 13:39:05 -07:00
ClearGrow Agent
6a82cc27de docs: complete librarian review for #3
No documentation updates needed - the wifi_scan task was already
documented in CLAUDE.md with the implementation commit.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 13:38:43 -07:00
ClearGrow Agent
3305f9dcc3 docs: complete librarian review for #1
Some checks failed
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
Documentation review confirms no external documentation updates needed:
- Setup wizard docs accurate
- WiFi manager docs correct
- Init sequence docs unchanged

Changes were internal refactors (WiFi init delegation) and code
documentation (API status clarification) - no user-facing changes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 13:10:42 -07:00
ClearGrow Agent
cb4baa1249 docs: document wifi_scan task for #3
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
Add wifi_scan task to Component-Managed Tasks table in CLAUDE.md.
This task is created by wizard_backend during WiFi scanning in the
setup wizard to prevent UI blocking.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 13:04:20 -07:00
ClearGrow Agent
097a72103a fix: #3 Use non-blocking WiFi scan in setup wizard
Some checks failed
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
Replace blocking esp_wifi_scan_start() call with background task that
uses wifi_manager's non-blocking scan API.

Changes:
- Create dedicated wifi_scan_task that runs scans in background
- Use wifi_mgr_scan_start() with callback instead of blocking scan
- Add 10-second timeout for scan operations
- Add wizard_backend_cancel_scan() API for user-initiated cancellation
- Add wizard_backend_is_scanning() API to check scan state
- Clean up scan task on wizard_backend_deinit()

This prevents the UI from freezing for 3-5 seconds during WiFi scans,
allowing animated spinners and touch input to work properly.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 13:01:03 -07:00
ClearGrow Agent
e6e8002e3e docs: add alert history REST API endpoints to CLAUDE.md
Document new /api/alerts/history and /api/alerts/history/stats
endpoints added as part of issue #7 implementation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 13:00:38 -07:00
ClearGrow Agent
dcdfec166d fix: #48 Add queue usage monitoring to health_monitor_task
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
Adds runtime queue usage statistics for all four inter-task queues:

- storage.event_queue (64 items) - sensor records for averaging
- sensor_hub.log_queue (32 items) - probe data logging
- automation.webhook_queue (8 items) - HTTP webhook requests
- touch_driver.event_queue (4 items) - touch interrupt events

Changes:
- Add storage_get_queue_stats() API to storage component
- Add sensor_hub_get_queue_stats() API to sensor_hub component
- Add automation_get_queue_stats() API to automation component
- Add touch_driver_get_queue_stats() API to display component
- Track overflow counts in storage, sensor_hub, and automation
- health_monitor_task checks queue usage every 60 seconds
- Warn (ESP_LOGW) when queue usage exceeds 75% of capacity
- Update CLAUDE.md documentation with monitoring APIs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-10 10:57:10 -07:00
CI System
7ee81e71eb Fix Docker build: run docker directly instead of TeamCity wrapper
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
2025-12-10 10:38:49 -07:00
CI System
0c6afb7df4 Fix repository URL: Brent/controller
Some checks failed
ClearGrow Controller CI / Run Unit Tests (push) Has been cancelled
ClearGrow Controller CI / Build Development Firmware (push) Has been cancelled
ClearGrow Controller CI / Build Production Firmware (push) Has been cancelled
ClearGrow Controller CI / CI Status Summary (push) Has been cancelled
2025-12-10 10:27:29 -07:00