Files
silo/schemas/kindred-rd.yaml
forbes-0023 4edaa35c49 feat: schema-driven form descriptor API and dynamic form rendering
- Add ui section to kindred-rd.yaml with category_picker (multi-stage),
  item_fields, field_groups, category_field_groups, and field_overrides
- Add UIConfig structs to Go schema parser with full YAML/JSON tags
- Add ValidateUI() to validate field references against property schemas
- Add ValuesByDomain() helper to auto-derive subcategory picker stages
- Implement GET /api/schemas/{name}/form endpoint that returns resolved
  form descriptor with field metadata, widget hints, and category picker
- Replace GET /api/schemas/{name}/properties route with /form
- Add FormDescriptor TypeScript types
- Create useFormDescriptor hook (replaces useCategories)
- Rewrite CreateItemPane to render all sections dynamically from descriptor
- Update CategoryPicker with multi-stage domain/subcategory selection
- Delete useCategories.ts (superseded by useFormDescriptor)
2026-02-11 10:14:00 -06:00

1101 lines
29 KiB
YAML

# Kindred Systems R&D Part Numbering Schema
#
# Format: CCC-NNNN
# CCC = Category/subcategory code (e.g., F01, R27)
# NNNN = Sequence (4 digits, scoped per category)
#
# Examples:
# F01-0001 (Screws/Bolts, seq 1)
# R27-0001 (Servo Motor, seq 1)
# S05-0002 (T-Slot Extrusion, seq 2)
#
# Note: Projects are managed separately as tags (many-to-many relationship).
# Parts can be associated with multiple projects.
#
# Note: Documents and drawings share part numbers with the items they describe
# and are managed as attachments/revisions rather than separate items.
schema:
name: kindred-rd
version: 3
description: "Kindred Systems R&D part numbering (category-sequence)"
separator: "-"
uniqueness:
scope: global
case_sensitive: false
segments:
# Category/subcategory code
- name: category
type: enum
description: "Category and subcategory code"
required: true
values:
# F - Fasteners
F01: "Screws and Bolts"
F02: "Threaded Rods"
F03: "Eyebolts"
F04: "U-Bolts"
F05: "Nuts"
F06: "Washers"
F07: "Shims"
F08: "Inserts"
F09: "Spacers"
F10: "Pins"
F11: "Anchors"
F12: "Nails"
F13: "Rivets"
F14: "Staples"
F15: "Key Stock"
F16: "Retaining Rings"
F17: "Cable Ties"
F18: "Hook and Loop"
# C - Fluid Fittings
C01: "Full Couplings"
C02: "Half Couplings"
C03: "Reducers"
C04: "Elbows"
C05: "Tees"
C06: "Crosses"
C07: "Unions"
C08: "Adapters"
C09: "Plugs and Caps"
C10: "Nipples"
C11: "Flanges"
C12: "Valves"
C13: "Quick Disconnects"
C14: "Hose Barbs"
C15: "Compression Fittings"
C16: "Tubing"
C17: "Hoses"
# R - Motion Components
R01: "Ball Bearings"
R02: "Roller Bearings"
R03: "Sleeve Bearings"
R04: "Thrust Bearings"
R05: "Linear Bearings"
R06: "Spur Gears"
R07: "Helical Gears"
R08: "Bevel Gears"
R09: "Worm Gears"
R10: "Rack and Pinion"
R11: "Sprockets"
R12: "Timing Pulleys"
R13: "V-Belt Pulleys"
R14: "Idler Pulleys"
R15: "Wheels"
R16: "Casters"
R17: "Shaft Couplings"
R18: "Clutches"
R19: "Brakes"
R20: "Lead Screws"
R21: "Ball Screws"
R22: "Linear Rails"
R23: "Linear Actuators"
R24: "Brushed DC Motor"
R25: "Brushless DC Motor"
R26: "Stepper Motor"
R27: "Servo Motor"
R28: "AC Induction Motor"
R29: "Gear Motor"
R30: "Motor Driver"
R31: "Motor Controller"
R32: "Encoder"
R33: "Pneumatic Cylinder"
R34: "Pneumatic Actuator"
R35: "Pneumatic Valve"
R36: "Pneumatic Regulator"
R37: "Other Pneumatic Device"
R38: "Air Compressor"
R39: "Vacuum Pump"
R40: "Hydraulic Cylinder"
R41: "Hydraulic Pump"
R42: "Hydraulic Motor"
R43: "Hydraulic Valve"
R44: "Hydraulic Accumulator"
# S - Structural Materials
S01: "Square Tube"
S02: "Round Tube"
S03: "Rectangular Tube"
S04: "I-Beam"
S05: "T-Slotted Extrusion"
S06: "Angle"
S07: "Channel"
S08: "Flat Bar"
S09: "Round Bar"
S10: "Square Bar"
S11: "Hex Bar"
S12: "Sheet Metal"
S13: "Plate"
S14: "Expanded Metal"
S15: "Perforated Sheet"
S16: "Wire Mesh"
S17: "Grating"
# E - Electrical Components
E01: "Wire"
E02: "Cable"
E03: "Connectors"
E04: "Terminals"
E05: "Circuit Breakers"
E06: "Fuses"
E07: "Relays"
E08: "Contactors"
E09: "Switches"
E10: "Buttons"
E11: "Indicators"
E12: "Resistors"
E13: "Capacitors"
E14: "Inductors"
E15: "Transformers"
E16: "Diodes"
E17: "Transistors"
E18: "ICs"
E19: "Microcontrollers"
E20: "Sensors"
E21: "Displays"
E22: "Power Supplies"
E23: "Batteries"
E24: "PCB"
E25: "Enclosures"
E26: "Heat Sinks"
E27: "Fans"
# M - Mechanical Components
M01: "Compression Springs"
M02: "Extension Springs"
M03: "Torsion Springs"
M04: "Gas Springs"
M05: "Dampers"
M06: "Shock Absorbers"
M07: "Vibration Mounts"
M08: "Hinges"
M09: "Latches"
M10: "Handles"
M11: "Knobs"
M12: "Levers"
M13: "Linkages"
M14: "Cams"
M15: "Bellows"
M16: "Seals"
M17: "O-Rings"
M18: "Gaskets"
# T - Tooling and Fixtures
T01: "Jigs"
T02: "Fixtures"
T03: "Molds"
T04: "Dies"
T05: "Gauges"
T06: "Templates"
T07: "Work Holding"
T08: "Test Fixtures"
# A - Assemblies
A01: "Mechanical Assembly"
A02: "Electrical Assembly"
A03: "Electromechanical Assembly"
A04: "Subassembly"
A05: "Cable Assembly"
A06: "Pneumatic Assembly"
A07: "Hydraulic Assembly"
# P - Purchased/Off-the-Shelf
P01: "Purchased Mechanical"
P02: "Purchased Electrical"
P03: "Purchased Assembly"
P04: "Raw Material"
P05: "Consumables"
# X - Custom Fabricated Parts
X01: "Machined Part"
X02: "Sheet Metal Part"
X03: "3D Printed Part"
X04: "Cast Part"
X05: "Molded Part"
X06: "Welded Fabrication"
X07: "Laser Cut Part"
X08: "Waterjet Cut Part"
# Sequence number (scoped per category)
- name: sequence
type: serial
length: 4
padding: "0"
start: 1
description: "Sequential identifier (per category)"
scope: "{category}"
format: "{category}-{sequence}"
examples:
- "F01-0001"
- "R27-0001"
- "S05-0002"
- "E20-0001"
- "A01-0001"
# Property schemas per category
property_schemas:
version: 2
# Global defaults (apply to all categories)
defaults:
manufacturer:
type: string
default: ""
description: "Manufacturer name"
manufacturer_pn:
type: string
default: ""
description: "Manufacturer part number"
supplier:
type: string
default: ""
description: "Primary supplier/distributor"
supplier_pn:
type: string
default: ""
description: "Supplier part number or SKU"
sourcing_link:
type: string
default: ""
description: "URL to purchase or source the item"
standard_cost:
type: number
default: null
unit: "USD"
description: "Standard cost per unit in USD"
lead_time_days:
type: number
default: null
description: "Typical lead time in days"
minimum_order_qty:
type: number
default: 1
description: "Minimum order quantity"
lifecycle_status:
type: string
default: "active"
description: "Status: active, deprecated, obsolete, prototype"
rohs_compliant:
type: boolean
default: null
description: "RoHS compliance status"
country_of_origin:
type: string
default: ""
description: "Country of origin"
notes:
type: string
default: ""
description: "Additional notes"
# Category-specific properties
categories:
# Fasteners (F01-F18)
F:
material:
type: string
default: ""
description: "Material (e.g., Steel, 316SS, Brass, Nylon)"
finish:
type: string
default: ""
description: "Surface finish (e.g., Zinc, Black Oxide, Plain)"
thread_size:
type: string
default: ""
description: "Thread size (e.g., M3x0.5, 1/4-20, M4)"
thread_pitch:
type: string
default: ""
description: "Thread pitch (coarse, fine, or specific pitch)"
length:
type: number
default: null
unit: "mm"
description: "Length in mm"
head_type:
type: string
default: ""
description: "Head type (e.g., Socket, Hex, Pan, Flat, Button)"
drive_type:
type: string
default: ""
description: "Drive type (e.g., Hex, Phillips, Torx, Slotted)"
strength_grade:
type: string
default: ""
description: "Strength grade (e.g., 8.8, 10.9, 12.9, A2-70)"
torque_spec:
type: number
default: null
unit: "Nm"
description: "Recommended torque in Newton-meters"
# Fluid Fittings (C01-C17)
C:
material:
type: string
default: ""
description: "Material (e.g., Brass, 316SS, PVC, PTFE)"
connection_type:
type: string
default: ""
description: "Connection type (NPT, BSP, Push-to-Connect, Compression)"
size_1:
type: string
default: ""
description: "Primary port size"
size_2:
type: string
default: ""
description: "Secondary port size (for reducers/adapters)"
pressure_rating:
type: number
default: null
unit: "psi"
description: "Maximum pressure rating in PSI"
temperature_min:
type: number
default: null
unit: "C"
description: "Minimum temperature rating in Celsius"
temperature_max:
type: number
default: null
unit: "C"
description: "Maximum temperature rating in Celsius"
media_compatibility:
type: string
default: ""
description: "Compatible media (air, water, oil, chemicals)"
seal_material:
type: string
default: ""
description: "Seal/O-ring material"
# Motion Components (R01-R44)
R:
# Common motion properties
load_capacity:
type: number
default: null
unit: "N"
description: "Load capacity in Newtons"
speed_rating:
type: number
default: null
unit: "rpm"
description: "Maximum speed in RPM"
# Motor/actuator properties
power_rating:
type: number
default: null
unit: "W"
description: "Power rating in watts"
voltage_nominal:
type: number
default: null
unit: "V"
description: "Nominal operating voltage"
voltage_min:
type: number
default: null
unit: "V"
description: "Minimum operating voltage"
voltage_max:
type: number
default: null
unit: "V"
description: "Maximum operating voltage"
current_nominal:
type: number
default: null
unit: "A"
description: "Nominal operating current"
current_stall:
type: number
default: null
unit: "A"
description: "Stall current"
torque_continuous:
type: number
default: null
unit: "Nm"
description: "Continuous torque in Newton-meters"
torque_peak:
type: number
default: null
unit: "Nm"
description: "Peak torque in Newton-meters"
steps_per_rev:
type: number
default: null
description: "Steps per revolution (for steppers)"
encoder_resolution:
type: number
default: null
unit: "ppr"
description: "Encoder resolution in pulses per revolution"
gear_ratio:
type: string
default: ""
description: "Gear ratio (e.g., 10:1, 50:1)"
# Bearing/linear properties
bore_diameter:
type: number
default: null
unit: "mm"
description: "Bore/shaft diameter in mm"
outer_diameter:
type: number
default: null
unit: "mm"
description: "Outer diameter in mm"
width:
type: number
default: null
unit: "mm"
description: "Width/length in mm"
travel:
type: number
default: null
unit: "mm"
description: "Travel distance in mm"
accuracy:
type: string
default: ""
description: "Positioning accuracy/repeatability"
# Pneumatic/hydraulic properties
port_size:
type: string
default: ""
description: "Port size"
stroke:
type: number
default: null
unit: "mm"
description: "Stroke length in mm"
bore:
type: number
default: null
unit: "mm"
description: "Cylinder bore diameter"
operating_pressure:
type: number
default: null
unit: "psi"
description: "Operating pressure in PSI"
# Structural Materials (S01-S17)
S:
material:
type: string
default: ""
description: "Material (e.g., 6061-T6 Aluminum, 1018 Steel, 304SS)"
material_spec:
type: string
default: ""
description: "Material specification (ASTM, AISI, etc.)"
profile:
type: string
default: ""
description: "Profile description"
dimension_a:
type: number
default: null
unit: "mm"
description: "Primary dimension (width/OD) in mm"
dimension_b:
type: number
default: null
unit: "mm"
description: "Secondary dimension (height/ID) in mm"
wall_thickness:
type: number
default: null
unit: "mm"
description: "Wall/material thickness in mm"
length:
type: number
default: null
unit: "mm"
description: "Length in mm"
weight_per_length:
type: number
default: null
unit: "kg/m"
description: "Weight per meter in kg/m"
finish:
type: string
default: ""
description: "Surface finish (mill, anodized, powder coat)"
temper:
type: string
default: ""
description: "Temper/heat treatment condition"
# Electrical Components (E01-E27)
E:
# Common electrical properties
voltage_rating:
type: number
default: null
unit: "V"
description: "Voltage rating"
current_rating:
type: number
default: null
unit: "A"
description: "Current rating"
power_rating:
type: number
default: null
unit: "W"
description: "Power rating/dissipation"
# Passive component properties
value:
type: string
default: ""
description: "Component value (10k, 100uF, 10mH)"
tolerance:
type: string
default: ""
description: "Tolerance (e.g., 1%, 5%, 10%)"
temperature_coefficient:
type: string
default: ""
description: "Temperature coefficient (e.g., X7R, C0G, NPO)"
# Package/form factor
package:
type: string
default: ""
description: "Package type (e.g., 0603, 0805, DIP-8, TO-220)"
mounting:
type: string
default: ""
description: "Mounting type (SMD, Through-Hole, Panel)"
# Connector properties
pin_count:
type: number
default: null
description: "Number of pins/contacts"
pitch:
type: number
default: null
unit: "mm"
description: "Pin pitch in mm"
wire_gauge:
type: string
default: ""
description: "Wire gauge (AWG or mm2)"
connector_type:
type: string
default: ""
description: "Connector family (JST, Molex, TE, etc.)"
# Semiconductor properties
frequency:
type: number
default: null
unit: "MHz"
description: "Operating frequency in MHz"
memory:
type: string
default: ""
description: "Memory size (for MCUs)"
interface:
type: string
default: ""
description: "Communication interfaces (SPI, I2C, UART, etc.)"
# Sensor properties
measurement_range:
type: string
default: ""
description: "Measurement range"
sensitivity:
type: string
default: ""
description: "Sensitivity/resolution"
output_type:
type: string
default: ""
description: "Output type (analog, digital, PWM, etc.)"
# Power supply properties
input_voltage:
type: string
default: ""
description: "Input voltage range"
output_voltage:
type: string
default: ""
description: "Output voltage"
efficiency:
type: number
default: null
unit: "%"
description: "Efficiency percentage"
# Mechanical Components (M01-M18)
M:
material:
type: string
default: ""
description: "Material"
# Spring properties
spring_rate:
type: number
default: null
unit: "N/mm"
description: "Spring rate in N/mm"
free_length:
type: number
default: null
unit: "mm"
description: "Free length in mm"
solid_length:
type: number
default: null
unit: "mm"
description: "Solid/compressed length in mm"
max_load:
type: number
default: null
unit: "N"
description: "Maximum load in Newtons"
# Damper/shock properties
travel:
type: number
default: null
unit: "mm"
description: "Travel distance in mm"
force_extended:
type: number
default: null
unit: "N"
description: "Force when extended (gas springs)"
damping_rate:
type: string
default: ""
description: "Damping rate/coefficient"
# Seal properties
inner_diameter:
type: number
default: null
unit: "mm"
description: "Inner diameter in mm"
outer_diameter:
type: number
default: null
unit: "mm"
description: "Outer diameter in mm"
cross_section:
type: number
default: null
unit: "mm"
description: "Cross-section diameter/thickness in mm"
hardness:
type: string
default: ""
description: "Durometer hardness (e.g., 70A)"
temperature_range:
type: string
default: ""
description: "Operating temperature range"
# Tooling and Fixtures (T01-T08)
T:
material:
type: string
default: ""
description: "Primary material"
tolerance:
type: string
default: ""
description: "Tolerance specification"
surface_finish:
type: string
default: ""
description: "Required surface finish"
hardness:
type: string
default: ""
description: "Hardness requirement"
associated_part:
type: string
default: ""
description: "Part number this tooling is used with"
machine:
type: string
default: ""
description: "Machine/equipment this tooling is for"
cycle_life:
type: number
default: null
description: "Expected cycle life"
# Assemblies (A01-A07)
A:
weight:
type: number
default: null
unit: "kg"
description: "Total weight in kg"
dimensions:
type: string
default: ""
description: "Overall dimensions (LxWxH)"
component_count:
type: number
default: null
description: "Number of unique components"
assembly_time:
type: number
default: null
unit: "min"
description: "Estimated assembly time in minutes"
test_procedure:
type: string
default: ""
description: "Reference to test procedure"
voltage_rating:
type: number
default: null
unit: "V"
description: "System voltage rating (for electrical assemblies)"
current_rating:
type: number
default: null
unit: "A"
description: "System current rating (for electrical assemblies)"
ip_rating:
type: string
default: ""
description: "Ingress protection rating (e.g., IP65)"
# Purchased/Off-the-Shelf (P01-P05)
P:
material:
type: string
default: ""
description: "Material (for raw materials)"
form:
type: string
default: ""
description: "Form/shape (sheet, rod, pellets, etc.)"
grade:
type: string
default: ""
description: "Material grade or specification"
quantity_per_unit:
type: number
default: 1
description: "Quantity per purchase unit"
unit_of_measure:
type: string
default: "ea"
description: "Unit of measure (ea, kg, m, L, etc.)"
shelf_life:
type: number
default: null
unit: "days"
description: "Shelf life in days (for consumables)"
# Custom Fabricated Parts (X01-X08)
X:
material:
type: string
default: ""
description: "Primary material"
material_spec:
type: string
default: ""
description: "Material specification"
finish:
type: string
default: ""
description: "Surface finish requirement"
critical_dimensions:
type: string
default: ""
description: "Critical dimensions and tolerances"
weight:
type: number
default: null
unit: "kg"
description: "Weight in kg"
process:
type: string
default: ""
description: "Primary manufacturing process"
secondary_operations:
type: string
default: ""
description: "Secondary operations (heat treat, plating, etc.)"
drawing_rev:
type: string
default: ""
description: "Current drawing revision"
inspection_requirements:
type: string
default: ""
description: "Inspection/QC requirements"
# UI configuration — drives form rendering for all clients.
ui:
category_picker:
style: multi_stage
stages:
- name: domain
label: "Domain"
values:
F: "Fasteners"
C: "Fluid Fittings"
R: "Motion"
S: "Structural"
E: "Electrical"
M: "Mechanical"
T: "Tooling"
A: "Assemblies"
P: "Purchased"
X: "Custom Fabricated"
# Item-level fields (stored on items table, not in revision properties)
item_fields:
description:
type: string
widget: text
label: "Description"
item_type:
type: string
widget: select
label: "Type"
options: [part, assembly, consumable, tool]
derived_from_category:
A: assembly
T: tool
default: part
sourcing_type:
type: string
widget: select
label: "Sourcing Type"
options: [manufactured, purchased]
default: manufactured
long_description:
type: string
widget: textarea
label: "Long Description"
projects:
type: string_array
widget: tag_input
label: "Projects"
search_endpoint: "/api/projects"
field_groups:
identity:
label: "Identity"
order: 1
fields: [item_type, description]
sourcing:
label: "Sourcing"
order: 2
fields:
[
sourcing_type,
manufacturer,
manufacturer_pn,
supplier,
supplier_pn,
sourcing_link,
]
cost:
label: "Cost & Lead Time"
order: 3
fields: [standard_cost, lead_time_days, minimum_order_qty]
status:
label: "Status"
order: 4
fields: [lifecycle_status, rohs_compliant, country_of_origin]
details:
label: "Details"
order: 5
fields: [long_description, projects, notes]
# Per-category-prefix field groups (rendered after global groups)
category_field_groups:
F:
fastener_specs:
label: "Fastener Specifications"
order: 10
fields:
[
material,
finish,
thread_size,
thread_pitch,
length,
head_type,
drive_type,
strength_grade,
torque_spec,
]
C:
fitting_specs:
label: "Fitting Specifications"
order: 10
fields:
[
material,
connection_type,
size_1,
size_2,
pressure_rating,
temperature_min,
temperature_max,
media_compatibility,
seal_material,
]
R:
motion_specs:
label: "Motion Specifications"
order: 10
fields:
[
load_capacity,
speed_rating,
power_rating,
voltage_nominal,
current_nominal,
torque_continuous,
bore_diameter,
travel,
stroke,
operating_pressure,
]
S:
structural_specs:
label: "Structural Specifications"
order: 10
fields:
[
material,
material_spec,
profile,
dimension_a,
dimension_b,
wall_thickness,
length,
weight_per_length,
finish,
temper,
]
E:
electrical_specs:
label: "Electrical Specifications"
order: 10
fields:
[
voltage_rating,
current_rating,
power_rating,
value,
tolerance,
package,
mounting,
pin_count,
wire_gauge,
connector_type,
]
M:
mechanical_specs:
label: "Mechanical Specifications"
order: 10
fields:
[
material,
spring_rate,
free_length,
max_load,
travel,
inner_diameter,
outer_diameter,
hardness,
temperature_range,
]
T:
tooling_specs:
label: "Tooling Specifications"
order: 10
fields:
[
material,
tolerance,
surface_finish,
hardness,
associated_part,
machine,
cycle_life,
]
A:
assembly_specs:
label: "Assembly Specifications"
order: 10
fields:
[
weight,
dimensions,
component_count,
assembly_time,
test_procedure,
voltage_rating,
current_rating,
ip_rating,
]
P:
purchased_specs:
label: "Purchased Item Specifications"
order: 10
fields:
[
material,
form,
grade,
quantity_per_unit,
unit_of_measure,
shelf_life,
]
X:
fabrication_specs:
label: "Fabrication Specifications"
order: 10
fields:
[
material,
material_spec,
finish,
critical_dimensions,
weight,
process,
secondary_operations,
drawing_rev,
inspection_requirements,
]
field_overrides:
standard_cost:
widget: currency
currency: USD
sourcing_link:
widget: url
lifecycle_status:
widget: select
options: [active, deprecated, obsolete, prototype]
rohs_compliant:
widget: checkbox