Title projects from the repository name only (review B1, N2)
Human
Prompt
Fable 5.2 review of ae26c16c, controller decision B1: title new projects from the repository name only; drop the README-name rule; migration 0103 retitles every project Equipo titled itself. N2: roster.go goes through the same title accessor.
From this commit's own message. The prompt ledger has no entries for it — which is what a squashed, rebased or amended commit looks like, and what every commit looks like in a repo without a ledger.
Summary
ProjectTitle takes the repository alone: capitalised name, or ns/repo for a generic one. The catalog no longer titles a project (oficina/base was 'Store', oficina/alta 'Paul'). shownTitle shows a title only when the person set it, so no stored Equipo-chosen title shows. Migration 0103 now clears every title with title_set 0 (idempotent; owner titles stay). Roster card context uses shownTitle. Tests that expected 'Woodstar' for oficina/sample now expect 'Sample'; fixtures standing for named projects set TitleSet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 files changed,
+78
−116
internal/equipo/chat/access_need_test.go+8 −4internal/equipo/chat/project_catalog.go+1 −1internal/equipo/chat/project_names.go+1 −1internal/equipo/chat/projects.go+5 −15internal/equipo/chat/report_thread_test.go+1 −1internal/equipo/chat/roster.go+5 −3internal/equipo/chat/roster_context_test.go+7 −2internal/equipo/chat/tasks.go+6 −38internal/equipo/migrations/0103_generic_project_titles.sql+5 −10internal/equipo/project_title_migration_test.go+13 −15internal/headless/merge_test.go+2 −2internal/headless/review_test.go+1 −1internal/thintest/merge_contract_test.go+3 −3internal/thintest/mergeauth_contract_test.go+4 −4internal/thintest/pages_test.go+3 −3internal/thintest/projects_pages_test.go+5 −5internal/thintest/report_actions_browser_test.go+1 −1internal/thintest/roster_browser_test.go+4 −4internal/thintest/rows_pages_test.go+1 −1internal/thintest/tasks_contract_test.go+2 −2
diff --git a/internal/equipo/chat/access_need_test.go b/internal/equipo/chat/access_need_test.go| index da779c66..a7a3a857 100644 |
| --- a/internal/equipo/chat/access_need_test.go |
| +++ b/internal/equipo/chat/access_need_test.go |
| @@ -229,14 +229,18 @@ func TestProjectTitleFromRepositoryName(t *testing.T) { |
| {"amadan.net/oficina/equipo", &equipo, "Equipo"}, |
| {"amadan.net/oficina/equipo", nil, "Equipo"}, |
| {"amadan.net/paulca/threatmin", &wire.RepoInfo{Names: []string{"threatmin", "Build", "Deploy"}}, "Threatmin"}, |
| - {"amadan.net/oficina/sample", &wire.RepoInfo{Names: []string{"sample", "Woodstar"}, Summary: "Woodstar is a reading app."}, "Woodstar"}, |
| - {"amadan.net/oficina/sample", &wire.RepoInfo{Names: []string{"sample", "Woodstar"}, Summary: "A reading app for Woodstars."}, "Sample"}, |
| - {"amadan.net/oficina/sample", &wire.RepoInfo{Names: []string{"sample", "Create"}, Summary: "Create an account."}, "Sample"}, |
| + // Review probes (Fable, ae26c16c): the runner's own names and |
| + // summaries for real Oficina repositories. A name the README |
| + // repeats is never the title, even when the summary uses it. |
| + {"amadan.net/oficina/base", &wire.RepoInfo{Names: []string{"base", "Store", "Platform", "Sign", "Settings"}, Summary: "Base is the front door ... you install apps from a Store."}, "Base"}, |
| + {"amadan.net/oficina/alta", &wire.RepoInfo{Names: []string{"alta", "Paul", "Oficina", "Home", "Continue"}, Summary: "Paul's team-provisioning app for the Oficina suite."}, "Alta"}, |
| + {"amadan.net/oficina/sample", &wire.RepoInfo{Names: []string{"sample", "Woodstar"}, Summary: "Woodstar is a reading app."}, "Sample"}, |
| + {"amadan.net/oficina/sample", &wire.RepoInfo{Names: []string{"sample", "Install"}, Summary: "Install with make."}, "Sample"}, |
| {"amadan.net/paulca/create", nil, "paulca/create"}, |
| {"amadan.net/woodstar/app", nil, "woodstar/app"}, |
| {"amadan.net/paulca/new", nil, "paulca/new"}, |
| } { |
| - if got := ProjectTitle(tc.repo, tc.info); got != tc.want { |
| + if got := ProjectTitle(tc.repo); got != tc.want { |
| t.Errorf("%s: %q, want %q", tc.repo, got, tc.want) |
| } |
| } |
diff --git a/internal/equipo/chat/project_catalog.go b/internal/equipo/chat/project_catalog.go| index 990040b3..6502dd57 100644 |
| --- a/internal/equipo/chat/project_catalog.go |
| +++ b/internal/equipo/chat/project_catalog.go |
| @@ -63,7 +63,7 @@ func (t *txn) projectListExtras(person string, h wire.Hello, out *wire.ProjectLi |
| break |
| } |
| } |
| - v := wire.ReachableProject{Repo: repo, Name: ProjectName(repo), Title: ProjectTitle(repo, info), Forge: "amadan", ConnectionID: "amadan", DescriptionSource: "repository"} |
| + v := wire.ReachableProject{Repo: repo, Name: ProjectName(repo), Title: ProjectTitle(repo), Forge: "amadan", ConnectionID: "amadan", DescriptionSource: "repository"} |
| if info != nil { |
| v.Description = clipText(info.Summary, 500) |
| } |
diff --git a/internal/equipo/chat/project_names.go b/internal/equipo/chat/project_names.go| index f498a6c4..3a75eaa2 100644 |
| --- a/internal/equipo/chat/project_names.go |
| +++ b/internal/equipo/chat/project_names.go |
| @@ -169,7 +169,7 @@ func (t *txn) namedProject(person, name string) (*projectRecord, error) { |
| var match *projectRecord |
| matches := 0 |
| for _, p := range rows { |
| - title := ProjectTitle(p.Repo, nil) |
| + title := ProjectTitle(p.Repo) |
| if p.TitleSet { |
| title = p.Title |
| } |
diff --git a/internal/equipo/chat/projects.go b/internal/equipo/chat/projects.go| index f7d881ae..461c7559 100644 |
| --- a/internal/equipo/chat/projects.go |
| +++ b/internal/equipo/chat/projects.go |
| @@ -52,13 +52,13 @@ type projectRecord struct { |
| func (projectRecord) TableName() string { return "chat_projects" } |
| // shownTitle is the project's title: the person's when they named it, |
| -// else the one Equipo stored from the repository when that is usable, |
| -// else the repository's name. A stored "Create" (#49) never shows. |
| +// else its repository's name. A title Equipo stored itself never shows, |
| +// so a stored "Create" or "Store" (#49) cannot come back. |
| func (p projectRecord) shownTitle() string { |
| - if p.Title != "" && (p.TitleSet || UsableProjectTitle(p.Title)) { |
| + if p.TitleSet && p.Title != "" { |
| return p.Title |
| } |
| - return ProjectTitle(p.Repo, nil) |
| + return ProjectTitle(p.Repo) |
| } |
| // cardRecord is a card in one person's conversation. |
| @@ -501,17 +501,7 @@ func (t *txn) addProject(person, raw string) (projectRecord, bool, error) { |
| return p, false, err |
| } |
| p = projectRecord{ID: newID("p_"), Repo: repo, State: wire.ProjectActive, AddedBy: person, Revision: 1, CreatedAt: now, UpdatedAt: now} |
| - h, err := t.hello(person) |
| - if err != nil { |
| - return p, false, err |
| - } |
| - var info *wire.RepoInfo |
| - for i := range h.Catalog { |
| - if h.Catalog[i].Repo == repo { |
| - info = &h.Catalog[i] |
| - } |
| - } |
| - p.Title = ProjectTitle(repo, info) |
| + p.Title = ProjectTitle(repo) |
| if err = t.db.Create(&p).Error; err != nil { |
| return p, false, err |
| } |
diff --git a/internal/equipo/chat/report_thread_test.go b/internal/equipo/chat/report_thread_test.go| index a5dccf74..8acd43b8 100644 |
| --- a/internal/equipo/chat/report_thread_test.go |
| +++ b/internal/equipo/chat/report_thread_test.go |
| @@ -20,7 +20,7 @@ func TestReportThreadOwnershipContextAndIsolation(t *testing.T) { |
| t.Fatal(err) |
| } |
| } |
| - must(r.s.db.G.Create(&projectRecord{ID: "p_report", Title: "Woodstar", Repo: "amadan.net/oficina/sample"}).Error) |
| + must(r.s.db.G.Create(&projectRecord{ID: "p_report", Title: "Woodstar", TitleSet: true, Repo: "amadan.net/oficina/sample"}).Error) |
| must(r.s.db.G.Create(&taskRecord{ID: "tk_report", ProjectID: "p_report", Title: "Improve sign-in", Creator: hkOwner, Stage: wire.StageInReview, CreatedAt: now, UpdatedAt: now}).Error) |
| c := cardRecord{ID: "c_report", Person: hkOwner, TaskID: "tk_report", Kind: wire.CardTask, State: wire.StageInReview, Options: "[]", Revision: 1, CreatedAt: now, UpdatedAt: now} |
| must(r.s.db.G.Create(&c).Error) |
diff --git a/internal/equipo/chat/roster.go b/internal/equipo/chat/roster.go| index 3d321efa..56f86c80 100644 |
| --- a/internal/equipo/chat/roster.go |
| +++ b/internal/equipo/chat/roster.go |
| @@ -424,10 +424,11 @@ func cardContexts(tx *gorm.DB, person string, cards []cardRecord) (map[string]Ca |
| } |
| var rows []struct { |
| ID, Repo string |
| + TitleSet bool |
| CardContext |
| } |
| err := tx.Table("chat_cards AS c"). |
| - Select("c.id, p.id AS project_id, p.title AS project_title, p.repo, t.title AS task_title"). |
| + Select("c.id, p.id AS project_id, p.title AS project_title, coalesce(p.title_set, 0) AS title_set, p.repo, t.title AS task_title"). |
| Joins("LEFT JOIN chat_tasks AS t ON t.id = c.task_id"). |
| Joins("LEFT JOIN chat_projects AS p ON p.id = coalesce(nullif(t.project_id, ''), c.project_id)"). |
| Where("c.person = ? AND c.id IN ?", person, ids).Scan(&rows).Error |
| @@ -435,8 +436,9 @@ func cardContexts(tx *gorm.DB, person string, cards []cardRecord) (map[string]Ca |
| return nil, err |
| } |
| for _, row := range rows { |
| - if row.ProjectTitle == "" && row.Repo != "" { |
| - row.ProjectTitle = ProjectTitle(row.Repo, nil) |
| + if row.Repo != "" { |
| + // The same title every other reader shows (shownTitle). |
| + row.ProjectTitle = projectRecord{Repo: row.Repo, Title: row.ProjectTitle, TitleSet: row.TitleSet}.shownTitle() |
| } |
| out[row.ID] = row.CardContext |
| } |
diff --git a/internal/equipo/chat/roster_context_test.go b/internal/equipo/chat/roster_context_test.go| index dc8fd03b..8d908f59 100644 |
| --- a/internal/equipo/chat/roster_context_test.go |
| +++ b/internal/equipo/chat/roster_context_test.go |
| @@ -9,7 +9,7 @@ import ( |
| func TestRosterCardContext(t *testing.T) { |
| r := newMeteredRig(t) |
| ctx := context.Background() |
| - for _, p := range []projectRecord{{ID: "p_old", Title: "Earlier", Repo: "amadan.net/one/old"}, {ID: "p_current", Title: "Woodstar", Repo: "amadan.net/one/current", State: "removed"}} { |
| + for _, p := range []projectRecord{{ID: "p_old", Title: "Earlier", TitleSet: true, Repo: "amadan.net/one/old"}, {ID: "p_current", Title: "Woodstar", TitleSet: true, Repo: "amadan.net/one/current", State: "removed"}, {ID: "p_create", Title: "Create", Repo: "amadan.net/oficina/equipo"}} { |
| if err := r.s.db.G.Create(&p).Error; err != nil { |
| t.Fatal(err) |
| } |
| @@ -23,12 +23,13 @@ func TestRosterCardContext(t *testing.T) { |
| {ID: "c_global", Person: hkOwner, Kind: wire.CardQuestion}, |
| {ID: "c_other", Person: hkMember, TaskID: "tk_context", Kind: wire.CardQuestion}, |
| {ID: "c_missing", Person: hkOwner, TaskID: "gone", ProjectID: "p_old", Kind: wire.CardQuestion}, |
| + {ID: "c_create", Person: hkOwner, ProjectID: "p_create", Kind: wire.CardProject}, |
| } { |
| if err := r.s.db.G.Create(&c).Error; err != nil { |
| t.Fatal(err) |
| } |
| } |
| - got, err := r.s.CardPresentations(ctx, hkOwner, []string{"c_task", "c_project", "c_global", "c_other", "c_missing"}) |
| + got, err := r.s.CardPresentations(ctx, hkOwner, []string{"c_task", "c_project", "c_global", "c_other", "c_missing", "c_create"}) |
| if err != nil { |
| t.Fatal(err) |
| } |
| @@ -44,6 +45,10 @@ func TestRosterCardContext(t *testing.T) { |
| if _, ok := got["c_other"]; ok { |
| t.Fatal("other person's card exposed") |
| } |
| + // A title Equipo stored itself (#49) shows as the repository's name. |
| + if c := got["c_create"].Context; c.ProjectTitle != "Equipo" { |
| + t.Fatalf("stored title shown: %+v", c) |
| + } |
| if c := got["c_missing"].Context; c.ProjectTitle != "Earlier" || c.TaskTitle != "" { |
| t.Fatalf("missing task failed graceful context: %+v", c) |
| } |
diff --git a/internal/equipo/chat/tasks.go b/internal/equipo/chat/tasks.go| index 068ed60f..ff7f2c0c 100644 |
| --- a/internal/equipo/chat/tasks.go |
| +++ b/internal/equipo/chat/tasks.go |
| @@ -11,7 +11,6 @@ import ( |
| "slices" |
| "strings" |
| "time" |
| - "unicode" |
| "unicode/utf8" |
| "amadan.net/oficina/equipo/internal/copydesk" |
| @@ -379,54 +378,23 @@ func cleanPath(p string) (string, bool) { |
| // ProjectTitle is the title a project takes from its repository, until |
| // the person names it: the repository's name, capitalised (equipo is |
| -// Equipo), or the catalog's own capitalisation of it. The catalog's next |
| -// name is the product's (sample's README calls it Woodstar) only when it |
| -// is a usable title and the repository's own summary uses it. Otherwise |
| -// it is a word the README happens to repeat: for oficina/equipo it was |
| -// "Create" (hub oficina/equipo #49). A repository named with a bare verb |
| -// or generic word (paulca/new) keeps its namespace. |
| -func ProjectTitle(repo string, info *wire.RepoInfo) string { |
| +// Equipo). Never one of the catalog's other names: past the first they |
| +// are headings and capitalised words the README happens to repeat, and |
| +// for oficina/equipo the second was "Create" (hub oficina/equipo #49), |
| +// for oficina/base "Store". A repository named with a bare verb or |
| +// generic word (paulca/new) keeps its namespace. |
| +func ProjectTitle(repo string) string { |
| base := path.Base(repo) |
| if base == "" || base == "." || base == "/" { |
| return repo |
| } |
| title := strings.ToUpper(base[:1]) + base[1:] |
| - if info != nil { |
| - for _, n := range info.Names { |
| - if strings.EqualFold(n, base) && n != base { |
| - title = n |
| - break |
| - } |
| - } |
| - if len(info.Names) > 1 { |
| - if n := info.Names[1]; len(n) <= 40 && len(strings.Fields(n)) <= 4 && UsableProjectTitle(n) && summaryNames(info.Summary, n) { |
| - return n |
| - } |
| - } |
| - } |
| if !UsableProjectTitle(title) { |
| return ProjectName(repo) |
| } |
| return title |
| } |
| -// summaryNames reports whether summary uses name as words of its own. |
| -func summaryNames(summary, name string) bool { |
| - for i := 0; ; { |
| - j := strings.Index(summary[i:], name) |
| - if j < 0 { |
| - return false |
| - } |
| - start, end := i+j, i+j+len(name) |
| - before, _ := utf8.DecodeLastRuneInString(summary[:start]) |
| - after, _ := utf8.DecodeRuneInString(summary[end:]) |
| - if !unicode.IsLetter(before) && !unicode.IsDigit(before) && !unicode.IsLetter(after) && !unicode.IsDigit(after) { |
| - return true |
| - } |
| - i = end |
| - } |
| -} |
| - |
| // genericTitles are words that say nothing about which project it is: |
| // bare verbs lifted from a request, and placeholders. |
| var genericTitles = map[string]bool{ |
diff --git a/internal/equipo/migrations/0103_generic_project_titles.sql b/internal/equipo/migrations/0103_generic_project_titles.sql| index 54a0fe8d..33d0e5d3 100644 |
| --- a/internal/equipo/migrations/0103_generic_project_titles.sql |
| +++ b/internal/equipo/migrations/0103_generic_project_titles.sql |
| @@ -1,15 +1,10 @@ |
| -- Hub oficina/equipo #49: a project added from the runner's catalog took a |
| -- word its README repeats as its title ("Create" for oficina/equipo, |
| --- project p_hydlybiyyy3jy574grtydymnyd). Clear titles Equipo chose that |
| --- are a bare verb or generic word (chat.UsableProjectTitle's list), so the |
| --- project shows its repository's name ("Equipo"). Data only: no row is |
| --- removed, tasks keep their project, and a title an owner set stays. |
| +-- project p_hydlybiyyy3jy574grtydymnyd; "Store" for oficina/base). Clear |
| +-- every title Equipo chose itself, so each project shows its repository's |
| +-- name ("Equipo"). Data only: no row is removed, tasks keep their project, |
| +-- a title an owner set (title_set) stays, and a second run changes nothing. |
| UPDATE chat_projects |
| SET title = '', revision = coalesce(revision, 0) + 1 |
| WHERE coalesce(title_set, 0) = 0 |
| - AND lower(trim(coalesce(title, ''))) IN ( |
| - 'create', 'new', 'add', 'make', 'build', 'start', 'fix', 'update', 'change', 'edit', 'open', |
| - 'run', 'test', 'tests', 'generate', 'remove', 'delete', 'move', 'use', 'set', 'check', |
| - 'project', 'projects', 'repo', 'repository', 'app', 'apps', 'untitled', 'task', 'tasks', |
| - 'work', 'main', 'default', 'code', 'src', 'site', 'web', 'website', 'none', 'todo' |
| - ); |
| + AND coalesce(title, '') <> ''; |
diff --git a/internal/equipo/project_title_migration_test.go b/internal/equipo/project_title_migration_test.go| index f93df128..dc100cef 100644 |
| --- a/internal/equipo/project_title_migration_test.go |
| +++ b/internal/equipo/project_title_migration_test.go |
| @@ -2,7 +2,6 @@ package equipo |
| import ( |
| "context" |
| - "regexp" |
| "testing" |
| "amadan.net/oficina/equipo/internal/equipo/chat" |
| @@ -10,9 +9,10 @@ import ( |
| ) |
| // #49: project p_hydlybiyyy3jy574grtydymnyd (oficina/equipo) was stored |
| -// with the title "Create". The migration clears titles Equipo chose that |
| -// are bare verbs or generic words, so the project shows its repository's |
| -// name; a title an owner set stays, and so does every task. |
| +// with the title "Create". The migration clears every title Equipo chose |
| +// itself (title_set 0), so each project shows its repository's name ("Store" |
| +// for oficina/base was the same bug); a title an owner set stays, and so |
| +// does every task. A second run changes nothing. |
| func TestGenericProjectTitleMigration(t *testing.T) { |
| all := Schema.All() |
| at := -1 |
| @@ -34,20 +34,24 @@ func TestGenericProjectTitleMigration(t *testing.T) { |
| "INSERT INTO chat_projects(id,repo,title,title_set,state,revision) VALUES('p_hydlybiyyy3jy574grtydymnyd','amadan.net/oficina/equipo','Create',0,'active',1)", |
| "INSERT INTO chat_projects(id,repo,title,title_set,state,revision) VALUES('p_named','amadan.net/oficina/new','New',1,'active',3)", |
| "INSERT INTO chat_projects(id,repo,title,state,revision) VALUES('p_legacy','amadan.net/oficina/web','Project','active',1)", |
| - "INSERT INTO chat_projects(id,repo,title,title_set,state,revision) VALUES('p_fine','amadan.net/woodstar/app','Woodstar',0,'active',2)", |
| + "INSERT INTO chat_projects(id,repo,title,title_set,state,revision) VALUES('p_base','amadan.net/oficina/base','Store',0,'active',2)", |
| + "INSERT INTO chat_projects(id,repo,title,title_set,state,revision) VALUES('p_owner','amadan.net/oficina/alta','Alta provisioning',1,'active',4)", |
| + "INSERT INTO chat_projects(id,repo,title,title_set,state,revision) VALUES('p_clean','amadan.net/oficina/docs','',0,'active',5)", |
| "INSERT INTO chat_tasks(id,project_id,title,stage) VALUES('tkqpu72zbeuo','p_hydlybiyyy3jy574grtydymnyd','Swipe down to dismiss the keyboard on iOS','noted')", |
| } { |
| if _, err := d.ExecContext(ctx, q); err != nil { |
| t.Fatal(err) |
| } |
| } |
| - if _, err := d.ExecContext(ctx, all[at].SQL); err != nil { |
| - t.Fatal(err) |
| + for range 2 { |
| + if _, err := d.ExecContext(ctx, all[at].SQL); err != nil { |
| + t.Fatal(err) |
| + } |
| } |
| for id, want := range map[string]struct { |
| title string |
| revision int64 |
| - }{"p_hydlybiyyy3jy574grtydymnyd": {"", 2}, "p_named": {"New", 3}, "p_legacy": {"", 2}, "p_fine": {"Woodstar", 2}} { |
| + }{"p_hydlybiyyy3jy574grtydymnyd": {"", 2}, "p_named": {"New", 3}, "p_legacy": {"", 2}, "p_base": {"", 3}, "p_owner": {"Alta provisioning", 4}, "p_clean": {"", 5}} { |
| var title string |
| var revision int64 |
| if err := d.QueryRowContext(ctx, "SELECT title, revision FROM chat_projects WHERE id = ?", id).Scan(&title, &revision); err != nil { |
| @@ -57,17 +61,11 @@ func TestGenericProjectTitleMigration(t *testing.T) { |
| t.Errorf("%s: %q rev %d, want %q rev %d", id, title, revision, want.title, want.revision) |
| } |
| } |
| - if got := chat.ProjectTitle("amadan.net/oficina/equipo", nil); got != "Equipo" { |
| + if got := chat.ProjectTitle("amadan.net/oficina/equipo"); got != "Equipo" { |
| t.Fatalf("cleared title shows %q", got) |
| } |
| var project string |
| if err := d.QueryRowContext(ctx, "SELECT project_id FROM chat_tasks WHERE id = 'tkqpu72zbeuo'").Scan(&project); err != nil || project != "p_hydlybiyyy3jy574grtydymnyd" { |
| t.Fatal("task lost its project", project, err) |
| } |
| - // The migration's words are titles the tool refuses. |
| - for _, m := range regexp.MustCompile(`'([a-z]+)'`).FindAllStringSubmatch(all[at].SQL, -1) { |
| - if chat.UsableProjectTitle(m[1]) { |
| - t.Errorf("migration clears %q, which the tool accepts", m[1]) |
| - } |
| - } |
| } |
diff --git a/internal/headless/merge_test.go b/internal/headless/merge_test.go| index e76d50a3..d23fc278 100644 |
| --- a/internal/headless/merge_test.go |
| +++ b/internal/headless/merge_test.go |
| @@ -93,7 +93,7 @@ func scenarioChecksCard(t *testing.T, env *Env) { |
| id := s.taskOf(t, sent.Turn.ID) |
| card := s.mergeCard(t, id) |
| k, _ := env.Client.Task(s.ctx, id) |
| - if k.Stage != wire.StageReadyToMerge || k.Checks != wire.ChecksCannotRun || k.NeedsYou != wire.NeedsMerge || card.Question != "Merge iOS edge swipe? I'd wait: I don't know yet whether merging to Woodstar's main branch ships to users." || card.State != wire.CardOpen { |
| + if k.Stage != wire.StageReadyToMerge || k.Checks != wire.ChecksCannotRun || k.NeedsYou != wire.NeedsMerge || card.Question != "Merge iOS edge swipe? I'd wait: I don't know yet whether merging to Sample's main branch ships to users." || card.State != wire.CardOpen { |
| t.Fatalf("asking %+v card %+v", k, card) |
| } |
| tip := forgeHead(t, bare, "main") |
| @@ -156,7 +156,7 @@ func scenarioChecksCard(t *testing.T, env *Env) { |
| if swift := forgeShow(t, bare, "main:ios/App.swift"); !strings.Contains(swift, "import SwiftUI // iPad") || !strings.Contains(swift, "edgeSwipe = true") { |
| t.Fatalf("main ios/App.swift: %s", swift) |
| } |
| - s.mergedLine(t, id2, "Merged [iPad edge swipe](/tasks/"+id2+") into Woodstar without checks.") |
| + s.mergedLine(t, id2, "Merged [iPad edge swipe](/tasks/"+id2+") into Sample without checks.") |
| // Merge authority: the owner says Woodstar's main is not a release, and |
| // the next small iOS change, measured by the real runner's review, |
diff --git a/internal/headless/review_test.go b/internal/headless/review_test.go| index 8844f871..3af5d0f5 100644 |
| --- a/internal/headless/review_test.go |
| +++ b/internal/headless/review_test.go |
| @@ -150,7 +150,7 @@ func scenarioReview(t *testing.T, env *Env) { |
| t.Fatalf("review findings %+v", f) |
| } |
| // The coordinator says so at the outcome level, once. |
| - s.mergedLine(t, id, "Merged [Make edge swipe go back](/tasks/"+id+") into Woodstar.") |
| + s.mergedLine(t, id, "Merged [Make edge swipe go back](/tasks/"+id+") into Sample.") |
| Witness[t.Name()].(map[string]any)["merged"] = k.Merged |
| Witness[t.Name()].(map[string]any)["merged_s"] = merged.Sub(start).Seconds() |
| if needs, _ := env.Client.NeedsYou(s.ctx); len(needs.Items) != 0 { |
diff --git a/internal/thintest/merge_contract_test.go b/internal/thintest/merge_contract_test.go| index 475114d6..e451cb87 100644 |
| --- a/internal/thintest/merge_contract_test.go |
| +++ b/internal/thintest/merge_contract_test.go |
| @@ -91,7 +91,7 @@ func TestContractAutoMerge(t *testing.T) { |
| if i, j := slices.Index(stages, wire.StageReadyToMerge), slices.Index(stages, wire.StageMerging); i < 0 || j < i || !slices.Contains(stages, wire.StageDone) { |
| t.Fatalf("stages %v", stages) |
| } |
| - want := "Merged [Fix the README typo](/tasks/" + id + ") into Woodstar." |
| + want := "Merged [Fix the README typo](/tasks/" + id + ") into Sample." |
| r.wait("the coordinator's line", func(c *Conversation) bool { |
| rs := c.Replies() |
| return len(rs) > 0 && rs[len(rs)-1].Text == want |
| @@ -158,7 +158,7 @@ func TestContractMergeWithoutChecks(t *testing.T) { |
| } |
| }) |
| shape(t, "api/card-merge.json", card) |
| - if cards != 1 || card.State != wire.CardOpen || card.Question != "Merge Swipe back on iOS? I'd wait: I don't know yet whether merging to Woodstar's main branch ships to users." || !slices.Equal(card.Options, []string{"merge", "wait_mac"}) || card.Name != "Swipe back on iOS" || card.TaskID != id { |
| + if cards != 1 || card.State != wire.CardOpen || card.Question != "Merge Swipe back on iOS? I'd wait: I don't know yet whether merging to Sample's main branch ships to users." || !slices.Equal(card.Options, []string{"merge", "wait_mac"}) || card.Name != "Swipe back on iOS" || card.TaskID != id { |
| t.Fatalf("merge card %+v (%d)", card, cards) |
| } |
| if r.heldKinds(wire.FrameDispatch) != 0 { |
| @@ -239,7 +239,7 @@ func TestContractMergeWithoutChecks(t *testing.T) { |
| if k, _ := r.client.Task(ctx, id2); k.Merged == nil || !k.Merged.WithoutChecks || !k.Steps[len(k.Steps)-1].WithoutChecks { |
| t.Fatalf("merged without checks %+v", k.Merged) |
| } |
| - want := "Merged [Edge swipe on iPad](/tasks/" + id2 + ") into Woodstar without checks." |
| + want := "Merged [Edge swipe on iPad](/tasks/" + id2 + ") into Sample without checks." |
| r.wait("the coordinator's line", func(c *Conversation) bool { |
| rs := c.Replies() |
| return len(rs) > 0 && rs[len(rs)-1].Text == want |
diff --git a/internal/thintest/mergeauth_contract_test.go b/internal/thintest/mergeauth_contract_test.go| index 02b0da62..097a371f 100644 |
| --- a/internal/thintest/mergeauth_contract_test.go |
| +++ b/internal/thintest/mergeauth_contract_test.go |
| @@ -174,7 +174,7 @@ func TestContractMergeAuthorityAct(t *testing.T) { |
| } |
| return false |
| }) |
| - want := "Merged [Swipe back from the edge](/tasks/" + id + ") into Woodstar without checks: approved by Review, a small change, 12 lines in one file, nothing ships until a release." |
| + want := "Merged [Swipe back from the edge](/tasks/" + id + ") into Sample without checks: approved by Review, a small change, 12 lines in one file, nothing ships until a release." |
| if receipt.Question != want || !slices.Equal(receipt.Options, []string{"undo"}) { |
| t.Fatalf("receipt %+v", receipt) |
| } |
| @@ -449,7 +449,7 @@ func TestContractShipsQuestion(t *testing.T) { |
| base := strings.Repeat("1", 40) |
| id, _ := r.measured("s", "Swipe back", base, strings.Repeat("2", 40), wire.ChecksCannotRun, "needs_macos", func(d *wire.DispatchCommand) *wire.ChangeFacts { return facts(d) }) |
| card := r.mergeCardsWait(id) |
| - if !strings.Contains(card.Question, "I don't know yet whether merging to Woodstar's main branch ships to users") { |
| + if !strings.Contains(card.Question, "I don't know yet whether merging to Sample's main branch ships to users") { |
| t.Fatalf("card %+v", card) |
| } |
| var ships wire.Card |
| @@ -462,7 +462,7 @@ func TestContractShipsQuestion(t *testing.T) { |
| } |
| return false |
| }) |
| - if ships.Question != "Does merging to Woodstar's main branch ship to users?" || !slices.Equal(ships.Options, []string{"ships", "not_ships"}) { |
| + if ships.Question != "Does merging to Sample's main branch ship to users?" || !slices.Equal(ships.Options, []string{"ships", "not_ships"}) { |
| t.Fatalf("ships %+v", ships) |
| } |
| // A second task asking on the same unknown: no second question. |
| @@ -555,7 +555,7 @@ func TestContractUndoMerge(t *testing.T) { |
| if err != nil { |
| t.Fatal(err) |
| } |
| - if !strings.HasPrefix(out.Card.Question, "Reverting it: [Revert eeeeeee in Woodstar](/tasks/") { |
| + if !strings.HasPrefix(out.Card.Question, "Reverting it: [Revert eeeeeee in Sample](/tasks/") { |
| t.Fatalf("receipt after undo %+v", out.Card) |
| } |
| _, body := r.expect(wire.FrameDispatch) |
diff --git a/internal/thintest/pages_test.go b/internal/thintest/pages_test.go| index 9b727777..304ffcc5 100644 |
| --- a/internal/thintest/pages_test.go |
| +++ b/internal/thintest/pages_test.go |
| @@ -124,7 +124,7 @@ func TestPagesTasksAndProjects(t *testing.T) { |
| r.step("r-pm", wire.StepReport{TaskID: id, StepID: m.StepID, Attempt: 1, State: wire.StepDone, BaseSHA: base, CandidateSHA: cand, Termination: true, MergeSHA: strings.Repeat("e", 40), Into: "main", Strategy: wire.MergeCommit}) |
| r.wait("done", func(c *Conversation) bool { return c.Tasks[id].Stage == wire.StageDone }) |
| page = r.get(owner, "/conversation", 200) |
| - for _, want := range []string{">Done<", "Merged into main at eeeeeee", `href="https://amadan.net/oficina/sample" rel="noopener" target="_blank" data-open-amadan>Open on Amadan</a>`, `Swipe back does nothing</a> into Woodstar.`} { |
| + for _, want := range []string{">Done<", "Merged into main at eeeeeee", `href="https://amadan.net/oficina/sample" rel="noopener" target="_blank" data-open-amadan>Open on Amadan</a>`, `Swipe back does nothing</a> into Sample.`} { |
| if !strings.Contains(page, want) { |
| t.Fatalf("merged card lacks %q: %s", want, page) |
| } |
| @@ -139,7 +139,7 @@ func TestPagesTasksAndProjects(t *testing.T) { |
| list := r.get(owner, "/tasks", 200) |
| // Rows: the whole row links the task; who filed it and from where; the |
| // Done group; the project by name; the detail line says Merged. |
| - for _, want := range []string{`data-task="` + id + `"`, `equipo-row-link href="/tasks/` + id + `"`, `<span equipo-project-name>Woodstar</span>`, ">You</span>", "From your conversation, ", `data-group="done"`, ">Merged.</span>"} { |
| + for _, want := range []string{`data-task="` + id + `"`, `equipo-row-link href="/tasks/` + id + `"`, `<span equipo-project-name>Sample</span>`, ">You</span>", "From your conversation, ", `data-group="done"`, ">Merged.</span>"} { |
| if !strings.Contains(list, want) { |
| t.Fatalf("Tasks page lacks %q", want) |
| } |
| @@ -165,7 +165,7 @@ func TestPagesTasksAndProjects(t *testing.T) { |
| } |
| projects := r.get(owner, "/projects", 200) |
| // Its one task is merged: nothing open, said in words, no empty bar. |
| - for _, want := range []string{"data-thin-projects", "Woodstar", "1 repository", "data-no-open>No open tasks<", "Woodstar is a reading app.", "Checks run here (make ci)"} { |
| + for _, want := range []string{"data-thin-projects", "Sample", "1 repository", "data-no-open>No open tasks<", "Woodstar is a reading app.", "Checks run here (make ci)"} { |
| if !strings.Contains(projects, want) { |
| t.Fatalf("Projects page lacks %q", want) |
| } |
diff --git a/internal/thintest/projects_pages_test.go b/internal/thintest/projects_pages_test.go| index 01c850ac..cdd2fd07 100644 |
| --- a/internal/thintest/projects_pages_test.go |
| +++ b/internal/thintest/projects_pages_test.go |
| @@ -98,7 +98,7 @@ func newProjectsRig(t *testing.T) (*toolRig, map[string]string) { |
| for _, p := range projects.Items { |
| ids[p.Title] = p.ID |
| } |
| - woodstar, p1, p2, p3 := ids["Woodstar"], ids["P1"], ids["P2"], ids["P3"] |
| + woodstar, p1, p2, p3 := ids["Sample"], ids["P1"], ids["P2"], ids["P3"] |
| if woodstar != task.ProjectID || p1 == "" || p2 == "" || p3 == "" || len(ids) != 10 { |
| t.Fatalf("projects: %v", ids) |
| } |
| @@ -119,17 +119,17 @@ func newProjectsRig(t *testing.T) (*toolRig, map[string]string) { |
| func TestPagesProjectsOrderAndStars(t *testing.T) { |
| r, ids := newProjectsRig(t) |
| owner := r.inst.Cookie() |
| - woodstar, p1, p2, p3 := ids["Woodstar"], ids["P1"], ids["P2"], ids["P3"] |
| + woodstar, p1, p2, p3 := ids["Sample"], ids["P1"], ids["P2"], ids["P3"] |
| page := r.get(owner, "/projects", 200) |
| // Auto-star: the project with the most tasks waiting on the owner, |
| // with a receipt and its Undo. |
| - if !strings.Contains(page, "Starred Woodstar: 2 tasks are waiting on you") || !strings.Contains(page, `<form method="post" action="/projects/`+woodstar+`/star"><input type="hidden" name="starred" value="0"><button equipo-link type="submit" data-star-undo>Undo</button>`) { |
| + if !strings.Contains(page, "Starred Sample: 2 tasks are waiting on you") || !strings.Contains(page, `<form method="post" action="/projects/`+woodstar+`/star"><input type="hidden" name="starred" value="0"><button equipo-link type="submit" data-star-undo>Undo</button>`) { |
| t.Fatalf("no receipt with Undo:\n%s", page) |
| } |
| if g := groupOf(t, page, woodstar); g != "starred" { |
| t.Fatalf("Woodstar in %q", g) |
| } |
| - if row := rowOf(t, page, woodstar); !strings.Contains(row, `aria-pressed="true" data-auto aria-label="Unstar Woodstar" title="Starred by Equipo: 2 tasks are waiting on you"`) { |
| + if row := rowOf(t, page, woodstar); !strings.Contains(row, `aria-pressed="true" data-auto aria-label="Unstar Sample" title="Starred by Equipo: 2 tasks are waiting on you"`) { |
| t.Fatalf("auto star's hover: %s", row) |
| } |
| if g := groupOf(t, page, p1); g != "active" { |
| @@ -174,7 +174,7 @@ func TestPagesProjectsOrderAndStars(t *testing.T) { |
| for i := 0; i < 2; i++ { |
| page = r.get(owner, "/projects", 200) |
| } |
| - if g := groupOf(t, page, woodstar); g != "active" || strings.Contains(page, "Starred Woodstar") || !strings.Contains(rowOf(t, page, woodstar), `aria-pressed="false" aria-label="Star Woodstar"`) { |
| + if g := groupOf(t, page, woodstar); g != "active" || strings.Contains(page, "Starred Sample") || !strings.Contains(rowOf(t, page, woodstar), `aria-pressed="false" aria-label="Star Sample"`) { |
| t.Fatalf("after Undo Woodstar is in %q:\n%s", g, page) |
| } |
| // The owner stars p1 themselves; the project page says who. |
diff --git a/internal/thintest/report_actions_browser_test.go b/internal/thintest/report_actions_browser_test.go| index 07243ab7..5d1b02fd 100644 |
| --- a/internal/thintest/report_actions_browser_test.go |
| +++ b/internal/thintest/report_actions_browser_test.go |
| @@ -137,7 +137,7 @@ func TestBrowserReportThread(t *testing.T) { |
| p.click(`[data-report-thread] [data-thread-send]`) |
| f, b := r.expect(wire.FrameMessage) |
| m := b.(*wire.MessageCommand) |
| - for _, want := range []string{id, "Show immediate loading feedback", "Woodstar", "in_review", "changes_requested"} { |
| + for _, want := range []string{id, "Show immediate loading feedback", "Sample", "in_review", "changes_requested"} { |
| if !strings.Contains(m.Text, want) { |
| t.Fatalf("missing context %q: %s", want, m.Text) |
| } |
diff --git a/internal/thintest/roster_browser_test.go b/internal/thintest/roster_browser_test.go| index e0b036d4..93cbe49e 100644 |
| --- a/internal/thintest/roster_browser_test.go |
| +++ b/internal/thintest/roster_browser_test.go |
| @@ -37,7 +37,7 @@ func TestBrowserRosterVisual(t *testing.T) { |
| p.check(`document.querySelector('[equipo-roster-report] [aria-current]').dataset.tone==='warning'`, "waiting for you looks failed") |
| p.check(`[...document.querySelectorAll('[equipo-roster-facts] small')].every(e=>getComputedStyle(e).whiteSpace==='normal' && e.scrollWidth<=e.clientWidth+1)`, "fact details truncate") |
| p.check(`(()=>{const c=document.querySelector('[equipo-roster-byline] b'),m=document.querySelector('[equipo-message="incoming"] [equipo-message-meta] strong');return !m||getComputedStyle(c).fontSize===getComputedStyle(m).fontSize})()`, "byline sizes differ") |
| - p.check(`[...document.querySelectorAll('[equipo-card="task"], [equipo-card="merge"]')].every(c=>c.querySelector('[equipo-roster-project]')?.textContent.includes('Woodstar') && c.querySelector('[equipo-roster-project] [equipo-mono]'))`, "task and coordinator cards lack project context") |
| + p.check(`[...document.querySelectorAll('[equipo-card="task"], [equipo-card="merge"]')].every(c=>c.querySelector('[equipo-roster-project]')?.textContent.includes('Sample') && c.querySelector('[equipo-roster-project] [equipo-mono]'))`, "task and coordinator cards lack project context") |
| p.check(`(()=>{const c=document.querySelector('[equipo-roster-card]'),b=c.previousElementSibling,r=c.querySelector('[equipo-roster-report]');return parseFloat(getComputedStyle(c).paddingTop)===0 && parseFloat(getComputedStyle(b).marginBottom)===8 && parseFloat(getComputedStyle(r).rowGap)===12 && parseFloat(getComputedStyle(c.querySelector('[equipo-roster-facts]')).paddingTop)===12})()`, "report spacing left the inset scale") |
| if width == 390 { |
| p.check(`document.querySelector('[equipo-roster-links] [data-report-next]').getBoundingClientRect().height>=44`, "task button lost its phone target") |
| @@ -76,7 +76,7 @@ func TestBrowserRosterSetAside(t *testing.T) { |
| p.check(`(()=>{const s=document.querySelector('[equipo-aside-stub]');return parseFloat(getComputedStyle(s).fontSize)<=14 && s.querySelector('[data-aside-title]') && s.getBoundingClientRect().height<=64})()`, "aside is a full question instead of a compact stub") |
| p.check(`(()=>{const t=document.querySelector('[equipo-roster-toast]'),c=document.querySelector('#chat-composer');return t.getBoundingClientRect().left>=c.getBoundingClientRect().left && t.getBoundingClientRect().bottom<=c.getBoundingClientRect().bottom})()`, "toast outside composer column") |
| p.check(`(()=>{const t=document.querySelector('[equipo-roster-toast]').getBoundingClientRect(),b=document.querySelector('[data-turn-stop]')?.getBoundingClientRect();return !b || (b.bottom<=t.top && b.bottom<=document.querySelector('[equipo-scroll]').getBoundingClientRect().bottom)})()`, "toast covers Stop") |
| - p.check(`document.querySelector('`+card+` [equipo-roster-project]')?.textContent.includes('Woodstar')`, "aside lost project context") |
| + p.check(`document.querySelector('`+card+` [equipo-roster-project]')?.textContent.includes('Sample')`, "aside lost project context") |
| if width == 390 { |
| p.check(`document.querySelector('[equipo-aside-stub] button').getBoundingClientRect().width>=44`, "Undo has a narrow phone target") |
| } |
| @@ -152,7 +152,7 @@ func TestBrowserRosterSubchat(t *testing.T) { |
| p.wait(`document.querySelector('[data-question-thread]').textContent.includes('I’ll start with the sign-in page.')`, "thread after reload") |
| p.check(`!document.querySelector('[equipo-thread-turn][data-own] [equipo-thread-who]')`, "own thread turn repeats a byline") |
| p.check(`parseFloat(getComputedStyle(document.querySelector('[data-first] [equipo-thread-bubble]')).fontWeight)<600`, "question is entirely title weight") |
| - p.check(`(()=>{const c=document.querySelector('[data-question-thread]').closest('[data-card]');return c.querySelector('[equipo-roster-project]')?.textContent.includes('Woodstar') && c.querySelector('[equipo-roster-task]')?.textContent==='Improve sign-in'})()`, "thread lost project or task context") |
| + p.check(`(()=>{const c=document.querySelector('[data-question-thread]').closest('[data-card]');return c.querySelector('[equipo-roster-project]')?.textContent.includes('Sample') && c.querySelector('[equipo-roster-task]')?.textContent==='Improve sign-in'})()`, "thread lost project or task context") |
| p.fits("sub-chat") |
| p.shot(fmt.Sprintf("roster-thread-answered-%d-%s", width, scheme)) |
| p.check(`(()=>{const i=document.querySelector('[data-question-thread] [equipo-mini-composer] textarea');i.value='Keep the email link.';i.dispatchEvent(new Event('input',{bubbles:true}));return true})()`, "follow-up") |
| @@ -220,7 +220,7 @@ func TestBrowserRosterDecisionStates(t *testing.T) { |
| if k := r.task(id); k.Stage != wire.StageInProgress { |
| t.Fatalf("note did not choose another round: %s", k.Stage) |
| } |
| - p.check(`document.querySelector('`+card+` [equipo-roster-project]')?.textContent.includes('Woodstar')`, "decision lost project context") |
| + p.check(`document.querySelector('`+card+` [equipo-roster-project]')?.textContent.includes('Sample')`, "decision lost project context") |
| p.fits("direction states") |
| p.shot(fmt.Sprintf("roster-decision-sent-%d-%s", width, scheme)) |
| build := `[data-card="` + built.ID + `"]` |
diff --git a/internal/thintest/rows_pages_test.go b/internal/thintest/rows_pages_test.go| index 47dba2c9..fe29621d 100644 |
| --- a/internal/thintest/rows_pages_test.go |
| +++ b/internal/thintest/rows_pages_test.go |
| @@ -64,7 +64,7 @@ func TestPagesTaskRows(t *testing.T) { |
| } |
| // The project, the stepper's words, who and from where, the age. |
| retry := taskRow(t, tasks, f.retry) |
| - for _, want := range []string{`data-placement-task="` + f.retry + `"`, `href="/tasks/` + f.retry + `/move"`, `<span equipo-project-name>Woodstar</span>`, |
| + for _, want := range []string{`data-placement-task="` + f.retry + `"`, `href="/tasks/` + f.retry + `/move"`, `<span equipo-project-name>Sample</span>`, |
| `role="img" aria-label="Step 3 of 6"`, ">Stopped: the model connection failed</p>", |
| "<span data-short>Conversation, ", "<span data-long>From your conversation, ", ">You</span>", "equipo-ago data-at=", `aria-label="More actions"`, |
| `href="/conversation?about=` + f.retry + `" data-ask-about>Ask about this</a>`} { |
diff --git a/internal/thintest/tasks_contract_test.go b/internal/thintest/tasks_contract_test.go| index b458ceed..5ad5b3d5 100644 |
| --- a/internal/thintest/tasks_contract_test.go |
| +++ b/internal/thintest/tasks_contract_test.go |
| @@ -99,7 +99,7 @@ func TestContractTasks(t *testing.T) { |
| if err != nil { |
| t.Fatal(err) |
| } |
| - if task.Branch != wire.TaskBranch(id, task.Title) || task.Project != "Woodstar" || task.Repo != "amadan.net/oficina/sample" || task.Creator != Owner || len(task.Steps) != 0 { |
| + if task.Branch != wire.TaskBranch(id, task.Title) || task.Project != "Sample" || task.Repo != "amadan.net/oficina/sample" || task.Creator != Owner || len(task.Steps) != 0 { |
| t.Fatalf("task %+v", task) |
| } |
| var project wire.Project |
| @@ -109,7 +109,7 @@ func TestContractTasks(t *testing.T) { |
| } |
| }) |
| // Projects are products: named from the catalog, with the repository attached. |
| - if project.Title != "Woodstar" || len(project.Attachments) != 1 || project.Attachments[0].Ref != "amadan.net/oficina/sample" || task.ProjectID != project.ID { |
| + if project.Title != "Sample" || len(project.Attachments) != 1 || project.Attachments[0].Ref != "amadan.net/oficina/sample" || task.ProjectID != project.ID { |
| t.Fatalf("project %+v", project) |
| } |