Selectively enforcing a "contents:" constraint according to a type parameter?
I'm doing some reversing work on a 3rd-party format that uses a typical magic bytes scheme in the file header. However, there are several instances of official (direct from said 3rd party) files that have busted headers with incorrect magic bytes (and incorrect header hashes, as well). The rest of the data is okay apart from the header size, but I can deal with that.

The application that uses these files seem to ignore the header signature and header size altogether, assuming the size to be a pre-ordained constant. I could do the same, but I would prefer to have a boolean `is_mangled` parameter for the `file_header` type. Downstream code can decide for themselves whether they care about the magic byte mismatch. If `is_mangled == false`, the parser will throw an exception if the bytes don't match.

I thought I could solve this with an instance in the `file_header` type. Something like:

```yaml
file_header:
  params:
    - id: is_mangled
      type: boolean
  seq:
    - id: raw_magic
      size: 10
    # <etc>
  instances:
    good_magic:
      value: "MAGICVALUE"
    expected_magic:
      value: '(is_mangled ? raw_magic : good_magic)'
    validate_magic:
      value: raw_magic
      contents: expected_magic
```

But this gives a compiler error:

    /instances/validate_magic/contents: invalid key found in value instance, allowed: doc, doc-ref, enum, if, value

For context: I'm invoking `ksc` by way of `ksv`. `ksv --version` reports `kaitai-struct-compiler 0.8`.

It sounds like the compiler objects to having a `contents` key in an `instance`. But according to the [instance spec](http://doc.kaitai.io/ksy_reference.html#spec-instance), any key valid for an `attribute` should also be valid for an `instance`, apart from `id`.

Am I missing something? If this approach won't work, is there something else that would?