Skip to content

fix(personality): relative-frequency cognitive-function scoring + opt-in LLM-vote mode - #19

Merged
ClaudiaFang merged 1 commit into
masterfrom
worktree-personality-scoring-fix
Jul 21, 2026
Merged

fix(personality): relative-frequency cognitive-function scoring + opt-in LLM-vote mode#19
ClaudiaFang merged 1 commit into
masterfrom
worktree-personality-scoring-fix

Conversation

@ClaudiaFang

Copy link
Copy Markdown
Member

Summary

  • Root cause of "MBTI numbers all high, unlike other tests": computeCognitiveFunctions scored each of the 8 Jungian functions by mean effective-pattern confidence, which has a hard 70 floor by prompt design and clusters 70-95 — so every function with any samples landed in the "high" band almost by construction, regardless of actual relative strength.
  • Switched to relative-frequency-share scoring (each function's share of pattern instances vs. a 1/8 "fair share" baseline), which differentiates by construction whenever pattern-category usage isn't perfectly uniform — matching the ipsative/competing nature of a real MBTI-style profile.
  • Bumped PERSONALITY_ANALYSIS_VERSION to 2.1.0 and made readSnapshot invalidate cached rows on analysisVersion mismatch (previously only checked profileVersion), so previously-cached mis-scored snapshots recompute instead of serving stale forever.
  • Added an opt-in llm-vote scoring mode (config: dashboard.analysis.personality.cognitiveFunctionScoring, toggle via code-insights config set personality-scoring llm-vote / personality-vote-rounds <n>): runs N independent LLM scoring rounds and averages them, as an alternative to the deterministic formula. PersonalityProfile.cognitiveFunctionScoringMode records which mode produced a profile; MbtiCard shows a small "(LLM-voted)" label when applicable.

Test plan

  • pnpm build — all 3 packages (cli/server/dashboard) build clean
  • pnpm test — 1599/1599 tests pass (917 cli + 667 server + 15 dashboard), including new coverage for the frequency-share formula, cache invalidation on stale analysisVersion, and scoreCognitiveFunctionsByLlmVote (averaging, malformed-round handling, zero-evidence forcing null, total-failure fallback)

🤖 Generated with Claude Code

… LLM-vote alternative

The 8 Jungian cognitive function scores were computed as mean effective-pattern
confidence, but confidence has a hard 70 floor by prompt design (see
cli/src/analysis/prompts.ts) and clusters 70-95 — so every function with any
samples landed in the "high" band almost by construction, producing uniformly
high, undifferentiated scores that don't resemble a real MBTI-style profile
(an ipsative construct where functions compete, not all score independently
high).

computeCognitiveFunctions now scores each function by its RELATIVE FREQUENCY
SHARE of pattern instances against a "fair share" (1/8) baseline instead —
this differentiates by construction whenever category usage isn't perfectly
uniform. Bumped PERSONALITY_ANALYSIS_VERSION to 2.1.0 and made readSnapshot
invalidate cached rows on analysisVersion mismatch (previously only checked
profileVersion), so already-cached mis-scored snapshots get recomputed
instead of served stale forever.

Also adds an opt-in 'llm-vote' scoring mode (dashboard.analysis.personality.
cognitiveFunctionScoring in config.json, toggle via `code-insights config set
personality-scoring llm-vote`): calls the LLM N independent rounds
(llmVoteRounds, default 3) to score all 8 functions from pattern-count +
example evidence and averages the results, as an alternative to the
deterministic formula. PersonalityProfile.cognitiveFunctionScoringMode
records which mode produced a given profile; MbtiCard surfaces it in the UI.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ClaudiaFang
ClaudiaFang marked this pull request as ready for review July 21, 2026 13:55
@ClaudiaFang
ClaudiaFang merged commit 0a05f42 into master Jul 21, 2026
1 check passed
@ClaudiaFang
ClaudiaFang deleted the worktree-personality-scoring-fix branch July 21, 2026 13:55
ClaudiaFang pushed a commit that referenced this pull request Jul 23, 2026
ClaudiaFang added a commit that referenced this pull request Jul 23, 2026
…-fix

fix(personality): relative-frequency cognitive-function scoring + opt-in LLM-vote mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant