Skip to content

Apply directed compatibility contracts to fallback decisions and /reflect diagnostics - #11328

Merged
lpcox merged 14 commits into
mainfrom
copilot/feat-apply-directed-compatibility-contracts
Nov 8, 2026
Merged

lpcox merged 14 commits into
mainfrom
copilot/feat-apply-directed-compatibility-contracts

Conversation

Copilot AI commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Assess captured requests against concrete directed request/return translation plans and exact-model reasoning evidence before applicable automatic inference attempts. Skip incompatible or unverified candidates without changing candidate order, policy/eligibility/budget authority, primary direct requests, or translator behavior.
  • Enforce admission across ordered fallback, catalogue recovery, synthesized resolver replacement, alias endpoint recovery, and alternate wire-endpoint retry. Preserve request-scoped endpoint/reasoning pins and explicitly authorized normalizations, including the Messages missing-limit default.
  • Project sanitized accepted/skipped/exhausted compatibility and shared reasoning decisions into the existing bounded /reflect history, preserving origin/candidate attribution, scope isolation, retention, public exhaustion envelopes, and permanent-rejection guidance.
  • Preserve same-provider Gemini/Vertex native generateContent and streamGenerateContent passthrough. Initial resolver fallbacks now reject unimplemented endpoints rather than treating an unchanged unknown path as verified native compatibility. Primary direct-request behavior remains unchanged.
  • Add provider-free actual-dispatch/reflection, nested-condition, translator-drift, and shipped-layout regressions; document tightened automatic-fallback policy and remaining native/enclave coverage boundaries.

Fixes #11327.

Validation

Published HEAD: b02961486e4a653ae735e6cd43201f3f22d423db.

  • cd containers/api-proxy && npm test -- --runInBand: 153 suites passed; 3,882 tests passed, 2 skipped. Includes fallback, translator, reasoning, management/diagnostics, accounting, and actual Docker-COPY-layout tests.
  • npm run build, npm run lint, npm run type-check, npm run models:check, changed-document Markdown lint, and git diff --check: passed. Root lint reports existing warnings, with zero errors.
  • Reproduced four unknown-endpoint resolver cases failing before the follow-up fix and passing afterward; supported Gemini/Vertex streaming/nonstreaming and unchanged direct requests are covered.
  • Full npm test -- --runInBand: 549 suites passed, 20 failed, 10 skipped; 12,426 tests passed, 218 failed, 273 skipped. This is not a green root run. Failures are in unchanged root sources/tests on macOS, including Linux /proc/self/fd and /dev/fd directory assumptions, symlink-safe evidence staging, host-platform prerequisites, shell tooling, and enclave socket/timing fixtures. All src/ and scripts/ files are unchanged from the PR merge base; no unrelated fixes or weakened assertions were introduced.

Review and CI handoff

No submitted reviews, review threads, or top-level feedback were present at triage. The PR was mergeable without conflicts; it is not merged and auto-merge is not enabled.

Current-head CI is unverified. Prior Actions runs were action_required with no jobs or failure logs available; the only reported check was successful license compliance. A maintainer must approve applicable Actions runs and verify CI for the published HEAD, then review the changes before merge. No workflows or live inference were dispatched for this work. Docker/KVM/live-runner validation was not performed locally.

Preserve recognized Gemini/Vertex inference paths and unchanged primary requests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-11328 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit c78ae3b

@lpcox lpcox changed the title [WIP] Apply directed compatibility contracts to fallback decisions and /reflect diagnostics Apply directed compatibility contracts to fallback decisions and /reflect diagnostics Nov 8, 2026
@lpcox
lpcox marked this pull request as ready for review November 8, 2026 22:10
Copilot AI adaptive review requested due to automatic review settings November 8, 2026 22:10
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 93.82% 93.81% ➡️ -0.01%
Statements 92.36% 92.36% ➡️ +0.00%
Functions 93.02% 93.02% ➡️ +0.00%
Branches 86.70% 86.69% 📉 -0.01%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/one-shot-process.ts 84.0% → 81.5% (-2.47%) 76.8% → 74.7% (-2.11%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An uncaught compatibility-assessment exception during alias recovery can terminate the sidecar and interrupt other requests.

7 open issues
What changed in this PR

This PR connects directed compatibility contracts to AWF’s API proxy fallback admission and /reflect diagnostics, without expanding translator support.

Changes:

  • Assess captured request semantics, endpoint plans, and exact-model reasoning before automatic fallback attempts.
  • Add sanitized compatibility and reasoning decisions to the existing bounded /reflect history.
  • Add dispatch, native-passthrough, pinning, translator-drift, and packaging regressions; document the tightened fallback policy.
File Description
docs/​api-proxy-sidecar.md Documents admission policy, diagnostics, and coverage boundaries.
containers/​api-proxy/​upstream-retry.test.js Tests permanent endpoint-rejection retry behavior.
containers/​api-proxy/​upstream-retry.js Preserves endpoint-error envelopes and prevents transient retry loops.
containers/​api-proxy/​upstream-http.test.js Updates reasoning-rejection expectations to pre-dispatch skips.
containers/​api-proxy/​upstream-http.js Integrates compatibility assessment across upstream fallback paths.
containers/​api-proxy/​upstream-http.compatibility.test.js Covers dispatch admission, candidate order, and request pins.
containers/​api-proxy/​server.model-recovery.test.js Exercises initial recovery admission and exhaustion.
containers/​api-proxy/​server.model-not-supported.test.js Updates endpoint compatibility-error expectations.
containers/​api-proxy/​server.model-fallback-chain.test.js Verifies Gemini and Vertex native fallback preservation.
containers/​api-proxy/​server.cross-provider-fallback.test.js Tests skipping lossy cross-provider translations.
containers/​api-proxy/​proxy-request.js Captures the concrete target for reasoning assessment.
containers/​api-proxy/​protocol-compatibility/​assessment.js Adds bounded request and translation-plan assessment.
containers/​api-proxy/​protocol-compatibility.packaging.test.js Exercises admission and reflection in the shipped layout.
containers/​api-proxy/​protocol-compatibility-assessment.test.js Covers request conditions, bounds, and implementation drift.
containers/​api-proxy/​model-resolver.js Tracks automatic replacement provenance.
containers/​api-proxy/​model-resolver-fallback.test.js Tests synthesized versus explicitly authorized selections.
containers/​api-proxy/​model-recovery.js Applies compatibility and reasoning admission during recovery.
containers/​api-proxy/​model-decision-reflection.test.js Verifies production fallback decisions reach /reflect.
containers/​api-proxy/​model-decision-observation.test.js Tests sanitization, isolation, attribution, and retention.
containers/​api-proxy/​model-decision-observation.js Captures explicit production decisions for bounded history.
containers/​api-proxy/​model-decision-diagnostics.test.js Adjusts observer fixtures for target-scope checks.
containers/​api-proxy/​model-decision-diagnostics.schema.json Defines additive compatibility and reasoning fields.
containers/​api-proxy/​model-decision-diagnostics.js Sanitizes and projects captured decisions and guidance.
containers/​api-proxy/​model-config.js Pins synthesized resolver-fallback metadata.
containers/​api-proxy/​model-body-rewriter.js Propagates automatic replacement provenance.
containers/​api-proxy/​cross-provider-fallback.test.js Tests request-pinned Copilot endpoint planning.
containers/​api-proxy/​cross-provider-fallback.js Plans concrete endpoints and invokes admission before building requests.
containers/​api-proxy/​body-handler.test.js Covers initial fallback admission and native passthrough.
containers/​api-proxy/​body-handler.js Preserves assessment input and filters initial resolver replacements.

Review effort: Max (auto)

Comment thread containers/api-proxy/upstream-http.js Resolved
Comment thread containers/api-proxy/upstream-http.js Resolved
Comment thread containers/api-proxy/upstream-http.js Resolved
Comment thread containers/api-proxy/upstream-http.js Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

lpcox and others added 5 commits November 8, 2026 14:47
Refactor assessment handling to include error catching.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 93.81% 93.80% 📉 -0.01%
Statements 92.35% 92.35% ➡️ +0.00%
Functions 93.02% 93.02% ➡️ +0.00%
Branches 86.69% 86.69% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/commands/main-action.ts 92.0% → 91.7% (-0.25%) 91.7% → 91.4% (-0.24%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 93.82% 93.80% 📉 -0.02%
Statements 92.36% 92.35% 📉 -0.01%
Functions 93.02% 93.02% ➡️ +0.00%
Branches 86.70% 86.69% 📉 -0.01%
📁 Per-file Coverage Changes (3 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/one-shot-process.ts 84.0% → 81.5% (-2.47%) 76.8% → 74.7% (-2.11%)
src/commands/main-action.ts 92.0% → 91.7% (-0.25%) 91.7% → 91.4% (-0.24%)
src/enclave/host-executor-server.ts 91.2% → 91.2% (+0.00%) 89.8% → 90.1% (+0.29%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: apply directed compatibility contracts to fallback decisions and /reflect diagnostics

3 participants