Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as opaque submodule gitlinks on GitHub) into fully-tracked first-party content. AITM now merges its 7 vendored repos as first-party engines: - memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts - git: vendored C git (bundled binary) + gitnexus (in-process code intelligence) - agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess) Includes the full session's product build: Gitgram web/mobile/backend features, AITM website/CLI/MCP, the unified memory layer, engine build tooling (scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md), and extensive test suites. Build artifacts, node_modules, external/, and gemini-cli are gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
123 lines
2.8 KiB
Go
123 lines
2.8 KiB
Go
package main
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/steveyegge/beads/internal/types"
|
|
)
|
|
|
|
func TestPrintHumanStats(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
issues []*types.Issue
|
|
// We just verify no panic; output goes to stdout
|
|
}{
|
|
{
|
|
name: "empty list",
|
|
issues: nil,
|
|
},
|
|
{
|
|
name: "mixed statuses",
|
|
issues: []*types.Issue{
|
|
{ID: "bd-1", Status: "open"},
|
|
{ID: "bd-2", Status: "in_progress"},
|
|
{ID: "bd-3", Status: "blocked"},
|
|
{ID: "bd-4", Status: "closed", CloseReason: "Responded"},
|
|
{ID: "bd-5", Status: "closed", CloseReason: "Dismissed: not needed"},
|
|
{ID: "bd-6", Status: "hooked"},
|
|
},
|
|
},
|
|
{
|
|
name: "all closed responded",
|
|
issues: []*types.Issue{
|
|
{ID: "bd-1", Status: "closed", CloseReason: "Responded"},
|
|
{ID: "bd-2", Status: "closed", CloseReason: "Responded"},
|
|
},
|
|
},
|
|
{
|
|
name: "all dismissed",
|
|
issues: []*types.Issue{
|
|
{ID: "bd-1", Status: "closed", CloseReason: "Dismissed"},
|
|
{ID: "bd-2", Status: "closed", CloseReason: "Dismissed: stale"},
|
|
},
|
|
},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
// Just verify no panic
|
|
printHumanStats(tt.issues)
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestPrintHumanList(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
issues []*types.Issue
|
|
}{
|
|
{
|
|
name: "empty list",
|
|
issues: nil,
|
|
},
|
|
{
|
|
name: "single issue",
|
|
issues: []*types.Issue{
|
|
{ID: "bd-abc", Title: "Need human input", Status: "open", Priority: 1},
|
|
},
|
|
},
|
|
{
|
|
name: "multiple issues with varied status",
|
|
issues: []*types.Issue{
|
|
{ID: "bd-1", Title: "Review needed", Status: "open"},
|
|
{ID: "bd-2", Title: "Approval required", Status: "blocked", Priority: 0},
|
|
},
|
|
},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
// Just verify no panic
|
|
printHumanList(tt.issues)
|
|
})
|
|
}
|
|
}
|
|
|
|
func TestHumanCmdSubcommands(t *testing.T) {
|
|
// Verify all subcommands are registered
|
|
subCmds := humanCmd.Commands()
|
|
names := make([]string, len(subCmds))
|
|
for i, cmd := range subCmds {
|
|
names[i] = cmd.Name()
|
|
}
|
|
joined := strings.Join(names, ",")
|
|
|
|
for _, expected := range []string{"list", "respond", "dismiss", "stats"} {
|
|
if !strings.Contains(joined, expected) {
|
|
t.Errorf("missing subcommand %q in human command", expected)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestHumanRespondRequiresResponseFlag(t *testing.T) {
|
|
flag := humanRespondCmd.Flags().Lookup("response")
|
|
if flag == nil {
|
|
t.Fatal("respond command should have --response flag")
|
|
}
|
|
}
|
|
|
|
func TestHumanDismissHasReasonFlag(t *testing.T) {
|
|
flag := humanDismissCmd.Flags().Lookup("reason")
|
|
if flag == nil {
|
|
t.Fatal("dismiss command should have --reason flag")
|
|
}
|
|
}
|
|
|
|
func TestHumanListHasStatusFlag(t *testing.T) {
|
|
flag := humanListCmd.Flags().Lookup("status")
|
|
if flag == nil {
|
|
t.Fatal("list command should have --status flag")
|
|
}
|
|
}
|