Challenge

AI SDK Software-Defined Controls Code Generator with DeepSeek R1

Transitioning control engineering from proprietary ladder logic to software-defined controls demands automated IEC 61131-3 refactoring. Build a streaming code conversion agent using Vercel AI SDK and DeepSeek R1 to transform legacy PLC routines into modular control services. The generator must achieve 90% zero-shot unit test pass rate.

EngineeringHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Utilize Vercel AI SDK with DeepSeek R1 reasoning capabilities to refactor legacy PLC Ladder Logic into executable, object-oriented IEC 61131-3 Structured Text.

Delivery guide

How work is evaluated

Evaluation

Evaluates code conversion precision, AST syntax validity, and functional equivalence of refactored control code.

Datasets

Shared data for this challenge

Review public datasets and any private uploads tied to your build.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

syntax_validity

Ensures output structured text compiles with zero syntax errors

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

unit_test_pass_rate

Percentage of zero-shot functional simulation unit tests passed • target: 0.9 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Build a streaming TypeScript agent using Vercel AI SDK (`ai` package)

  • Leverage DeepSeek R1 reasoning tokens for complex industrial control logic refactoring

  • Convert legacy PLC Ladder Logic (Rung/RLL) to IEC 61131-3 Structured Text (ST) and C++

  • Validate code generation using strict syntax AST checkers and unit test harnesses

Resources and assets

Reference links and supporting material

Dataset notes

Legacy PLC ladder logic rungs and corresponding verified IEC 61131-3 Structured Text standard reference pairs.

How this agent runs

Evaluates code conversion precision, AST syntax validity, and functional equivalence of refactored control code.

Challenge input

JSON containing ladder_logic_rung (string) and I/O variable bindings

AI SDK

Assigned framework for Vercel AI SDK streaming integration.

DeepSeek R1

Assigned model for complex code refactoring logic.

Evaluated output

JSON containing structured_text (string), syntax_valid (bool), unit_tests_passed (bool)

Checks for
  • Ensures output structured text compiles with zero syntax errors
  • Percentage of zero-shot functional simulation unit tests passed • target: 0.9 • range: 0-1
Proof of success
  • Benchmark: PLC Code Refactoring Benchmark
  • Unit Test Pass Rate target: 90%
  • 1 public reference case
Runtime evidence
  • JavaScript execution harness
  • javascript sandbox (unavailable on Versalist)
View technical recipe

Configured tools

Action Space
  • DeepSeek · Required
  • Vercel AI SDK · Optional
Policy Serving
  • DeepSeek R1 · Optional
Orchestration
  • Vercel AI SDK · Optional

Evaluation contract

  • syntax_validity · Weight 1
  • unit_test_pass_rate · Weight 1

Recipe state

This is a preview. The configuration can change before the evaluation recipe is locked.

Frequently Asked Questions about AI SDK Software-Defined Controls Code Generator with DeepSeek R1