On this page
Generated strictspec validator for the character-preview document: per-part variant and palette selections, randomizer weights, and oscillator functions.
#server.src.pixelweaver._gen.character_preview
#server.src.pixelweaver._gen.character_preview
#validate_bytes
def validate_bytes(input: bytes, syntax: str) -> tuple[CharacterPreviewState | None, tuple[Diagnostic, ...]]RAW-BYTES entry point: lossless parse of input in the given syntax ("json" | "toml" | "jsonl"), then validate. Returns the typed root value (None when any diagnostic fired) and the ordered diagnostics.
#validate_bytes_with_evidence
def validate_bytes_with_evidence(input: bytes, syntax: str, evidence: dict | None) -> tuple[CharacterPreviewState | None, tuple[Diagnostic, ...]]validate_bytes plus cross-document resolver evidence for the phase-2 constraint vocabulary.
#validate_value
def validate_value(v: Value) -> tuple[CharacterPreviewState | None, tuple[Diagnostic, ...]]TAGGED-VALUE entry point: validate an already-parsed tagged document value (from strictspec.load_value or a typed constructor). Raw untagged dicts are never accepted.
#CharacterPreviewState
Frozen typed binding of the "CharacterPreviewState" record. Immutable; use with_* for copy-on-write.
#with_version
def with_version(self, v: str) -> CharacterPreviewState#with_parts
def with_parts(self, v: Value) -> CharacterPreviewState#with_randomizer
def with_randomizer(self, v: RandomizerConfig) -> CharacterPreviewState#with_oscillators
def with_oscillators(self, v: OscillatorConfig) -> CharacterPreviewState#PartSelection
Frozen typed binding of the "PartSelection" record. Immutable; use with_* for copy-on-write.
#with_variantIndex
def with_variantIndex(self, v: int | None) -> PartSelection#with_paletteClassId
def with_paletteClassId(self, v: str | None) -> PartSelection#with_locked
def with_locked(self, v: bool) -> PartSelection#RandomizerConfig
Frozen typed binding of the "RandomizerConfig" record. Immutable; use with_* for copy-on-write.
#with_seed
def with_seed(self, v: int) -> RandomizerConfig#with_rollIndex
def with_rollIndex(self, v: int) -> RandomizerConfig#with_variantWeights
def with_variantWeights(self, v: Value) -> RandomizerConfig#with_paletteWeights
def with_paletteWeights(self, v: Value) -> RandomizerConfig#OscillatorConfig
Frozen typed binding of the "OscillatorConfig" record. Immutable; use with_* for copy-on-write.
#with_functions
def with_functions(self, v: list[Value]) -> OscillatorConfig#with_assignments
def with_assignments(self, v: list[OscAssignment]) -> OscillatorConfig#SineFunction
Frozen typed binding of the "SineFunction" record. Immutable; use with_* for copy-on-write.
#with_id
def with_id(self, v: str) -> SineFunction#with_name
def with_name(self, v: str) -> SineFunction#with_type
def with_type(self, v: str) -> SineFunction#with_axis
def with_axis(self, v: str) -> SineFunction#with_amplitudePx
def with_amplitudePx(self, v: int) -> SineFunction#with_periodMs
def with_periodMs(self, v: float) -> SineFunction#with_phaseMs
def with_phaseMs(self, v: float) -> SineFunction#BlinkFunction
Frozen typed binding of the "BlinkFunction" record. Immutable; use with_* for copy-on-write.
#with_id
def with_id(self, v: str) -> BlinkFunction#with_name
def with_name(self, v: str) -> BlinkFunction#with_type
def with_type(self, v: str) -> BlinkFunction#with_periodMs
def with_periodMs(self, v: float) -> BlinkFunction#with_onMs
def with_onMs(self, v: float) -> BlinkFunction#with_phaseMs
def with_phaseMs(self, v: float) -> BlinkFunction#OscAssignment
Frozen typed binding of the "OscAssignment" record. Immutable; use with_* for copy-on-write.
#with_functionId
def with_functionId(self, v: str) -> OscAssignment#with_partKey
def with_partKey(self, v: str) -> OscAssignment#with_layerId
def with_layerId(self, v: str | None) -> OscAssignment#with_blinkMode
def with_blinkMode(self, v: str) -> OscAssignment