- Remove KCL ecosystem (~220 files deleted) - Migrate all infrastructure to Nickel schema system - Consolidate documentation: legacy docs → provisioning/docs/src/ - Add CI/CD workflows (.github/) and Rust build config (.cargo/) - Update core system for Nickel schema parsing - Update README.md and CHANGES.md for v5.0.0 release - Fix pre-commit hooks: end-of-file, trailing-whitespace - Breaking changes: KCL workspaces require migration - Migration bridge available in docs/src/development/
Constraints
Single source of truth for validation limits across all services.
Purpose
The constraints.toml file defines:
- Numeric ranges (min/max values for ports, workers, timeouts, etc.)
- Uniqueness rules (field constraints, array bounds)
- Validation bounds (resource limits, timeout ranges)
These constraints are used by:
- Validators (
validators/*.ncl) - Check that configuration values are within bounds - TypeDialog forms (
forms/*.toml) - Enable constraint interpolation for dynamic field validation - Nickel schemas (
schemas/*.ncl) - Define type contracts with bounds
File Structure
constraints/
└── constraints.toml # All validation constraints in TOML format
Usage Pattern
1. Define Constraint
constraints.toml:
[orchestrator.queue.concurrent_tasks]
min = 1
max = 100
2. Reference in Validator
validators/orchestrator-validator.ncl:
let constraints = import "../constraints/constraints.toml" in
{
ValidConcurrentTasks = fun tasks =>
if tasks < constraints.orchestrator.queue.concurrent_tasks.min then
error "Tasks must be >= 1"
else if tasks > constraints.orchestrator.queue.concurrent_tasks.max then
error "Tasks must be <= 100"
else
tasks,
}
3. Reference in Form
forms/fragments/orchestrator-queue-section.toml:
[[elements]]
name = "max_concurrent_tasks"
type = "number"
min = "${constraint.orchestrator.queue.concurrent_tasks.min}"
max = "${constraint.orchestrator.queue.concurrent_tasks.max}"
help = "Max: ${constraint.orchestrator.queue.concurrent_tasks.max}"
nickel_path = ["orchestrator", "queue", "max_concurrent_tasks"]
Constraint Categories
Service-Specific Constraints
-
Orchestrator (
[orchestrator.*])- Worker count bounds
- Queue concurrency limits
- Task timeout ranges
- Batch parallelism limits
-
Control Center (
[control_center.*])- JWT token expiration bounds
- Rate limiting thresholds
- RBAC policy limits
-
MCP Server (
[mcp_server.*])- Tool concurrency limits
- Resource size bounds
- Prompt template limits
Common Constraints
-
Server (
[common.server.*])- Port range (1024-65535)
- Worker count
- Connection limits
-
Deployment (
[deployment.{solo,multiuser,cicd,enterprise}.*])- CPU core bounds
- Memory allocation bounds
- Disk space requirements
Modifying Constraints
When changing constraint bounds:
- Update constraints.toml
- Update validators that use the constraint
- Update forms that interpolate the constraint
- Test validation in forms and Nickel typecheck
- Update documentation of affected services
Example: Increase Max Queue Tasks
Before:
[orchestrator.queue.concurrent_tasks]
min = 1
max = 100
After:
[orchestrator.queue.concurrent_tasks]
min = 1
max = 200 # Increased from 100
Then:
- Verify
validators/orchestrator-validator.nclstill type-checks - Form will automatically show new max (via constraint interpolation)
- Test with:
nu scripts/validate-config.nu values/orchestrator.*.ncl
Constraint Interpolation in Forms
TypeDialog supports dynamic constraint references via ${constraint.path.to.value}:
# Static min/max
min = 1
max = 100
# Dynamic from constraints.toml
min = "${constraint.orchestrator.queue.concurrent_tasks.min}"
max = "${constraint.orchestrator.queue.concurrent_tasks.max}"
# Help text with dynamic reference
help = "Value must be between ${constraint.orchestrator.queue.concurrent_tasks.min} and ${constraint.orchestrator.queue.concurrent_tasks.max}"
Best Practices
- Single source of truth - Define constraint once in constraints.toml
- Meaningful names - Use clear path hierarchy (service.subsystem.property)
- Document ranges - Add comments explaining why min/max values exist
- Validate propagation - Ensure forms and validators reference the same constraint
- Test edge cases - Verify min/max values work in validators and forms
Files to Update When Modifying Constraints
When you change constraints/constraints.toml:
validators/*.ncl- Update validator boundsforms/fragments/*.toml- Update form field constraintsschemas/*.ncl- Update type contracts if needed- Documentation - Update service-specific constraint documentation
Version: 1.0.0 Last Updated: 2025-01-05