Skip to content

Repair primary regression completion and Codex routing evidence gates - #11191

Merged
lpcox merged 4 commits into
mainfrom
copilot/repair-primary-regression-gates
Nov 6, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/repair-primary-regression-gates

Conversation

Copilot AI commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Five primary-runtime jobs rejected exit-0 results at shared evidence gates. NVX completion failures lacked byte-level classification, while Codex routing depended on token-usage records that can be absent after successful inference.

  • Completion evidence

    • Accept exact standalone LF/CRLF completion lines; preserve strict proof/response matching and nonzero-exit rejection.
    • Retain bounded, redacted marker-check.json classifications without claiming to resolve historical private-log bytes.
  • Codex routing

    • Read persisted token-tracker-audit.jsonl: HTTP upstream statuses and newly observed WebSocket handshake statuses.
    • Require HTTP 2xx or WebSocket 101; start/close events alone cannot pass.
    • Distinguish unavailable, rejected, empty, failed, and successful evidence, with no-usage, pending, partial-line, and schema/path diagnostics.
  • Compatibility and fixtures

    • Recognize the new WebSocket observation in enclave auditing without changing usage totals.
    • Cover all five affected cells, malformed markers, no-token-usage inference, split handshakes, and early transport closure.
    • Preserve credential isolation and egress controls; project only fixed fields, never raw logs, headers, or payloads.

Copilot AI changed the title [WIP] Repair primary regression evidence gates for NVX completion and Codex proxy routing Repair primary regression completion and Codex routing evidence gates Nov 6, 2026
Copilot AI requested a review from lpcox November 6, 2026 15:24
@lpcox
lpcox marked this pull request as ready for review November 6, 2026 15:24
Copilot AI adaptive review requested due to automatic review settings November 6, 2026 15:24

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

The collector stops evaluating routing after 100 audit entries, allowing unsuccessful attempts to hide a later successful response and incorrectly report failure.

2 open issues
What changed in this PR

Updates the shared primary-runtime regression harness to recognize valid NVX completion lines and verify Codex API-proxy routing without requiring token-usage records.

Changes:

  • Adds bounded, redacted marker diagnostics with strict LF/CRLF completion checks.
  • Uses persisted HTTP and WebSocket upstream statuses for routing evidence, with enclave audit compatibility.
  • Adds fixtures for affected runtime cells and transport edge cases, and documents the evidence contract.
File Description
src/​enclave/​proxy-usage.ts Accepts WebSocket status observations without changing usage totals.
src/​enclave/​proxy-usage.test.ts Tests valid and malformed WebSocket status observations.
scripts/​ci/​run-agent-runtime-regression.sh Enforces classified completion and routing evidence.
scripts/​ci/​collect-agent-regression-evidence.test.ts Adds marker, routing, and producer fixtures.
scripts/​ci/​collect-agent-regression-evidence.cjs Collects marker diagnostics and audit-based routing reports.
scripts/​ci/​agent-runtime-regression.test.ts Exercises affected runtime cells and evidence rejection cases.
docs/​INTEGRATION-TESTS.md Documents retained evidence and success requirements.
containers/​api-proxy/​token-tracker-ws.js Audits parsed upstream WebSocket handshake statuses.

Review effort: Max (auto)

Comment on lines 134 to 144
if (report.requests.length === MAX_ROUTING_RECORDS) { diagnostics.truncated = true; break; }
report.requests.push({ transport: websocket ? 'websocket' : 'http', path: endpoint, status: record.status });
}
diagnostics.pending = pending.size;
if (report.requests.some(request => request.transport === 'websocket' ?
request.status === 101 : request.status >= 200 && request.status < 300)) {
report.status = 'successful';
} else if (report.requests.length) report.status = 'failed';
else if (diagnostics.malformed || diagnostics.wrongSource || diagnostics.invalidStatus || diagnostics.partialLine) {
report.status = 'rejected';
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 64f3865: the collector now scans the full bounded audit after the 100-record projection cap and tracks success independently. Added a 100×429 followed by 200 regression case.

Comment on lines +244 to +255
${event === 'close' ? 'client' : 'response'}.emit(${JSON.stringify(event)});
response.emit('end');
closeLogStream().catch(() => { process.exitCode = 1; });
`], { env: { ...process.env, AWF_TOKEN_LOG_DIR: directory, AWF_VERSION: '0.0.0-test' }, encoding: 'utf8', timeout: 10000 });
expect(result.status).toBe(0);
expect(result.stderr).toBe('');
expect(fs.readFileSync(path.join(directory, 'token-usage.jsonl'), 'utf8')).toBe('');
fs.mkdirSync(destination);
collectCodexRoutingEvidence(path.join(directory, 'token-tracker-audit.jsonl'), destination);
expect(JSON.parse(fs.readFileSync(path.join(destination, 'codex-routing.json'), 'utf8'))).toMatchObject({
status: 'successful', requests: [{ transport: 'http', path: '/v1/responses', status: 200 }],
diagnostics: { starts: 1, ends: 1, pending: 0, noUsage: 1 },

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 64f3865: the close case now emits only the downstream close, and asserts pending: 1, ends: 0, and noUsage: 0; the upstream-end case retains its finalized expectations.

@lpcox

lpcox commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main, resolve conflicts, and address all review feedback

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

⏳ Copilot review left inline comments.

@copilot To proceed:

  1. Ask @copilot to address the review feedback (reply to this comment or the review thread)
  2. Once the fix is pushed, add the ready-for-aw label to trigger agentic CI smoke tests

@github-actions

github-actions Bot commented Nov 6, 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-11191 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit 2eace9b

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.76% 93.76% ➡️ +0.00%
Statements 92.30% 92.30% ➡️ +0.00%
Functions 93.08% 93.08% ➡️ +0.00%
Branches 86.58% 86.58% ➡️ +0.00%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/enclave/host-executor-server.ts 91.2% → 91.2% (+0.00%) 89.8% → 90.1% (+0.29%)
src/enclave/proxy-usage.ts 96.0% → 96.1% (+0.07%) 92.6% → 92.8% (+0.11%)

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

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services is testing service connectivity for this pull request...

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Generated by Smoke Claude for #11191

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

💎 Smoke Gemini is crystallizing results on this pull request...

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #11191

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia ✅ 1/1 passed ✅ PASS
Bun hono ✅ 1/1 passed ✅ PASS
C++ fmt ✅ N/A ✅ PASS
C++ json ✅ N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world ✅ N/A ✅ PASS
.NET json-parse ✅ N/A ✅ PASS
Go color ✅ pass ✅ PASS
Go env ✅ pass ✅ PASS
Go uuid ✅ pass ✅ PASS
Java gson ❌ 0/0 ❌ FAIL
Java caffeine ❌ 0/0 ❌ FAIL
Node.js clsx ✅ pass ✅ PASS
Node.js execa ✅ pass ✅ PASS
Node.js p-limit ✅ pass ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 7/8 ecosystems passed — FAIL

Java failure: Maven could not download plugins from Maven Central: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty. The Java truststore is empty or unreadable in this environment, so TLS to the proxy or repo fails.

.NET note: dotnet only worked after I set XDG_RUNTIME_DIR, because /run/user/1001 does not exist and the NuGet mutex failed. Both projects then restored, built and ran.

Generated by Build Test Suite for #11191 · copilot · auto · ~19 AIC · ⊞ 5.7K · ◷
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

@Copilot @lpcox
chore: refresh canonical model sources
docs: sync schemas and specs with source changes
MCP connectivity: ✅
GitHub.com connectivity: ✅
File write/read: ✅
BYOK inference: ✅
Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra
Overall status: PASS

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com → 200)
  • ✅ Blocked domain (example.com blocked)

Overall: PASS — cc @lpcox

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode

✅ PASS — Direct BYOK mode validated

Test Status
GitHub.com connectivity ✅ HTTP 200
File write/read ✅ File exists
BYOK inference ✅ Working (agent → api-proxy sidecar → api.githubcopilot.com)
MCP connectivity ✅ PR #11183, PR #11180

Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY via api-proxy sidecar)

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

OTEL smoke test

  • ✅ S1 Module loading: otel.js loads; exports startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, etc.
  • ✅ S2 Tests: 3 suites, 75/75 passed
  • ✅ S3 Env forwarding: trace/parent span IDs in env-passthrough.ts; OTEL vars in api-proxy-env-config.ts
  • ✅ S4 Token tracker: onUsage hook present in token-tracker-http.js
  • ⚠️ S5 Diagnostics: no export run in this local check (spans fall back to file exporter when no endpoint is configured), so I confirmed no span exports and no errors.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Cloud Hypervisor + Copilot smoke test

  1. Merged PR lookup: PASS
  2. github.com connectivity: PASS (HTTP 200)
  3. File write/read: PASS
  4. example.com blocked: PASS (HTTP 000)

Overall: PASS

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

@Copilot @lpcox
Repair primary regression completion and Codex routing evidence gates
GitHub MCP Testing: ✅ | GitHub.com Connectivity: ✅ | File Write/Read Test: ✅ | BYOK Inference Test: ✅
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
Status: PASS

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude Results

  • API status: ✅ PASS
  • GitHub check: ✅ PASS
  • File status: ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #11191 · claude · haiku45 · ~14 AIC · ⊞ 6.1K · ◷
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot: PRs: "chore: refresh canonical model sources", "docs: sync schemas and specs with source changes"

  • GitHub MCP ✅
  • GitHub.com connectivity ✅
  • File write/read ✅

PASS — @Copilot @lpcox

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Smoke Test

  • chore: refresh canonical model sources / docs: sync schemas and specs with source changes
  • GitHub PR reads: ✅
  • Playwright title check: ❌
  • Temp file write/read: ✅
  • AWF build: ✅
  • Overall: FAIL

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@lpcox
lpcox enabled auto-merge (squash) November 6, 2026 18:50
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.16 Python 3.12.16 ✅
Node.js v24.22.2 v2.98.0 ❌
Go go1.22.12 go1.22.12 ✅

Result: Not all tests passed (Node.js mismatch), so the smoke-chroot label was not added.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@lpcox
lpcox merged commit da90d1e into main Nov 6, 2026
156 of 161 checks passed
@lpcox
lpcox deleted the copilot/repair-primary-regression-gates branch November 6, 2026 19:09

This branch was previously deployed

1 inactive deployment
aoai-model — 64f3865f Deployed Nov 6, 2026 by lpcox via conclusion #2272
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repair primary regression evidence gates for NVX completion and Codex proxy routing

3 participants