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>
57 lines
2.1 KiB
Go
57 lines
2.1 KiB
Go
package storage
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
// CommitInfo represents a version control commit.
|
|
type CommitInfo struct {
|
|
Hash string
|
|
Author string
|
|
Email string
|
|
Date time.Time
|
|
Message string
|
|
}
|
|
|
|
// StatusEntry represents a changed table in the working set.
|
|
type StatusEntry struct {
|
|
Table string
|
|
Status string // "new", "modified", "deleted"
|
|
}
|
|
|
|
// Status represents the current repository status.
|
|
type Status struct {
|
|
Staged []StatusEntry
|
|
Unstaged []StatusEntry
|
|
}
|
|
|
|
// VersionControl provides branch, commit, merge, and status operations.
|
|
type VersionControl interface {
|
|
Branch(ctx context.Context, name string) error
|
|
Checkout(ctx context.Context, branch string) error
|
|
CurrentBranch(ctx context.Context) (string, error)
|
|
DeleteBranch(ctx context.Context, branch string) error
|
|
ListBranches(ctx context.Context) ([]string, error)
|
|
Commit(ctx context.Context, message string) error
|
|
// CommitWithConfig is like Commit but includes the config table.
|
|
// Use after intentional config writes (bd init, bd config set, bd rename-prefix).
|
|
// GH#3216: bootstrap paths must use this to commit issue_prefix.
|
|
CommitWithConfig(ctx context.Context, message string) error
|
|
// CommitMergeResolution concludes a merge whose conflicts the operator
|
|
// resolved with an explicit --strategy (bd vc merge / bd federation sync),
|
|
// committing the resolved working set INCLUDING config. Plain Commit excludes
|
|
// config (GH#2455), so a config-only resolution — routine now that kv.* user
|
|
// data syncs through config — would be dropped, leaving the merge unconcluded
|
|
// and re-wedging the next pull/sync (GH#2474).
|
|
CommitMergeResolution(ctx context.Context, message string) error
|
|
CommitPending(ctx context.Context, actor string) (bool, error)
|
|
CommitExists(ctx context.Context, commitHash string) (bool, error)
|
|
GetCurrentCommit(ctx context.Context) (string, error)
|
|
Status(ctx context.Context) (*Status, error)
|
|
Log(ctx context.Context, limit int) ([]CommitInfo, error)
|
|
Merge(ctx context.Context, branch string) ([]Conflict, error)
|
|
GetConflicts(ctx context.Context) ([]Conflict, error)
|
|
ResolveConflicts(ctx context.Context, table string, strategy string) error
|
|
}
|