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
refactor([issue-3014]): disambiguate "abandoned", drop a duplicate aggregate pass, extract scopeKeyOf
[._.]/ Adam Eivy78a9ef36c81a
diff --git a/client/src/components/apps/LayeredIntelligenceOutcomes.jsx b/client/src/components/apps/LayeredIntelligenceOutcomes.jsxindex 1982fd4967..822f018896 100644--- a/client/src/components/apps/LayeredIntelligenceOutcomes.jsx+++ b/client/src/components/apps/LayeredIntelligenceOutcomes.jsx@@ -82,7 +82,7 @@ export default function LayeredIntelligenceOutcomes({ appId }) {);}- const { stats, execution, rejections, recent, tracked = true } = state.data;+ const { stats, execution, metrics, rejections, recent, tracked = true } = state.data;if (!stats || stats.total === 0) {return (@@ -117,7 +117,11 @@ export default function LayeredIntelligenceOutcomes({ appId }) {// the API caps `recent` at a limit above what we render, so `recent.length` would// undercount the real remainder for an app with a long proposal history.const hiddenCount = Math.max(0, stats.total - visible.length);- const executionScopes = Object.entries(execution?.byScope || {});+ // Per-scope rows come from `metrics.byScope`, not `execution.byScope`: the latter is+ // built from approved records only, so a scope whose every proposal was rejected is+ // missing from it entirely — exactly the scope a reader most needs to see. Falls back+ // to the execution view so an older server (no `metrics` block) still renders rows.+ const executionScopes = Object.entries(metrics?.byScope || execution?.byScope || {});return (<div className="space-y-3 bg-port-bg border border-port-border rounded-lg px-3 py-3">@@ -188,7 +192,16 @@ export default function LayeredIntelligenceOutcomes({ appId }) {<li key={scope} className="text-xs text-gray-500 flex justify-between gap-2"><span className="min-w-0 break-all">{scope}</span><span className="shrink-0">- {summary.completionRate == null ? 'awaiting' : `${Math.round(summary.completionRate)}%`} · {summary.completed}/{summary.attempted || 0}+ {/*+ Delivery against APPROVALS, so a scope sitting on unexecuted+ approvals reads as partial rather than as a perfect attempted-only+ score. `null` means nothing was approved here at all — say so+ instead of printing a rate over a zero denominator.+ */}+ {summary.approvalToCompletionRate == null+ ? 'none approved'+ : `${Math.round(summary.approvalToCompletionRate)}% · ${summary.completed}/${summary.approved}`}+ {summary.rejected > 0 && ` · ${summary.rejected} rejected`}</span></li>))}diff --git a/client/src/components/apps/LayeredIntelligenceOutcomes.test.jsx b/client/src/components/apps/LayeredIntelligenceOutcomes.test.jsxindex 69b61b60da..9e187c38fc 100644--- a/client/src/components/apps/LayeredIntelligenceOutcomes.test.jsx+++ b/client/src/components/apps/LayeredIntelligenceOutcomes.test.jsx@@ -24,6 +24,17 @@ const ready = (overrides = {}) => ({}}},+ metrics: {+ totalFiled: 4, totalApproved: 1, totalCompleted: 1, totalRejected: 1,+ totalAbandonedAtFiling: 1, totalPending: 1, totalAwaitingExecution: 0,+ totalFailedExecution: 0, approvalToCompletionRate: 100, completionRate: 100,+ byScope: {+ 'app-improvement': {+ approved: 1, completed: 1, rejected: 0, abandonedAtFiling: 0, failedExecution: 0,+ awaitingExecution: 0, pending: 0, attempted: 1, completionRate: 100, approvalToCompletionRate: 100+ }+ }+ },rejections: { entries: [{ reason: 'user-rejected', count: 1 }], unknown: 1, unclassified: 0, diagnosed: 1, total: 2 },recent: [{ slug: 'add-metrics', scope: 'app-improvement', outcome: 'merged', rejectionReason: null, filedAt: '2026-07-04T00:00:00.000Z', outcomeAt: '2026-07-05T00:00:00.000Z' },@@ -79,6 +90,38 @@ describe('LayeredIntelligenceOutcomes', () => {expect(screen.getByText(/of approvals delivered \(1\/2\)/)).toBeInTheDocument();});+ it('lists a scope whose proposals were only ever rejected', async () => {+ // `execution.byScope` is built from approved records only, so this scope is absent+ // from it — it appears solely because the per-scope list reads `metrics.byScope`.+ // Showing it is the point: a scope that only ever gets rejected is the one a reader+ // most needs to see, and dropping it silently overstates the app's record.+ getAppLayeredIntelligenceOutcomes.mockResolvedValue(ready({+ metrics: {+ ...ready().metrics,+ byScope: {+ ...ready().metrics.byScope,+ 'loop-meta': {+ approved: 0, completed: 0, rejected: 2, abandonedAtFiling: 0, failedExecution: 0,+ awaitingExecution: 0, pending: 0, attempted: 0, completionRate: null, approvalToCompletionRate: null+ }+ }+ }+ }));+ render(<LayeredIntelligenceOutcomes appId="app-001" />);++ expect(await screen.findByText('loop-meta')).toBeInTheDocument();+ expect(screen.getByText(/none approved · 2 rejected/)).toBeInTheDocument();+ });++ it('falls back to the execution breakdown when the server sends no metrics block', async () => {+ // An older server predates the `metrics` roll-up; the per-scope rows must still+ // render rather than silently emptying the list.+ getAppLayeredIntelligenceOutcomes.mockResolvedValue(ready({ metrics: undefined }));+ render(<LayeredIntelligenceOutcomes appId="app-001" />);++ expect(await screen.findByText('app-improvement')).toBeInTheDocument();+ });+it('shows a dash for the merge rate when nothing has resolved yet', async () => {getAppLayeredIntelligenceOutcomes.mockResolvedValue(ready({stats: { total: 1, merged: 0, rejected: 0, abandoned: 0, pending: 1, resolved: 0, mergeRate: null },diff --git a/server/routes/apps/taskTypes.js b/server/routes/apps/taskTypes.jsindex 28e40b7790..37909b3df3 100644--- a/server/routes/apps/taskTypes.js+++ b/server/routes/apps/taskTypes.js@@ -110,7 +110,12 @@ router.get('/:id/layered-intelligence/outcomes', loadApp, asyncHandler(async (reif (!read) {return res.json({ appId: app.id, appName: app.name, read: false, tracked, stats: null, execution: null, metrics: null, rejections: null, recent: [] });}- const { total, merged, rejected, abandoned, pending, resolved, rawMergeRate } = summarizeOutcomeStats(outcomes);+ // Computed once and threaded into the roll-up below — `computeProposalOutcomeMetrics`+ // is built on these same two aggregators, so handing it the results keeps the whole+ // response to a single pass over the records instead of re-deriving both.+ const stats = summarizeOutcomeStats(outcomes);+ const execution = computePostApprovalCompletion(stats.filed);+ const { total, merged, rejected, abandoned, pending, resolved, rawMergeRate } = stats;const rejections = summarizeRejectionReasons(outcomes);const recent = outcomes.slice(0, OUTCOMES_DASHBOARD_LIMIT).map(o => ({slug: o.slug,@@ -130,14 +135,15 @@ router.get('/:id/layered-intelligence/outcomes', loadApp, asyncHandler(async (re// `mergeRate` is the raw 0–100 percentage over RESOLVED proposals, or null when// none have resolved (still-pending ≠ 0% merged). The client rounds for display.stats: { total, merged, rejected, abandoned, pending, resolved, mergeRate: rawMergeRate },- execution: computePostApprovalCompletion(outcomes),- // The composed `li-outcomes` effectiveness roll-up (#3014): filing-side approval /- // rejection counts and the execution-side approval → completion rate in ONE object,- // per-scope included. `stats` and `execution` above stay as the pre-existing- // per-facet views (the config tab still reads them); `metrics` is the single block- // that answers "do LI's approved proposals actually get delivered?" — all three are- // derived from the same records by the same shared aggregators, so they cannot drift.- metrics: computeProposalOutcomeMetrics(outcomes),+ execution,+ // The composed `li-outcomes` effectiveness roll-up (#3014). `stats` and `execution`+ // above stay as the pre-existing per-facet views (existing consumers read them);+ // `metrics` is the union neither can express — a per-scope breakdown carrying a+ // scope's rejection count AND its delivery rate side by side, including scopes that+ // never had an approval (absent from `execution.byScope` entirely). That union is+ // what distinguishes "rejected" from "approved then lost". Built from the same two+ // aggregate objects returned above, so the three blocks cannot drift.+ metrics: computeProposalOutcomeMetrics(outcomes, { stats, execution }),rejections,recent});diff --git a/server/routes/apps/taskTypes.test.js b/server/routes/apps/taskTypes.test.jsindex 224ab25cf1..27d8427af5 100644--- a/server/routes/apps/taskTypes.test.js+++ b/server/routes/apps/taskTypes.test.js@@ -100,14 +100,14 @@ describe('Apps Task-Type Routes', () => {// scope whose only proposal was abandoned rather than dropping it.expect(response.body.metrics).toMatchObject({totalFiled: 4, totalApproved: 1, totalCompleted: 1, totalRejected: 1,- totalAbandoned: 1, totalPending: 1, totalAwaitingExecution: 0,+ totalAbandonedAtFiling: 1, totalPending: 1, totalAwaitingExecution: 0,totalFailedExecution: 0, approvalToCompletionRate: 100});expect(response.body.metrics.byScope['app-improvement']).toMatchObject({approved: 1, completed: 1, rejected: 1, pending: 1, approvalToCompletionRate: 100});expect(response.body.metrics.byScope['app-data-gap']).toMatchObject({- approved: 0, abandoned: 1, approvalToCompletionRate: null+ approved: 0, abandonedAtFiling: 1, approvalToCompletionRate: null});// Real diagnoses only in entries; the undiagnosed abandoned row is `unknown`.expect(response.body.rejections.entries).toEqual([{ reason: 'user-rejected', count: 1 }]);diff --git a/server/services/layeredIntelligence.test.js b/server/services/layeredIntelligence.test.jsindex da08ec5729..6b0f35bc2a 100644--- a/server/services/layeredIntelligence.test.js+++ b/server/services/layeredIntelligence.test.js@@ -617,7 +617,7 @@ describe('computeProposalOutcomeMetrics (#3014)', () => {totalApproved: 3,totalCompleted: 1,totalRejected: 1,- totalAbandoned: 1,+ totalAbandonedAtFiling: 1,totalPending: 1,totalAwaitingExecution: 1,totalFailedExecution: 1@@ -630,7 +630,7 @@ describe('computeProposalOutcomeMetrics (#3014)', () => {it('breaks down by scope, keeping scopes that were only ever rejected', () => {const { byScope } = computeProposalOutcomeMetrics(RECORDS);expect(byScope['app-improvement']).toMatchObject({- approved: 2, completed: 1, rejected: 0, abandoned: 0, failedExecution: 1,+ approved: 2, completed: 1, rejected: 0, abandonedAtFiling: 0, failedExecution: 1,awaitingExecution: 0, attempted: 2, completionRate: 50, approvalToCompletionRate: 50});expect(byScope['app-data-gap']).toMatchObject({@@ -639,7 +639,7 @@ describe('computeProposalOutcomeMetrics (#3014)', () => {});// A never-approved scope still appears, with null rates rather than a fake 0%.expect(byScope['loop-meta']).toMatchObject({- approved: 0, completed: 0, rejected: 1, abandoned: 1,+ approved: 0, completed: 0, rejected: 1, abandonedAtFiling: 1,completionRate: null, approvalToCompletionRate: null});});@@ -661,12 +661,22 @@ describe('computeProposalOutcomeMetrics (#3014)', () => {const out = computeProposalOutcomeMetrics(input);expect(out).toMatchObject({totalFiled: 0, totalApproved: 0, totalCompleted: 0, totalRejected: 0,- totalAbandoned: 0, totalPending: 0, approvalToCompletionRate: null, completionRate: null+ totalAbandonedAtFiling: 0, totalPending: 0, approvalToCompletionRate: null, completionRate: null});expect(Object.keys(out.byScope)).toEqual([]);}});+ it('produces the same result whether or not the caller pre-computes the aggregates', () => {+ // The route hands in the `stats`/`execution` it already computed to avoid a second+ // pass. That shortcut must stay a pure optimization — if it ever diverges from+ // recomputing, the API's three blocks silently disagree about the same records.+ const stats = summarizeOutcomeStats(RECORDS);+ const execution = computePostApprovalCompletion(stats.filed);+ expect(computeProposalOutcomeMetrics(RECORDS, { stats, execution }))+ .toEqual(computeProposalOutcomeMetrics(RECORDS));+ });+it('buckets a "__proto__" scope as data rather than rewriting the prototype', () => {const { byScope } = computeProposalOutcomeMetrics([{ scope: '__proto__', outcome: 'merged', executionOutcome: 'success', filedAt: '2026-07-01T00:00:00.000Z', executionAt: '2026-07-01T01:00:00.000Z' }diff --git a/server/services/layeredIntelligence/awareness.js b/server/services/layeredIntelligence/awareness.jsindex 37ac49c39e..167fee41cd 100644--- a/server/services/layeredIntelligence/awareness.js+++ b/server/services/layeredIntelligence/awareness.js@@ -26,6 +26,22 @@ export function clampScopeLabel(label) {: label;}+/**+ * Resolve an outcome record's grouping key: its trimmed `scope`, or `fallback` when the+ * record carries none. Every per-scope aggregator here needs this, and the `fallback`+ * is the one thing they legitimately disagree on — a report that must not invent a+ * bucket passes `null` and skips the record (computeExecutionByDomain,+ * computeCrossReferenceAnalysis), while a breakdown that must account for every record+ * passes the default `'unknown'` (computePostApprovalCompletion,+ * computeProposalOutcomeMetrics). Keeping the predicate in one place means the four+ * groupings can't drift on what counts as a scope — which would silently split one+ * scope's records across two buckets.+ */+export function scopeKeyOf(record, fallback = 'unknown') {+ const scope = record?.scope;+ return typeof scope === 'string' && scope.trim() ? scope.trim() : fallback;+}+/*** Render an avoid/prefer prompt block from pre-classified item lists — the presentation* both scope-awareness signals share (#2760 install-wide task-type rates, #2765@@ -155,7 +171,7 @@ export function computeExecutionByDomain(outcomes = []) {for (const r of Array.isArray(outcomes) ? outcomes : []) {if (!r || typeof r !== 'object') continue;if (!PROPOSAL_EXECUTION_OUTCOMES.includes(r.executionOutcome)) continue;- const scope = typeof r.scope === 'string' && r.scope.trim() ? r.scope.trim() : null;+ const scope = scopeKeyOf(r, null);if (!scope) continue;if (!recordsByScope.has(scope)) recordsByScope.set(scope, []);recordsByScope.get(scope).push(r);@@ -253,7 +269,7 @@ export function computePostApprovalCompletion(outcomes = []) {const recordsByScope = new Map();for (const record of approved) {- const scope = typeof record.scope === 'string' && record.scope.trim() ? record.scope.trim() : 'unknown';+ const scope = scopeKeyOf(record);const records = recordsByScope.get(scope) || [];records.push(record);recordsByScope.set(scope, records);@@ -370,7 +386,7 @@ export function computeCrossReferenceAnalysis({ outcomes = [] } = {}) {const mergeByScope = new Map();for (const o of records) {if (!o || typeof o !== 'object') continue;- const scope = typeof o.scope === 'string' && o.scope.trim() ? o.scope.trim() : null;+ const scope = scopeKeyOf(o, null);if (!scope) continue;if (!PROPOSAL_OUTCOMES.includes(o.outcome)) continue; // unresolved: no verdict yetconst agg = mergeByScope.get(scope) || { merged: 0, resolved: 0 };diff --git a/server/services/layeredIntelligence/outcomes.js b/server/services/layeredIntelligence/outcomes.jsindex 53de7def3a..9554b94865 100644--- a/server/services/layeredIntelligence/outcomes.js+++ b/server/services/layeredIntelligence/outcomes.js@@ -16,7 +16,7 @@ import {LI_DEGRADED_SUCCESS_THRESHOLD, LI_HARD_GATE_EXECUTION_THRESHOLD, CLOSED_SUPPRESSION_MS,} from './constants.js';import { normalizeSlug, extractSlugFromBody, isIssueWithinDedupWindow } from './dedup.js';-import { computePostApprovalCompletion } from './awareness.js';+import { computePostApprovalCompletion, scopeKeyOf } from './awareness.js';/*** Derive a resolved outcome for a filed proposal from its live tracker issue.@@ -74,11 +74,11 @@ export function summarizeOutcomeStats(outcomes = []) {};}-// The per-scope bucket every scope in `computeProposalOutcomeMetrics().byScope`-// carries, including scopes whose proposals were only ever rejected (no approval, so-// `computePostApprovalCompletion` never builds a bucket for them). Zeroed counts with-// a NULL rate — "this scope has approved nothing" is not "this scope completes 0%".-const EMPTY_SCOPE_METRICS = {+// The per-scope EXECUTION bucket used for a scope that has no approvals, so+// `computePostApprovalCompletion` never built one for it (e.g. a scope whose every+// proposal was rejected). Zeroed counts with NULL rates — "this scope has approved+// nothing" is not "this scope completes 0% of what it approved".+const EMPTY_SCOPE_EXECUTION = {approved: 0,completed: 0,abandoned: 0,@@ -88,50 +88,71 @@ const EMPTY_SCOPE_METRICS = {approvalToCompletionRate: null};+// A scope's zeroed FILING tally, shared by the accumulator's seed and the lookup+// fallback below so the two can't drift apart.+const emptyScopeFiling = () => ({ rejected: 0, abandonedAtFiling: 0, pending: 0 });+/*** Roll this app's outcome records into the single `li-outcomes` effectiveness metrics* object (#3014) — the approval → completion signal LI had no way to read about* itself. Pure + side-effect-free and DERIVED, not stored: every field comes from the- * per-proposal records the outcome store already persists- * (`data/cos/li-outcomes/`), so there is no second on-disk aggregate to drift from- * its source and no migration to keep in step. Callers that want it persisted should- * persist the records (already done), not this.+ * per-proposal records the outcome store already persists (`data/cos/li-outcomes/`),+ * so there is no second on-disk aggregate to drift from its source and no migration to+ * keep in step. Callers that want it persisted should persist the records (already+ * done), not this.+ *+ * WHY this exists when the route already returns `stats` + `execution`: neither can+ * answer the question the issue was filed for — "are my approved proposals being+ * REJECTED, or approved and then LOST?" — per scope. `summarizeOutcomeStats` has no+ * per-scope breakdown at all, and `computePostApprovalCompletion.byScope` is built+ * from APPROVED records only, so a scope whose every proposal was rejected does not+ * appear in it. This is the union of the two, which is the only view where a scope's+ * rejection count and its delivery rate sit side by side.*- * Composes the two existing aggregators rather than re-deriving either — the same- * "one place the math lives" rule `summarizeOutcomeStats` was extracted for, so the- * roll-up, the prompt block, and the dashboard can never disagree:- * - FILING side (`summarizeOutcomeStats`): totalApproved / totalRejected /- * totalAbandoned / totalPending — how the user's triage judged each proposal.- * `totalApproved` is the `merged` outcome; approval is what the tracker records.- * - EXECUTION side (`computePostApprovalCompletion`): totalCompleted and the two- * completion rates — whether an APPROVED proposal actually got implemented.+ * Composes both existing aggregators rather than re-deriving either — the same "one+ * place the math lives" rule `summarizeOutcomeStats` was extracted for, so the roll-up,+ * the prompt block, and the dashboard can never disagree. Pass `stats`/`execution` when+ * the caller has already computed them (the route has) to skip recomputing both.** `totalCompleted` deliberately counts successful hand-offs of APPROVED proposals* only: a hand-off that completed for a proposal the user later rejected is not* evidence that approval leads to delivery, and letting it into the numerator could* push `approvalToCompletionRate` above 100%.*- * `byScope` is the union of both sides' scopes, so a scope whose proposals were only- * ever REJECTED still appears (with a null rate) instead of vanishing from the- * breakdown — the "distinguish rejected from lost" signal is per-scope too.+ * NAMING — "abandoned" is ambiguous in this domain, so this object never uses it bare.+ * A proposal can be dropped on either side of the lifecycle, and the sibling+ * `execution` block already spends the bare word on the second meaning:+ * - `abandonedAtFiling` / `totalAbandonedAtFiling` — the FILING-side `abandoned`+ * outcome: the tracker closed it for some reason other than merge or reject.+ * "The user dropped it."+ * - `failedExecution` / `totalFailedExecution` — the EXECUTION-side failure:+ * it was approved, handed off, and the hand-off failed. "LI couldn't implement it."+ * (`computePostApprovalCompletion` returns the latter as plain `abandoned`, which is+ * what `execution.abandoned` means in the same API payload. Rather than rename that+ * established field and its consumers, this block avoids the collision by never+ * exposing a bare `abandoned` of its own.)** @param {Array} [outcomes] - the app's li-outcomes records (from listOutcomes).+ * @param {object} [precomputed] - optional already-computed aggregates, to avoid a+ * second pass when the caller needs them separately anyway.+ * @param {object} [precomputed.stats] - a `summarizeOutcomeStats(outcomes)` result.+ * @param {object} [precomputed.execution] - a `computePostApprovalCompletion(...)` result.* @returns {{ totalFiled: number, totalApproved: number, totalCompleted: number,- * totalRejected: number, totalAbandoned: number, totalPending: number,+ * totalRejected: number, totalAbandonedAtFiling: number, totalPending: number,* totalAwaitingExecution: number, totalFailedExecution: number,* approvalToCompletionRate: number|null, completionRate: number|null,* duration: object, byScope: Object<string, object> }}*/-export function computeProposalOutcomeMetrics(outcomes = []) {- const { filed, total, merged, rejected, abandoned, pending } = summarizeOutcomeStats(outcomes);- const postApproval = computePostApprovalCompletion(filed);+export function computeProposalOutcomeMetrics(outcomes = [], { stats = null, execution = null } = {}) {+ const { filed, total, merged, rejected, abandoned, pending } = stats || summarizeOutcomeStats(outcomes);+ const postApproval = execution || computePostApprovalCompletion(filed);// Filing-side per-scope tallies. Keyed the same way computePostApprovalCompletion// keys its buckets ('unknown' for a scopeless record) so the two sides join.const filingByScope = new Map();for (const record of filed) {- const scope = typeof record.scope === 'string' && record.scope.trim() ? record.scope.trim() : 'unknown';- const agg = filingByScope.get(scope) || { rejected: 0, abandonedAtFiling: 0, pending: 0 };+ const scope = scopeKeyOf(record);+ const agg = filingByScope.get(scope) || emptyScopeFiling();if (record.outcome === 'rejected') agg.rejected += 1;else if (record.outcome === 'abandoned') agg.abandonedAtFiling += 1;else if (!record.outcome) agg.pending += 1;@@ -143,22 +164,19 @@ export function computeProposalOutcomeMetrics(outcomes = []) {// rewrite the prototype instead of adding a bucket.const byScope = Object.create(null);for (const scope of new Set([...Object.keys(postApproval.byScope), ...filingByScope.keys()])) {- const execution = postApproval.byScope[scope] || EMPTY_SCOPE_METRICS;- const filing = filingByScope.get(scope) || { rejected: 0, abandonedAtFiling: 0, pending: 0 };+ const scopeExecution = postApproval.byScope[scope] || EMPTY_SCOPE_EXECUTION;+ const filing = filingByScope.get(scope) || emptyScopeFiling();byScope[scope] = {- approved: execution.approved,- completed: execution.completed,+ approved: scopeExecution.approved,+ completed: scopeExecution.completed,rejected: filing.rejected,- // The FILING-side 'abandoned' outcome (closed for some other reason), NOT the- // failed hand-off — `failedExecution` below carries that. Naming them apart- // keeps "the user dropped it" separate from "LI couldn't implement it".- abandoned: filing.abandonedAtFiling,- failedExecution: execution.abandoned,- awaitingExecution: execution.awaitingExecution,+ abandonedAtFiling: filing.abandonedAtFiling,+ failedExecution: scopeExecution.abandoned,+ awaitingExecution: scopeExecution.awaitingExecution,pending: filing.pending,- attempted: execution.attempted,- completionRate: execution.completionRate,- approvalToCompletionRate: execution.approvalToCompletionRate+ attempted: scopeExecution.attempted,+ completionRate: scopeExecution.completionRate,+ approvalToCompletionRate: scopeExecution.approvalToCompletionRate};}@@ -167,7 +185,7 @@ export function computeProposalOutcomeMetrics(outcomes = []) {totalApproved: merged,totalCompleted: postApproval.completed,totalRejected: rejected,- totalAbandoned: abandoned,+ totalAbandonedAtFiling: abandoned,// Filed but not yet judged by the tracker — awaiting triage, NOT a failure.totalPending: pending,// Approved but never handed off / still running: the "approved but LOST" bucket