A token used as a JSON mapping key remains raw in the structured walker;
its presence prevents the fixed-point check from passing, so the fallback
drops unrelated Kanban handoff, request-dump, and trace argument fields.
Redact keys as quoted JSON leaves and pass the sanitized key as value context.
Carrier PR: NousResearch/hermes-agent#155252 (c2h5oh)
Original structured helper: ZHJay (#87030)
Refs NousResearch/hermes-agent#77472
(cherry picked from commit a002f7c30f68727419ed8422e95bde83c8393290)
A single redact_sensitive_text pass is not always a fixed point: a head/tail
mask (TOKEN=<hex> -> TOKEN=6f1d2a...d3c) is masked again by another rule on
the next pass. _settled checks with that extra pass, so it failed and the hard
pass replaced every sibling string with ***. Repeat the leaf pass (bounded)
until it stops changing; _settled, the hard pass and the sentinel are unchanged.
Refs #77472
Co-authored-by: BearHuddleston <196404565+BearHuddleston@users.noreply.github.com>
A keyless leaf was redacted as bare text: "DB_PASSWORD=pw..." became
"DB_PASSWORD=***", and on re-serialization the env pattern swallowed the
closing quote again, so the soft pass never settled and the hard pass masked
every string in the payload (kanban handoffs lost summary fields next to a
commands_run list). List/tuple items and bare top-level strings now go through
the same quoted-JSON path as dict values, with an empty key prefix.
Refs #77472
Co-authored-by: teknium1 <127238744+teknium1@users.noreply.github.com>
json.dumps' default \uXXXX escapes left a token glued to non-ASCII text
(e.g. 中sk-...) after an ASCII letter, so the leaf pass missed it, the settle
check (ensure_ascii=False) caught it and the hard pass masked every sibling.
Refs #77472