Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
address review (claude): pin the containment contract's third leg
Adam Eivyfe8c813c486c
diff --git a/PLAN.md b/PLAN.mdindex fc84d7aed1..7fdfafb39b 100644--- a/PLAN.md+++ b/PLAN.md@@ -90,7 +90,7 @@ by `/do:replan --issues`:### CoS stat-card follow-ups-- [ ] **Retire or wire up `StatCard`'s dead `activeLabel` prop, and de-dup the two hand-rolled Learning cards.** `activeLabel` (`client/src/components/cos/StatCard.jsx:1`, rendered at :59-63 and interpolated into `ariaLabel` at :2) has **zero callers** across the client — no `activeLabel=` usage and no spread props into `<StatCard>`. It is also only honored by the *default* variant: the `compact` (:6-27) and `mini` (:29-46) variants silently drop it, so a future caller passing it to a compact card would get nothing. Either delete the prop + its render branch, or make the compact/mini variants honor it. Related: the two Learning cards (`client/src/pages/ChiefOfStaff.jsx` ~512-537 compact, ~832-858 ascii `mini`) are hand-rolled buttons rather than `StatCard`s precisely because StatCard supports neither `onClick` nor a status-driven border color nor a sub-label on the compact variant — and they duplicate the same `status === 'critical' ? … : 'warning' ? …` color ternaries three times each. Wiring the sub-label through (an `activeLabel`-style slot honored by all variants) plus `onClick`/border-tone props would let both collapse onto StatCard. Deferred from the mobile-overflow fix (which only restructured the compact card's value/label stacking): removing or re-speccing a prop on a shared component used by every CoS stat card is a distinct refactor deserving its own PR + tests, and the overflow fix must not ride on it.+- [ ] **Retire or wire up `StatCard`'s never-passed `activeLabel` prop, and de-dup the two hand-rolled Learning cards.** `activeLabel` (`client/src/components/cos/StatCard.jsx:1`) has **zero callers** across the client — no `activeLabel=` usage and no spread props into `<StatCard>`. It is *visually* rendered only by the default variant (:59-63); the `compact` (:4-22) and `mini` (:24-42) variants honor it only through the `ariaLabel` interpolation at :2 (consumed via `aria-label` at :8 / :28) — i.e. it reaches the accessible name but is never displayed. So it is not fully inert: deleting it changes the accname on two variants. Either delete the prop + its render branch + the `ariaLabel` clause together, or make compact/mini render it. Related: the two Learning cards (`client/src/pages/ChiefOfStaff.jsx` ~512-540 compact, ~836-862 ascii `mini`) are hand-rolled buttons rather than `StatCard`s precisely because StatCard supports neither `onClick` nor a status-driven border color nor a visible sub-label on the compact variant — and each duplicates the same `status === 'critical' ? … : 'warning' ? …` color ternary twice (once for the border, once for the icon). Wiring a visible sub-label slot through all variants plus `onClick`/border-tone props would let both collapse onto StatCard. Deferred from the mobile-overflow fix (which only restructured the compact card's value/label stacking): removing or re-speccing a prop on a shared component used by every CoS stat card is a distinct refactor deserving its own PR + tests, and the overflow fix must not ride on it.### Creative Director agents should not push code (deferred — needs a distinct completion contract)diff --git a/client/src/pages/ChiefOfStaff.jsx b/client/src/pages/ChiefOfStaff.jsxindex 03bd286cad..570fe376cc 100644--- a/client/src/pages/ChiefOfStaff.jsx+++ b/client/src/pages/ChiefOfStaff.jsx@@ -524,11 +524,14 @@ export default function ChiefOfStaff() {'text-gray-500'}`} /><div className="flex-1 min-w-0 text-left">- <div className="text-[10px] text-gray-500">Learning</div>+ <div className="text-[10px] text-gray-500 truncate">Learning</div>{/* Stacked, not a flex row: as flex items these keep min-width:auto,so on a narrow card the skipped label can't shrink and spills out.- The value itself stays wrappable — `truncate` would clip the- (widest) 'No data' to 'No dat…' on a narrow card. */}+ (The `min-w-0` on the column above is what lets it shrink at all —+ a nowrap label in a `min-width:auto` flex item can't.) The value+ itself stays wrappable — `truncate` would clip the widest value,+ 'No data', to 'No dat…'. Mirrors StatCard's compact variant:+ truncate the label, leave the value alone. */}<div className="text-sm font-bold text-white">{learningSummary?.overallSuccessRate != null ? `${learningSummary.overallSuccessRate}%` : 'No data'}</div>diff --git a/client/src/pages/ChiefOfStaff.test.jsx b/client/src/pages/ChiefOfStaff.test.jsxindex 0d68f03a5b..598fc3f944 100644--- a/client/src/pages/ChiefOfStaff.test.jsx+++ b/client/src/pages/ChiefOfStaff.test.jsx@@ -176,6 +176,41 @@ describe('ChiefOfStaff Learning card skipped label', () => {}});+ it('keeps the compact card\'s text column shrinkable so the truncate can bite', async () => {+ // Third leg of the containment contract: `truncate` sets white-space:nowrap,+ // which makes the label's min-content its FULL width. In the compact card+ // that column is a flex item of the button's `flex items-center gap-2`, so+ // without `min-w-0` it can't shrink below that min-content and the whole+ // column spills past the border again — the exact reported bug, with the+ // truncate still present and every other assertion here still green.+ api.getCosLearningSummary.mockResolvedValue(summaryWithSkipped);+ renderAt('config');++ // Scope to the compact cards: the ascii `mini` card's label parent is the+ // <button> itself (not a flex-item column), so this leg doesn't apply there.+ const columns = (await learningCards())+ .map(c => within(c).getByText(/skipped/).parentElement)+ .filter(col => col.classList.contains('flex-1'));+ expect(columns.length).toBeGreaterThan(0);+ for (const col of columns) {+ expect(col.classList.contains('min-w-0')).toBe(true);+ }+ });++ it('renders a legitimate 0% rate as "0%", not the empty state', async () => {+ // `overallSuccessRate != null` (not truthiness) is what keeps a total-failure+ // 0% from disguising itself as "No data" — the highest-signal state reading+ // as the empty one. Pins the branch against a future truthiness collapse.+ api.getCosLearningSummary.mockResolvedValue({ overallSuccessRate: 0, skipped: 0, status: 'critical', totalCompleted: 12 });+ renderAt('config');++ for (const card of await learningCards()) {+ expect(within(card).getByText('0%')).toBeInTheDocument();+ expect(within(card).queryByText('No data')).not.toBeInTheDocument();+ expect(within(card).queryByText('—')).not.toBeInTheDocument();+ }+ });+it('leaves the value wrappable so "No data" is not clipped', async () => {// `truncate` implies white-space:nowrap. The label needs it (it can be// arbitrarily wide); the value must NOT have it — the widest value,