Skip to content

build: make openadapt-kernel an optional, capped alpha extra; run its suite in ci - #2782

Merged
abrichr merged 1 commit into
mainfrom
claude/kernel-optional-extra-ci
Nov 30, 2026
Merged

abrichr merged 1 commit into
mainfrom
claude/kernel-optional-extra-ci

Conversation

@abrichr

@abrichr abrichr commented Nov 30, 2026

Copy link
Copy Markdown
Member

openadapt-kernel is a 0.1.0 alpha, but pip install openadapt installed it, uncapped. Its tests ran in kernel.yml and kernel-ci.yml, two near-identical path-filtered workflows outside the required ci check. So a kernel change could merge with them red. This PR makes the kernel an opt-in extra and runs its suite inside ci. It does not change any kernel source.

Packaging

  • openadapt-kernel is gone from the base dependencies. The kernel extra stays, capped: openadapt-kernel>=0.1.0,<0.2. all and core don't include it. uv lock changed only the kernel's two edges.
  • openadapt kernel ..., openadapt kernel --help and the lazy openadapt.ObligationLedger (and the other kernel exports) say to pip install 'openadapt[kernel]' when the kernel is missing. import openadapt never imported the kernel eagerly. A new test now holds that: a fresh interpreter whose import system refuses openadapt_kernel runs import openadapt, openadapt --help, openadapt kernel run and openadapt kernel --help.
  • The install-weight budget for the launcher moves openadapt-kernel from allow to forbid, so the install-weight job fails if the base install pulls it again.
  • platform-manifest.json: compatibility.launcher_requires follows the new range. validate_platform_manifest.py --offline passes.
  • CLI surface snapshot: the kernel's help gains the install line, and the command list says "(optional alpha extra)". Both snapshot tests pass on Click 8.5.0 and Python 3.12, the versions the snapshot was written on.

CI

  • packages.yml, which ci calls, gets a kernel job: uv sync --locked --extra browser --extra dev, headless Chromium, ruff, mypy and pytest tests. It runs on Python 3.12 on the PR and queue tiers, and 3.11 and 3.12 on main. Only packages/kernel/** (and packages.yml) select it. It is in packages-gate's needs and selects, so a selected kernel job that fails or is skipped fails ci. Nightly runs it as well.
  • kernel.yml and kernel-ci.yml are deleted. Neither had a matrix or anything the new job lacks: kernel-ci.yml was kernel.yml plus mypy. kernel-ci.yml also ran on pushes to every branch, merge-queue branches included.
  • Kernel releases: scripts/ci/newest_green.py now finds the green run in packages.yml under the job prefix kernel (, which matches both Python versions.
  • Time: on fix(kernel): autopilot requires a signed VERIFIED_AUTOPILOT pack #2779 the kernel job took about 2 minutes (install 13 s, mypy 3 s, suite 80 s). It runs in parallel with the other package jobs, so ci stays under its 10-minute budget. Every action is pinned by SHA.
  • tests/test_kernel_ci.py runs the real scope classifier and gate script. It checks that kernel changes select the job, that unrelated changes don't, and that the gate fails a selected job that failed, was cancelled or was skipped. It also checks the release lookup.

Docs

  • packages/kernel/README.md has a new Install section: an optional alpha extra, or pip install openadapt-kernel on its own.
  • The root README package row says it's an optional alpha extra.
  • New capability row capabilities/04-.../0620-commit-boundary-kernel-an-optional-alpha-extra.md. As the repository's CLAUDE.md requires, this PR doesn't regenerate CAPABILITIES.md or llms-full.txt. refresh-generated.yml does that after the change lands, and build_capabilities.py --check-pr passes.

Note on the cap

#2779 bumps the kernel to 0.2.0, a breaking release that holds the W4 security fixes. With <0.2, openadapt[kernel] keeps resolving to 0.1.0 after 0.2.0 ships. Once 0.2.0 is on PyPI, a follow-up should move the extra to >=0.2.0,<0.3 and relock. Today both ranges lock to 0.1.0.

Tests

The launcher and CI contract tests were run on this branch and on origin/main in the same environment. See the PR comment for which ones already fail on main here.

… suite in ci

- Remove openadapt-kernel from the launcher's base dependencies. The kernel
  extra stays and is capped: openadapt-kernel>=0.1.0,<0.2. Relock.
- openadapt kernel, its --help and the lazy openadapt.* kernel exports say to
  install 'openadapt[kernel]' when the kernel is missing. A subprocess test
  blocks openadapt_kernel and checks import openadapt, openadapt --help and
  openadapt kernel.
- Install-weight budgets forbid the kernel in the base install; the platform
  manifest's compatibility range follows pyproject.
- packages.yml (called by the required ci check) gets a kernel job: ruff,
  mypy and the whole suite with headless Chromium, Python 3.12 on PR and
  queue tiers, 3.11 and 3.12 on main. Selected by packages/kernel changes
  and enforced by packages-gate.
- Delete kernel.yml and kernel-ci.yml, which ran the same checks outside the
  required check. Kernel releases now read the packages.yml kernel job.
- Docs: kernel README install section, root README row, capability row.
@abrichr

abrichr commented Nov 30, 2026

Copy link
Copy Markdown
Member Author

Local test comparison, run in the same shared environment on this branch and on origin/main (a32c13e). The set covered 22 launcher and CI-contract files, plus tests/test_kernel_ci.py on the branch.

  • Branch: 1057 passed, 7 failed.
  • main: 1029 passed, 7 failed.

The same 7 fail on both. They read installed openadapt metadata or PATH commands from another worktree's install (test_cli_smoke x3, test_release_artifacts x3), or this env's Click 8.4.2 (test_cli_surface structure). Nothing fails only on this branch.

tests/test_cli_surface.py was also run in a venv with Click 8.5.0 and Python 3.12, the snapshot's own versions. It passes there, help text included. ruff check and format are clean.

@abrichr

abrichr commented Nov 30, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: bc4e250

This is a packaging and CI change only; no kernel source moves. openadapt-kernel leaves the base install and becomes an opt-in extra capped at >=0.1.0,<0.2. import openadapt still does not import the kernel eagerly, and openadapt kernel / the lazy kernel exports fail closed with an install line when it is missing. The install-weight budget now forbids the package on the base launcher install, so a regression that pulls it back in will fail CI.

The kernel suite moves into the required ci path: packages.yml gains a kernel job (ruff, mypy, pytest tests) selected only for packages/kernel/** or a packages.yml change, and packages-gate fails if that selected job fails, is cancelled or is skipped. The old kernel.yml and kernel-ci.yml workflows are deleted, which is a net tightening: a red kernel suite can no longer sit outside ci. newest_green.py looks up kernel releases under the kernel ( job prefix in packages.yml.

Footgun, already documented in the PR: once kernel 0.2.0 is on PyPI, openadapt[kernel] will keep resolving to 0.1.0 because of the <0.2 cap. 0.2.0 is the breaking release that holds the W4 fixes in #2779. The follow-up to move the extra to >=0.2.0,<0.3 and relock should land as soon as 0.2.0 is published.

Tests at this head

  • tests/test_kernel_ci.py and tests/test_kernel_integration.py: 33 passed.
  • ruff check on the touched launcher, CI-contract and test files: clean.

Not run

  • A clean pip install openadapt vs openadapt[kernel] in a fresh venv, or the kernel package's own pytest / mypy (those run in the new CI job when kernel paths change; this PR does not change kernel source, so that job is correctly unselected).
  • I did not rerun the wider launcher suite the PR compared against main (the same 7 failures on both, from this environment's installs and Click version).

CI at this head

46 passed, 0 failed, with at most one check still pending when I posted. I didn't merge or push anything.

@abrichr
abrichr added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 9c3d97b Nov 30, 2026
107 of 112 checks passed
@abrichr
abrichr deleted the claude/kernel-optional-extra-ci branch November 30, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant