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
// 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:".
"encoding/json"
"maps"
"slices"
"encoding/json"
"maps"
"slices"
"testing"
"github.com/stretchr/testify/require"
"testing"
"github.com/stretchr/testify/require"
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) {
// 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
"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
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