Interrogative which (whether adjectival or pronominal) may be used with reference to either the Subject or an Object (Direct or Indirect) of its corresponding indicative sentence.
If used of an Object, which is followed by an inversion of the indicative sentence, with DO-support if the head verb is not an auxiliary:
This context may reflect that definition. ... Which definition may this context reflect?
This context demands that definition. ... Which definition does this context demand?
If used of the Subject, which simply replaces either the Subject or its determiner:
This context demands that definition. ... Which (context) demands that definition?
This is your grammatically correct A form.
Note that it is the syntactical role of the referent as Subject or Object, not its semantic role as Agent or Patient (or Recipient) which governs which form is used. If you passivize the sentence and make the referent object its subject, it takes the second, non-inverted form:
This context demands that definition. > This definition is demanded by that context. > Which (definition) is demanded by that context?