Repository navigation
feat(verify): add local JIT compiler (openadapt_verify.jit) and mcpify --from-compiled - #2633
Conversation
…y --from-compiled
Independent adversarial review: REQUEST CHANGESFrom: Gemini Full read-only audit of all 5 files in Blocking Findings (P1)
Non-Blocking Notes (P2)
|
Independent adversarial review: APPROVEFrom: Gemini Delta review of
No blocking issues remain at |
Independent adversarial review: REQUEST CHANGESFrom: Grok This is a cross-vendor review. Both earlier reviews on this PR are from the author's own vendor. The binder, empty-recording, healer and secret-redaction fixes from the previous round hold. Two problems remain, and I reproduced both at this head. P1: the default
|
Independent adversarial review: REQUEST CHANGESFrom: Grok This is a delta review of P1 (open): the default
|
…ency compat test (#2648) * fix(desktop): match bundled Flow openadapt-types>=0.24.2 floor PR #2637 raised packages/flow/pyproject.toml to openadapt-types>=0.24.2,<0.25.0, causing packages/desktop/tests/test_dependency_compat.py:: test_types_range_matches_the_bundled_flow_runtime to fail on PRs (including #2633). Bump packages/desktop/pyproject.toml to openadapt-types>=0.24.2,<0.25.0 and re-lock packages/desktop/uv.lock (0.24.0 -> 0.24.2, now live on PyPI). * test(desktop): distinguish bundled Flow pin vs in-tree Flow in dependency compat test Qualification contract installs Desktop's pinned bundled Flow (2.4.1, openadapt-types>=0.24.0,<0.25.0) while Python engine tests overlay in-tree Flow (4.0.0, openadapt-types>=0.24.2,<0.25.0). Keep Desktop's pyproject.toml/uv.lock aligned with bundled Flow 2.4.1 and enforce exact specifier equality when installed Flow matches the bundled pin, while verifying shared-types compatibility and matching upper bound when overlaid with newer in-tree Flow.
Summary
Adds the local JIT workflow compiler (
openadapt_verify.jit) and exposes compiled plans as verified MCP tools viamcpify --from-compiled. All changes are scoped topackages/verify/and.github/workflows/packages.yml.What changed
packages/verify/src/openadapt_verify/jit.py:ParameterBinder: templates concrete action values into{{param_name}}(longest-match first, refuses empty values, flags secret-named parameters likepassword/api_key/token, and audits serialized plans so raw secret values never persist on disk).CompiledStep,CompiledPlanStats,CompiledPlan: JSON-serializable plan (openadapt.jit.plan/v1) saved atomically to.openadapt/compiled/<name>.jsonwith fallback selector chains (role/label/css/text), templated read-back expectations, cumulative latency/cost savings, andto_workflow_tool_spec()conversion.jit_wrap: sync and async decorator that records actions on Cold Run (pip install -r requirements (There is no requirements file in the repo) #1) throughRecordingPageProxy, writes the cache only when independent read-back passesVERIFIED, replays deterministically with substituted parameters on Warm Runs (alembic upgrade head #2+) with 0 agent calls, and runs bounded step-level self-healing (max_heal_steps) that updates the cache only after final read-back passesVERIFIED.JitResult&format_scorecard: structured result with optional Ed25519SignedReceiptand terminal scorecard.packages/verify/src/openadapt_verify/mcpify.py:load_compiled_tools(cache_dir)and--from-compiled <dir>onserveandconfigso everyCompiledPlanJSON in.openadapt/compiled/is exposed as a verified MCP tool with its parameterized JSON Schema.packages/verify/src/openadapt_verify/__init__.py: exportedjit,jit_wrap,CompiledPlan,CompiledStep,JitResult,ParameterBinder,format_scorecard, andload_compiled_tools.packages/verify/tests/test_jit.py: 8 tests covering longest-match parameter binding, Cold -> Warm 0-agent replay with different parameters + Ed25519 receipt verification, unconfirmed-write cache refusal, bounded self-heal -> warm Run pip install -r requirements.txt #3, failed self-heal cache preservation, secret redaction, asyncjit_wrap, andmcpify --from-compiled..github/workflows/packages.yml: updated verify-facade collected test count from168to176.Verification
PYTHONPATH=src:../flow:../types pytest tests/test_jit.py -v: 8 passed in 0.61s (176 tests collected acrosspackages/verify/tests)ruff check src tests&ruff format --check src tests: passedmypy src/openadapt_verify: Success: no issues found in 21 source filesgitleaks detect --no-git: no leaks found