Metadata-Version: 2.4
Name: openadapt-kernel
Version: 0.1.0
Summary: Minimal commit-boundary verification, macro-action staging, stepwise live-DOM healing, and shadow-to-autopilot kernel for GUI agents
Project-URL: Homepage, https://github.com/OpenAdaptAI/OpenAdapt/tree/main/packages/kernel
Project-URL: Repository, https://github.com/OpenAdaptAI/OpenAdapt/tree/main/packages/kernel
Project-URL: Documentation, https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/kernel/README.md
Project-URL: Changelog, https://github.com/OpenAdaptAI/OpenAdapt/blob/main/packages/kernel/CHANGELOG.md
Project-URL: Issues, https://github.com/OpenAdaptAI/OpenAdapt/issues
Author-email: OpenAdapt <admin@openadapt.ai>
License-Expression: MIT
License-File: LICENSE
Keywords: browser-automation,commit-boundary,computer-use,gui-agents,mcp,verification
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: cryptography>=42.0.0
Provides-Extra: browser
Requires-Dist: playwright>=1.45.0; extra == 'browser'
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# openadapt-kernel

Minimal, self-contained runtime kernel (`< 3,200` LOC, zero `openadapt-flow` dependencies, zero per-app code) implementing commit-boundary verification, cross-rail read-back, reversible occlusion probing, online ACI calibration, macro staging, stepwise live-DOM healing, and shadow-to-autopilot execution:

1. **Default-Deny Obligation, Capability, and Saga Ledger (`ledger.py`):** Episodes start `UNVERIFIED` and emit `VERIFIED` only when every obligation has an independent post-commit read-back proof and zero dirty form buffers remain. Step-limit timeouts, crashes, and unverified exits deterministically return `ESCALATED`. Carries both cross-screen `<MANDATORY_CONSTRAINTS>` and `<VERIFIED_CAPABILITIES>` (user consent and SSA opaque-ID provenance), with durable Saga checkpointing across multi-system workflows.
2. **Wire and DOM-Effect Commit Interceptor (`interceptor.py`):** Detects commits from actual network mutations (`POST`, `PUT`, `PATCH`, `DELETE`) or non-empty dirty form submissions instead of button-label regexes. Excludes search/filter inputs from dirty buffers and escapes escalation payloads safely.
3. **Full-DOM Macro Staging and Stepwise Live-DOM Healer (`macro.py`):** Extracts all interactive controls across the full scrollable page (`observe_schema`), fills an entire form in one pre-commit batch with SSA provenance enforcement (`stage_form`), and heals drifted UI plans step-by-step against the live mounted DOM (handling modals and dialogs that only exist after earlier clicks).
4. **Cross-Rail Read-Back Oracles (`oracles.py`):** Independent read-only SQLite queries (`mode=ro`), pure-stdlib PDF content-stream extraction (filtering `3 Tr` / `7 Tr` invisible text), and multi-tab / fresh-reload DOM verification.
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.

## CLI Quickstart

```bash
openadapt-kernel shadow-sync --dir ./recordings --pack-id portal-v1 --out pack.json
openadapt-kernel qualify --pack pack.json --evidence ./recordings/run_1/extension_evidence.jsonl
openadapt-kernel keygen --priv priv.pem --pub pub.pem
openadapt-kernel run --pack pack.json --dossier dossier.json --mode draft --cdp-url http://127.0.0.1:9222
openadapt-kernel run --pack pack.json --dossier dossier.json --mode autopilot --url https://portal.example --commit-selector '[data-testid="submit-btn"]' --priv priv.pem --receipt-out receipt.json
openadapt-kernel verify-receipt --receipt receipt.json --pub pub.pem
openadapt-kernel serve-mcp
```
