Repository navigation
[WIP] Implement shared scoped eligibility decisions and refresh re-evaluation - #10878
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
| model: decision.identity?.key, | ||
| scope: decision.scope, | ||
| reasons: decision.reasons.filter(reason => reason.code.startsWith('harness_')).map(reason => ({ | ||
| ...reason, |
There was a problem hiding this comment.
Addressed in b8d2eee: buildEligibilityError now constructs an explicit client-facing field allowlist rather than spreading reason objects. Provenance is excluded, and shared URL sanitization also drops pathname/query/credentials. The real HTTP ingress regression asserts that internal provenance hostnames and revision values are absent from the returned error. I am running the full local validation suites on the latest code.
Agent-Logs-Url: https://github.com/github/gh-aw-firewall/sessions/39bb6d5c-feec-4ae5-b11b-7cf97937e6cb Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
@copilot address all review feedback |
Addressed in |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Query-string decoys can bypass model eligibility checks in both HTTP and WebSocket requests, allowing constrained models to pass through unchecked.
5 open issues
Restrict path model extraction to the URL pathname · New Cache discovery identity keys to avoid quadratic evaluation · New Match discovery evidence to the trusted eligibility scope · New Avoid recording rejections for unmatched fallback models · New Check default-alias rejection when the model is missing · New
What changed in this PR
Introduces a shared, scoped model-eligibility boundary for AWF’s host validation and API proxy, advancing ADR 0004 Phase 4 while leaving environment observation producers and remote constraint activation for later work.
Changes:
- Adds version-constraint evaluation, structured evidence diagnostics, and immutable request snapshots.
- Integrates eligibility with explicit requests, selectors, routing, fallback, recovery, and visible WebSocket handshake models.
- Packages shared contracts and generated projections, adds regression coverage, and documents remaining handoffs.
| File | Description |
|---|---|
src/model-information.eligibility.generated.json |
Adds the host harness-constraint projection. |
src/model-information-eligibility.test.ts |
Tests scope, version rules, evidence, and snapshots. |
src/model-information-contract/eligibility.js |
Packages the shared runtime for host use. |
src/model-information-contract/eligibility.d.ts |
Packages host eligibility types. |
src/copilot-model.ts |
Applies eligibility during CLI model validation. |
src/copilot-model.test.ts |
Tests CLI constraints and pinned evidence. |
shared/model-information/eligibility.js |
Implements eligibility decisions and evidence snapshots. |
shared/model-information/eligibility.d.ts |
Defines requirements, observations, and decision contracts. |
scripts/model-information/compile.test.ts |
Checks generated projections and standalone packaging. |
scripts/model-information/compile.cjs |
Generates host and proxy eligibility assets. |
docs/adr/0004-model-information-management.md |
Documents semantics, integrations, and remaining handoffs. |
containers/api-proxy/websocket-proxy.js |
Pins evidence and identifies visible handshake models. |
containers/api-proxy/websocket-guards.test.js |
Covers opaque handshake compatibility. |
containers/api-proxy/websocket-guards.js |
Adds handshake harness admission checks. |
containers/api-proxy/upstream-http.js |
Filters fallback attempts through eligibility. |
containers/api-proxy/server-factory.js |
Pins evidence at HTTP and upgrade ingress. |
containers/api-proxy/routing-runtime.js |
Passes trusted eligibility dependencies into routing. |
containers/api-proxy/routing-provider-executor.js |
Preserves snapshots through classification and final checks. |
containers/api-proxy/routing-controller.test.js |
Tests snapshot consistency across routing retries. |
containers/api-proxy/routing-controller.js |
Shares one snapshot throughout routing decisions. |
containers/api-proxy/routing-candidates.js |
Filters routing candidates by eligibility. |
containers/api-proxy/proxy-request.js |
Pins eligibility before HTTP processing. |
containers/api-proxy/proxy-guards.js |
Adds explicit-request harness rejection. |
containers/api-proxy/model-selector.js |
Attaches eligibility decisions to selector results. |
containers/api-proxy/model-resolver.js |
Filters automatic candidates and records rejections. |
containers/api-proxy/model-recovery.js |
Integrates availability and recovery candidate decisions. |
containers/api-proxy/model-information.eligibility.generated.json |
Adds the proxy harness-constraint projection. |
containers/api-proxy/model-identity.js |
Accepts scoped identity-resolution options. |
containers/api-proxy/model-eligibility.js |
Adapts shared evidence, scope, and diagnostics for proxy consumers. |
containers/api-proxy/model-eligibility.integration.test.js |
Exercises consumers, refresh behavior, and request pinning. |
containers/api-proxy/model-config.js |
Applies pinned evidence during model transformations. |
containers/api-proxy/model-body-rewriter.js |
Propagates eligibility context and decisions. |
containers/api-proxy/Dockerfile |
Includes eligibility runtime and generated assets. |
containers/api-proxy/cross-provider-fallback.js |
Preserves pinned evidence and catalogue context. |
containers/api-proxy/catalogue-contract/eligibility.js |
Packages the shared runtime for standalone proxy use. |
containers/api-proxy/catalogue-contract/eligibility.d.ts |
Packages proxy eligibility type declarations. |
Review effort: Max (auto)
| } | ||
|
|
||
| const eligibilityModel = checkModelMultiplier | ||
| ? getRequestModel(null, req.url) || getRequestModel(body, req.url) |
| const records = req.awfRuntimePricing?.[provider] || []; | ||
| const available = identity && records.some(record => | ||
| resolveModelIdentity(record.id, provider, { scope: consumerScope, policy: { providerPrefix: false } }).identity?.key === identity.key); |
| status: unavailable ? 'unavailable' : 'unknown', authoritative: unavailable === true, | ||
| scope: { provider, channel: provider === 'copilot' ? 'copilot-api' : 'native-api' }, |
| [currentProvider]: providerModels.filter(m => | ||
| _isModelPermittedByPolicy(m, modelPolicyConfig, currentProvider) && | ||
| _isModelHarnessPermitted(m, currentProvider, resolutionState)), |
| const eligibilityModel = checkModelMultiplier | ||
| ? getRequestModel(null, req.url) || getRequestModel(body, req.url) | ||
| : null; |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
@copilot address the review feedback |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 Smoke CodexOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅
|
|
🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅
|
|
🔌 Smoke Services — All services reachable! ✅
|
|
✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓
|
|
✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓
|
|
OTEL smoke test
|
|
Services smoke test: FAIL
|
|
Smoke Test (Copilot)
Overall: PASS —
|
|
Cloud Hypervisor + Copilot smoke test
Overall: PASS
|
Smoke Test: Copilot BYOK (Direct) Mode ✅Tests: All passing
Status: PASS | Direct BYOK mode active (COPILOT_PROVIDER_API_KEY) /cc @lpcox
|
🏗️ Build Test Suite Results
Overall: 7/8 ecosystems passed — FAIL Java failure details: Maven could not use .NET needed
|
|
EGRESS_RESULT allow=pass deny=pass
Overall: PASS — cc @lpcox
|
Chroot version comparison
Node.js differs between host and chroot, so the tests did not all pass and the
|
|
✅ MCP / GitHub.com / File / BYOK tests all passed
|
Smoke Claude Results
Overall result: PASS
|
Smoke Test
|


Summary
Validation
Remaining handoff
838487bd693c0b18f23751d280387221a3e07230, review the results, and resolve the addressed provenance-disclosure thread.