Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/remove-grants-boot-migrations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

Internal: remove the one-shot typed-grants boot migrations now that production is migrated. No user-facing or API change.
28 changes: 0 additions & 28 deletions ornn-api/src/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ import { wireAdmin } from "./domains/admin/bootstrap";
// per-provider arrays). One-time, idempotent, runs before any
// LlmProvidersService consumer reads from disk.
import { migrateModelCatalogIntoProviders } from "./domains/settings/llmProviders/migration";
import { backfillTypedGrants, renameReadWriteGrantsToWrite } from "./domains/skills/crud/grants.migration";
import { createLlmPickerRoutes } from "./domains/settings/llmProviders/routes";

// OpenAPI spec
Expand Down Expand Up @@ -675,33 +674,6 @@ export async function bootstrap(
),
);

// ---- Typed-grants backfill (#1123) ----
// Fold the legacy read-only `sharedWithUsers` / `sharedWithOrgs` lists into
// the typed `grants` array (every legacy grant → `read` level). One-time,
// idempotent, non-disruptive (legacy lists preserved, nobody escalated to
// write). Runs before any skill/skillset read so the authz gates + scope
// filters can rely on `grants`. Failure is non-fatal: the read-time
// fallback in `effectiveGrants` keeps un-migrated docs authorizing
// correctly off the legacy lists.
await backfillTypedGrants(db).catch((err) =>
logger.error(
{ err: err instanceof Error ? err.message : String(err) },
"typed-grants backfill failed — gates fall back to legacy read lists via effectiveGrants, no data loss",
),
);

// ---- read_write → write grant-level rename (#1127) ----
// The combined `read_write` level was renamed to `write`. Rewrite any
// existing grant carrying the legacy value. Idempotent + non-disruptive
// (write confers what read_write did); `coerceStoredGrants` covers any doc
// not yet rewritten, so failure is non-fatal.
await renameReadWriteGrantsToWrite(db).catch((err) =>
logger.error(
{ err: err instanceof Error ? err.message : String(err) },
"read_write→write rename failed — coerceStoredGrants maps legacy values at read time, no data loss",
),
);

// The picker route — `GET /me/models?surface=...` — reads from the
// per-provider arrays via `LlmProvidersService` (already constructed
// upstream as part of `domains/settings/...`). The section-default
Expand Down
187 changes: 0 additions & 187 deletions ornn-api/src/domains/skills/crud/grants.migration.test.ts

This file was deleted.

137 changes: 0 additions & 137 deletions ornn-api/src/domains/skills/crud/grants.migration.ts

This file was deleted.