-
Notifications
You must be signed in to change notification settings - Fork 0
Spec First Workflow
The recommended development cycle in SERP puts the interface contract first. Everything else — generated code, implementations, tests — follows from the spec.
Define Interface (SerpIDL) → Validate → Generate → Implement → Test → Repeat
File: specs/interfaces/IMyService.sidl.yaml
Define methods, attributes, broadcasts, and types. The interface is the contract between the service and its callers — keep it stable, because changes ripple to all callers.
serpgen validate -w specs/serp.sidlCatches IDL errors, unknown types, and circular dependencies before any code is touched. Also available in VS Code: Ctrl+Option+V.
serpgen generate-workspace -w specs/serp.sidlUpdates the gen/ directory: interfaces, base classes, process mains, and adapters. It never overwrites files in src/. Safe to run at any time.
Edit src/components/<Group>/<Service>/<Service>Impl.cpp.
Your handler is called by the generated base class. If the handler signature does not match the interface, you get a compile error — the generator enforces the contract at build time.
cmake --build build/Or use the VS Code shortcut: Ctrl+Option+B.
-
Component tests:
serp::TestRunner+ GTest — mock dependencies, drive lifecycle, assert results - Integration: run the full deployment and exercise the system end-to-end
Add a method to the interface → validate → generate → the compiler shows you exactly what to implement.
Remove a method → generate → the compiler tells you what to clean up.
| Rule | Reason |
|---|---|
| Specs are the source of truth | When in doubt, update the spec first |
Treat gen/ as build output |
Never edit generated files — your changes will be overwritten |
Keep src/ clean |
Only business logic; no transport or IPC code belongs here |
Commit specs/ and src/
|
gen/ can be gitignored and regenerated on checkout |
- Start with a monolith deployment (inprocess, single binary) — easiest to debug, no transport overhead
- Once the logic is working, switch to multiprocess by changing the deployment spec — no service code changes required
- Use the Runtime Inspector (Dev gRPC/DBus profile) for live method testing while the system is running
serpgen tracks which files are user-owned. Running generate again will not touch anything under src/. The only file that is always overwritten is the generated main.cpp — do not put custom code there.
Getting Started
The Development Model
Architecture Language
Code Generator
- Generator Overview
- Generated Code Layout
- Deployment Configurations
- Lifecycle Backends
- CMake Integration
Framework Internals
- Core Concepts
- Services & Lifecycle
- Methods
- Properties
- Notifications
- Timers & Watchdog
- Promises & Async
- Streams
- Commands
- Logging
- Test Engine
- Transports
- Runtime & Debug Tools
VS Code Plugin
Examples