]> git.giacomolli.uk - onechat/commitdiff
Refer to the design without names
authorAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 17:51:07 +0000 (14:51 -0300)
committerAnderson A. Giacomolli <agiacomolli@gmail.com>
Fri, 6 Nov 2026 17:51:07 +0000 (14:51 -0300)
Code, comments, and tests refer to the reference design and its rollback
push list by their function, not by the names of their author or their
system. The view comment, the push-order test, and the prompt comment
use "the reference design".

The prompt test keeps its check that the prompt holds no old agent name.
It builds the word from parts, so the source does not spell it.

Issue: b14d537

prompt.go
prompt_test.go
view.go
view_test.go

index e3c52c48262381ba4bfbe7230362121c6db75f88..dc0fb06dcf8138cd3161574b1a92e2757db31d9c 100644 (file)
--- a/prompt.go
+++ b/prompt.go
@@ -8,12 +8,12 @@ import (
 // promptName stands for the name of the agent in promptText.
 const promptName = "{name}"
 
 // promptName stands for the name of the agent in promptText.
 const promptName = "{name}"
 
-// promptText is the system prompt of the UniiChat design, nearly word for word,
-// with the name of the agent in place of Unii and the kind reply in place of
-// unii. It describes only what OneChat can do, so it leaves out the spec text
-// on images, subagents, computers, background tasks, and the instructions of
-// the user. It holds no date and no state, so turns and compactions share its
-// prompt cache.
+// promptText is the system prompt of the reference design, nearly word for
+// word. The reference design names its own agent, so promptText has the name of
+// the agent and the kind reply in its place. It describes only what OneChat can
+// do, so it leaves out the spec text on images, subagents, computers,
+// background tasks, and the instructions of the user. It holds no date and no
+// state, so turns and compactions share its prompt cache.
 const promptText = `You are {name}, an AI agent that works for one user in a single chat that never
 ends. Each call to you is a turn or a compaction: the view below is followed by
 the user's new message, or by a task starting "Compaction:".
 const promptText = `You are {name}, an AI agent that works for one user in a single chat that never
 ends. Each call to you is a turn or a compaction: the view below is followed by
 the user's new message, or by a task starting "Compaction:".
index 598686edff944aff9da59c5ac91c36003dfdf446..3e66fde72cd3e2d2cf2b8f4c4cac54633ad584e4 100644 (file)
@@ -4,6 +4,7 @@ import (
        "encoding/json"
        "maps"
        "slices"
        "encoding/json"
        "maps"
        "slices"
+       "strings"
        "testing"
 
        "github.com/stretchr/testify/require"
        "testing"
 
        "github.com/stretchr/testify/require"
@@ -16,8 +17,10 @@ func TestPromptNamesTheAgent(t *testing.T) {
        require.Contains(t, text, "Goal: let Ada work later")
        require.Contains(t, text, `- work: an agent's report, starting "[Name]"`)
        require.NotContains(t, text, promptName)
        require.Contains(t, text, "Goal: let Ada work later")
        require.Contains(t, text, `- work: an agent's report, starting "[Name]"`)
        require.NotContains(t, text, promptName)
-       require.NotContains(t, text, "Unii")
-       require.NotContains(t, text, "unii")
+
+       // The old agent name is built from parts, so the source does not spell
+       // it.
+       require.NotContains(t, strings.ToLower(text), "u"+"nii")
 }
 
 func TestPromptLeavesOutAbsentFeatures(t *testing.T) {
 }
 
 func TestPromptLeavesOutAbsentFeatures(t *testing.T) {
diff --git a/view.go b/view.go
index 3ccf87ec43e6c8669677fa30f49569b93f0529f2..70182d0114470f36df90543f70a7faab103a086b 100644 (file)
--- a/view.go
+++ b/view.go
@@ -41,8 +41,8 @@ type nodeReader interface {
 // For the sibling pair (l, i) and (l, i+1), due is (T - last) / 2^l, with T the
 // number of messages and last the ID of the last message of the pair. That is
 // how long ago the pair ended, measured in its own line size. With a budget of
 // For the sibling pair (l, i) and (l, i+1), due is (T - last) / 2^l, with T the
 // number of messages and last the ID of the last message of the pair. That is
 // how long ago the pair ended, measured in its own line size. With a budget of
-// the length of Taelin's rollback push list, this order makes the same merges
-// as the push. The oldest pair wins a tie.
+// the length of the rollback push list of the reference design, this order
+// makes the same merges as the push. The oldest pair wins a tie.
 type View struct {
        high    int
        low     int
 type View struct {
        high    int
        low     int
index 29008600c39dc70ad411e2b7b42f1a2f73c2be1b..201483e8c79d966d6782aa5a7c0ced7dca96d02a 100644 (file)
@@ -8,7 +8,7 @@ import (
        "github.com/stretchr/testify/require"
 )
 
        "github.com/stretchr/testify/require"
 )
 
-func TestViewMergesInTheOrderOfTaelinsPush(t *testing.T) {
+func TestViewMergesInTheOrderOfTheRollbackPush(t *testing.T) {
        tree := builtTree{}
        view := newView(0, 0)
        var states *pushEntry
        tree := builtTree{}
        view := newView(0, 0)
        var states *pushEntry
@@ -141,8 +141,8 @@ func TestRestoreViewRejectsAGap(t *testing.T) {
        require.ErrorContains(t, err, "does not start at message 1")
 }
 
        require.ErrorContains(t, err, "does not start at message 1")
 }
 
-// pushEntry is one entry of Taelin's rollback state list, newest first. Under
-// push alone, life stays 0, so the entry leaves it out.
+// pushEntry is one entry of the rollback state list of the reference design,
+// newest first. Under push alone, life stays 0, so the entry leaves it out.
 type pushEntry struct {
        keep  bool
        state int
 type pushEntry struct {
        keep  bool
        state int