Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
docs([settings-shallow-getsave-callers-tidy]): remove from PLAN.md and log to changelog
[._.]/ Adam Eivy6fb785a503a4
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 61c8c4020d..219384ec8b 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -61,6 +61,7 @@- **[cos-agent-output-write-amplification] Streamed CoS agent output no longer rewrites the entire agent-state file once per line.** A shared ~250ms output batcher now coalesces the runner's per-line output events and direct-CLI stdout/stderr into single state writes (draining before an agent is marked complete), cutting agent-state write churn on chatty agents from dozens of writes/sec to a few — with no change to the live output tail (no user-facing change).- **[subagent-spawner-top-level-side-effects]** The CoS agent spawner now initializes explicitly at server startup instead of as a side effect of being imported, so importing it (in tests or elsewhere) no longer re-arms its event listeners and timers (no user-facing change).- **[settings-getsave-callers-stale-base]** Saving or clearing the HF / Civitai API keys now runs its read-modify-write inside the settings write queue, so a save landing at the same moment can't clobber it with a stale snapshot (no user-facing change).+- **[settings-shallow-getsave-callers-tidy]** Saving Telegram config (method, bot token/chat id, forwarded types) and system-health alert thresholds now runs inside the settings write queue too, closing the same stale-snapshot clobber window (no user-facing change).- **[wardrobe-appearance-id-route-validation] Rendering a storyboard scene with a stale outfit pick now fails clearly instead of silently ignoring it.** If a scene's wardrobe selection points at a character or outfit that no longer exists (e.g. it was deleted after the pick was made), the render returns a clear error instead of quietly rendering the character without that outfit.## Fixeddiff --git a/PLAN.md b/PLAN.mdindex 91bf4a6dd2..508df5cecf 100644--- a/PLAN.md+++ b/PLAN.md@@ -6,7 +6,6 @@ For project goals, see [GOALS.md](./GOALS.md). For completed work, see [.changelClaimable, well-specified, no decision needed — `/claim`-able. Unordered.-- [ ] [settings-shallow-getsave-callers-tidy] **Drop the redundant external `getSettings()` read in two shallow-merge settings callers.** After `[settings-getsave-callers-stale-base]` migrated the deep-merge/sub-key-delete callers to `updateSettingsWith`, two callers still do `getSettings()` *then* `updateSettings(patch)`: `server/services/telegram.js` (~line 56, merges a telegram method object) and `server/services/systemHealth.js` (~line 280, merges health thresholds). Both are shallow-merge-safe, so they don't have the stale-base clobber risk the migrated four had — but the external `getSettings()` read is pointless when `updateSettings(patch)` already does its own queued read-merge. Drop the leading `getSettings()` and pass just the patch (verify neither caller actually needs to read a current value to compute the patch — if it does, use `updateSettingsWith`). Pure tidy; no behavior change. Surfaced by /simplify (reuse) during the stale-base caller migration (2026-06-02).- [ ] [json-state-serialization-one-mechanism] **Two serialization mechanisms guard single-JSON-file writes — pick one.** `server/services/cosState.js` serializes `state.json` writes with the `withStateLock` async mutex (`createMutex`), while `settings.js` (and the issues/series/mediaCollections splits) serialize with `createFileWriteQueue` (single-tail promise chain). Both solve the same "don't let two read-merge-write cycles interleave on one file" problem. Standardize on `createFileWriteQueue` (the documented convention in CLAUDE.md and `fileWriteQueue.js`) and retire the mutex path: route `cosState.saveState`/`loadState`-mutating callers through a per-file queue, then drop `withStateLock`. Low value (both are correct today), and `withStateLock` is imported by several CoS modules so the migration needs care — surfaced by /simplify altitude during the settings atomicWrite migration.- [ ] [worktree-remove-helper] **Extract the repeated "worktree remove --force → on-fail rm + prune" dance into one helper.** The pattern is now inlined in 4 spots in `server/services/worktreeManager.js`: `removeWorktree`, `reapMergedWorktrees`, `cleanupExternalRepoWorktrees`, and `removePersistentWorktree`. Extract `forceRemoveWorktreeDir(repo, worktreePath, label)` and route all four through it.- [ ] [plan-task-prefer-merge] **Switch the `/claim` (`plan-task`) Phase-6 merge order to prefer `--merge` over `--squash`.** The live `plan-task` prompt in `server/services/taskSchedule.js` (~line 562) still tries `gh pr merge --auto || --squash || --merge || --rebase`, so `/claim` squash-merges by default — inconsistent with the `--merge`-first default now used by the review-loop / `/do:pr` agent prompts. Deferred because: (a) `plan-task` is a **version-migrated** prompt, so the change needs a `PROMPT_VERSIONS['plan-task']` bump (7→8) **and** the v7 default preserved in `PREVIOUS_DEFAULT_PROMPTS['plan-task']` (~190-line byte-exact copy); (b) `/claim` self-cleans its worktree/branch regardless of merge method; and (c) `reapMergedWorktrees` detects squash merges anyway. Low benefit, non-trivial migration cost — do it as a focused follow-up when touching `plan-task` prompt versioning next.