BUG: Missing Artifact when checking out with --no-strict

Summary

When building with --no-strict and then checking out an element that has a runtime dependency that was changed, we get a broken assertion.

Steps to reproduce

a.bst

kind: import
sources:
  - kind: local
    path: files

b.bst

kind: stack
depends:
  - filename: a.bst

project.conf

name: test

files/a.txt

a

Commands to reproduce:

bst build b.bst
echo b >files/a.txt
bst --no-strict build b.bst
bst --no-strict checkout b.bst b

What is the current bug behavior?

[--:--:--][][] BUG     stack element at b.bst [line 1 column 0]: Missing artifact fa3f9513

    Traceback (most recent call last):
      File "/home/valentin/.local/bin/bst", line 8, in <module>
        sys.exit(cli())
      File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__
        return self.main(*args, **kwargs)
      File "/home/valentin/.local/lib/python3.6/site-packages/BuildStream-1.3.0+275.g834b3c0a.dirty-py3.6.egg/buildstream/_frontend/cli.py", line 162, in override_main
        standalone_mode=standalone_mode, **extra)
      File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main
        rv = self.invoke(ctx)
      File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
        return callback(*args, **kwargs)
      File "/usr/lib/python3/dist-packages/click/decorators.py", line 27, in new_func
        return f(get_current_context().obj, *args, **kwargs)
      File "/home/valentin/.local/lib/python3.6/site-packages/BuildStream-1.3.0+275.g834b3c0a.dirty-py3.6.egg/buildstream/_frontend/cli.py", line 662, in checkout
        tar=tar)
      File "/home/valentin/.local/lib/python3.6/site-packages/BuildStream-1.3.0+275.g834b3c0a.dirty-py3.6.egg/buildstream/_stream.py", line 409, in checkout
        integrate=integrate) as sandbox:
      File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
        return next(self.gen)
      File "/home/valentin/.local/lib/python3.6/site-packages/BuildStream-1.3.0+275.g834b3c0a.dirty-py3.6.egg/buildstream/element.py", line 1314, in _prepare_sandbox
        self.stage_dependency_artifacts(sandbox, scope)
      File "/home/valentin/.local/lib/python3.6/site-packages/BuildStream-1.3.0+275.g834b3c0a.dirty-py3.6.egg/buildstream/element.py", line 699, in stage_dependency_artifacts
        update_mtimes=to_update)
      File "/home/valentin/.local/lib/python3.6/site-packages/BuildStream-1.3.0+275.g834b3c0a.dirty-py3.6.egg/buildstream/element.py", line 609, in stage_artifact
        self.__assert_cached()
      File "/home/valentin/.local/lib/python3.6/site-packages/BuildStream-1.3.0+275.g834b3c0a.dirty-py3.6.egg/buildstream/element.py", line 2069, in __assert_cached
        self, self._get_brief_display_key())
    AssertionError: stack element at b.bst [line 1 column 0]: Missing artifact fa3f9513

What is the expected correct behavior?

We should get a nice "No artifacts to stage" error.

Relevant logs and/or screenshots

Possible fixes

Other relevant information