Files
agency-agents/scripts
Michael SitarzewskiandClaude Fable 5.1 3febe026c1 fix(lib): get_field strips a quoted YAML scalar's outer quotes so quoted sources don't double-wrap (#826)
Contributors keep reaching for the same fix when a description contains ": "
and breaks YAML frontmatter: double-quote the source scalar (#473 for
zk-steward, re-proposed in #548, and again in #810). #778 fixed the same
problem one layer down by having the converters emit quoted scalars. The two
compose badly: get_field returned a quoted source's quotes as content, so
yaml_quote wrapped them again and every generated file for an already-quoted
agent shipped as  description: '"..."'  with a literal quote leaking into the
parsed value. zk-steward and ai-data-remediation-engineer are affected on
main today.

get_field now treats one matching outer pair of double or single quotes as
delimiters: it strips them and unescapes (\" -> ", \\ -> \, '' -> '). Quoting a
source description is now safe and harmless, so #473/#548/#810's instinct and
#778's generator-side fix reconcile. Unquoted sources are unchanged.

Verified in a sandbox end-to-end (source -> convert.sh -> parsed YAML):
zk-steward and ai-data-remediation-engineer no longer leak a quote and keep
their internal apostrophes; developer-tooling-engineer (unquoted, contains
": ") is byte-identical to before; synthetic '...''...' and "...\"...\\" cases
unescape correctly. lib.sh is only ever sourced by bash (its shebang); note
`repeat()` at the top of the TUI section is a zsh reserved word, so sourcing
lib.sh from a zsh shell errors — pre-existing and unrelated.

Refs #473 #548 #810 #778

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-02 20:32:18 -05:00
..