feat: guard generic edit batch commit boundaries - #250
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runtime modesoutput so planner/coder/QA runtime selection, fallback rules, required full-runtime paths, and eval artifacts are explicit..auto-Codex/provider-smoke-history.json, recover corrupt history artifacts, and surface the run-history evidence in CLI/UI diagnostics.runtime_eval_historyto the runtime diagnostics control plane so persisted provider smoke evidence is summarized alongside the policy/eval matrix.cli_runner_contract_matrixso every full-runtime CLI candidate is measured against the samerun,cancel,resume, artifacts, event parser, and cost/account contract.runtime_subagent_mutation_policyso mutating child agents are explicitly blocked until transaction boundaries, conflict-aware merge, and parent-approved apply/abort exist.mcp_bridge_permission_matrixso local, external, and custom MCP bridge permissions expose policy metadata, audit artifacts, mutating permissions, strict allowlist status, and missing gates.normalized_resultwith text, typed content, structured payloads, and error state for observations/audit/recovery consumers.tools/listlifecycle failures withfailure_stageandfailure_kindso UI/contract smoke can distinguish invalid responses, startup failures, timeouts, and server errors.tools/callfailures in runtime observations and audit artifacts with the same lifecycle taxonomy.runtime_capability_matrixand Settings control-plane row for provider readiness, blockers, warnings, and CLI candidates.runtime_comparative_eval_matrixand Settings comparative eval rows for Claude/Codex/OpenAI/Gemini/Ollama quality/cost/safety evidence.commit_batchblocks if active staged postimages drift or become unverifiable before the batch closes, while rollback/abort mark restored snapshots as no longer staged.committedon successfulcommit_batch, preservingrolled_backstate for abort/rollback snapshots.batch_committedtimeline events with committed snapshot ids to Generic Edit event and manifest artifacts.event_countdrifts from the persisted event artifact.transaction_batch_probeandtransaction_batchesreliability case for begin/commit batch coverage.commit_batch.corrupt_json/invalid_schemapreflight health reasons.tmp_pathmanifest rewrite with a scopedNOSONARcomment.Remaining Full-Autonomous Provider Plan
generic_edithas JSON/native tool loops, local actions, MCP bridge calls, read-only subagents, fallback, smoke diagnostics, transaction batch contract diagnostics, recovery/batch guards, and provider-specific negative fixture probes.mcp_bridge_permission_matrix, normalized MCP tool results, and classifiedtools/listplus bridgedtools/calllifecycle failures are wired. The runtime enforcesRuntimeMcpToolPolicybefore bridged tool execution and reports strict allowlist status.runtime_subagent_mutation_policynow exposes the missing gates for mutating children.cli_runner_contract_matrixnow tracks run/cancel/resume/artifacts/event_parser/cost_account readiness for every candidate. Planned runners now share a generic CLI core for configurable process execution, cancel, JSONL event parsing, sanitized account summaries, and<runner>_result/timeline/stdout/eventsartifacts.runtime_policy_matrix,runtime_eval_matrix,runtime_eval_history,runtime_comparative_eval_matrix, and UI control-plane rows are wired.Validation
/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "manifest_event_preserves_staged_workspace_fields"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "batch or resume_preflight or mutation_snapshot or partial_failure or rollback or manifest_event_preserves_staged_workspace_fields"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "corrupt_mutation_snapshots or invalid_mutation_snapshot_schema"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "resume_preflight or corrupt_mutation_snapshots or invalid_mutation_snapshot_schema or mutation_snapshot or batch or partial_failure or rollback"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "manifest_batch_lifecycle_mismatch or corrupt_mutation_snapshots or invalid_mutation_snapshot_schema"npm --prefix apps/frontend test -- spec-file-readers.test.ts GenericEditArtifactsPanel.test.tsxnpm --prefix apps/frontend run typecheckcd apps/frontend && npm exec -- biome check src/main/ipc-handlers/task/spec-file-readers.ts src/main/ipc-handlers/task/spec-file-readers.test.ts src/renderer/components/task-detail/GenericEditArtifactsPanel.tsx src/renderer/components/task-detail/__tests__/GenericEditArtifactsPanel.test.tsx src/shared/types/task.ts src/shared/i18n/locales/en/tasks.json src/shared/i18n/locales/fr/tasks.json/Users/om/PycharmProjects/Auto-Coding/.venv/bin/python -m ruff check apps/backend/agents/runtime/adapters/generic_edit.py tests/test_agent_runtime.py/Users/om/PycharmProjects/Auto-Coding/.venv/bin/python -m ruff format apps/backend/agents/runtime/adapters/generic_edit.py tests/test_agent_runtime.py --check --diff/Users/om/PycharmProjects/Auto-Coding/.venv/bin/python -m py_compile apps/backend/agents/runtime/adapters/generic_edit.pynode -e "JSON.parse(require('fs').readFileSync('apps/frontend/src/shared/i18n/locales/en/tasks.json','utf8')); JSON.parse(require('fs').readFileSync('apps/frontend/src/shared/i18n/locales/fr/tasks.json','utf8'))"git diff --check/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_provider_smoke_command.py tests/test_runtime_modes_command.py -q/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "batch or resume_preflight or mutation_snapshot or partial_failure or rollback"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "unrestored_isolated_staged_snapshot or incomplete_mutation_snapshot"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "manifest_batch_lifecycle_mismatch"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "records_committed_batch_protocol or aborts_open_batch_with_snapshot_rollback"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_provider_smoke_command.py tests/test_agent_runtime.py -q -k "committed_batch_snapshots or records_committed_batch_protocol or batch or resume_preflight or mutation_snapshot or partial_failure or rollback"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_provider_smoke_command.py -q -k committed_batch_snapshots/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_provider_smoke_command.py -qnpm --prefix apps/frontend test -- provider-smoke-diagnostics.test.ts ProviderSettingsSection.test.tsx/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "records_committed_batch_protocol or batch or resume_preflight or mutation_snapshot or partial_failure or rollback"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "resume_preflight or trace_input_mismatch or rejects_resume_when_trace_mismatches_checkpoint or resumes_from_recovery_checkpoint or resumes_from_session_state_manifest"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "manifest_event_count_mismatch or resume_preflight or trace_input_mismatch or manifest_batch or batch or mutation_snapshot or partial_failure or rollback"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "batch or resume_preflight or mutation_snapshot or partial_failure or rollback"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_provider_smoke_command.py -qnpm --prefix apps/frontend test -- provider-smoke-diagnostics.test.ts ProviderSettingsSection.test.tsxnpm --prefix apps/frontend run typecheckcd apps/frontend && npm exec -- biome check src/main/ipc-handlers/provider-smoke-diagnostics.ts src/main/ipc-handlers/provider-smoke-diagnostics.test.ts src/renderer/components/settings/ProviderSettingsSection.tsx src/renderer/components/settings/ProviderSettingsSection.test.tsx src/shared/types/settings.ts src/shared/i18n/locales/en/settings.json src/shared/i18n/locales/fr/settings.json/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_provider_smoke_command.py tests/test_agent_runtime.py -q -k "staged_batch_drift or transaction_batches_expose_staged_mutation_metadata or batch or resume_preflight or mutation_snapshot or partial_failure or rollback"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "mcp_bridge or external_mcp or normalize_mcp_tool_result"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_agent_runtime.py -q -k "codex_cli or cli_runtime_process or generic_cli or runtime_factory_can_create_generic_cli_runner"/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_runtime_modes_command.py -qnpm --prefix apps/frontend test -- ProviderSettingsSection.test.tsxnpm --prefix apps/frontend test -- provider-smoke-diagnostics.test.ts ProviderSettingsSection.test.tsx provider-smoke-runtime.test.tsnpm --prefix apps/frontend run typecheck/Users/om/PycharmProjects/Auto-Coding/.venv/bin/pytest tests/test_provider_smoke_command.py -q -k staged_batch_drift/Users/om/PycharmProjects/Auto-Coding/.venv/bin/python -m ruff check apps/backend/cli/provider_smoke_commands.py apps/backend/cli/runtime_commands.py tests/test_provider_smoke_command.py tests/test_runtime_modes_command.py/Users/om/PycharmProjects/Auto-Coding/.venv/bin/python -m ruff check apps/backend/agents/runtime/adapters/generic_edit.py apps/backend/cli/provider_smoke_commands.py tests/test_agent_runtime.py tests/test_provider_smoke_command.py/Users/om/PycharmProjects/Auto-Coding/.venv/bin/python -m ruff check apps/backend/agents/runtime/__init__.py apps/backend/agents/runtime/adapters/__init__.py apps/backend/agents/runtime/adapters/generic_cli.py apps/backend/cli/runtime_commands.py tests/test_agent_runtime.py tests/test_runtime_modes_command.py/Users/om/PycharmProjects/Auto-Coding/.venv/bin/python -m ruff format apps/backend/cli/provider_smoke_commands.py apps/backend/cli/runtime_commands.py tests/test_provider_smoke_command.py tests/test_runtime_modes_command.py --check --diff/Users/om/PycharmProjects/Auto-Coding/.venv/bin/python -m ruff format apps/backend/agents/runtime/adapters/generic_edit.py apps/backend/cli/provider_smoke_commands.py tests/test_agent_runtime.py tests/test_provider_smoke_command.py --check --diff/Users/om/PycharmProjects/Auto-Coding/.venv/bin/python -m ruff format apps/backend/agents/runtime/__init__.py apps/backend/agents/runtime/adapters/__init__.py apps/backend/agents/runtime/adapters/generic_cli.py apps/backend/cli/runtime_commands.py tests/test_agent_runtime.py tests/test_runtime_modes_command.py --check --diff/Users/om/PycharmProjects/Auto-Coding/.venv/bin/python -m py_compile apps/backend/agents/runtime/__init__.py apps/backend/agents/runtime/adapters/__init__.py apps/backend/agents/runtime/adapters/generic_cli.py apps/backend/cli/runtime_commands.py/Users/om/PycharmProjects/Auto-Coding/.venv/bin/python -m py_compile apps/backend/cli/provider_smoke_commands.py apps/backend/cli/runtime_commands.py/Users/om/PycharmProjects/Auto-Coding/.venv/bin/python -m py_compile apps/backend/agents/runtime/adapters/generic_edit.py apps/backend/cli/provider_smoke_commands.pynode -e "JSON.parse(require('fs').readFileSync('apps/frontend/src/shared/i18n/locales/en/settings.json','utf8')); JSON.parse(require('fs').readFileSync('apps/frontend/src/shared/i18n/locales/fr/settings.json','utf8')); console.log('settings locale JSON ok')"cd apps/frontend && npm exec -- biome check src/main/ipc-handlers/provider-smoke-diagnostics.ts src/main/ipc-handlers/provider-smoke-diagnostics.test.ts src/main/ipc-handlers/settings-handlers.ts src/renderer/components/settings/ProviderSettingsSection.tsx src/renderer/components/settings/ProviderSettingsSection.test.tsx src/shared/types/settings.ts src/shared/i18n/locales/en/settings.json src/shared/i18n/locales/fr/settings.jsoncd apps/frontend && npm exec -- biome check src/renderer/components/settings/ProviderSettingsSection.tsx src/renderer/components/settings/ProviderSettingsSection.test.tsx src/shared/i18n/locales/en/settings.json src/shared/i18n/locales/fr/settings.jsongit diff --check