affaan-m/ECC · error · ValueError
reference probe must contain finite in-duration times
Error message
reference probe {field} must contain finite in-duration times What it means
_validate_probe requires the 'sample_times' and 'scene_changes' lists of the measured probe to contain only finite real timestamps in [0, duration]. A non-list value, a non-numeric/NaN/inf entry, or a timestamp outside the probe duration triggers this error. It prevents out-of-range times from corrupting style-sampling logic.
Solutions
- Clamp/filter all entries to 0 <= t <= duration and drop non-numeric values before calling run_workflow
- Fix the unit mismatch (e.g. divide ms values by 1000) in the probe-producing tool
- Regenerate the probe so sample_times/scene_changes are plain lists of finite numbers
- Pre-validate the lists with math.isfinite and bounds checks at load time
Example fix
# before
measured['scene_changes'] = [0, 4.2, 17.9] # duration is 12.0 -> 17.9 out of range
run_workflow(measured)
# after
dur = measured['duration']
measured['scene_changes'] = [t for t in measured['scene_changes']
if isinstance(t, (int, float)) and math.isfinite(t) and 0 <= t <= dur]
run_workflow(measured) Defensive patterns
Strategy: validation
Validate before calling
import math
def validate_times(measured):
dur = float(measured['duration'])
for field in ('sample_times', 'scene_changes'):
vals = measured.get(field, [])
if not isinstance(vals, list):
return False
if any(not isinstance(v, (int, float)) or isinstance(v, bool)
or not math.isfinite(v) or not (0 <= v <= dur) for v in vals):
return False
return True Type guard
def valid_time_list(vals, dur: float) -> bool:
return isinstance(vals, list) and all(
isinstance(v, (int, float)) and not isinstance(v, bool)
and math.isfinite(v) and 0 <= float(v) <= dur for v in vals) Try / catch
try:
run_workflow(measured)
except ValueError as e:
if 'in-duration times' in str(e):
field = str(e).split()[2]
print(f'Fix {field}: times must be numbers within [0, {measured["duration"]}]')
else:
raise Prevention
- Clamp or filter timestamps against duration before calling the workflow
- Check units (seconds vs milliseconds) between detector output and probe duration
- Drop null entries from detector lists at ingestion
- Write a unit test for probe validation with boundary times 0 and duration
When it happens
Trigger: run_workflow receiving measured['sample_times'] or measured['scene_changes'] that is not a list, or contains a negative number, a value greater than 'duration', NaN/inf, or a non-numeric element.
Common situations: Scene-detection script emitting times in milliseconds while duration is in seconds; negative timestamps from misaligned offsets; nulls in the list where a detector failed to report; times captured before duration was finalized.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- application bundle differs from its bound evidence
- At least one video is required
- cannot upload, file does not exist
- Draft name must be a plain file name
- Geometry, fps and duration must be finite and positive
AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16).
Data as JSON: /api/errors/361034383fed0df5.
Report an issue: GitHub.
Appendix: source
Thrown at skills/taste-application/scripts/tasteforge/workflow.py:155
require_finite_evidence(nested)
elif isinstance(value, list):
for nested in value:
require_finite_evidence(nested)
require_finite_evidence(measured)
duration = measured.get("duration")
if not _finite_real(duration):
raise ValueError("reference probe duration must be finite and positive")
duration = cast(float, duration)
if float(duration) <= 0:
raise ValueError("reference probe duration must be finite and positive")
for field in ("sample_times", "scene_changes"):
values = measured.get(field, [])
if not isinstance(values, list) or any(
not _finite_real(value) or float(value) < 0 or float(value) > float(duration)
for value in values
):
raise ValueError(f"reference probe {field} must contain finite in-duration times")
samples = measured.get("style_samples", [])
if not isinstance(samples, list) or any(
not isinstance(sample, dict)
or not _finite_real(sample.get("time"))
or float(cast(float, sample["time"])) < 0
or float(cast(float, sample["time"])) > float(duration)
for sample in samples
):
raise ValueError("reference style evidence times must be finite and within duration")
return float(duration)
class _SafeOutput:
"""Descriptor-bound output tree with no-follow traversal and atomic writes."""
def __init__(self, root: Path) -> None:
self._root_fd = -1
if not hasattr(os, "O_NOFOLLOW") or not hasattr(os, "O_DIRECTORY"):View on GitHub (pinned to 8321021c54)