Repository navigation
296 lines (280 loc) · 12.1 KB
/
Copy pathci.yml
File metadata and controls
296 lines (280 loc) · 12.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
name: CI
on:
pull_request:
push:
branches: [main, develop, 'release/**']
workflow_dispatch:
jobs:
ts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: 26
cache: pnpm
- uses: astral-sh/setup-uv@v6
- run: pnpm install --frozen-lockfile
- run: pnpm gen
- run: pnpm build
# CLI coexistence tests boot the real sidecar. It resolves the repo
# .venv that `uv sync` creates; without that, those tests exit 1.
- run: uv sync
- run: pnpm test
- run: pnpm check:drift
# agent-shell 产品中立门禁(3.2 随 shell 上提到本仓):shell 源码与
# 技能正文不得含产品硬编码,产品身份由消费方组装根注入。
- name: shell neutrality gate
run: pnpm --filter @steerable/agent-shell shell:neutral
- name: storage boundary gate
run: pnpm --filter @steerable/agent-shell storage:boundaries
# D1 (codegen idempotency): rerun the generator and assert the working
# tree is still clean. Catches non-deterministic codegen (random hashes,
# unstable map ordering, locale-dependent sort) the moment it sneaks in,
# rather than years later when a contributor finally regenerates locally.
- name: codegen idempotency
run: |
pnpm gen
if ! git diff --quiet -- packages; then
echo "::error::pnpm gen produced a non-empty diff on second run — codegen is not idempotent."
git --no-pager diff -- packages
exit 1
fi
tui-portable:
name: TUI portable (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: 26
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm gen
- run: pnpm --filter @steerable/agent-cli... build
- run: pnpm --filter @steerable/agent-cli test:tui
env:
TUI_ARTIFACT_DIR: ${{ github.workspace }}/test-results/tui
- name: Upload TUI platform evidence and failure artifacts
if: always()
uses: actions/upload-artifact@v5
with:
name: tui-portable-${{ matrix.os }}
path: test-results/tui
if-no-files-found: ignore
tui-pty:
name: TUI PTY (Linux/tmux)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: 26
cache: pnpm
- run: sudo apt-get update && sudo apt-get install -y tmux
- run: pnpm install --frozen-lockfile
- run: pnpm gen
- run: pnpm --filter @steerable/agent-cli... build
- run: pnpm --filter @steerable/agent-cli test:tui:pty
env:
TUI_ARTIFACT_DIR: ${{ github.workspace }}/test-results/tui
- name: Upload TUI PTY failure artifacts
if: failure()
uses: actions/upload-artifact@v5
with:
name: tui-pty-linux
path: test-results/tui
if-no-files-found: ignore
rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Public source gate
run: python scripts/check_no_public_coreloop_source.py
- name: Public exposure gate
run: python scripts/check_public_exposure.py
- name: Engine compatibility gate
run: python scripts/check_engine_compatibility.py
- name: Install Tauri compile dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libayatana-appindicator3-dev \
librsvg2-dev \
libwebkit2gtk-4.1-dev
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Tauri host crate
working-directory: packages/agent-shell/tauri
run: |
cargo fmt --check
cargo test
cargo clippy --all-targets -- -D warnings
# The desktop example is the documented starting point for a product, so
# a change that breaks it must fail here rather than in someone's repo.
- name: Desktop example compiles
working-directory: examples/tauri-desktop/src-tauri
run: |
cargo fmt --check
cargo check --all-targets
py:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v6
- run: uv sync
- name: Native CoreLoop import smoke
run: uv run python -c "import steerable_agent_runtime_native as n; assert n.run_turn"
- run: uv run python scripts/generate_py.py
# STEERABLE_E2E_REQUIRED=1: the real-process e2e tier (run_code, web
# tools, tool exposure, …) must hard-fail when its environment is broken
# (sidecar not importable) instead of silently skipping — a silent skip
# would let a sandbox/tool regression land green.
- run: uv run pytest
env:
STEERABLE_E2E_REQUIRED: "1"
- run: uv run python scripts/check_drift.py
- run: uv run python scripts/check_docs_drift.py
- run: uv run python scripts/check_doc_anchors.py
# D1 (codegen idempotency): same as the TS job, scoped to the Py
# generated tree.
- name: codegen idempotency
run: |
uv run python scripts/generate_py.py
if ! git diff --quiet -- packages; then
echo "::error::generate_py.py produced a non-empty diff on second run — codegen is not idempotent."
git --no-pager diff -- packages
exit 1
fi
# Wall-clock budgets need an otherwise idle runner, so the benchmark lane
# runs as its own job instead of joining the py aggregate. PR-only: the
# gate guards incoming changes; main-branch history does not need it.
bench:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v6
- run: uv sync
# -s: measurements print on pass too — the recorded medians are the
# evidence for recalibrating CI_TIME_SCALE and spotting slow drift.
- run: uv run pytest benchmarks/ -q -s
lockstep:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- run: python scripts/check_lockstep_versions.py
examples:
# D2 (examples-in-CI): runs every published example end-to-end so the
# README claims about the framework's surface stay honest. Each run
# asserts a marker line that the example is supposed to print, otherwise
# a refactor that silently breaks an example would still pass CI.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v5
with:
node-version: 26
cache: pnpm
- uses: astral-sh/setup-uv@v6
- run: pnpm install --frozen-lockfile
- run: pnpm gen # ts examples consume generated types
- run: pnpm build # so the workspace deps resolve to dist/
- run: uv sync # py examples consume editable workspace pkgs
- name: example / py-minimal
run: |
out=$(uv run --package steerable-example-py-minimal \
python -m steerable_example_py_minimal.main)
echo "$out"
echo "$out" | grep -q "^\[wire\]" || { echo "::error::py-minimal missing [wire] marker"; exit 1; }
echo "$out" | grep -q "^\[harness\]" || { echo "::error::py-minimal missing [harness] marker"; exit 1; }
- name: example / ts-minimal
run: |
out=$(pnpm --filter steerable-example-ts-minimal start 2>&1)
echo "$out"
echo "$out" | grep -q "\[wire\]" || { echo "::error::ts-minimal missing [wire] marker"; exit 1; }
echo "$out" | grep -q "\[harness\]" || { echo "::error::ts-minimal missing [harness] marker"; exit 1; }
- name: example / sidecar-roundtrip
run: |
out=$(uv run --package steerable-example-sidecar-roundtrip \
python -m steerable_example_sidecar_roundtrip.main)
echo "$out"
echo "$out" | grep -q "^\[ready\]" || { echo "::error::sidecar-roundtrip missing [ready] marker"; exit 1; }
echo "$out" | grep -q "^\[ping\]" || { echo "::error::sidecar-roundtrip missing [ping] marker"; exit 1; }
echo "$out" | grep -q "^\[bye\]" || { echo "::error::sidecar-roundtrip missing [bye] marker"; exit 1; }
- name: example / ts-runtime
# Boots the real sidecar through @steerable/agent-runtime. No key, so it
# prints the tool count instead of running a turn: the point is that a
# host can spawn and drain the sidecar with one dependency.
run: |
out=$(pnpm --filter steerable-example-ts-runtime start 2>&1)
echo "$out"
echo "$out" | grep -q "^\[ready\]" || { echo "::error::ts-runtime missing [ready] marker"; exit 1; }
echo "$out" | grep -q "^\[tools\]" || { echo "::error::ts-runtime missing [tools] marker"; exit 1; }
echo "$out" | grep -q "^\[bye\]" || { echo "::error::ts-runtime missing [bye] marker"; exit 1; }
- name: example / web-shell (vite build smoke)
# The framework's runnable reference app. We don't run it (no headless
# browser here), but a clean Vite build is enough to catch any
# framework export / type / fixture-schema regression that would
# otherwise only surface when an external user clones the repo.
run: |
pnpm --filter steerable-example-web-shell build
test -f examples/web-shell/dist/index.html || {
echo "::error::web-shell build did not produce dist/index.html"; exit 1;
}
sidecar-budget:
# D3 (sidecar bundle size budget): enforces a hard upper bound on the
# sidecar bundle size on every PR so a future dependency bump can't
# quietly inflate the bundle even further. We build the host (Linux x64)
# target only — that is enough to catch dep-size regressions, and the
# full cross-platform matrix runs on `tags: [sidecar-v*]` via
# .github/workflows/sidecar-build.yml.
#
# Budget rationale (2026-08):
# * The build uses the `install_only_stripped` python-build-standalone
# variant (debug symbols / toolchain artefacts removed); with pydantic
# + our four workspace packages and aggressive stdlib pruning the
# bundle lands well under 300 MB on Linux x64.
# * 320 MB PR budget = the original design target, with head-room for
# dep bumps but tight enough to catch a 50 MB+ regression on the PR.
# * (History: the `install_only` variant unpacked to ~700 MB and needed
# an 800 MB gate; the variant switch reclaimed ~400 MB.)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Build pure-Python wheels and download the verified native wheel
run: |
uv build --all-packages --out-dir dist/py
rm -f dist/py/steerable_example_*.whl dist/py/steerable_example_*.tar.gz
python scripts/fetch_verified_artifacts.py wheel \
--artifact-lock --platform manylinux-x64 --out dist/py
- name: Build sidecar (host) under PR budget
run: |
python packages/sidecar/build/build_sidecar.py \
--from-wheels dist/py \
--target host \
--strip-stdlib \
--aggressive \
--budget-mb 320
- name: Report bundle size
run: |
python <<'PY'
import glob, json, pathlib
manifest_path = glob.glob("packages/sidecar/dist/python-runtime/*/manifest.json")[0]
mb = json.loads(pathlib.Path(manifest_path).read_text())["totalBytes"] / 1024 / 1024
print(f"::notice title=Sidecar bundle size (host)::{mb:.1f} MB / 320 MB budget")
PY