What breaks
Derive.__init__ takes the columns to derive as **transforms beside a keyword-only meta:
def __init__(self, *, meta: dict[str, Any] | None = None, **transforms: Callable[[Episode], Any]):
A caller whose column name is a constant has to unpack a dict, and every such call fails the type check: with **{name: fn} the checker cannot rule out name == 'meta', so it matches the transform function against meta: dict[str, Any] | None and reports reportArgumentType. This holds whether the key is a variable, a Final, or a plain string literal — verified against basedpyright on a reduced case.
The consequence is that the only way to name a derived column by constant is to earn a baseline entry. positronic/cfg/ds/internal.py:54 is exactly that:
_RENAME_ROBOT_COMMAND = Derive(**{keys.TARGET_EE_POSE: Get('robot_commands.pose', None)})
and it sits in .basedpyright/baseline.json for it. So the API pushes callers toward bare literals, which is hardcoded-keys — a name shared with whoever reads the column, written as a literal because the typed alternative does not check.
The shape of a fix
Take the transforms as a mapping rather than as **kwargs, so a constant key is an ordinary value and meta cannot collide with a column name. Around 58 call sites use the keyword form, so this is a mechanical sweep rather than a small edit, and it wants doing in one pass rather than alongside unrelated work.
Note the collision is also a real (if unlikely) hole: a dataset column named meta is unrepresentable today.
Where this came up
Review of #591 asked positronic/replay_record.py to define its replay channel name once. Two of the three spellings now share a constant; RestoreCommand.__init__ keeps its literal keyword because unifying it would have added a baseline entry, which grandfathered-violation forbids.
What breaks
Derive.__init__takes the columns to derive as**transformsbeside a keyword-onlymeta:A caller whose column name is a constant has to unpack a dict, and every such call fails the type check: with
**{name: fn}the checker cannot rule outname == 'meta', so it matches the transform function againstmeta: dict[str, Any] | Noneand reportsreportArgumentType. This holds whether the key is a variable, aFinal, or a plain string literal — verified against basedpyright on a reduced case.The consequence is that the only way to name a derived column by constant is to earn a baseline entry.
positronic/cfg/ds/internal.py:54is exactly that:and it sits in
.basedpyright/baseline.jsonfor it. So the API pushes callers toward bare literals, which ishardcoded-keys— a name shared with whoever reads the column, written as a literal because the typed alternative does not check.The shape of a fix
Take the transforms as a mapping rather than as
**kwargs, so a constant key is an ordinary value andmetacannot collide with a column name. Around 58 call sites use the keyword form, so this is a mechanical sweep rather than a small edit, and it wants doing in one pass rather than alongside unrelated work.Note the collision is also a real (if unlikely) hole: a dataset column named
metais unrepresentable today.Where this came up
Review of #591 asked
positronic/replay_record.pyto define its replay channel name once. Two of the three spellings now share a constant;RestoreCommand.__init__keeps its literal keyword because unifying it would have added a baseline entry, whichgrandfathered-violationforbids.