]> git.giacomolli.uk - onechat/blobdiff - log.go
Start the builds in the order of the messages
[onechat] / log.go
diff --git a/log.go b/log.go
index 22012e28eebd31ca4695b0e714960d7396f5e685..f1727d5fafef4e3dc35c42df94c9986f0b515aec 100644 (file)
--- a/log.go
+++ b/log.go
@@ -17,12 +17,12 @@ var errLocked = errors.New("another process owns the chat")
 
 // kinds holds the kinds that a message can have.
 var kinds = map[string]bool{
-       "user": true,
-       "unii": true,
-       "tool": true,
-       "echo": true,
-       "work": true,
-       "note": true,
+       "user":  true,
+       "reply": true,
+       "tool":  true,
+       "echo":  true,
+       "work":  true,
+       "note":  true,
 }
 
 // Message is one entry of the chat log. ID is the permanent position of the
@@ -38,11 +38,11 @@ type Message struct {
 
 // Log is the append-only message log of one chat. It writes one JSON line for
 // each message to main/YYYY-MM-DD.jsonl, named for the local day of the write.
-// It never edits or deletes a line. Each write goes to the file and to the disk
-// before Append returns. An exclusive lock on the lock file makes sure that
-// only one process writes the log. After a failed write, the end of the file is
-// not known, so the log refuses all writes until it is opened again. The caller
-// serializes all calls.
+// It never edits or deletes a line. Each line goes to the operating system
+// before Append returns, so a crash of the process loses no message. An
+// exclusive lock on the lock file makes sure that only one process writes the
+// log. After a failed write, the end of the file is not known, so the log
+// refuses all writes until it is opened again. The caller serializes all calls.
 type Log struct {
        clock    func() time.Time
        lock     *os.File