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.
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.
How work is evaluated
Evaluates code conversion precision, AST syntax validity, and functional equivalence of refactored control code.
Shared data for this challenge
Review public datasets and any private uploads tied to your build.
How submissions are scored
These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.
syntax_validity
Ensures output structured text compiles with zero syntax errors
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
unit_test_pass_rate
Percentage of zero-shot functional simulation unit tests passed • target: 0.9 • range: 0-1
This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.
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
Reference links and supporting material
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)
- Ensures output structured text compiles with zero syntax errors
- Percentage of zero-shot functional simulation unit tests passed • target: 0.9 • range: 0-1
- Benchmark: PLC Code Refactoring Benchmark
- Unit Test Pass Rate target: 90%
- 1 public reference case
- JavaScript execution harness
- javascript sandbox (unavailable on Versalist)
View technical recipe
Configured tools
- DeepSeek · Required
- Vercel AI SDK · Optional
- DeepSeek R1 · Optional
- 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.