Skip to content

feat(obd_ai): add deterministic basic health scan workflow - #13

Open
virtuscyber wants to merge 1 commit into
feature/3-obd-ai-readonly-tool-surfacefrom
feature/4-basic-health-scan
Open

virtuscyber wants to merge 1 commit into
feature/3-obd-ai-readonly-tool-surfacefrom
feature/4-basic-health-scan

Conversation

@virtuscyber

Copy link
Copy Markdown
Owner

Refs #4

Stacked on top of #3.

Includes:

  • deterministic basic_health_scan() workflow
  • structured health snapshot with findings and anomalies
  • graceful handling of partially supported vehicles

@augmentcode

augmentcode Bot commented Apr 11, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR introduces a deterministic, read-only basic_health_scan() workflow that produces a structured “health snapshot” plus findings/anomalies and recommended next steps.

Changes:

  • Extends the approved command catalog with fuel-trim and MAF PIDs used by the scan.
  • Adds protocol ID/name fields to connection metadata serialization.
  • Enhances OBDAISession.connection_metadata() to safely expose protocol info when supported by the adapter/driver.
  • Implements OBDAIReadOnlyToolSurface.basic_health_scan() to collect status, DTC snapshots, and a fixed set of live metrics.
  • Adds analysis helpers to turn raw reads into human-oriented findings/anomalies/next steps and an overall summary.
  • Adds/updates unit tests covering the new catalog entries, protocol metadata, and scan behavior for nominal and fault/partial-support scenarios.

Technical Notes: The scan is designed to be resilient to unsupported PIDs and transient read failures by returning per-command results and deriving a summarized status.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread obd_ai/tools.py
"codes": stored_codes,
},
}
findings.append(anomaly)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status_unavailable is labeled with severity: "warning" but it’s not added to anomalies, so summary.overall_status can remain "ok" even when monitor status couldn’t be read. Consider whether this warning should influence the overall scan status similarly to other warning-level items.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread obd_ai/tools.py
return None

magnitude = value.get("magnitude")
if isinstance(magnitude, (int, float)):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a DTC read fails (ok: false), _extract_value_payload() returns None and _extract_dtc_codes() returns [], which is indistinguishable from a successful “no codes” result; this can make summary.stored_dtc_count/pending_dtc_count misleading. Consider whether the analysis/summary should preserve an explicit “DTC read failed/unknown” state.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

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