Enforce deterministic Python 3.12+ runtime and adoption readiness (#710) - #719
Conversation
Codex audit (merge-authority lane)Head SHA: Codex Audit: BLOCKED Summary: Two P2 findings are present: the readiness check can falsely report Muse authentication for unusable key files, and unknown runtimes can bypass the Python 3.12 minimum requirement. Findings:
|
Claude audit (merge-authority lane)Head SHA: Claude Audit: BLOCKED Summary: Found a real regression in the Claude adapter result-extraction fallback that undermines the campaign system's core anti-fabrication guarantee, plus a lesser observability gap in the new readiness aggregation. Everything else (deterministic Python 3.12+ runtime gating, runtime_class >= 3.12 schema enforcement, new antigravity/muse auth checks) is well-tested and internally consistent. Findings:
|
* Resolve a supported Python 3.12+ runtime before invoking local campaign adapters, probing CODE_MOWER_PYTHON, sys.executable, and versioned candidates on PATH. Pass exact --python-bin and --target-runtime to maintained adapters to prevent providers from picking ambient python3. * Fail closed with bounded python_runtime_unavailable status when no supported Python 3.12+ runtime exists. * Enforce runtime_class >= python_3.12 in adoption result validation. * Model trusted ambient-home opt-ins for Antigravity and Muse in adoption doctor checks, warning and excluding them from campaign-ready when absent. * Verify structured-result capability offline via in-memory fixture and distinguish command, auth, and structured_result in readiness JSON without leaking paths or output.
- Restore fail-closed early return on Claude is_error envelopes before raw JSON fallback - Validate Muse META_API_KEY_FILE through safe adapter resolver in auth doctor checks - Reject unknown and non-python runtime_class in adoption result validation - Emit actionable WARN when offline structured-result probe fails
c164e4b to
f51bdc0
Compare
|
Code Mower notice: previously audited head |
Codex audit (merge-authority lane)Head SHA: Codex Audit: BLOCKED Summary: The runtime override is incorrectly reused as the interpreter launching Code Mower's adapter module, which can cause local campaigns to fail immediately. Findings:
|
Claude audit (merge-authority lane)Head SHA: Claude Audit: BLOCKED Summary: The PR adds deterministic Python 3.12+ runtime resolution for campaign adapters plus a new offline "structured-result capability" doctor probe. Most of the change (runtime resolution, schema tightening, muse/antigravity auth checks) is well tested and self-consistent. One correctness bug was found in the new structured-result capability check: it silently exercises the wrong extraction path for the Claude lane, undermining the check's stated purpose. Findings:
|
- Keep adapter launcher bound to sys.executable and use separate {target_python} placeholder for target runtime
- Route canonical Claude lane claude_audit through _extract_claude_result with envelope/is_error fixture
- Key runtime-unavailable remediation on stable python_runtime_unavailable error code
- Add regressions for distinct launcher/target interpreters and claude_audit generic extraction failure
Claude audit (merge-authority lane)Head SHA: Claude Audit: PASS Summary: PR adds deterministic Python 3.12+ runtime resolution for local campaign adapters, structured-result capability probing, and Antigravity/Muse auth-readiness checks in the doctor adoption flow, plus tightened runtime_class validation in release_qualify. Reviewed the fail-closed runtime resolution (resolve_supported_runtime), the readiness/ready_providers aggregation logic, the Claude/Muse/Antigravity result-extraction refactors, and the new tests, all of which are internally consistent and match the documentation updates. No correctness, security, or data-loss blockers found. Findings:
|
|
Code Mower notice: previously audited head |
|
Code Mower notice: previously audited head |
Codex audit (merge-authority lane)Head SHA: Codex Audit: BLOCKED Summary: The Antigravity and Muse authentication readiness checks compare aliases instead of canonical provider IDs, making them unreachable and allowing unauthenticated providers to appear ready. Findings:
|
|
Audit disposition for Codex finding codex:627f9fca38fd6f40c8be The reported alias mismatch is not present. Head |
|
Code Mower notice: previously audited head |
1 similar comment
|
Code Mower notice: previously audited head |
Code Review 👍 Approved with suggestions 2 resolved / 3 findingsEnforces deterministic Python 3.12+ runtime resolution with fail-closed behavior when unavailable, validates adoption result schemas, models ambient-home provider auth readiness, and adds offline structured-result capability probing. All audit findings have been addressed. Note: 💡 Edge Case: Board hides all healthy campaigns when one id collides📄 src/code_mower/release_campaigns.py:4142-4156
✅ 2 resolved✅ Bug: Offline capability probe uses clock-sensitive hardcoded timestamp
✅ Quality: structured_result probe marks owner_action even for optional/unenabled lanes
🤖 Prompt for agentsOptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
Claude audit (merge-authority lane)Head SHA: Head SHA changed during review ( |
Codex audit (merge-authority lane)Head SHA: Codex Audit: PASS Summary: No discrete, actionable regressions were identified in the changed code. Findings: none. |
Claude audit (merge-authority lane)Head SHA: Claude Audit: PASS Summary: Reviewed the deterministic Python 3.12+ runtime enforcement and adoption-readiness PR. The changes (runtime resolution/binding, structured-result capability probing, Antigravity/Muse auth checks) are extensively tested and internally consistent with the updated docs. No P0/P1/P2 correctness, security, or data-loss blockers were found. Two non-blocking observations are noted for awareness. Findings:
|
Resolves #710 (child of #708, part of epic #709).
Summary of Changes
Merged
origin/main:origin/main(including Release campaign: preserve retry chronology and upload terminal failure evidence #711 campaign retry chronology and terminal failure evidence upload) into current branch without rebasing.Addressed Codex Audit Finding (
codex:10ca06eef8f192c3a8b3):check_campaign_auth_readinessinsrc/code_mower/doctor_checks/campaign_auth.pyevaluatescampaign_auth_probe_requested()before the Antigravity and Muse ambient-home inspection branches.CODE_MOWER_CAMPAIGN_AUTH_PROBE=0, both providers immediately returnstatus="skip"(state="skipped"), bypassing missing-opt-in warnings and preserving readiness.tests/test_doctor_campaign_auth.pyandtests/test_doctor_campaign_readiness.pyverifying that disabled probing skips ambient checks, emits no provider warnings, and keeps providers inready_providers.Addressed Claude Audit Finding (
claude:478292eabccf944c5cbd):_detect_runtime_classwas already imported fromrelease_qualifyat the top ofsrc/code_mower/release_campaigns.pyacross both package execution modes.resolve_supported_runtimeinsrc/code_mower/release_campaigns.pywithout code duplication or relocation.test_build_adapter_argv_default_and_empty_target_runtime_resolves_bounded_runtimeintests/test_release_campaigns.pyverifying that calling_build_adapter_argvwithtarget_runtimeomitted or empty string evaluates the imported deterministic fallback rather than raisingNameError.Deterministic Python 3.12+ Runtime Resolution & Fail-Closed Behavior:
resolve_supported_runtime(*, environ, which_fn, runner)insrc/code_mower/release_campaigns.pyto probeCODE_MOWER_PYTHON, running interpretersys.executable, and versioned candidates (python3.12,python3.13,python3.14,python3) for a Python 3.12+ runtime, resolving relative paths to absolute paths._invoke_local_adapterto resolve the runtime deterministically before invoking maintained adapters and pass exact--python-bin {python} --target-runtime {target_runtime}arguments, ensuring providers never fall back to ambient unvalidatedpython3.src/code_mower/provider_registry.pyupdated to include--python-binand--target-runtime.python_runtime_unavailableas a bounded safe error code mapped tounavailablestate with actionable remediation.Result Schema Enforcement:
runtime_class >= python_3.12invalidate_adoption_result_payloadinsrc/code_mower/release_qualify.py.Offline Structured-Result Capability Probe:
check_structured_result_capability(provider)insrc/code_mower/campaign_adapters.pyusing a bounded in-memory fixture (zero token spend, zero network) to verify provider result extraction and schema validation.doctor.campaign.readinessdetail to distinguishcommand(executable readiness),auth(auth readiness), andstructured_result(structured-result capability) per provider without leaking output or paths.Verification Evidence:
tests/test_doctor_campaign_auth.py: 19 tests OKtests/test_doctor_campaign_readiness.py: 35 tests OKtests/test_release_campaigns.py: 324 tests OKruff check .passed (clean)scripts/privacy_scan.pypassed (clean)python -m compileall src testspassed (clean)git diff --checkclean (0 errors)