Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

perf(ci): build artifacts without installing the application (#1906)

Call White963ab0d690d5
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 2efa7414e..fe350feae 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -89,7 +89,8 @@ jobs:
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AVIBE_OS: 3.0.99rc1
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_AVIBE_MEMORY: 3.0.99rc1
run: |
- pip install -e . build hatchling hatch-vcs
+ # Build backends are installed by each isolated PEP 517 build.
+ python -m pip install --disable-pip-version-check build
python scripts/prepare_local_show_runtime_manifest.py
python -m build --outdir memory-dist packaging/avibe-memory
python -m build
diff --git a/docs/plans/ci-minimal-artifact-builder.md b/docs/plans/ci-minimal-artifact-builder.md
new file mode 100644
index 000000000..cc93c087b
--- /dev/null
+++ b/docs/plans/ci-minimal-artifact-builder.md
@@ -0,0 +1,61 @@
+# Minimal CI Artifact Builder
+
+## Scope and Evidence
+
+This is phase two of the approved order: stability, build/install preparation,
+then repeated work inside test calls. Phase one (#1905) is merged and its exact
+master source passed all 17 checks, 405 unit-file exits/metrics, 21 distribution
+contracts and 196 installer cases. The remaining test-call investigation is not
+claimed complete by this PR.
+
+The artifact producer installed the whole application and its runtime dependency
+graph before running isolated PEP 517 builds. Inspection of the manifest helper,
+Hatch hook and exact-peer metadata hook found only standard-library operations
+and declared build-system requirements. The producer does not run application
+behavior; separate private installation jobs own that validation.
+
+A fresh local builder containing only pip, build, packaging and pyproject-hooks
+produced real core and Memory wheels and source distributions. Neither the app
+nor its runtime dependencies were installed in that builder before or after.
+The original manifest preparation validated the published runtime manifest. Both
+distribution pairs used the exact 3.0.99rc1 peer contract. All 21 existing actual
+distribution tests passed against those artifacts, including isolated source
+installation. The local UI placeholder does not substitute for CI's production
+UI build, Docker regressions or Windows installation.
+
+## Smallest Complete Change
+
+Install only the existing build frontend in the producer. Each isolated build
+continues installing its declared backend requirements. Preserve the original
+manifest preparation, core/Memory wheel and sdist builds, contract versions,
+production UI, artifact identities and same-run consumers. No build isolation
+is disabled. No runner, dependency declaration, timeout, test selection or
+application behavior changes.
+
+Workflow contracts pin the minimal command sequence and execute that sequence
+with a controlled Python command to prove failure propagation at every boundary.
+All existing unit/UI and distribution/install aggregates still fail closed.
+
+## Verification and Delivery
+
+Run workflow, shard and fixture contracts, source packaging contracts, lint and
+package requirement checks. Require all 21 actual distribution contracts in the
+installer CI with no skips; retain the real released-wheel upgrade and Windows
+smoke. The full expected check set remains 17. Complete current-head bot review,
+every exact-head lint run, whole-PR thread inventory and clean integration gate
+are mandatory before guarded squash. Verify exact-source master CI afterward.
+
+Baseline #1905 PR run 34008949861 took 416 seconds; producer 103 seconds and
+installer 302 seconds. Merged master 34009487671 took 442 seconds, with a Python
+shard as the tail. Prior master 34007354215 took 361 seconds with producer 122
+seconds. These varying samples are not a stable speed guarantee. Compare actual
+build-step and build-to-install timestamps after this PR; the successful local
+build is capability evidence, not a claimed CI speedup.
+
+Initial findings-bearing review-head inventory is zero. No allocated cross-lane
+identifiers, production operations or global environment changes are involved.
+
+Local workflow/shard/fixture/source contracts passed 70 cases. Seven artifact-only
+cases skip when wheel paths are absent; all 21 distribution cases separately
+passed with the minimal builder's real artifacts (136.41 seconds). Ruff 0.4.9,
+all 84 private test-environment package requirements and whitespace checks pass.
diff --git a/tests/test_ci_pipeline.py b/tests/test_ci_pipeline.py
index af7334849..943a2a87e 100644
--- a/tests/test_ci_pipeline.py
+++ b/tests/test_ci_pipeline.py
@@ -21,6 +21,53 @@ def _jobs() -> dict:
return yaml.safe_load((ROOT / ".github/workflows/lint.yml").read_text())["jobs"]
+def _artifact_build_commands() -> list[list[str]]:
+ step, = [step for step in _jobs()["build-linux-artifacts"]["steps"]
+ if step.get("name") == "Build package artifact"]
+ assert not step.get("if") and not step.get("continue-on-error")
+ return [shlex.split(line, comments=True) for line in step["run"].splitlines()
+ if line.strip() and not line.lstrip().startswith("#")]
+
+
+def test_artifact_producer_only_installs_the_frontend_and_builds_both_isolated_distributions():
+ assert _artifact_build_commands() == [
+ ["python", "-m", "pip", "install", "--disable-pip-version-check", "build"],
+ ["python", "scripts/prepare_local_show_runtime_manifest.py"],
+ ["python", "-m", "build", "--outdir", "memory-dist", "packaging/avibe-memory"],
+ ["python", "-m", "build"],
+ ]
+
+
[email protected]("failed_stage", [None, 0, 1, 2, 3])
+def test_artifact_build_stops_at_each_failed_boundary(tmp_path, failed_stage):
+ binary = tmp_path / "bin"
+ binary.mkdir()
+ python = binary / "python"
+ python.write_text(
+ f"#!{sys.executable}\n"
+ "import json, os, pathlib, sys\n"
+ "path = pathlib.Path('commands.json')\n"
+ "commands = json.loads(path.read_text()) if path.exists() else []\n"
+ "commands.append(sys.argv)\n"
+ "path.write_text(json.dumps(commands))\n"
+ "sys.exit(7 if str(len(commands) - 1) == os.environ['FAIL_STAGE'] else 0)\n"
+ )
+ python.chmod(0o755)
+ step, = [step for step in _jobs()["build-linux-artifacts"]["steps"]
+ if step.get("name") == "Build package artifact"]
+ result = subprocess.run(
+ [shutil.which("bash"), "-e", "-c", step["run"]], cwd=tmp_path,
+ env={**os.environ, "PATH": str(binary), "FAIL_STAGE": str(failed_stage)},
+ capture_output=True, text=True, timeout=10,
+ )
+ assert result.returncode == (0 if failed_stage is None else 7), result.stderr
+ commands = json.loads((tmp_path / "commands.json").read_text())
+ expected = _artifact_build_commands()
+ assert [["python", *command[1:]] for command in commands] == expected[:
+ len(expected) if failed_stage is None else failed_stage + 1
+ ]
+
+
def test_ci_uv_installation_is_exact_and_cache_ownership_is_preserved():
owners = {
name: job for name, job in _jobs().items()