44
55AIMA (AI-Inference-Managed-by-AI): a Go binary that manages AI inference on edge devices.
66It detects hardware, resolves optimal configs from a YAML knowledge base, generates K3S Pod YAML,
7- and exposes 79 MCP tools for AI Agents to operate everything. ** This project is 100% developed by Claude Code.**
7+ and exposes 94 MCP tools for AI Agents to operate everything. ** This project is 100% developed by Claude Code.**
88
99Tech: Go (no CGO), K3S, HAMi, SQLite (modernc.org/sqlite), MCP (JSON-RPC 2.0), Cobra CLI, log/slog.
1010Design docs: ` design/ARCHITECTURE.md ` (system architecture), ` design/PRD.md ` , ` design/MRD.md ` .
1111
12- ## Git Flow & Version Management
12+ ## Release Flow & Version Management
1313
14- This project uses ** Git Flow** branching model. Current version: ** v0.0.x** (pre-release).
14+ Current development line: ** v0.2** . Latest product release: ** v0.2.0** (2026-03-25).
15+
16+ This project uses a ** develop-based release flow** with a single declared development line.
17+ The development line is recorded in ` internal/buildinfo/series.txt ` . Right now that value is ` v0.2 ` .
1518
1619```
17- master ──●──── tag v0.0.1 ────────────────── tag v0.0.2 ──
20+ master ──●──── tag v0.2.0 ───────────────── tag v0.2.1 ──
1821 \ /
1922develop ───●──●──●──●──feature──●──●──●──●──●
2023 \ /
@@ -23,18 +26,45 @@ develop ───●──●──●──●──feature──●──●
2326
2427| Branch | Purpose | Merges to |
2528| --------| ---------| -----------|
26- | ` master ` | Production releases only. Every commit = a tagged release. | — |
27- | ` develop ` | Integration branch. Daily development lands here. | ` master ` (via release) |
28- | ` feat/<name> ` | New features. Branch from ` develop ` . | ` develop ` (via PR) |
29- | ` fix/<name> ` | Bug fixes for develop. Branch from ` develop ` . | ` develop ` (via PR) |
30- | ` release/<ver> ` | Release prep (version bump, final fixes). Branch from ` develop ` . | ` master ` + ` develop ` |
31- | ` hotfix/<ver> ` | Urgent fix for production. Branch from ` master ` . | ` master ` + ` develop ` |
32-
33- ### Version Numbering (SemVer)
34-
35- - ** 0.0.x** — Current phase: foundational features, API not stable
36- - ** 0.1.0** — First feature-complete milestone (all core MCP tools working)
37- - ** 1.0.0** — Production-ready, stable API contract
29+ | ` master ` | Production releases only. Every product release tag is created here. | — |
30+ | ` develop ` | Main integration branch for the current development line (` v0.2 ` ). | ` master ` (via ` release/* ` ) |
31+ | ` feat/<name> ` | New feature branch from ` develop ` . | ` develop ` |
32+ | ` fix/<name> ` | Bug fix branch from ` develop ` . | ` develop ` |
33+ | ` docs/<name> ` | Documentation-only branch from ` develop ` . | ` develop ` |
34+ | ` release/<ver> ` | Release preparation branch for a concrete SemVer release such as ` release/v0.2.1 ` . | ` master ` + ` develop ` |
35+ | ` hotfix/<ver> ` | Urgent production fix from ` master ` for a concrete SemVer release. | ` master ` + ` develop ` |
36+
37+ ### Version Taxonomy
38+
39+ - ** Product version** — SemVer release tag ` vMAJOR.MINOR.PATCH ` . Only annotated tags in this exact format count as AIMA releases.
40+ - ** Development line** — the active train for ` develop ` and feature work, currently ` v0.2 ` .
41+ - ** Development build version** — ` <development-line>-dev ` , for example ` v0.2-dev ` . The exact commit is carried separately in build metadata.
42+ - ** MCP protocol version** — protocol compatibility only (for example ` 2024-11-05 ` ), not the AIMA release number.
43+ - ** DB/import schema version** — internal compatibility counters (` PRAGMA user_version ` , ` schema_version ` ), never product release numbers.
44+ - ** Catalog/component version** — upstream dependency versions stored in YAML, not AIMA release numbers.
45+ - ** Asset bundle tag** — must use a separate namespace such as ` assets/<date> ` or ` bundle/<name>/<date> ` , never ` vX.Y.Z-* ` .
46+
47+ ### Product Tag Rules
48+
49+ - Use ** exactly one** product release tag per release commit.
50+ - Product release tags must be ** annotated** .
51+ - Only ` vX.Y.Z ` tags are product releases.
52+ - Do not create product-like suffix tags such as ` v0.1.0-images ` or duplicate aliases such as ` v0.0.1-metax ` .
53+ - Codenames belong in the GitHub release title/notes, not in the tag name.
54+
55+ ### SemVer Rules (Pre-1.0)
56+
57+ - ** 0.y.z minor** — user-visible capability additions, new MCP tools, new runtime behavior, or intentional CLI/MCP contract changes.
58+ - ** 0.y.z patch** — bug fixes, catalog corrections, packaging fixes, and doc updates without intentional capability expansion.
59+ - ** 1.0.0** — CLI/MCP contract and core deployment workflow are stable enough to be treated as a compatibility baseline.
60+
61+ ### Development Line Rules
62+
63+ - ` internal/buildinfo/series.txt ` is the single source of truth for the active development line.
64+ - As long as the team is iterating inside the current line, keep it at ` v0.2 ` .
65+ - All non-tagged builds from ` develop ` , ` feat/* ` , ` fix/* ` , ` docs/* ` , and ` release/* ` report ` v0.2-dev ` .
66+ - When starting the next line, update ` internal/buildinfo/series.txt ` in ` develop ` first, for example ` v0.2 ` → ` v0.3 ` .
67+ - Product releases remain exact SemVer tags such as ` v0.2.1 ` or ` v0.3.0 ` .
3868
3969### Daily workflow
4070
@@ -59,41 +89,48 @@ git branch -d feat/my-feature
5989### Release workflow
6090
6191``` bash
62- # Prepare release
92+ # Prepare a concrete release from the current development line
6393git checkout develop
64- git checkout -b release/v0.0.2
94+ git pull origin develop
95+ git checkout -b release/v0.2.1
6596
66- # Version bump, final fixes, then merge to master
97+ # Final fixes, changelog update, validation
98+
99+ # Merge to master and tag the release
67100git checkout master
68- git merge --no-ff release/v0.0.2
69- git tag -a v0.0.2 -m " Release v0.0.2 "
101+ git merge --no-ff release/v0.2.1
102+ git tag -a v0.2.1 -m " Release v0.2.1 "
70103git push origin master --tags
71104
72- # Back-merge to develop
105+ # Back-merge release fixes into develop
73106git checkout develop
74- git merge --no-ff release/v0.0.2
75- git branch -d release/v0.0.2
107+ git merge --no-ff release/v0.2.1
108+ git push origin develop
76109```
77110
78111### Build with version info
79112
80113``` bash
81- VERSION=$( git describe --tags --always)
82- COMMIT=$( git rev-parse --short HEAD)
83- BUILD_TIME=$( date -u +%Y-%m-%dT%H:%M:%SZ)
84- LDFLAGS=" -X github.com/jguan/aima/internal/cli.Version=$VERSION \
85- -X github.com/jguan/aima/internal/cli.GitCommit=$COMMIT \
86- -X github.com/jguan/aima/internal/cli.BuildTime=$BUILD_TIME "
87-
88- go build -ldflags " $LDFLAGS " -o build/aima ./cmd/aima
114+ make build
115+ ./build/aima version
116+ make version-audit
117+ make bundle-tag
89118```
90119
120+ ` make build ` injects ` Version ` , ` GitCommit ` , and ` BuildTime ` into ` internal/buildinfo ` .
121+ Only exact ` vX.Y.Z ` tags are treated as releases. Non-tagged builds report
122+ ` <development-line>-dev ` , and the current line comes from ` internal/buildinfo/series.txt ` .
123+ ` make version-audit ` prints product tags, legacy pseudo-release tags, and known migration targets.
124+ ` make bundle-tag ` creates the local replacement bundle tag ` bundle/stack/2026-02-26 ` without pushing it.
125+
91126### Rules for AI Agents
92127
93- - ** Never commit directly to master.** Always branch from ` develop ` .
94- - ** Never force-push to master or develop.** These are protected branches.
95- - ** Feature branches merge to develop only.** Only release/hotfix branches touch master.
96- - ** Tag every master merge** with the version number.
128+ - ** Never force-push to ` master ` .**
129+ - ** Branch new work from ` develop ` , not from ` master ` .**
130+ - ** Keep ` internal/buildinfo/series.txt ` at ` v0.2 ` until the team explicitly starts the next line.**
131+ - ** Only ` vX.Y.Z ` annotated tags are product releases.**
132+ - ** Do not invent new product-like suffix tags for assets, images, or vendor-specific bundles.**
133+ - ** Release through ` release/<ver> ` and tag on ` master ` .**
97134
98135## The Prime Directive: Less Code
99136
@@ -108,7 +145,7 @@ mature external tools (K3S, HAMi, containerd, SQLite) together with YAML knowled
108145
109146## Architecture Invariants (Never Violate)
110147
111- Read ` design/ARCHITECTURE.md ` §14 for full list. The critical ones:
148+ Read ` design/ARCHITECTURE.md ` §5 for full list. The critical ones:
112149
1131501 . ** INV-1/2: No code branches for engine/model types.** Engine behavior = YAML. Model metadata = YAML.
114151 Adding a new engine or model = writing YAML, zero Go code.
@@ -120,7 +157,7 @@ Read `design/ARCHITECTURE.md` §14 for full list. The critical ones:
120157## Project Structure
121158
122159```
123- cmd/aima/main.go # Entry point
160+ cmd/aima/ # Entry point + dependency wiring split across domain files
124161internal/
125162 hal/ # Hardware detection (nvidia-smi, /proc)
126163 k3s/ # K3S client (kubectl wrapper)
@@ -129,14 +166,13 @@ internal/
129166 # + query engine (query.go) + vector similarity (similarity.go)
130167 # + Pod YAML generator (dynamic GPU resource names)
131168 runtime/ # Multi-Runtime: K3S (Pod) + Docker (container) + Native (exec + warmup)
132- state/ # SQLite (modernc.org/sqlite, zero CGO) — v2: 16 tables
133- model/ # Model scan/download/import
169+ sqlite.go # SQLite state store package (modernc.org/sqlite, zero CGO) — v2: 16 tables
170+ model/ # Model scan/download/import + metadata detection
134171 engine/ # Engine image scan/pull/import + native binary manager
135172 stack/ # Tiered stack installer (Docker/CTK/K3S/HAMi, archive/binary/helm, airgap)
136173 benchmark/ # Live benchmark runner (SSE streaming, concurrency, percentile stats)
137- mcp/ # MCP server + 61 tool implementations
174+ mcp/ # MCP server + RegisterAllTools + tools_*.go implementations
138175 agent/ # Go Agent loop (L3a) + Dispatcher
139- zeroclaw/ # ZeroClaw lifecycle manager (optional L3b sidecar)
140176 cli/ # Cobra commands (thin wrappers over MCP tools)
141177 ui/ # Embedded Web UI (go:embed, Alpine.js SPA on :6188/ui/)
142178catalog/ # Knowledge assets (go:embed, compiled in)
@@ -153,7 +189,8 @@ catalog/ # Knowledge assets (go:embed, compiled in)
153189## Key Commands
154190
155191``` bash
156- go build ./cmd/aima # Build
192+ make build # Versioned build (uses current development line / release tag)
193+ go build ./cmd/aima # Quick local build without release metadata guarantees
157194go test ./... # Test all
158195go test -race ./... # Test with race detector
159196go vet ./... # Static analysis
@@ -212,11 +249,8 @@ if engineType == "vllm" {
212249Every feature must handle absence of its dependencies:
213250
214251``` go
215- // L3b unavailable -> fall back to L3a -> fall back to L2 -> fall back to L0
252+ // L3a unavailable -> fall back to L2 -> fall back to L0
216253func (d *Dispatcher ) Ask (ctx context .Context , query string ) (string , error ) {
217- if d.zeroclaw .Available () && d.isComplex (query) {
218- return d.zeroclaw .Ask (ctx, query)
219- }
220254 if d.goAgent .Available () {
221255 return d.goAgent .Ask (ctx, query)
222256 }
@@ -256,7 +290,7 @@ func (d *Dispatcher) Ask(ctx context.Context, query string) (string, error) {
256290| Configuration | A tested Hardware x Engine x Model x Config instance with derivation chain |
257291| BenchmarkResult | Multi-dimensional performance data for a Configuration under specific load |
258292| PerfVector | 6-dimensional normalized performance vector for similarity search |
259- | L0/L1/L2/L3a/L3b | Progressive intelligence levels: defaults -> human CLI -> knowledge -> Go Agent -> ZeroClaw |
293+ | L0/L1/L2/L3a | Progressive intelligence levels: defaults -> human CLI -> knowledge -> Go Agent |
260294| ConfigResolver | Merges L0-L3 configs, higher layer overrides lower |
261295| Store | Knowledge query engine wrapping * sql.DB (Search/Compare/Gaps/Similar/Lineage/Aggregate) |
262296| MCP Tool | JSON-RPC function exposed to Agents (deploy.apply, model.scan, etc) |
0 commit comments