feat(personality): add MBTI type + 8 cognitive functions - #16
Merged
ClaudiaFang merged 2 commits intoJul 21, 2026
Conversation
Extends the deterministic Personality Analysis profile with a second layer scored from the same effective-pattern facets: one score per Jungian cognitive function (Ni/Ne/Si/Se/Ti/Te/Fi/Fe), mapped 1:1 from the 8 effective-pattern categories, plus a pure deriveMbti() that picks a 4-letter type from the standard 16-type function-stack table using dominant/auxiliary scores with a documented, deterministic tie-break. PersonalityProfile.profileVersion bumps to 2 (cognitiveFunctions + mbti fields); PERSONALITY_ANALYSIS_VERSION bumps to 2.0.0. No SQLite schema change — personality_snapshots.results_json is an opaque JSON blob and old cached rows are read via JSON.parse(...) as PersonalityProfile, not runtime- validated, so profileVersion 1 stays in the type union for those. Every number here stays deterministic and LLM-free, same as the rest of this module — the archetype narrative continues to be the only LLM-touched field.
Extends the archetype-generation LLM call (POST /api/personality/generate) to also return a ranked top-5 MBTI type guess list with reasoning, grounded in the 8 cognitive function scores and 4 traits — a softer, LLM-authored companion view alongside the existing deterministic single-type derivation. `likelihood` is a deliberate, documented exception to this feature's "LLM never produces a number" rule, since ranking requires one. Every field is re-validated/clamped server-side (type must be one of the 16 valid codes, deduped, capped at 5, likelihood clamped to 0-100, rank reassigned from array order). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
Author
Summary
Test plan
🤖 Generated with Claude Code |
ClaudiaFang
marked this pull request as ready for review
July 21, 2026 13:20
ClaudiaFang
pushed a commit
that referenced
this pull request
Jul 23, 2026
chore: pre-launch open-source cleanup
ClaudiaFang
added a commit
that referenced
this pull request
Jul 23, 2026
…gnitive-functions feat(personality): add MBTI type + 8 cognitive functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PersonalityProfile.profileVersionbumped to2;PERSONALITY_ANALYSIS_VERSIONbumped to2.0.0. No DB migration needed —personality_snapshots.results_jsonis an opaque JSON blob.CognitiveFunctionRadarChart(8-axis radar, mirrorsPersonalityRadarChart) andMbtiCard(type, confidence, function stack), wired intoPersonalityPage.server/src/schemas/personality.ts) updated to match.Test plan
cd cli && pnpm test— 914/914 passing, including new coverage for all 8 function scores, MBTI derivation (INTJ/INFJ/ESFP/ESTP fixtures), the <2-signal null case, and tie-break determinism.pnpm buildfrom repo root — zero TypeScript errors across cli/server/dashboard.pnpm testfrom repo root — cli 914, server 655, dashboard 15, all passing.🤖 Generated with Claude Code