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

refactor: retire overlap acceptsLyrics wire shim (#4850)

[._.]/ Adam Eivy2de143136c08
diff --git a/client/src/components/music/MusicGenPanel.test.jsx b/client/src/components/music/MusicGenPanel.test.jsx
index 48b8489280..1196fd70b3 100644
--- a/client/src/components/music/MusicGenPanel.test.jsx
+++ b/client/src/components/music/MusicGenPanel.test.jsx
@@ -293,8 +293,8 @@ describe('MusicGenPanel', () => {
// One end of the mixed-version window: this peer's MODEL sings
// (`lyrics: true`) but its build predates lyrical federation, so it publishes
- // neither the `lyrics` feature nor the legacy `acceptsLyrics`. Absent must
- // read as false, or the panel offers a render the peer answers with a 400.
+ // The peer does not advertise the `lyrics` feature. Absent must read as
+ // false, or the panel offers a render the peer answers with a 400.
it('falls back to an instrumental remote render when the peer build cannot carry lyrics', async () => {
api.listMusicEngines.mockResolvedValue({ defaultEngine: 'musicgen', engines: [engine({ ready: true })] });
api.getInstances.mockResolvedValue({ peers: [lyricCapablePeer()] });
@@ -319,34 +319,9 @@ describe('MusicGenPanel', () => {
expect(requestBody).not.toHaveProperty('lyrics');
});
- // ADR docs/decisions/2026-08-22-federated-media-input-assets.md rule 2: the
- // words the model sings cross. The free-form style prompt still does not, but
- // that is the SERVER's doing — it blanks params.prompt and renders the wire
- // prompt from the profile — so this body legitimately carries it for the
- // track record. federatedMediaProvider.test.js guards the wire side.
- it('sends lyrics to a peer that advertises it accepts them', async () => {
- api.listMusicEngines.mockResolvedValue({ defaultEngine: 'musicgen', engines: [engine({ ready: true })] });
- api.getInstances.mockResolvedValue({ peers: [lyricCapablePeer({ acceptsLyrics: true })] });
- api.generateMusic.mockResolvedValue({ track: { id: 'track-1' } });
-
- render(<MusicGenPanel track={{ id: 'track-1' }} prompt="private prompt" lyrics="private lyrics" />);
-
- fireEvent.change(await screen.findByRole('combobox', { name: /generation target/i }), { target: { value: 'peer-example' } });
- // Instrumental is an ordinary choice again once the peer can sing.
- expect(screen.getByLabelText(/instrumental only/i)).not.toBeDisabled();
- fireEvent.click(screen.getByRole('button', { name: /^generate$/i }));
-
- await waitFor(() => expect(api.generateMusic).toHaveBeenCalledWith(expect.objectContaining({
- mediaProviderPeerId: 'peer-example',
- instrumentalOnly: false,
- lyrics: 'private lyrics',
- }), { silent: true }));
- });
-
// The other end of the same mixed-version window (#4826): a peer on the NEW
- // build advertises the `lyrics` feature at the status root and stops stamping
- // `acceptsLyrics` on every capability. A panel still reading the per-capability
- // field would pin this peer to Instrumental only for no reason.
+ // build advertises the `lyrics` feature at the status root. A panel that did
+ // not read the status-root feature would pin this peer to Instrumental only.
it('sends lyrics to a peer that advertises the lyrics feature and no per-capability flag', async () => {
api.listMusicEngines.mockResolvedValue({ defaultEngine: 'musicgen', engines: [engine({ ready: true })] });
api.getInstances.mockResolvedValue({ peers: [lyricCapablePeer({}, ['lyrics', 'inputAssets'])] });
@@ -380,7 +355,7 @@ describe('MusicGenPanel', () => {
it('drops lyrics from a lyric-capable remote render when instrumental-only is chosen', async () => {
api.listMusicEngines.mockResolvedValue({ defaultEngine: 'musicgen', engines: [engine({ ready: true })] });
- api.getInstances.mockResolvedValue({ peers: [lyricCapablePeer({ acceptsLyrics: true })] });
+ api.getInstances.mockResolvedValue({ peers: [lyricCapablePeer({}, ['lyrics', 'inputAssets'])] });
api.generateMusic.mockResolvedValue({ track: { id: 'track-1' } });
render(<MusicGenPanel track={{ id: 'track-1' }} prompt="private prompt" lyrics="private lyrics" />);
diff --git a/client/src/lib/README.md b/client/src/lib/README.md
index f592ad8c59..65e33d3daf 100644
--- a/client/src/lib/README.md
+++ b/client/src/lib/README.md
@@ -46,7 +46,7 @@ grep -i "what you want to do" client/src/lib/README.md
| `creativeDirectorPlan.js` | Pure presentation helpers for the CD studio Plan board (CDO Phase 4) — annotate `plan.steps[]` with tool cost-class/timing/approval flags, cost/status summaries, owning-surface deep links, status/cost badge tone maps. |
| `creativeDirectorPreview.js` | `selectProjectPreview(project)` → `{ kind: 'video'\|'image'\|'audio'\|'none', jobId?, src?, poster?, label, durationSec? }` — picks a CD project's representative produced asset (finalVideoId → last rendered scene → last done plan video/image step → `musicBed` audio → startingImageFile) for the list cards + Overview tab (#2702, audio #2772). Pure, computed off the already-returned project payload (no fetch). Plus `previewAspectClass(aspectRatio)` (literal Tailwind classes — a computed `aspect-[w/h]` never lands in the build), `startingImageSrc()` (client mirror of `localImageFilename`), and the `videoSrcForJob`/`videoPosterForJob`/`imageSrcForJob`/`musicBedSrc` path builders — the one client-side definition of the `<jobId>`-named asset convention, shared with `ScenePreview.jsx`. |
| `editorialRoadmap.js` | `projectAnalyzedPoints` (aggregate roadmap → analyzed chart points with arc-position `frac`) + `dominant` (most-frequent string). Shared by EditorialRoadmapPanel and the Reader Map page. |
-| `federatedMediaReadiness.js` | One reading of a peer’s federated media-provider readiness (#4348), shared by the Instances peer card and the System Health capacity panel so the two cannot disagree. `resolvePeerMediaReadiness(peer, { now })` maps the stored probe onto a display state/label/tone plus its remedy text, queue snapshot, capabilities, and per-kind allowlists; it re-derives `stale` when the snapshot’s `freshUntil` has passed, so a snapshot probed as `ready` cannot keep reading `ready` after the server would refuse to submit against it. Also exports `FEDERATED_MEDIA_KINDS` (audio/image/video + their config fields and icons), the state/help tables, and `peerMediaProviderConfig`. `summarizePeerMediaQueue(queue)` renders the peer’s queue block into finished display segments — slot occupancy, how many jobs drain in parallel, and which kinds are busy — so every surface shows the same words, dropping any segment an older provider did not send rather than showing it as a zero. `federatedMediaModelsForPeer(peer, kind)` intersects the local per-kind allowlist with the peer’s advertised capabilities and returns the capability entries (with their `ready` / `unavailableReason`), so no surface can offer a model the server would refuse or hide why a listed one cannot run. `federatedMediaSupports(status, feature, capability)` mirrors the server helper of the same name and is the ONE place the "absent reads as false" rule lives on this side (#4826): it answers whether the peer’s BUILD speaks a wire feature (`lyrics`, `inputAssets`) from the status-root `features` list, falling back to the legacy per-capability field for a peer still on the previous build, and `peerMediaProviderSnapshot(peer)` returns the status payload to ask it against. `peerModelAcceptsInput(capability, role, status)` / `peerModelRequiresInput(capability)` read the capability’s `inputAssets` block — which conditioning slots (`initImage` / `referenceImages` / `sourceImage` / `lastImage`) a peer model takes, and whether it can render without one — gated first on the build speaking conditioning at all, with **absent reading as NO**, so a provider predating that field is never offered a render it would reject. Display only — the server re-probes and fail-closes before any job leaves. |
+| `federatedMediaReadiness.js` | One reading of a peer’s federated media-provider readiness (#4348), shared by the Instances peer card and the System Health capacity panel so the two cannot disagree. `resolvePeerMediaReadiness(peer, { now })` maps the stored probe onto a display state/label/tone plus its remedy text, queue snapshot, capabilities, and per-kind allowlists; it re-derives `stale` when the snapshot’s `freshUntil` has passed, so a snapshot probed as `ready` cannot keep reading `ready` after the server would refuse to submit against it. Also exports `FEDERATED_MEDIA_KINDS` (audio/image/video + their config fields and icons), the state/help tables, and `peerMediaProviderConfig`. `summarizePeerMediaQueue(queue)` renders the peer’s queue block into finished display segments — slot occupancy, how many jobs drain in parallel, and which kinds are busy — so every surface shows the same words, dropping any segment an older provider did not send rather than showing it as a zero. `federatedMediaModelsForPeer(peer, kind)` intersects the local per-kind allowlist with the peer’s advertised capabilities and returns the capability entries (with their `ready` / `unavailableReason`), so no surface can offer a model the server would refuse or hide why a listed one cannot run. `federatedMediaSupports(status, feature, capability)` mirrors the server helper of the same name and is the ONE place the "absent reads as false" rule lives on this side (#4826): it answers whether the peer’s BUILD speaks a wire feature (`lyrics`, `inputAssets`) from the status-root `features` list, retaining only the legacy `inputAssets` capability block for peers on the previous build because that signal is genuinely per-model, and `peerMediaProviderSnapshot(peer)` returns the status payload to ask it against. `peerModelAcceptsInput(capability, role, status)` / `peerModelRequiresInput(capability)` read the capability’s `inputAssets` block — which conditioning slots (`initImage` / `referenceImages` / `sourceImage` / `lastImage`) a peer model takes, and whether it can render without one — gated first on the build speaking conditioning at all, with **absent reading as NO**, so a provider predating that field is never offered a render it would reject. Display only — the server re-probes and fail-closes before any job leaves. |
| `glbFailure.js` | Turns a 3D asset failure into an actionable sentence. `glbFailureHint(error)` matches the message against a shared table (an HTML body reaching the glTF parser, a WebGL context failure, a 404) and returns `null` when nothing recognizes it — so a caller can tell "we know the cause" from "we don't" and fall back to the raw text. `glbErrorText(error)` reads a message off whatever shape was thrown. Shared because the CoS avatars load remote GLBs too: every caught error there used to be reported as "this display has no WebGL", sending the user to change an unrelated setting (#4688). Consumed by `media/GlbViewer.jsx` and `cos/CoSCanvasGuard.jsx`. |
| `grokVideoClip.js` | Mirror of `server/lib/grokVideoClip.js` — `GROK_VIDEO_DURATIONS` (`[6, 10]`) + `GROK_VIDEO_DEFAULT_DURATION`, the clip lengths grok's `image_to_video` actually delivers. |
| `imageCleaners.js` | Mirror of `resolveCleanersFromConfig` from `server/lib/imageClean.js`. Reads `{cleanC2PA, denoise}` off a per-mode settings record. `cleanC2PA` defaults are mode-aware (on for `codex` + `external` — the backends that emit C2PA chunks today — off otherwise, as an allow-list rather than a deny-list); `denoise` defaults off everywhere (lossy, opt-in only). |
diff --git a/client/src/lib/federatedMediaReadiness.js b/client/src/lib/federatedMediaReadiness.js
index c873851999..2f00df8c35 100644
--- a/client/src/lib/federatedMediaReadiness.js
+++ b/client/src/lib/federatedMediaReadiness.js
@@ -134,14 +134,14 @@ function verifiedState(status, now) {
return state;
}
-// Overlap-release fallbacks, mirroring FEDERATED_MEDIA_LEGACY_FEATURE_TELL in
-// server/lib/federatedMediaWire.js. A provider on the previous build advertises
-// the same build-level fact per-capability instead of at the status root.
+// The input-assets overlap fallback mirrors FEDERATED_MEDIA_LEGACY_FEATURE_TELL
+// in server/lib/federatedMediaWire.js. A provider on the previous build
+// advertises this genuinely per-model fact in the capability block instead of
+// at the status root.
// `Object.create(null)` for the same reason the server table uses it: the key
// is a feature name off the wire, and on a normal object `'constructor'` and
// friends resolve to inherited values rather than being absent.
const LEGACY_FEATURE_TELL = Object.freeze(Object.assign(Object.create(null), {
- lyrics: (capability) => capability?.acceptsLyrics === true,
inputAssets: (capability) => isRecord(capability?.inputAssets),
}));
@@ -155,15 +155,15 @@ const LEGACY_FEATURE_TELL = Object.freeze(Object.assign(Object.create(null), {
* would offer a render the peer answers with a 400. Display only — the route
* re-checks and the provider re-checks again at admission.
*
- * A published list WINS over the legacy per-capability field rather than being
+ * A published list WINS over the input-assets legacy tell rather than being
* OR'd with it: a peer that told us its whole vocabulary and left this feature
* out has positively denied it, so the legacy tell is consulted only when there
* is no list to read. Mirrors the server rule exactly.
*
* @param {object|null} status - a peer's `mediaProviderStatus.snapshot`
* @param {string} feature - 'lyrics' | 'inputAssets'
- * @param {object|null} [capability] - for the overlap fallback against a peer
- * that has not migrated yet
+ * @param {object|null} [capability] - for the input-assets overlap fallback
+ * against a peer that has not migrated yet
* @returns {boolean} false whenever the answer cannot be established
*/
export function federatedMediaSupports(status, feature, capability = null) {
diff --git a/client/src/lib/federatedMediaReadiness.test.js b/client/src/lib/federatedMediaReadiness.test.js
index 8c041d3faf..e08ccf4ab9 100644
--- a/client/src/lib/federatedMediaReadiness.test.js
+++ b/client/src/lib/federatedMediaReadiness.test.js
@@ -406,12 +406,8 @@ describe('federatedMediaSupports / peerMediaProviderSnapshot', () => {
expect(federatedMediaSupports({ features: 'lyrics' }, 'lyrics')).toBe(false);
});
- it('reads the status-root list, and falls back to the legacy per-capability field', () => {
+ it('reads the status-root list and keeps the input-assets capability fallback', () => {
expect(federatedMediaSupports({ features: ['lyrics'] }, 'lyrics')).toBe(true);
- expect(federatedMediaSupports({}, 'lyrics', { ...capability, acceptsLyrics: true })).toBe(true);
- // List wins: a published vocabulary that omits the feature overrules the
- // legacy field rather than being OR'd with it.
- expect(federatedMediaSupports({ features: [] }, 'lyrics', { ...capability, acceptsLyrics: true })).toBe(false);
expect(federatedMediaSupports({}, 'inputAssets', { inputAssets: { roles: [] } })).toBe(true);
expect(federatedMediaSupports({}, 'inputAssets', { inputAssets: null })).toBe(false);
// Pinned identically in server/lib/federatedMediaWire.test.js: an array is
diff --git a/docs/FEDERATED_MEDIA_PROVIDERS.md b/docs/FEDERATED_MEDIA_PROVIDERS.md
index 764d92b044..e896d7c540 100644
--- a/docs/FEDERATED_MEDIA_PROVIDERS.md
+++ b/docs/FEDERATED_MEDIA_PROVIDERS.md
@@ -99,11 +99,10 @@ Sending them needs **two** signals to agree, and they live at different levels o
|---|---|---|---|
| `lyrics` | on the capability | the **model** sings | — (always present) |
| the `lyrics` feature | `features` at the status root | **this provider's build** carries lyrics on the wire | reads as `false` |
-| `acceptsLyrics` | on the capability | superseded duplicate of the feature, kept for one overlap release | reads as `false` |
A provider predating lyrical federation advertises `lyrics: true` for MiniMax Music 3 and then rejects the field at submission, so absence must fail closed or every remote lyrical render becomes a 400 the user cannot act on. When either half is missing, `POST /api/music/generate` refuses with `400 MEDIA_PROVIDER_LYRICS_UNSUPPORTED` naming which one, and Music Studio pins Instrumental only with the reason — it never silently renders a wordless take of a song the user wrote words for.
-Consumers ask through `federatedMediaSupports(status, feature, capability)` (`server/lib/federatedMediaWire.js`, mirrored in `client/src/lib/federatedMediaReadiness.js`) rather than reading either field directly, so the fail-closed reasoning lives in one place and the overlap fallback retires from one place.
+Consumers ask through `federatedMediaSupports(status, feature, capability)` (`server/lib/federatedMediaWire.js`, mirrored in `client/src/lib/federatedMediaReadiness.js`) rather than reading either field directly, so the fail-closed reasoning lives in one place. The `inputAssets` capability block remains the only legacy overlap tell because it is genuinely per-model.
### Remote image and video renders
@@ -442,9 +441,9 @@ empty list is a peer positively denying every feature, which is a stronger claim
than a malformed field has earned.
Consumers ask `federatedMediaSupports(status, feature, capability)` rather than
-testing the list inline, which is also where the overlap fallback to the legacy
-per-capability `acceptsLyrics` lives — one place to retire it from once no
-supported peer sends it (#4850).
+testing the list inline, which keeps the fail-closed feature check in one place.
+The `inputAssets` capability block remains the only legacy overlap tell because
+it is genuinely per-model.
CUDA has three states: `available`, `absent`, and `unknown`. A CUDA model is ready only when the state is positively `available`; a failed or ambiguous probe blocks admission. Runtime, host-platform, exact fixed-checkpoint readiness, and queue capacity are similarly fail-closed.
diff --git a/server/lib/README.md b/server/lib/README.md
index 552d3c1930..7936114d2e 100644
--- a/server/lib/README.md
+++ b/server/lib/README.md
@@ -284,7 +284,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub
| `fetchWithTimeout.js` | `fetch` wrapper with AbortController timeout. |
| `tailnetPeer.js` | `isTailnetPeer(peer)` — fail-closed security predicate for "is this peer reachable only over the tailnet". Deliberately separate from `instances.js`'s `peerRequiresTailscale()` probe-deferral heuristic so a polling-noise tweak can't widen a privacy boundary; required by the unattended-routing gate in ADR 2026-08-20-federated-visual-prompts. |
| `federatedMediaRequest.js` | Builds and validates the versioned federated-media submission body for a visual kind, so every call site that persists a remote-job marker projects local params onto the wire identically. |
-| `federatedMediaWire.js` | Versioned federated-media status schema/constants plus fail-closed consumer freshness checks (stale and clock-skewed snapshots are never assignable). `FEDERATED_MEDIA_FEATURES` + `federatedMediaSupports(status, feature, capability)` answer "does the peer BUILD speak this wire feature" from the status-root `features` list — the one place the "absent reads as the wire-v1 baseline" rule lives; a published list wins outright, with the legacy per-capability field consulted only when a peer published none. `federatedMediaDeclaresFeatures(status)` and `federatedMediaDeniesFeature(status, feature, capability)` separate "positively denied" from "could not establish" for MESSAGE selection only — both gate identically, and which missing signal indicts the peer’s build is recorded per feature rather than at each call site. |
+| `federatedMediaWire.js` | Versioned federated-media status schema/constants plus fail-closed consumer freshness checks (stale and clock-skewed snapshots are never assignable). `FEDERATED_MEDIA_FEATURES` + `federatedMediaSupports(status, feature, capability)` answer "does the peer BUILD speak this wire feature" from the status-root `features` list — the one place the "absent reads as the wire-v1 baseline" rule lives; a published list wins outright, with the `inputAssets` capability block retained as its only legacy overlap tell because it is genuinely per-model. `federatedMediaDeclaresFeatures(status)` and `federatedMediaDeniesFeature(status, feature, capability)` separate "positively denied" from "could not establish" for MESSAGE selection only — both gate identically, and which missing signal indicts the peer’s build is recorded per feature rather than at each call site. |
| `connectivity.js` | `isMachineOnline({timeoutMs?, hosts?})` — internet-reachability probe: bare TCP `connect` to public anycast resolvers on :443 (no DNS, no HTTP), resolves `true` on the first connect and `false` only after all fail; never rejects. Reuse when a caller needs a best-effort local reachability signal. |
| `safeUrlFetch.js` | SSRF-guarded public-URL fetch: `isPublicHttpUrlSafe`/`assertPublicHttpUrl` (scheme + blocked-host-literal via `catalogValidation.isBlockedIngestHost` + DNS-resolve), exported strict `isPrivateAddress`, plus `fetchPublicText`/`fetchPublicBinary` (timeout, redirect revalidation, size cap) and `buildPinnedLookup`/`buildPinnedDispatcher` (the connect-time IP pin that closes the DNS-rebinding TOCTOU). Reuse instead of copying the SSRF guard for any "fetch this remote thing the user pointed us at" flow. |
| `pinterestFeed.js` | Pure Pinterest board RSS helpers: `normalizePinterestFeedUrl(input)` (board URL or `.rss` → `{ feedUrl, boardUrl }`, host-gated) + `parsePinterestRss(xml)` (per-pin `pinUrl`/`imageUrl`/title/description, 736x size upgrade). Feeds the mood-board Pinterest importer. |
diff --git a/server/lib/federatedMediaWire.js b/server/lib/federatedMediaWire.js
index 5e613b07fe..146a2c4ab5 100644
--- a/server/lib/federatedMediaWire.js
+++ b/server/lib/federatedMediaWire.js
@@ -288,16 +288,6 @@ export const federatedMediaCapabilitySchema = z.object({
// predate lyrical federation entirely — which is why it cannot double as the
// consumer's permission to send words.
lyrics: z.boolean(),
- // SUPERSEDED by the status-root `features` list (#4826), and kept on the
- // wire for one overlap release so a consumer on the previous build still
- // reads this provider correctly. Emitted per-capability but never per-model:
- // it always equalled `lyrics`, because the fact it carried was "does this
- // BUILD carry lyrics on the wire", which is a property of the payload's
- // sender rather than of any one engine. Read it only through
- // `federatedMediaSupports`, never directly. Do not add a second field in
- // this shape — a new per-field wire capability belongs in `features`.
- // Retirement tracked in #4850.
- acceptsLyrics: z.boolean().optional(),
autoDuration: z.boolean(),
frameStride: z.number().int().min(1).max(64).nullable().optional(),
maxNumFrames: z.number().int().min(1).max(600).nullable().optional(),
@@ -399,23 +389,13 @@ const federatedMediaFeaturesSchema = z.array(z.unknown()).max(256)
// every such render into a hard 400 the user cannot act on. Fail closed and the
// consumer degrades to something it can explain instead.
//
-// `capability` is the OVERLAP path only: for one release a provider on the
-// previous build advertises the same build-level fact per-capability. A
-// published list WINS over it outright rather than being OR'd with it — a peer
-// that told us its whole vocabulary and left this feature out has positively
-// denied it, and honoring a stale or contradictory per-capability field against
-// that would resurrect the very ambiguity the list replaced. The legacy tell is
-// consulted only when there is no list to read.
-// `decisive` records whether a FAILING legacy tell proves the peer's build is
-// old, and it differs per feature — which is why it belongs in the table rather
-// than in a comment at each call site (whoever adds the third feature would
-// otherwise inherit whichever policy they happened to read first):
-//
-// lyrics — the previous build stamped `acceptsLyrics` on EVERY audio
-// capability, so its absence can only mean an older build.
-// inputAssets — the block is genuinely per-model, so its absence is ambiguous:
-// mid-overlap the peer may speak conditioning and simply have a
-// text-only model configured.
+// `capability` is the overlap path for `inputAssets`: a provider on the
+// previous build advertises that genuinely per-model fact in the capability
+// block. A published list WINS over it outright rather than being OR'd with it
+// — a peer that told us its whole vocabulary and left this feature out has
+// positively denied it. `decisive` records whether a FAILING legacy tell proves
+// the peer's build is old; the input-assets block is not decisive because a
+// healthy peer may simply have a text-only model configured.
//
// Both gate identically; only a message that blames the BUILD may distinguish
// them. See federatedMediaDeniesFeature.
@@ -425,7 +405,6 @@ const federatedMediaFeaturesSchema = z.array(z.unknown()).max(256)
// on `.tell`. A null prototype makes an unknown name simply absent, which is
// also what keeps this end and the client mirror answering alike.
const FEDERATED_MEDIA_LEGACY_FEATURE_TELL = Object.freeze(Object.assign(Object.create(null), {
- lyrics: { tell: (capability) => capability?.acceptsLyrics === true, decisive: true },
// A build that predates conditioning omits the block entirely; one that
// speaks it advertises the block (possibly with no roles for this model).
// `isPlainObject`, not a bare `typeof === 'object'`: the client mirror uses
@@ -441,7 +420,7 @@ const FEDERATED_MEDIA_LEGACY_FEATURE_TELL = Object.freeze(Object.assign(Object.c
* @param {object|null} status - a validated provider status payload
* @param {string} feature - a FEDERATED_MEDIA_FEATURES member
* @param {object|null} [capability] - the capability being acted on, for the
- * overlap fallback against a provider that has not migrated yet
+ * input-assets overlap fallback against a provider that has not migrated yet
* @returns {boolean} false whenever the answer cannot be established
*/
export function federatedMediaSupports(status, feature, capability = null) {
@@ -472,7 +451,8 @@ export function federatedMediaDeclaresFeatures(status) {
*
* @param {object|null} status - a validated provider status payload
* @param {string} feature - a FEDERATED_MEDIA_FEATURES member
- * @param {object|null} [capability] - the capability being acted on
+ * @param {object|null} [capability] - the capability being acted on, for the
+ * input-assets overlap fallback
* @returns {boolean} true only when the peer's build is provably the reason
*/
export function federatedMediaDeniesFeature(status, feature, capability = null) {
diff --git a/server/lib/federatedMediaWire.test.js b/server/lib/federatedMediaWire.test.js
index 604827dd58..da83f113c0 100644
--- a/server/lib/federatedMediaWire.test.js
+++ b/server/lib/federatedMediaWire.test.js
@@ -374,16 +374,7 @@ describe('federatedMediaSupports', () => {
expect(federatedMediaSupports({ features: ['lyrics'] }, 'inputAssets')).toBe(false);
});
- // The overlap release: a peer on the previous build sends the per-capability
- // field and no root list, and must keep working unchanged.
- it('falls back to the legacy per-capability field only when no list was published', () => {
- expect(federatedMediaSupports({}, 'lyrics', capability({ acceptsLyrics: true }))).toBe(true);
- // A peer that published its vocabulary and left the feature out has
- // positively denied it; a stale or contradictory legacy field on the
- // capability does not get to overrule that.
- expect(federatedMediaSupports({ features: [] }, 'lyrics', capability({ acceptsLyrics: true }))).toBe(false);
- expect(federatedMediaSupports({ features: ['inputAssets'] }, 'lyrics', capability({ acceptsLyrics: true }))).toBe(false);
- expect(federatedMediaSupports({}, 'lyrics', capability({ acceptsLyrics: false }))).toBe(false);
+ it('keeps the input-assets capability fallback when no list was published', () => {
expect(federatedMediaSupports({}, 'inputAssets', capability({ inputAssets: { roles: ['initImage'] } }))).toBe(true);
expect(federatedMediaSupports({}, 'inputAssets', capability({ inputAssets: null }))).toBe(false);
// An array is not a block. The client mirror's record guard excludes
@@ -409,9 +400,8 @@ describe('federatedMediaSupports', () => {
// A published list that omits the feature is a positive denial either way.
expect(federatedMediaDeniesFeature({ features: [] }, 'lyrics', capability())).toBe(true);
expect(federatedMediaDeniesFeature({ features: ['lyrics'] }, 'inputAssets', withBlock)).toBe(true);
- // No list: the previous build stamped acceptsLyrics on EVERY audio
- // capability, so its absence can only mean an older build...
- expect(federatedMediaDeniesFeature({}, 'lyrics', capability())).toBe(true);
+ // No list and no capability-level tell leaves the build version unknown.
+ expect(federatedMediaDeniesFeature({}, 'lyrics', capability())).toBe(false);
// ...while an absent inputAssets block is ambiguous — a healthy peer may
// speak conditioning and simply have a text-only model configured, so it
// must not be told to update itself.
@@ -429,11 +419,11 @@ describe('federatedMediaSupports', () => {
});
// The feature name is a string off the wire, so it can collide with an
- // Object.prototype key. These MUST take the legacy-tell path (no `features`
- // list) — with a list present every case short-circuits before the lookup and
- // the guard would be vacuous. On a normal object literal `'constructor'`
- // resolves to an inherited value, truthy enough to defeat `?.` and then throw
- // on the property access after it.
+ // Object.prototype key. These MUST take the input-assets legacy-tell path
+ // (no `features` list) — with a list present every case short-circuits before
+ // the lookup and the guard would be vacuous. On a normal object literal
+ // `'constructor'` resolves to an inherited value, truthy enough to defeat
+ // `?.` and then throw on the property access after it.
it.each(['constructor', 'toString', 'hasOwnProperty', 'valueOf', '__proto__'])(
'answers false for the inherited key %s instead of throwing',
(feature) => {
diff --git a/server/routes/music.js b/server/routes/music.js
index cf07c638c3..f36fc27683 100644
--- a/server/routes/music.js
+++ b/server/routes/music.js
@@ -470,10 +470,9 @@ router.post('/generate', asyncHandler(async (req, res) => {
);
}
if (!federatedMediaSupports(resolved.status, 'lyrics', capability)) {
- // Blaming the peer's build is safe for THIS feature — the previous
- // build stamped the legacy tell on every audio capability, so its
- // absence can only mean an older one. `federatedMediaDeniesFeature`
- // is what records that, per feature, rather than this call site.
+ // `federatedMediaDeniesFeature` keeps message selection separate from
+ // the shared fail-closed gate, so only a positively published feature
+ // vocabulary is described as a build-level denial here.
throw new ServerError(
federatedMediaDeniesFeature(resolved.status, 'lyrics', capability)
? 'The selected peer runs a PortOS build that cannot carry lyrics to its provider. Update the peer, or render this track locally.'
diff --git a/server/routes/music.test.js b/server/routes/music.test.js
index 1d827856cb..70ae4f90b8 100644
--- a/server/routes/music.test.js
+++ b/server/routes/music.test.js
@@ -656,9 +656,7 @@ describe('music routes', () => {
// Lyrics reach an allowlisted peer since ADR
// docs/decisions/2026-08-22-federated-media-input-assets.md rule 2 — but only
// when the resolved capability advertises BOTH that the model sings and that
- // the peer's build carries the words. The three cases below are the whole
- // contract: a peer too old to say so, a model that cannot sing, and the one
- // combination that ships.
+ // the peer's build carries the words.
const remoteLyricRequest = (peer, overrides = {}) => ({
prompt: 'private concept',
lyrics: '[verse]\nCall [email protected]',
@@ -679,13 +677,12 @@ describe('music routes', () => {
...overrides,
});
- it('POST /generate refuses lyrics when the peer build cannot carry them, rather than rendering instrumental', async () => {
+ it('POST /generate refuses lyrics when the peer does not advertise them, rather than rendering instrumental', async () => {
const peer = { id: '00000000-0000-4000-8000-000000000001', enabled: true };
remoteProvider.peers = [peer];
- // A provider predating lyrical federation: the MODEL sings, so `lyrics` is
- // true, but it publishes neither the `lyrics` feature nor the legacy
- // `acceptsLyrics`, and rejects the field on submit. Absent must read as
- // false or every such render is a hard 400 the user cannot act on.
+ // A peer that does not publish a feature list cannot establish that its
+ // build accepts lyrics. Absent must read as false or every such render is a
+ // hard 400 the user cannot act on.
remoteProvider.resolve.mockResolvedValueOnce({
peer, capability: remoteLyricCapability({ lyrics: true }),
});
@@ -694,31 +691,14 @@ describe('music routes', () => {
expect(r.status).toBe(400);
expect(r.body.code).toBe('MEDIA_PROVIDER_LYRICS_UNSUPPORTED');
- expect(r.body.error).toContain('Update the peer');
- expect(mediaQueue.enqueue).not.toHaveBeenCalled();
- });
-
- it('POST /generate refuses lyrics for a remote model that renders instrumental only', async () => {
- const peer = { id: '00000000-0000-4000-8000-000000000001', enabled: true };
- remoteProvider.peers = [peer];
- remoteProvider.resolve.mockResolvedValueOnce({
- peer, capability: remoteLyricCapability({ lyrics: false, acceptsLyrics: false }),
- });
-
- const r = await request(app).post('/api/music/generate').send(remoteLyricRequest(peer));
-
- expect(r.status).toBe(400);
- expect(r.body.code).toBe('MEDIA_PROVIDER_LYRICS_UNSUPPORTED');
- expect(r.body.error).toContain('instrumental audio only');
+ expect(r.body.error).toContain('not reporting');
expect(mediaQueue.enqueue).not.toHaveBeenCalled();
});
it('POST /generate accepts lyrics from a peer that advertises only the status-root feature', async () => {
const peer = { id: '00000000-0000-4000-8000-000000000001', enabled: true };
remoteProvider.peers = [peer];
- // The post-migration provider: `features` at the status root and no
- // `acceptsLyrics` on the capability at all. A consumer that had kept
- // reading the per-capability field would refuse this peer outright.
+ // The provider advertises the build-level feature at the status root.
remoteProvider.resolve.mockResolvedValueOnce({
peer,
capability: remoteLyricCapability({ lyrics: true }),
@@ -756,7 +736,9 @@ describe('music routes', () => {
const peer = { id: '00000000-0000-4000-8000-000000000001', enabled: true };
remoteProvider.peers = [peer];
remoteProvider.resolve.mockResolvedValueOnce({
- peer, capability: remoteLyricCapability({ lyrics: true, acceptsLyrics: true }),
+ peer,
+ capability: remoteLyricCapability({ lyrics: true }),
+ status: { features: ['lyrics', 'inputAssets'] },
});
const r = await request(app).post('/api/music/generate').send(remoteLyricRequest(peer));
@@ -778,7 +760,9 @@ describe('music routes', () => {
const peer = { id: '00000000-0000-4000-8000-000000000001', enabled: true };
remoteProvider.peers = [peer];
remoteProvider.resolve.mockResolvedValueOnce({
- peer, capability: remoteLyricCapability({ lyrics: true, acceptsLyrics: true }),
+ peer,
+ capability: remoteLyricCapability({ lyrics: true }),
+ status: { features: ['lyrics', 'inputAssets'] },
});
const r = await request(app).post('/api/music/generate')
diff --git a/server/services/federatedMediaProvider.js b/server/services/federatedMediaProvider.js
index 665da3bebd..9e78ebae2f 100644
--- a/server/services/federatedMediaProvider.js
+++ b/server/services/federatedMediaProvider.js
@@ -401,10 +401,6 @@ async function configuredAudioCapabilities(config) {
maxDurationSec: engine?.maxDurationSec ?? null,
defaultDurationSec: engine?.defaultDurationSec ?? null,
lyrics: engine?.lyrics === true,
- // Overlap-release duplicate of the status-root `lyrics` feature (#4826).
- // Always equal to `lyrics` because it never carried a per-model fact;
- // drop it once no supported peer reads the legacy field.
- acceptsLyrics: engine?.lyrics === true,
inputAssets: null,
autoDuration: engine?.autoDuration === true,
frameStride: null,
@@ -495,7 +491,6 @@ async function localGeneratorCapabilities(kind, pythonPath, { models, configured
maxDurationSec: null,
defaultDurationSec: null,
lyrics: false,
- acceptsLyrics: false,
inputAssets: federatedInputAssetsBlock(kind, model),
autoDuration: false,
frameStride,
diff --git a/server/services/federatedMediaProvider.test.js b/server/services/federatedMediaProvider.test.js
index 52c14742cf..b2b638da64 100644
--- a/server/services/federatedMediaProvider.test.js
+++ b/server/services/federatedMediaProvider.test.js
@@ -349,7 +349,7 @@ describe('federated media provider capacity and idempotency', () => {
expect(status.capabilities[0].lyrics).toBe(false);
});
- it('renders lyrics on a lyric-capable model and advertises that its wire accepts them', async () => {
+ it('renders lyrics on a lyric-capable model and advertises the lyrics feature', async () => {
await submitFederatedMediaJob({
callerId: 'peer-example', config: config(),
input: { ...input(), lyrics: '[verse]\nwords' }, idempotencyKey: 'commission-lyrics',
@@ -359,7 +359,8 @@ describe('federated media provider capacity and idempotency', () => {
}));
const status = await getFederatedMediaProviderStatus(config());
- expect(status.capabilities[0]).toMatchObject({ lyrics: true, acceptsLyrics: true });
+ expect(status.capabilities[0]).toMatchObject({ lyrics: true });
+ expect(status.capabilities[0]).not.toHaveProperty('acceptsLyrics');
});
it('refuses lyrics for an instrumental-only model rather than dropping them', async () => {
@@ -371,7 +372,8 @@ describe('federated media provider capacity and idempotency', () => {
expect(enqueueJob).not.toHaveBeenCalled();
const status = await getFederatedMediaProviderStatus(config());
- expect(status.capabilities[0]).toMatchObject({ lyrics: false, acceptsLyrics: false });
+ expect(status.capabilities[0]).toMatchObject({ lyrics: false });
+ expect(status.capabilities[0]).not.toHaveProperty('acceptsLyrics');
});
// An instrumental take on a lyrical engine sends `lyrics: ''`. Gating on