Package commit runs actions after the surrounding transaction commits:
effects outside the database (a cache invalidation) must not be
observed before the change they describe.
Scope runs fn as a transaction body: actions deferred inside it run
after fn and the commit succeed. A nested scope joins the outer one, so
its actions wait for the outermost commit.