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-3014]): measure LI's approval to completion rate, not just attempted hand-offs
[._.]/ Adam Eivyecb5b9cb8245
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex 57a9821514..9b233041d7 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -22,6 +22,10 @@- **[issue-2952] TRELLIS.2 local runner scaffolding** — added `server/services/imageTo3d/trellis2.js`: on-disk install detection, pure install/generate command builders, a format-agnostic `generate.py` progress parser, and a guarded generate runner (throws unless installed; never auto-runs). `GET /api/image-to-3d/targets` now also reports each target's `installed` state. The real ~15 GB install + live GPU render are user-triggered and validated hands-on (remainder of #2952); no user-visible surface yet.- **[issue-2952] TRELLIS.2 SSE install endpoint** — added `GET /api/image-to-3d/trellis2/install` and `installTrellis2()`, which clone the Apple Silicon MPS port and run its `setup.sh` while streaming staged progress (stage → log → complete/error). Gated on hardware support (refuses on non-Apple-Silicon / insufficient memory), single-flighted against double-clicks, and canceled if the client disconnects. The real ~15 GB download only fires on this explicit user request (never at boot); the orchestration is mock-tested. No user-visible surface yet (the install button lands with the 3D page, #2953).+## Layered Intelligence++- **[issue-3014] See how many of the loop's approved proposals actually got delivered** — the Proposal outcomes panel showed only how many hand-offs succeeded *once attempted*, which read as a perfect score even when most approved proposals were sitting untouched. It now also shows an **approvals delivered** rate measured against every proposal you approved, so work that was approved and then quietly lost is visible instead of hidden behind the attempted-only number. The loop sees the same two rates (overall and per scope) when it reasons about what to propose next, so it can tell "you rejected my ideas" apart from "my ideas were accepted and never landed" and calibrate accordingly.+## Music studio- **[issue-2912] Chiptune score edits on two synced machines now show up as a real conflict** — if you compose a chiptune score for the same track on two federated installs before they sync with each other, that divergence now surfaces in Sharing → Conflicts (so you can review and choose which version to keep) instead of one edit silently overwriting the other.diff --git a/client/src/components/apps/LayeredIntelligenceOutcomes.jsx b/client/src/components/apps/LayeredIntelligenceOutcomes.jsxindex 2db6e13f63..1982fd4967 100644--- a/client/src/components/apps/LayeredIntelligenceOutcomes.jsx+++ b/client/src/components/apps/LayeredIntelligenceOutcomes.jsx@@ -165,6 +165,18 @@ export default function LayeredIntelligenceOutcomes({ appId }) {<p className="text-xs text-gray-500">{execution.completed} completed · {execution.abandoned} abandoned · {execution.awaitingExecution} awaiting execution</p>+ {/*+ Approval → completion (#3014). Distinct from the rate above: this divides by+ every APPROVED proposal, so approved work still sitting unexecuted drags it+ down. A wide gap between the two is the "approved but never delivered" signal+ — proposals being lost rather than rejected — so both are shown, never one.+ */}+ <p className="text-xs text-gray-500">+ <span className="text-gray-300">+ {execution.approvalToCompletionRate == null ? '—' : `${Math.round(execution.approvalToCompletionRate)}%`}+ </span>+ {' '}of approvals delivered ({execution.completed}/{execution.approved})+ </p>{execution.duration?.count > 0 && (<p className="text-xs text-gray-500">Filed → completed: median {formatDurationMs(execution.duration.medianMs)} · p90 {formatDurationMs(execution.duration.p90Ms)}diff --git a/client/src/components/apps/LayeredIntelligenceOutcomes.test.jsx b/client/src/components/apps/LayeredIntelligenceOutcomes.test.jsxindex 0de39f9100..69b61b60da 100644--- a/client/src/components/apps/LayeredIntelligenceOutcomes.test.jsx+++ b/client/src/components/apps/LayeredIntelligenceOutcomes.test.jsx@@ -14,10 +14,12 @@ const ready = (overrides = {}) => ({stats: { total: 4, merged: 1, rejected: 1, abandoned: 1, pending: 1, resolved: 3, mergeRate: 100 / 3 },execution: {approved: 1, completed: 1, abandoned: 0, awaitingExecution: 0, attempted: 1, completionRate: 100,+ approvalToCompletionRate: 100,duration: { count: 1, averageMs: 3_600_000, medianMs: 3_600_000, p90Ms: 3_600_000, minMs: 3_600_000, maxMs: 3_600_000 },byScope: {'app-improvement': {approved: 1, completed: 1, abandoned: 0, awaitingExecution: 0, attempted: 1, completionRate: 100,+ approvalToCompletionRate: 100,duration: { count: 1, averageMs: 3_600_000, medianMs: 3_600_000, p90Ms: 3_600_000, minMs: 3_600_000, maxMs: 3_600_000 }}}@@ -52,11 +54,31 @@ describe('LayeredIntelligenceOutcomes', () => {expect(screen.getByText('add-metrics')).toBeInTheDocument();expect(screen.getByText('drop-feature')).toBeInTheDocument();expect(screen.getByText('post-approval hand-off completion')).toBeInTheDocument();+ expect(screen.getByText(/of approvals delivered \(1\/1\)/)).toBeInTheDocument();expect(screen.getByText(/Filed → completed: median 1h 0m/)).toBeInTheDocument();expect(screen.getByText('app-improvement')).toBeInTheDocument();expect(getAppLayeredIntelligenceOutcomes).toHaveBeenCalledWith('app-001');});+ it('shows approval → completion separately from the attempted-only rate', async () => {+ // 2 approved, 1 delivered, 1 still awaiting execution: the attempted-only rate is a+ // perfect 100% while only half the approved work has landed. Both must be visible —+ // showing only the first would hide that a proposal was approved and then lost.+ getAppLayeredIntelligenceOutcomes.mockResolvedValue(ready({+ execution: {+ approved: 2, completed: 1, abandoned: 0, awaitingExecution: 1, attempted: 1,+ completionRate: 100, approvalToCompletionRate: 50,+ duration: { count: 0, averageMs: null, medianMs: null, p90Ms: null, minMs: null, maxMs: null },+ byScope: {}+ }+ }));+ render(<LayeredIntelligenceOutcomes appId="app-001" />);++ expect(await screen.findByText('100%')).toBeInTheDocument();+ expect(screen.getByText('50%')).toBeInTheDocument();+ expect(screen.getByText(/of approvals delivered \(1\/2\)/)).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 5dae9f08d9..28e40b7790 100644--- a/server/routes/apps/taskTypes.js+++ b/server/routes/apps/taskTypes.js@@ -21,7 +21,7 @@ import { sanitizeTaskMetadata } from '../../lib/validation.js';import { parseCronToNextRun } from '../../services/eventScheduler.js';import { asyncHandler, ServerError } from '../../lib/errorHandler.js';import { SELF_IMPROVEMENT_TASK_TYPES } from '../../services/taskSchedule.js';-import { summarizeOutcomeStats, computePostApprovalCompletion } from '../../services/layeredIntelligence.js';+import { summarizeOutcomeStats, computePostApprovalCompletion, computeProposalOutcomeMetrics } from '../../services/layeredIntelligence.js';import { listOutcomesResult } from '../../services/layeredIntelligenceOutcomes.js';import { summarizeRejectionReasons } from '../../services/layeredIntelligenceRejections.js';import { loadApp } from './shared.js';@@ -108,7 +108,7 @@ router.get('/:id/layered-intelligence/outcomes', loadApp, asyncHandler(async (reconst tracked = !!config?.sources?.outcomes;const { read, outcomes } = await listOutcomesResult({ appId: app.id });if (!read) {- return res.json({ appId: app.id, appName: app.name, read: false, tracked, stats: null, execution: null, rejections: null, recent: [] });+ 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);const rejections = summarizeRejectionReasons(outcomes);@@ -131,6 +131,13 @@ router.get('/:id/layered-intelligence/outcomes', loadApp, asyncHandler(async (re// 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),rejections,recent});diff --git a/server/routes/apps/taskTypes.test.js b/server/routes/apps/taskTypes.test.jsindex bae292e7f9..224ab25cf1 100644--- a/server/routes/apps/taskTypes.test.js+++ b/server/routes/apps/taskTypes.test.js@@ -95,6 +95,20 @@ describe('Apps Task-Type Routes', () => {duration: { count: 1, medianMs: 3_600_000 }});expect(response.body.execution.byScope['app-improvement']).toMatchObject({ completed: 1, completionRate: 100 });+ // The composed li-outcomes effectiveness roll-up (#3014): approval → completion+ // alongside the filing-side verdicts, with a per-scope breakdown that keeps a+ // 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,+ 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+ });// Real diagnoses only in entries; the undiagnosed abandoned row is `unknown`.expect(response.body.rejections.entries).toEqual([{ reason: 'user-rejected', count: 1 }]);expect(response.body.rejections.unknown).toBe(1);@@ -127,6 +141,9 @@ describe('Apps Task-Type Routes', () => {expect(response.body.read).toBe(false);expect(response.body.stats).toBeNull();expect(response.body.execution).toBeNull();+ // Null, not a zeroed roll-up: an unreadable store must not read as "LI has+ // approved nothing and delivered nothing" — the same sentinel rule as `stats`.+ expect(response.body.metrics).toBeNull();expect(response.body.recent).toEqual([]);});diff --git a/server/services/layeredIntelligence.test.js b/server/services/layeredIntelligence.test.jsindex 111e21d362..da08ec5729 100644--- a/server/services/layeredIntelligence.test.js+++ b/server/services/layeredIntelligence.test.js@@ -46,6 +46,7 @@ import {computeScopeAwareness,computeExecutionByDomain,computePostApprovalCompletion,+ computeProposalOutcomeMetrics,computeProposalExecutionAwareness,computeCrossReferenceAnalysis,computeHandoffRouting,@@ -574,6 +575,106 @@ describe('computePostApprovalCompletion (#2944)', () => {maxMs: 14_400_000});});++ it('divides approvalToCompletionRate by APPROVED, not attempted, and nulls it at zero approvals', () => {+ // 2 approved, 1 completed, 1 still awaiting execution: the attempted-only rate+ // reads a perfect 100% while only half the approved work has actually landed.+ const out = computePostApprovalCompletion([+ { scope: 'app-improvement', outcome: 'merged', executionOutcome: 'success', filedAt: '2026-07-01T00:00:00.000Z', executionAt: '2026-07-01T01:00:00.000Z' },+ { scope: 'app-improvement', outcome: 'merged', executionOutcome: null, filedAt: '2026-07-01T00:00:00.000Z' }+ ]);+ expect(out.completionRate).toBe(100);+ expect(out.approvalToCompletionRate).toBe(50);+ expect(out.byScope['app-improvement'].approvalToCompletionRate).toBe(50);++ // Nothing approved → null, never 0 (the division-by-zero sentinel).+ const none = computePostApprovalCompletion([{ scope: 'loop-meta', outcome: 'rejected' }]);+ expect(none.approved).toBe(0);+ expect(none.approvalToCompletionRate).toBeNull();+ });+});++describe('computeProposalOutcomeMetrics (#3014)', () => {+ const RECORDS = [+ // Approved and delivered.+ { scope: 'app-improvement', outcome: 'merged', executionOutcome: 'success', filedAt: '2026-07-01T00:00:00.000Z', executionAt: '2026-07-01T01:00:00.000Z' },+ // Approved, handed off, hand-off failed.+ { scope: 'app-improvement', outcome: 'merged', executionOutcome: 'failure', filedAt: '2026-07-01T00:00:00.000Z', executionAt: '2026-07-01T02:00:00.000Z' },+ // Approved but LOST — never executed. The bucket a rejection tally can't see.+ { scope: 'app-data-gap', outcome: 'merged', executionOutcome: null, filedAt: '2026-07-01T00:00:00.000Z' },+ // Rejected outright, in a scope that never had an approval at all.+ { scope: 'loop-meta', outcome: 'rejected', filedAt: '2026-07-01T00:00:00.000Z' },+ // Closed for some other reason (filing-side abandonment).+ { scope: 'loop-meta', outcome: 'abandoned', filedAt: '2026-07-01T00:00:00.000Z' },+ // Still open — awaiting triage, not a failure.+ { scope: 'app-data-gap', outcome: null, filedAt: '2026-07-01T00:00:00.000Z' }+ ];++ it('rolls filing and execution outcomes into one metrics object', () => {+ const out = computeProposalOutcomeMetrics(RECORDS);+ expect(out).toMatchObject({+ totalFiled: 6,+ totalApproved: 3,+ totalCompleted: 1,+ totalRejected: 1,+ totalAbandoned: 1,+ totalPending: 1,+ totalAwaitingExecution: 1,+ totalFailedExecution: 1+ });+ // 1 of 3 approved actually delivered — while the attempted-only rate reads 50%.+ expect(out.approvalToCompletionRate).toBeCloseTo(100 / 3, 10);+ expect(out.completionRate).toBe(50);+ });++ 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,+ awaitingExecution: 0, attempted: 2, completionRate: 50, approvalToCompletionRate: 50+ });+ expect(byScope['app-data-gap']).toMatchObject({+ approved: 1, completed: 0, awaitingExecution: 1, pending: 1,+ completionRate: null, approvalToCompletionRate: 0+ });+ // 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,+ completionRate: null, approvalToCompletionRate: null+ });+ });++ it('never counts a non-approved proposal towards completion (rate stays <= 100%)', () => {+ // A hand-off that succeeded for a REJECTED proposal is not evidence that approval+ // leads to delivery — letting it into the numerator would exceed 100%.+ const out = computeProposalOutcomeMetrics([+ { scope: 'app-improvement', outcome: 'merged', executionOutcome: 'success', filedAt: '2026-07-01T00:00:00.000Z', executionAt: '2026-07-01T01:00:00.000Z' },+ { scope: 'app-improvement', outcome: 'rejected', executionOutcome: 'success', filedAt: '2026-07-01T00:00:00.000Z', executionAt: '2026-07-01T01:00:00.000Z' }+ ]);+ expect(out.totalApproved).toBe(1);+ expect(out.totalCompleted).toBe(1);+ expect(out.approvalToCompletionRate).toBe(100);+ });++ it('returns zeroed totals with null rates for an empty or invalid history', () => {+ for (const input of [[], null, undefined]) {+ const out = computeProposalOutcomeMetrics(input);+ expect(out).toMatchObject({+ totalFiled: 0, totalApproved: 0, totalCompleted: 0, totalRejected: 0,+ totalAbandoned: 0, totalPending: 0, approvalToCompletionRate: null, completionRate: null+ });+ expect(Object.keys(out.byScope)).toEqual([]);+ }+ });++ 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' }+ ]);+ expect(Object.keys(byScope)).toContain('__proto__');+ expect(byScope['__proto__'].approvalToCompletionRate).toBe(100);+ expect({}.approvalToCompletionRate).toBeUndefined();+ });});describe('computeProposalExecutionAwareness (#2765)', () => {diff --git a/server/services/layeredIntelligence/awareness.js b/server/services/layeredIntelligence/awareness.jsindex e376588952..37ac49c39e 100644--- a/server/services/layeredIntelligence/awareness.js+++ b/server/services/layeredIntelligence/awareness.js@@ -191,6 +191,19 @@ export function computeExecutionByDomain(outcomes = []) {* Duration is measured from filing to a successful hand-off completion. That is the* only timestamp pair available for every tracker and remains meaningful when the* coding hand-off finishes before the tracker issue is reconciled as merged.+ *+ * TWO completion rates, deliberately (#3014) — they answer different questions and+ * conflating them hides the failure mode the metric exists to surface:+ * - `completionRate` = completed / ATTEMPTED (completed + abandoned).+ * "Of the hand-offs that actually terminated, how many succeeded?" — the+ * execution-quality read, which excludes work still in flight.+ * - `approvalToCompletionRate` = completed / APPROVED (every merged proposal).+ * "Of everything the user approved, how much has actually landed?" — the+ * downstream-effectiveness read. It counts an approved proposal that was never+ * handed off, or is stuck awaiting execution, as NOT completed, which is exactly+ * the "approved but LOST" signal a rejection-only view cannot distinguish.+ * Both are `null` (not 0) when their denominator is zero — the sentinel rule: "nothing+ * has been approved / attempted yet" must not read as "everything failed".*/export function computePostApprovalCompletion(outcomes = []) {const approved = (Array.isArray(outcomes) ? outcomes : []).filter(record =>@@ -230,6 +243,10 @@ export function computePostApprovalCompletion(outcomes = []) {awaitingExecution: records.length - attempted,attempted,completionRate: attempted > 0 ? (completed / attempted) * 100 : null,+ // Approval → completion (#3014): denominator is every APPROVED proposal, so a+ // merged proposal that is stuck awaiting execution drags this down while leaving+ // `completionRate` untouched. Division-by-zero yields null, never 0.+ approvalToCompletionRate: records.length > 0 ? (completed / records.length) * 100 : null,duration};};diff --git a/server/services/layeredIntelligence/outcomes.js b/server/services/layeredIntelligence/outcomes.jsindex 89ae8c6a23..53de7def3a 100644--- a/server/services/layeredIntelligence/outcomes.js+++ b/server/services/layeredIntelligence/outcomes.js@@ -74,6 +74,113 @@ 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 = {+ approved: 0,+ completed: 0,+ abandoned: 0,+ awaitingExecution: 0,+ attempted: 0,+ completionRate: null,+ approvalToCompletionRate: null+};++/**+ * 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.+ *+ * 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.+ *+ * `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.+ *+ * @param {Array} [outcomes] - the app's li-outcomes records (from listOutcomes).+ * @returns {{ totalFiled: number, totalApproved: number, totalCompleted: number,+ * totalRejected: number, totalAbandoned: 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);++ // 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 };+ if (record.outcome === 'rejected') agg.rejected += 1;+ else if (record.outcome === 'abandoned') agg.abandonedAtFiling += 1;+ else if (!record.outcome) agg.pending += 1;+ filingByScope.set(scope, agg);+ }++ // Null prototype for the same reason computeExecutionByDomain uses one: `scope` is+ // an LLM-authored free string, so a literal "__proto__" key on a plain object would+ // 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 };+ byScope[scope] = {+ approved: execution.approved,+ completed: execution.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,+ pending: filing.pending,+ attempted: execution.attempted,+ completionRate: execution.completionRate,+ approvalToCompletionRate: execution.approvalToCompletionRate+ };+ }++ return {+ totalFiled: total,+ totalApproved: merged,+ totalCompleted: postApproval.completed,+ totalRejected: rejected,+ totalAbandoned: 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+ // that `approvalToCompletionRate` counts against LI and a rejection tally misses.+ totalAwaitingExecution: postApproval.awaitingExecution,+ totalFailedExecution: postApproval.abandoned,+ approvalToCompletionRate: postApproval.approvalToCompletionRate,+ completionRate: postApproval.completionRate,+ duration: postApproval.duration,+ byScope+ };+}+/*** Format the LI outcome-feedback report (#2428) from this app's recorded* proposals + their reconciled outcomes. Pure + side-effect-free: the LI hook@@ -117,16 +224,30 @@ export function computeOutcomesReport({ outcomes = [], hasPlannedWork = false }.sort((a, b) => b[1].approved - a[1].approved).map(([scope, summary]) => {const rate = summary.completionRate == null ? 'no completed hand-offs yet' : `${Math.round(summary.completionRate)}% completed`;+ // Approval → completion (#3014): the share of this scope's APPROVED proposals+ // that actually landed. Sits alongside the attempted-only rate above so a scope+ // whose few attempts all succeeded but whose approvals mostly sit unexecuted+ // reads as the partial delivery it is, not as 100%.+ const approvalRate = summary.approvalToCompletionRate == null+ ? 'no approvals yet'+ : `${Math.round(summary.approvalToCompletionRate)}% of approvals delivered`;const duration = summary.duration.medianMs == null? 'no completion-time sample yet': `median filed-to-completed ${formatDuration(summary.duration.medianMs)} (p90 ${formatDuration(summary.duration.p90Ms)})`;- return `- ${scope}: ${summary.completed} completed, ${summary.abandoned} abandoned, ${summary.awaitingExecution} awaiting execution; ${rate}; ${duration}`;+ return `- ${scope}: ${summary.completed} completed, ${summary.abandoned} abandoned, ${summary.awaitingExecution} awaiting execution; ${rate}; ${approvalRate}; ${duration}`;});const postApprovalLines = postApproval.approved === 0 ? [] : ['','Post-approval LI hand-off follow-through:',`- Approved proposals: ${postApproval.approved}; ${postApproval.completed} completed, ${postApproval.abandoned} abandoned, ${postApproval.awaitingExecution} awaiting execution.`,`- Completion rate: ${postApproval.completionRate == null ? 'no terminal hand-offs yet' : `${Math.round(postApproval.completionRate)}% (${postApproval.completed}/${postApproval.attempted} attempted)`}.`,+ // The downstream-effectiveness read (#3014). Denominator is every APPROVED+ // proposal, so work the user accepted but that was never handed off — or is still+ // stuck — counts against LI here even though the attempted-only rate above ignores+ // it. This is the number that answers "do my approved proposals actually land?",+ // and a large gap between the two rates means proposals are being LOST, not rejected.+ `- Approval → completion rate: ${postApproval.approvalToCompletionRate == null ? 'nothing approved yet' : `${Math.round(postApproval.approvalToCompletionRate)}% (${postApproval.completed}/${postApproval.approved} approved)`}.`+ + `${postApproval.awaitingExecution > 0 ? ` ${postApproval.awaitingExecution} approved proposal(s) are still awaiting execution — approved work that has not been delivered. Prefer proposals a coding agent can finish over adding to that queue.` : ''}`,`- Filed-to-completed duration: ${postApproval.duration.medianMs == null ? 'no valid completion-time sample yet' : `average ${formatDuration(postApproval.duration.averageMs)}, median ${formatDuration(postApproval.duration.medianMs)}, p90 ${formatDuration(postApproval.duration.p90Ms)} (${postApproval.duration.count} completed)`}.`,'- By approved proposal scope:',...(postApprovalScopeLines.length ? postApprovalScopeLines : ['- (none)'])