metadata: Add a 'warnings' slot that accumulates across stack frames

A warning is a Z5 which we record rather than raise, so that execution continues and the diagnostic is not lost. The evaluator already emits them (Z590-Z593) and WikiLambda already displays them, but nothing on the orchestrator side could add one, and what did arrive was lossy: only 'executorDebugLogs' collected the values of every frame, so a second warning silently replaced the first, and a nested frame lost to the one enclosing it.

Generalise that single special case into a table of accumulating keys, each with the element type of the typed list it becomes, so setMetadata(), mergeKeys() and getMergedMetadata() all read the rule from one place. Warnings are also deduplicated and capped: one raised inside a recursive function occurs once per frame, and WikiLambda caches the envelope, so an unlimited list makes every later read of that result more expensive.

A value arriving as a bare Z5 rather than as a list is wrapped, not dropped, so an evaluator older than this change still reaches the reader.

Assisted-by: Claude Opus 5
Bug: T427112

Edited by Jforrester

Merge request reports

Loading