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>
40 lines
1.4 KiB
Go
40 lines
1.4 KiB
Go
package dberrors
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
)
|
|
|
|
// The real-world message shape is pinned against a live Dolt merge by
|
|
// TestCrossUpgradeBoundaryMerge (internal/storage/dolt); this covers the
|
|
// matcher/extractor consistency contract: any casing IsAncestorPKMismatch
|
|
// accepts must also yield the table name (bd-578h9.17).
|
|
func TestAncestorPKMismatch_CasingConsistency(t *testing.T) {
|
|
for _, msg := range []string{
|
|
"cannot merge because table dependencies has different primary keys",
|
|
"Cannot merge because table dependencies has different primary keys in its common ancestor",
|
|
"CANNOT MERGE BECAUSE TABLE dependencies HAS DIFFERENT PRIMARY KEYS",
|
|
} {
|
|
err := errors.New(msg)
|
|
if !IsAncestorPKMismatch(err) {
|
|
t.Errorf("IsAncestorPKMismatch(%q) = false, want true", msg)
|
|
}
|
|
if got := AncestorPKMismatchTable(err); got != "dependencies" {
|
|
t.Errorf("AncestorPKMismatchTable(%q) = %q, want %q", msg, got, "dependencies")
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestAncestorPKMismatch_NonMatches(t *testing.T) {
|
|
if IsAncestorPKMismatch(nil) {
|
|
t.Error("IsAncestorPKMismatch(nil) = true, want false")
|
|
}
|
|
err := errors.New("merge conflict in table dependencies")
|
|
if IsAncestorPKMismatch(err) {
|
|
t.Errorf("IsAncestorPKMismatch(%q) = true, want false", err)
|
|
}
|
|
if got := AncestorPKMismatchTable(err); got != "" {
|
|
t.Errorf("AncestorPKMismatchTable(%q) = %q, want empty", err, got)
|
|
}
|
|
}
|