Skip to content

Three routers are built on tables that were never created #658

Closed

Description

@thinkclay

Unlike the wrong-schema cluster (#657), these have no table to point at. Each needs a decision, not a rename.

router queried refs nearest real thing
skills.ts (soft skills) core.soft_skills_ratings 8 core.soft_skills, core.review_soft_skill_votes
profile-import.ts core.profile_import_data 5 — nothing
profile-completion.ts:259 core.profile_completion_nudges 1 — nothing

GET /v1/profiles/skills/soft/history was confirmed 500 against a live stack. The soft-skills router carries eight references to a table that has never existed, which suggests a whole feature was written against a schema that was designed but not migrated.

The decision each needs

  1. Soft skills history — is the intended source core.soft_skills + core.review_soft_skill_votes (which do exist and are populated by the review wizard), or was a dedicated ratings table planned? If the former, these eight references should be rewritten against the real tables. Related: lib/skill-snapshots.ts already summarises soft-skill ratings for /v1/skills/snapshots, so there may be two half-built versions of the same idea.
  2. Profile import — is the feature live? If not, the router should be removed rather than left returning 500s.
  3. Completion nudges — same question, one reference.

Acceptance

Found by the sweep behind #651.

Activity

  1. added
    bug
    needs-design
    on Aug 27, 2026
  2. thinkclay commented on Sep 10, 2026

    @thinkclay
    ContributorAuthor

    Done in #741, with Scaffald/sdk#25 for the retired surface.

    The issue said each of the three needed a decision, not a rename. The deciding evidence turned out to be one question asked three times — does anything reach this? — and the answers split two-to-one.

    table reached by decision
    core.soft_skills_ratings 4 routes, 4 hooks, 13 components (profile radar/comparison/history widgets, rating form, skills-analytics, office job form, discover panes) created — shape read off the router: versioned, append-only self-assessments
    core.profile_import_data 3 routes, 3 hooks, ImportReviewScreen at /profile/resume/review, linked from the drawer created — one staged import per user, 24h expiry stays in the API
    core.profile_completion_nudges 1 route, 1 hook, no component — and the upsert named no onConflict target, so it never worked as one retired

    On the specific questions the issue asked:

    1. Soft skills — a dedicated ratings table was the intent, and the router already fully specified it. lib/skill-snapshots.ts is not a second half-built version: it's pure arithmetic over core.skill_snapshots, which exists.
    2. Profile import — live and reachable. Created.
    3. Nudges — not live. Retired per EPIC: the API addresses a schema that partly does not exist — 45 references, 14 route files #660's method rather than given a table.

    Acceptance

    • soft_skills_ratings: migration 354 · profile_import_data: migration 354 · nudges: router, SDK method and hook removed
    • No route in the three files references a table outside the schema
    • BASELINE_BROKEN loses all three — it is now empty

    Verified, not trusted

    constraints   every CHECK, UNIQUE and FK tried and rejected
    live routes   14/14   scripts/audit/test-658.mjs      (GET /soft: 500 → 200)
    RLS            5/5    scripts/audit/test-658-rls.mjs  (two real sessions via PostgREST)
    schema guard   6/6    baseline empty
    

    One lesson worth leaving here: my first RLS probe emulated JWT claims in psql, which is not how auth.uid() reads them. It printed SET for every assertion — which looks like output and is not an answer. The committed probe uses two real signed-in sessions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-design

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions