validation core as a dependency2
This commit is contained in:
@@ -5,7 +5,7 @@ Validation is split into three ownership layers.
|
||||
```mermaid
|
||||
flowchart LR
|
||||
Server[server<br/>stores simple settings<br/>binds table fields<br/>enforces writes]
|
||||
Core[validation-core<br/>owns meaning<br/>resolves recipes<br/>runs pure validation]
|
||||
Core[validation-core<br/>owns meaning<br/>resolves sets<br/>runs pure validation]
|
||||
Canvas[canvas<br/>editor integration<br/>masking while typing<br/>UI feedback]
|
||||
Common[common/proto<br/>wire format]
|
||||
|
||||
@@ -23,13 +23,14 @@ settings mean. `canvas` uses the resolved result for editing behavior.
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Settings[ValidationSettings<br/>serializable data]
|
||||
Recipe[ValidationRecipe<br/>named reusable settings]
|
||||
Package[ValidationPackage<br/>distributable recipes]
|
||||
Rule[ValidationRule<br/>named reusable fragment]
|
||||
Set[ValidationSet<br/>ordered rules]
|
||||
Config[ValidationConfig<br/>resolved runtime config]
|
||||
Result[ValidationResult]
|
||||
|
||||
Package --> Recipe
|
||||
Recipe --> Settings
|
||||
Rule --> Settings
|
||||
Set --> Rule
|
||||
Set --> Settings
|
||||
Settings --> Config
|
||||
Config --> Result
|
||||
```
|
||||
@@ -50,30 +51,32 @@ sequenceDiagram
|
||||
Client->>Client: canvas editing, masks, errors
|
||||
```
|
||||
|
||||
## Future Package Flow
|
||||
## Set Flow
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
Registry[validation package registry]
|
||||
Package[phone package]
|
||||
Recipe[phone.e164 recipe]
|
||||
RuleA[digits-only rule]
|
||||
RuleB[phone-length rule]
|
||||
RuleC[phone-mask rule]
|
||||
Set[phone set]
|
||||
Assignment[column assignment]
|
||||
Stored[server stored settings<br/>recipe ref + resolved config]
|
||||
Stored[server stored settings<br/>set name + resolved config]
|
||||
Runtime[server/canvas runtime]
|
||||
|
||||
Registry --> Package
|
||||
Package --> Recipe
|
||||
Recipe --> Assignment
|
||||
RuleA --> Set
|
||||
RuleB --> Set
|
||||
RuleC --> Set
|
||||
Set --> Assignment
|
||||
Assignment --> Stored
|
||||
Stored --> Runtime
|
||||
```
|
||||
|
||||
The server may store both the recipe reference and the resolved settings:
|
||||
The server stores reusable rules and sets, and field application stores a
|
||||
resolved snapshot:
|
||||
|
||||
```text
|
||||
field customer_phone uses phone.e164@1.0.0
|
||||
field customer_phone uses set phone
|
||||
resolved settings = {...}
|
||||
```
|
||||
|
||||
That keeps package imports inspectable and versioned while preserving stable
|
||||
backend enforcement even if a package changes later.
|
||||
That keeps backend enforcement stable even if the reusable set changes later.
|
||||
|
||||
Reference in New Issue
Block a user