Files
pad/cmd/pad/query_test.go
T
xarmian 7cda0d7896 feat: rebrand to Perpetual Software + new tagline (IDEA-832) (#273)
Migrates from xarmian/pad to PerpetualSoftware/pad across the entire
repo and updates the product subtitle to "Collaborate with your AI
agents".

Go module rename
- go.mod: github.com/xarmian/pad → github.com/PerpetualSoftware/pad
- All Go imports updated across cmd/pad, internal/{cli,server,store,
  models,collections,items,events,metrics,webhooks} (~130 files)
- Test fixtures with the literal repo slug ("xarmian/pad" in JSON
  shapes, SSH/HTTPS git URL strings, workspace_context fixtures)
  also updated, including the secondary repo entry
  (xarmian/pad-web → PerpetualSoftware/pad-web — pad-web was also
  moved to the org per branch context)

Docs / config
- README badges, install instructions, brew tap, Docker image, source
  build path, sponsor link (sponsor link kept as personal @xarmian)
- Subtitle: "Project management for developers and AI agents." →
  "Collaborate with your AI agents." (README, manifests, web layout
  meta, .goreleaser homebrew description)
- CONTRIBUTING.md, SECURITY.md, skills/INSTALL.md
- .goreleaser.yaml: homebrew_casks owner, GHCR image, release github
  owner, cosign cert-identity regex, comments
- .github/workflows/release.yml: tap/release comments
- deploy/k8s/deployment.yaml: container image
- docs/deployment.md: clone URL
- web/static/{site.webmanifest,manifest.json}: description
- web/src/routes/+layout.svelte: meta description + og:description

Brew tap path is PerpetualSoftware/tap/pad (CamelCase, matches
GitHub user case). GHCR image is ghcr.io/perpetualsoftware/pad
(lowercased per GHCR's URL normalization). CODEOWNERS @xarmian and
FUNDING.yml github: xarmian intentionally retained — those are the
personal maintainer / sponsor account, separate from the org repo.

Verification: go build ./..., go test ./... (all pkgs pass), web
build, and make install all clean (TASK-844, TASK-845).
2026-04-28 12:26:39 -04:00

67 lines
2.3 KiB
Go

package main
import (
"testing"
"github.com/PerpetualSoftware/pad/internal/models"
"github.com/PerpetualSoftware/pad/internal/server"
)
func TestFilterAgentAttentionKeepsOnlyActionableBuckets(t *testing.T) {
input := []server.DashboardAttention{
{Type: "stalled", ItemRef: "TASK-1"},
{Type: "blocked", ItemRef: "TASK-2"},
{Type: "phase_completion", ItemRef: "PHASE-1"},
{Type: "orphaned_task", ItemRef: "TASK-3"},
}
got := filterAgentAttention(input)
if len(got) != 3 {
t.Fatalf("expected 3 attention items, got %#v", got)
}
for _, item := range got {
if item.Type == "phase_completion" {
t.Fatalf("did not expect phase_completion in %#v", got)
}
}
}
func TestIncomingImplementedByReturnsIncomingImplementersOnly(t *testing.T) {
item := &models.Item{ID: "target"}
links := []models.ItemLink{
{SourceID: "task-a", TargetID: "target", LinkType: models.ItemLinkTypeImplements, SourceRef: "TASK-1", SourceTitle: "Implement auth", SourceStatus: "done"},
{SourceID: "target", TargetID: "idea-b", LinkType: models.ItemLinkTypeImplements, TargetRef: "IDEA-2", TargetTitle: "Auth idea"},
}
got := incomingImplementedBy(item, links)
if len(got) != 1 {
t.Fatalf("expected 1 incoming implementer, got %#v", got)
}
if got[0].Ref != "TASK-1" || got[0].Title != "Implement auth" {
t.Fatalf("unexpected implementer %#v", got[0])
}
}
func TestBuildRelatedGroupsIncludesLineageAndDependencySections(t *testing.T) {
item := &models.Item{ID: "task-1"}
links := []models.ItemLink{
{SourceID: "task-1", TargetID: "task-2", LinkType: models.ItemLinkTypeBlocks, TargetRef: "TASK-2", TargetTitle: "Blocked task"},
{SourceID: "task-3", TargetID: "task-1", LinkType: models.ItemLinkTypeImplements, SourceRef: "TASK-3", SourceTitle: "Implementation task"},
{SourceID: "task-1", TargetID: "doc-1", LinkType: models.ItemLinkTypeWikiLink, TargetRef: "DOC-1", TargetTitle: "Context doc"},
}
got := buildRelatedGroups(item, links)
if len(got) != 3 {
t.Fatalf("expected 3 groups, got %#v", got)
}
if got[0].Key != "blocks" {
t.Fatalf("expected first group blocks, got %q", got[0].Key)
}
if got[1].Key != "links_to" {
t.Fatalf("expected second group links_to, got %q", got[1].Key)
}
if got[2].Key != "implemented_by" {
t.Fatalf("expected third group implemented_by, got %q", got[2].Key)
}
}