Batch edit check
batch_edit_check
Strictly read-only preflight for a batch_edit operation set.
Mirrors the shape of :mod:axm_edit.tools.batch_edit: a module-level
:func:render_text plus an :class:~axm.tools.base.AXMTool whose
execute never raises — every failure is shaped into
ToolResult(success=False, error=...).
No code path here opens a file for writing, creates a directory, or calls
batch_apply / create_checkpoint: rule evaluation and ordering are
fully delegated to the shared read-only core
:mod:axm_edit.core.preflight.
BatchEditCheckTool
Bases: AXMTool
Validate a batch_edit operation set without touching the disk.
Orchestration and shaping layer only: the rules, their ordering and
the blocking verdict live in :mod:axm_edit.core.preflight.
Source code in packages/axm-edit/src/axm_edit/tools/batch_edit_check.py
name
property
Tool name used for MCP registration.
execute(*, path='.', operations=None, **kwargs)
Check a batch of file operations without applying any of them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Project root the batch would be applied to. |
'.'
|
operations
|
list[dict[str, object]] | None
|
List of operation dicts with |
None
|
kwargs
|
object
|
Ignored extra arguments (MCP forward-compatibility). |
{}
|
Returns:
| Type | Description |
|---|---|
ToolResult
|
|
ToolResult
|
serialised |
ToolResult
|
|
ToolResult
|
|
ToolResult
|
|
ToolResult
|
failed (missing root, malformed operations). Never raises. |
Source code in packages/axm-edit/src/axm_edit/tools/batch_edit_check.py
render_text(diagnostics)
Render a diagnostic set as the compact text consumed by the CLI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
diagnostics
|
Sequence[CheckDiagnostic]
|
Diagnostics to render, in batch order. |
required |
Returns:
| Type | Description |
|---|---|
str
|
A header — |
str
|
diagnostics is empty — plus one line per diagnostic carrying its |
str
|
|
str
|
|