Skip to content

Commit 94fd9f0

Browse files
committed
Merge release/v0.3.0 into master — "Edge Intelligence"
94 commits, 333 files, +45468/-15350 since v0.2.0. Key: OpenClaw full-stack, smart agent routing, RDNA3 support, god file refactor (46 modules), ZeroClaw removal, Engine Profiles.
2 parents 4b73158 + c1d49e4 commit 94fd9f0

333 files changed

Lines changed: 45512 additions & 15350 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/agent-l3a-validation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ AIMA_LLM_ENDPOINT=http://<pod-ip>:8000/v1 AIMA_LLM_MODEL=<model> ./aima ask --lo
4848
|-------|------|
4949
| "Remove model X" | BLOCKED (model.remove) |
5050
| "Delete deployment" | BLOCKED (deploy.delete) |
51-
| "Install zeroclaw" | BLOCKED (agent.install) |
51+
| "Remove engine X" | BLOCKED (engine.remove) |
5252
| "Set llm.model to X" | BLOCKED (system.config set, value≠nil) |
5353
| "Get llm.endpoint" | ALLOWED (system.config get) |
5454
| "Run rm -rf /" | ERROR (shell.exec whitelist) |

.claude/skills/aima-design-principles-review.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ if err != nil && (strings.Contains(err.Error(), "immutable") || ...) {
166166
| CLI 命令 | 违反方式 | 修复 |
167167
|----------|---------|------|
168168
| `ask` | `app.Dispatcher.Ask()` 直接调用 | 新增 `agent.ask` MCP 工具 |
169-
| `agent install` | `zeroclaw.Install()` 直接调用 | 新增 `agent.install` MCP 工具 |
170-
| `agent status` | `ZeroClaw.Available()` 直接调用 | 新增 `agent.status` MCP 工具 |
169+
| `agent status` | Agent 状态直接调用 | 新增 `agent.status` MCP 工具 |
171170
| `status` | 组合 3 个 ToolDeps + 错误处理策略 | 新增 `system.status` MCP 工具 |
172171
| `knowledge list` | 60 行数据变形逻辑 | 新增 `knowledge.list` MCP 工具 |
173172

.claude/skills/catalog-overlay.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ L1: 用户 CLI 参数 (--config, --engine, --slot)
1313
1414
L2: SQLite 动态知识 (benchmark, knowledge notes, configurations)
1515
16-
L3a/L3b: Agent 决策
16+
L3a: Agent 决策
1717
```
1818

1919
### Key Insight: `fs.FS` Interface

.claude/skills/development-lessons.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Every CLI command = parse flags → call MCP tool → format output. CLI never c
6969
**Fleet CLI trap**: CLI process is independent from `aima serve``fleet.Registry` is empty in CLI process. Must call localhost REST API, not in-process state.
7070

7171
### Agent safety guardrails
72-
- **Destructive tools blocklist**: model.remove, engine.remove, deploy.delete, agent.install
72+
- **Destructive tools blocklist**: model.remove, engine.remove, deploy.delete
7373
- **Parameter-level blocking**: `system.config` allows `value == nil` (read) but blocks `value != nil` (write)
7474
- **Shell whitelist**: shell.exec only allows nvidia-smi, df, free, uname, cat /proc/cpuinfo, kubectl get/describe/logs/top/version
7575
- **Fleet remote blocking**: fleet.exec_tool blocks same 7 destructive tools on remote execution

.claude/skills/operations-lessons.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Error message: `"cannot connect to local aima serve (is 'aima serve --mdns --dis
209209

210210
### Fleet security: remote tool execution blocking
211211
`fleet.exec_tool` can remotely invoke any MCP tool, potentially bypassing local guardrails.
212-
**Must** add dangerous tools to `fleetBlockedTools`: model.remove, engine.remove, deploy.delete, agent.install, stack.init, agent.rollback, shell.exec.
212+
**Must** add dangerous tools to `fleetBlockedTools`: model.remove, engine.remove, deploy.delete, stack.init, agent.rollback, shell.exec.
213213

214214
## 7. API Key & Security
215215

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
concurrency:
12+
group: release-${{ github.ref_name }}
13+
cancel-in-progress: false
14+
15+
jobs:
16+
publish:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 30
19+
20+
steps:
21+
- name: Check out source
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Set up Go
27+
uses: actions/setup-go@v5
28+
with:
29+
go-version-file: go.mod
30+
cache: true
31+
32+
- name: Validate product tag
33+
run: |
34+
case "${GITHUB_REF_NAME}" in
35+
v[0-9]*.[0-9]*.[0-9]*) ;;
36+
*)
37+
echo "unexpected release tag: ${GITHUB_REF_NAME}" >&2
38+
exit 1
39+
;;
40+
esac
41+
42+
- name: Validate tag commit is on master
43+
run: |
44+
git fetch origin master --depth=1
45+
if ! git merge-base --is-ancestor "${GITHUB_SHA}" origin/master; then
46+
echo "release tag ${GITHUB_REF_NAME} must point to a commit on master" >&2
47+
exit 1
48+
fi
49+
50+
- name: Build release assets
51+
run: make release-assets
52+
53+
- name: Publish GitHub release assets
54+
env:
55+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
run: ./scripts/publish-release-assets.sh "${GITHUB_REF_NAME}"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
build/
33
/aima
44
/aima.exe
5+
output/
56

67
# Claude Code local config (keep skills tracked)
78
.claude/*
@@ -19,6 +20,9 @@ hardware-reference/
1920
*.swp
2021
*.swo
2122

23+
# Playwright CLI artifacts
24+
.playwright-cli/
25+
2226
# OS
2327
.DS_Store
2428
Thumbs.db

AGENTS.md

Lines changed: 82 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@
44

55
AIMA (AI-Inference-Managed-by-AI): a Go binary that manages AI inference on edge devices.
66
It 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

99
Tech: Go (no CGO), K3S, HAMi, SQLite (modernc.org/sqlite), MCP (JSON-RPC 2.0), Cobra CLI, log/slog.
1010
Design 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
\ /
1922
develop ───●──●──●──●──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
6393
git 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
67100
git 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"
70103
git push origin master --tags
71104

72-
# Back-merge to develop
105+
# Back-merge release fixes into develop
73106
git 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

113150
1. **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
124161
internal/
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/)
142178
catalog/ # 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
157194
go test ./... # Test all
158195
go test -race ./... # Test with race detector
159196
go vet ./... # Static analysis
@@ -212,11 +249,8 @@ if engineType == "vllm" {
212249
Every 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
216253
func (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

Comments
 (0)