Skip to content

chore(deps): point the four catalog'd devtools at the catalog - #22

Merged
thinkclay merged 1 commit into
mainfrom
fix/catalog-align-devtools
Sep 10, 2026
Merged

thinkclay merged 1 commit into
mainfrom
fix/catalog-align-devtools

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

@supabase/supabase-js already reads catalog: here. tsx, tsup, typescript and vitest are in the workspace catalog too — but this manifest declared its own, looser ranges, every one free to float above the pinned version:

package catalog this manifest installed
tsx ~4.19.3 ^4.7.0 4.22.3 ← above the catalog
tsup ~8.5.1 ^8.5.1 8.5.1
typescript ~5.9.3 ^5.3.3 5.9.3
vitest ~4.1.10 ^4.0.18 4.1.10

Three land on the catalog version by luck. tsx does not, and has not for a while — 4.22.3 does not satisfy ~4.19.3, so for the hoisted copy the catalog entry was decorative. That is the same shape as the override/catalog drift check-override-catalog-alignment.mjs exists to catch, one level over.

Where the cost lands

In the parent repo. packages/ai-pipeline asks for catalog: and gets 4.19.4; this asks for ^4.7.0 and gets 4.22.3. The lockfile carries both, and pnpm dedupe --check — which Monorepo integrity runs — fails on the split.

It only surfaces on a PR that touches a package.json, because that check is gated on the deps paths filter. So it has been sitting on main unseen, and the first unrelated PR to edit a manifest inherits the failure. (That is how I found it: Scaffald/SaaS#725 adds a lint script and nothing else, and went red on Monorepo integrity.)

Result

With all four on catalog::

  • tsx resolves to 4.19.4
  • the lockfile loses the duplicate — 67 insertions, 68 deletions
  • pnpm dedupe --check exits 0

Nothing else moves; the other three were already resolving to their catalog version, so pinning them is a no-op today and stops the same drift tomorrow.

Verified after the change: sdk builds clean, 780 tests across 36 files pass.

`@supabase/supabase-js` already reads `catalog:` here. `tsx`, `tsup`,
`typescript` and `vitest` are in the workspace catalog too, but this manifest
declared its own looser ranges — every one of them free to float above the
pinned version:

    package          catalog     this manifest   installed
    tsx              ~4.19.3     ^4.7.0          4.22.3   <- above the catalog
    tsup             ~8.5.1      ^8.5.1          8.5.1
    typescript       ~5.9.3      ^5.3.3          5.9.3
    vitest           ~4.1.10     ^4.0.18         4.1.10

Three land on the catalog version by luck. tsx does not, and has not for a
while: 4.22.3 does not satisfy ~4.19.3, so for the hoisted copy the catalog
entry was decorative — the same shape as the override/catalog drift that
scripts/check-override-catalog-alignment.mjs exists to catch, one level over.

The cost lands in the parent repo. `packages/ai-pipeline` asks for `catalog:`
and gets 4.19.4; this asks for `^4.7.0` and gets 4.22.3; the lockfile carries
both, and `pnpm dedupe --check` — which Monorepo integrity runs — fails on the
split. It only shows up on a PR that touches a package.json, because that check
is gated on the deps paths filter, so it has been sitting on main unseen.

With all four on `catalog:`, tsx resolves to 4.19.4, the lockfile loses the
duplicate (67 insertions, 68 deletions) and `pnpm dedupe --check` exits 0.
Nothing else moves: the other three were already resolving to the catalog
version. Verified after the change — sdk builds, and 780 tests across 36 files
pass.

Co-Authored-By: Claude Opus 5 <[email protected]>
@thinkclay
thinkclay merged commit 1291ef2 into main Sep 10, 2026
@thinkclay
thinkclay deleted the fix/catalog-align-devtools branch September 10, 2026 20:11
thinkclay added a commit to Scaffald/SaaS that referenced this pull request Sep 10, 2026
Scaffald/sdk#22 points sdk's tsx/tsup/typescript/vitest at the workspace
catalog. Only tsx actually moves: it declared `^4.7.0` and resolved to 4.22.3,
which does not satisfy the catalog's `~4.19.3`, so the lockfile carried both
that and the 4.19.4 that packages/ai-pipeline gets through `catalog:`.

`pnpm dedupe --check` — what Monorepo integrity runs — fails on that split. It
is invisible on main because the check is gated on the deps paths filter, so
only a PR touching a package.json ever runs it, and this PR's two-line script
addition was the first in a while.

tsx now resolves to 4.19.4 and `pnpm dedupe --check` exits 0.

Co-Authored-By: Claude Opus 5 <[email protected]>
thinkclay added a commit to Scaffald/SaaS that referenced this pull request Sep 10, 2026
…top search_path drifting (#725)

* fix(db): grant service_role the eight tables it could not read, and stop search_path drifting

Two grant/definition gaps, both reproduced against a live database before and
after.

**#481 — eight core tables service_role cannot read.** `service_role` is the
bypass-everything role, and edge-function code reaches for the service client
whenever it needs to read past RLS. These eight were readable by
`authenticated` (three also by `anon`) and not by `service_role` at all, so that
client got a GRANT error — which fires before RLS is even evaluated:

    { code: "42501", message: "permission denied for table soft_skills" }

All eight have RLS enabled with policies already written, so it is the same
omission migrations 332 (api_keys) and 335 (scheduling) fixed: the policies were
authored, the table-level GRANTs beneath them were not. A policy cannot widen
access past an absent GRANT.

`core.soft_skills` is the clearest case — public reference data seeded by
migration 001, with a public-read policy for anon and authenticated. It is also
where this bit: GET /v1/profiles/:username had to resolve skill names with the
caller's client because the service client could not read the catalog (see
`resolveSkillNames`, #464).

Migration 352 grants service_role only. anon and authenticated are untouched,
verified after: soft_skills and portfolio_items still anon+authenticated,
archetypes still authenticated. The issue's own detection query now returns
nothing.

**#468 — ten functions with no search_path.** Migration 308 set one on every
owned function in core/data/community/onet/public. Ten had none, because
migrations 314-325 created them after 308 ran. Nine are trigger functions plus
core.tasks_handle_completion, so today's risk is low — but a function without an
explicit search_path resolves unqualified names against whatever the caller's
search_path happens to be, and "it is only a trigger function" is not a property
that stays true.

Migration 353 sets them, as explicit ALTERs against real signatures rather than
another positional DO-sweep. A sweep is one-shot by construction — it covers
what exists when it runs and nothing after — which is exactly how these drifted
unnoticed for eleven migrations. The count the issue asks about is now 0.

**The half that matters more:** scripts/check-migrations.mjs, wired into
`pnpm lint` and prepush, fails the build when a migration above 353 creates a
function without a search_path. So there is no twelfth.

It is exercised rather than assumed — the first version was decorative. Its
regex read `(?:or\s+replace\s+)+?`, requiring at least one occurrence, so a
plain `CREATE FUNCTION` (the usual form for a new function, and the only form
this guard exists to catch) passed straight through. Caught by probing it with a
deliberate offender instead of trusting a green run over zero files. Now
verified against five cases: plain CREATE without a path fails, CREATE OR
REPLACE without a path fails, a path in the header passes, a path mentioned only
in the body fails, and a function in an unowned schema is out of scope.

The same script also fails on two migrations sharing a number. That is not
hypothetical either: #723 landed 351_drop_redundant_review_link_policies.sql
while this branch was writing its own 351, and git merges both files without a
conflict — leaving migration order to whatever the filesystem returns. Mine are
renumbered to 352 and 353.

Closes #481
Closes #468

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

* chore(deps): bump the sdk pointer to collapse the tsx duplicate

Scaffald/sdk#22 points sdk's tsx/tsup/typescript/vitest at the workspace
catalog. Only tsx actually moves: it declared `^4.7.0` and resolved to 4.22.3,
which does not satisfy the catalog's `~4.19.3`, so the lockfile carried both
that and the 4.19.4 that packages/ai-pipeline gets through `catalog:`.

`pnpm dedupe --check` — what Monorepo integrity runs — fails on that split. It
is invisible on main because the check is gated on the deps paths filter, so
only a PR touching a package.json ever runs it, and this PR's two-line script
addition was the first in a while.

tsx now resolves to 4.19.4 and `pnpm dedupe --check` exits 0.

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.

1 participant