Repository navigation
Conversation
thinkclay
force-pushed
the
claude/660-schema-refs
branch
2 times, most recently
from
September 2, 2026 06:17
1e40910 to
d5dab1b
Compare
…in no schema
`GET /v1/profiles/employers/{slug}` has never returned a response. It queried
`core.employers`, and information_schema has no `employers` table in any schema
and no `employer_id` column anywhere in `core` — the route was written against
a schema that does not exist, not one that drifted. The handler also counted
jobs by `employer_id`, so there was nothing to repair toward.
`employer` in this product is an organization: `core.organizations` carries
`owner_user_id`, and `core.jobs.organization_id` is the real FK.
`GET /v1/profiles/organizations/{slug}` already does what this route appears to
want, and works (#617).
Deleted: the route, the SDK's `EmployerProfile` / `profiles.getEmployer` /
`useEmployerProfile` (Scaffald/sdk#21, pointer bumped here), the scf-core
wrapper hook and its re-export, and the five Deno tests plus the
`createTestEmployerProfile` helper that inserted into `core.employers`.
`core.employers` is dropped from BASELINE_BROKEN — with the route gone the
entry is stale, and the reference test fails on a stale entry rather than
letting it rot.
BREAKING CHANGE: `GET /v1/profiles/employers/{slug}` is gone, along with
`profiles.getEmployer`, `useEmployerProfile` and `EmployerProfile`. It never
returned a response, so no working behaviour is removed. Use
`GET /v1/profiles/organizations/{slug}` and `useOrganizationProfile`.
Closes #618
Co-Authored-By: Claude Opus 5 <[email protected]>
thinkclay
force-pushed
the
claude/618-665-dead-routes
branch
from
September 2, 2026 06:18
92c2ea3 to
2722855
Compare
…le at all Every /v1/feedback endpoint failed for any client, for two independent reasons (#665): 1. PostgREST does not serve the `logs` schema. config.toml exposes auth, public, core, storage, data, onet, engagement and community. 2. logs.user_feedback granted only `postgres` — no service_role, no authenticated. Same class as #481 and #654. Migration 350 takes the smaller of the two routes offered in the issue: move the table rather than expose a ninth schema. That keeps the exposed-schema list stable across all three environments, and core is already the convention for user-scoped data. `logs` held nothing else. The table is empty, so nothing is migrated but the definition. SET SCHEMA carries its indexes, constraints, RLS setting and all three policies, which were already correct and role-scoped — select/insert to authenticated on `user_id = auth.uid()`, ALL to service_role. What was missing was never the policies but the grants beneath them: a policy cannot widen access past an absent GRANT, which is why even service_role could not read it. Verified against the running stack. Before, PostgREST answered "Could not find the table in the schema cache". Now it resolves the table and answers 42501 for `anon` — which is the correct outcome, since feedback requires auth and only authenticated and service_role are granted. As `authenticated`, the count runs. The CCPA data summary counts platform feedback again. #663 left it out of the Communications category rather than reporting a silent zero in a statutory disclosure; with the table reachable, the category is "Reviews, platform feedback" and its count includes both. Closes #665 Co-Authored-By: Claude Opus 5 <[email protected]>
thinkclay
force-pushed
the
claude/618-665-dead-routes
branch
from
September 2, 2026 06:19
2722855 to
ca124a6
Compare
4 tasks
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.
Both of these are routes that have never worked, for the same underlying reason as the rest of #660: the code addresses a schema that isn't there.
#618 — delete
GET /v1/profiles/employers/{slug}It queried
core.employers:No
employerstable in any schema, noemployer_idcolumn anywhere incore. The handler also counted jobs byemployer_id. There was nothing to repair toward — this was written against a schema that does not exist, not one that drifted.employerin this product is an organization:core.organizationscarriesowner_user_id,core.jobs.organization_idis the real FK, andGET /v1/profiles/organizations/{slug}already does the job (repaired in #617).Deleted: the route; the SDK's
EmployerProfile,profiles.getEmployeranduseEmployerProfile(Scaffald/sdk#21, merged, pointer bumped here); thescf-corewrapper hook and its re-export; and the five Deno tests plus thecreateTestEmployerProfilehelper that inserted intocore.employers.Why nothing caught this. The SDK tests mocked
/v1/profiles/employers/:slugin msw and asserted against the mock, so they were green for the entire life of an endpoint that 500s. A mock of an endpoint that cannot exist proves only that the client can parse an object someone made up.core.employersis dropped fromBASELINE_BROKEN— with the route gone the entry is stale, and the reference test fails on stale entries rather than letting them rot.BREAKING CHANGE. The endpoint,
profiles.getEmployer,useEmployerProfileandEmployerProfileare gone. Since it never returned a response, no working behaviour is removed.#665 — move
logs.user_feedbacktocore.user_feedbackEvery feedback endpoint failed for any client, for two independent reasons:
logsschema (config.tomlexposes auth, public, core, storage, data, onet, engagement, community).postgres— noservice_role, noauthenticated. Same class as fix(db): 8 core tables grant SELECT to authenticated but not service_role #481 and core.review_links grants only postgres — both review-link endpoints 500 #654.Migration
350takes the smaller of the two routes the issue offered: move the table rather than expose a ninth schema. That keeps the exposed-schema list stable across all three environments, andcoreis already the convention for user-scoped data.logsheld nothing else.The table is empty, so nothing migrates but the definition.
SET SCHEMAcarries indexes, constraints, the RLS setting and all three policies — which were already correct:What was missing was never the policies but the grants beneath them. A policy cannot widen access past an absent GRANT, which is why even
service_rolecould not read it.Verified against the running stack
core.user_feedbackanon42501 permission denied— correct, feedback requires authauthenticatedCCPA
GET /v1/ccpa/data-summarycounts platform feedback again. #663 deliberately left it out of the Communications category rather than report a silent zero in a statutory disclosure; with the table reachable, the category is now "Reviews, platform feedback" and its count includes both.Closes #618
Closes #665