Skip to content

refactor(daemon): require runtime access when constructing request execution #4047

Closed

Description

@thymikee

Parent: #4045

Purpose

The production router supplies gateway and platformRequestScope, but createRequestExecutionScope makes them optional and createRequestDeviceAccess returns absent claim admission and bindings. Late throwing defaults conceal incomplete wiring.

Owner and scope

packages/daemon/src/server/request-execution-scope.ts, immediate router callers and directly affected scope/claim test fixtures only. Exclude downstream handler context optionality and session teardown files.

Required behavior

Require deviceRuntimeGateway and platformRequestScope at construction and remove the impossible absent-access branch and late gatewayMissing defaults. Preserve existing command claim policy and genuine capability optionality. Reuse existing complete runtime fixtures; no new production seam or forwarding wrapper. Audit roughly ten test files whose omitted access previously disabled actual claim admission: update incorrect assumptions and isolate claim state with existing test scratch helpers rather than disabling admission.

API or evidence example

createRequestExecutionScope({ deviceRuntimeGateway, platformRequestScope, ... }) requires both fields; its internal device-access result cannot represent missing construction dependencies.

Observable completion

  • Production callers and all directly affected scope fixtures supply complete gateway and request scope.
  • Missing construction dependencies cannot silently bypass claim admission or become late throwing functions.
  • Focused tests exercise the same claim-admission path as production, with scratch state isolated; report tests whose old assertions depended on bypassed admission.
  • No downstream optional inspectFacts/bindDevice migration, platformCleanup scope expansion or new forwarding abstraction.

Dependencies and sequencing

Blocked by: #4060 for validation. The implementation itself has no semantic prerequisite.

Validation

Focused request scope/router/claim tests, typecheck, format, exact-head affected gate. Preserve missing-capability behavior; distinguish construction requirements from runtime availability.

Base audit SHA: 144bd59890277fd4717995588ad817597c9d6552. Re-read the issue and all Decision: comments before work. Read applicable AGENTS.md routes. Keep one owner boundary per PR. Independent review and serialized exact-head validation are coordinated by the umbrella orchestrator.

Activity

  1. thymikee commented on Oct 29, 2026

    @thymikee
    MemberAuthor

    Implementation committed at 8380273 against audit base 144bd59. Worker reports focused tests, typecheck and OXC format passed. No implementation PR is published. Independent review and orchestrator-scheduled exact-head validation remain outstanding.

  2. thymikee commented on Oct 29, 2026

    @thymikee
    MemberAuthor

    Independent review found no issues. The actual nightly concurrency runner passed all 4 tests, including 128 deterministic interleavings. Exact-head affected validation at 8380273 failed in vitest-related: provider-integration test/integration/provider-scenarios/ios-record-trace.test.ts:66 timed out at 5000ms (299 files / 1985 tests passed, 1 test failed). Cause is unproven. The orchestrator is running the identical failed command on unchanged base 144bd59 in a disposable checkout without competing test runs. No timeout widening, selection reduction, or pass claim.

  3. thymikee commented on Oct 29, 2026

    @thymikee
    MemberAuthor

    Decision: validation blocker: The same ios-record-trace.test.ts:66 five-second timeout reproduced on unchanged base 144bd59 with the identical vitest-related command and default worker limit. Head: 1 failed / 1985 passed tests; base: 3 failed / 1983 passed tests, including the matching failure. #4060 owns diagnosis and correction. Validation remains failed/base-blocked; a draft may record this evidence and remaining checks. No timeout or selection changes are authorized. The comparison checkout was removed and the reviewed head remains clean.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions