anchor.diff:      ((:running :stopping) NIL)
       ((:stopped :completed :errored :created) T)))
   
  +(defun discover-status-from-logfile (logfile)
  +  (if (not (probe-file logfile))
  +      :created
  +      (with-open-file (stream logfile :direction :input)
  +        (loop for line = (read-line stream NIL NIL)
  +              while line
  +              do (when (search ";;;; Autobuild" line)
  +                   (cond ((search "RUNNING" line))
  +                         ((search "ERRORED" line)
  +                          (return :errored))
  +                         ((search "COMPLETED" line)
  +                          (return :completed))))
  +              finally (return :stopped)))))
  +
   (defgeneric perform-build (build))
   
   (defmethod perform-build :around ((build build))
  
positive.code:           (let ((*build-output* (make-broadcast-stream *standard-output* log-out))
                  (start-time (get-universal-time)))
              (setf (start build) start-time)
              (format log-out ";;;; Autobuild~%")
              (format log-out ";; Started on ~a~%~%" (format-date start-time))
              (finish-output log-out)
              (multiple-value-prog1
                  (handler-bind ((error (lambda (err)
                                          (format log-out "~&~%~%;; !! ERROR DURING BUILD~%")
                                          (dissect:present err log-out)
                                          (format log-out "~&~%~%")
                                          (finish-output log-out)                                      
                                          (setf (start build) NIL)
                                          (v:log :err :autobuild err))))
                    (call-next-method))
                (let ((end-time (get-universal-time)))
                  (format log-out "~&~%")
                  (format log-out ";; Ended on ~a~%" (format-date))
                  (format log-out ";; Build took ~a" (format-time (- end-time start-time)))
                  (finish-output log-out)
                  (setf (end build) end-time)
                  (v:info :autobuild "Build for ~a finished." build)))))))))
  
negative.code: (defmethod initialize-instance :after ((build build) &key)
    (when (and (project build) (not (location build)))
      (setf (location build) (location (project build))))
    (setf (logfile build) (merge-pathnames (logfile build) (location build)))
    (setf (status build) (discover-status-from-logfile (logfile build))))
  
  (defmethod print-object ((build build) stream)
    (print-unreadable-object (build stream :type T)
  