pub struct Contract {Show 20 fields
pub schema_version: SchemaVersion,
pub id: String,
pub title: String,
pub description: String,
pub status: ContractStatus,
pub stability: Stability,
pub scope: String,
pub capabilities: Vec<String>,
pub invariants: Vec<Invariant>,
pub required_semantics: Vec<Semantic>,
pub forbidden_semantics: Vec<Semantic>,
pub edge_cases: Vec<EdgeCase>,
pub examples: Vec<Example>,
pub non_goals: Vec<String>,
pub implementation_notes: Vec<String>,
pub test_expectations: Vec<String>,
pub expected_api: Vec<String>,
pub history: Vec<HistoryEntry>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
A contract defines the stable behavioral specification for a component.
Contracts are the primary artifact in lexicon. They declare what a component must do, what it must not do, and what is explicitly out of scope.
Stored at specs/contracts/<id>.toml.
Fields§
§schema_version: SchemaVersion§id: StringUnique slug identifier, e.g. “key-value-store”.
title: String§description: StringA longer description of the contract’s purpose and context.
status: ContractStatus§stability: Stability§scope: StringHigh-level scope description.
capabilities: Vec<String>What the component provides.
invariants: Vec<Invariant>Invariants that must always hold.
required_semantics: Vec<Semantic>Behavior that is required.
forbidden_semantics: Vec<Semantic>Behavior that is explicitly forbidden.
edge_cases: Vec<EdgeCase>Edge cases with expected behavior.
examples: Vec<Example>Usage examples.
non_goals: Vec<String>What this component explicitly does not do.
implementation_notes: Vec<String>Implementation-level notes (not part of the contract).
test_expectations: Vec<String>What tests are expected for this contract.
expected_api: Vec<String>Expected public API items (traits, methods, types) this contract covers.
history: Vec<HistoryEntry>Version history of contract changes.
created_at: DateTime<Utc>§updated_at: DateTime<Utc>