Repository navigation
feat(profile): make the guided wizard reachable, and have it write a real profile (#584) - #605
Merged
Merged
Conversation
…real profile (#584) The Profile Wizard was 15 source files, 12 test files and a live /v1/profile-wizard router with no route anywhere that rendered it. Nothing imported it outside its own directory. It was unreachable in the shipped app, while carrying nearly half the passing test files in the profile feature — which is how it inflated the apparent health of a feature it was not part of. Two things were missing, and both had to be fixed for either to be worth doing. Reachability: /profile/wizard now renders it, declared in the profile layout, with ROUTES.PROFILE.WIZARD and a "Guided setup" entry point on the profile overview beside Request review and Share profile. It is a peer of the section editors, not a replacement — the wizard is the guided path for a new worker, the editors are how anyone changes one thing later. Persistence: POST /v1/profile-wizard/complete writes wizard progress into core.preferences and touches nothing else, so finishing all six steps left the actual profile empty. The wizard now commits through the same endpoints the profile editors use — PATCH /v1/profiles/general, POST /v1/profiles/experience, POST /v1/profiles/education, PATCH /v1/profiles/employment — rather than giving the server a second write path per section. One write path, one set of validation rules, one place for a bug to live. The commit runs before the wizard is marked complete, so a failed write cannot leave a user with a finished wizard and an empty profile. Sections are written independently and one failure does not abort the rest: someone who filled in five steps should not lose all five because certifications 500'd. Failures are named in a toast pointing at the profile. Skills and certifications are deliberately NOT committed yet. Both write paths key off catalog ids, and the wizard's pickers resolve those against endpoints that are currently broken — the CSI catalog was unseeded until #602, and two skills endpoints still 404 (#603). Writing half-resolved ids would put rows in core.user_skills that are harder to clean up than to skip. Noted inline. The field mapping is extracted to wizard-to-profile.ts and unit-tested rather than inlined: the wizard says "bio" where the profile says "about", and getting that wrong is silent — the PATCH succeeds and the text lands nowhere visible. Co-Authored-By: Claude Opus 5 <[email protected]>
This was referenced Aug 12, 2026
thinkclay
added a commit
that referenced
this pull request
Aug 12, 2026
…it clean (#504, #593) (#606) I un-excluded scf-core from test:unit in #604 on the strength of a JSON report showing 957 passed / 0 failed. That was the wrong signal. `vitest run` exits 1 regardless, so `pnpm test` went red on main for anyone running it locally. Two things were wrong with how I checked. The OOM is real. I grepped the background task's output file for "heap out of memory" and got nothing, because that file held only my own echo lines — vitest's stderr went elsewhere and I never read it. #504 is not stale: at --max-old-space-size=4096 the main process dies with "Ineffective mark-compacts near heap limit" at ~4GB. Raising it to 8192 does not fix it either; with the two collection failures below repaired, more files collect, more memory is retained, and it OOMs again at 8GB. Every test passes and the report says success: true — the failure is entirely the parent process at teardown, not the tests. My pass/fail summary could not see a broken file. A file that fails to *collect* contributes zero passed and zero failed, so it is invisible to a count of assertions. Two files were failing that way and I shipped both: - ScaffaldLogo.test.tsx (mine, #599) — "Unexpected token 'typeof'". react-native-svg's untransformed source. A mock for it has existed at tests/infrastructure/vitest/mocks/react-native-svg.tsx since it was written but was never aliased in vitest.config.ts, unlike the react-native, lucide and expo-updates mocks. Now aliased, which fixes any test rendering an SVG. - ProfileWizard.test.tsx (mine, #605) — the commit hook I added pulled @scf/core/provider, and through it UniversalThemeProvider -> expo-router/react-navigation, which does not resolve under vitest. Mocked in the test; the commit path keeps its own unit tests. The logo test also asserted something false: that two separate render() calls produce byte-identical markup. They are two React roots, and useId is only required to be deterministic by position within a root, so a correct implementation fails that. It now asserts what actually regresses if the id goes random again — not drawn from a random source, stable across re-renders, distinct between two logos in one tree, and referenced by the url(#id) that fills the mark. scf-core goes back in the exclude list. Making it runnable is #504's job and it needs the parent-process retention fixed, not a bigger ceiling. Co-authored-by: Claude Opus 5 <[email protected]>
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.
Closes #584. Part of #594. You chose "wire it up properly" over deleting it.
What was wrong
The Profile Wizard was 15 source files, 12 test files and a live
/v1/profile-wizardrouter with no route anywhere that rendered it. Nothing imported it outside its own directory. It was unreachable in the shipped app — while carrying nearly half the passing test files in the profile feature, which is how it inflated the apparent health of a feature it was not part of.Two things were missing, and fixing either alone would have been pointless.
Reachability
/profile/wizardrenders it, declared in the profile layout, withROUTES.PROFILE.WIZARDand a Guided setup button on the profile overview beside Request review and Share profile.It is a peer of the section editors, not a replacement: the wizard is the guided path for a new worker; the editors are how anyone changes one thing later.
Persistence
POST /v1/profile-wizard/completewrites wizard progress intocore.preferencesand touches nothing else — so finishing all six steps left the actual profile empty.The wizard now commits through the same endpoints the profile editors use:
PATCH /v1/profiles/generalPOST /v1/profiles/experiencePOST /v1/profiles/educationPATCH /v1/profiles/employmentThat is the acceptance criterion, and it is also the right shape: giving the server a second write path per section would mean two sets of validation rules and two places for the same bug.
Two deliberate ordering choices:
What is deliberately left out
Skills and certifications are not committed yet. Both write paths key off catalog ids, and the wizard's pickers resolve those against endpoints that are currently broken: the CSI catalog was unseeded until #602, and two skills endpoints still 404 (#603). Writing half-resolved ids would put rows in
core.user_skillsthat are harder to clean up than to skip. Marked inline with the issue references so it is a known gap rather than an oversight.Why the mapping is a separate tested module
wizard-to-profile.tsexists because the wizard saysbiowhere the profile saysabout,issuerwhere it saysissuing_organization, and a single-valueavailabilitywhere it stores an array. Getting any of those wrong is silent — the request succeeds and the data lands nowhere visible. 18 assertions cover the renames, the trimming, the required-field rules the editors enforce, and the current-role end-date handling.Verification
scf-coretypechecks at 0 errors;pnpm prepushgreen.pnpm supa start,pnpm web, visit/profile/wizard, complete it, confirm/profilereflects the answers.CI checks will show red without running — Actions billing block, see #375.
🤖 Generated with Claude Code