feat: fail-closed envelope + Core-authoritative routing + proxy enforcement - #42
Merged
Merged
Conversation
…(gap5) Gap1: Default Core-authoritative routing - Added requireCoreDecision config option (default true = fail closed) - When true: missing Core decision returns 503, no heuristic fallback - When false: explicit compatibility opt-out enables heuristic routing - Heuristic routing (evaluateTier, buildDynamicLadder, Q-learning) isolated behind opt-out - Tests in tests/router.test.ts for missing/unavailable/malformed/denied/valid Core decisions Gap5: Proxy envelope enforcement - Import and compose enforceExecutionEnvelope() in LlmGateNode.proxy() - Validates Core execution envelope before any upstream fetch in both JSON and SSE paths - Enforcement only when envelope available (Core decision fetched) - When requireCoreDecision=false (compatibility), no envelope exists and enforcement is skipped - Reuses forwarder's enforcement logic, no duplication - Error codes: envelope_missing, envelope_invalid, envelope_expired, envelope_tampered, model_disallowed, tool_disallowed, budget_exceeded Verification: 190 tests pass, typecheck clean, format clean, build clean, package verified
7 tasks
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
Combines fail-closed envelope enforcement with Core-authoritative routing and proxy envelope enforcement.
Changes
Fail-closed envelope enforcement:
Core-authoritative routing (gap1):
Proxy envelope enforcement (gap5):
Verification
All local gates pass: npm test (190 pass), typecheck, format:check, build, verify:package, pack:dry-run, git diff --check
Related
Addresses Node #30 gaps 1, 2, 3, 5. Gaps 4/6 blocked by Core #220.