Unusual behavior for "datomic.tx" as a tempid

Is it a bug that the “datomic.tx” tempid is nil when the transaction id is only in the V position?

(d/transact conn {:tx-data [{:db/id "temptoken"
                                                  :db/ident :delete/me
                                                  :st.oauth.token/updated-by "datomic.tx"}]})

outputs:

{:db-before #datomic.core.db.Db{:id "stt", :basisT 47, :indexBasisT 0, :index-root-id nil, :asOfT nil, :sinceT nil, :raw nil},
 :db-after #datomic.core.db.Db{:id "stt", :basisT 48, :indexBasisT 0, :index-root-id nil, :asOfT nil, :sinceT nil, :raw nil},
 :tx-data
 [#datom[13194139533360 50 #inst "2023-10-19T19:09:00.794-00:00" 13194139533360 true] #datom[79164837212475 183 13194139533360 13194139533360 true] #datom[79164837212475 183 13194139533359 13194139533360 false]],
 :tempids {"temptoken" 79164837212475, "datomic.tx" nil}}

In other situations (notably, augmenting the tx entity with additional attrs) I find “datomic.tx” correctly identified in the tempids data structure.

if i add something like {:db/id "datomic.tx" :db/doc "..."} to the :tx-data, then "datomic.tx" will be correct.

however, u can access tx eids within datalog queries for every attr of an entity, since its stored in every datom, so u shouldn’t really dedicate an attr for it. it just opens up the possibility to store invalid or inconsistent values in it.

if u r looking for the latest date, when any attr of an entity was modified, u can say something like this:

  '{:find  [(pull ?e attrs) (max ?t)]
    :in    [$ attrs]
    :where [[?e _ _ ?t]
            [?e :db/txInstant ?t]]}

We sometimes duplicate the transaction association (via a ref attribute) purely to provide pull expressions access to the metadata such as txInstant. There are also benefits when configuring the Datomic Analytics platform.

The tx metadata is particularly useful for forensic analyses and that’s where these duplicate associations really shine. We certainly don’t use them for domain data.