         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?}}))


                         :read-results (:results r)}) 
                      reads)))))

(defn emitted-segment? [segment] 
  (= :emitted (:type segment)))

(defn reads-correct-jobs? [job+reads]
  (empty? 
    (remove (fn [{:keys [read-results job-num]}]
              (or (empty? read-results) 
                  (= #{job-num} (set (map :job-num (remove emitted-segment? read-results))))))
            job+reads)))

(defn job-exception [log-conn final-replica]
