Skip to content

fix(vag_vehicle): select telemetry by timestamp and explain SoC selection - #213

Draft
segran2 wants to merge 3 commits into
srcfl:mainfrom
segran2:fix/vag-vehicle-measurement-timestamps
Draft

segran2 wants to merge 3 commits into
srcfl:mainfrom
segran2:fix/vag-vehicle-measurement-timestamps

Conversation

@segran2

@segran2 segran2 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Portal datasets may contain multiple points for the same field or different SoC candidates. index_points previously kept the last row per key/name and lookup chose the greatest row number, allowing an older measurement to hide a newer one.

Both stages now compare parsed measurement timestamps, including timezone offsets and fractional seconds. Valid timestamps outrank missing or invalid ones; equal or unavailable timestamps retain row-order fallback. Bumps vag_vehicle to 0.3.1 and refreshes generated metadata.

Adds diagnostics once per newly downloaded dataset: VIN-masked filename, portal fetch time, candidate count, selected row and selection reason. Logs up to 32 SoC candidate rows (including those discarded by indexing), with key/name, value, timestamp and selection flag; excess rows are counted. No raw datasets or credentials are logged. This distinguishes stale upstream measurements from incorrect local selection.

Validation:

  • Synthetic regression harness covers duplicate keys/shared names, candidate GUIDs, both row orders, missing/invalid/equal timestamps, offsets, fractional seconds, empty values and nil inputs. Original 0.3.0 fails the newest-first case.
  • Diagnostic tests cover discarded candidates, selection reasons, no candidates, truncation and VIN masking.
  • make test-driver ID=vag_vehicle: 40 passed, 16 skipped.
  • make check: 5090 passed, 951 skipped; manifests, generated metadata, source history, host API and sandbox checks passed.
  • Updated code installed locally on FTW Core v0.159.0-beta.1+local.3 with an Audi e-tron: restart/authentication/download succeeded; actual dataset diagnostics showed one SoC candidate with an old measurement timestamp and correctly masked VIN. Firmware was not recorded. Competing real SoC candidates have not yet been observed, so this remains a draft pending that evidence/review.

No credentials, VINs or raw site datasets are included. This does not refresh stale upstream data. After merge, FTW must advance its bundled-driver source pin and regenerate its recovery snapshot to reach bundled installations.

Signed-off-by: Segran <goran@andersson-stehag.se>
Signed-off-by: Segran <goran@andersson-stehag.se>
Signed-off-by: Segran <goran@andersson-stehag.se>
@segran2 segran2 changed the title fix(vag_vehicle): select telemetry by measurement timestamp fix(vag_vehicle): select telemetry by timestamp and explain SoC selection Nov 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant