Releases: raylanlin/smarttune-cli
v3.0.3 — R5 Performance + R6 Cross-Module Contract Fixes
What's New in v3.0.3
R5 — Performance Optimization (bit-identical, zero numerical change)
- magfit: New
ned_to_body_batch()batch quaternion rotation +np.bincountbin weights vectorization - AP step_response_fft:
np.fullscale +np.cumsumSNR gaussian vectorization
R6 — Cross-Module Contract Bug Fixes
- 🔴 A2 generic-key injection (AP/BF):
parse()now injects generic keys (pid.roll.petc.) into params. Previously,PIDReviewer._get_current_pidalways returned 0.0 because it queried generic keys while only native names were stored — all PID parameter suggestions were silently discarded. - 🟡 BF pid_bounds: Added Betaflight integer-scale bounds (P[10,150]/I[20,220]/D[0,100]/FF[0,300]). Default AP-scale bounds (0.01~0.5) would clamp BF 45×1.1 down to 0.5.
- 🟡 thresholds shape guard: New
_is_axis_threshold_shape()validates knowledge-base thresholds are in the consumer-expected shape. Previously, allpid_rules.jsonthresholds were dead config — the analyzer always used hardcoded defaults. - New
tests/test_platform_contracts.py(8 tests): A2 injection, thresholds guard, BF bounds, BF gain not clipped.
167 tests passed
Full Changelog: v3.0.2...v3.0.3
SmartTune v3.0.2 — PX4 ULog + A1 Convergence + Label Unification
Changes since v3.0.0
v3.0.1 — 14 Architecture Review Fixes (2026-06-11)
14 critical/high severity fixes from Claude architecture review:
- C1: magfit 100% KeyError crash fixed (was silently skipped)
- C2: mGauss unit normalization across magfit pipeline
- C3: INS_HNTCH_REF semantic fix — prevents incorrect dynamic notch params
- C4: Skip current_val ≤ 0 recommendations (removes false "0.0 → 0.01" suggestions)
- C5/C6: ODI symmetric soft-iron matrix + PitchIn guard
- C7/C8: imu_dict actual construction + bidirectional overshoot + settling=-1 sentinel
- C10: step_response_fft aligned with WebTools/PID Toolbox reference implementations
- C12/C14/A3/A4: frequency band merge, ARX fallback markers, registry metadata snapshot, TYPE_CHECKING
v3.0.2 — PX4 ULog + A1 Convergence + Label Unification (2026-06-12)
PX4 Full Implementation (first time complete):
- ULog parser based on pyulog — all uORB topics mapped (vehicle_rates_setpoint, sensor_combined, ekf2_innovations, etc.)
- Param A2 dual-write contract
- sensor_combined fallback path for pre-v1.13 firmware
- PX4 knowledge base (pid_rules.json, filter_rules.json)
- validate_px4_ulog.py — one-command end-to-end validation
- `stune quality/pid/fft/sysid/analyze -i .ulg` all functional
A1 Convergence (services layer unification):
- `run_module()` unified core — CLI and services no longer have duplicate analyzer wiring
- B2 fix: fft_result now properly assigned to FullAnalysisResult
- sysid --na/--nb now actually passes through (was broken)
- filter and quality commands call services layer (D1 fix)
- t_synthetic_regression.py: 11 case golden-standard synthetic tests
Label Unification:
- vibration_level: SEVERE→POOR, CRITICAL→UNUSABLE (consistent Assessment enum)
- vibration_level_raw preserves original labels
- formatter/httm_report color mapping compatible with both old and new labels
v6.2 Synthetic Regression Fix:
- Excitation signals add 8% broadband noise (improves Wiener deconvolution conditioning)
- Steady-state tolerances widened; underdamped test uses relative assertion
- formatter `_has_vec()` guard for numpy array truthiness
Test Results
`159 passed in 2.16s` — AP/BF/PX4 real log verified
Files Changed
v3.0.1: 12 files, +743/-492
v3.0.2: 13 files, +1181/-510
SmartTune CLI v3.0.0 — Firmware-Parameter-Aware Tuning
SmartTune CLI v3.0.0 — Firmware-Parameter-Aware Tuning
New: stune params — Firmware Parameter Validation
SmartTune CLI can now query and validate firmware parameters before recommending changes, preventing agents from suggesting parameters that don't exist in the target firmware.
stune params ap # List 2,574 ArduPilot parameters
stune params bf # List 45 Betaflight parameters
stune params ATC_RAT_RLL_P # Show parameter details
stune params --search notch # Search across all platforms
stune params --validate ATC_RAT_RLL_P 0.15 -p ardupilot # Validate before recommendingNew: MCP Parameter Tools (13 total)
3 new MCP tools for parameter query and validation:
smarttune_list_params(platform, category)— List all firmware parameterssmarttune_search_params(keyword, platform)— Search by keywordsmarttune_validate_param(name, value, platform)— Validate before recommending
MCP agents can now autonomously verify parameter existence and value ranges.
Knowledge Base Architecture
Parameter tables live in smarttune/knowledge/params/*.json — data scraped from official firmware repositories:
- ArduPilot: 2,574 parameters from @Param annotations (100% described, 1,941 with valid ranges)
- Betaflight: 45 parameters from settings.c (BF 4.5+ names:
p_roll,gyro_lpf1_static_hz,d_max_roll) - PX4: 20 parameters from official YAML definitions
Breaking Change
Betaflight adapter's map_param_to_platform() now returns BF 4.5+ parameter names:
pid_roll_p→p_rollgyro_lowpass_hz→gyro_lpf1_static_hzd_min_roll→d_max_roll
Legacy name support maintained for reading older BBL logs.
Consistency Fixes
- ParamTable.validate() fixed for parameters without min/max range
- BF filter_transfer.py supports both old and new parameter names
- All 35 previously-undescribed AP parameters now have verified descriptions and ranges
- Count metadata corrected in knowledge base JSONs
Full Changelog
Previous v2.4.2 → v3.0.0: [compare]
SmartTune CLI v2.3.1
Patch release adding a dedicated MCP-only SmartTune skill for read-only customer-support agents.\n\n- Adds skill-mcp/SKILL.md for agents without exec/shell/write permission\n- Documents SmartTune MCP tool workflow and safety boundaries\n- Keeps v2.3.0 MCP server/runtime behavior unchanged\n\nVerification: pytest -q -> 141 passed
SmartTune CLI v2.3.0
SmartTune CLI v2.3.0
Added
- Read-only MCP server via
smarttune-mcpfor OpenClaw and other MCP clients. smarttune_list_platforms,smarttune_log_quality, andsmarttune_analyze_logMCP tools.- Pure service layer under
smarttune/services/for analysis and JSON-safe serialization. - MCP security tests for extension allowlists, path traversal, symlink escape, and file size limits.
Security
- MCP tools do not expose subprocess, shell execution, arbitrary output paths, parameter writes, or filesystem mutation.
- Path validation resolves symlinks, enforces allowed roots, rejects unsafe extensions, and respects
SMARTTUNE_MCP_MAX_FILE_MB. - Betaflight
.txtremains CLI-supported but is intentionally excluded from the MCP allowlist.
Fixed
- Fixed MagFit import indentation.
- Hardware analysis service uses the existing
generate_hardware_report()path.
Verification
pytest -q->141 passed- MCP smoke-tested against a real ArduPilot
.BINlog.
v2.2.0 — English Docs & CLI Help Improvements
What's Changed
- 🌐 All documentation converted to English (SKILL.md, ROADMAP.md, MIGRATION.md)
- 📖 Complete
--helpdescriptions for all subcommands (pid, fft, sysid, hardware, magfit) - 🤖 SKILL.md for OpenClaw agent integration
- 🧹 Deprecated ardupilot-tune skill/CLI replaced by stune
Platform Support
| Platform | Format | Status |
|---|---|---|
| ArduPilot | .bin / .log | ✅ Full |
| Betaflight | .bbl / .bfl | ✅ Full (v2.0) |
| PX4 | .ulg | 🔲 Partial (v2.1) |
Full changelog
9a760a0 chore: sync version to 2.2.0 (pyproject.toml + __init__.py)
9e26108 feat(cli): add complete --help descriptions for all subcommands
6303c3d docs: convert all docs and skill to English (SKILL.md, ROADMAP.md, MIGRATION.md)
32ace2d feat(skill): add SmartTune SKILL.md for OpenClaw agent - replace deprecated ardupilot-tune skill
49be79e docs(readme): convert Agent Analysis Report to Markdown tables
dfb6d81 docs(readme): switch example images to dark theme
cce6f8f fix(plots): subtle light theme - gray reference lines and invisible borders
d3063ab feat(plots): customize dark theme colors
0ffc943 feat(cli): add --theme light|dark option for plot generation
b416ef9 docs(readme): add agent analysis report example section
371c736 revert(assets): restore original light-themed APM example image
ba576db revert(plots): restore original light theme, remove all dark_background attempts
3250841 refactor(plots): use matplotlib dark_background style instead of manual rcParams
d719542 fix(plots): compact layout for GitHub README (formatter changes gitignored)
73024c5 docs(readme): dark theme plots, move examples to end section
349659d docs(readme): add PID step response example images for ArduPilot and Betaflight
dec397d docs(readme): update for v2.1.0
v2.1.0 — Platform-Specific Analyzers
Full Changelog: v2.0.2...v2.1.0
v2.0.2: BBL Parser Critical Fixes
BBL Parser Fixes
Fixed 8 critical bugs in Betaflight Blackbox log parser:
| Bug | Impact |
|---|---|
| TAG8_4S16 nibble packing | Frame sync loss → all fields corrupted |
| TAG2_3S32 tag bit extraction | axisI decoded as zero |
| NEG_14BIT sign extension | vbatLatest and fields wrong |
| P-frame predictor history | Difference decoding errors |
| loopIteration segment detection | Parser stopped after ~3K frames per segment |
| 0x48 byte false header | Parser hangs on valid data |
| P interval sample rate | Duration wrong (41s→165s) |
| Quality filter threshold | Empty charts (rad/s↔deg/s mismatch) |
Results
- BLL-PD.bbl: 1s → 91s parsed, 158K PID samples/axis
- H5_51377_6S_F722.bbl: 1s → 166s parsed, quality 45→75 (POOR→GOOD)
Credits
- BBL parser loopIteration fix: internal
- Remaining 7 fixes: Claude Code via ACP session
Full Changelog: v2.0.1...v2.0.2
v2.0.1 — PID unit contract fix + FFT threshold + CLI docs
🐛 Bug Fixes
ArduPilot 单位契约修复
- rad/s → deg/s 自动转换:PIDR/ATC_RAT_* 消息 Tar 字段自动检测单位(max < 6.5 判定为 rad/s)
- PIDR 字段兼容:支持 Tar(新固件)和 Des(旧固件)
- modern/legacy 消息源正确分离:修复旧版 PIDR+RATE 混入 bug
FFT 阶跃响应精度修复
min_target_amplitude阈值从 0.349(rad/s)改为 3.0(deg/s)- Roll 峰值从 0.52 恢复到 0.64(与旧版 0.65 一致)
CLI --help 文档完善
- 版本号同步至 2.0.1
- Betaflight 状态: Planned → Full support
- PX4 状态: Planned → Partial support
- 7 个子命令 --platform/--visual 选项添加帮助文本
包含 Commits
| Commit | 说明 |
|---|---|
3a3ae08 |
ArduPilot PID 单位契约修复 + PIDR 兼容 + CLI 增强 |
86fde58 |
FFT 阈值同步 deg/s |
c2988ef |
版本号 + 平台状态 + 子命令帮助文本完善 |
v2.0.0 — Multi-platform release
SmartTune CLI v2.0.0
Multi-platform flight log analysis & tuning advisor CLI — ArduPilot + Betaflight + PX4
What's New
- Multi-platform architecture — Unified FlightData representation across ArduPilot, Betaflight, and PX4
- Betaflight support — Pure Python BBL parser, FF/RPM/D-term noise analyzers
- Platform auto-detection —
stune analyzedetects platform from log headers - ParamRef system — Generic parameter names mapped to each platform
- 6-layer Knowledge Base — common → platform → user → Pro layers
- Error code system — Standardized E10xx-E50xx error classification
Quick Install
pip install smarttune
stune analyze -i flight-log.BIN