make spec infra more ergonomic
Signed-off-by: Onur Özkan <work@onurozkan.dev>
This commit is contained in:
1 parent
b0a7a9bb03
commit
85559bd2d5
20 files changed
+74
-123
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
Kaptan is a modular flight controller platform focused on deterministic bare-metal execution for flight-critical paths and strong verification discipline around the rest of the stack.
|
||||
|
||||
The repository is currently in infrastructure setup. Formal project specifications should be linked directly from the code they govern through compile-time attributes.
|
||||
The repository is currently in infrastructure setup. Formal project specifications are automatically checked beside the file-backed modules they govern.
|
||||
|
||||
## Current Direction
|
||||
|
||||
@@ -32,14 +32,14 @@ Formal specs should be colocated with the code or board package they govern.
|
||||
- Version history should live inside the same spec file as additional spec entries, not in the filename.
|
||||
- Each appended spec entry should begin with version marker such as `# --- version: 0.1.0 ---`.
|
||||
- Inside a spec entry, `#` is reserved for version markers and content headings should start at `##`.
|
||||
- Rust items should link to those sidecar specs through `#[spec("...")]`.
|
||||
- Missing linked spec files must fail compilation.
|
||||
- Each file-backed Rust module requires a same-name `.spec.md` sidecar.
|
||||
- Modules that intentionally have no formal specification must declare `no_spec!("reason");` at module scope.
|
||||
- Missing sidecars and modules that have both a sidecar and `no_spec!(...)` fail the build.
|
||||
|
||||
Example:
|
||||
|
||||
```rust
|
||||
use kaptan_spec::spec;
|
||||
use kaptan_spec::no_spec;
|
||||
|
||||
#[spec("control_loop.spec.md")]
|
||||
pub struct ControlLoop;
|
||||
no_spec!("Crate root declares child modules only.");
|
||||
```
|
||||
Reference in new issue
Block a user