Export the Pi provider catalog validator for forked profiles repos #7
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/profiles#7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A deployment that redirects the framework's
profilesinput at its own definitions repo cannot validate its own Pi provider catalog, because this repo exports only the applied result and keeps the validator internal.lib.piProvidersis the validated catalog for this template'spi-providers.json.validatePiProviders— the parameterized function thepi-provider-catalogcheck already drives with sabotage fixtures — is aletbinding and is not exported. A fork therefore has three options, and none of them is good: re-export this template's catalog and give up on holding any provider data of its own; copy the validator into its own flake, where it drifts from the one the check exercises; or expose an unvalidated catalog and lose the contract the framework relies on when it joins provider metadata to credential selection.allod/secretsalready solves the same problem the other way. It exportslib.mkPiCredentialContractbeside the appliedlib.piCredentialsand friends, precisely so a private registry can run the same validation over its own data. The two halves of the Pi join should be symmetric.Proposal
Export the existing binding:
No behavior changes here.
checkedPiProvidersstays the valuelib.piProvidersforces, the sabotage witnesses stay as they are, and the function is already written to be called with an arbitrary catalog — that is how the check feeds it fixtures today.Why it matters now
The framework forces
profiles.lib.piProvidersat composition, so every deployment must supply the attribute. A deployment with real provider data has no supported way to supply a validated one.Notes
Consider whether the validator belongs in a
lib/file rather than inline inflake.nix, the wayallod/secretsfactorslib/pi-credential-contract.nix. That would make the reuse path obvious and keep the flake'sletblock from carrying a hundred lines of schema logic. Either shape closes the gap; the export is the part that matters.Fixed on master in
718c6cf.lib.validatePiProvidersis exported, and the same change replaced the closed-world schema with structural validation — provider ID shape, anhttps://base URL because the provider credential is a bearer token, and a non-empty model list whose entries carry a non-emptyid. Adapter names and model fields now pass through untouched.A deployment fork has since used both halves: its profiles repo holds its own
pi-providers.jsonrun through the exported validator, and the loosening is what made its catalog expressible at all — one of its providers usesapi = "anthropic-messages"withthinkingLevelMapandcompaton its models, none of which the old schema accepted. The reconciler merges provider objects intomodels.jsonverbatim, so nothing downstream needed a matching change.allod/nexusgot the same treatment in itspi-providerregistry validator and--apiflag.