         ledger-reads (first (history->read-ledgers history :persist))
         trigger-ledger-reads (first (history->read-ledgers history :annotate-job))
         ;; TODO: Don't need the sort any more - trigger only called on job-complete
-        final-window-state-write (single-trigger-write trigger-ledger-reads) 
+        final-window-state-write (final-trigger-write trigger-ledger-reads) 
         window-state-filtered? (= (count final-window-state-write) 
                                   (count (set final-window-state-write)))
         ledger-read-results (ledger-reads->job+reads ledger-reads)

                   :unacknowledged-writes-read unacked-writes-read
                   :job-exception-message (some-> exception (.getMessage))
                   :job-exception-trace (if exception (with-out-str (clojure.stacktrace/print-stack-trace exception)))}
     :invariants {:job-completed? (nil? exception)
                  :reads-correct-jobs? correct-jobs?
                  :all-written-read? all-written-read?}}))


                                           n-jobs))
                  :reads-correct-jobs? correct-jobs?
                  :all-added-triggered? all-added-triggered?
                  ;; FIXME: all-added-emitted? is currently broken by job-complete not flushing remaining segments.
                  ;:all-added-emitted? all-added-emitted?
                  :all-added-read? all-added-read?}}))

;; TODO, check whether the jobs were even submitted, if not, nothing should be read back 
