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
feat([issue-715]): provenance chips on CoS, Goals, and dashboard surfaces
Adam Eivy9540bf9b2bbb
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex e572c88cb5..8cd8673eca 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -10,6 +10,7 @@- **[issue-711] Per-domain autonomy guardrails** — The Chief of Staff config gains a "Domain Guardrails" panel that lets you set how much each domain acts on its own, independently: Brain auto-classify, Memory auto-extract, CoS auto-run, and Messages auto-send. Each is Off (never act automatically — leave it for you), Dry-run (do the thinking and surface what it would do, but don't commit the side effect), or Execute (act automatically — the default, so nothing changes unless you dial a domain back). Dry-run captures and classifies thoughts but holds them for your confirmation, routes extracted memories to pending approval instead of storing them live, lists the autonomous tasks it would have run without spawning them, and skips outbound message forwarding while logging what it would have sent.- **[issue-713] Pinned & Recent in the sidebar** — The top of the left navigation now shows the pages you've pinned and the ones you visited most recently, so your working set is one click away. Hover (or keyboard-focus) a page row inside any sidebar section to reveal a pin button; pinned pages stay at the top until you unpin them, and Recent tracks your last few pages automatically. Both sections appear only when they have something to show.- **[issue-715] "Why am I seeing this?" chips on Insights** — Your taste-identity theme cards now carry a tappable provenance chip alongside the confidence badge, the same source-chip affordance the health views use. Tap it to see that the theme was inferred by AI from your taste profile (not something you stated outright) and what would change it — answering more of your profile or regenerating. Confidence (how strong the pattern is) and provenance (how it was derived) are now two distinct, honest signals on every card.+- **[issue-715] "Why am I seeing this?" chips across Chief of Staff, Goals, and the dashboard** — The same provenance chip now appears wherever PortOS shows you something it derived rather than something you set. The Chief of Staff's actionable-insights banner explains that its top recommendation was surfaced from your task queue and recent activity. A goal's detail panel marks its urgency and activity-budget readings as modeled from your health timeline and linked activities — not numbers you entered — so a derived reading never reads as a fact you stated. On the dashboard, the Proactive Alerts card declares its alerts are inferred from trends in your goals, costs, and system metrics, while the Decision Log card declares its entries are read straight from the ledger of choices the Chief of Staff actually made. Tap any chip for how it was derived and what would change it.## Changeddiff --git a/client/src/components/DecisionLogWidget.jsx b/client/src/components/DecisionLogWidget.jsxindex 9b4db119db..397b0404be 100644--- a/client/src/components/DecisionLogWidget.jsx+++ b/client/src/components/DecisionLogWidget.jsx@@ -19,6 +19,19 @@ import { useAutoRefetch } from '../hooks/useAutoRefetch';import { useTimeTick } from '../hooks/useTimeTick';import { timeAgo } from '../utils/formatters';import { equalByKeys, equalListByKeys } from '../lib/compareHelpers';+import ProvenanceChip from './ui/ProvenanceChip';++// Every row here is a record of an autonomous choice the Chief of Staff made —+// what it skipped, switched, or deferred and why. That's read straight off the+// decision ledger it wrote as it ran, so the provenance is data-backed: a log+// of actions taken, not a model's guess about them.+const DECISION_PROVENANCE = {+ level: 'data-backed',+ explainer:+ 'Read directly from the decision ledger your Chief of Staff writes as it runs — each row is an autonomous choice it actually made (skip, switch, defer) with the reason it recorded at the time.',+ whatWouldChange:+ 'New entries appear as the Chief of Staff makes more scheduling decisions; the log only grows, it is never re-estimated.',+};/*** DecisionLogWidget - Shows transparency into CoS decision-making@@ -240,13 +253,16 @@ const DecisionLogWidget = memo(function DecisionLogWidget() {</p></div></div>- <Link- to="/cos/learning"- className="flex items-center gap-1 text-sm text-port-accent hover:text-port-accent/80 transition-colors min-h-[40px] px-2"- >- <span className="hidden sm:inline">Details</span>- <ChevronRight size={16} />- </Link>+ <div className="flex items-center gap-2 shrink-0">+ <ProvenanceChip {...DECISION_PROVENANCE} />+ <Link+ to="/cos/learning"+ className="flex items-center gap-1 text-sm text-port-accent hover:text-port-accent/80 transition-colors min-h-[40px] px-2"+ >+ <span className="hidden sm:inline">Details</span>+ <ChevronRight size={16} />+ </Link>+ </div></div>{/* Quick Stats Row */}diff --git a/client/src/components/ProactiveAlertsWidget.jsx b/client/src/components/ProactiveAlertsWidget.jsxindex c60f9f57bb..791ff5031e 100644--- a/client/src/components/ProactiveAlertsWidget.jsx+++ b/client/src/components/ProactiveAlertsWidget.jsx@@ -15,6 +15,19 @@ import {import * as api from '../services/api';import { useAutoRefetch } from '../hooks/useAutoRefetch';import { equalByKeys, equalListByKeys } from '../lib/compareHelpers';+import ProvenanceChip from './ui/ProvenanceChip';++// Alerts are detected by the Chief of Staff from trends in your goals, task+// success rates, costs, and system metrics — inferred from your data, not+// thresholds you configured. The chip declares that the same way the insights+// and health surfaces do. Only rendered when there are alerts to attribute.+const ALERT_PROVENANCE = {+ level: 'inferred',+ explainer:+ 'Detected by your Chief of Staff from trends in your goals, task success rates, costs, and system metrics — inferred from your data, not thresholds you set by hand.',+ whatWouldChange:+ 'As the underlying trend reverses — a goal resumes progress, success rates recover, costs settle — the alert clears on the next sweep.',+};const SEVERITY_STYLES = {critical: { bg: 'bg-port-error/10', text: 'text-port-error', border: 'border-port-error/30' },@@ -77,15 +90,18 @@ const ProactiveAlertsWidget = memo(function ProactiveAlertsWidget() {</p></div></div>- {hasAlerts && counts.total > 5 && (- <Link- to="/cos"- className="flex items-center gap-1 text-sm text-port-accent hover:text-port-accent/80 transition-colors min-h-[40px] px-2"- >- <span className="hidden sm:inline">View All</span>- <ChevronRight size={16} />- </Link>- )}+ <div className="flex items-center gap-2 shrink-0">+ {hasAlerts && <ProvenanceChip {...ALERT_PROVENANCE} />}+ {hasAlerts && counts.total > 5 && (+ <Link+ to="/cos"+ className="flex items-center gap-1 text-sm text-port-accent hover:text-port-accent/80 transition-colors min-h-[40px] px-2"+ >+ <span className="hidden sm:inline">View All</span>+ <ChevronRight size={16} />+ </Link>+ )}+ </div></div>{/* Severity badges */}diff --git a/client/src/components/cos/ActionableInsightsBanner.jsx b/client/src/components/cos/ActionableInsightsBanner.jsxindex 15e8ede2a7..625e841d32 100644--- a/client/src/components/cos/ActionableInsightsBanner.jsx+++ b/client/src/components/cos/ActionableInsightsBanner.jsx@@ -16,6 +16,19 @@ import {Unlock} from 'lucide-react';import * as api from '../../services/api';+import ProvenanceChip from '../ui/ProvenanceChip';++// Actionable insights are surfaced by the Chief of Staff from your current task+// queue, system state, and recent activity — recommendations it derived, never+// something you set outright. The chip answers "why am I seeing this?" the same+// way the taste-identity and health surfaces do.+const INSIGHT_PROVENANCE = {+ level: 'inferred',+ explainer:+ 'Surfaced by your Chief of Staff from your current task queue, system state, and recent activity — a prioritized recommendation it derived, not an alert you configured.',+ whatWouldChange:+ 'Acting on it, clearing the underlying tasks, or changing your queue updates or removes the recommendation on the next evaluation.',+};const ICON_MAP = {AlertCircle,@@ -139,6 +152,7 @@ export default function ActionableInsightsBanner({ onTaskUnblocked }) {Urgent</span>)}+ <ProvenanceChip {...INSIGHT_PROVENANCE} /></div>{primaryInsight.description && !isExpanded && (<p className="text-xs text-gray-400 mt-0.5 line-clamp-1">diff --git a/client/src/components/goals/GoalDetailPanel.jsx b/client/src/components/goals/GoalDetailPanel.jsxindex 194dd65258..37bf960c06 100644--- a/client/src/components/goals/GoalDetailPanel.jsx+++ b/client/src/components/goals/GoalDetailPanel.jsx@@ -1,5 +1,6 @@import { X, AlertTriangle, Calendar, Activity, Tag, Check, Trash2 } from 'lucide-react';import Pill from '../ui/Pill';+import ProvenanceChip from '../ui/ProvenanceChip';import {CATEGORY_CONFIG, HORIZON_OPTIONS, GOAL_TYPE_CONFIG, GOAL_TYPE_OPTIONS, DEFAULT_NEW_GOAL} from './goalConstants';@@ -25,6 +26,19 @@ const urgencyColor = (u) => {return 'text-green-400';};+// The goal itself is yours — title, horizon, category are all stated outright.+// The urgency and activity-budget readings, though, are computed from your life+// expectancy, health timeline, and linked activities — modeled from your data,+// not numbers you entered. The chip declares that so a derived reading never+// reads as something you set. Only rendered when such a reading is present.+const READING_PROVENANCE = {+ level: 'inferred',+ explainer:+ 'Urgency and activity-budget readings are computed from your life-expectancy and health timeline, this goal\'s horizon, and the activities you linked to it — modeled from your data, not values you entered.',+ whatWouldChange:+ 'Updating your health timeline, the goal\'s horizon or target date, or the activities linked to it shifts these readings.',+};+export default function GoalDetailPanel({ goal, allGoals, onClose, onRefresh }) {const s = useGoalDetail({ goal, allGoals, onClose, onRefresh });@@ -38,6 +52,9 @@ export default function GoalDetailPanel({ goal, allGoals, onClose, onRefresh })const excludedIds = s.getDescendantIds(goal.id);const parentOptions = (allGoals || []).filter(g => !excludedIds.has(g.id));+ // Only declare provenance when an AI-derived reading is actually on the panel.+ const hasDerivedReading = goal.urgency != null || goal.feasibility != null;+return (<div className="w-full sm:w-80 bg-port-card border-l border-port-border h-full overflow-y-auto p-4 space-y-4">{/* Header */}@@ -55,9 +72,12 @@ export default function GoalDetailPanel({ goal, allGoals, onClose, onRefresh })</span>)}</div>- <button onClick={onClose} className="p-1 text-gray-500 hover:text-white shrink-0">- <X className="w-4 h-4" />- </button>+ <div className="flex items-center gap-1.5 shrink-0">+ {hasDerivedReading && <ProvenanceChip {...READING_PROVENANCE} />}+ <button onClick={onClose} className="p-1 text-gray-500 hover:text-white shrink-0">+ <X className="w-4 h-4" />+ </button>+ </div></div>{s.editing ? (diff --git a/client/src/components/goals/GoalDetailPanel.test.jsx b/client/src/components/goals/GoalDetailPanel.test.jsxindex ec632149f2..e797c7b429 100644--- a/client/src/components/goals/GoalDetailPanel.test.jsx+++ b/client/src/components/goals/GoalDetailPanel.test.jsx@@ -109,3 +109,18 @@ describe('GoalDetailPanel badge migration to <Pill>', () => {expect(priorityBadge.className).not.toContain('inline-flex');});});++describe('GoalDetailPanel provenance chip', () => {+ it('renders an Inferred provenance chip when an AI-derived reading is present', () => {+ // baseGoal carries urgency: 0.8 → the urgency/feasibility readings are modeled,+ // so the header must declare provenance the same way the insight surfaces do.+ renderPanel();+ expect(screen.getByText('Inferred')).toBeTruthy();+ });++ it('omits the provenance chip when there is no AI-derived reading', () => {+ // A goal with neither urgency nor feasibility has nothing modeled to attribute.+ renderPanel({ ...baseGoal, urgency: undefined, feasibility: undefined });+ expect(screen.queryByText('Inferred')).toBeNull();+ });+});