The original description is partly stale. There is no connectors.accepted table. connectors.packages already has a UUID primary key and a unique name, and connectors.credentials already has a UUID primary key.
Decision
A connector package's name (for example gitea, telegram) is its catalogue identifier and is immutable. The display label is manifest.display_name. Columns that store the package name stay as they are: judgement.action_types.connector, judgement.decisions.connector, approvals.requests.connector, events.sources.connector, deliveries.messages.channel. Workflows, Cedar rules and channel identity issuers (governance.identity_subjects.issuer, governance.link_codes.issuer) already treat it as permanent.
Replacing them with package_id was rejected:
deliveries.messages.channel also holds the built-in composer channel (modules/deliveries/deliveries.go), which has no package row.
What runs an action is an installation, not a package. Decisions and requests already store installation_id, and connectors.Get and connectors.Tool (modules/connectors/module.go) resolve an installation.
Re-accepting a package with the same name updates the existing row (ON CONFLICT (name) DO UPDATE in modules/connectors/internal/store/store.go). Deleting a package (DELETE FROM connectors.packages in the same file) frees the name; a later package accepted under that name is the same catalogue entry, which is consistent with the rule.
Installation credential slots (connectors.installations.credentials, slot to credential name) stay by name on purpose: the name resolves per scope (person, then organisation, then instance), so an instance installation uses each organisation's own credential of that name. Out of scope here.
Change
Write the rule down. In 00002_connectors.sql, the comment on connectors.packages says name is the immutable package identifier, never renamed and never given to a different package. Put the same sentence on the Connector fields that store it (modules/judgement, modules/approvals, modules/events store structs).
Model providers get an id. In 00001_governance.sql:
governance.model_providers: add id uuid PRIMARY KEY; keep UNIQUE (org_id, name); name becomes an editable label (keep its CHECK).
governance.model_roles.provider text becomes provider_id uuid NOT NULL REFERENCES governance.model_providers (id).
Update modules/governance/internal/store/store.go: the provider list, get, upsert and delete; the role-by-provider query; both role reads that join p.name = r.provider; the role upsert.
The API in modules/governance/models_api.go addresses providers by name: PUT and DELETE /api/settings/model-providers/{name}. Change to POST /api/settings/model-providers (create, returns the id), PUT and DELETE .../{id}, and give the provider view an id. Model role input and view carry provider_id. modules/governance/governance.go builds the provider and role rows (search for store.Provider{ and APIKeyCredential).
Dashboard: ui/src/settings/SystemModelsPage.vue and ui/src/lib/api.ts. Run task openapi:generate.
The provider's API key credential is stored by id. governance.model_providers.api_key_credential text becomes api_key_credential_id uuid (nullable, no foreign key: connectors owns the table).
modules/connectors/credentials.go: add BearerTokenByID(ctx, id uuid.UUID) beside BearerToken(ctx, name). It must refuse a credential the caller's scope can't use: for an organisation's provider, only that organisation's or an instance credential.
modules/governance/governance.go (around the m.credentials.BearerToken(ctx, model.APIKeyCredential) call) uses it.
API and dashboard send and show api_key_credential_id, with the credential's name read from connectors for display. The picker is in SystemModelsPage.vue, which sends api_key_credential as the credential name.
Done when
connectors.packages.name is documented as an immutable identifier in the schema.
governance.model_providers has a UUID primary key, model_roles references it by provider_id, and a provider can be renamed.
model_providers references its credential by api_key_credential_id, and renaming the credential doesn't break the provider.
task check passes.
The original description is partly stale. There is no `connectors.accepted` table. `connectors.packages` already has a UUID primary key and a unique `name`, and `connectors.credentials` already has a UUID primary key.
## Decision
A connector package's `name` (for example `gitea`, `telegram`) is its catalogue identifier and is immutable. The display label is `manifest.display_name`. Columns that store the package name stay as they are: `judgement.action_types.connector`, `judgement.decisions.connector`, `approvals.requests.connector`, `events.sources.connector`, `deliveries.messages.channel`. Workflows, Cedar rules and channel identity issuers (`governance.identity_subjects.issuer`, `governance.link_codes.issuer`) already treat it as permanent.
Replacing them with `package_id` was rejected:
- `deliveries.messages.channel` also holds the built-in `composer` channel (`modules/deliveries/deliveries.go`), which has no package row.
- What runs an action is an installation, not a package. Decisions and requests already store `installation_id`, and `connectors.Get` and `connectors.Tool` (`modules/connectors/module.go`) resolve an installation.
Re-accepting a package with the same name updates the existing row (`ON CONFLICT (name) DO UPDATE` in `modules/connectors/internal/store/store.go`). Deleting a package (`DELETE FROM connectors.packages` in the same file) frees the name; a later package accepted under that name is the same catalogue entry, which is consistent with the rule.
Installation credential slots (`connectors.installations.credentials`, slot to credential name) stay by name on purpose: the name resolves per scope (person, then organisation, then instance), so an instance installation uses each organisation's own credential of that name. Out of scope here.
## Change
1. Write the rule down. In `00002_connectors.sql`, the comment on `connectors.packages` says `name` is the immutable package identifier, never renamed and never given to a different package. Put the same sentence on the `Connector` fields that store it (`modules/judgement`, `modules/approvals`, `modules/events` store structs).
2. Model providers get an id. In `00001_governance.sql`:
- `governance.model_providers`: add `id uuid PRIMARY KEY`; keep `UNIQUE (org_id, name)`; `name` becomes an editable label (keep its CHECK).
- `governance.model_roles.provider text` becomes `provider_id uuid NOT NULL REFERENCES governance.model_providers (id)`.
- Update `modules/governance/internal/store/store.go`: the provider list, get, upsert and delete; the role-by-provider query; both role reads that join `p.name = r.provider`; the role upsert.
- The API in `modules/governance/models_api.go` addresses providers by name: `PUT` and `DELETE /api/settings/model-providers/{name}`. Change to `POST /api/settings/model-providers` (create, returns the id), `PUT` and `DELETE .../{id}`, and give the provider view an `id`. Model role input and view carry `provider_id`. `modules/governance/governance.go` builds the provider and role rows (search for `store.Provider{` and `APIKeyCredential`).
- Dashboard: `ui/src/settings/SystemModelsPage.vue` and `ui/src/lib/api.ts`. Run `task openapi:generate`.
3. The provider's API key credential is stored by id. `governance.model_providers.api_key_credential text` becomes `api_key_credential_id uuid` (nullable, no foreign key: `connectors` owns the table).
- `modules/connectors/credentials.go`: add `BearerTokenByID(ctx, id uuid.UUID)` beside `BearerToken(ctx, name)`. It must refuse a credential the caller's scope can't use: for an organisation's provider, only that organisation's or an instance credential.
- `modules/governance/governance.go` (around the `m.credentials.BearerToken(ctx, model.APIKeyCredential)` call) uses it.
- API and dashboard send and show `api_key_credential_id`, with the credential's name read from `connectors` for display. The picker is in `SystemModelsPage.vue`, which sends `api_key_credential` as the credential name.
## Done when
- `connectors.packages.name` is documented as an immutable identifier in the schema.
- `governance.model_providers` has a UUID primary key, `model_roles` references it by `provider_id`, and a provider can be renamed.
- `model_providers` references its credential by `api_key_credential_id`, and renaming the credential doesn't break the provider.
- `task check` passes.
sam
added the highbug labels 2026-11-23 13:13:57 +00:00
Landed in 26e19f3de. Verified with task check and against a throwaway PostgreSQL 18 instance (baseline migrations 00001-00012, connectors.packages.name immutability comment, model_providers UUID PK + provider_id FK on model_roles, POST /api/settings/model-providers 201 and PUT/DELETE /api/settings/model-providers/{id} with 409 on duplicate name and in-use delete, credential rename resolution by api_key_credential_id, and 400 refusal of person-scoped credentials on org model providers).
Landed in 26e19f3de. Verified with task check and against a throwaway PostgreSQL 18 instance (baseline migrations 00001-00012, connectors.packages.name immutability comment, model_providers UUID PK + provider_id FK on model_roles, POST /api/settings/model-providers 201 and PUT/DELETE /api/settings/model-providers/{id} with 409 on duplicate name and in-use delete, credential rename resolution by api_key_credential_id, and 400 refusal of person-scoped credentials on org model providers).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The original description is partly stale. There is no
connectors.acceptedtable.connectors.packagesalready has a UUID primary key and a uniquename, andconnectors.credentialsalready has a UUID primary key.Decision
A connector package's
name(for examplegitea,telegram) is its catalogue identifier and is immutable. The display label ismanifest.display_name. Columns that store the package name stay as they are:judgement.action_types.connector,judgement.decisions.connector,approvals.requests.connector,events.sources.connector,deliveries.messages.channel. Workflows, Cedar rules and channel identity issuers (governance.identity_subjects.issuer,governance.link_codes.issuer) already treat it as permanent.Replacing them with
package_idwas rejected:deliveries.messages.channelalso holds the built-incomposerchannel (modules/deliveries/deliveries.go), which has no package row.installation_id, andconnectors.Getandconnectors.Tool(modules/connectors/module.go) resolve an installation.Re-accepting a package with the same name updates the existing row (
ON CONFLICT (name) DO UPDATEinmodules/connectors/internal/store/store.go). Deleting a package (DELETE FROM connectors.packagesin the same file) frees the name; a later package accepted under that name is the same catalogue entry, which is consistent with the rule.Installation credential slots (
connectors.installations.credentials, slot to credential name) stay by name on purpose: the name resolves per scope (person, then organisation, then instance), so an instance installation uses each organisation's own credential of that name. Out of scope here.Change
Write the rule down. In
00002_connectors.sql, the comment onconnectors.packagessaysnameis the immutable package identifier, never renamed and never given to a different package. Put the same sentence on theConnectorfields that store it (modules/judgement,modules/approvals,modules/eventsstore structs).Model providers get an id. In
00001_governance.sql:governance.model_providers: addid uuid PRIMARY KEY; keepUNIQUE (org_id, name);namebecomes an editable label (keep its CHECK).governance.model_roles.provider textbecomesprovider_id uuid NOT NULL REFERENCES governance.model_providers (id).modules/governance/internal/store/store.go: the provider list, get, upsert and delete; the role-by-provider query; both role reads that joinp.name = r.provider; the role upsert.modules/governance/models_api.goaddresses providers by name:PUTandDELETE /api/settings/model-providers/{name}. Change toPOST /api/settings/model-providers(create, returns the id),PUTandDELETE .../{id}, and give the provider view anid. Model role input and view carryprovider_id.modules/governance/governance.gobuilds the provider and role rows (search forstore.Provider{andAPIKeyCredential).ui/src/settings/SystemModelsPage.vueandui/src/lib/api.ts. Runtask openapi:generate.The provider's API key credential is stored by id.
governance.model_providers.api_key_credential textbecomesapi_key_credential_id uuid(nullable, no foreign key:connectorsowns the table).modules/connectors/credentials.go: addBearerTokenByID(ctx, id uuid.UUID)besideBearerToken(ctx, name). It must refuse a credential the caller's scope can't use: for an organisation's provider, only that organisation's or an instance credential.modules/governance/governance.go(around them.credentials.BearerToken(ctx, model.APIKeyCredential)call) uses it.api_key_credential_id, with the credential's name read fromconnectorsfor display. The picker is inSystemModelsPage.vue, which sendsapi_key_credentialas the credential name.Done when
connectors.packages.nameis documented as an immutable identifier in the schema.governance.model_providershas a UUID primary key,model_rolesreferences it byprovider_id, and a provider can be renamed.model_providersreferences its credential byapi_key_credential_id, and renaming the credential doesn't break the provider.task checkpasses.Landed in
26e19f3de. Verified with task check and against a throwaway PostgreSQL 18 instance (baseline migrations 00001-00012, connectors.packages.name immutability comment, model_providers UUID PK + provider_id FK on model_roles, POST /api/settings/model-providers 201 and PUT/DELETE /api/settings/model-providers/{id} with 409 on duplicate name and in-use delete, credential rename resolution by api_key_credential_id, and 400 refusal of person-scoped credentials on org model providers).