- Project/component:
rustiamacros derive contract - Canonical path:
crates/rustia-macros
- Runtime: Rust proc-macro crate
- Primary language: Rust
- Rust developers deriving
LLMDataimplementations for domain structs/enums - Maintainers preserving derive/runtime compatibility boundaries
- Stable component identifier:
macros. - Stable derive identifier:
#[derive(LLMData)]. - Expansion contract:
- derives for
structandenum - emits compile-time error for
union - supports
#[rustia(tags(...))]on fields with lowerCamelCase rustia tag identifiers - accepts signed numeric literals for numeric tags (
minimum,maximum,exclusiveMinimum,exclusiveMaximum,multipleOf) - supports nested tag groups:
items(tags(...)),keys(tags(...)),values(tags(...)) - validates tag-target compatibility and tag exclusivity at compile time
- respects serde field-shape attributes used by validator codegen (
rename,rename_all,default,flatten,skip,skip_deserializing) - accepts additional serde key-value field options without derive parse failures (for example
alias,with,skip_serializing_if) - resolves runtime crate path through
proc-macro-crateto support renamedrustiadependencies
- derives for
- Generated impls must remain compatible with runtime trait contracts defined by
crates/rustia. - Derived output contract:
- always emits
impl LLMData - emits
impl Validate
- always emits
- No persistent storage contract.
- Macro outputs are compile-time artifacts only.
- Macro expansion must avoid unsound generated code patterns.
- Diagnostics must stay local to macro invocation sites.
- Proc-macro diagnostics should remain concise and deterministic.
- Crate remains publishable (
publish = true) viacrates/rustia-macros/Cargo.toml. - Workspace release orchestration is owned by
cargo-mono publish. - Publish tag eligibility for this crate is controlled by root
[workspace.metadata.cargo-mono.publish.tag].packages.
- Local validation:
cargo test -p rustia-macros - Workspace baseline:
cargo test --workspace --all-targets
- Dependency domain: Rust proc-macro ecosystem (
syn,quote,proc-macro2,proc-macro-crate). - Integrates with
docs/crates-rustia-core-foundation.mdcompatibility contracts.
- Update
docs/project-rustia.mdand this file when derive identifiers or expansion constraints change. - Keep derive/runtime compatibility updates synchronized with
docs/crates-rustia-core-foundation.md. - Keep rustia component contract updates synchronized with
docs/crates-rustia-llm-foundation.mdwhen shared API identifiers or release policy boundaries change.
docs/project-rustia.mddocs/crates-rustia-core-foundation.mddocs/crates-rustia-llm-foundation.mddocs/domain-template.md