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

243 lines
8.8 KiB
YAML

name: PR Risk
on:
pull_request:
branches: [ main ]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
detect-ci-tier:
name: Detect CI tier
runs-on: ubuntu-latest
outputs:
full_embedded: ${{ steps.tier.outputs.full_embedded }}
reason: ${{ steps.tier.outputs.reason }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Decide embedded Dolt coverage
id: tier
env:
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: bash .github/scripts/ci-embedded-tier.sh
# # End-to-end coverage for proxied-server CLI subcommands. Each sub-test
# # spawns a real dolt sql-server via the proxy and exercises the bd CLI
# # subprocess against it (see cmd/bd/*_proxied_integration_test.go).
# #
# # The -run pattern intentionally matches the TestProxiedServer* prefix so
# # new proxied integration suites (TestProxiedServerCreate, ...Update,
# # ...Show, etc.) are auto-included without further CI edits. Adopt the
# # `TestProxiedServer<Subcommand>` naming convention for any new entry
# # points and they will be picked up here.
# #
# # Companion to test-domain-uow (which tests the storage/uow layer); this
# # job is the CLI-side gate that ensures the proxied path stays at parity
# # with the embedded path's behavior.
# #
# # The package-level testcontainers Dolt singleton (started by
# # cmd/bd/test_dolt_server_cgo_test.go) is automatically skipped when
# # BEADS_TEST_PROXIED_SERVER=1 is set, so this lane is ~50s faster than
# # it would otherwise be.
# test-proxied-server-cmd:
# name: Test (proxied-server cmd)
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
#
# - name: Set up Go
# uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
# with:
# go-version-file: 'go.mod'
#
# - name: Install Dolt CLI
# run: curl -fsSL https://github.com/dolthub/dolt/releases/latest/download/install.sh | sudo bash
#
# - name: Verify dolt on PATH
# run: dolt version
#
# - name: Configure Git and Dolt identity
# run: |
# git config --global user.name "CI Bot"
# git config --global user.email "ci@beads.test"
# dolt config --global --add user.name "CI Bot"
# dolt config --global --add user.email "ci@beads.test"
#
# - name: Pre-build bd binary for proxied integration tests
# # The test's buildEmbeddedBD helper picks up BEADS_TEST_BD_BINARY,
# # skipping a per-test ~45s rebuild for each invocation.
# run: go build -tags gms_pure_go -o /tmp/bd-proxied-test ./cmd/bd
#
# - name: Test proxied-server bd subcommands
# env:
# BEADS_TEST_PROXIED_SERVER: "1"
# BEADS_TEST_BD_BINARY: /tmp/bd-proxied-test
# # ^TestProxiedServer matches every proxied-server top-level test
# # (Create today; future Update/Show/etc. auto-join without edits).
# run: go test -tags gms_pure_go -count=1 -timeout=10m -v -run '^TestProxiedServer' ./cmd/bd/
# Embedded Dolt tests - test the in-process Dolt engine (no server required)
#
# Split into: build → storage tests + parallel cmd test shards.
# cmd/bd embedded tests use a committed shard manifest; newly-added tests
# still auto-distribute via hash fallback until the manifest is updated.
build-embedded:
name: Build (Embedded Dolt)
needs: detect-ci-tier
if: needs.detect-ci-tier.outputs.full_embedded == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version-file: 'go.mod'
- name: Build embedded bd binary
run: go build -tags gms_pure_go -race -o /tmp/bd-embedded-test ./cmd/bd/
- name: Build embedded storage test binary
run: go test -tags gms_pure_go -race -c -o /tmp/embeddeddolt-test ./internal/storage/embeddeddolt/
- name: Build embedded cmd test binary
run: go test -tags gms_pure_go -race -c -o /tmp/bd-cmd-test ./cmd/bd/
- name: Upload binaries
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: embedded-test-binaries
path: |
/tmp/bd-embedded-test
/tmp/embeddeddolt-test
/tmp/bd-cmd-test
retention-days: 1
test-embedded-storage:
name: Test (Embedded Dolt Storage)
needs: [detect-ci-tier, build-embedded]
if: needs.detect-ci-tier.outputs.full_embedded == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Download binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: embedded-test-binaries
path: /tmp/
- name: Fix permissions
run: chmod +x /tmp/embeddeddolt-test
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Test
env:
BEADS_TEST_EMBEDDED_DOLT: "1"
BEADS_TEST_EMBEDDED_TEST_BINARY: /tmp/embeddeddolt-test
run: /tmp/embeddeddolt-test -test.v -test.count=1 -test.timeout=10m
test-embedded-cmd:
name: Test (Embedded Dolt Cmd ${{ matrix.shard }}/${{ strategy.job-total }})
needs: [detect-ci-tier, build-embedded]
if: needs.detect-ci-tier.outputs.full_embedded == 'true'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Download binaries
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: embedded-test-binaries
path: /tmp/
- name: Fix permissions
run: chmod +x /tmp/bd-embedded-test /tmp/embeddeddolt-test /tmp/bd-cmd-test
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Test
env:
BEADS_TEST_EMBEDDED_DOLT: "1"
BEADS_TEST_BD_BINARY: /tmp/bd-embedded-test
run: bash .github/scripts/embedded-test-shard.sh ${{ matrix.shard }} 20
test-nix:
name: Test Nix Flake
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: DeterminateSystems/determinate-nix-action@f4c468f2287f0f14a113841b41f2dc8957119519 # v3
- name: Run bd help via Nix
id: nix_help
run: |
nix run .#default -- --help > help.txt
- name: Verify help text
if: steps.nix_help.outcome == 'success'
run: |
FIRST_LINE=$(head -n 1 help.txt)
EXPECTED="Issues chained together like beads. A lightweight issue tracker with first-class dependency support."
if [ "$FIRST_LINE" != "$EXPECTED" ]; then
echo "First line of help.txt doesn't match expected output"
echo "Expected: $EXPECTED"
echo "Got: $FIRST_LINE"
exit 1
fi
echo "Help text first line is correct"
ci-gate:
name: CI Gate / Required
runs-on: ubuntu-latest
needs:
- detect-ci-tier
- build-embedded
- test-embedded-storage
- test-embedded-cmd
- test-nix
if: ${{ always() }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Evaluate CI gate
env:
CI_GATE_NAME: PR risk gate
CI_GATE_REQUIRED: >-
DETECT_CI_TIER
BUILD_EMBEDDED
TEST_EMBEDDED_STORAGE
TEST_EMBEDDED_CMD
TEST_NIX
FULL_EMBEDDED: ${{ needs.detect-ci-tier.outputs.full_embedded }}
DETECT_CI_TIER: ${{ needs.detect-ci-tier.result }}
BUILD_EMBEDDED: ${{ needs.build-embedded.result }}
TEST_EMBEDDED_STORAGE: ${{ needs.test-embedded-storage.result }}
TEST_EMBEDDED_CMD: ${{ needs.test-embedded-cmd.result }}
TEST_NIX: ${{ needs.test-nix.result }}
run: |
skipped_ok=""
if [[ "$FULL_EMBEDDED" != "true" ]]; then
skipped_ok="BUILD_EMBEDDED TEST_EMBEDDED_STORAGE TEST_EMBEDDED_CMD"
fi
export CI_GATE_SKIPPED_OK="$skipped_ok"
bash .github/scripts/ci-gate.sh