Skip to content

backends: isolate the missing-credential fixture from ambient inference credentials #1996

Closed

Description

@schlessera

Out of scope

Changing production credential precedence or environment admission, handling real credentials, external inference, changing #1993's browser fixture, offline guards or assertion deadlines, or weakening the missing-credential refusal assertion.

Context

autonomous Claude envelope > an API profile without a credential refuses before a relay or worker exists (test("an API profile, packages/ui-backend-claude/tests/autonomous-envelope.test.ts:97-100) supplies an empty profile environment but does not isolate ambient inference credentials. turnEnv merges a filtered host snapshot before the profile environment (turnEnv, packages/ui-backend-claude/src/sdk-options.ts:71-76); envSnapshot reads the host environment (envSnapshot, packages/ui-backend-claude/src/config/env.ts:201). The negative control therefore depends on the terminal having no admitted API credential, and it creates a relay when that assumption is false.

Observed twice:

Both runs used the repository test wrapper and offline preload. No inference request or worker launch is required.

Scope

  • Make the missing-credential fixture own its credential environment, saving and restoring every variable it changes. Keep production behavior unchanged.
  • Check the other credential-absence cases in autonomous-envelope.test.ts for the same ambient-credential assumption and isolate any that share it.

Acceptance criteria

  • The original refusal and absence-of-relay assertions pass when the invoking process has no inference credential and when it contains a fictional API key or bearer-token sentinel, while still proving that the assembled turn has no admitted inference credential.
  • The fixture restores the exact preceding variable presence/value after success and failure; no real credential is printed.
  • Every other credential-absence case in the suite either is shown not to depend on ambient credentials or receives the same isolation.
  • A mutation removing the fixture's isolation makes the named case fail for the original missing-refusal assertion with a fictional sentinel.
  • The package suite remains offline with the normal test guard enabled.

Verification

Run env ANTHROPIC_API_KEY=sk-odysseus-fixture bun run test ./packages/ui-backend-claude/tests/autonomous-envelope.test.ts, then repeat with that variable unset, plus appropriate local preflight and affected hosted proof. Retain the failing mutation and restored results. Do not use real credentials or network calls.

Contract impact

None. Test environment isolation only. This issue does not establish any relationship to #1993's Playwright GUID failure.

Part of #736's deterministic host-isolation outcome.

2026-10-24: merged #2749 into this issue (same test, same ambient-key dependency): folded in its second observation, the sibling-case audit, and the offline-suite criterion; refreshed the test and turnEnv/envSnapshot anchors; added area: ci.

2026-10-24: attached natively to #736 after #736's browser children moved to the new nested epic and freed capacity; replaced the earlier standalone-by-reference wording.

Activity

  1. added
    type: testCoverage, harness or proof work with no behaviour change.
    area: backendsAgentBackend implementations and the seam they share.
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    on Oct 15, 2026
  2. schlessera commented on Oct 15, 2026

    @schlessera
    OwnerAuthor

    2026-10-16 triage: verified the test and host-environment source anchors, corrected the turnEnv range, added priority p2 and agent-ready for this complete unscheduled test-isolation brief. The existing fictional sentinel evidence establishes the scoped failure; no new inference or credential access was performed. Keep standalone by reference to full-capacity #736, without moving any child or changing production credential precedence.

  3. added
    area: ciCI workflows, the gates they run, release scripts, packaging.
    on Oct 23, 2026
  4. self-assigned this
    on Oct 24, 2026
  5. added this to the 0.44.0 milestone on Oct 24, 2026
  6. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    Claim bk044-2749-a9f58eea: implementing the credential-absence fixture isolation on branch test/2749-hermetic-credentials-044 for milestone 0.44.0. #2749 is closed as a duplicate of #1996; this claim covers that same scoped fix. Will stop at a draft PR with local receipts and draft gates, leaving #2769 untouched.

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

Metadata

Metadata

Assignees

Labels

agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: backendsAgentBackend implementations and the seam they share.area: ciCI workflows, the gates they run, release scripts, packaging.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: testCoverage, harness or proof work with no behaviour change.

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions