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>
63 lines
1.3 KiB
Go
63 lines
1.3 KiB
Go
//go:build cgo
|
|
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"github.com/steveyegge/beads/internal/types"
|
|
)
|
|
|
|
func TestRepairDeps_NoOrphans(t *testing.T) {
|
|
ctx := context.Background()
|
|
store := newTestStoreWithPrefix(t, filepath.Join(t.TempDir(), "test.db"), "test")
|
|
|
|
// Create two issues with valid dependency
|
|
i1 := &types.Issue{Title: "Issue 1", Priority: 1, Status: "open", IssueType: "task"}
|
|
store.CreateIssue(ctx, i1, "test")
|
|
i2 := &types.Issue{Title: "Issue 2", Priority: 1, Status: "open", IssueType: "task"}
|
|
store.CreateIssue(ctx, i2, "test")
|
|
store.AddDependency(ctx, &types.Dependency{
|
|
IssueID: i2.ID,
|
|
DependsOnID: i1.ID,
|
|
Type: types.DepBlocks,
|
|
}, "test")
|
|
|
|
// Get all dependency records
|
|
allDeps, err := store.GetAllDependencyRecords(ctx)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
// Get all issues
|
|
issues, err := store.SearchIssues(ctx, "", types.IssueFilter{})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
// Build valid ID set
|
|
validIDs := make(map[string]bool)
|
|
for _, issue := range issues {
|
|
validIDs[issue.ID] = true
|
|
}
|
|
|
|
// Find orphans
|
|
orphanCount := 0
|
|
for issueID, deps := range allDeps {
|
|
if !validIDs[issueID] {
|
|
continue
|
|
}
|
|
for _, dep := range deps {
|
|
if !validIDs[dep.DependsOnID] {
|
|
orphanCount++
|
|
}
|
|
}
|
|
}
|
|
|
|
if orphanCount != 0 {
|
|
t.Errorf("Expected 0 orphans, got %d", orphanCount)
|
|
}
|
|
}
|