v1.2.0:8 — tolerate decimal integers in AI output
Local models (Qwen via SparkControl, surfaced on the first SparkControl smoke test) sometimes emit a decimal where the AI-output schema expects an integer — e.g. a half-step "rpe": 7.5 or "reps": 8.0. Zod's .int() rejected these and failed the ENTIRE parse, so one stray decimal killed an otherwise good generation. Fix: a shared looseInt helper rounds a number to the nearest int before the .int() check, applied to every integer field in both the program and single-workout schemas (rpe, reps, sets, gear, order, durationSeconds, rest/week/day numbers). RPE/reps/sets are stored as integers downstream, so rounding is the correct landing. Transform-before-validate, so inferred types are unchanged. Parse-only; no schema/data change. 261 tests pass; built + sideloaded to immense-voyage.local (1.2.0:8, clean non-root launch). SparkControl now confirmed working end-to-end.
This commit is contained in:
@@ -22,6 +22,7 @@ import { v_1_2_0_4 } from './v1.2.0.4'
|
||||
import { v_1_2_0_5 } from './v1.2.0.5'
|
||||
import { v_1_2_0_6 } from './v1.2.0.6'
|
||||
import { v_1_2_0_7 } from './v1.2.0.7'
|
||||
import { v_1_2_0_8 } from './v1.2.0.8'
|
||||
|
||||
/**
|
||||
* Version graph for the `proof-of-work` package.
|
||||
@@ -91,9 +92,13 @@ import { v_1_2_0_7 } from './v1.2.0.7'
|
||||
* internal address, model auto-detected via /api/endpoints. Plus a
|
||||
* base-URL footgun fix (a custom URL could attach to a fixed-URL
|
||||
* provider and be silently ignored). No schema/data change.
|
||||
* v1.2.0:8 — Tolerate decimal integers in AI output: a shared looseInt rounds
|
||||
* float values (e.g. a half-step RPE 7.5 from a local model) before
|
||||
* the .int() check, so one stray decimal no longer fails the whole
|
||||
* generation. Parse-only; no schema/data change.
|
||||
*/
|
||||
export const versionGraph = VersionGraph.of({
|
||||
current: v_1_2_0_7,
|
||||
current: v_1_2_0_8,
|
||||
other: [
|
||||
v_1_0_0_1,
|
||||
v_1_0_0_2,
|
||||
@@ -117,5 +122,6 @@ export const versionGraph = VersionGraph.of({
|
||||
v_1_2_0_4,
|
||||
v_1_2_0_5,
|
||||
v_1_2_0_6,
|
||||
v_1_2_0_7,
|
||||
],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user