Problem
Layer definitions are currently split across frontend and backend with no machine-readable shared contract.
This can cause UI/compiler drift:
- frontend exposes a layer and its params
- backend model generation does not support the same node type or validation rules
Recent bug reports show this mismatch risk in practice.
Why this matters
- Users can build graphs that look valid in UI but fail at compile/train time
- Adding new layers requires touching multiple files with duplicated metadata
- Validation logic becomes inconsistent across frontend and backend
Proposed solution
Introduce a backend-driven layer schema endpoint (single source of truth), e.g.:
GET /api/layers/schema
Each layer schema entry should include:
type (e.g., customdense, customdropout)
- display metadata (
label, category)
- parameter definitions (name, type, required, defaults, min/max/options)
- backend support flag/version (for safe rollout)
- validation constraints and error messages
Frontend should render node config forms and save guards from this schema instead of hardcoded per-layer forms.
Scope
- Backend:
- create schema model + endpoint
- centralize layer metadata in one registry
- Frontend:
- consume endpoint
- render dynamic layer parameter forms
- use schema-based validation before save/train
- Compiler:
- ensure schema-backed node types map to supported build handlers
- Tests:
- contract tests for schema shape
- integration test for at least one layer end-to-end from schema -> UI payload -> compiler
Acceptance criteria
Expected impact
- Prevents future UI/backend layer mismatches
- Reduces maintenance overhead when adding new layers
- Improves reliability of visual model-building workflow
Problem
Layer definitions are currently split across frontend and backend with no machine-readable shared contract.
This can cause UI/compiler drift:
Recent bug reports show this mismatch risk in practice.
Why this matters
Proposed solution
Introduce a backend-driven layer schema endpoint (single source of truth), e.g.:
GET /api/layers/schemaEach layer schema entry should include:
type(e.g.,customdense,customdropout)label, category)Frontend should render node config forms and save guards from this schema instead of hardcoded per-layer forms.
Scope
Acceptance criteria
GET /api/layers/schemawith typed param constraintsExpected impact