Skip to content

Commit 818f33a

Browse files
caparomulaclaude
andcommitted
Release v0.8.2: Code review fixes, documentation restructure, VS Code extension improvements
Comprehensive code review and documentation overhaul. Two full review cycles identified and fixed 40+ issues across math, architecture, domain correctness, and documentation. Bug fixes: - AnalyzeSwerveTool.poseDistance always returned zero (flat struct layout) - MoI R² used inconsistent torque formula between OLS and residual loops - time_correlate included NaN/Infinity, used single-signal quality score - CSV export struct columns didn't match header ordering - 2024 Crescendo auto amp scoring was 5 instead of 2 - HTTP SSE committed 200 before executor acceptance check - Cross-correlation center lag could cause ArrayIndexOutOfBounds - DataQuality gaps changed from count-based to duration-based ratio - TbaClient.apiKey not volatile for HTTP thread visibility VS Code extension: - Generates .mcp.json on activation for Claude Code compatibility - Passes settings as both CLI args and env vars - Auto-detects WPILib IDE JDK (matches season) - Added extension icon - New buildExtension Gradle task (package without installing) Documentation: - README restructured: Installation first, split detailed docs into vscode-extension/README.md, doc/STANDALONE.md, doc/DEVELOPMENT.md - AI model capability caveats added across all docs - TOOLS.md confidence levels fixed (moderate→medium, added insufficient) - Default team number set to 2363 Stress tests: - Synthesize defaults when no config file present - SLF4J logging reduced to warn, JUnit tree output, console forwarding Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 26302c2 commit 818f33a

77 files changed

Lines changed: 21518 additions & 1793 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, windows-latest]
14+
runs-on: ${{ matrix.os }}
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin'
24+
25+
- name: Setup Gradle
26+
uses: gradle/actions/setup-gradle@v4
27+
28+
- name: Build and test
29+
run: ./gradlew test shadowJar
30+
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: '20'
35+
36+
- name: Check VS Code extension compiles
37+
working-directory: vscode-extension
38+
run: |
39+
npm ci
40+
npm run compile
41+
42+
- name: Upload shadow JAR
43+
if: matrix.os == 'ubuntu-latest'
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: wpilog-mcp-jar
47+
path: build/libs/wpilog-mcp-*-all.jar
48+
retention-days: 14

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
23+
- name: Setup Gradle
24+
uses: gradle/actions/setup-gradle@v4
25+
26+
- name: Build shadow JAR
27+
run: ./gradlew shadowJar
28+
29+
- name: Set up Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: '20'
33+
34+
- name: Bundle JAR into extension
35+
run: |
36+
cp build/libs/wpilog-mcp-*-all.jar vscode-extension/server/wpilog-mcp-all.jar
37+
38+
- name: Build VS Code extension
39+
working-directory: vscode-extension
40+
run: |
41+
npm ci
42+
npm run compile
43+
npx @vscode/vsce package
44+
45+
- name: Extract version from tag
46+
id: version
47+
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
48+
49+
- name: Create GitHub Release
50+
uses: softprops/action-gh-release@v2
51+
with:
52+
generate_release_notes: true
53+
files: |
54+
build/libs/wpilog-mcp-${{ steps.version.outputs.version }}-all.jar
55+
vscode-extension/*.vsix

.gitignore

Lines changed: 10048 additions & 0 deletions
Large diffs are not rendered by default.

CHANGELOG.md

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,61 @@ All notable changes to wpilog-mcp will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.8.2] - 2026-03-26
9+
10+
### Added
11+
- **YAML configuration support**`ConfigLoader` now parses `servers.yaml` with 3-layer defaults merging (top-level defaults, per-server overrides, environment variable interpolation).
12+
- **VS Code extension**`wpilog-analyzer` extension with `McpServerDefinitionProvider` registration and `.mcp.json` generation for Claude Code compatibility. Auto-detects WPILib IDE JDK, log directory, and bundled JAR. Extension icon added.
13+
- **VS Code extension `.mcp.json` generation** — Extension writes `.mcp.json` on activation with all settings (log directory, team number, TBA key) so Claude Code can discover the server.
14+
- **Standalone installer scripts**`install.ps1` (Windows) and `install.sh` (macOS/Linux) for one-line installation outside VS Code.
15+
- **CI/CD workflows** — GitHub Actions for build, test, and release automation.
16+
- **`buildExtension` Gradle task** — Builds the server JAR, compiles TypeScript, and packages the `.vsix` without installing. Complements `bundleExtension` (JAR only) and `installExtension` (build + install).
17+
- **Stress test default configuration** — Stress tests now synthesize defaults (`~/riologs`, team 2363, TBA from `TBA_API_KEY` env var) when no config file is present. No `servers.yaml` entry required.
18+
19+
### Fixed
20+
- **`AnalyzeSwerveTool.poseDistance` always returned zero** — Odometry drift analysis now handles flat struct layout (`{x, y}`) from Pose decoders, not just nested `{translation: {x, y}}`.
21+
- **MoI R² computation used inconsistent torque formula** — Residual loop now uses the same torque sign convention as the OLS fit.
22+
- **`time_correlate` included NaN/Infinity values** — Filter now requires `Double.isFinite()`. Uses worst-of-two quality scores.
23+
- **`FrcDomainTools.extractTranslation` only handled nested layout** — Now supports both nested `{translation: {x, y}}` and flat `{x, y}` from struct decoders.
24+
- **CSV export struct column mismatch** — Explicit field ordering for Pose2d, Pose3d, SwerveModuleState matches header row. Generic structs use deterministic alphabetical ordering.
25+
- **2024 Crescendo auto amp scoring** — Corrected from 5 to 2 points per game manual.
26+
- **TBA quarterfinal match key** — Added explicit `qf` comp level handling.
27+
- **HTTP SSE response committed before executor check** — Moved `sendResponseHeaders(200)` inside the executor task so `RejectedExecutionException` returns 503.
28+
- **LogManager shutdown lifecycle**`shutdownNow()` + `awaitTermination()` prevents resource leaks. Disk cache shutdown waits for sync executor.
29+
- **Cross-correlation center lag guard** — Returns `FAILED` when center lag exceeds array bounds, preventing `ArrayIndexOutOfBoundsException`.
30+
- **`DataQuality` gap detection** — Changed from count-based to duration-based gap ratio for confidence level calculation.
31+
- **DS timeline linear scan** — Replaced with binary search (`findFirstIndexAtOrAfter`) for teleop deferred emit.
32+
- **Vision quality fallback** — Falls back to pose entry quality when no target entries found.
33+
- **Overshoot detection absolute minimum** — Added `Math.01` minimum threshold to prevent false positives near zero setpoints.
34+
- **Median calculation for even-length arrays** — Now averages two middle elements.
35+
- **Battery voltage off-by-one** — Changed `voltageValues.size() - 10` to `voltageValues.size() - 1`.
36+
- **`TbaClient.apiKey` not volatile** — Added `volatile` for safe publication to HTTP handler threads.
37+
- **`health_check` misleading field name** — Renamed `cache_memory_mb` to `jvm_heap_used_mb` to accurately reflect that it measures total JVM heap, not cache-specific memory.
38+
- **Main.java help text** — Changed stale `servers.json` reference to `servers.yaml`.
39+
- **CHANGELOG gap threshold** — Corrected "3x-median" to "5x-median" to match code.
40+
- **Launcher scripts hardcoded WPILib year** — Now dynamically scan for latest installed year.
41+
- **Unix launcher missing JAVA_HOME fallback** — Added between WPILib scan and bare `java`.
42+
- **CI extension compile restricted to Ubuntu** — Removed `if: matrix.os == 'ubuntu-latest'` from Node.js/extension steps.
43+
- **`ExportTools` missing parameter validation**`export_csv` now uses `getRequiredString()` for the `name` parameter.
44+
- **Correlation guidance language** — Softened wording for moderate correlations.
45+
- **CHANGELOG `WPILOG_BIND`** — Corrected to `WPILOG_HTTP_BIND`.
46+
47+
### Changed
48+
- **Documentation restructured** — README slimmed to focus on installation and features. Detailed docs split into `vscode-extension/README.md` (extension settings, upgrading, uninstalling), `doc/STANDALONE.md` (standalone install, configuration, Docker), and `doc/DEVELOPMENT.md` (building, project structure, contributing).
49+
- **Installation section leads README** — VS Code extension and standalone install presented as two equal paths with links to dedicated docs. Notes that both can coexist independently.
50+
- **AI model capability caveats** — Added notes across documentation that analysis quality depends on the AI model used.
51+
- **Default team number** — Changed from 0 to 2363 in generated config templates, extension defaults, and stress test fallbacks.
52+
- **TOOLS.md confidence levels** — Fixed "moderate" to "medium", added missing "insufficient" level, corrected `servers.json` to `servers.yaml`.
53+
- **`analyze_can_bus` categorization** — Moved from Robot Analysis to FRC Domain in README tool table to match code module.
54+
- **Stress test output** — SLF4J logging reduced from `debug` to `warn`, JUnit output uses compact `tree` mode, stdout/stderr forwarded to console.
55+
56+
## [0.8.1] - 2026-03-24
57+
58+
### Added
59+
- **Configurable HTTP bind address** — New `bind` config field / `-bind` CLI flag / `WPILOG_HTTP_BIND` env var controls which network interface the HTTP transport listens on.
60+
- **Configurable endpoint path** — New `endpoint` config field allows customizing the HTTP endpoint path.
61+
- **Origin allowlist** — New `origins` config field restricts CORS access to a configurable list of allowed origins.
62+
863
## [0.8.0] - 2026-03-24
964

1065
### Added
@@ -208,7 +263,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
208263

209264
#### LLM Epistemological Guardrails
210265
- **Trojan Horse tool descriptions (§6.1)** — All 20 analytical tools now embed interpretation guidance in their MCP `description()` strings. Five guidance constants in `ToolUtils` (`GUIDANCE_UNIVERSAL`, `GUIDANCE_STATISTICAL`, `GUIDANCE_POWER`, `GUIDANCE_MECHANISM`, `GUIDANCE_MATCH_ANALYSIS`) provide consistent, category-appropriate caveats about single-match limitations, sample size uncertainty, correlation-vs-causation, and alternative explanations. Informational tools (`list_entries`, `read_entry`, etc.) are unchanged.
211-
- **Data quality metadata (§6.5)** — New `DataQuality` record computes quality metrics from any `List<TimestampedValue>`: sample count, time span, gap count/max (adaptive 3x-median threshold), NaN/Infinity count, effective sample rate, timing jitter, and a composite quality score (0.0–1.0). `ResponseBuilder.addDataQuality()` serializes these into a `data_quality` JSON object and auto-warns when score < 0.5. Integrated into `get_statistics` as reference implementation.
266+
- **Data quality metadata (§6.5)** — New `DataQuality` record computes quality metrics from any `List<TimestampedValue>`: sample count, time span, gap count/max (adaptive 5x-median threshold), NaN/Infinity count, effective sample rate, timing jitter, and a composite quality score (0.0–1.0). `ResponseBuilder.addDataQuality()` serializes these into a `data_quality` JSON object and auto-warns when score < 0.5. Integrated into `get_statistics` as reference implementation.
212267
- **Output contextual framing (§6.2)** — New `AnalysisDirectives` class generates `server_analysis_directives` in tool responses. `fromQuality(DataQuality)` factory auto-generates guidance from detected issues (low sample count, gaps, NaN, short time span). Builder methods `addGuidance()`, `addFollowup()`, and `addSingleMatchCaveat()` allow tool-specific enrichment. `ResponseBuilder.addDirectives()` serializes into `confidence_level`, `sample_context`, `interpretation_guidance[]`, and `suggested_followup[]` fields.
213268

214269
### Fixed

0 commit comments

Comments
 (0)