Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

refactor(control-api): brand upsertGrant carrier as DbTransactionClient (dev-sync)

Diego Zacariase98eb4632955
diff --git a/control-api/package-lock.json b/control-api/package-lock.json
index 7050daece..27c17a377 100644
--- a/control-api/package-lock.json
+++ b/control-api/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-control-api",
- "version": "0.1.465",
+ "version": "0.1.466",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-control-api",
- "version": "0.1.465",
+ "version": "0.1.466",
"dependencies": {
"@clerum/display-field": "file:../packages/display-field",
"@clerum/image-policy": "file:../packages/image-policy",
diff --git a/control-api/package.json b/control-api/package.json
index b9afbbacb..4c7396687 100644
--- a/control-api/package.json
+++ b/control-api/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-control-api",
- "version": "0.1.465",
+ "version": "0.1.466",
"description": "Internal Clerum control plane REST API + UI for managing CRDs and secrets",
"main": "dist/main.js",
"engines": {
diff --git a/control-api/src/services/pluginWorkloadSdkDb.ts b/control-api/src/services/pluginWorkloadSdkDb.ts
index e9a602df9..dc823222a 100644
--- a/control-api/src/services/pluginWorkloadSdkDb.ts
+++ b/control-api/src/services/pluginWorkloadSdkDb.ts
@@ -531,7 +531,9 @@ export async function upsertGrant(
// the model locks (global order: `llm-model:*` before `plugin_workload_sdk:*`)
// and the enabled-ness revalidation + the write commit atomically. Every other
// caller passes no `db` and gets its own transaction, exactly as before.
- db?: DbClient
+ // The carrier MUST be a real transaction session (branded, issue #375 M3):
+ // it holds the advisory locks and `notifyGrantUpdate` refuses `pool`.
+ db?: DbTransactionClient
): Promise<PluginWorkloadSdkGrant> {
if (db) return upsertGrantInTransaction(params, operatorSub, db)
return withTransaction(inner => upsertGrantInTransaction(params, operatorSub, inner))
@@ -540,7 +542,7 @@ export async function upsertGrant(
async function upsertGrantInTransaction(
params: UpsertGrantParams,
operatorSub: string,
- db: DbClient
+ db: DbTransactionClient
): Promise<PluginWorkloadSdkGrant> {
{
// All capability families for a recipe share one lock. A family-scoped