Validation Rules
RULE1..RULE12 for capability args plus schema validation flow
RULE1..RULE12
- RULE1: no duplicate
media_urns. - RULE2:
sourcesmust not be empty. - RULE3: multiple stdin sources must use identical stdin media URN.
- RULE4: no duplicate source type inside one arg.
- RULE5: no duplicate positional index across args.
- RULE6: positions must be 0-based sequential with no gaps.
- RULE7: one arg cannot have both
positionandcli_flag. - RULE8: unknown source keys rejected by serde
deny_unknown_fields. - RULE9: no duplicate
cli_flagacross args. - RULE10: reserved CLI flags are forbidden (
manifest,--help,--version,-v,-h). - RULE11:
cli_flagis used verbatim. - RULE12: argument identity is
media_urn; no separate name key.
Schema Validation Flow
- Resolve media URN via cap-local specs, then registry.
- If resolved spec has no JSON schema, skip schema check.
- Compile Draft-07 schema (cached by schema JSON).
- Validate argument/output JSON value; return detailed validation errors on failure.
Test Anchors
capdag/src/cap/validation.rs:1232(RULE-series tests)capdag/src/cap/validation.rs:1244