Skip to content

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

chore: release v2.4.0

[._.]/ Adam Eivy7a6126c3beeb
diff --git a/.changelog/NEXT.md b/.changelog/v2.4.0.md
similarity index 70%
rename from .changelog/NEXT.md
rename to .changelog/v2.4.0.md
index 4e08916921..7153bd5275 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/v2.4.0.md
@@ -1,4 +1,6 @@
-# Unreleased Changes
+# Release v2.4.0
+
+Released: 2026-05-19
## Added
@@ -10,6 +12,9 @@
- **Per-field arc locks on series.** `series.locked.arcFields` is an opt-in sub-map (`{ logline, summary, themes, protagonistArc, shape }`); locked fields are preserved verbatim through `commitSeasonsWithRemap` so arc regenerate + auto-resolve only rewrite the unlocked fields. Inline lock icons on the Arc Canvas read view toggle each field.
- **Pagination on `GET /api/pipeline/series/:id/issues`.** Accepts optional `?offset=N&limit=N`; when present, returns `{ items, total, offset, limit }`. Without the params, the endpoint still returns the legacy raw array. Eliminates the silent 1000-issue cap for long-running series.
- **Zod validation across cos-task / loops / cos-job / cos-learning routes.** Replaces manual destructure-and-check with `safeParse` + `failValidation` for consistent 400 errors.
+- **Pending sheet slot cleanup on character/universe delete.** New `universeCharacterSheetSlot.js` module owns the `_latestPendingByCharacter` Map (extracted from `universeCharacterSheet.js` to avoid a require cycle) and exposes `clearPendingSheetSlot(universeId, entryId)` + `clearPendingSheetSlotsForUniverse(universeId)`. `updateUniverse` diffs `cur.characters` vs the merged record inside the write queue and drops slots for any character that disappeared; universe delete drops all slots for that universe. Closes the leak where an in-flight render whose character was deleted mid-flight could still stamp `referenceSheetImageRef` against a missing record.
+- **`useRowDraft` hook for multi-column row drafts.** Row-level analogue of `useFieldDraft` in `client/src/hooks/`. Preserves the sibling-draft "ride-along" race protection (drafts map merged into the commit payload so a fast A-blur → B-blur sequence doesn't lose column A when the parent hasn't re-rendered yet). `ListRow` in `CharacterDetailEditor.jsx` collapses to a single hook call; covered by 9 vitest cases.
+- **Module discovery infrastructure — barrels + catalogs.** New `index.js` barrels and `README.md` catalogs across `server/lib/`, `client/src/lib/`, `client/src/hooks/`, and `client/src/services/` enumerate ~80 reusable helpers so new code can grep the catalog before re-implementing (`tryReadFile`, `atomicWrite`, `optionalBooleanMap`, `useLockToggle`, `formatBytes`, `copyToClipboard`, etc.). New "Module Organization" section in CLAUDE.md codifies where new code lives, the discovery rule ("grep the catalog before writing a helper"), the maintenance rule ("every new public module re-exports from the barrel AND lists in the README"), and the namespace-export pattern for domain-prefixed name collisions. `server/lib/index.test.js` (and matching client tests) enforce the barrel/README contract so a forgotten entry fails boot.
## Changed
@@ -19,6 +24,7 @@
- **`atomicWrite` migration.** 10 services + 4 aiToolkit modules switched from inline `ensureDir + writeFile + JSON.stringify` to the `atomicWrite` helper (toolkit gets a self-contained copy at `server/lib/aiToolkit/internal/atomicWrite.js`). Prevents partial-write corruption on shared JSON state files.
- **Code-quality dedup batch.** Eight `/simplify` follow-up items shipped together: new `tryReadFile` helper in `fileUtils.js` (collapses the `readFile(...).catch(() => null)` pattern at ~60 sites); new `optionalBooleanMap` Zod helper (3 sites); new `assertProvider` helper in `promptRunner.js` (7 sites); new `useLockToggle` React hook (4 sites in ArcCanvas + PipelineIssue); three more `resolveProviderAndModel` migrations (agentContentGenerator, agentPersonalityGenerator, loops); TUI text-accumulator skip in `runPromptThroughProvider` (avoids hundreds of KB of screen-redraw concat per TUI run); `loadProviders` JSON.parse rescue (renames `<path>.corrupt.<ts>` instead of crashing boot); new `createProvider` field-parity test guarding the schema-vs-explicit-list regression noted in CLAUDE.md.
- **AI Toolkit runner: PortOS-aware `deleteRun` override.** Now stops the live child process before deleting the run on disk (closes a zombie-process leak when an in-flight CLI run was deleted via the UI).
+- **Better-audit residue cleanups.** Four bundled refactors: (1) Shared `formatTimecode` / `formatDurationSec` / `formatDateShort` in `client/src/utils/formatters.js` (migrated `VideoTimelineEditor`, `VideoTimeline`, `ImportTab` off local copies). (2) `feeds.js` now sorts `data.items` on write (addFeed / refreshFeed / refreshAllFeeds), so `getItems` drops its per-call sort; `ensureItemsSorted` normalizes legacy unsorted data once on first read with an `isSortedNewestFirst` guard so already-sorted state isn't re-saved on boot. (3) Typed `ServerError` codes replace brittle `err.message` string-checks: `voice/tts.js` throws `UNKNOWN_VOICE` (400); nine "AI Toolkit not initialized" throws in `providers.js` consolidated into one `requireToolkit()` helper throwing `AI_TOOLKIT_NOT_INITIALIZED` (503); `visionTest.js`'s misleading "Provider not found" path swapped for an accurate "AI provider service is still initializing" message. (4) Named magic numbers across `cos.js` (`RECENT_TASK_LIMIT` = 50, `MAX_PARALLEL` = 4, etc.) — no behavior change, just self-documenting constants.
## Fixed
@@ -34,6 +40,7 @@
- **Accessibility:** form labels in `VoiceTab`, `ProviderModelSelector`, `IconPicker`, `ImageGenTab`, `BackupTab`, `MortalLoomTab`, `BackupWidget` now have `htmlFor`/`id` pairing via `useId()`; icon-only buttons in `IconPicker` and `TaskAddForm` use `aria-label`.
- **`ImageGenTab` parallel-limit number input** no longer snaps to default on every keystroke; draft string state, clamp on blur.
- **NAV_COMMANDS manifest** registers `/city/settings` and `/ambient` so they are reachable from `⌘K` and voice.
+- **`loadProviders()` corrupt-sample handling.** Parses the shipped `providers.sample.json` BEFORE persisting it as the live `providers.json`. Previously a corrupt sample combined with a corrupt user file would rename the sample to `<sample>.corrupt.<ts>` while leaving the freshly-written corrupt user file in place; next boot still saw the bad user file and the sample silently disappeared. Now `parseOrRescue` only guards the user-side file — the only file whose corruption we want to quarantine.
## Removed
@@ -42,3 +49,7 @@
## Changed (continued)
- **Series creation requires a universe in the UI.** The `New Series` form's universe picker is now required (submit disabled until one is picked); the bible's "Linked World" picker drops the `— None —` option. Server-side stays permissive so the importer / share-bucket sync can still land legacy orphan records — the UI is the gate, matching PortOS's single-user model.
+
+## Full Changelog
+
+**Full Diff**: https://github.com/atomantic/PortOS/compare/v2.3.0...v2.4.0
diff --git a/package-lock.json b/package-lock.json
index bb91383e93..b6601c6866 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "portos",
- "version": "2.3.0",
+ "version": "2.4.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "portos",
- "version": "2.3.0",
+ "version": "2.4.0",
"license": "MIT",
"devDependencies": {
"pm2": "7.0.1"
diff --git a/package.json b/package.json
index c5fe75df93..79b41587d7 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "portos",
- "version": "2.3.0",
+ "version": "2.4.0",
"private": true,
"description": "Local dev machine App OS portal",
"author": "Adam Eivy (@antic|@atomantic)",