caelum0x 49b183818c Unify gitgram + aitimemachine into the monorepo (de-submodule) and merge vendored engines
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>
2026-06-23 14:14:09 +03:00

54 lines
1.8 KiB
TypeScript

/**
* Shared mini-repo fixture setup for `runFullAnalysis`-level integration
* tests (incremental-orchestration, pdg-mode-flip). Copies the
* `test/fixtures/mini-repo/src` files into a fresh git-initialized temp
* directory so each test owns a real repo with a real history. Extracted
* from incremental-orchestration.test.ts when pdg-mode-flip.test.ts became
* its second verbatim consumer (#2099) — the fixture file list must live in
* exactly one place.
*/
import { execSync } from 'child_process';
import { copyFile, mkdir } from 'fs/promises';
import path from 'path';
import { fileURLToPath } from 'url';
import { createTempDir } from './test-db.js';
const HERE = path.dirname(fileURLToPath(import.meta.url));
const FIXTURE_SRC = path.resolve(HERE, '..', 'fixtures', 'mini-repo', 'src');
const MINI_REPO_FILES = [
'index.ts',
'handler.ts',
'validator.ts',
'formatter.ts',
'middleware.ts',
'logger.ts',
'db.ts',
];
/**
* Copy the mini-repo fixture into a fresh git-initialized temp directory.
* Returns the temp handle so the caller owns cleanup.
*/
export async function setupMiniRepo(
prefix = 'gitnexus-mini-repo-',
): Promise<{ dbPath: string; cleanup: () => Promise<void> }> {
const tmp = await createTempDir(prefix);
const dest = path.join(tmp.dbPath, 'src');
await mkdir(dest, { recursive: true });
for (const n of MINI_REPO_FILES) {
await copyFile(path.join(FIXTURE_SRC, n), path.join(dest, n));
}
execSync('git init', { cwd: tmp.dbPath, stdio: 'pipe' });
execSync('git -c user.name=test -c user.email=t@t -c commit.gpgsign=false add -A', {
cwd: tmp.dbPath,
stdio: 'pipe',
});
execSync('git -c user.name=test -c user.email=t@t -c commit.gpgsign=false commit -q -m initial', {
cwd: tmp.dbPath,
stdio: 'pipe',
});
return tmp;
}