harness-base: add assertions for common agent config mistakes (closes #318)

This commit is contained in:
damocles 2026-05-23 00:41:15 +02:00 committed by Mara
parent ce539559d5
commit e70ae7776c

View file

@ -329,8 +329,10 @@
# expected to set `_module.args.flakeInputs = builtins.removeAttrs inputs ["self"]`. # expected to set `_module.args.flakeInputs = builtins.removeAttrs inputs ["self"]`.
# If `self` leaks into flakeInputs the agent gets a spurious attrset # If `self` leaks into flakeInputs the agent gets a spurious attrset
# entry that can shadow real inputs and is almost certainly a bug. # entry that can shadow real inputs and is almost certainly a bug.
# Guard with `or {}` so standalone evaluation stays clean when
# flakeInputs is absent from _module.args.
{ {
assertion = !(builtins.hasAttr "self" flakeInputs); assertion = !(builtins.hasAttr "self" (config._module.args.flakeInputs or { }));
message = '' message = ''
hyperhive: `flakeInputs` must not contain "self". hyperhive: `flakeInputs` must not contain "self".
In your agent flake.nix, use: In your agent flake.nix, use: