Enforce proxy budgets#322
Merged
Merged
Conversation
Ratifies the policy-plane design (the #306 convergence gate) so #307 (the PolicyEvaluator hook interface) and #308 (the compiled rules artifact) build against a fixed contract: an optional PolicyEvaluator consulted over HTTP (nil = bit-identical passthrough), the five interception points, the {OpenAI,Anthropic}x{plain,managed}x{stream,non-stream} hook-order matrix and its two invariants (managed mode is always non-stream upstream so it is always hard-gateable; plain+stream is the only true streaming egress -> gate-before- stream + score-on-complete), governor-principal non-recursion via a policy_exempt metadata flag, the four-hook contract, CLLAMA_POLICY_* config, and v1-vs-deferred scope. Records #310 budget enforcement as the first concrete enforcement, shipped in cllama core independent of the policy plane. Design only; #307/#308 implementation deferred.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
x-claw.budget/x-claw.budget-defaultsparsing, validation, inheritance, and compiled cllama metadatafleet.budget.setcllamav0.7.4, and add docs, changelog, and a Docker spike exampleCloses #310
Verification
go test ./internal/infraimages ./cmd/claw-api ./internal/pod ./cmd/clawgo run ./scripts/check-release-infra-tags --release-tag v0.23.1npm run buildinsite/go test ./...go vet ./...go test ./...incllama/go vet ./...incllama/git diff --check -- . ':!cllama' && git -C cllama diff --checkgo test -tags spike -run TestSpikeBudgetEnforcementAndOverride -count=1 -timeout 10m ./cmd/clawdocker buildx imagetools inspect ghcr.io/mostlydev/cllama:v0.7.4->sha256:8fbbb17904a1900175859fe817ad45651f6adfcbbbd12b4d85ada39c1634c40eCloses #306 (ADR-025 policy plane architecture ratified; #307/#308 hook implementation deferred).