Skip to content

Repository files navigation

Diagnostic Autonomy Grid

Python 3.11+ License: MIT CI Anthropic Claude

Automotive diagnostic validation, accelerated by AI. Turn an ISO 14229-1 UDS requirement into execution-ready test scenarios, traceability, and reporting in seconds.

Diagnostic Autonomy Grid is a Python platform for automotive ECU validation teams. It combines deterministic UDS scenario generation with optional AI-assisted analysis and review, while still working cleanly in rule-based mode when AI dependencies are unavailable.


What it does

  • Generates 88 baseline test cases across 11 UDS services
  • Produces traceability, compliance, JSON/CSV exports, and HTML dashboards
  • Supports a web UI, single-requirement CLI, batch CLI, and optional AI pipeline
  • Keeps the core path deterministic and usable without real hardware
  • Falls back gracefully when the Anthropic SDK or ANTHROPIC_API_KEY is missing

Diagnostic Autonomy Grid pipeline

Real output snapshot

Below is a generated dashboard from the current workspace output:

Generated validation dashboard


Quick start

Install dependencies:

pip install -r requirements.txt

Start the web UI:

python -m app.web_app

Then open http://localhost:8000.

Run a single requirement:

python -m app.main
python -m app.main sample_data/requirement_0x27_security.json

Run the full sample batch:

python -m app.batch_runner
python -m app.batch_runner sample_data/

Run tests:

python -m pytest -q

Use the AI pipeline when you have the SDK and API key available.

PowerShell:

$env:ANTHROPIC_API_KEY = "your_key_here"
python -m app.ai_agent_runner

Bash:

export ANTHROPIC_API_KEY=your_key_here
python -m app.ai_agent_runner

Without ANTHROPIC_API_KEY or the Anthropic SDK, the project continues in rule-based mode instead of crashing.


Example

Sample requirement input:

{
  "requirement_id": "REQ_DIAG_0x22_001",
  "service_id": "0x22",
  "did": "F191",
  "requirement_summary": "The ECU shall support ReadDataByIdentifier service 0x22 for DID F191 to provide hardware number information.",
  "expected_result": "The ECU shall return a positive response containing the hardware number for DID F191."
}

Verified local run:

python -m app.ai_agent_runner sample_data/requirement_0x22_f191.json

Verified outcome from this workspace:

  • 8 rule-based scenarios generated
  • 100% coverage reported for the sample requirement
  • HTML reports written to outputs/report_dashboard.html and outputs/REQ_DIAG_0x22_001_report.html
  • JSON and CSV exports written to outputs/test_report.json, outputs/test_report.csv, and outputs/traceability_matrix.csv
  • AI pipeline safely fell back to rule-based mode when ANTHROPIC_API_KEY was not set

AI-enabled run:

python -m app.ai_agent_runner sample_data/requirement_0x22_f191.json

When the Anthropic SDK is installed and ANTHROPIC_API_KEY is set, the same pipeline also:

  • adds supplemental AI-generated scenarios on top of the deterministic baseline
  • runs AI coverage gap analysis and includes AI insights in the requirement report
  • runs the agentic validation loop and writes outputs/REQ_DIAG_0x22_001_agent_report.txt

AI-enabled batch mode:

python -m app.batch_runner sample_data/

With AI enabled, batch mode also generates a release advisory and embeds it into:

  • outputs/batch_summary.json
  • outputs/batch_dashboard.html

Key features

  • 11 UDS service generators covering 0x10, 0x14, 0x19, 0x22, 0x27, 0x2E, 0x31, 0x34, 0x36, 0x37, and 0x3E
  • Optional AI layer for scenario augmentation, coverage analysis, reviewer verdicts, and release guidance
  • Web UI + CLI workflows for interactive use, single-requirement runs, and batch processing
  • Pluggable harness design with deterministic simulation by default and a real ECU adapter stub
  • Safer reporting with HTML escaping in generated dashboards and requirement reports
  • Strong test coverage with 222 passing tests

Supported services

The project ships generators for:

DiagnosticSessionControl, ClearDiagnosticInformation, ReadDTCInformation, ReadDataByIdentifier, SecurityAccess, WriteDataByIdentifier, RoutineControl, RequestDownload, TransferData, RequestTransferExit, and TesterPresent.

Each service produces a baseline scenario set covering positive, negative, boundary, state-based, fault-injection, and recovery-oriented validation paths.


Tech stack

  • Python 3.11 / 3.12
  • Pydantic v2
  • FastAPI + Uvicorn
  • pandas + Chart.js
  • SQLite for agent memory
  • Anthropic Claude models for optional AI features

Project status

  • Tests: 222 passing
  • CI: GitHub Actions
  • License: MIT
  • Outputs are written to outputs/
  • Sample requirements are included in sample_data/

About

ISO 14229-1 UDS validation platform for deterministic and AI-assisted test scenario generation, traceability, and reporting

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages