oficina / equipo Public

Fix false access cards (#48) and projects titled Create (#49)

Human

Prompt

Fix two Equipo bugs that Paul hit in production, filed as hub discussions oficina/equipo #48 and #49. Yes, and pick them up here?

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

#48: find raises an access card only for a real ns/repo or namespace the agent does not reach (AccessTarget + reaches); free text such as 'iOS keyboard' is refused with not_a_repository and no card. request_access refuses a target already reached (already_reached). A turn's open find card resolves as not needed (choice not_needed) once record_task files the task in a reachable repository, and the runner's hello resolves open find cards whose target fails validation or is already reached (the housekeeping that clears Paul's existing card). The web card says 'No new access is needed for this.' (chat.card.access_not_needed, pending review). #49: ProjectTitle took catalog Names[1], which for oficina/equipo was 'Create' (a capitalised word its README and AGENTS.md repeat; the real 'Equipo' heading was deduped against the repo name). Titles now come from the repository's name; UsableProjectTitle refuses bare verbs and generic words; shownTitle ignores a stored generic title Equipo chose. Migration 0103 clears such stored titles (owner-set ones stay), so p_hydlybiyyy3jy574grtydymnyd shows 'Equipo' and keeps task tkqpu72zbeuo.
Agent notes
No project for amadan.net/oficina/equipo could have existed before p_hydlybiyyy3jy574grtydymnyd: chat_projects.repo is uniquely indexed and addProject restores a removed one under its old id, so this is a rename, not a merge. AccessName was replaced by AccessTarget (TestAccessName became TestAccessTarget). namedProject still matches a repo basename for untitled projects so 'new' finds oficina/new. Migration is 0103 because origin/github/connect-app holds a 0102.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev e3702440815dc95fb1aef10d131d4edb6e0d5d4e parent eff421c
17 files changed, +542 −77
  • docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md +1 −0
  • internal/equipo/chat/access_need_test.go +250 −0
  • internal/equipo/chat/access_request.go +10 −0
  • internal/equipo/chat/merge.go +1 −4
  • internal/equipo/chat/mergeauth.go +4 −16
  • internal/equipo/chat/project_names.go +2 −1
  • internal/equipo/chat/projects.go +11 −4
  • internal/equipo/chat/stars.go +1 −4
  • internal/equipo/chat/tasks.go +39 −16
  • internal/equipo/chat/tools.go +89 −24
  • internal/equipo/chat_page.go +5 −0
  • internal/equipo/copy.go +1 −0
  • internal/equipo/migrations/0103_generic_project_titles.sql +15 −0
  • internal/equipo/project_title_migration_test.go +73 −0
  • internal/thintest/empty_repo_contract_test.go +9 −8
  • internal/thintest/pages_test.go +26 −0
  • internal/wire/tasks.go +5 −0
diff --git a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
index bc02f046..822b6ae3 100644
--- a/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
+++ b/docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md
@@ -6845,6 +6845,7 @@ records remain unchanged.
| `work.reason.tools_refused` | Equipo refused the commands it needed to run | Task page: fills "Engineering stopped: %s" when an Engineering step committed nothing after Equipo refused tool requests it made (stop reasons, 2026-11-23) | Runtime; COPY APPROVED (Paul, 2026-11-23, copy-review eavqvil43jg2zs3wxx3kxp3bpm, unchanged) |
| `work.reason.proposal_failed` | the branch was pushed, but the review request could not be created | Successful push diagnostic (GitHub seam, 2026-11-23; Luna, house rules) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
| `CopyGitHubEgress` | GitHub reachable: %t; status: %d; latency: %s; TLS peer: %s<br> | GitHub egress check (2026-11-23; Luna, house rules) | COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23) |
+| `chat.card.access_not_needed` | No new access is needed for this. | Copy specialist | COPY REVIEW PENDING |
## Task 21
diff --git a/internal/equipo/chat/access_need_test.go b/internal/equipo/chat/access_need_test.go
new file mode 100644
index 00000000..a27317db
--- /dev/null
+++ b/internal/equipo/chat/access_need_test.go
@@ -0,0 +1,250 @@
+package chat
+
+import (
+ "context"
+ "encoding/json"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/wire"
+ "gorm.io/gorm"
+)
+
+// swipeWords is what Paul said on 2026-11-23 (hub oficina/equipo #48, #49).
+const swipeWords = "On iOS, the keyboard should be dismissible with a swipe."
+
+// swipeHello is his runner's reach that day: four namespaces, and
+// oficina/equipo read with the names its README and AGENTS.md give it
+// ("Create" is a capitalised word that appears twice in them).
+func swipeHello() wire.Hello {
+ return wire.Hello{
+ Agent: "claude~paul@keymail.dev",
+ Repos: []string{"amadan.net/carlos/platform", "amadan.net/oficina/equipo", "amadan.net/oficina/old", "amadan.net/oficina/new", "amadan.net/paulca/threatmin", "amadan.net/woodstar/app"},
+ CreateIn: []string{"oficina"},
+ Catalog: []wire.RepoInfo{
+ {Repo: "amadan.net/oficina/equipo", Names: []string{"equipo", "Create", "Generate", "Owners", "Open"}, Hints: []string{"go"}, Summary: "An Oficina app: a coordinator and a team of AI specialists."},
+ {Repo: "amadan.net/carlos/platform", Names: []string{"platform"}, Hints: []string{}},
+ {Repo: "amadan.net/paulca/threatmin", Names: []string{"threatmin"}, Hints: []string{}},
+ {Repo: "amadan.net/woodstar/app", Names: []string{"app", "Woodstar"}, Hints: []string{}},
+ },
+ }
+}
+
+// swipeRig is that conversation's turn, running, with the person's words.
+func swipeRig(t *testing.T) (*meteredRig, turnRecord, Lease) {
+ t.Helper()
+ r := placementRig(t)
+ r.s.authority.CurrentRunner = func(*gorm.DB, RunnerPrincipal) error { return nil }
+ h, _ := json.Marshal(swipeHello())
+ if err := r.s.db.G.Model(&runnerSessionRecord{}).Where("runner_id = ?", "RUNNER1").Update("hello", string(h)).Error; err != nil {
+ t.Fatal(err)
+ }
+ turn := turnRecord{ID: "tr_swipe", Person: hkOwner, Kind: wire.TurnPerson, State: wire.TurnRunning, Attempt: 1}
+ for _, row := range []any{&turn, &messageRecord{ID: "m_swipe", Person: hkOwner, TurnID: turn.ID, Role: wire.RolePerson, Text: swipeWords, Origin: originComposer}} {
+ if err := r.s.db.G.Create(row).Error; err != nil {
+ t.Fatal(err)
+ }
+ }
+ return r, turn, Lease{Runner: RunnerPrincipal{Person: hkOwner, RunnerID: "RUNNER1"}, Protocol: wire.ProtocolCurrent}
+}
+
+// callTool sends one Coordinator tool call the way the runner does and
+// returns the result it is sent back.
+func callTool(t *testing.T, r *meteredRig, l Lease, turn turnRecord, id, name string, args any) wire.ToolResult {
+ t.Helper()
+ raw, _ := json.Marshal(args)
+ call := wire.ToolCall{CallID: id, TurnID: turn.ID, Attempt: turn.Attempt, Name: name, Args: raw}
+ frame, _ := wire.NewFrame("frame-"+id, wire.FrameToolCall, call)
+ if err := r.s.Apply(context.Background(), l, frame, &call); err != nil {
+ t.Fatalf("%s: %v", name, err)
+ }
+ var cmd commandRecord
+ if err := r.s.db.G.Last(&cmd, "kind = ?", wire.FrameToolResult).Error; err != nil {
+ t.Fatal(err)
+ }
+ var res wire.ToolResult
+ if err := json.Unmarshal([]byte(cmd.Body), &res); err != nil {
+ t.Fatal(err)
+ }
+ if res.CallID != id {
+ t.Fatalf("%s: result for %q", name, res.CallID)
+ }
+ return res
+}
+
+func accessCards(t *testing.T, r *meteredRig) []cardRecord {
+ t.Helper()
+ var cards []cardRecord
+ if err := r.s.db.G.Where("kind = ?", wire.CardAccess).Order("created_at").Find(&cards).Error; err != nil {
+ t.Fatal(err)
+ }
+ return cards
+}
+
+// #48 and #49: the Coordinator looked for "iOS keyboard", then filed the
+// task in oficina/equipo. Looking for a feature raises no access card, and
+// the project made for the task is called Equipo, not "Create".
+func TestSwipeConversationNoFalseAccessCardAndRepoTitle(t *testing.T) {
+ r, turn, l := swipeRig(t)
+ found := callTool(t, r, l, turn, "call-find", wire.ToolFind, map[string]string{"query": "iOS keyboard"})
+ if !found.IsError || found.Code != "not_a_repository" {
+ t.Fatalf("find of a feature: %+v", found)
+ }
+ if cards := accessCards(t, r); len(cards) != 0 {
+ t.Fatalf("access card for a feature: %+v", cards)
+ }
+ recorded := callTool(t, r, l, turn, "call-record", wire.ToolRecordTask, map[string]string{"repo": "amadan.net/oficina/equipo", "title": "Swipe down to dismiss the keyboard on iOS", "brief": "On iOS, the keyboard should be dismissible with a swipe."})
+ if recorded.IsError || recorded.Code != "recorded" {
+ t.Fatalf("record: %+v", recorded)
+ }
+ var projects []projectRecord
+ if err := r.s.db.G.Where("repo = ?", "amadan.net/oficina/equipo").Find(&projects).Error; err != nil {
+ t.Fatal(err)
+ }
+ if len(projects) != 1 || projects[0].Title != "Equipo" || projects[0].TitleSet {
+ t.Fatalf("project: %+v", projects)
+ }
+ // A second task for the same repository goes in the same project.
+ again := callTool(t, r, l, turn, "call-record-2", wire.ToolRecordTask, map[string]any{"repo": "oficina/equipo", "title": "Keep the keyboard toolbar above the swipe area", "brief": "Second task.", "separate": true})
+ if again.Code != "recorded" {
+ t.Fatalf("second record: %+v", again)
+ }
+ var n int64
+ r.s.db.G.Model(&projectRecord{}).Where("repo = ?", "amadan.net/oficina/equipo").Count(&n)
+ if n != 1 {
+ t.Fatalf("projects for one repository: %d", n)
+ }
+}
+
+// An access card a find raised before this fix (the 2026-11-23 card, for
+// "iOS keyboard") resolves itself once its turn files the task in a
+// project whose repository the agent reaches: the need has passed.
+func TestOpenAccessCardResolvesWhenTaskFindsReachableRepo(t *testing.T) {
+ r, turn, l := swipeRig(t)
+ old := cardRecord{ID: "c_keyboard", Person: hkOwner, Kind: wire.CardAccess, State: wire.CardOpen, TurnID: turn.ID, Question: "iOS keyboard", Options: `["carlos","oficina","paulca","woodstar"]`, Choice: "claude~paul@keymail.dev", Name: "keyboard", Revision: 1}
+ if err := r.s.db.G.Create(&old).Error; err != nil {
+ t.Fatal(err)
+ }
+ recorded := callTool(t, r, l, turn, "call-record", wire.ToolRecordTask, map[string]string{"repo": "amadan.net/oficina/equipo", "title": "Swipe down to dismiss the keyboard on iOS", "brief": swipeWords})
+ if recorded.Code != "recorded" {
+ t.Fatalf("record: %+v", recorded)
+ }
+ var c cardRecord
+ if err := r.s.db.G.First(&c, "id = ?", old.ID).Error; err != nil {
+ t.Fatal(err)
+ }
+ if c.State != wire.CardResolved || c.Choice != wire.ChoiceNotNeeded || c.Revision != 2 {
+ t.Fatalf("card left open: %+v", c)
+ }
+}
+
+// Housekeeping on the runner's hello: an open access card whose target is
+// not a repository or namespace (the old free text), or one the agent
+// already reaches, resolves as not needed. A real unreached one stays.
+func TestHelloResolvesAccessCardsThatFailValidation(t *testing.T) {
+ r, _, _ := swipeRig(t)
+ cards := []cardRecord{
+ {ID: "c_free", Question: "iOS keyboard", Name: "keyboard"},
+ {ID: "c_vague", Question: "the login bug", Name: ""},
+ {ID: "c_reached", Question: "oficina/equipo", Name: "oficina/equipo"},
+ {ID: "c_real", Question: "tito/website", Name: "tito/website"},
+ {ID: "c_ns", Question: "tito", Name: "tito"},
+ }
+ for i := range cards {
+ c := &cards[i]
+ c.Person, c.Kind, c.State, c.TurnID, c.Options, c.Choice, c.Revision = hkOwner, wire.CardAccess, wire.CardOpen, "tr_old", `["oficina"]`, "claude~paul@keymail.dev", 1
+ if err := r.s.db.G.Create(c).Error; err != nil {
+ t.Fatal(err)
+ }
+ }
+ if err := r.s.tx(context.Background(), func(tx *txn) error {
+ return tx.resolveAccess(hkOwner, swipeHello())
+ }); err != nil {
+ t.Fatal(err)
+ }
+ want := map[string]string{"c_free": wire.ChoiceNotNeeded, "c_vague": wire.ChoiceNotNeeded, "c_reached": "", "c_real": "open", "c_ns": "open"}
+ for _, c := range accessCards(t, r) {
+ switch want[c.ID] {
+ case "open":
+ if c.State != wire.CardOpen {
+ t.Errorf("%s resolved: %+v", c.ID, c)
+ }
+ case wire.ChoiceNotNeeded:
+ if c.State != wire.CardResolved || c.Choice != wire.ChoiceNotNeeded {
+ t.Errorf("%s not resolved as not needed: %+v", c.ID, c)
+ }
+ default:
+ // Reached: resolved, and it says so itself.
+ if c.State != wire.CardResolved || c.Choice == wire.ChoiceNotNeeded {
+ t.Errorf("%s: %+v", c.ID, c)
+ }
+ }
+ }
+}
+
+// find raises a card only for a real repository or namespace the agent
+// does not reach; request_access refuses one it already reaches.
+func TestAccessCardOnlyForUnreachedRepositoryOrNamespace(t *testing.T) {
+ for _, tc := range []struct {
+ query string
+ card bool
+ code string
+ }{
+ {"iOS keyboard", false, "not_a_repository"},
+ {"swipe to dismiss", false, "not_a_repository"},
+ {"ios", false, "not_a_repository"},
+ {"tito/website", true, "none"},
+ {"amadan.net/tito/website", true, "none"},
+ {"tito", true, "none"},
+ } {
+ t.Run(tc.query, func(t *testing.T) {
+ r, turn, l := swipeRig(t)
+ got := callTool(t, r, l, turn, "call-find", wire.ToolFind, map[string]string{"query": tc.query})
+ if got.Code != tc.code || got.IsError != (tc.code == "not_a_repository") {
+ t.Fatalf("find: %+v", got)
+ }
+ if cards := accessCards(t, r); (len(cards) == 1) != tc.card || len(cards) > 1 {
+ t.Fatalf("cards: %+v", cards)
+ }
+ })
+ }
+ r, turn, l := swipeRig(t)
+ got := callTool(t, r, l, turn, "call-ask", wire.ToolRequestAccess, map[string]string{"target": "oficina/equipo", "reason": "I need to fix the keyboard."})
+ if !got.IsError || got.Code != "already_reached" {
+ t.Fatalf("request_access for a reached repository: %+v", got)
+ }
+ if cards := accessCards(t, r); len(cards) != 0 {
+ t.Fatalf("cards: %+v", cards)
+ }
+}
+
+// A project's title from its repository is the repository's name, never a
+// word lifted from its README, and never a bare verb or generic word.
+func TestProjectTitleFromRepositoryName(t *testing.T) {
+ equipo := swipeHello().Catalog[0]
+ for _, tc := range []struct {
+ repo string
+ info *wire.RepoInfo
+ want string
+ }{
+ {"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/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 {
+ t.Errorf("%s: %q, want %q", tc.repo, got, tc.want)
+ }
+ }
+ for _, title := range []string{"Create", "new", " Project ", "Add", "Fix", "", "Untitled"} {
+ if UsableProjectTitle(title) {
+ t.Errorf("%q passed", title)
+ }
+ }
+ for _, title := range []string{"Equipo", "Woodstar", "Create Studio", "paulca/create"} {
+ if !UsableProjectTitle(title) {
+ t.Errorf("%q refused", title)
+ }
+ }
+}
diff --git a/internal/equipo/chat/access_request.go b/internal/equipo/chat/access_request.go
index 5fe7295e..ef7709d4 100644
--- a/internal/equipo/chat/access_request.go
+++ b/internal/equipo/chat/access_request.go
@@ -57,6 +57,16 @@ func (t *txn) requestAccess(r turnRecord, in wire.AccessRequest) (wire.ToolResul
return refused("narrow_target", "Name the single repository. A namespace needs the person's explicit request for that namespace."), nil
}
}
+ // Never for what the agent already reaches (#48): a repository on its
+ // list, or a namespace it already holds.
+ h, err := t.hello(r.Person)
+ if err != nil {
+ return wire.ToolResult{}, err
+ }
+ target := strings.ToLower(in.Target)
+ if strings.Contains(target, "/") && reaches(h, target) || !strings.Contains(target, "/") && slices.Contains(h.CreateIn, target) {
+ return refused("already_reached", fmt.Sprintf(toolAlreadyReached, in.Target)), nil
+ }
var old []cardRecord
if err := t.db.Where("person = ? AND kind = ? AND coalesce(access, '') <> '' AND (turn_id = ? OR state = ?)", r.Person, wire.CardAccess, r.ID, wire.CardOpen).Find(&old).Error; err != nil {
return wire.ToolResult{}, err
diff --git a/internal/equipo/chat/merge.go b/internal/equipo/chat/merge.go
index 0a1118a2..822c0327 100644
--- a/internal/equipo/chat/merge.go
+++ b/internal/equipo/chat/merge.go
@@ -210,10 +210,7 @@ func (t *txn) mergeDone(k *taskRecord, s *stepRecord, v *wire.StepReport) error
if err := t.db.Where("id = ?", k.ProjectID).First(&pr).Error; err != nil {
return err
}
- project := pr.Title
- if project == "" {
- project = ProjectTitle(pr.Repo, nil)
- }
+ project := pr.shownTitle()
k.MergeVerified = mergeVerified(v, s.CandidateSHA)
parents, _ := json.Marshal(v.MergeParents)
s.MergeSource, s.MergeParents = v.MergeSource, string(parents)
diff --git a/internal/equipo/chat/mergeauth.go b/internal/equipo/chat/mergeauth.go
index 0a840365..7dc91c10 100644
--- a/internal/equipo/chat/mergeauth.go
+++ b/internal/equipo/chat/mergeauth.go
@@ -576,10 +576,7 @@ func (t *txn) mergeQuestion(k taskRecord, p progress, d mergegate.Decision) (str
if err := t.db.Where("id = ?", k.ProjectID).First(&pr).Error; err != nil {
return "", nil, err
}
- project := pr.Title
- if project == "" {
- project = ProjectTitle(pr.Repo, nil)
- }
+ project := pr.shownTitle()
checks, reason, _, _ := p.judged()
var good, bad []string
var facts *wire.ChangeFacts
@@ -702,10 +699,7 @@ func (t *txn) askShips(k taskRecord) error {
if err := t.db.Where("id = ?", k.ProjectID).First(&proj).Error; err != nil {
return err
}
- name := proj.Title
- if name == "" {
- name = ProjectTitle(proj.Repo, nil)
- }
+ name := proj.shownTitle()
pr.ShipsAsked = true
if err := t.writePolicy(&pr, k.Creator, false); err != nil {
return err
@@ -911,10 +905,7 @@ func (t *txn) undoMerge(person string, k taskRecord) (taskRecord, error) {
if err := t.db.Where("id = ?", k.ProjectID).First(&pr).Error; err != nil {
return taskRecord{}, err
}
- project := pr.Title
- if project == "" {
- project = ProjectTitle(pr.Repo, nil)
- }
+ project := pr.shownTitle()
now := t.now()
title := clipText(t.words("chat.merge.revert_title", short(k.MergedSHA), project), wire.MaxTaskTitle)
brief := fmt.Sprintf("Revert merge commit %s on %s with `git revert -m 1 %s` and change nothing else. It undoes %q (task %s).", k.MergedSHA, k.MergedInto, k.MergedSHA, k.Title, k.ID)
@@ -1117,10 +1108,7 @@ func (t *txn) setMergePolicy(r turnRecord, args json.RawMessage) (wire.ToolResul
if !mergegate.ValidPolicy(next) {
return refused("invalid", toolBadPolicy), nil
}
- name := proj.Title
- if name == "" {
- name = ProjectTitle(proj.Repo, nil)
- }
+ name := proj.shownTitle()
if mergegate.Tighter(old, next) {
applyPolicy(&pr, next, words)
if err := t.savePolicy(&pr, r.Person); err != nil {
diff --git a/internal/equipo/chat/project_names.go b/internal/equipo/chat/project_names.go
index 873d1b56..f498a6c4 100644
--- a/internal/equipo/chat/project_names.go
+++ b/internal/equipo/chat/project_names.go
@@ -3,6 +3,7 @@ package chat
import (
"context"
"errors"
+ "path"
"slices"
"strings"
"time"
@@ -172,7 +173,7 @@ func (t *txn) namedProject(person, name string) (*projectRecord, error) {
if p.TitleSet {
title = p.Title
}
- fits := want == strings.ToLower(title) || want == strings.ToLower(ProjectName(p.Repo)) || strings.EqualFold(NormalizeRepo(want), p.Repo)
+ fits := want == strings.ToLower(title) || !p.TitleSet && want == strings.ToLower(path.Base(p.Repo)) || want == strings.ToLower(ProjectName(p.Repo)) || strings.EqualFold(NormalizeRepo(want), p.Repo)
for _, n := range names {
if n.Person == "" && n.ProjectID == p.ID && n.Name == want {
fits = true
diff --git a/internal/equipo/chat/projects.go b/internal/equipo/chat/projects.go
index 1e9988d3..f7d881ae 100644
--- a/internal/equipo/chat/projects.go
+++ b/internal/equipo/chat/projects.go
@@ -51,6 +51,16 @@ 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.
+func (p projectRecord) shownTitle() string {
+ if p.Title != "" && (p.TitleSet || UsableProjectTitle(p.Title)) {
+ return p.Title
+ }
+ return ProjectTitle(p.Repo, nil)
+}
+
// cardRecord is a card in one person's conversation.
type cardRecord struct {
Access string
@@ -246,10 +256,7 @@ func ProjectName(repo string) string { return forgekey.Display(repo) }
func NormalizeRepo(raw string) string { return forgekey.Normalize(raw) }
func (t *txn) projectView(p projectRecord) (wire.Project, error) {
- title := p.Title
- if title == "" {
- title = ProjectTitle(p.Repo, nil)
- }
+ title := p.shownTitle()
v := wire.Project{CopyOwner: p.CopyOwner, CopyRevision: p.CopyRevision, ID: p.ID, Revision: p.Revision, Repo: p.Repo, Name: ProjectName(p.Repo), Title: title, State: p.State, AddedBy: p.AddedBy, CreatedAt: p.CreatedAt, UpdatedAt: p.UpdatedAt}
var err error
if v.Autonomy, err = t.autonomyOf(p); err != nil {
diff --git a/internal/equipo/chat/stars.go b/internal/equipo/chat/stars.go
index 69c00de8..7c0562a0 100644
--- a/internal/equipo/chat/stars.go
+++ b/internal/equipo/chat/stars.go
@@ -239,10 +239,7 @@ func (t *txn) starProject(r turnRecord, project string, starred bool) (wire.Tool
return wire.ToolResult{}, err
}
t.touched[r.Person] = true
- title := p.Title
- if title == "" {
- title = ProjectTitle(p.Repo, nil)
- }
+ title := p.shownTitle()
if starred {
return wire.ToolResult{Code: "starred", Repo: p.Repo, Text: "Starred " + title + ": it is pinned at the top of the person's Projects page."}, nil
}
diff --git a/internal/equipo/chat/tasks.go b/internal/equipo/chat/tasks.go
index 51c6b422..e9dda57c 100644
--- a/internal/equipo/chat/tasks.go
+++ b/internal/equipo/chat/tasks.go
@@ -376,27 +376,50 @@ func cleanPath(p string) (string, bool) {
return p, true
}
-// ProjectTitle is a project's product name: the catalog's capitalised
-// spelling of the repository's name (woodstar is Woodstar), else the
-// README's first heading when short, else the repository's name.
+// 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 that name (woodstar is
+// WoodStar). Never another of the catalog's names: past the first they are
+// capitalised words its README happens to repeat, and for oficina/equipo
+// the second 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 {
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 {
- return n
- }
- }
- if len(info.Names) > 1 {
- if n := info.Names[1]; len(n) <= 40 && len(strings.Fields(n)) <= 4 && n != "" {
- return n
+ title = n
+ break
}
}
}
- if base == "" {
- return repo
+ if !UsableProjectTitle(title) {
+ return ProjectName(repo)
}
- return strings.ToUpper(base[:1]) + base[1:]
+ return title
+}
+
+// genericTitles are words that say nothing about which project it is:
+// bare verbs lifted from a request, and placeholders.
+var genericTitles = map[string]bool{
+ "create": true, "new": true, "add": true, "make": true, "build": true, "start": true, "fix": true,
+ "update": true, "change": true, "edit": true, "open": true, "run": true, "test": true, "tests": true,
+ "generate": true, "remove": true, "delete": true, "move": true, "use": true, "set": true, "check": true,
+ "project": true, "projects": true, "repo": true, "repository": true, "app": true, "apps": true,
+ "untitled": true, "task": true, "tasks": true, "work": true, "main": true, "default": true,
+ "code": true, "src": true, "site": true, "web": true, "website": true, "none": true, "todo": true,
+}
+
+// UsableProjectTitle reports whether a title Equipo chose (never one the
+// person typed) names a project: not empty, not a bare verb or generic
+// word such as Create, New or Project.
+func UsableProjectTitle(title string) bool {
+ t := strings.ToLower(strings.TrimSpace(title))
+ return t != "" && validProjectText(t, 120) && !genericTitles[t]
}
// TaskLink is a task's own page on this instance, as the coordinator
@@ -472,10 +495,7 @@ func (t *txn) taskView(k taskRecord) (wire.Task, error) {
if err := t.db.Where("id = ?", k.ProjectID).First(&p).Error; err != nil {
return v, err
}
- v.Repo, v.Project = p.Repo, p.Title
- if v.Project == "" {
- v.Project = ProjectTitle(p.Repo, nil)
- }
+ v.Repo, v.Project = p.Repo, p.shownTitle()
var entries []entryRecord
if err := t.db.Where("task_id = ?", k.ID).Order("created_at, id").Find(&entries).Error; err != nil {
return v, err
@@ -827,6 +847,9 @@ func (t *txn) recordTask(r turnRecord, repo, title, brief, kind string, separate
if err := t.taskEvent(k); err != nil {
return wire.ToolResult{}, err
}
+ if err := t.accessNeedPassed(r, p.Repo); err != nil {
+ return wire.ToolResult{}, err
+ }
if _, err := t.housekeepingPass(housekeeping.TriggerRecordTask, p.ID); err != nil {
return wire.ToolResult{}, err
}
diff --git a/internal/equipo/chat/tools.go b/internal/equipo/chat/tools.go
index a82c6fbd..55015a58 100644
--- a/internal/equipo/chat/tools.go
+++ b/internal/equipo/chat/tools.go
@@ -38,6 +38,13 @@ const (
toolMovingIn = "While moving in or exploring you only look around and take notes: status, find, search_code, read_file, read_notes and write_note."
toolAskedOwner = "Nothing changed yet: the person sees a card asking whether to make this change, and one tap applies it. Do not ask again in your reply."
toolNoHome = "New projects have no home now, so there is nothing to clear."
+ // toolNotARepository follows a find that matched nothing and named no
+ // repository or namespace (%q is the query): no grant could help.
+ toolNotARepository = "Nothing Equipo's agent can reach matches %q, and that is not the name of a repository or namespace, so access would not help and no card was raised. find matches repository and project names, not features: if the person named a repository or namespace, find it by that name alone. Otherwise use one of the person's projects, or ask the person which project this is for."
+ // toolReachedNoMatch: the query names a namespace the agent reaches.
+ toolReachedNoMatch = "Equipo's agent already reaches %s, so it needs no access, but no repository there matches. Ask the person which repository they mean."
+ // toolAlreadyReached: request_access for something already reached.
+ toolAlreadyReached = "Equipo's agent already reaches %s. No access request is needed; work there."
// toolUnknownProject: star_project names no single current project.
toolUnknownProject = "That names no single current project. Use status to see the projects and their names."
toolAmbiguous = "Nothing was recorded: this reads like more than one task this turn already recorded. If it is one of them, use its task id. If it is a new problem, call record_task again with separate: true."
@@ -1051,13 +1058,22 @@ func (t *txn) find(r turnRecord, query string) (wire.ToolResult, error) {
}
return wire.ToolResult{Code: "found", Text: b.String()}, nil
}
+ // An access card is for a repository or namespace the agent does not
+ // reach, never for what a request is about ("iOS keyboard", #48).
+ target := AccessTarget(query)
+ if target == "" {
+ return refused("not_a_repository", fmt.Sprintf(toolNotARepository, query)), nil
+ }
+ if reaches(h, target) {
+ return wire.ToolResult{Code: "none", Text: fmt.Sprintf(toolReachedNoMatch, target)}, nil
+ }
namespaces := []string{}
for _, e := range entries {
if ns := strings.Split(ProjectName(e.Repo), "/")[0]; !slices.Contains(namespaces, ns) {
namespaces = append(namespaces, ns)
}
}
- if err := t.accessCard(r, query, h.Agent, namespaces); err != nil {
+ if err := t.accessCard(r, target, h.Agent, namespaces); err != nil {
return wire.ToolResult{}, err
}
reach := "nothing yet"
@@ -1083,16 +1099,17 @@ func (t *txn) find(r turnRecord, query string) (wire.ToolResult, error) {
}
// accessCard shows how to give Equipo's agent another namespace, once per
-// turn. For an access card, question is what was looked for, options are
-// the namespaces the agent reaches and choice is the agent's name.
-func (t *txn) accessCard(r turnRecord, query, agent string, namespaces []string) error {
+// turn. For an access card, question and name are the repository or
+// namespace looked for (AccessTarget), options are the namespaces the agent
+// reaches and choice is the agent's name.
+func (t *txn) accessCard(r turnRecord, target, agent string, namespaces []string) error {
var n int64
if err := t.db.Model(&cardRecord{}).Where("person = ? AND turn_id = ? AND kind = ?", r.Person, r.ID, wire.CardAccess).Count(&n).Error; err != nil || n > 0 {
return err
}
raw, _ := json.Marshal(namespaces)
now := t.now()
- c := cardRecord{ID: newID("c_"), Person: r.Person, Kind: wire.CardAccess, State: wire.CardOpen, TurnID: r.ID, Question: clipText(query, wire.MaxQuestion), Options: string(raw), Choice: agent, Name: AccessName(query), Revision: 1, CreatedAt: now, UpdatedAt: now, Lane: r.Lane}
+ c := cardRecord{ID: newID("c_"), Person: r.Person, Kind: wire.CardAccess, State: wire.CardOpen, TurnID: r.ID, Question: clipText(target, wire.MaxQuestion), Options: string(raw), Choice: agent, Name: target, Revision: 1, CreatedAt: now, UpdatedAt: now, Lane: r.Lane}
if err := t.db.Create(&c).Error; err != nil {
return err
}
@@ -1146,29 +1163,43 @@ func (t *txn) setProjectHome(r turnRecord, ns string) (wire.ToolResult, error) {
return wire.ToolResult{Code: "asked_owner", Text: toolAskedOwner}, nil
}
-// guessSkip are words in a query that never name a namespace.
-var guessSkip = map[string]bool{"the": true, "a": true, "an": true, "my": true, "our": true, "app": true, "apps": true, "ios": true, "android": true, "web": true, "site": true, "repo": true, "repository": true, "bug": true, "in": true, "on": true, "of": true, "for": true, "project": true}
-
-var guessName = regexp.MustCompile(`^[a-z0-9][a-z0-9-]{1,38}$`)
-
-// AccessName is what an access card is for, from what was looked for:
-// a repository with its namespace ("paulca/threatmin"), or else the one
-// name a person would type (Woodstar is woodstar); empty when unclear.
-// It is what resolves the card, never a namespace on its own.
-func AccessName(query string) string {
- for _, w := range strings.Fields(strings.ToLower(query)) {
- w = strings.TrimPrefix(strings.Trim(w, ".,;:!?'\"()"), "amadan.net/")
- if guessSkip[w] {
- continue
- }
- if repoRef.MatchString(w) || guessName.MatchString(w) {
- return w
+// AccessTarget is what a query names that access could be granted to: a
+// repository with its namespace ("tito/website") or one namespace
+// ("tito"), lower-cased, without the hub's host. Anything else, such as a
+// feature ("iOS keyboard") or a word that never names a namespace, is "".
+func AccessTarget(query string) string {
+ q := strings.TrimPrefix(strings.ToLower(strings.TrimSpace(query)), "amadan.net/")
+ if guessSkip[q] || !wire.ValidAccessTarget(q) {
+ return ""
+ }
+ if strings.Contains(q, "/") {
+ if repoRef.MatchString(q) {
+ return q
}
return ""
}
+ if guessName.MatchString(q) {
+ return q
+ }
return ""
}
+// reaches reports whether the agent already reaches target (AccessTarget):
+// a repository on its list or in its catalog, or a namespace it may create
+// in or holds a repository in.
+func reaches(h wire.Hello, target string) bool {
+ if strings.Contains(target, "/") {
+ entries, _ := reachable(h)
+ return slices.ContainsFunc(entries, func(e wire.RepoInfo) bool { return strings.EqualFold(ProjectName(e.Repo), target) })
+ }
+ return slices.Contains(h.CreateIn, target) || related(h, target)
+}
+
+// guessSkip are words in a query that never name a namespace.
+var guessSkip = map[string]bool{"the": true, "a": true, "an": true, "my": true, "our": true, "app": true, "apps": true, "ios": true, "android": true, "web": true, "site": true, "repo": true, "repository": true, "bug": true, "in": true, "on": true, "of": true, "for": true, "project": true}
+
+var guessName = regexp.MustCompile(`^[a-z0-9][a-z0-9-]{1,38}$`)
+
// repoRef is a repository named with its namespace.
var repoRef = regexp.MustCompile(`^[a-z0-9][a-z0-9_.-]{0,38}/[a-z0-9][a-z0-9._-]{0,99}$`)
@@ -1210,10 +1241,44 @@ func (t *txn) resolveAccess(person string, h wire.Hello) error {
}
continue
}
- if c.Name == "" || !slices.ContainsFunc(h.Catalog, func(e wire.RepoInfo) bool { return intended(e.Repo, c.Name) }) {
+ target := AccessTarget(c.Question)
+ switch {
+ case target != "" && c.Name != "" && slices.ContainsFunc(h.Catalog, func(e wire.RepoInfo) bool { return intended(e.Repo, c.Name) }):
+ // What it asked for is reachable now, and it says so.
+ c.State = wire.CardResolved
+ case target == "" || reaches(h, target):
+ // Never a repository or namespace (a card find raised for
+ // free text before #48), or already reached: no access was
+ // needed.
+ c.State, c.Choice = wire.CardResolved, wire.ChoiceNotNeeded
+ default:
continue
}
- c.State = wire.CardResolved
+ if err := t.saveCard(&c); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// accessNeedPassed resolves the turn's open find card once the turn's task
+// is in a project whose repository the agent reaches: whatever was looked
+// for, the work found its repository, so no access is needed.
+func (t *txn) accessNeedPassed(r turnRecord, repo string) error {
+ h, err := t.hello(r.Person)
+ if err != nil {
+ return err
+ }
+ if !reaches(h, strings.ToLower(ProjectName(repo))) {
+ return nil
+ }
+ var rows []cardRecord
+ if err := t.db.Where("person = ? AND turn_id = ? AND kind = ? AND state = ? AND coalesce(access, '') = ''", r.Person, r.ID, wire.CardAccess, wire.CardOpen).Find(&rows).Error; err != nil {
+ return err
+ }
+ for i := range rows {
+ c := rows[i]
+ c.State, c.Choice = wire.CardResolved, wire.ChoiceNotNeeded
if err := t.saveCard(&c); err != nil {
return err
}
diff --git a/internal/equipo/chat_page.go b/internal/equipo/chat_page.go
index e1392929..f3592df5 100644
--- a/internal/equipo/chat_page.go
+++ b/internal/equipo/chat_page.go
@@ -182,6 +182,11 @@ func cardView(c wire.Card, choices []string, tasks map[string]wire.Task) chatCar
v.Open = c.State == wire.CardOpen
if c.State == wire.CardResolved {
v.Line = fmt.Sprintf(copyText("chat.card.access_resolved"), c.Question)
+ // Resolved by Equipo, not reached: the target was never a
+ // repository, or the work found one it reaches (#48).
+ if c.Choice == wire.ChoiceNotNeeded {
+ v.Line = copyText("chat.card.access_not_needed")
+ }
}
case wire.CardMerge:
v.Line, v.Open = c.Question, c.State == wire.CardOpen
diff --git a/internal/equipo/copy.go b/internal/equipo/copy.go
index b6dba594..0a31e5d4 100644
--- a/internal/equipo/copy.go
+++ b/internal/equipo/copy.go
@@ -908,6 +908,7 @@ var pageCopy = map[string]string{
"chat.activity.cancel_task": "Cancelling the task…", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"nav.tasks": "Tasks", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"chat.card.access_resolved": "%s is reachable now.", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
+ "chat.card.access_not_needed": "No new access is needed for this.", // COPY REVIEW PENDING
"chat.card.grant_check": "Check now", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.stage.noted": "Noted", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
"work.stage.investigated": "Looking into it", // COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)
diff --git a/internal/equipo/migrations/0103_generic_project_titles.sql b/internal/equipo/migrations/0103_generic_project_titles.sql
new file mode 100644
index 00000000..54a0fe8d
--- /dev/null
+++ b/internal/equipo/migrations/0103_generic_project_titles.sql
@@ -0,0 +1,15 @@
+-- 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.
+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'
+ );
diff --git a/internal/equipo/project_title_migration_test.go b/internal/equipo/project_title_migration_test.go
new file mode 100644
index 00000000..f93df128
--- /dev/null
+++ b/internal/equipo/project_title_migration_test.go
@@ -0,0 +1,73 @@
+package equipo
+
+import (
+ "context"
+ "regexp"
+ "testing"
+
+ "amadan.net/oficina/equipo/internal/equipo/chat"
+ "amadan.net/rastrillo/rastrillo/migrate"
+)
+
+// #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.
+func TestGenericProjectTitleMigration(t *testing.T) {
+ all := Schema.All()
+ at := -1
+ for i, m := range all {
+ if m.ID == "equipo/0103_generic_project_titles" {
+ at = i
+ }
+ }
+ if at < 0 {
+ t.Fatal("missing generic project titles migration")
+ }
+ ctx := context.Background()
+ d, err := migrate.Replay(ctx, all[:at])
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer d.Close()
+ for _, q := range []string{
+ "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_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 id, want := range map[string]struct {
+ title string
+ revision int64
+ }{"p_hydlybiyyy3jy574grtydymnyd": {"", 2}, "p_named": {"New", 3}, "p_legacy": {"", 2}, "p_fine": {"Woodstar", 2}} {
+ 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 {
+ t.Fatal(err)
+ }
+ if title != want.title || revision != want.revision {
+ 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" {
+ 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/thintest/empty_repo_contract_test.go b/internal/thintest/empty_repo_contract_test.go
index 0b54ec7f..84212a2b 100644
--- a/internal/thintest/empty_repo_contract_test.go
+++ b/internal/thintest/empty_repo_contract_test.go
@@ -75,19 +75,20 @@ func TestContractEmptyRepository(t *testing.T) {
}
}
-// An access card's name is what was looked for; the grant command names
-// a namespace only when the person gave one ("acme/moonbeam"). A bare
-// name is a repository or a product as often as a namespace, so the
+// An access card is for what was looked for only when that names a
+// repository or a namespace (#48: never "iOS keyboard"); the grant command
+// names a namespace only when the person gave one ("acme/moonbeam"). A
+// bare name is a repository or a product as often as a namespace, so the
// command keeps the <namespace> placeholder rather than guess
// ("threatmin" is a repository in paulca).
-func TestAccessName(t *testing.T) {
+func TestAccessTarget(t *testing.T) {
for q, want := range map[string]string{
- "Woodstar": "woodstar", "the Woodstar iOS app": "woodstar", "Moon Beam": "moon", "¿Qué?": "", "my app": "", "x": "",
- "paulca/threatmin": "paulca/threatmin", "amadan.net/paulca/threatmin": "paulca/threatmin", "the acme/Moonbeam repo": "acme/moonbeam",
+ "Woodstar": "woodstar", "the Woodstar iOS app": "", "Moon Beam": "", "¿Qué?": "", "my app": "", "x": "", "ios": "", "iOS keyboard": "",
+ "paulca/threatmin": "paulca/threatmin", "amadan.net/paulca/threatmin": "paulca/threatmin", "acme/Moonbeam": "acme/moonbeam", "the acme/Moonbeam repo": "",
"a/b/c": "", "/threatmin": "",
} {
- if got := chat.AccessName(q); got != want {
- t.Fatalf("AccessName(%q) = %q, want %q", q, got, want)
+ if got := chat.AccessTarget(q); got != want {
+ t.Fatalf("AccessTarget(%q) = %q, want %q", q, got, want)
}
}
for name, want := range map[string]string{"woodstar": "", "threatmin": "", "paulca/threatmin": "paulca", "": ""} {
diff --git a/internal/thintest/pages_test.go b/internal/thintest/pages_test.go
index 54fa41a3..47e4de5b 100644
--- a/internal/thintest/pages_test.go
+++ b/internal/thintest/pages_test.go
@@ -288,6 +288,32 @@ func TestPagesGrantCard(t *testing.T) {
t.Fatal(err)
}
r.wait("named resolved", func(c *Conversation) bool { return c.Cards[named.ID].State == wire.CardResolved })
+ // A card whose need passed (the turn's task found a repository the
+ // agent reaches) says no access was needed, not that it is reachable
+ // (#48).
+ hello.Repos = []string{"amadan.net/moonbeam/web"}
+ if err := r.runner.Send(r.ctx, "h-pg4", wire.FrameHello, hello); err != nil {
+ t.Fatal(err)
+ }
+ r.next("tito")
+ r.call("g4", wire.ToolFind, map[string]string{"query": "tito"})
+ var passed wire.Card
+ r.wait("tito access card", func(c *Conversation) bool {
+ for _, k := range c.Cards {
+ if k.Kind == wire.CardAccess && k.State == wire.CardOpen {
+ passed = k
+ }
+ }
+ return passed.ID != ""
+ })
+ if got := r.call("g5", wire.ToolRecordTask, map[string]string{"repo": "moonbeam/web", "title": "Fix the header", "brief": "go"}); got.Code != "recorded" {
+ t.Fatalf("record: %+v", got)
+ }
+ r.wait("need passed", func(c *Conversation) bool { return c.Cards[passed.ID].State == wire.CardResolved })
+ page = r.get(owner, "/conversation", 200)
+ if !strings.Contains(page, html.EscapeString(equipo.RunnerText("chat.card.access_not_needed"))) || strings.Contains(page, "tito is reachable now.") {
+ t.Fatal("a card whose need passed does not say so")
+ }
}
func cardState(cards []wire.Card, id string) string {
diff --git a/internal/wire/tasks.go b/internal/wire/tasks.go
index 4d3859fe..ff533ea2 100644
--- a/internal/wire/tasks.go
+++ b/internal/wire/tasks.go
@@ -156,6 +156,11 @@ const (
// ChoiceCheck is the answer on an access card: the person granted
// access, so the runner checks its reach now.
ChoiceCheck = "check"
+ // ChoiceNotNeeded marks an access card Equipo resolved itself because
+ // no access was needed: its target was never a repository or
+ // namespace, the agent already reached it, or the turn's task found a
+ // repository the agent reaches. It is never a person's answer.
+ ChoiceNotNeeded = "not_needed"
)
// Bounds for tasks.