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

address review (codex r7): link runs to their CD output, redistribute one-sided digest budget

[._.]/ Adam Eivyffe6ef117780
diff --git a/client/src/pages/CreativeCommissions.jsx b/client/src/pages/CreativeCommissions.jsx
index 53d5cac242..fe9e5675f3 100644
--- a/client/src/pages/CreativeCommissions.jsx
+++ b/client/src/pages/CreativeCommissions.jsx
@@ -13,8 +13,8 @@
*/
import { useEffect, useMemo, useState, useCallback, useRef } from 'react';
-import { useNavigate, useParams } from 'react-router-dom';
-import { Plus, Sparkles, Trash2, Clock, Pause, Play, ThumbsUp, ThumbsDown } from 'lucide-react';
+import { useNavigate, useParams, Link } from 'react-router-dom';
+import { Plus, Sparkles, Trash2, Clock, Pause, Play, ThumbsUp, ThumbsDown, ExternalLink } from 'lucide-react';
import toast from '../components/ui/Toast';
import Drawer from '../components/Drawer';
import ConfirmButtonPair from '../components/ui/ConfirmButtonPair';
@@ -605,7 +605,18 @@ function CommissionForm({ form, patchForm, runs, feedback, onRate, saving, onSav
{r.status}{r.reason ? ` · ${r.reason}` : ''}{r.error ? ` · ${r.error}` : ''}
</span>
</div>
- {/* Rate/annotate a run that actually produced output. */}
+ {/* Open the generated output so the user can inspect what they're
+ rating, then rate/annotate the run below. */}
+ {r.projectId && (
+ <div className="mt-1">
+ <Link
+ to={`/creative-director/${encodeURIComponent(r.projectId)}`}
+ className="text-port-accent hover:text-blue-400 inline-flex items-center gap-1"
+ >
+ <ExternalLink className="w-3 h-3" /> View output
+ </Link>
+ </div>
+ )}
{r.projectId && onRate && (
<RunFeedback runId={r.id} current={feedbackByRun[r.id]} onRate={onRate} />
)}
diff --git a/server/services/creativeCommissions/directive.js b/server/services/creativeCommissions/directive.js
index 8e69ad9c9e..99caf15b15 100644
--- a/server/services/creativeCommissions/directive.js
+++ b/server/services/creativeCommissions/directive.js
@@ -91,7 +91,11 @@ export function renderFeedbackDigest(feedback, windowSize = 5) {
// chronological join would drop the user's LATEST reaction in a long group.
// Reversing puts the newest notes first, so the truncation sheds the oldest.
const STEER = 'Steer toward the likes and away from the dislikes.';
- const groupBudget = Math.max(0, Math.floor((MAX_DIGEST_LEN - STEER.length - 40) / 2));
+ // Split the budget only across the groups that are actually present — a
+ // one-sided window (only likes or only dislikes) gets the WHOLE budget rather
+ // than reserving half for an absent group and truncating real feedback.
+ const groupsPresent = (likes.length ? 1 : 0) + (dislikes.length ? 1 : 0);
+ const groupBudget = Math.max(0, Math.floor((MAX_DIGEST_LEN - STEER.length - 40) / groupsPresent));
const parts = [];
if (likes.length) parts.push(`Recent likes: ${clamp([...likes].reverse().join('; '), groupBudget)}.`);
if (dislikes.length) parts.push(`Recent dislikes: ${clamp([...dislikes].reverse().join('; '), groupBudget)}.`);
diff --git a/server/services/creativeCommissions/directive.test.js b/server/services/creativeCommissions/directive.test.js
index e6ba9e1b98..ef910bdc6a 100644
--- a/server/services/creativeCommissions/directive.test.js
+++ b/server/services/creativeCommissions/directive.test.js
@@ -68,6 +68,22 @@ describe('renderFeedbackDigest', () => {
expect(renderFeedbackDigest([{ rating: 'up', note: 'x' }], 0)).toBe('');
});
+ it('gives a one-sided window the whole budget (does not reserve half for the absent group)', () => {
+ // 3 × 300-char likes = ~900 chars — fits the full digest budget but would
+ // overrun a half-budget (~730), truncating the newest like. With no dislikes,
+ // the likes group must get the whole budget so all three survive.
+ const feedback = [
+ { rating: 'up', note: 'A'.repeat(300) },
+ { rating: 'up', note: 'B'.repeat(300) },
+ { rating: 'up', note: 'C'.repeat(300) },
+ ];
+ const digest = renderFeedbackDigest(feedback, 3);
+ // newest-first: C should be present (it's the latest), and all three fit.
+ expect(digest).toContain('C'.repeat(300));
+ expect(digest).toContain('A'.repeat(300));
+ expect(digest).not.toContain('Recent dislikes');
+ });
+
it('keeps recent dislikes even when many long likes precede them (per-group budget)', () => {
const feedback = [
...Array.from({ length: 5 }, () => ({ rating: 'up', note: 'L'.repeat(300) })),