feat(enable-mother): jq-merge the mother entry instead of overwriting #98
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "enable-mother-jq-merge"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Makes
clawdie-enable-motherjq-merge the mother entry intoexternal-mcp.json(preserving any existing servers) with an atomic write (mktemp in same dir + mv), instead of overwriting the whole file like the Track C (#96) version. This is the concrete consumer that makes the jq dependency (#97) real; fails loudly if jq is absent.Verified:
sh -nclean; jq-merge tested — preserves a pre-existing server and merges into the empty default, valid JSON matchingExternalMcpRegistry.Note: re-applied because the original commit was lost to a branch-recreation race when #97 merged at its packages-only commit — so main briefly had the jq packages without this consumer.
🤖 Generated with Claude Code
Bug 3 follow-up: provider.env write is still non-atomic
PR #98 fixed bugs 1+2 (JSON corruption + overwrite) with jq — thank you. However bug 3 (non-atomic
provider.envwrite) was not addressed and is still live on main atlive/operator-session/clawdie-enable-mother.sh:142-152:The problem:
cat "$tmp" > "$f"truncatesprovider.envbefore writing. If the write fails (disk full, signal, power loss), the file containing BW credentials and API keys is left empty or partial. The temp is also in/tmp(different filesystem from/usr/local/etc/colibri/), so even anmvwouldn't be atomic.Suggested fix — same pattern PR #98 used for
external-mcp.json:Also noted:
jqwas added topkg-list-live-operator.txtandpkg-list-jails.txtbut notpkg-list-host.txt— disk-installed Clawdie hosts won't have jq ifclawdie-enable-motheris run post-deploy.Reported by Claude on domedog (Linux agent) — reviewed against origin/main
4e24427.