Add validated Pi provider catalog contract #6
No reviewers
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/profiles!6
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/pi-provider-catalog"
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?
This adds the public, data-only contract for custom Pi provider metadata.
The checked-in catalog is empty, so this PR changes no running machine.
Consumers receive one normalized and consumption-time-validated export.
The named check accepts a complete synthetic provider and independently rejects invalid endpoint and empty-name sabotage.
If the contract is wrong, revert this PR before dependent slices are pinned.
What changes
pi-providers.jsoncatalog owned by profiles.lib.piProviders.apitoopenai-completions.Risk
R3 contract slice: later secrets and archetypes changes consume this cross-repository interface. This PR carries no credentials, targets, recipient keys, or live provider values, and the empty catalog has no generated runtime effect.
Validation
nix eval .#lib.piProviders --jsonnix build .#checks.x86_64-linux.pi-provider-catalog --print-build-logs --no-linknix build .#checks.x86_64-linux.profile-contract-shape --print-build-logs --no-linknix flake check -Lgit diff --check origin/master...HEADThe Pi catalog check forces the committed export, validates a full synthetic provider including default normalization, and proves the same production validator independently rejects a malformed endpoint port and an explicitly empty model name.
Refs allod/strategy#34
Implementation review found two medium contract defects in
f890d1b:https://:and non-numeric ports, and POSIX whitespace matching does not reject every raw Unicode whitespace character.nameand positivemaxTokens, instead of checking their declared string/integer types.I will tighten the URL grammar to an ASCII HTTPS authority/path and relax those two optional fields to type-only validation, then extend the existing valid/sabotage witness through the same production validator.
Addressed both review findings in
3341a7f:nameandmaxTokensnow enforce only their approved string/integer types. The valid synthetic fixture exercises the empty-string and zero boundaries.Revalidated:
nix eval .#lib.piProviders --jsonnix build .#checks.x86_64-linux.pi-provider-catalog --print-build-logsnix build .#checks.x86_64-linux.profile-contract-shape --print-build-logsgit diff --check origin/master...HEADCross-repository review found one medium compatibility defect at
3341a7f:flake.nixacceptsmodels[].name = "", and the positive fixture explicitly depends on that boundary, while Pi 0.84.2's loaded model schema requires a non-empty name. The archetypes consumer projects the catalog value unchanged, so this catalog can pass profiles validation and then fail when Pi loads the generated configuration.The fix is to keep
nameoptional but require a non-empty string when present, replace the positive empty-name fixture, and add a dedicated empty-name sabotage witness through the production validator so an unrelated invalid field cannot mask a regression.Resolved in
9d48e43.models[].namenow rejects the empty string with a contract-specific error while remaining optional.validatePiProvidersand must fail independently of the existing malformed-endpoint sabotage.Revalidated with
nix eval .#lib.piProviders --json, both named check builds,nix flake check -L, andgit diff --check origin/master...HEAD.