Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions .github/workflows/kernel-ci.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/kernel.yml

This file was deleted.

58 changes: 53 additions & 5 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
# from the push-to-main run, so no Desktop release ships without the
# installers having built and passed their smoke tests.
#
# openadapt-kernel (packages/kernel), the optional alpha commit-boundary
# runtime, keeps its own uv.lock and runs `uv sync --locked` against it: ruff,
# mypy and its whole suite, headless Chromium tests included, on Python 3.12
# for a PR and in the queue, plus 3.11 on main. It depends on no other
# package here, so only its own files select it.
#
# openadapt-tray (packages/tray) keeps its own uv.lock and runs `uv sync
# --locked` against it: its suite on Linux with Python 3.12 for a PR and in
# the queue, plus 3.11, macOS and Windows on main; ruff, the version and changelog
Expand Down Expand Up @@ -122,6 +128,7 @@ jobs:
agent: ${{ steps.classify.outputs.agent }}
eligibility: ${{ steps.classify.outputs.eligibility }}
verify: ${{ steps.classify.outputs.verify }}
kernel: ${{ steps.classify.outputs.kernel }}
capture: ${{ steps.classify.outputs.capture }}
privacy: ${{ steps.classify.outputs.privacy }}
desktop: ${{ steps.classify.outputs.desktop }}
Expand Down Expand Up @@ -149,7 +156,7 @@ jobs:
if [ "$EVENT_NAME" = pull_request ]; then unit_shards=4; else unit_shards=2; fi
echo "flow_unit_shards=$unit_shards" >> "$GITHUB_OUTPUT"
all() {
for pkg in flow flow_at_rest flow_onprem flow_agent_frameworks types agent eligibility verify capture privacy desktop tray program_graph seal_view weight fast_checks; do echo "$pkg=true" >> "$GITHUB_OUTPUT"; done
for pkg in flow flow_at_rest flow_onprem flow_agent_frameworks types agent eligibility verify kernel capture privacy desktop tray program_graph seal_view weight fast_checks; do echo "$pkg=true" >> "$GITHUB_OUTPUT"; done
exit 0
}
case "$EVENT_NAME" in
Expand Down Expand Up @@ -213,6 +220,7 @@ jobs:
# The optional eligibility connector is tested against the in-tree core.
eligibility="$(hit "^packages/(connectors/eligibility|flow|types)/|$wf")"
verify="$(hit "^packages/(verify|flow|types)/|$wf")"
kernel="$(hit "^packages/kernel/|$wf")"
capture="$(hit "^packages/capture/|$wf")"
privacy="$(hit "^packages/privacy/|$wf")"
# Desktop bundles the program map from packages/program-graph.
Expand Down Expand Up @@ -241,6 +249,7 @@ jobs:
echo "agent=$agent"
echo "eligibility=$eligibility"
echo "verify=$verify"
echo "kernel=$kernel"
echo "capture=$capture"
echo "privacy=$privacy"
echo "desktop=$desktop"
Expand Down Expand Up @@ -760,8 +769,8 @@ jobs:
packages/capture/uv.lock
cache-suffix: flow-default-at-rest
- name: Install from the locks
# Root's lock first (for `--editable .` dependencies such as
# openadapt-kernel), then Flow's, then Capture's: the in-tree Capture
# Root's lock first (for dependencies only `--editable .` declares),
# then Flow's, then Capture's: the in-tree Capture
# can need newer dependencies than the published one Flow's lock names.
run: >-
python ../../scripts/ci/locked_install.py --lock . --lock 'packages/flow[dev,capture,agent]' --lock packages/capture
Expand Down Expand Up @@ -935,8 +944,8 @@ jobs:
packages/capture/uv.lock
cache-suffix: flow-unit
- name: Install from the locks
# Root's lock first (for `--editable .` dependencies such as
# openadapt-kernel), then Flow's, then Capture's: the in-tree Capture
# Root's lock first (for dependencies only `--editable .` declares),
# then Flow's, then Capture's: the in-tree Capture
# can need newer dependencies than the published one Flow's lock names.
run: >-
python ../../scripts/ci/locked_install.py --lock . --lock 'packages/flow[dev,capture,agent]' --lock packages/capture
Expand Down Expand Up @@ -1780,6 +1789,43 @@ jobs:
- name: Test
run: uv run --no-sync pytest tests/ -v

kernel:
name: kernel (py${{ matrix.python-version }})
needs: scope
if: github.event.pull_request.draft != true && (needs.scope.outputs.kernel == 'true')
runs-on: ubuntu-latest
# About two minutes on ubuntu-latest (Nov 2026), most of it the suite.
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
# PR and queue tiers: one Python; main adds the oldest.
python-version: ${{ fromJSON((github.event_name == 'pull_request' || github.event_name == 'merge_group') && '["3.12"]' || '["3.11", "3.12"]') }}
defaults:
run:
working-directory: packages/kernel
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
with:
enable-cache: true
cache-dependency-glob: "packages/kernel/uv.lock"
cache-suffix: kernel-py${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install from the lock, with headless Chromium
run: |
uv sync --locked --python ${{ matrix.python-version }} --extra browser --extra dev
uv run --no-sync python -m playwright install chromium
- name: Ruff
run: uv run --no-sync ruff check src tests
- name: Mypy
run: uv run --no-sync mypy --ignore-missing-imports src
- name: Test (unit, boundary, CLI and headless Chromium)
run: uv run --no-sync pytest tests -q

desktop-test:
name: desktop test
needs: scope
Expand Down Expand Up @@ -2080,6 +2126,7 @@ jobs:
- eligibility
- verify
- verify-clean-install
- kernel
- flow-lint
- flow-unit
- flow-default-at-rest
Expand Down Expand Up @@ -2135,6 +2182,7 @@ jobs:
"eligibility": "eligibility",
"verify": "verify",
"verify-clean-install": "verify",
"kernel": "kernel",
"flow-lint": "flow",
"flow-unit": "flow",
"flow-default-at-rest": "flow_at_rest",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Full methodology, benchmark tables, and verifiable raw runs: **[openadapt.ai/pro
| Package | Role | Source |
|---|---|---|
| [`openadapt`](https://pypi.org/project/openadapt/) | Unified CLI (`quickstart`, `wrap`, `connect`, `record`, `compile`, `run`, `verify`, `kernel`, `agent`, `mcpify`) | [`openadapt/`](https://github.com/OpenAdaptAI/OpenAdapt/tree/main/openadapt) |
| [`openadapt-kernel`](https://github.com/OpenAdaptAI/OpenAdapt/tree/main/packages/kernel) | Commit-boundary kernel: default-deny write ledger, wire/DOM commit interceptor, stepwise live-DOM healer, cross-rail oracles, Ed25519 receipts, stdio MCP | [`packages/kernel/`](https://github.com/OpenAdaptAI/OpenAdapt/tree/main/packages/kernel) |
| [`openadapt-kernel`](https://github.com/OpenAdaptAI/OpenAdapt/tree/main/packages/kernel) | Optional alpha extra (`pip install 'openadapt[kernel]'`). Commit-boundary kernel: default-deny write ledger, wire/DOM commit interceptor, stepwise live-DOM healer, cross-rail oracles, Ed25519 receipts, stdio MCP | [`packages/kernel/`](https://github.com/OpenAdaptAI/OpenAdapt/tree/main/packages/kernel) |
| [`openadapt-flow`](https://pypi.org/project/openadapt-flow/) | Demonstration compiler, certification, qualification, governed replay, auto-repair, and BYOC connector | [`packages/flow/`](https://github.com/OpenAdaptAI/OpenAdapt/tree/main/packages/flow) |
| [`openadapt-agent`](https://pypi.org/project/openadapt-agent/) | MCP server, Agent Skills export, and A2A handoffs | [`packages/agent/`](https://github.com/OpenAdaptAI/OpenAdapt/tree/main/packages/agent) |
| [`openadapt-verify`](https://pypi.org/project/openadapt-verify/) | Standalone Python SDK (`@verified`, `checked_write`, local JIT compiler, `mcpify`) | [`packages/verify/`](https://github.com/OpenAdaptAI/OpenAdapt/tree/main/packages/verify) |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| Commit-boundary kernel, an optional alpha extra: `pip install 'openadapt[kernel]'` adds `openadapt kernel` (or install `openadapt-kernel` alone for its own command), an experimental runtime with shadow, draft and autopilot modes and signed receipts that does not depend on `openadapt-flow`. `pip install openadapt` leaves it out, and the extra is capped below the next minor version because its API may change before 1.0 | On main | Synthetic (its own suite, headless Chromium tests included, runs in the required `ci` check on every kernel change) | [packages/kernel](packages/kernel/README.md) |
10 changes: 6 additions & 4 deletions openadapt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
"""OpenAdapt launcher and compatibility meta-package.

``openadapt-kernel`` (``openadapt kernel ...``) is the canonical minimal
commit-boundary and shadow-to-autopilot runtime. ``openadapt-flow`` ships in
``openadapt-kernel`` (``openadapt kernel ...``) is the minimal commit-boundary
and shadow-to-autopilot runtime, an optional alpha extra
(``pip install 'openadapt[kernel]'``). ``openadapt-flow`` ships in
the base install for backward-compatible workflow compilation, replay, and
receipt verification (``openadapt flow ...``). The lazy exports below preserve
compatibility with optional supporting and research packages:

pip install openadapt # launcher + openadapt-flow
pip install openadapt[capture] # native capture
pip install openadapt[privacy] # privacy scrubbing
pip install openadapt[kernel] # commit-boundary runtime (alpha)
pip install openadapt[ml,evals] # research toolkits
"""

Expand Down Expand Up @@ -116,8 +118,8 @@ def __getattr__(name: str):
return locals()[name]
except ImportError:
raise ImportError(
f"{name} requires openadapt-kernel. "
"Install with: pip install openadapt-kernel"
f"{name} requires openadapt-kernel, an optional alpha extra. "
"Install with: pip install 'openadapt[kernel]'"
)

# Lightweight 2-line Python SDK wrapper (stdlib-only at import time)
Expand Down
9 changes: 6 additions & 3 deletions openadapt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2386,12 +2386,15 @@ def _optional_engine_entrypoint(command_ctx: click.Context, modules: tuple[str,
)
@click.pass_context
def kernel(command_ctx: click.Context) -> None:
"""Run the minimal commit-boundary and shadow-to-autopilot runtime."""
"""Run the minimal commit-boundary and shadow-to-autopilot runtime.

An optional alpha extra: pip install 'openadapt[kernel]'
"""
kernel_main = _optional_engine_entrypoint(command_ctx, ("openadapt_kernel.cli",))
if kernel_main is None:
click.echo(
"Error: openadapt-kernel is not installed. "
"Install with: pip install openadapt-kernel",
"Error: openadapt-kernel is not installed. It is an optional "
"alpha extra. Install with: pip install 'openadapt[kernel]'",
err=True,
)
sys.exit(2)
Expand Down
2 changes: 1 addition & 1 deletion openadapt/cli_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

# These tasks are implemented by launcher-native commands, not the Flow parser.
LAUNCHER_TASKS = {
"kernel": "Run the minimal commit-boundary and shadow-to-autopilot runtime",
"kernel": "Run the commit-boundary runtime (optional alpha extra)",
"mcpify": "Serve compiled workflow packs or JIT plans as a local MCP server",
"wrap": "Run an agent task once, then reuse its checked compiled tool",
"test": "Test an agent on real apps with planted faults, for CI",
Expand Down
19 changes: 19 additions & 0 deletions packages/kernel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@ Minimal, self-contained runtime kernel (`< 3,200` LOC, zero `openadapt-flow` dep
5. **Reversible Pre-Click Probe & Online ACI Calibration (`probe.py`, `aci.py`):** Hit-tests commit controls via `elementsFromPoint` plus an 80ms hover/focus probe to block transparent-overlay click-jacking (`probe_before_click`), and calibrates anomaly thresholds across shifting UI themes via `SessionStartNormalizer` and Gibbs-Candes `OnlineACICalibrator`.
6. **Shadow-to-Autopilot, 4-Mutant Offline Qualification, Micro-Handoff, Live Runner, and MCP Server (`copilot.py`, `extension_bridge.py`, `runner.py`, `mcp_server.py`, `cli.py`):** Induces zero-PII `PortalPack` specs from live Chrome Co-Pilot `extension_evidence.jsonl` recordings, qualifies verifiers offline against four counterfactual mutants (zero staging DB), runs `Draft-to-Commit` or `Verified Autopilot` across main and child popup windows via Playwright or `--cdp-url`, signs `openadapt.kernel.receipt/v1` Ed25519 receipts, and serves tools over stdio JSON-RPC 2.0 MCP.

## Install

openadapt-kernel is an alpha, and `pip install openadapt` does not include it.
Install it as the launcher's optional extra, which runs it as
`openadapt kernel ...`:

```bash
pip install 'openadapt[kernel]'
```

Or install it on its own, which gives you the `openadapt-kernel` command:

```bash
pip install openadapt-kernel
```

Its API can change in any minor release before 1.0, so the launcher's extra is
capped below the next minor version.

## CLI Quickstart

```bash
Expand Down
2 changes: 1 addition & 1 deletion platform-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@
">=0.1.0"
],
"openadapt-kernel": [
">=0.1.0"
">=0.1.0,<0.2"
],
"openadapt-ml": [
">=0.2.0"
Expand Down
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ dependencies = [
# `openadapt-agent` command without a second package. 2.2.4 widens its
# openadapt-flow cap to <5 so it resolves cleanly alongside Flow 4.0.0.
"openadapt-agent>=2.2.4,<3; python_version < '3.13'",
# Minimal commit-boundary and shadow-to-autopilot runtime (`openadapt kernel`).
# Depends only on cryptography, which openadapt-flow already pulls.
"openadapt-kernel>=0.1.0; python_version < '3.13'",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -156,10 +153,11 @@ flow = [
agent = [
"openadapt-agent>=2.2.4,<3; python_version < '3.13'",
]
# `openadapt-kernel` ships in the base install on Python <3.13. Keep the extra
# so `pip install openadapt[kernel]` also resolves directly (including 3.13+).
# The commit-boundary and shadow-to-autopilot runtime behind `openadapt kernel`.
# An alpha, so it is opt-in (`pip install 'openadapt[kernel]'`) and capped
# below its next minor release, which may break its API.
kernel = [
"openadapt-kernel>=0.1.0",
"openadapt-kernel>=0.1.0,<0.2",
]
# Agent-to-agent handoffs over the A2A (Agent2Agent) protocol:
# `openadapt agent serve --a2a`. Handoffs over MCP, HTTP and files need no extra.
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/newest_green.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"packages.yml",
["verify facade (", "verify clean install"],
),
"kernel": (["packages/kernel"], "kernel.yml", ["openadapt-kernel ("]),
"kernel": (["packages/kernel"], "packages.yml", ["kernel ("]),
"program-graph": (["packages/program-graph"], "packages.yml", ["program-graph"]),
"desktop": (
["packages/desktop"],
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_weight/budgets.json
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@
"forbid": [
"openadapt-desktop",
"openadapt-capture",
"openadapt-kernel",
"matplotlib"
],
"allow": [
Expand Down Expand Up @@ -380,7 +381,6 @@
"openadapt",
"openadapt-agent",
"openadapt-flow",
"openadapt-kernel",
"openadapt-types",
"opencv-python",
"opentelemetry-api",
Expand Down
Loading