Repository navigation
fix(seeds): the CSI trade taxonomy was never seeded, so skills could not be added (#583) - #602
Merged
Merged
Conversation
…not be added (#583) POST /v1/profiles/skills/search-parents returned {"skills":[]} for every query in every local environment — "electrical", "conc", anything — so nobody could add a trade skill to a profile. Not a developer, not a test, not a reviewer. Every skills screen was an empty state, which is why skills bugs were undetectable by construction. The catalog was never loaded. data.masterformat is populated by scripts/seed-csi.ts, and nothing invokes it: config.toml declares sql_paths = ['./seeds/*.sql'], so a TypeScript script is not part of `supa db reset` and never has been. Converted to a real seed. 8,953 rows generated from the same scripts/seed-csi-2020.csv, reproducing that script's identity rules exactly so the two cannot disagree — id = uuid5(uuid5(URL,'scaffald:skills:csi2018'), code_key). Deterministic ids mean re-running is a no-op and rows referencing a skill survive a reset. Ordered parent-before-child so the self-referencing parent_id FK resolves in one pass, and numbered 000 so it lands before 014, which resolves trade skills by code_key. 014's CSI insert joins data.masterformat and matched zero rows against the empty table, reporting success while planting none of the six skills its own header advertises. That is exactly the failure mode its header warns about — "an empty state and a broken query look identical" — and it is how this stayed hidden: marcus scored 100% completion beside a widget reading "No skills added yet". It now asserts its own inserts landed, and names data.masterformat's row count in the failure so the cause is in the message. Not verified against a live database: Docker is unavailable in this environment, so the seed has not been applied and search-parents has not been re-probed. The generated SQL is checked structurally (row count, depth distribution 35/1406/ 5031/2481, parent linkage spot-checked on 26-05-05-00 -> 26-05-00-00). Co-Authored-By: Claude Opus 5 <[email protected]>
5 tasks
thinkclay
added a commit
that referenced
this pull request
Aug 12, 2026
…real profile (#584) (#605) 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
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.
Addresses the main body of #583. Part of #594.
The catalog was never loaded
POST /v1/profiles/skills/search-parentsreturned{"skills":[]}for every query in every local environment — "electrical", "conc", anything — so nobody could add a trade skill to a profile. Not a developer, not a test, not a reviewer. Every skills screen was an empty state, which is why skills bugs were undetectable by construction.data.masterformatis populated byscripts/seed-csi.ts, and nothing invokes it.config.tomldeclaressql_paths = ['./seeds/*.sql'], so a TypeScript script is not part ofsupa db resetand never has been.The fix
Converted to a real seed: 8,953 rows generated from the same
scripts/seed-csi-2020.csv, reproducing that script's identity rules exactly so the two cannot disagree —Deterministic ids mean re-running is a no-op rather than a duplicate set, and rows referencing a skill survive a reset. Ordered parent-before-child so the self-referencing
parent_idFK resolves in one pass. Numbered000so it lands before014_seed-worker-profiles.sql, which resolves trade skills bycode_key.Depth distribution: 35 / 1,406 / 5,031 / 2,481.
Seed 014 now fails loudly
014's CSI insert joins
data.masterformatand matched zero rows against the empty table — reporting success while planting none of the six skills its own header advertises. That is exactly the failure mode its header warns about ("an empty state and a broken query look identical"), and it is how this stayed hidden: marcus scored 100% completion beside a widget reading "No skills added yet".It now asserts its own inserts landed, and names
data.masterformat's row count in the exception so the cause is in the message rather than something you have to go looking for.Not done here, and why
Not verified against a live database. Docker is unavailable in this environment, so the seed has not been applied and
search-parentshas not been re-probed. The generated SQL is checked structurally only (row count, depth distribution, parent linkage spot-checked on26-05-05-00→26-05-00-00). This wants apnpm supa db resetbefore it is trusted.The two 404ing endpoints are left alone. #583 proposed deleting them or their hooks. On inspection they have live consumers, so deleting the hooks is not correct and the endpoints are genuinely missing:
GET /v1/profiles/skills/useruseWorkLogForm,WorkLogDetailScreenGET /v1/profiles/skills/legacySkillsWidget, rendered on other-user profiles viauser-profile-rightThat is a wider breakage than #583 described — the work-log skill picker and the skills section of every other-user profile — and it needs a decision about implementing the endpoints rather than a guess at their contract under time pressure. Filed separately as #603 and noted on #583.
🤖 Generated with Claude Code