Skip to content

fix(profile): Profile Strength measured the wrong things (#585) - #601

Merged
thinkclay merged 1 commit into
mainfrom
claude/fix-585-completion-scoring
Aug 12, 2026
Merged

thinkclay merged 1 commit into
mainfrom
claude/fix-585-completion-scoring

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Closes #585. Part of #594.

Skills counted the soft-skills questionnaire

core.user_skills holds three taxonomies — csi, onet and soft_skills — and the 25-question soft-skills self-assessment writes a row each. Both completion paths counted the table unfiltered, so rating yourself on that questionnaire satisfied the >= 3 skills component outright with zero trade skills.

Measured rather than assumed: [email protected] has zero csi/onet rows and three soft_skills rows, and GET /v1/profiles/completion/status returned completionPercentage: 100 — while the Skills widget on his own profile read "No skills added yet". The widget filters to csi/onet; the score did not.

Fixed in both places, because completion is calculated twice and only one of them served that 100:

  • migration 345 for core.v_profile_completion_scores
  • the .in("skill_taxonomy", …) filter in routes/profile-completion.ts

Fixing only the view would have left the observed behaviour unchanged, which is worth knowing if you review the migration alone.

A Deno test asserts the shared rule so changing one side without the other becomes a visible edit here rather than a silent divergence in production.

Identity scored a field nothing could set

Identity awards 20 points for a non-empty core.users.headline. No editor in the app could set one: the Profile Wizard collects a headline and requires it, but the wizard is unreachable (#584); the General Information editor had no such field; and PATCH /v1/profiles/general did not accept one. Twenty points were unreachable for every user no matter what they filled in.

The issue offered either direction. This takes the "make it reachable" one, because headline is a real product concept already rendered on the profile header, community posts and search results — dropping it from the score would have left the app unable to collect something it displays. Added to the client schema (120-char cap), the editor, and both directions of /v1/profiles/general.

This also unblocks part of #584: the wizard's general step now has a real write path for the headline it collects.

Verification

  • 34 Deno assertions in __tests__/lib (17 request-schema, 8 completion-calc, 5 new parity, plus existing), 0 failures.
  • 242 scf-core profile assertions, 0 failures.
  • scf-core typechecks at 0 errors; supabase:build green; pnpm prepush green.

Not verified against a live database — Docker is down in this environment, so the migration has not been applied and observed. It is a CREATE OR REPLACE VIEW whose only change from 340 is the added AND us.skill_taxonomy IN ('csi','onet') predicate.

CI checks will show red without running — Actions billing block, see #375.

🤖 Generated with Claude Code

Two defects, one in each of the two places completion is calculated.

Skills counted core.user_skills with no taxonomy filter. That table holds three
taxonomies — csi, onet and soft_skills — and the soft-skills self-assessment
alone writes 25 rows, so rating yourself on that questionnaire satisfied the
">= 3 skills" component outright with zero trade skills.

Measured, not assumed: [email protected] has zero csi/onet rows and
three soft_skills rows, and GET /v1/profiles/completion/status returned
completionPercentage 100 while the Skills widget on his own profile read "No
skills added yet". The widget filters to csi/onet; the score did not.

Fixed in both paths, because both were wrong and only one of them is the one
that served that 100: migration 345 for core.v_profile_completion_scores, and
the .in() filter in routes/profile-completion.ts. A Deno test now asserts the
shared rule so changing one side without the other is a visible edit rather
than a silent divergence.

Identity awards 20 points for a non-empty core.users.headline, and no editor in
the app could set one. The wizard collects a headline and requires it, but the
wizard is not reachable (#584); the General Information editor had no such
field, and PATCH /v1/profiles/general did not accept one. So 20 points were
unreachable for every user no matter what they filled in.

Rather than drop headline from the score, this makes it reachable — it is a real
product concept, rendered on the profile header, community posts and search
results. Added to the general schema (120 char cap), the editor, and both
directions of /v1/profiles/general.

Co-Authored-By: Claude Opus 5 <[email protected]>
@thinkclay
thinkclay merged commit 965dfd4 into main Aug 12, 2026
6 of 15 checks passed
@thinkclay
thinkclay deleted the claude/fix-585-completion-scoring branch August 12, 2026 03:49
thinkclay added a commit that referenced this pull request Aug 12, 2026
* test: repoint the profile e2e specs at routes that exist, and run the Deno lib tests (#592)

Twelve specs under tests/e2e/profile/ visited a URL space the app no longer
serves. Seven targeted /profile/general, /profile/employment, /profile/education
and /profile/certifications — all redirect stubs since the nine-screens-to-four
consolidation — and asserted expect(page.url()).toContain(<old path>), which the
redirect makes false. They now visit the live routes, and their titles name the
section they actually exercise ("/profile/resume (General Information)") rather
than a screen that was deleted.

PROFILE_AUDIT_PLAN.md listed /dashboard/profile/*, a prefix the app has never
served, and half its entries were screens that no longer exist. Replaced with
the live route list plus an explicit stub-to-destination table.

Separately: functions/api/__tests__/lib/*.test.ts was in no runner glob.
test:api:rest:suite and the CI workflow both listed only routes/ and
integration/, so profile-completion-calc.test.ts had never run, and neither had
the schema tests added in #597 or the parity tests added in #601. Added to both,
plus a standalone test:api:lib. That is 34 assertions moving from "written" to
"executed".

The profile specs are corrected but deliberately NOT added to testMatch yet.
Turning them on needs one verified green run — Supabase up, api function served,
dev server warm, seeded workers present — and this environment has no Docker, so
they have been fixed but not executed. Adding them unrun would ship exactly the
"known-red selection" playwright.config.ts already warns about. The config now
carries the precise command to finish the job.

Co-Authored-By: Claude Opus 5 <[email protected]>

* test: run scf-core in the default suite (#593)

scf-core holds every line of profile UI logic and was explicitly excluded from
test:unit, so `pnpm test` and CI never ran any of it. 146 test files, ~1,000
assertions, none of them executing on the command the repo treats as "the
tests".

Running the suite directly: 955 passed, 61 skipped, 2 failed. It also completes
— it does not OOM, contrary to the premise of #504. The `pool: 'forks'`
workaround already in packages/scf-core/vitest.config.ts is doing its job; what
remained was simply the exclude flag.

The two failures were the same wrong assertion in two assessment widgets:

    expect(container.firstChild).toBeNull()

renderWithProviders wraps in BeyondUIThemeWrapper, which renders a real element,
so container.firstChild is that wrapper and can never be null. The assertion
failed whether or not the widget rendered — it was testing the harness, not the
component. Both now assert the widget's own testid is absent, which is what
"should not render widget when assessment is completed" actually means.

With those fixed the suite is green, so the exclude comes off.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>
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.

fix(profile): Profile Strength scores a field no editor can set, and counts soft-skill ratings as skills

1 participant