deepseek-ai/deepseek-harness · error

typert: invocation " " Context receiver cannot declare a…

Error message

typert: invocation "${descriptor.id}" Context receiver cannot declare a direct scope projection

What it means

validateInvocation found an invocation whose receiver is a Context receiver (`invocation.kind === 'context'`) that also declares a direct scope projection. Scope projection is only defined for direct invocations, so the combination is structurally invalid.

Solutions

  1. Remove the direct scope projection from the Context receiver parameter.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/typert/registry/src/service.ts:674 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/7f91bd5772e4c4c6. Report an issue: GitHub.

Appendix: source

Thrown at packages/typert/registry/src/service.ts:674

      if (parameter.acceptsUndefined !== undefined) {
        throw new Error(`typert: invocation "${descriptor.id}" lookup parameter "${parameter.name}" cannot accept undefined`)
      }
      if (parameter.lookup === undefined) {
        throw new Error(`typert: invocation "${descriptor.id}" lookup parameter "${parameter.name}" has no lookup key`)
      }
      validateSegment('lookup key', parameter.lookup)
    } else if (parameter.lookup !== undefined) {
      throw new Error(`typert: invocation "${descriptor.id}" JSON parameter "${parameter.name}" declares a lookup key`)
    }
    validateCodec(parameter.codec, `${descriptor.id} parameter ${parameter.name}`)
  }
  const cancellation = descriptor.cancellation as { readonly parameter: string } | undefined
  if (cancellation !== undefined && cancellation.parameter !== 'signal') {
    throw new Error(`typert: invocation "${descriptor.id}" cancellation parameter must be "signal"`)
  }
  if (descriptor.scope !== undefined) {
    if (descriptor.invocation.kind !== 'direct') {
      throw new Error(`typert: invocation "${descriptor.id}" Context receiver cannot declare a direct scope projection`)
    }
    validateSegment('scope Context key', descriptor.scope.context)
    validateWireName('scope wire field', descriptor.scope.wire)
    const lookups = descriptor.parameters.filter(candidate => candidate.source === 'lookup')
    const parameter = lookups.length === 1 ? lookups[0] : undefined
    if (parameter === undefined || parameter.wire !== descriptor.scope.wire
      || parameter.lookup !== descriptor.scope.context) {
      throw new Error(
        `typert: invocation "${descriptor.id}" scope wire "${descriptor.scope.wire}" must select its only lookup parameter`,
      )
    }
  }
  if (descriptor.invocation.kind === 'context') {
    validateSegment('Context key', descriptor.invocation.context)
    validateWireName('Context wire field', descriptor.invocation.wire)
    if (wires.has(descriptor.invocation.wire)) {
      throw new Error(`typert: invocation "${descriptor.id}" repeats wire field "${descriptor.invocation.wire}"`)
    }

View on GitHub (pinned to b150a551b8)