MergeSettings: an append annotation inside an overlay-only object is emitted raw into settings.json
Maintainers usually reply within 6 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- bun, json, typescript
- Domain
- backend
Research direction
Read LifeOS/install/LIFEOS/TOOLS/MergeSettings.ts around lines 170–177, then run the clean-tree repro from the issue and inspect out.json. Check how overlay-only objects are handled and compare the result with the stated expected output. Done means nested merge annotations are consumed and the output contains the expected array.
Written by the indexing model from the issue text.
Description
Version
LifeOS 7.40.4; repro on main @ 5e2f2e8
What is broken
mergeSettings consumes { "__merge": "append", "values": [...] } only when it meets the annotation at a key the system layer also has, or at the top level of an overlay-only key. When the overlay adds an object the system layer does not have at all, the function falls through to cloneJsonValue(user), which copies the object verbatim, so any annotation nested inside it reaches settings.json unconsumed. Claude Code then rejects the field, e.g. autoMode.allow: Expected array, but received object, and the rules in it are not applied. The file header promises "Merge annotations are consumed and never emitted in the output." The --check mode compares against the same merge, so it reports no differences.
Where (file:line)
LifeOS/install/LIFEOS/TOOLS/MergeSettings.ts:177 (return cloneJsonValue(user);), reached from the overlay-only branch at :170 with system === undefined.
Repro on a clean tree
mkdir -p /tmp/ms-repro && cd /tmp/ms-repro
echo '{"permissions":{"allow":["Read"]}}' > system.json
echo '{"autoMode":{"allow":{"__merge":"append","values":["rule one"]}}}' > user.json
HOME=/tmp/ms-repro bun <lifeos-checkout>/LifeOS/install/LIFEOS/TOOLS/MergeSettings.ts \
--system system.json --user user.json --output out.json
jq -c .autoMode out.json
Negative control
On unpatched main @ 5e2f2e8 the merge exits 0 ("Merged 1 system keys + 1 user overlays") and out.json contains {"allow":{"__merge":"append","values":["rule one"]}}, an object where Claude Code requires an array. Expected: {"allow":["rule one"]}.
A stock install does not hit this through autoMode, because the shipped settings.system.json defines autoMode. It is hit by any overlay-only section that carries an annotation, e.g. a settings.system.json that omits autoMode while SettingsBackport writes an append annotation for autoMode.allow into the overlay.
Suggested fix
Recurse into overlay-only objects so nested annotations are consumed. Tested against the repro above: output becomes {"allow":["rule one"]}.
@@ -172,6 +172,10 @@
return merged;
}
+ if (system === undefined && isObjectRecord(user)) {
+ return mergeSettings({}, user);
+ }
+
return cloneJsonValue(user);
}
Before submitting
- I searched open and closed issues for this defect.
- The repro runs against a clean tree of the version above, not against my modified install.
- I removed personal data from the pasted output.
- Dominant language
- TypeScript
- Stars
- 19.3k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from danielmiessler/LifeOS
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
danielmiessler/LifeOS#2305 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
danielmiessler/LifeOS#2299 ·
Maintainers usually reply within 6 days
-
Upgrade: Anthropic.ts report exists only on stdout while state is saved, and --help runs a full scanOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
danielmiessler/LifeOS#2290 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
danielmiessler/LifeOS#2289 ·
Maintainers usually reply within 6 days
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
danielmiessler/LifeOS#2288 ·
Maintainers usually reply within 6 days
All issues in danielmiessler/LifeOS
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/playwright#43327 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/TypeScript#64758 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
opensearch-project/OpenSearch-Dashboards#12937 ·
Maintainers usually reply within 2 days
-
Liveness marks block-included attesters live in the block's epoch instead of the attestation's epochOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
status: needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
a2ui-project/a2ui#3158 ·
Maintainers usually reply within 2 days