diff --git a/docs/dev/bias-profile.md b/docs/dev/bias-profile.md index fdd635ab..c9bfc43a 100644 --- a/docs/dev/bias-profile.md +++ b/docs/dev/bias-profile.md @@ -151,9 +151,17 @@ interval lower bound (not the mean) as the surfacing gate. - `src/screens/BiasProfile.svelte` - the diagnostics modal. Reads `bias_summary` and `biasListProcessedThreads` on mount; per-thread observations are pulled on demand when a row is - expanded. Three sections: per-bias evidence table, processed - conversations list with drill-down to observations, footer - citing the math constants. + expanded. Four sections: current-conversation status, bias + landscape chart, per-bias evidence cards with drill-down, and + the processed-conversations list, plus a footer citing the math + constants. The screen is Svelte wire-up only per the frontend + split (see `docs/dev/frontend-organization.md`). +- `src/lib/ui/bias-profile.ts` - the modal's pure display + primitives: row sorting, the RENDER_CAP'd rendered set, catalog + lookups tolerant of unknown keys, number/verdict formatters, the + per-row interpretation prose, the landscape chart's hue and + width geometry, and the current-conversation empty-state copy. + Unit-tested in `tests/bias-profile.test.ts`. - `supabase/schema.sql` (bias-profile section) - the tables (`bias_observations`, `bias_summary`, `bias_reactions`), the columns on `threads` (`bias_processed_at`, diff --git a/docs/dev/frontend-organization.md b/docs/dev/frontend-organization.md index aca24364..7ec2e74e 100644 --- a/docs/dev/frontend-organization.md +++ b/docs/dev/frontend-organization.md @@ -191,7 +191,10 @@ component "to consolidate." Each is locally reasonable. The aggregate is a layer rebuilt one inch at a time. Periodically (and after any non-trivial UI work), walk -`src/components/*.svelte` and ask, per file: +`src/components/*.svelte` AND `src/screens/*.svelte` and ask, per +file (the screens are where the convention drifts hardest - they +are the biggest files, and "it's only used by this screen" is the +exact rationalization the convention exists to refuse): 1. **What's in the ` @@ -571,37 +369,19 @@ {/if}
- Not yet analyzed. Conversations become eligible - once their last activity falls on a previous day; - the hourly sweep picks this one up then. -
- {:else if currentThreadObs.length === 0} -- Already analyzed - no clear bias evidence was - found in this conversation. Reporting nothing - is the correct answer most of the time. -
+ {#if obsEmptyCopy !== null} + +{obsEmptyCopy}
{:else}{o.reasoning}
@@ -611,36 +391,18 @@ {/if}- {#if currentThreadReactions === null || currentThreadProcessedAt === null} - - Not yet analyzed. Reactions are recorded for the - biases that were active in the system prompt while - the conversation happened; the sweep classifies - them once the conversation settles. - {:else if renderedRows.length === 0} - No biases were active in the system prompt during - this conversation, so there was nothing for you - to react to. - {:else} - Already analyzed - the agent did not see a clear - affirmation or pushback signal for the active - biases on this conversation. - {/if} -
+ {#if reactionsEmptyCopy !== null} + +{reactionsEmptyCopy}
{:else}- {interpretBias(row, rendered.has(row.bias))} + {interpretBias(row, rendered.has(row.bias), hasEvidence(observationCounts, row.bias))}
- {#if hasEvidence(row.bias)} + {#if hasEvidence(observationCounts, row.bias)}