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
Release v2.17.0
Released: 2026-06-08
Added
- Versioned PostgreSQL schema-migration runner — PortOS now has a lightweight, ordered DB-migration runner for schema deltas that the boot-time
ensureSchema()(which only handles additiveCREATE/ADD IF NOT EXISTSfresh-install DDL) can't express: column renames, type changes, data transforms, and embedding-dimension changes. Ordered migration files live inserver/scripts/db-migrations/(both.sqland.js— a.jsmigration exportsasync up(client)and receives the transaction client so it can read + transform rows in the same transaction). On boot, after the base schema is ensured and the database-ready gate passes but before any store warms or the server starts listening, each unapplied migration runs inside a single transaction together with the insert that records it in a newschema_migrationstracking table — so a failed migration rolls back atomically (never marked applied) and aborts boot loudly rather than leaving a half-migrated install serving requests. Already-applied migrations are skipped, so the runner is idempotent on every boot. No real migration ships yet (the schema is current) — this is the runner, the tracking table, and the format documentation (server/scripts/db-migrations/README.md). The runner is skipped entirely under theMEMORY_BACKEND=filedev/test escape hatch, likeensureSchema(). (#1029) - Songs: sheet-music harmony parts, derived from the melody by AI — a song can now carry multiple staves beyond its base melody — Bass, Mid Harmony I/II, High Harmony I/II — each its own sheet music that stacks with the melody when sung together. In the Sheet music editor there's a new Sheet music parts section with a one-click Derive with AI: it reads the song's base melody and writes a full layered-folk vocal stack — chord-tone voicings (each voice targets a chord tone and moves smoothly, rather than tracking the melody in parallel 3rds/6ths like a "MIDI choir"), with a hymn-like root–fifth bass, sustained inner pads, an upper pad that keeps the dominant-7 leading tone (e.g. the F# on D7 that pulls back to G), a sparse top descant that enters late, sensible per-voice ranges, and staggered entrances. Parts land in the editor for you to review, tweak, and Save — nothing is auto-saved. You can also add a blank part (seeded from the melody) and hand-edit it. In the read/perform view, the Sheet music card gains a part switcher — flip between Melody and each harmony (laid out low→high) and play any one back as a reference tone on its own. Derive is gated on the base melody being saved (it reads the persisted score), so you won't harmonize stale notes. Built on the existing in-house lead-sheet renderer — no third-party engraving or MIDI library. The built-in "500 Miles" now ships with the full five-part harmony stack as a worked example.
- Songs: pitch-detection core (foundation for the upcoming vocal tuner & color-match) — a new in-house, dependency-free DSP module estimates the fundamental frequency of sung audio (McLeod normalized-square-difference autocorrelation, with a clarity score that rejects silence and noise) and maps frequency↔note using the same diatonic staff math the sheet-music renderer already uses — so a detected pitch lands on exactly the note position the staff would draw. It also ships a live pitch tracker that reads a microphone analyser on an animation-frame loop and smooths the result (median + EMA) to suppress the octave jumps raw vocal detection produces. No new third-party library — like the rest of the song system's notation stack, the detector is hand-rolled in-tree. This is groundwork; the singer-facing tuner, color-match grading, and sing-to-score features build on it.
- Songs — an a cappella song workbench (Create → Songs) — write, arrange, and learn songs like "500 Miles" by Peter, Paul and Mary. Each song tracks its key, tempo, and rhythm shape (slow 4/4 ballad, compound 6/8 dirge, free-time lament, and more), lyric sections, and the voice layers you're stacking — with per-layer learning notes. An "Add from ladder" picker seeds layers in the recommended foundation-first order (lead → bass → thirds → fifths → drone → counter-melody). A deep-linkable Learning Guide (Create → Songs → Learning Guide, or
/songs/guide) covers dirge rhythm shapes with tempo bands, the layer-building ladder, a step-by-step practice sequence for learning a new song, and a plain-language musical-notation primer (staves, time signatures, note values, dynamics, reading a lead sheet). A worked "500 Miles" example is seeded on first visit. Reachable from⌘Kand voice nav. - Songs: AI generate, expand & evaluate — like the manuscript and universe/series creators, the Songs workbench now drafts and critiques arrangements with AI. From the Songs list, Generate drafts a full arrangement (lyrics, voice layers, key/tempo/rhythm shape, notation, and learning notes) from the title/artist as a brief; inside the editor, Generate draft and Expand current rewrite or build on the open draft, and Evaluate scores the arrangement 0–100 for performance-readiness with concrete strengths, weaknesses, and suggestions. The model returns rhythm-shape and voice-layer ids the editor's pickers already understand. Generated drafts land in the editor for review and are never auto-saved.
- Songs: record & layer your own vocals — record each part straight from the mic in the song editor (saved as a vocal take), assign takes to voice layers, then Play layered to start every unmuted take together — sample-aligned on one audio clock — so you can stack a lead, bass, and harmony and rehearse a cappella against yourself. Mute/solo individual takes, scrub each one with its own player, and the takes persist with the song.
- Songs: a metronome with count-in and a visual beat pulse — the song recorder now has a built-in metronome so you can keep time while you record. It defaults to the song's tempo (BPM) and derives its time signature from the sheet-music header (4/4 if none), accents beat 1 both audibly (a brighter click) and visually (a pulsing accent dot), and offers an optional one-bar count-in so you know exactly where beat 1 lands before you start singing. The clicks ride the same audio clock the layered playback uses, so the beat stays sample-accurate instead of drifting. This is also the shared timing grid the upcoming pitch-matching and sing-to-score features will build on.
- Daily budgets for the Chief of Staff's domains — each domain (Brain auto-classify, Memory auto-extract, CoS auto-run, Messages auto-send) can now carry a daily cap on how many automatic actions it takes and how many minutes of work it does. When a domain reaches its cap it pauses that automatic work for the rest of the day and resumes after the counters reset at midnight; the Chief of Staff config panel shows each domain's usage so far today. Caps are off by default (blank means unlimited), so nothing changes until you set one. This rounds out the per-domain guardrails alongside the off / dry-run / execute controls.
- Scheduled "Claim Issue" task — a new built-in CoS schedule (CoS → Schedule → Claim Issue) that runs the
/claim --issuesflow on a cadence: it picks the next open GitHub issue, creates its ownclaim/issue-<num>worktree, implements the fix, opens a PR that closes the issue, runs the configured reviewers, merges, and cleans up. Configurable per app via an Issue Author Filter — claim only issues filed by the repository owner (default) or any open issue regardless of author. Off by default; enable and pick a provider/model per app like the other improvement tasks. - Scheduled "Refresh local-LLM catalog" task — a new built-in CoS schedule that periodically researches the current best local models per category and opens a PR refreshing PortOS's bundled suggested-models catalog (
server/lib/localLlmCatalog.js) and the editorial model ranking, so the in-app install picker and recommendations don't go stale. It no-ops on any repo lacking the catalog file, so it only does work when enabled on the PortOS app itself. Off by default; weekly when enabled, and it only opens a PR when the catalog is actually out of date. - Manuscript editorial review: "Start fresh" re-run mode — re-running the editorial pass in the manuscript editor previously always merged, leaving every prior open note in place even when a later pass no longer flagged it. A new "Start fresh" checkbox next to "Run editorial review" reconciles the open list against the latest pass: open notes it still finds stay open, open notes it no longer finds are auto-dismissed, and genuinely-new findings are added. Your accepted and dismissed decisions are left untouched. Clearing is done by moving notes to dismissed (never by deleting them), so the change syncs correctly across federated machines instead of being resurrected by a peer. Merge stays the default.
- Manuscript editor: editorial feedback is now shown in-context, not just in a sidebar — instead of scrolling a disconnected list of notes, each editorial comment is highlighted directly on the text it points to. A header toggle switches between two modes: Live (Grammarly-style — the manuscript stays fully editable and each anchored note shows as a severity-toned underline; click the underlined text or its tag to pop the note's card right there with Generate-fix / Accept / Dismiss) and Review (a read-through where the prose is annotated and clicking a highlight expands the note inline, with a per-section Edit toggle to drop into free editing). The right sidebar becomes a filterable index (by severity, with open / accepted / dismissed groups and a "located in text" count) that scrolls to and opens any note. The editor now focuses one issue at a time with a deep-linkable tab strip (
…/manuscript/<issueNumber>, each tab badged with its open-note count) instead of one page-length scroll of every issue. Suggested edits can be reviewed as a side-by-side before/after diff (default) or the prior stacked inline diff, and a new Impact preview shows, per affected issue, how accepting the selected fixes changes the whole manuscript before you commit to them (a single fix can span multiple issues). Notes whose anchor text no longer matches the draft degrade gracefully — they stay listed in the sidebar with no in-text highlight rather than disappearing. - Songs: hear the written melody (reference-tone playback + playhead) — the sheet-music view now has a Play melody control that synthesizes the notated tune so you can hear how a part goes before you sing it — the written-notation companion to the recorded-take round-stack playback. Each note is played as a soft triangle-wave reference tone on the same shared audio clock the recording mixer uses (no MIDI.js / Tone.js — Web Audio oscillators only), with pitch and rhythm read from the score (A4=440, durations honoring the time signature). The currently-sounding notehead lights up in the theme accent as a moving playhead so the audio and the staff stay in sync, and a Tempo field lets you slow it down (defaults to the song's marked tempo). Play / pause / stop, and audio tears down cleanly when you navigate away.
- Songs: a sheet-music view & editor — each song can now carry real sheet music, rendered as an engraved staff (treble or bass clef, key & time signature, notes with stems/flags/dots, accidentals, ledger lines, rests, chord symbols above and lyrics beneath). It's drawn entirely in-house — no third-party music-notation library — from a small, readable text format ("PortOS lead-sheet notation":
clef:/key:/time:/tempo:headers, then measures of[chord] pitch+duration (lyric)like[C] E4q(If) G4q(you)). The Edit tab gives you a textarea with a live-updating staff preview, a collapsible format guide, and per-measure beat-count feedback; the View tab shows the rendered score full-width above the lyrics. The built-in "500 Miles" now ships with its verse melody, chords, and lyrics as a worked example you can edit and learn from. - Songs: built-in singing rounds + a round-stack (quodlibet) view — four traditional rounds now ship as built-in songs — Hey Ho Nobody Home, Ah Poor Bird (with an alternate "Oh poor bird, why art thou…" lyric set), Rose Rose Rose Red, and Zum Gali Gali — each with its melody in sheet music, lyrics, and canon-entry voice layers. Songs can now declare the partners they're sung with: the first three are the classic quodlibet — they share one minor chord cycle and can be sung at the same time. In Edit, a "Sings with" picker links partner songs; in View, a Stack parts toggle (linkable as
?stack=1) renders every partner's melody and lyrics stacked as simultaneous parts and plays their recorded takes layered together on one audio clock. Existing installs receive the four rounds via a migration; the links round-trip and are restorable via "Refresh from template." - Songs: a read/perform view, built-in defaults, and reference videos — the song page now has a View / Edit toggle (mode lives in the URL, so each view is linkable). View is a clean, desktop-wide performance layout — lyrics rendered in full with no cramped sub-scrolling boxes, sections laid out side-by-side to use the screen and cut vertical scrolling, with the recorder kept front-and-centre for playing/recording; Edit is the existing workbench, now wider with a two-column lyric grid. Shipped example songs are tagged Built-in default (a badge in the Songs list and a banner in the editor) with a Refresh from template button that restores the latest bundled lyrics, arrangement, and references while preserving your own recordings and learned progress — so an install that already has an older copy of a default song can renew it on demand. Songs can also carry reference material: paste a link to a performance or tutorial, and TikTok video links play inline as embeds in the View tab (other links render as link cards). The built-in "500 Miles" ships with TikTok reference performances and its full set of lyrics.
Changed
- Songs: pick the AI provider & model for "Derive with AI" — the harmony-parts deriver in the Sheet music editor now has a compact provider + model picker next to the Derive with AI button, so you can run the derivation on a specific provider/model (e.g. a stronger local model for richer chord-tone voicing) instead of always using the active default. It defaults to Active provider (default) / Default model (no behaviour change unless you choose otherwise), is a per-run choice (not persisted on the song), and is built on the shared
useProviderModelshook +ProviderModelSelectorso it lists the same selectable models (embedding-only models filtered out) as the rest of the app. The server side already acceptedproviderId/modelon the derive endpoint — this surfaces it in the UI. - Songs: play any combination of sheet-music parts together — the read/perform view's Sheet music card now has a layered MIDI player. When a song carries harmony parts beyond the melody, a checkbox per part (Layers: Melody, Bass, Mid Harmony I/II, High Harmony I/II…) lets you pick any combination — melody + bass, the whole stack, two inner harmonies on their own — and a single Play parts transport synthesizes them all together, sample-aligned on one audio clock (Web Audio oscillators, no MIDI.js / Tone.js), with the master level backing off as voices stack so the blend doesn't clip. All parts are checked by default, so Play gives the full harmony stack out of the box. A Tempo field controls playback for the whole stack, and the pill row still picks which staff is shown independently of what plays — the moving playhead lights up on the shown staff whenever it's one of the sounding parts. A single-part song keeps the simple per-staff reference-tone player.
- Songs: recording "take types" now match the harmony stack you generate — the voice-layer vocabulary used for vocal takes (the "Next take is for layer" picker, the per-take layer dropdown, the "Add layer from ladder" presets, and the Learning Guide ladder) was the old folk set (Lead melody, Bass / root, Harmony third/fifth, Drone, Counter-melody, Vocal percussion) — out of step with the Melody, Bass, Mid Harmony I/II, High Harmony I/II stack the AI derive tool actually writes. The two vocabularies are now unified: a recorded take's layer lines up by id and label with the notated part of the same name, so you can record yourself singing each generated part and stack them. A test guards the two lists against drifting apart again. Existing songs keep their stored layers; "Refresh from template" pulls the new set onto built-in songs.
- Songs: the built-in "500 Miles" ships the full song, not just verse 1 — the bundled sheet-music melody now spans every verse and the closing coda (46 bars) instead of only the first verse, so the Sheet music view shows the whole song. Existing installs that still hold the earlier single-verse (or the original C-major placeholder) melody can pull it via the song's "Refresh from template" button; the per-section harmony parts can be regenerated to match with "Derive with AI" (it now reads the full melody).
- Storage backend policy is now formally documented (#1030) — the decision that PostgreSQL is mandatory and
MEMORY_BACKEND=fileis a development/test-only escape hatch (never a supported deployment mode) is now written down where contributors and AI agents will find it: a new "PostgreSQL is required —MEMORY_BACKEND=fileis test-only" section indocs/STORAGE.md(explaining why — the creative catalog/pgvector, federation, and backup have no file-backed equivalent — and documenting the exactnpm run setup:dbhappy path), plus a matching policy line inCLAUDE.mdso the no-silent-fallback behavior isn't mistakenly "fixed." This is documentation + setup-path hardening only — no runtime behavior change (the backend selector already enforced the policy). The DB setup script (scripts/setup-db.js) now reports the configured Docker port in its success log instead of a hardcoded5561(aPGPORT_DOCKERoverride no longer produces a misleading "ready on port 5561" message), and.env.examplereframes thePGMODEcomment to mark file storage as the unsupported escape hatch rather than merely "deprecated." - Songs: the practice tools now lead the View tab — the sheet music, metronome, and vocal recorder are grouped at the top of a song's performance view (just under the meta line and round-stack toggle), instead of the recorder sitting at the very bottom below the lyrics and references. So when you open a song to play it, you read the chart, set the tempo, and record against it without scrolling — the lyrics and reference videos follow underneath.
- Universe Builder now stores universes in PostgreSQL — your universes (canon bibles, categories, composite sheets, locks, influences, and the per-universe render-run history) moved out of the per-record
data/universes/{id}/index.jsonfiles into dedicateduniversesanduniverse_runstables, one row per universe. Existing installs are migrated automatically and losslessly on first boot — the legacydata/universes/directory is renamed aside (data/universes.imported) as a one-release recovery source. Nothing changes in how you create, edit, delete, render, or sync universes: the Universe Builder UI and the cross-machine federation wire format are unchanged (no schema-version bump — the sync payload is storage-independent, so a machine on this version syncs universes cleanly with a peer still on the old file storage). This is the first implementation slice (#1014) of the Create relational-schema migration designed in #999. Universes still persist to the per-record file store under theMEMORY_BACKEND=filedev/test escape hatch. - Pipeline series & issues now store in PostgreSQL — your comic/TV series and their issues (the 8-stage production pipeline state: idea, prose, comic script, teleplay, comic pages, storyboards, episode video, audio) moved out of the per-record
data/pipeline-series/{id}/index.jsonanddata/pipeline-issues/{id}/index.jsonfiles into dedicatedpipeline_seriesandpipeline_issuestables, one row per record. The hot relationships are promoted to indexed columns —pipeline_issues (series_id, number)directly serves the issue-renumber pass (the most common cross-record pipeline query), andpipeline_series (universe_id)serves the universe delete-guard and "series in this universe" lists. Existing installs are migrated automatically and losslessly on first boot. Each issue's full stage map (including itslastRunIdtranscript pointers) stays in the row'sdatapayload, and the "Finish the draft" manuscript-review sibling document stays a file alongside the series — only the series/issue records themselves moved. Nothing changes in how you create, edit, delete, renumber, run, or sync the pipeline: the UI and the cross-machine federation wire format are unchanged (no schema-version bump — the sync payload is storage-independent, so a machine on this version syncs the pipeline cleanly with a peer still on the old file storage). This is the second implementation slice (#1015) of the Create relational-schema migration designed in #999, building on the Universes slice (#1014). The pipeline still persists to the per-record file store under theMEMORY_BACKEND=filedev/test escape hatch. - Story Builder sessions now store in PostgreSQL — the guided Story Builder's session records (the per-step lock/integrity state, the cross-machine staleness baseline, your current step, and the saved provider/model picker choice) moved out of the per-record
data/story-builder/{id}/index.jsonfiles into a dedicatedstory_builder_sessionstable, one row per session. The two links every session carries — its universe and its series — are promoted to indexed columns, and the OPT-IN cross-machine resume flag (sync) is promoted too so the federation snapshot loop can find the sync-enabled sessions without deserializing every session's body. Existing installs are migrated automatically and losslessly on first boot — the legacydata/story-builder/directory is renamed aside (data/story-builder.imported) as a one-release recovery source. Nothing changes in how you create, run, lock, reconcile, or sync sessions: the Story Builder UI and the opt-in cross-machine resume wire format are unchanged (no schema-version bump — the sync payload is storage-independent, so a machine on this version syncs sessions cleanly with a peer still on the old file storage). This is the third implementation slice (#1016) of the Create relational-schema migration designed in #999, building on the Universes (#1014) and Pipeline (#1015) slices. Sessions still persist to the per-record file store under theMEMORY_BACKEND=filedev/test escape hatch. - Catalog references now resolve against their database targets, with a dangling-ref integrity report — a catalog ingredient records which universe / series / issue / work / Creative-Director project consumes it (the "Appears in" panel) by a string
(kind, id)reference. Now that all five of those target kinds live in PostgreSQL (#1014–#1017, #997), a new resolver can answer "does this reference still point at a live record?" and a new integrity surface (GET /api/catalog/refs/dangling) lists every live reference whose target no longer resolves — deleted, or a federated reference whose target hasn't synced in yet — mirroring the existing missing-media check. References remain a plain string match with no database foreign key (by design): a peer can legitimately sync a reference before its target arrives, and a hard constraint would make that sync fail — so a dangling reference is reported, never an error, and resolves itself once the target lands. Read-only and local; nothing touches the cross-machine wire and there's no schema change (the existing target index already makes the lookup cheap). This is the fifth and final implementation slice (#1018) of the Create relational-schema migration designed in #999. - Writers Room metadata now stores in PostgreSQL — the Writers Room library's metadata — folders, work manifests, draft-version history, and writing-sprint exercises — moved out of the bespoke
data/writers-room/file layout (folders.json,exercises.json, per-workmanifest.json) into dedicatedwriters_room_folders,writers_room_works,writers_room_draft_versions, andwriters_room_exercisestables. Each work's draft versions are decomposed into their own rows (one per version) so the library and future staleness analysis can query word counts, hashes, and lineage directly, while the draft prose bodies stay on disk as.mdfiles (data/writers-room/works/<id>/drafts/<draftId>.md) — only their metadata is indexed in the database. Existing installs are migrated automatically and losslessly on first boot: the JSON metadata files are renamed aside (*.imported.json) as a one-release recovery source, and the.mdbodies are left exactly where they are. Nothing changes in how you create, edit, version, delete, or run exercises on your works — the Writers Room UI is unchanged. (Writers Room is single-machine and not federated, so there's no wire-format or schema-version change.) This is the fourth implementation slice (#1017) of the Create relational-schema migration designed in #999, building on the Universes (#1014), Pipeline (#1015), and Story Builder (#1016) slices. The library still persists to the legacy file layout under theMEMORY_BACKEND=filedev/test escape hatch. - Create relational schema design (Postgres-first plan, #999) — a design doc (
docs/plans/2026-06-07-create-relational-schema-design.md) now specifies the PostgreSQL data model for the remaining file-backed Create domains: universes, pipeline series/issues, Story Builder sessions, and Writers Room metadata, plus howcatalog_ingredient_refswill resolve to DB-native targets. It's design-only (no behavior change): one row per record with the record body in adataJSONB column and only queryable fields promoted to columns (mirroring the Creative Director #997 and catalog-user-types #1001 swaps), zero hard FKs (so a federated ref can still arrive before its target), Writers Room draft.mdbodies staying file-backed with only their metadata indexed, and — crucially — no change to the existing snapshot/push federation model, so each store's file→DB move stays invisible to peers with no schema-version bump. Five implementation slices are tracked as #1014–#1018. - Catalog user-defined types now live in PostgreSQL — the user-defined ingredient types you create in Settings → Catalog (the registry that defines what fields a custom catalog type has) moved out of the
data/settings.jsonblob into a dedicatedcatalog_user_typestable, one row per type, so type definitions version and federate alongside the catalog data they govern instead of riding the unrelated settings file. Existing installs are migrated automatically and losslessly on first boot — the legacycatalogUserTypesslice is renamed aside (catalogUserTypes_imported) as a one-release recovery source. Nothing changes in how you create, edit, delete, or sync types: the/api/catalog/typesUI and the cross-machine federation wire format are unchanged (no schema-version bump — the sync payload is storage-independent), so a machine on this version syncs types cleanly with a peer still on the old one. This is the Phase 4 lead-in of the Postgres-first plan (#1001), unblocking typed catalog references. Types still persist to the settings slice under theMEMORY_BACKEND=filedev/test escape hatch. - Generated images & videos now have a PostgreSQL index — every generated image and video is mirrored into a new
media_assetstable (one row per asset), so media metadata — prompt, model, dimensions, lineage, timestamps — becomes queryable from the database instead of only by scanningdata/images/*sidecars anddata/video-history.json. The bytes and those files stay exactly where they are and remain authoritative; the table is a derived index, rebuilt from disk on boot (and pruned of any asset whose file has been removed) and kept current as new media finishes rendering. Nothing about the gallery, history, or generation flows changes for you — this is the foundation (Phase 3.2 of the Postgres-first plan, #1000) that later lets media collections and catalog attachments resolve through one queryable asset index. The index is simply not maintained under theMEMORY_BACKEND=filedev/test escape hatch (media still serves from disk). - Creative Director state now lives in PostgreSQL — Creative Director projects (treatment, scenes, and run history) moved out of the single monolithic
data/creative-director-projects.jsonfile into acreative_director_projectstable, one row per project. The orchestrator rewrote that whole file ≈10 times per scene render, so a long session turned every project list/read into an O(N²) reserialize; per-project rows remove that contention, and concurrent writes to the same project (render-progress + agent-run updates) are now serialized with a row lock so they can't lose each other's updates. Existing installs are migrated automatically and losslessly on first boot — the legacy file is kept (renamed…json.imported) as a recovery source. Behavior is unchanged; this is a storage move (Phase 3 of the Postgres-first plan, #997). The file backend remains reachable under theMEMORY_BACKEND=filedev/test escape hatch. - PostgreSQL is now a required dependency — file-based JSON storage is no longer offered as a normal setup choice.
npm run setup:dbpresents only Docker and Native PostgreSQL hosting modes (and auto-selects native when a healthy local PostgreSQL is already reachable). On boot, PortOS now verifies the database is reachable with the required schema and refuses to start with an actionable message if it isn't — instead of silently falling back to file-backed memory and serving a half-broken install (the creative catalog has no file-backed equivalent).MEMORY_BACKEND=filesurvives only as an explicit, unsupported development/test escape hatch. New docs:docs/STORAGE.md(the storage-classification contract —db-primary/file-primary/asset-file-db-indexed/ephemeral-file— plus a "new data store?" review checklist) anddocs/BACKUP.md(backup/restore now that the Postgres dump is required system state). - Federation change-token unified across DB-backed Create domains (#1031) — the three PostgreSQL Create migrations above (#1014 universes, #1015 pipeline series/issues, #1016 Story Builder sessions) each added their own near-identical module-level
mutationEpochcounter so the cross-machine snapshot loop knew when to re-send a snapshot for records that no longer touch theirdata/<domain>/directory. Those three counters are now consolidated into one shared, domain-keyed change-token registry (server/services/changeToken.js): each store bumpsbumpChangeToken('universe' | 'pipeline' | 'storyBuilder')on record write/delete, and the sync loop readsgetChangeToken(domain). The fingerprint string format (epoch:N) is unchanged, so this is entirely internal and federation-invisible — no schema-version bump, no wire change, and peers sync exactly as before. Eliminated the separate per-domain counters inuniverseBuilder/store.js,storyBuilderStore/store.js, andpipeline/syncEpoch.js(the latter kept as a thin re-export over the shared registry). An unknown-domain typo now fails fast at bump/get so it can't silently desync a peer. - Local model pickers now show what's actually installed — the Fallback Model dropdown in the AI Provider editor and the provider/model selector in the manuscript editorial review previously only listed the models stored on the provider record, so models you'd pulled in Ollama later (e.g. Command R+, Gemma) never appeared. Both pickers now fold in the live list of installed Ollama / LM Studio models. Embedding-only models (e.g.
nomic-embed-text) are filtered out of these generation pickers since they can't run a prompt. - Editorial model recommendation — the manuscript editorial review now suggests the best installed local model for editing/feedback (a one-tap "Recommended for editing" chip), ranking models that follow instructions tightly (Qwen/Llama/Gemma) ahead of chatty/RAG-tuned ones (Command R+) and skipping embedding/code/vision models. The pick is always among your installed models, so it auto-adapts as you pull newer versions.
- Model context windows are now visible — each model card on Settings → Local LLM shows its native context length (e.g. "32K ctx"), and the provider/model selector dropdowns (AI Provider editor, manuscript editorial review) annotate each local model with its window as a parenthetical.
- Tooling: bumped the bundled slashdo submodule (
lib/slashdo) to v3.6.0 — adds--issuesmode to/do:better(track the plan as GitHub/GitLab issues instead ofPLAN.md) and dedups--issuesfindings against existing open tracker issues. - Code quality: extracted the duplicated cron-expression validation in
cosJobRoutes.js(job create/update) into a singlevalidateCronExpression()helper, and unified the two slightly-divergent error messages. - Code quality: replaced inline
8000/8/4/20 * 1024 * 1024literals in the image-generation routes with named constants (MAX_PROMPT_LENGTH,MAX_LORAS,MAX_REFERENCE_IMAGES,MAX_IMAGE_UPLOAD_BYTES); thereferenceImageNupload field list now derives fromMAX_REFERENCE_IMAGESso it can't drift. - Code quality: replaced the local
safeReadJsonreimplementation inapps.jswith the sharedreadJSONFilehelper fromfileUtils.js, and named the repeated1500ms inter-action throttle inagentActionExecutor.jsasINTER_ACTION_DELAY_MS. - Legacy file→Postgres migration artifacts are now cleaned up automatically — the file→DB migrations (#997, #1014–#1017) each parked their source data aside as a "one-release recovery source" (
data/universes.imported,pipeline-issues.imported, per-recordindex.json.imported/manifest.imported.json, etc.) but nothing ever removed them, so they accumulated in./data(several MB on a long-lived install) even though the authoritative copy now lives in PostgreSQL and thepg_dump. A new boot-time prune (server/scripts/pruneImportedLegacyFiles.js, registered in the ledger as migration 077) removes those.importedcopies once the database is provably authoritative — it deletes a domain's parked files only after verifying, by record identity, that every migrated record those files hold is still present in the database (it reads the record ids off the artifacts themselves — directory names and JSON.ids, including universe run logs and Writers Room draft versions — and checks those exact ids exist). Identity rather than a row count, so a wipe-and-restore to a different record set can't satisfy the check with substitute rows. Anything that can't be verified withholds the prune for that domain (a missing id, an unparseable or id-less parked record, or a still-pending migration), so recovery data is never deleted on a doubt; a later boot retries. The deeper*.bak-NNNmonolith backups from the earlier file→file split migrations are intentionally left in place for manual cleanup — they can hold records the split skipped and soft-deleted records the live DB no longer has, so they're not safe to auto-verify. Nothing is excluded from rsync backups while it's on disk (during a blocked prune the parked files are the only recovery source and thepg_dumpis of the incomplete database), and the Writers Room.mddraft bodies (file-primary by design) are always preserved. The prune never runs under theMEMORY_BACKEND=filedev/test escape hatch.
Fixed
Backup: the snapshots list no longer chokes on
.DS_Store— when the backup target is an iCloud/Finder folder, macOS drops a.DS_Storefile into every directory. The snapshot lister treated each directory entry as a snapshot id, so it tried to read<.DS_Store>/manifest.jsonand logged a repeatingENOTDIR: not a directoryerror (and.DS_Storeshowed up as a bogus, dateless row in the snapshots list). It now skips non-directory and dotfile entries, and a snapshot that predates manifests no longer logs a scary "failed to read" warning on every list.Backup: the database dump now picks a
pg_dumpnew enough for your server — on machines with more than one PostgreSQL install (the common Homebrew case, where an olderpostgresql@NNkeg shadows the running server inPATH), the backup ran an out-of-datepg_dumpand failed with "server version mismatch" — leaving the backup degraded (files saved, database not). The backup now reads the live server's major version and selects apg_dumpat least that new from the installed Homebrew kegs / Postgres.app bundles (setPORTOS_PGDUMPto force a specific binary). When nothing new enough is installed, the failure is reported as a distinctversion_mismatchwith a Settings → Backup hint to install a newerpg_dump, instead of the generic "is pg_dump installed / is PG reachable" message; the exactpg_dumperror is also available on hover.Songs: "500 Miles" now ships the correct melody, in G major — the built-in "500 Miles" previously carried a placeholder verse melody in C major that didn't match the song. It's been re-transcribed in G major (the Hedy West lead sheet — G · Em · C · Am7 · D7 · G) with the correct verse tune, chords, and rhythm. Fresh installs get it directly; an existing install that still holds the old placeholder is upgraded automatically on boot (a migration that only touches the unedited shipped version — a score you've customized is left alone), and you can always pull the latest via the song's "Refresh from template" button.
Sheet music: low notes no longer overlap their lyrics — the lyric line was drawn at a fixed distance below the staff, so notes that dip below it (ledger-line pitches like A3) rendered their noteheads on top of the syllable. Lyrics now sit below the lowest note in each line.
[issue-980] PostgreSQL restores now verify the backup against its manifest before replaying — a snapshot's database dump is hashed into the snapshot's
manifest.jsonwhen the backup is taken, but the restore path never checked that hash, so a corrupted or tampered dump would be fed straight intopsql. Restores now recompute the dump's SHA-256 and compare it against the stored hash first; on a mismatch the restore refuses (nopsqlis run) rather than replaying a damaged dump over your live database. Older snapshots taken before manifests existed — or any manifest missing the dump's entry — still restore as before, since there's nothing recorded to verify against.MortalLoom iCloud writes no longer fail when the data file has been offloaded — under macOS "Optimize Mac Storage," iCloud can evict
MortalLoom.jsonto the cloud (a dataless placeholder) hours after PortOS booted. A write would then fail to read the evicted file within the brief retry window and refuse to overwrite it ("MortalLoom store is unreadable; refusing to overwrite") rather than risk truncating your data — but that also blocked the write entirely. PortOS now pre-warms the file on demand: before refusing, it runsbrctl downloadand waits for the file to materialize, then re-reads and proceeds. It also detects a legacy.icloudplaceholder shadowing the real path so it won't seed a fresh (empty) store on top of evicted data. If the file is genuinely corrupt, or the device is offline and can't download it, PortOS still safely refuses rather than clobbering the iCloud copy. The fire-and-forget boot/settings-change pinning remains as the first line of defense.[issue-978] Apps no longer get stuck reading "in review" after a no-op idle check — when the Chief of Staff's idle review picked an app but had nothing to actually do (no claimable plan item, no new commits or PRs to watch), the app could stay marked as under review until a restart or cleanup pass cleared it. Idle checks that find no work now release the app right away while still spacing out how often it's rechecked.
[issue-984] Chief of Staff daily action cap holds firm when several jobs come due at once — scheduled jobs that fired in the same instant could each slip past a small daily action cap before the others were counted, letting the cap be exceeded by one. The cap is now enforced the moment each job is admitted, so simultaneously-due jobs can no longer overshoot it.
[issue-968] A PM2 hiccup no longer makes running apps look offline — when PortOS briefly can't read process state, affected apps now show "status unavailable" instead of being silently reported as stopped. The Apps list and detail pages replace the (misleading) Start button with a refresh-to-retry control, the dashboard counts these separately, the system health page flags the degraded read, and CyberCity no longer rains on apps whose status simply couldn't be read.
Ollama fallback no longer picks an embedding model — when a primary provider failed and PortOS fell back to Ollama, it could resolve
nomic-embed-text(an embedding model that can't run a prompt) because that model was listed first and the provider had no default. The fallback now skips embedding-only models when resolving which model to run, so it lands on a real chat model (e.g. Qwen) instead of failing twice.A model declining a prompt on safety grounds is no longer treated as a provider outage — when Codex/Claude refuses a prompt for content/safety reasons, PortOS used to spin up a Chief-of-Staff "investigate AI provider failure" task even though the cause is known. Refusals are now recognized: no investigation task is created, the provider isn't benched (it's healthy — it just declined that one prompt), PortOS still retries with a fallback model, and the UI shows a calm "model declined — attempting a fallback" notice instead of a red error.
Manuscript editor honors the selected model instead of silently defaulting — when you picked a provider (e.g. Ollama) with no configured default model, the model dropdown showed a model but actually held an empty selection, so the server fell through to the provider's first model — the embedding model
nomic-embed-text, which then failed. The picker now pins a real, in-list model (the editorial recommendation, else the first generation model) the moment a provider is chosen, so what you see is what runs.A slow fallback that recovers no longer leaves a stray "investigate" task — the auto-fixer deferred its investigation task for a few seconds to give a fallback time to recover, but a slow CLI fallback (Claude Code can take 20–30s) outran that window, so a failure that was successfully recovered still left a task in the plan. The suppression now follows the fallback's actual lifecycle instead of a fixed timer: the task is cancelled the moment a fallback starts and only fires if no fallback is attempted or the fallback itself fails.
Full Changelog
Full Diff: https://github.com/atomantic/PortOS/compare/v2.16.0...v2.17.0