Automated Capability Documentation
Deterministic, zero-token refactoring capabilities extracted directly from compiler AST implementations and executable test archives (txtar).
View the semedit repository on GitHub
Cross-Language Edit & Refactoring Capability Matrix
| Language | Maturity | Supported Access Modifiers | Supported Edit / Refactoring Capabilities |
|---|---|---|---|
| Go (Golang) | Production | infer, public, private | add_build_dependency, assertion_mode, change_signature, extract_constant, extract_function, extract_interface, extract_type, extract_variable, find_references, implement_contract, inline_function, inline_variable, insert_case, insert_construct, insert_decl, insert_declaration, insert_field, insert_function, insert_type, inspect_construct, inspect_symbol, introduce_parameter_object, introduce_parameter, lookup, migrate_type, move_construct, organize_imports, outline, remove_construct, rename, replace_body, replace_construct, replace_decl, scaffold_file, set_doc_comment, snapshot, stage_abort, stage_commit, stage_drop, stage_start, undo, verify, workspace_outline |
| Rust | Selected-file refactoring preview | lookup, outline, rename, snapshot, undo | |
| Java | Selected-file refactoring preview | add_build_dependency, change_signature, extract_constant, extract_function, extract_interface, extract_variable, find_references, implement_contract, inline_function, inline_variable, insert_case, insert_construct, insert_field, insert_function, insert_type, inspect_construct, inspect_symbol, introduce_parameter_object, introduce_parameter, lookup, maven_compile, maven_test, move_construct, organize_imports, outline, remove_construct, rename, replace_body, replace_construct, replace_decl, scaffold_file, set_doc_comment, snapshot, stage_abort, stage_commit, stage_drop, stage_start, undo, verify, workspace_outline | |
| Scala | Read-only preview | lookup, outline, snapshot, undo | |
| Haskell | Read-only preview | lookup, snapshot, undo | |
| Kotlin | Read-only preview | public, private, protected, internal | lookup, outline, snapshot, undo, verify |
| Bash | Read-only preview | lookup, outline, snapshot, undo, verify | |
| Makefile | Read-only preview | inspect_symbol, lookup, outline, snapshot, undo |
Per-Language Operation Contracts
Contracts distinguish exact request variants, prerequisites, capabilities, and scoped guarantees. Supported means the operation can meet those guarantees when its other prerequisites hold; it does not promise a clean project. Conditional cases require the named analysis, normalization, or reporting condition. Unknown cases make no promise.
Fault bits 0 through 5 represent target-file syntax/type errors, syntax/type errors in another file of the same package, and syntax/type errors in another package. Each 64-bit support mask has one bit per exact fault combination: uint64(1) << faults. Mixed faults use that exact bit; individual support implies no combined support.
Go (Golang)
| Operation | CLI command | MCP tool | Variant | Analysis scope | Preconditions | Capabilities | Guarantees | Error tolerance |
|---|---|---|---|---|---|---|---|---|
| add_build_dependency | semedit add-build-dependency | semantic_add_build_dependency | default | module manifests | a module root must be discoverable in module manifests; the language toolchain must be available in module manifests | Use this tool instead of editing go.mod/go.sum or Maven POM files manually to add a build dependency. Go runs go get and go mod tidy and may access the network; Java updates the selected Maven reactor using dependencyManagement inheritance and refreshes JDT LS. Java requires explicit workspace trust. Use semantic_organize_imports for source imports.; add dependency | atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the Go command succeeds with the available dependency graph (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| assertion_mode | semedit assertion-mode | semantic_assertion_mode | selected_file,dry_run | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of text replacing t.Fatal/t.Error calls when converting supported Go test assertions between fail-fast and continue-on-failure modes. Set trust_workspace=true before a write; set dry_run=true to preview without trust or file writes.; assertions | read-only | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| assertion_mode | semedit assertion-mode | semantic_assertion_mode | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file; the workspace must be trusted in the selected file | Use this tool instead of text replacing t.Fatal/t.Error calls when converting supported Go test assertions between fail-fast and continue-on-failure modes. Set trust_workspace=true before a write; set dry_run=true to preview without trust or file writes.; formatting, assertions | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| change_signature | semedit change-signature | semantic_change_signature | selected_file | the active module | a module root must be discoverable in the active module; the module snapshot must be available in the active module; module type information must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the active module; the source must fit configured bounds in the active module; overlay type information must be available in the active module | Use this tool instead of manually changing a Java method signature and its resolved callers through JDT LS, or a supported private Go free-function signature and its proven direct callers. Supply the complete ordered parameter mapping. New Java parameters require a default argument expression used at every existing call site; Go keeps its stricter append-only proof. Standalone results expose a finalized function_target; receipt continuations remain available for inspection. Buffered results report applied_working without claiming disk publication. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; typed refactoring, formatting | package overlay, module proof, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=rejected; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=63, conditional=0, unknown=0; masks: supported=0x0000000000000001, rejected=0xfffffffffffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| extract_constant | semedit extract-constant | semantic_extract_constant | selected_file | the selected package | the target must parse in the selected package; package type information must be available in the selected package; the selector must identify exactly one target in the selected package; the source must fit configured bounds in the selected package; overlay type information must be available in the selected package; test variants must be available in the selected package | Use this tool instead of manually moving expressions into fields to extract one exact compile-time constant expression. Go preserves resolved constant type and value facts; Java delegates to JDT LS refactor.extract.constant and renames the generated field. Supply symbol, in_function, and exact-source discriminator; use construct_path with its matching expected_revision when the expression is ambiguous. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; typed refactoring, formatting | package overlay, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=unknown, other_package_type=unknown; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=60, conditional=0, unknown=3; masks: supported=0x0000000000000001, rejected=0xfffefffefffefffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| extract_function | semedit extract-function | semantic_extract_function | selected_file | the selected package | the target must parse in the selected package; package type information must be available in the selected package; the selector must identify exactly one target in the selected package; the source must fit configured bounds in the selected package; overlay type information must be available in the selected package | Use this tool instead of copying statements to extract a safe contiguous top-level call region from a Go function or method into a local helper. Parameters are inferred from named owner parameters and the receiver. One leading := declaration may return multiple distinct named live-out values when every result expression is a basic literal, a boolean literal, a named owner parameter, or a supported unary or parenthesized form of those expressions. Effectful, call, compound, and unsupported result-type expressions are refused before writing. Pass the returned live file and helper symbol to semantic_rename or semantic_replace_body. Address-taken values, closure-captured inputs, direct recover calls, selector calls on forwarded values, other local data flow, branching, loops, comments, composite literals, generic owners, and variadic parameters are refused. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; typed refactoring, formatting | package overlay, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=unknown, other_package_type=unknown; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=60, conditional=0, unknown=3; masks: supported=0x0000000000000001, rejected=0xfffefffefffefffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| extract_interface | semedit extract-interface | semantic_extract_interface | selected_file | the active module | a module root must be discoverable in the active module; the module snapshot must be available in the active module; module type information must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the active module; the source must fit configured bounds in the active module; overlay type information must be available in the active module | Use this tool instead of reconstructing method signatures to create an interface from exact selected direct methods. Go type-checks the generated declaration and supports current-overlay proof. Java selects public instance methods, appends a package-private interface to the concrete type file, adds implements, then formats and verifies through JDT LS. Copy result.contract and result.contract_file to semantic_implement_contract.contract and contract_file. Go mutable local replacement modules are unsupported; versioned replacements remain supported.; typed refactoring, formatting | package overlay, module proof, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=rejected; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=63, conditional=0, unknown=0; masks: supported=0x0000000000000001, rejected=0xfffffffffffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| extract_type | semedit extract-type | semantic_extract_type | selected_file | the active module | the module snapshot must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the selected package; the source must fit configured bounds in the selected package; package type information must be available in the selected package; overlay type information must be available in the selected package | Use this tool instead of manually editing the owner struct and its selectors to move selected direct private fields from one private same-package Go struct into a new composed private struct. Select exact fields with typed {file, symbol} members; choose fresh symbol and field names. The source and extracted type stay in the same file. It rewrites only typed direct field selectors in that file. Generated files, keyed or address-taken uses, cross-file or external consumers, selected tags or comments, owner trailing comments, reflection or unsafe imports, embedded or grouped fields, generic or exported owners, and build variants are refused. Methods stay on the original type, so this operation does not change interface implementations or method sets. The complete overlay is typechecked before one buffered edit; static inputs are required in batches.; typed refactoring, formatting | package overlay, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=unknown; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=62, conditional=0, unknown=1; masks: supported=0x0000000000000001, rejected=0xfffffffefffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| extract_variable | semedit extract-variable | semantic_extract_variable | selected_file | the selected package | the target must parse in the selected package; package type information must be available in the selected package; the selector must identify exactly one target in the selected package; the source must fit configured bounds in the selected package; overlay type information must be available in the selected package | Use this tool instead of manually rewriting a call to extract one exact expression into a local variable. Go supports one side-effect-free typed first argument of a direct call under strict data-flow checks; Java delegates extraction to a matching JDT LS refactor action, then renames the generated local to the requested symbol. Use construct_path and its matching selected-file expected_revision when the expression is ambiguous. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; typed refactoring, formatting | package overlay, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=unknown, other_package_type=unknown; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=60, conditional=0, unknown=3; masks: supported=0x0000000000000001, rejected=0xfffefffefffefffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| find_references | semedit find-references | semantic_find_references | selected_file | the active module | a module root must be discoverable in the active module; the module snapshot must be available in the active module; module type information must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the active module | Use this tool instead of text search when finding typed references to a Go or Java declaration. The optional file selects the target; results span the active Go module or trusted Java workspace.; references | read-only, module proof | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=rejected; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=63, conditional=0, unknown=0; masks: supported=0x0000000000000001, rejected=0xfffffffffffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| implement_contract | semedit implement-contract | semantic_implement_contract | selected_file | the active module | a module root must be discoverable in the active module; the module snapshot must be available in the active module; module type information must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the active module; the source must fit configured bounds in the active module; overlay type information must be available in the active module | Use this tool instead of rebuilding interface method signatures to generate missing Go methods on an existing concrete type. contract_file identifies an ordinary interface, receiver_kind selects pointer or value semantics, and body_policy must explicitly select panic_stub. Generated methods panic when called; they are placeholders, not completed implementations. destination_file must already exist in the concrete type package. Copy type_target to inspect the concrete type and each generated_methods file/symbol pair to replace_body or rename. Existing incompatible methods, unsupported promoted methods, failed required-package overlay type checks, and mutable local replacement modules are refused before one apply; versioned replacements remain supported.; typed refactoring, formatting | package overlay, module proof, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=rejected; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=63, conditional=0, unknown=0; masks: supported=0x0000000000000001, rejected=0xfffffffffffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| inline_function | semedit inline-function | semantic_inline_function | selected_file | the active module | a module root must be discoverable in the active module; the module snapshot must be available in the active module; module type information must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the active module; the source must fit configured bounds in the active module; overlay type information must be available in the active module | Use this tool instead of text editing to inline one selected call site. Go supports one direct zero-argument call to a same-package free function whose body is a single literal return. Java resolves the selected method call in call_site and delegates one refactor.inline action to JDT LS. The callee declaration remains in place.; typed refactoring, formatting | package overlay, module proof, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=rejected; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=63, conditional=0, unknown=0; masks: supported=0x0000000000000001, rejected=0xfffffffffffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| inline_variable | semedit inline-variable | semantic_inline_variable | selected_file | the selected package | the target must parse in the selected package; package type information must be available in the selected package; the selector must identify exactly one target in the selected package; the source must fit configured bounds in the selected package; overlay type information must be available in the selected package | Use this tool instead of text replacement to inline one local variable. Go supports a bounded literal substitution with strict data-flow checks; Java delegates to JDT LS refactor.inline for the selected local declaration. The successful edit removes the binding and returns its surviving owner function as a live target; use semantic_lookup to select fresh constructs or bindings. The removed name is historical evidence and is not a follow-up target. Expressions, reassignment, shadowing, and unsupported server actions are refused.; typed refactoring, formatting | package overlay, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=unknown, other_package_type=unknown; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=60, conditional=0, unknown=3; masks: supported=0x0000000000000001, rejected=0xfffefffefffefffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_case | semedit insert-case | semantic_insert_case | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of text editing when adding one case clause to an existing Go switch. Use semantic_insert_construct for the generic insertion interface. Supply the existing in_function selector and, for tagged switches, the exact discriminator expression (for example request.Method); kind=case alone does not identify the target switch. If multiple switches match, copy construct_path from the ambiguity diagnostic. The case value is a complete clause including its colon and statements.; AST edits, formatting | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_construct | semedit insert-construct | semantic_insert_construct | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of text replacement to add one backend-supported declaration, field, keyed composite element, switch case, or anchored statement. For kind=element, select a typed map/dictionary literal and append one keyed key: value pair, or select a struct/object initializer and append one property; slices/arrays and positional elements are unsupported. Select the exact literal with discriminator and its owning top-level declaration or function/method with in_declaration. Element insertion preserves the exact planned bytes and ignores auto_organize_imports. Field insertion requires an existing locally declared, private, non-generic Go struct. Use semantic_replace_construct for existing targets; insertions fail closed on collisions. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; AST edits, formatting | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_construct | semedit insert-construct | semantic_insert_construct | selected_file,field | the active module | the module snapshot must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the selected package; the source must fit configured bounds in the selected package; package type information must be available in the selected package; overlay type information must be available in the selected package; the supplied snippet must parse in the selected file | Use this tool instead of text replacement to add one backend-supported declaration, field, keyed composite element, switch case, or anchored statement. For kind=element, select a typed map/dictionary literal and append one keyed key: value pair, or select a struct/object initializer and append one property; slices/arrays and positional elements are unsupported. Select the exact literal with discriminator and its owning top-level declaration or function/method with in_declaration. Element insertion preserves the exact planned bytes and ignores auto_organize_imports. Field insertion requires an existing locally declared, private, non-generic Go struct. Use semantic_replace_construct for existing targets; insertions fail closed on collisions. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; AST edits, typed refactoring, formatting | package overlay, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=unknown; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=62, conditional=0, unknown=1; masks: supported=0x0000000000000001, rejected=0xfffffffefffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_construct | semedit insert-construct | semantic_insert_construct | selected_file,element | the active module | the module snapshot must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the selected package; the source must fit configured bounds in the selected package; package type information must be available in the selected package; overlay type information must be available in the selected package; the supplied snippet must parse in the selected file | Use this tool instead of text replacement to add one backend-supported declaration, field, keyed composite element, switch case, or anchored statement. For kind=element, select a typed map/dictionary literal and append one keyed key: value pair, or select a struct/object initializer and append one property; slices/arrays and positional elements are unsupported. Select the exact literal with discriminator and its owning top-level declaration or function/method with in_declaration. Element insertion preserves the exact planned bytes and ignores auto_organize_imports. Field insertion requires an existing locally declared, private, non-generic Go struct. Use semantic_replace_construct for existing targets; insertions fail closed on collisions. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; AST edits, typed refactoring | package overlay, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=unknown; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=62, conditional=0, unknown=1; masks: supported=0x0000000000000001, rejected=0xfffffffefffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_decl | semedit insert-decl | semantic_insert_decl | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of replace_file_content to add one Go constant or variable declaration. Use semantic_insert_construct with kind=const or var for the generic interface. Existing package symbols fail closed. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; AST edits, formatting | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_declaration | semedit insert | semantic_insert_declaration | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of text replacement when role-based placement and generic placement controls for one top-level Go declaration fit the intent. Prefer semantic_insert_function, semantic_insert_type, semantic_insert_decl, or semantic_insert_construct for their matching kinds. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; AST edits, formatting | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_field | semedit insert-field | semantic_insert_field | selected_file | the active module | the module snapshot must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the selected package; the source must fit configured bounds in the selected package; package type information must be available in the selected package; overlay type information must be available in the selected package | Use this tool instead of editing a type declaration to add one named field to an existing private, non-generic Go struct or a Java class, enum, or record. Java type_end insertion respects member category and visibility ordering, then formats and verifies through JDT LS.; typed refactoring, formatting | package overlay, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=unknown; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=62, conditional=0, unknown=1; masks: supported=0x0000000000000001, rejected=0xfffffffefffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_function | semedit insert-func | semantic_insert_function | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of text replacement to add one complete Go function or method, or one Java method or constructor. The complete parameters, results, and body are supplied as a declaration. Java inserts into one selected owner type and delegates formatting and verification to JDT LS. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; AST edits, formatting | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_type | semedit insert-type | semantic_insert_type | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of replace_file_content or text insertion to add one Go struct, interface, or type alias, or one Java nested type to a uniquely selected owner type. Java member ordering follows type visibility and JDT LS formats and verifies the result. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; AST edits, formatting | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| inspect_construct | semedit inspect-construct | semantic_inspect_construct | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of guessing nested construct selectors when current choices are unavailable after selection drift or a selector has multiple matches. Lists current candidates with canonical selector context, reusable construct_path values, and an opaque expected_selection_revision for the ordered current candidate list.; inspect | read-only | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| inspect_symbol | semedit inspect-symbol | semantic_inspect_symbol | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of reading source with shell commands when you need a declaration’s exact source, metadata, and snapshot revision.; inspect | read-only | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| inspect_symbol | semedit inspect-symbol | semantic_inspect_symbol | selected_scope | the selected scope | the selected scope must parse in the selected scope; the selector must identify exactly one target in the selected scope | Use this tool instead of reading source with shell commands when you need a declaration’s exact source, metadata, and snapshot revision.; inspect | read-only | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=unknown, same_package_type=supported, other_package_syntax=unknown, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=8, rejected=32, conditional=0, unknown=24; masks: supported=0x0000050500000505, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| introduce_parameter | semedit introduce-parameter | semantic_introduce_parameter | selected_file | the active module | a module root must be discoverable in the active module; the module snapshot must be available in the active module; module type information must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the active module; the source must fit configured bounds in the active module; overlay type information must be available in the active module | Use this tool instead of manually replacing one exact expression with a new parameter and updating its callers. Java delegates signature and call-site changes to JDT LS; Go requires a private free function and proves the closed constant argument and complete call set. Methods, exported or generic Go functions, function values, and ambiguous Java expressions are refused. Standalone results expose a finalized function_target; receipt continuations remain available for inspection. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; typed refactoring, formatting | package overlay, module proof, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=rejected; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=63, conditional=0, unknown=0; masks: supported=0x0000000000000001, rejected=0xfffffffffffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| introduce_parameter_object | semedit introduce-parameter-object | semantic_introduce_parameter_object | selected_file | the active module | a module root must be discoverable in the active module; the module snapshot must be available in the active module; module type information must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the active module; the source must fit configured bounds in the active module; overlay type information must be available in the active module | Use this tool instead of manually replacing a complete parameter list with one value object, rewriting bound body references, and updating every proven direct caller. Go requires a private free function; Java requires one same-package method with direct invocation references. Partial mappings, unresolved call sites, cross-package Java callers, and unsupported Java parameter shapes are refused. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; typed refactoring, formatting | package overlay, module proof, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=rejected; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=63, conditional=0, unknown=0; masks: supported=0x0000000000000001, rejected=0xfffffffffffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| lookup | semedit lookup | semantic_lookup | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of grep or text search when locating a named symbol in Go or a selected trusted source file. Omit file for Go workspace lookup. Rust, Java, Scala, Kotlin, Bash, Makefile, and Haskell lookup are read-only and require explicit workspace trust; external tools must already be installed. Returns symbol, file, kind, line, and column. Pass symbol and file to follow-up semedit calls. Use line and column only for file-navigation reads; they are not accepted as semedit tool parameters.; lookup | read-only | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| lookup | semedit lookup | semantic_lookup | selected_scope | the selected scope | the selected scope must parse in the selected scope; the selector must identify exactly one target in the selected scope | Use this tool instead of grep or text search when locating a named symbol in Go or a selected trusted source file. Omit file for Go workspace lookup. Rust, Java, Scala, Kotlin, Bash, Makefile, and Haskell lookup are read-only and require explicit workspace trust; external tools must already be installed. Returns symbol, file, kind, line, and column. Pass symbol and file to follow-up semedit calls. Use line and column only for file-navigation reads; they are not accepted as semedit tool parameters.; lookup | read-only | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=unknown, same_package_type=supported, other_package_syntax=unknown, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=8, rejected=32, conditional=0, unknown=24; masks: supported=0x0000050500000505, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| migrate_type | semedit migrate-type | semantic_migrate_type | selected_file | the active module | a module root must be discoverable in the active module; the module snapshot must be available in the active module; module type information must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the active module; the source must fit configured bounds in the active module; overlay type information must be available in the active module | Use this tool instead of text editing to migrate one unexported Go struct field between type names with identical type identity after alias resolution. Only one private field and one unqualified same-package or predeclared destination type are supported. Distinct named types, exported fields, conversions, imported selectors, and local variables are refused before the file changes.; typed refactoring, formatting | package overlay, module proof, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=rejected; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=63, conditional=0, unknown=0; masks: supported=0x0000000000000001, rejected=0xfffffffffffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| move_construct | semedit move-construct | semantic_move_construct | selected_file,same_package | the selected scope | the target must parse in the selected file; the selector must identify exactly one target in the selected file; the selected scope must parse in the selected scope | Use this tool instead of text replacement to relocate one supported declaration to an explicit destination. Java delegates static-member moves and reference updates to JDT LS; Go supports explicit declaration placements.; AST edits, formatting | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=unknown, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=16, rejected=32, conditional=0, unknown=16; masks: supported=0x0505050505050505, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| move_construct | semedit move-construct | semantic_move_construct | selected_file,cross_package | the active module | the module snapshot must be available in the active module; module type information must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the active module; the source must fit configured bounds in the active module; overlay type information must be available in the active module | Use this tool instead of text replacement to relocate one supported declaration to an explicit destination. Java delegates static-member moves and reference updates to JDT LS; Go supports explicit declaration placements.; typed refactoring, formatting | package overlay, module proof, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=rejected; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=63, conditional=0, unknown=0; masks: supported=0x0000000000000001, rejected=0xfffffffffffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| organize_imports | semedit imports | semantic_organize_imports | selected_file | the selected file | the target must parse in the selected file; imports must resolve in the selected file | Use this tool instead of text editing import blocks or shelling out to goimports when adding, removing, or formatting Go imports. For Java, select one trusted .java file; explicit additions and removals use fully qualified type names before JDT LS formats and organizes imports. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; formatting, organize imports, repair imports | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| organize_imports | semedit imports | semantic_organize_imports | selected_scope | the selected scope | the selected scope must parse in the selected scope; imports must resolve in the selected scope | Use this tool instead of text editing import blocks or shelling out to goimports when adding, removing, or formatting Go imports. For Java, select one trusted .java file; explicit additions and removals use fully qualified type names before JDT LS formats and organizes imports. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; formatting, organize imports, repair imports | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=unknown, same_package_type=supported, other_package_syntax=unknown, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=8, rejected=32, conditional=0, unknown=24; masks: supported=0x0000050500000505, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| outline | semedit outline | semantic_outline | selected_file | the selected file | the target must parse in the selected file | Use this tool instead of scanning source files with shell commands when you need a declaration outline for a selected source scope; use semantic_workspace_outline first to discover which packages to inspect. Directory scopes are Go-only.; outline | read-only | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| outline | semedit outline | semantic_outline | selected_scope | the selected scope | the selected scope must parse in the selected scope | Use this tool instead of scanning source files with shell commands when you need a declaration outline for a selected source scope; use semantic_workspace_outline first to discover which packages to inspect. Directory scopes are Go-only.; outline | read-only | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=unknown, same_package_type=supported, other_package_syntax=unknown, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=8, rejected=32, conditional=0, unknown=24; masks: supported=0x0000050500000505, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| remove_construct | semedit remove-construct | semantic_remove_construct | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of replace_file_content to remove one supported Go declaration or construct, or one Java method, constructor, field declaration, nested type, or method-local control-flow construct. Java safe_delete checks private declaration visibility and requires complete JDT LS workspace reference coverage with no usages. Syntax is validated and diagnostics are reported; structural removal does not prove behavioral equivalence.; AST edits, formatting | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| remove_construct | semedit remove-construct | semantic_remove_construct | selected_file,safe_delete | the active module | the module snapshot must be available in the active module; module type information must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the active module | Use this tool instead of replace_file_content to remove one supported Go declaration or construct, or one Java method, constructor, field declaration, nested type, or method-local control-flow construct. Java safe_delete checks private declaration visibility and requires complete JDT LS workspace reference coverage with no usages. Syntax is validated and diagnostics are reported; structural removal does not prove behavioral equivalence.; AST edits, formatting | AST edit, module proof, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=rejected; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=63, conditional=0, unknown=0; masks: supported=0x0000000000000001, rejected=0xfffffffffffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| rename | semedit rename | semantic_rename | selected_file | the language server’s scope | the target must parse in the selected file; gopls must be available; the language server must support rename in the language server’s scope; baseline diagnostics must be available in the active module | Use this tool instead of text search-and-replace when renaming a symbol and its references through the selected language backend. Go supports workspace rename; trusted Rust and Java support selected-file language-server rename. Other languages may be lookup-only. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; rename | validated server edit without resource operations, diagnostic delta, atomic writes | healthy=supported, target_syntax=rejected, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=32, conditional=31, unknown=0; masks: supported=0x0000000000000001, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x5555555555555554; mixed-fault cases use the exact matrix with no subset or superset closure) |
| rename | semedit rename | semantic_rename | selected_file,batch | the language server’s scope | the target must parse in the selected file; gopls must be available; the language server must support rename in the language server’s scope | Use this tool instead of text search-and-replace when renaming a symbol and its references through the selected language backend. Go supports workspace rename; trusted Rust and Java support selected-file language-server rename. Other languages may be lookup-only. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; rename | validated server edit without resource operations, atomic writes | healthy=supported, target_syntax=rejected, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=32, conditional=31, unknown=0; masks: supported=0x0000000000000001, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x5555555555555554; mixed-fault cases use the exact matrix with no subset or superset closure) |
| rename | semedit rename | semantic_rename | selected_scope | the language server’s scope | the selected scope must parse in a workspace scan; gopls must be available; the language server must support rename in the language server’s scope; baseline diagnostics must be available in the active module | Use this tool instead of text search-and-replace when renaming a symbol and its references through the selected language backend. Go supports workspace rename; trusted Rust and Java support selected-file language-server rename. Other languages may be lookup-only. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; rename | validated server edit without resource operations, diagnostic delta, atomic writes | healthy=supported, target_syntax=rejected, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=32, conditional=31, unknown=0; masks: supported=0x0000000000000001, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x5555555555555554; mixed-fault cases use the exact matrix with no subset or superset closure) |
| rename | semedit rename | semantic_rename | selected_scope,batch | the language server’s scope | the selected scope must parse in a workspace scan; gopls must be available; the language server must support rename in the language server’s scope | Use this tool instead of text search-and-replace when renaming a symbol and its references through the selected language backend. Go supports workspace rename; trusted Rust and Java support selected-file language-server rename. Other languages may be lookup-only. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; rename | validated server edit without resource operations, atomic writes | healthy=supported, target_syntax=rejected, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=32, conditional=31, unknown=0; masks: supported=0x0000000000000001, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x5555555555555554; mixed-fault cases use the exact matrix with no subset or superset closure) |
| replace_body | semedit replace-body | semantic_replace_body | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of text editing or replacing the entire declaration when changing the body of an existing Go function or method by name, or a Java method selected through JDT LS. The new body is provided as bare statements (no surrounding braces). Use semantic_replace_construct for replacing one construct or selecting a statement/expression slot. Validates and formats in memory before writing; leaves the file untouched on any syntax error. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; AST edits, formatting | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| replace_construct | semedit replace-construct | semantic_replace_construct | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of replacing a whole function body to update one selected construct by kind. Go supports its documented control-flow and declaration kinds. Java supports method-local loop, if/else, switch/case, try/catch, try-with-resources, synchronized, array-element, and statement/expression candidates selected through semantic_inspect_construct; Java replacements are parsed, staged, formatted, import-organized, and verified through JDT LS. Use symbol for named declarations or in_function plus discriminator for nested targets. semantic_replace_body preserves a function signature when only its body changes.; AST edits, formatting | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| replace_decl | semedit replace-decl | semantic_replace_decl | selected_file | the selected file | the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of replace_file_content to replace one Go package-level constant, variable, or type alias, or one uniquely selected Java method, field, or nested type declaration. Java replacements preserve declaration kind and name and run JDT LS formatting and diagnostics.; AST edits, formatting | AST edit, atomic writes | healthy=supported, target_syntax=rejected, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=32, rejected=32, conditional=0, unknown=0; masks: supported=0x5555555555555555, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| scaffold_file | semedit scaffold-file | semantic_scaffold_file | selected_file,infer_package | sibling package clauses | the destination must be writable in sibling package clauses; a valid non-test sibling package clause must be available; the first eligible sibling is selected in sibling package clauses | Use this tool instead of creating source files manually to add a Go or Java file with its package declaration. Java package inference uses sibling .java files or the path beneath src/main/java or src/test/java. Fails if the file already exists unless overwrite is true. Does not seed declarations; use insert tools afterward.; scaffold | atomic writes | healthy=supported, target_syntax=unknown, target_type=unknown, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=16, rejected=0, conditional=0, unknown=48; masks: supported=0x1111111111111111, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| scaffold_file | semedit scaffold-file | semantic_scaffold_file | selected_file,explicit_package | the selected file | the destination must be writable in the selected file | Use this tool instead of creating source files manually to add a Go or Java file with its package declaration. Java package inference uses sibling .java files or the path beneath src/main/java or src/test/java. Fails if the file already exists unless overwrite is true. Does not seed declarations; use insert tools afterward.; scaffold | atomic writes | healthy=supported, target_syntax=unknown, target_type=unknown, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=16, rejected=0, conditional=0, unknown=48; masks: supported=0x1111111111111111, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| set_doc_comment | semedit set-doc-comment | semantic_set_doc_comment | selected_file | the active module | the module snapshot must be available in the active module; test variants must be available in the active module; the selector must identify exactly one target in the selected package; the source must fit configured bounds in the selected package; package type information must be available in the selected package; overlay type information must be available in the selected package | Use this tool instead of editing source text to set or remove one owned Go top-level or Java declaration documentation comment. Scope is declaration only. Missing and null comment values are invalid; an explicit empty string removes the comment. Existing Go directives, grouped declarations, detached ownership, and ambiguous targets are refused. Standalone results include a live declaration continuation; batch receipts report applied_working without live continuations.; typed refactoring, formatting | package overlay, atomic writes | healthy=supported, target_syntax=rejected, target_type=rejected, same_package_syntax=rejected, same_package_type=rejected, other_package_syntax=rejected, other_package_type=unknown; mixed faults follow the declared fault matrix (exact cases: supported=1, rejected=62, conditional=0, unknown=1; masks: supported=0x0000000000000001, rejected=0xfffffffefffffffe, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| snapshot | semedit snapshot | semantic_snapshot | default | workspace paths | the source must remain stable in workspace paths; the destination must be writable in workspace paths; a label must be supplied in workspace paths | Use this tool instead of git stash or manual backup copies when a later semantic_undo may be needed for a bounded edit; capture a pre-edit transactional snapshot, creating an immutable journal under .scratch/snapshots/ | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| stage_abort | semedit stage-abort | semantic_stage_abort | default | the active module | a module root must be discoverable in the active module; the module snapshot must be available in the active module; an active retained staging session must exist in the language server’s scope | Use this tool instead of undo when discarding an uncommitted retained Go or Java staging session. This removes its in-memory overlay and writes no workspace files.; volatile staging | volatile state only | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| stage_commit | semedit commit | semantic_commit | default | the active module | a module root must be discoverable in the active module; the module snapshot must be available in the active module; an active retained staging session must exist in the language server’s scope | Use this tool instead of semantic_batch when publishing an existing retained Go or Java staging session. It normalizes the staged edits and reports zero, partial, or full publication and the final verification outcome.; formatting, organize imports, diagnostics, project hooks, publication | diagnostics, conflict checked, atomic writes, explicit publication outcome | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when current diagnostic coverage arrives successfully (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| stage_drop | semedit stage-drop | semantic_stage_drop | default | the active module | a module root must be discoverable in the active module; the module snapshot must be available in the active module; an active retained staging session must exist in the language server’s scope | Use this tool instead of restarting the entire staging session when removing one accepted step. The surviving steps are replayed into a new in-memory overlay and no workspace files are written.; volatile staging | volatile state only | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| stage_start | semedit stage | semantic_stage | default | the active module | a module root must be discoverable in the active module; the module snapshot must be available in the active module | Use this tool instead of applying Go or Java edits immediately when a retained sequence needs review before publication. Accepted edits remain in an in-memory overlay until semantic_commit; no workspace files are written by this control.; volatile staging | volatile state only | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| undo | semedit undo | semantic_undo | default | workspace paths | the snapshot state must be available in workspace paths; the destination must be writable in workspace paths | Use this tool instead of git reset or manual file restoration when undoing edits recorded by semantic_snapshot; it restores workspace files with conflict-checked atomic writes. Fails and performs zero writes if any touched file was modified after the snapshot’s recorded post-edit state.; restore | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| verify | semedit verify | semantic_verify | selected_file,normalize | the selected file | gopls must be available in the selected file; the language toolchain must be available in the selected file; project hooks must be trusted in the selected file | Use this tool instead of ad hoc diagnostic commands to verify source files with detected or explicitly selected language servers. Go verification formats files before diagnostics; check-only skips all normalization.; formatting, organize imports, diagnostics, project hooks | diagnostics | healthy=supported, target_syntax=rejected, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=32, conditional=31, unknown=0; masks: supported=0x0000000000000001, rejected=0xaaaaaaaaaaaaaaaa, conditional=0x5555555555555554; mixed-fault cases use the exact matrix with no subset or superset closure) |
| verify | semedit verify | semantic_verify | selected_scope,normalize | the selected scope | gopls must be available in the selected scope; the language toolchain must be available in the selected scope; project hooks must be trusted in the selected scope | Use this tool instead of ad hoc diagnostic commands to verify source files with detected or explicitly selected language servers. Go verification formats files before diagnostics; check-only skips all normalization.; formatting, organize imports, diagnostics, project hooks | diagnostics | healthy=supported, target_syntax=rejected, target_type=conditional, same_package_syntax=rejected, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=48, conditional=15, unknown=0; masks: supported=0x0000000000000001, rejected=0xfafafafafafafafa, conditional=0x0505050505050504; mixed-fault cases use the exact matrix with no subset or superset closure) |
| verify | semedit verify | semantic_verify | selected_file,check_only | the selected file | gopls must be available in the selected file; the language toolchain must be available in the selected file; the operation must be diagnostics-only in the selected file; project hooks must be trusted in the selected file | Use this tool instead of ad hoc diagnostic commands to verify source files with detected or explicitly selected language servers. Go verification formats files before diagnostics; check-only skips all normalization.; diagnostics, project hooks | diagnostics | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when current diagnostic coverage arrives successfully (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| verify | semedit verify | semantic_verify | selected_scope,check_only | the selected scope | gopls must be available in the selected scope; the language toolchain must be available in the selected scope; the operation must be diagnostics-only in the selected scope; project hooks must be trusted in the selected scope | Use this tool instead of ad hoc diagnostic commands to verify source files with detected or explicitly selected language servers. Go verification formats files before diagnostics; check-only skips all normalization.; diagnostics, project hooks | diagnostics | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when current diagnostic coverage arrives successfully (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| workspace_outline | semedit workspace-outline | semantic_workspace_outline | default | workspace paths | the source must remain stable in workspace paths | Use this tool instead of find, tree, ls, or shell directory scanning to orient yourself in a Go or Java workspace; it lists packages, synopses, and Go module or Maven reactor boundaries ordered by depth. Use semantic_outline next to inspect declarations.; outline | read-only | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
Rust
| Operation | CLI command | MCP tool | Variant | Analysis scope | Preconditions | Capabilities | Guarantees | Error tolerance |
|---|---|---|---|---|---|---|---|---|
| lookup | semedit lookup | semantic_lookup | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; a Cargo root must be discoverable in the selected file; rust-analyzer must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of grep or text search when locating a named symbol in Go or a selected trusted source file. Omit file for Go workspace lookup. Rust, Java, Scala, Kotlin, Bash, Makefile, and Haskell lookup are read-only and require explicit workspace trust; external tools must already be installed. Returns symbol, file, kind, line, and column. Pass symbol and file to follow-up semedit calls. Use line and column only for file-navigation reads; they are not accepted as semedit tool parameters.; lookup | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| outline | semedit outline | semantic_outline | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; a Cargo root must be discoverable in the selected file; rust-analyzer must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; unexported declarations must be included in the selected file | Use this tool instead of scanning source files with shell commands when you need a declaration outline for a selected source scope; use semantic_workspace_outline first to discover which packages to inspect. Directory scopes are Go-only.; outline | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| rename | semedit rename | semantic_rename | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; a Cargo root must be discoverable in the selected file; rust-analyzer must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; the selector must identify exactly one target in the selected file; the language server must support rename in the selected file; the source must remain stable in the selected file | Use this tool instead of text search-and-replace when renaming a symbol and its references through the selected language backend. Go supports workspace rename; trusted Rust and Java support selected-file language-server rename. Other languages may be lookup-only. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; rename | validated server edit without resource operations, atomic writes, edits confined to the selected file | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| snapshot | semedit snapshot | semantic_snapshot | default | workspace paths | the source must remain stable in workspace paths; the destination must be writable in workspace paths; a label must be supplied in workspace paths | Use this tool instead of git stash or manual backup copies when a later semantic_undo may be needed for a bounded edit; capture a pre-edit transactional snapshot, creating an immutable journal under .scratch/snapshots/ | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| undo | semedit undo | semantic_undo | default | workspace paths | the snapshot state must be available in workspace paths; the destination must be writable in workspace paths | Use this tool instead of git reset or manual file restoration when undoing edits recorded by semantic_snapshot; it restores workspace files with conflict-checked atomic writes. Fails and performs zero writes if any touched file was modified after the snapshot’s recorded post-edit state.; restore | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
Java
| Operation | CLI command | MCP tool | Variant | Analysis scope | Preconditions | Capabilities | Guarantees | Error tolerance |
|---|---|---|---|---|---|---|---|---|
| add_build_dependency | semedit add-build-dependency | semantic_add_build_dependency | default | module manifests | the workspace must be trusted in module manifests; a Maven root must be discoverable in module manifests | Use this tool instead of editing go.mod/go.sum or Maven POM files manually to add a build dependency. Go runs go get and go mod tidy and may access the network; Java updates the selected Maven reactor using dependencyManagement inheritance and refreshes JDT LS. Java requires explicit workspace trust. Use semantic_organize_imports for source imports.; add dependency | atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| change_signature | semedit change-signature | semantic_change_signature | selected_file | the language server’s scope | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file; the source must remain stable in the selected file | Use this tool instead of manually changing a Java method signature and its resolved callers through JDT LS, or a supported private Go free-function signature and its proven direct callers. Supply the complete ordered parameter mapping. New Java parameters require a default argument expression used at every existing call site; Go keeps its stricter append-only proof. Standalone results expose a finalized function_target; receipt continuations remain available for inspection. Buffered results report applied_working without claiming disk publication. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; typed refactoring, formatting | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| extract_constant | semedit extract-constant | semantic_extract_constant | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of manually moving expressions into fields to extract one exact compile-time constant expression. Go preserves resolved constant type and value facts; Java delegates to JDT LS refactor.extract.constant and renames the generated field. Supply symbol, in_function, and exact-source discriminator; use construct_path with its matching expected_revision when the expression is ambiguous. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; typed refactoring, formatting | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| extract_function | semedit extract-function | semantic_extract_function | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of copying statements to extract a safe contiguous top-level call region from a Go function or method into a local helper. Parameters are inferred from named owner parameters and the receiver. One leading := declaration may return multiple distinct named live-out values when every result expression is a basic literal, a boolean literal, a named owner parameter, or a supported unary or parenthesized form of those expressions. Effectful, call, compound, and unsupported result-type expressions are refused before writing. Pass the returned live file and helper symbol to semantic_rename or semantic_replace_body. Address-taken values, closure-captured inputs, direct recover calls, selector calls on forwarded values, other local data flow, branching, loops, comments, composite literals, generic owners, and variadic parameters are refused. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; typed refactoring, formatting | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| extract_interface | semedit extract-interface | semantic_extract_interface | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file; the source must remain stable in the selected file | Use this tool instead of reconstructing method signatures to create an interface from exact selected direct methods. Go type-checks the generated declaration and supports current-overlay proof. Java selects public instance methods, appends a package-private interface to the concrete type file, adds implements, then formats and verifies through JDT LS. Copy result.contract and result.contract_file to semantic_implement_contract.contract and contract_file. Go mutable local replacement modules are unsupported; versioned replacements remain supported.; typed refactoring, formatting | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| extract_variable | semedit extract-variable | semantic_extract_variable | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of manually rewriting a call to extract one exact expression into a local variable. Go supports one side-effect-free typed first argument of a direct call under strict data-flow checks; Java delegates extraction to a matching JDT LS refactor action, then renames the generated local to the requested symbol. Use construct_path and its matching selected-file expected_revision when the expression is ambiguous. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; typed refactoring, formatting | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| find_references | semedit find-references | semantic_find_references | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of text search when finding typed references to a Go or Java declaration. The optional file selects the target; results span the active Go module or trusted Java workspace.; references | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| implement_contract | semedit implement-contract | semantic_implement_contract | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of rebuilding interface method signatures to generate missing Go methods on an existing concrete type. contract_file identifies an ordinary interface, receiver_kind selects pointer or value semantics, and body_policy must explicitly select panic_stub. Generated methods panic when called; they are placeholders, not completed implementations. destination_file must already exist in the concrete type package. Copy type_target to inspect the concrete type and each generated_methods file/symbol pair to replace_body or rename. Existing incompatible methods, unsupported promoted methods, failed required-package overlay type checks, and mutable local replacement modules are refused before one apply; versioned replacements remain supported.; typed refactoring, formatting | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| inline_function | semedit inline-function | semantic_inline_function | selected_file | the selected file | the workspace must be trusted in the selected file; JDT LS must be available in the selected file; the selector must identify exactly one target in the selected file; the source must remain stable in the selected file | Use this tool instead of text editing to inline one selected call site. Go supports one direct zero-argument call to a same-package free function whose body is a single literal return. Java resolves the selected method call in call_site and delegates one refactor.inline action to JDT LS. The callee declaration remains in place.; typed refactoring, formatting | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| inline_variable | semedit inline-variable | semantic_inline_variable | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of text replacement to inline one local variable. Go supports a bounded literal substitution with strict data-flow checks; Java delegates to JDT LS refactor.inline for the selected local declaration. The successful edit removes the binding and returns its surviving owner function as a live target; use semantic_lookup to select fresh constructs or bindings. The removed name is historical evidence and is not a follow-up target. Expressions, reassignment, shadowing, and unsupported server actions are refused.; typed refactoring, formatting | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_case | semedit insert-case | semantic_insert_case | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file; the source must remain stable in the selected file | Use this tool instead of text editing when adding one case clause to an existing Go switch. Use semantic_insert_construct for the generic insertion interface. Supply the existing in_function selector and, for tagged switches, the exact discriminator expression (for example request.Method); kind=case alone does not identify the target switch. If multiple switches match, copy construct_path from the ambiguity diagnostic. The case value is a complete clause including its colon and statements.; AST edits, formatting | AST edit, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_construct | semedit insert-construct | semantic_insert_construct | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of text replacement to add one backend-supported declaration, field, keyed composite element, switch case, or anchored statement. For kind=element, select a typed map/dictionary literal and append one keyed key: value pair, or select a struct/object initializer and append one property; slices/arrays and positional elements are unsupported. Select the exact literal with discriminator and its owning top-level declaration or function/method with in_declaration. Element insertion preserves the exact planned bytes and ignores auto_organize_imports. Field insertion requires an existing locally declared, private, non-generic Go struct. Use semantic_replace_construct for existing targets; insertions fail closed on collisions. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; AST edits, formatting | AST edit, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_field | semedit insert-field | semantic_insert_field | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of editing a type declaration to add one named field to an existing private, non-generic Go struct or a Java class, enum, or record. Java type_end insertion respects member category and visibility ordering, then formats and verifies through JDT LS.; AST edits, formatting | AST edit, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_function | semedit insert-func | semantic_insert_function | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of text replacement to add one complete Go function or method, or one Java method or constructor. The complete parameters, results, and body are supplied as a declaration. Java inserts into one selected owner type and delegates formatting and verification to JDT LS. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; AST edits, formatting | AST edit, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| insert_type | semedit insert-type | semantic_insert_type | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of replace_file_content or text insertion to add one Go struct, interface, or type alias, or one Java nested type to a uniquely selected owner type. Java member ordering follows type visibility and JDT LS formats and verifies the result. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; AST edits, formatting | AST edit, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| inspect_construct | semedit inspect-construct | semantic_inspect_construct | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of guessing nested construct selectors when current choices are unavailable after selection drift or a selector has multiple matches. Lists current candidates with canonical selector context, reusable construct_path values, and an opaque expected_selection_revision for the ordered current candidate list.; inspect | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| inspect_symbol | semedit inspect-symbol | semantic_inspect_symbol | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of reading source with shell commands when you need a declaration’s exact source, metadata, and snapshot revision.; inspect | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| introduce_parameter | semedit introduce-parameter | semantic_introduce_parameter | selected_file | the language server’s scope | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file; the source must remain stable in the selected file | Use this tool instead of manually replacing one exact expression with a new parameter and updating its callers. Java delegates signature and call-site changes to JDT LS; Go requires a private free function and proves the closed constant argument and complete call set. Methods, exported or generic Go functions, function values, and ambiguous Java expressions are refused. Standalone results expose a finalized function_target; receipt continuations remain available for inspection. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; typed refactoring, formatting | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| introduce_parameter_object | semedit introduce-parameter-object | semantic_introduce_parameter_object | selected_file | the language server’s scope | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file; the source must remain stable in the selected file | Use this tool instead of manually replacing a complete parameter list with one value object, rewriting bound body references, and updating every proven direct caller. Go requires a private free function; Java requires one same-package method with direct invocation references. Partial mappings, unresolved call sites, cross-package Java callers, and unsupported Java parameter shapes are refused. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; typed refactoring, formatting | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| lookup | semedit lookup | semantic_lookup | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of grep or text search when locating a named symbol in Go or a selected trusted source file. Omit file for Go workspace lookup. Rust, Java, Scala, Kotlin, Bash, Makefile, and Haskell lookup are read-only and require explicit workspace trust; external tools must already be installed. Returns symbol, file, kind, line, and column. Pass symbol and file to follow-up semedit calls. Use line and column only for file-navigation reads; they are not accepted as semedit tool parameters.; lookup | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| maven_compile | semedit maven-compile | semantic_maven_compile | default | the project build | the workspace must be trusted in the project build; a Maven root must be discoverable in the project build; Maven must be available in the project build | Use this tool instead of a shell Maven invocation when compiling tests for a Java root POM. Set trust_workspace=true. The fixed test-compile goal runs offline unless allow_network=true and uses temporary Maven home/repository data under .scratch; Maven writes project build outputs.; compile | diagnostics | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the build tool can execute and report its outcome (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| maven_test | semedit maven-test | semantic_maven_test | default | the project build | the workspace must be trusted in the project build; a Maven root must be discoverable in the project build; Maven must be available in the project build | Use this tool instead of a shell Maven invocation when running tests for a Java root POM. Set trust_workspace=true. The fixed test goal runs offline unless allow_network=true and uses temporary Maven home/repository data under .scratch; Maven writes project build outputs.; test | diagnostics | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the build tool can execute and report its outcome (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| move_construct | semedit move-construct | semantic_move_construct | selected_file | the selected file | the workspace must be trusted in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of text replacement to relocate one supported declaration to an explicit destination. Java delegates static-member moves and reference updates to JDT LS; Go supports explicit declaration placements.; typed refactoring, formatting, organize imports, diagnostics | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when current diagnostic coverage arrives successfully (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| organize_imports | semedit imports | semantic_organize_imports | selected_file | the selected file | the source must remain stable in the selected file; imports must resolve in the selected file | Use this tool instead of text editing import blocks or shelling out to goimports when adding, removing, or formatting Go imports. For Java, select one trusted .java file; explicit additions and removals use fully qualified type names before JDT LS formats and organizes imports. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; formatting, organize imports | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| outline | semedit outline | semantic_outline | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; unexported declarations must be included in the selected file | Use this tool instead of scanning source files with shell commands when you need a declaration outline for a selected source scope; use semantic_workspace_outline first to discover which packages to inspect. Directory scopes are Go-only.; outline | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| remove_construct | semedit remove-construct | semantic_remove_construct | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the target must parse in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of replace_file_content to remove one supported Go declaration or construct, or one Java method, constructor, field declaration, nested type, or method-local control-flow construct. Java safe_delete checks private declaration visibility and requires complete JDT LS workspace reference coverage with no usages. Syntax is validated and diagnostics are reported; structural removal does not prove behavioral equivalence.; AST edits, formatting | AST edit, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| remove_construct | semedit remove-construct | semantic_remove_construct | selected_file,safe_delete | the language server’s scope | hierarchical, valid document symbols must be available in the language server’s scope; the selector must identify exactly one target in the language server’s scope; the source must remain stable in the language server’s scope | Use this tool instead of replace_file_content to remove one supported Go declaration or construct, or one Java method, constructor, field declaration, nested type, or method-local control-flow construct. Java safe_delete checks private declaration visibility and requires complete JDT LS workspace reference coverage with no usages. Syntax is validated and diagnostics are reported; structural removal does not prove behavioral equivalence.; AST edits, formatting, references | AST edit, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| rename | semedit rename | semantic_rename | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; the selector must identify exactly one target in the selected file; the language server must support rename in the selected file; the source must remain stable in the selected file | Use this tool instead of text search-and-replace when renaming a symbol and its references through the selected language backend. Go supports workspace rename; trusted Rust and Java support selected-file language-server rename. Other languages may be lookup-only. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; rename | validated server edit without resource operations, atomic writes, edits confined to the selected file | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| replace_body | semedit replace-body | semantic_replace_body | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of text editing or replacing the entire declaration when changing the body of an existing Go function or method by name, or a Java method selected through JDT LS. The new body is provided as bare statements (no surrounding braces). Use semantic_replace_construct for replacing one construct or selecting a statement/expression slot. Validates and formats in memory before writing; leaves the file untouched on any syntax error. This standalone operation automatically verifies diagnostics and has no verification opt-out; do not call semantic_verify separately.; AST edits, formatting | AST edit, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| replace_construct | semedit replace-construct | semantic_replace_construct | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of replacing a whole function body to update one selected construct by kind. Go supports its documented control-flow and declaration kinds. Java supports method-local loop, if/else, switch/case, try/catch, try-with-resources, synchronized, array-element, and statement/expression candidates selected through semantic_inspect_construct; Java replacements are parsed, staged, formatted, import-organized, and verified through JDT LS. Use symbol for named declarations or in_function plus discriminator for nested targets. semantic_replace_body preserves a function signature when only its body changes.; AST edits, formatting | AST edit, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| replace_decl | semedit replace-decl | semantic_replace_decl | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the target must parse in the selected file; the selector must identify exactly one target in the selected file; the supplied snippet must parse in the selected file | Use this tool instead of replace_file_content to replace one Go package-level constant, variable, or type alias, or one uniquely selected Java method, field, or nested type declaration. Java replacements preserve declaration kind and name and run JDT LS formatting and diagnostics.; AST edits, formatting | AST edit, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| scaffold_file | semedit scaffold-file | semantic_scaffold_file | selected_file,infer_package | the selected file | the destination must be writable in the selected file | Use this tool instead of creating source files manually to add a Go or Java file with its package declaration. Java package inference uses sibling .java files or the path beneath src/main/java or src/test/java. Fails if the file already exists unless overwrite is true. Does not seed declarations; use insert tools afterward.; scaffold | atomic writes | healthy=supported, target_syntax=unknown, target_type=unknown, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=16, rejected=0, conditional=0, unknown=48; masks: supported=0x1111111111111111, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| set_doc_comment | semedit set-doc-comment | semantic_set_doc_comment | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; the selector must identify exactly one target in the selected file; the source must remain stable in the selected file | Use this tool instead of editing source text to set or remove one owned Go top-level or Java declaration documentation comment. Scope is declaration only. Missing and null comment values are invalid; an explicit empty string removes the comment. Existing Go directives, grouped declarations, detached ownership, and ambiguous targets are refused. Standalone results include a live declaration continuation; batch receipts report applied_working without live continuations.; AST edits, formatting | AST edit, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| snapshot | semedit snapshot | semantic_snapshot | default | workspace paths | the source must remain stable in workspace paths; the destination must be writable in workspace paths; a label must be supplied in workspace paths | Use this tool instead of git stash or manual backup copies when a later semantic_undo may be needed for a bounded edit; capture a pre-edit transactional snapshot, creating an immutable journal under .scratch/snapshots/ | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| stage_abort | semedit stage-abort | semantic_stage_abort | default | workspace paths | the source must remain stable in workspace paths; an active retained staging session must exist in the language server’s scope | Use this tool instead of undo when discarding an uncommitted retained Go or Java staging session. This removes its in-memory overlay and writes no workspace files.; volatile staging | volatile state only | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| stage_commit | semedit commit | semantic_commit | default | workspace paths | the workspace must be trusted in workspace paths; an explicit, unambiguous Java project root must be selected in workspace paths; JDT LS must be available in workspace paths; Java 21 or newer must be available in workspace paths | Use this tool instead of semantic_batch when publishing an existing retained Go or Java staging session. It normalizes the staged edits and reports zero, partial, or full publication and the final verification outcome.; formatting, organize imports, diagnostics, publication | diagnostics, conflict checked, atomic writes, explicit publication outcome | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when current diagnostic coverage arrives successfully (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| stage_drop | semedit stage-drop | semantic_stage_drop | default | workspace paths | the source must remain stable in workspace paths; an active retained staging session must exist in the language server’s scope | Use this tool instead of restarting the entire staging session when removing one accepted step. The surviving steps are replayed into a new in-memory overlay and no workspace files are written.; volatile staging | volatile state only | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| stage_start | semedit stage | semantic_stage | default | workspace paths | the source must remain stable in workspace paths | Use this tool instead of applying Go or Java edits immediately when a retained sequence needs review before publication. Accepted edits remain in an in-memory overlay until semantic_commit; no workspace files are written by this control.; volatile staging | volatile state only | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| undo | semedit undo | semantic_undo | default | workspace paths | the snapshot state must be available in workspace paths; the destination must be writable in workspace paths | Use this tool instead of git reset or manual file restoration when undoing edits recorded by semantic_snapshot; it restores workspace files with conflict-checked atomic writes. Fails and performs zero writes if any touched file was modified after the snapshot’s recorded post-edit state.; restore | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| verify | semedit verify | semantic_verify | selected_file,normalize | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; a timely diagnostics receipt matching the current file must be available; silence is not a receipt in the selected file; the source must remain stable in the selected file | Use this tool instead of ad hoc diagnostic commands to verify source files with detected or explicitly selected language servers. Go verification formats files before diagnostics; check-only skips all normalization.; formatting, organize imports, diagnostics | validated server edit without resource operations, diagnostics, atomic writes, edits confined to the selected file | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| verify | semedit verify | semantic_verify | selected_scope,normalize | the selected scope | the workspace must be trusted in the selected scope; an explicit, unambiguous Java project root must be selected in the selected scope; JDT LS must be available in the selected scope; Java 21 or newer must be available in the selected scope; a timely diagnostics receipt matching the current file must be available; silence is not a receipt in the selected scope; the source must remain stable in the selected scope | Use this tool instead of ad hoc diagnostic commands to verify source files with detected or explicitly selected language servers. Go verification formats files before diagnostics; check-only skips all normalization.; formatting, organize imports, diagnostics | validated server edit without resource operations, diagnostics, atomic writes | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the requested normalizers accept the source or repair the relevant fault (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| verify | semedit verify | semantic_verify | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; a timely diagnostics receipt matching the current file must be available; silence is not a receipt in the selected file | Use this tool instead of ad hoc diagnostic commands to verify source files with detected or explicitly selected language servers. Go verification formats files before diagnostics; check-only skips all normalization.; diagnostics | read-only, diagnostics | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when current diagnostic coverage arrives successfully (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| verify | semedit verify | semantic_verify | selected_file,check_only | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; an explicit, unambiguous Java project root must be selected in the selected file; JDT LS must be available in the selected file; Java 21 or newer must be available in the selected file; a timely diagnostics receipt matching the current file must be available; silence is not a receipt in the selected file | Use this tool instead of ad hoc diagnostic commands to verify source files with detected or explicitly selected language servers. Go verification formats files before diagnostics; check-only skips all normalization.; diagnostics | read-only, diagnostics | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when current diagnostic coverage arrives successfully (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| workspace_outline | semedit workspace-outline | semantic_workspace_outline | default | workspace paths | the source must remain stable in workspace paths | Use this tool instead of find, tree, ls, or shell directory scanning to orient yourself in a Go or Java workspace; it lists packages, synopses, and Go module or Maven reactor boundaries ordered by depth. Use semantic_outline next to inspect declarations.; outline | read-only | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
Scala
| Operation | CLI command | MCP tool | Variant | Analysis scope | Preconditions | Capabilities | Guarantees | Error tolerance |
|---|---|---|---|---|---|---|---|---|
| lookup | semedit lookup | semantic_lookup | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; a Scala project root must be discoverable in the selected file; Metals must be available in the selected file; Java 21 or newer must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of grep or text search when locating a named symbol in Go or a selected trusted source file. Omit file for Go workspace lookup. Rust, Java, Scala, Kotlin, Bash, Makefile, and Haskell lookup are read-only and require explicit workspace trust; external tools must already be installed. Returns symbol, file, kind, line, and column. Pass symbol and file to follow-up semedit calls. Use line and column only for file-navigation reads; they are not accepted as semedit tool parameters.; lookup | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| outline | semedit outline | semantic_outline | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; a Scala project root must be discoverable in the selected file; Metals must be available in the selected file; Java 21 or newer must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; unexported declarations must be included in the selected file | Use this tool instead of scanning source files with shell commands when you need a declaration outline for a selected source scope; use semantic_workspace_outline first to discover which packages to inspect. Directory scopes are Go-only.; outline | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| snapshot | semedit snapshot | semantic_snapshot | default | workspace paths | the source must remain stable in workspace paths; the destination must be writable in workspace paths; a label must be supplied in workspace paths | Use this tool instead of git stash or manual backup copies when a later semantic_undo may be needed for a bounded edit; capture a pre-edit transactional snapshot, creating an immutable journal under .scratch/snapshots/ | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| undo | semedit undo | semantic_undo | default | workspace paths | the snapshot state must be available in workspace paths; the destination must be writable in workspace paths | Use this tool instead of git reset or manual file restoration when undoing edits recorded by semantic_snapshot; it restores workspace files with conflict-checked atomic writes. Fails and performs zero writes if any touched file was modified after the snapshot’s recorded post-edit state.; restore | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
Haskell
| Operation | CLI command | MCP tool | Variant | Analysis scope | Preconditions | Capabilities | Guarantees | Error tolerance |
|---|---|---|---|---|---|---|---|---|
| lookup | semedit lookup | semantic_lookup | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; standalone Haskell mode with matching GHC and HLS must be selected in the selected file; no Haskell project markers may be present in the selected file; HLS matching the selected GHC toolchain must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of grep or text search when locating a named symbol in Go or a selected trusted source file. Omit file for Go workspace lookup. Rust, Java, Scala, Kotlin, Bash, Makefile, and Haskell lookup are read-only and require explicit workspace trust; external tools must already be installed. Returns symbol, file, kind, line, and column. Pass symbol and file to follow-up semedit calls. Use line and column only for file-navigation reads; they are not accepted as semedit tool parameters.; lookup | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| snapshot | semedit snapshot | semantic_snapshot | default | workspace paths | the source must remain stable in workspace paths; the destination must be writable in workspace paths; a label must be supplied in workspace paths | Use this tool instead of git stash or manual backup copies when a later semantic_undo may be needed for a bounded edit; capture a pre-edit transactional snapshot, creating an immutable journal under .scratch/snapshots/ | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| undo | semedit undo | semantic_undo | default | workspace paths | the snapshot state must be available in workspace paths; the destination must be writable in workspace paths | Use this tool instead of git reset or manual file restoration when undoing edits recorded by semantic_snapshot; it restores workspace files with conflict-checked atomic writes. Fails and performs zero writes if any touched file was modified after the snapshot’s recorded post-edit state.; restore | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
Kotlin
| Operation | CLI command | MCP tool | Variant | Analysis scope | Preconditions | Capabilities | Guarantees | Error tolerance |
|---|---|---|---|---|---|---|---|---|
| lookup | semedit lookup | semantic_lookup | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; the Kotlin language server must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of grep or text search when locating a named symbol in Go or a selected trusted source file. Omit file for Go workspace lookup. Rust, Java, Scala, Kotlin, Bash, Makefile, and Haskell lookup are read-only and require explicit workspace trust; external tools must already be installed. Returns symbol, file, kind, line, and column. Pass symbol and file to follow-up semedit calls. Use line and column only for file-navigation reads; they are not accepted as semedit tool parameters.; lookup | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| outline | semedit outline | semantic_outline | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; the Kotlin language server must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; unexported declarations must be included in the selected file | Use this tool instead of scanning source files with shell commands when you need a declaration outline for a selected source scope; use semantic_workspace_outline first to discover which packages to inspect. Directory scopes are Go-only.; outline | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| snapshot | semedit snapshot | semantic_snapshot | default | workspace paths | the source must remain stable in workspace paths; the destination must be writable in workspace paths; a label must be supplied in workspace paths | Use this tool instead of git stash or manual backup copies when a later semantic_undo may be needed for a bounded edit; capture a pre-edit transactional snapshot, creating an immutable journal under .scratch/snapshots/ | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| undo | semedit undo | semantic_undo | default | workspace paths | the snapshot state must be available in workspace paths; the destination must be writable in workspace paths | Use this tool instead of git reset or manual file restoration when undoing edits recorded by semantic_snapshot; it restores workspace files with conflict-checked atomic writes. Fails and performs zero writes if any touched file was modified after the snapshot’s recorded post-edit state.; restore | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| verify | semedit verify | semantic_verify | selected_file | the selected file in isolation | the workspace must be trusted in the selected file in isolation; a file must be selected in the selected file in isolation; the Kotlin language server must be available in the selected file in isolation; a timely diagnostics receipt matching the current file must be available; silence is not a receipt in the selected file in isolation; the operation must be diagnostics-only in the selected file in isolation | Use this tool instead of ad hoc diagnostic commands to verify source files with detected or explicitly selected language servers. Go verification formats files before diagnostics; check-only skips all normalization.; diagnostics | read-only, diagnostics | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when current diagnostic coverage arrives successfully (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| verify | semedit verify | semantic_verify | selected_file,check_only | the selected file in isolation | the workspace must be trusted in the selected file in isolation; a file must be selected in the selected file in isolation; the Kotlin language server must be available in the selected file in isolation; a timely diagnostics receipt matching the current file must be available; silence is not a receipt in the selected file in isolation; the operation must be diagnostics-only in the selected file in isolation | Use this tool instead of ad hoc diagnostic commands to verify source files with detected or explicitly selected language servers. Go verification formats files before diagnostics; check-only skips all normalization.; diagnostics | read-only, diagnostics | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when current diagnostic coverage arrives successfully (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
Bash
| Operation | CLI command | MCP tool | Variant | Analysis scope | Preconditions | Capabilities | Guarantees | Error tolerance |
|---|---|---|---|---|---|---|---|---|
| lookup | semedit lookup | semantic_lookup | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; the Bash language server must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of grep or text search when locating a named symbol in Go or a selected trusted source file. Omit file for Go workspace lookup. Rust, Java, Scala, Kotlin, Bash, Makefile, and Haskell lookup are read-only and require explicit workspace trust; external tools must already be installed. Returns symbol, file, kind, line, and column. Pass symbol and file to follow-up semedit calls. Use line and column only for file-navigation reads; they are not accepted as semedit tool parameters.; lookup | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| outline | semedit outline | semantic_outline | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; the Bash language server must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; unexported declarations must be included in the selected file | Use this tool instead of scanning source files with shell commands when you need a declaration outline for a selected source scope; use semantic_workspace_outline first to discover which packages to inspect. Directory scopes are Go-only.; outline | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| snapshot | semedit snapshot | semantic_snapshot | default | workspace paths | the source must remain stable in workspace paths; the destination must be writable in workspace paths; a label must be supplied in workspace paths | Use this tool instead of git stash or manual backup copies when a later semantic_undo may be needed for a bounded edit; capture a pre-edit transactional snapshot, creating an immutable journal under .scratch/snapshots/ | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| undo | semedit undo | semantic_undo | default | workspace paths | the snapshot state must be available in workspace paths; the destination must be writable in workspace paths | Use this tool instead of git reset or manual file restoration when undoing edits recorded by semantic_snapshot; it restores workspace files with conflict-checked atomic writes. Fails and performs zero writes if any touched file was modified after the snapshot’s recorded post-edit state.; restore | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| verify | semedit verify | semantic_verify | selected_file | the selected file in isolation | the workspace must be trusted in the selected file in isolation; a file must be selected in the selected file in isolation; the Bash language server must be available in the selected file in isolation; a timely diagnostics receipt matching the current file must be available; silence is not a receipt in the selected file in isolation; the operation must be diagnostics-only in the selected file in isolation | Use this tool instead of ad hoc diagnostic commands to verify source files with detected or explicitly selected language servers. Go verification formats files before diagnostics; check-only skips all normalization.; diagnostics | read-only, diagnostics | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when current diagnostic coverage arrives successfully (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| verify | semedit verify | semantic_verify | selected_file,check_only | the selected file in isolation | the workspace must be trusted in the selected file in isolation; a file must be selected in the selected file in isolation; the Bash language server must be available in the selected file in isolation; a timely diagnostics receipt matching the current file must be available; silence is not a receipt in the selected file in isolation; the operation must be diagnostics-only in the selected file in isolation | Use this tool instead of ad hoc diagnostic commands to verify source files with detected or explicitly selected language servers. Go verification formats files before diagnostics; check-only skips all normalization.; diagnostics | read-only, diagnostics | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when current diagnostic coverage arrives successfully (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
Makefile
| Operation | CLI command | MCP tool | Variant | Analysis scope | Preconditions | Capabilities | Guarantees | Error tolerance |
|---|---|---|---|---|---|---|---|---|
| inspect_symbol | semedit inspect-symbol | semantic_inspect_symbol | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; the Make language server must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of reading source with shell commands when you need a declaration’s exact source, metadata, and snapshot revision.; inspect | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| lookup | semedit lookup | semantic_lookup | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; the Make language server must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; the selector must identify exactly one target in the selected file | Use this tool instead of grep or text search when locating a named symbol in Go or a selected trusted source file. Omit file for Go workspace lookup. Rust, Java, Scala, Kotlin, Bash, Makefile, and Haskell lookup are read-only and require explicit workspace trust; external tools must already be installed. Returns symbol, file, kind, line, and column. Pass symbol and file to follow-up semedit calls. Use line and column only for file-navigation reads; they are not accepted as semedit tool parameters.; lookup | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| outline | semedit outline | semantic_outline | selected_file | the selected file | the workspace must be trusted in the selected file; a file must be selected in the selected file; the Make language server must be available in the selected file; hierarchical, valid document symbols must be available in the selected file; unexported declarations must be included in the selected file | Use this tool instead of scanning source files with shell commands when you need a declaration outline for a selected source scope; use semantic_workspace_outline first to discover which packages to inspect. Directory scopes are Go-only.; outline | read-only | healthy=supported, target_syntax=conditional, target_type=conditional, same_package_syntax=conditional, same_package_type=conditional, other_package_syntax=conditional, other_package_type=conditional; mixed faults follow the declared fault matrix; conditional when the server supplies sufficient usable analysis (exact cases: supported=1, rejected=0, conditional=63, unknown=0; masks: supported=0x0000000000000001, rejected=0x0000000000000000, conditional=0xfffffffffffffffe; mixed-fault cases use the exact matrix with no subset or superset closure) |
| snapshot | semedit snapshot | semantic_snapshot | default | workspace paths | the source must remain stable in workspace paths; the destination must be writable in workspace paths; a label must be supplied in workspace paths | Use this tool instead of git stash or manual backup copies when a later semantic_undo may be needed for a bounded edit; capture a pre-edit transactional snapshot, creating an immutable journal under .scratch/snapshots/ | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
| undo | semedit undo | semantic_undo | default | workspace paths | the snapshot state must be available in workspace paths; the destination must be writable in workspace paths | Use this tool instead of git reset or manual file restoration when undoing edits recorded by semantic_snapshot; it restores workspace files with conflict-checked atomic writes. Fails and performs zero writes if any touched file was modified after the snapshot’s recorded post-edit state.; restore | conflict checked, atomic writes | healthy=supported, target_syntax=supported, target_type=supported, same_package_syntax=supported, same_package_type=supported, other_package_syntax=supported, other_package_type=supported; mixed faults follow the declared fault matrix (exact cases: supported=64, rejected=0, conditional=0, unknown=0; masks: supported=0xffffffffffffffff, rejected=0x0000000000000000, conditional=0x0000000000000000; mixed-fault cases use the exact matrix with no subset or superset closure) |
Language Constraints & Capability Rules
Go (Golang) Engine Constraints
- Unsupported Modifiers Rejection: Go lacks ‘protected’ and ‘package-private’ scopes. The engine rejects these modifiers with ErrUnsupportedModifier.
- Casing & Visibility Invariant: Identifier capitalization governs visibility. Specifying ‘public’ for a lowercase symbol or ‘private’ for an uppercase symbol returns VisibilityMismatchError.
- Strict Public-Precedes-Private Ordering: All public declarations precede private declarations within generated or updated source files.
- Receiver Method Clustering: Methods sharing a common receiver type cluster near each other while maintaining public vs private partitioning.
- Declaration Block Merging: Constants and variables automatically merge into existing ‘const (…)’ or ‘var (…)’ blocks instead of creating duplicate blocks.
Rust Engine Constraints
- Trusted Explicit Workspace: Lookup requires a selected .rs file, a deterministic Cargo root, explicit workspace trust, and a preinstalled rust-analyzer; Cargo is never invoked.
- Hierarchical Document Symbols: Only exact hierarchical document symbols and associated items are resolved; macros, generated symbols, locals, ambiguous trait methods, and multiple impl resolution are not promised.
Java Engine Constraints
- Trusted Explicit Workspace: Java edits and JDT LS reads require an explicit or unambiguous workspace root, explicit workspace trust, a preinstalled JDT LS distribution, and Java 21 or newer; JDT LS operations never invoke build tools. Bounded Maven process actions are exposed separately by the central operation registry.
- Hierarchical Document Symbols: Hierarchical package, type, field, method, and constructor symbols are resolved; overloaded methods accept signature-qualified selectors. Locals, generated symbols, and malformed-source fallback are not promised.
Scala Engine Constraints
- Trusted Explicit Tools: Lookup requires a selected .scala file, an explicit workspace root for project markers, explicit workspace trust, a pinned preinstalled Metals distribution, and recorded Java 21 or newer; no build tool is invoked.
- Hierarchical Document Symbols: Only exact hierarchical classes, objects, traits, enums, methods, fields, and nested types are resolved; overload signatures, givens, extensions, package objects, generated symbols, and cross-file SemanticDB search are not promised.
Haskell Engine Constraints
- Explicit Standalone Trust: Lookup requires –haskell-standalone (or standalone_haskell=true), a selected .hs file, explicit workspace trust, preinstalled GHC, and a matching preinstalled haskell-language-server-wrapper; hie.yaml, stack.yaml, cabal.project, *.cabal, and package.yaml project markers are rejected.
- Hierarchical Document Symbols: Only module, top-level values, types, classes, constructors, fields, and instances returned hierarchically by HLS are resolved; locals, pattern synonyms, duplicate record fields, reexports, generated or Template Haskell symbols, and malformed-source fallback are not promised.
Kotlin Engine Constraints
- Trusted Server: A selected .kt or .kts file and request-scoped workspace trust are required before the preinstalled fwcd/kotlin-language-server is resolved or launched. Upstream may execute project classpath scripts or Maven/Gradle while resolving dependencies.
- Selected File Diagnostics: Verification requires a matching publishDiagnostics notification for the selected isolated file; no report before timeout is an error, not a clean result. Formatting and import modes are rejected.
Bash Engine Constraints
- Selected File: Only .sh and .bash files are accepted. The server runs in a source-only scratch workspace after request-scoped workspace trust.
- Optional Shell Tools: bash-language-server may invoke an installed ShellCheck against the copied selected source; the backend does not execute the shell script.
- Diagnostics Receipt: Verification requires an explicit matching publishDiagnostics report. Silence and malformed reports are errors.
Makefile Engine Constraints
- Selected File: Only Makefile, makefile, GNUmakefile, and .mk files are accepted. make-ls runs in an isolated source workspace after request-scoped trust.
- Include Reads: make-ls resolves includes; absolute paths and relative paths traversing outside the copied source may read files after trust is granted.
Placement Qualifiers
| Placement Mode | Target Identifier Required | Semantic Behavior |
|---|---|---|
file_start | No | Prepends declaration immediately after the package/import preamble. |
file_end | No | Appends declaration at the conclusion of the file (default fallback). |
public_start | No | Anchors declaration at the start of the public declarations section. |
public_end | No | Appends declaration at the boundary concluding public declarations. |
private_start | No | Anchors declaration at the start of the unexported/private section. |
private_end | No | Appends declaration at the boundary concluding private declarations. |
before_symbol | Yes | Locates target symbol AST node and injects declaration directly preceding it. |
after_symbol | Yes | Locates target symbol AST node and injects declaration directly succeeding it. |
Executable Test Workflows
Active, compiler-verified regression tests in testdata/scripts/*.txtar provide every scenario below.
Test build-level dependency validation without network access
Source: add_build_dependency.txtar · Download raw file
Execute: exec semedit add-build-dependency
CLI invocation
$ exec semedit add-build-dependency
Equivalent MCP tool call (semedit_semedit)
{}Expected error: add-build-dependency: param “package” is required: invalid operation parameters
Execute: exec semedit add-build-dependency –package ""
CLI invocation
$ exec semedit add-build-dependency --package ""
Equivalent MCP tool call (semedit_semedit)
{}Expected error: malformed module path
Add a local replacement module to go.mod without network access.
Source: add_build_dependency_go.txtar · Download raw file
Execute: semedit add-build-dependency –package example.com/localdep
CLI invocation
$ semedit add-build-dependency --package example.com/localdep
Equivalent MCP tool call (semantic_add_build_dependency)
{
"package": "example.com/localdep"
}Assert: Successfully added dependency example.com/localdep and tidied go.mod.
Unified AST transformation diff
module example.com/test
go 1.23
replace example.com/localdep => ./localdep
+ require example.com/localdep v0.0.0-00010101000000-000000000000
Expected output state (go.mod)
module example.com/test
go 1.23
replace example.com/localdep => ./localdep
require example.com/localdep v0.0.0-00010101000000-000000000000Add a versioned dependency to a Maven parent and a versionless child entry.
Source: add_build_dependency_java_reactor.txtar · Download raw file
Execute: semedit add-build-dependency –language java –trust-workspace –dependency org.example:codec:2.1 –file core
CLI invocation
$ semedit add-build-dependency --language java --trust-workspace --dependency org.example:codec:2.1 --file core
Equivalent MCP tool call (semantic_add_build_dependency)
{
"dependency": "org.example:codec:2.1",
"file": "core",
"language": "java",
"trust_workspace": true
}Assert: Successfully added Maven dependency org.example:codec:2.1 to 2 POM
Unified AST transformation diff (core/pom.xml)
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.example</groupId>
<artifactId>reactor</artifactId>
<version>1</version>
</parent>
<artifactId>core</artifactId>
+ <dependencies>
+ <dependency>
<groupId>org.example</groupId>
+ <artifactId>codec</artifactId>
+ </dependency>
+ </dependencies>
</project>
Expected output state (core/pom.xml)
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.example</groupId>
<artifactId>reactor</artifactId>
<version>1</version>
</parent>
<artifactId>core</artifactId>
<dependencies>
<dependency>
<groupId>org.example</groupId>
<artifactId>codec</artifactId>
</dependency>
</dependencies>
</project>Unified AST transformation diff (pom.xml)
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>reactor</artifactId>
<version>1</version>
<packaging>pom</packaging>
<modules><module>core</module></modules>
<dependencyManagement>
<dependencies>
<!-- Keep this comment in place. -->
+ <dependency>
<groupId>org.example</groupId>
+ <artifactId>codec</artifactId>
+ <version>2.1</version>
+ </dependency>
</dependencies>
</dependencyManagement>
</project>
Expected output state (pom.xml)
<project xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>reactor</artifactId>
<version>1</version>
<packaging>pom</packaging>
<modules><module>core</module></modules>
<dependencyManagement>
<dependencies>
<!-- Keep this comment in place. -->
<dependency>
<groupId>org.example</groupId>
<artifactId>codec</artifactId>
<version>2.1</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>Test assertion-mode: dry-run previews without writing, relax rewrites with trust
Source: assertion_mode.txtar · Download raw file
Execute: semedit assertion-mode –file api/api_test.go –mode relax –dry-run
CLI invocation
$ semedit assertion-mode --file api/api_test.go --mode relax --dry-run
Equivalent MCP tool call (semantic_assertion_mode)
{
"dry_run": true,
"file": "api/api_test.go",
"mode": "relax"
}Assert: 1 swapped
Assert: dry run
Execute: semedit assertion-mode –file api/api_test.go –mode relax –trust-workspace
CLI invocation
$ semedit assertion-mode --file api/api_test.go --mode relax --trust-workspace
Equivalent MCP tool call (semantic_assertion_mode)
{
"file": "api/api_test.go",
"mode": "relax",
"trust_workspace": true
}Assert: wrote api/api_test.go
Execute: semedit assertion-mode –file api/api_test.go –mode relax –trust-workspace
CLI invocation
$ semedit assertion-mode --file api/api_test.go --mode relax --trust-workspace
Equivalent MCP tool call (semantic_assertion_mode)
{
"file": "api/api_test.go",
"mode": "relax",
"trust_workspace": true
}Assert: No assertions changed in api/api_test.go.
Execute: exec semedit assertion-mode –file api/api_test.go –mode relax
CLI invocation
$ exec semedit assertion-mode --file api/api_test.go --mode relax
Equivalent MCP tool call (semedit_semedit)
{}Expected error: workspace trust required
Execute: exec semedit assertion-mode –file api/api_test.go –mode sideways
CLI invocation
$ exec semedit assertion-mode --file api/api_test.go --mode sideways
Equivalent MCP tool call (semedit_semedit)
{}Expected error: must be one of
Unified AST transformation diff (api/api_test.go)
package api
import "testing"
func TestPing(t *testing.T) {
if err := Ping(); err != nil {
t.Fatalf("Ping failed: %v", err)
}
if Probe() != "out" {
t.Errorf("Probe wrong")
}
}
Expected output state (api/api_test.go)
package api
import "testing"
func TestPing(t *testing.T) {
if err := Ping(); err != nil {
t.Fatalf("Ping failed: %v", err)
}
if Probe() != "out" {
t.Errorf("Probe wrong")
}
}Unified AST transformation diff (api/api_test.go)
- t.Fatalf("Ping failed: %v", err)
package api
import "testing"
func TestPing(t *testing.T) {
if err := Ping(); err != nil {
+ t.Errorf("Ping failed: %v", err)
}
if Probe() != "out" {
t.Errorf("Probe wrong")
}
}
Expected output state (api/api_test.go)
package api
import "testing"
func TestPing(t *testing.T) {
if err := Ping(); err != nil {
t.Errorf("Ping failed: %v", err)
}
if Probe() != "out" {
t.Errorf("Probe wrong")
}
}Reject misspelled batch arguments with indexed suggestions before any workspace operation.
Source: batch_params_shape.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: edit 0 params
Assert: semantic_rename
Assert: unknown parameter
Assert: symobl
Assert: Did you mean
Assert: symbol
Assert: Required parameters
Fail-fast batch execution across multiple files
Source: batch_partial.txtar · Download raw file
1. Execute batch with valid first edit and invalid second edit
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: NonExistentSymbol
Unified AST transformation diff (file1.go)
- return "pending"
package main
func StepOne() string {
+ return "completed"
}
Expected output state (file1.go)
package main
func StepOne() string {
return "completed"
}Unified AST transformation diff (file2.go)
package main
func StepTwo() string {
return "untouched"
}
Expected output state (file2.go)
package main
func StepTwo() string {
return "untouched"
}The CLI appends one typed parameter across source and test callers, preserves unrelated bytes, and refuses unsafe bindings without writes.
Source: change_signature_go.txtar · Download raw file
Execute: semedit change-signature –file service.go –symbol transform –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“ctx”,“type”:"*int"},“argument”:“nil”}]’
CLI invocation
$ semedit change-signature --file service.go --symbol transform --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"ctx","type":"*int"},"argument":"nil"}]'
Equivalent MCP tool call (semantic_change_signature)
{
"file": "service.go",
"parameters": "[{\"source_index\":0,\"parameter\":{\"name\":\"id\",\"type\":\"int\"}},{\"parameter\":{\"name\":\"ctx\",\"type\":\"*int\"},\"argument\":\"nil\"}]",
"symbol": "transform"
}Assert: Updated the function signature and every proven direct caller.
Execute: semedit change-signature –file service.go –symbol transform –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“source_index”:1,“parameter”:{“name”:“ctx”,“type”:"*int"}}]’
CLI invocation
$ semedit change-signature --file service.go --symbol transform --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"source_index":1,"parameter":{"name":"ctx","type":"*int"}}]'
Equivalent MCP tool call (semantic_change_signature)
{
"file": "service.go",
"parameters": "[{\"source_index\":0,\"parameter\":{\"name\":\"id\",\"type\":\"int\"}},{\"source_index\":1,\"parameter\":{\"name\":\"ctx\",\"type\":\"*int\"}}]",
"symbol": "transform"
}Assert: already present
Execute: semedit change-signature –file service.go –symbol noop –parameters ‘[]’
CLI invocation
$ semedit change-signature --file service.go --symbol noop --parameters '[]'
Equivalent MCP tool call (semantic_change_signature)
{
"file": "service.go",
"parameters": "[]",
"symbol": "noop"
}Assert: already present
Execute: exec semedit change-signature –file service.go –symbol indirect –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“enabled”,“type”:“bool”},“argument”:“true”}]’
CLI invocation
$ exec semedit change-signature --file service.go --symbol indirect --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"enabled","type":"bool"},"argument":"true"}]'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: function values and indirect callers are unsupported
Execute: exec semedit change-signature –file service.go –symbol usesGlobal –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“globalValue”,“type”:“int”},“argument”:“0”}]’
CLI invocation
$ exec semedit change-signature --file service.go --symbol usesGlobal --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"globalValue","type":"int"},"argument":"0"}]'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: conflicts with an existing body binding
Java change-signature delegates the ordered signature and caller edits to JDT LS.
Source: change_signature_java.txtar · Download raw file
Execute: semedit change-signature –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Service.java –symbol ‘Service.send(int)’ –parameters ‘[{“source_index”:0,“parameter”:{“name”:“identifier”,“type”:“long”}},{“parameter”:{“name”:“enabled”,“type”:“boolean”},“argument”:“true”}]’
CLI invocation
$ semedit change-signature --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Service.java --symbol 'Service.send(int)' --parameters '[{"source_index":0,"parameter":{"name":"identifier","type":"long"}},{"parameter":{"name":"enabled","type":"boolean"},"argument":"true"}]'
Equivalent MCP tool call (semantic_change_signature)
{
"file": "src/Service.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"parameters": "[{\"source_index\":0,\"parameter\":{\"name\":\"identifier\",\"type\":\"long\"}},{\"parameter\":{\"name\":\"enabled\",\"type\":\"boolean\"},\"argument\":\"true\"}]",
"symbol": "Service.send(int)",
"trust_workspace": true
}Unified AST transformation diff (src/Caller.java)
- service.send(7);
package sample;
class Caller {
void run(Service service) {
+ service.send(7, true);
}
}
Expected output state (src/Caller.java)
package sample;
class Caller {
void run(Service service) {
service.send(7, true);
}
}Unified AST transformation diff (src/Service.java)
- void send(int id) {
- System.out.println(id);
package sample;
class Service {
+ void send(long identifier, boolean enabled) {
+ System.out.println(identifier);
}
}
Expected output state (src/Service.java)
package sample;
class Service {
void send(long identifier, boolean enabled) {
System.out.println(identifier);
}
}The CLI appends parameters and call arguments after existing multiline trailing commas without creating invalid comma layouts.
Source: change_signature_trailing_comma_go.txtar · Download raw file
Execute: semedit change-signature –file service.go –symbol transform –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“enabled”,“type”:“bool”},“argument”:“true”}]’
CLI invocation
$ semedit change-signature --file service.go --symbol transform --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"enabled","type":"bool"},"argument":"true"}]'
Equivalent MCP tool call (semantic_change_signature)
{
"file": "service.go",
"parameters": "[{\"source_index\":0,\"parameter\":{\"name\":\"id\",\"type\":\"int\"}},{\"parameter\":{\"name\":\"enabled\",\"type\":\"bool\"},\"argument\":\"true\"}]",
"symbol": "transform"
}Structural insertion keeps anchored comments attached to their code
Source: comment_anchors.txtar · Download raw file
Execute: semedit insert –file api/anchors.go –placement before_symbol –target Keep –source ‘func AddedBefore() {}’
CLI invocation
$ semedit insert --file api/anchors.go --placement before_symbol --target Keep --source 'func AddedBefore() {}'
Equivalent MCP tool call (semantic_insert_declaration)
{
"file": "api/anchors.go",
"placement": "before_symbol",
"source": "func AddedBefore() {}",
"target_symbol": "Keep"
}Execute: semedit insert –file api/anchors.go –placement after_symbol –target Target –source ‘func AddedAfter() {}’
CLI invocation
$ semedit insert --file api/anchors.go --placement after_symbol --target Target --source 'func AddedAfter() {}'
Equivalent MCP tool call (semantic_insert_declaration)
{
"file": "api/anchors.go",
"placement": "after_symbol",
"source": "func AddedAfter() {}",
"target_symbol": "Target"
}Execute: semedit insert-case –file api/handler.go –in-function Handle –discriminator value –placement before_default –case ‘case “added”: return “added”’
CLI invocation
$ semedit insert-case --file api/handler.go --in-function Handle --discriminator value --placement before_default --case 'case "added": return "added"'
Equivalent MCP tool call (semantic_insert_case)
{
"case": "case \"added\": return \"added\"",
"discriminator": "value",
"file": "api/handler.go",
"in_function": "Handle",
"placement": "before_default"
}Unified AST transformation diff (api/anchors.go)
package api
+ func AddedBefore() {}
// Keep documentation on Keep.
func Keep() {}
func Target() {} // Keep this trailing comment.
+ func AddedAfter() {}
func Last() {}
Expected output state (api/anchors.go)
package api
func AddedBefore() {}
// Keep documentation on Keep.
func Keep() {}
func Target() {} // Keep this trailing comment.
func AddedAfter() {}
func Last() {}Unified AST transformation diff (api/handler.go)
package api
func Handle(value string) string {
switch value {
case "keep":
return "keep"
+ case "added":
+ return "added"
// Keep this comment on the default case.
default:
return "default"
}
}
Expected output state (api/handler.go)
package api
func Handle(value string) string {
switch value {
case "keep":
return "keep"
case "added":
return "added"
// Keep this comment on the default case.
default:
return "default"
}
}Specific declaration kinds must parse comments while rejecting wrong or multiple declaration forms before writing.
Source: commented_declaration_insert.txtar · Download raw file
Execute: semedit insert-construct –file request.go –kind var –placement after_symbol –target ErrRequest –group standalone –source -
CLI invocation
$ semedit insert-construct --file request.go --kind var --placement after_symbol --target ErrRequest --group standalone --source -
Equivalent MCP tool call (semantic_insert_construct)
{
"file": "request.go",
"group": "standalone",
"kind": "var",
"placement": "after_symbol",
"source": "-",
"target_symbol": "ErrRequest"
}Assert: Successfully inserted var construct
Execute: semedit insert-construct –file request.go –kind const –placement after_symbol –target ErrInvalidRequest –group standalone –source -
CLI invocation
$ semedit insert-construct --file request.go --kind const --placement after_symbol --target ErrInvalidRequest --group standalone --source -
Equivalent MCP tool call (semantic_insert_construct)
{
"file": "request.go",
"group": "standalone",
"kind": "const",
"placement": "after_symbol",
"source": "-",
"target_symbol": "ErrInvalidRequest"
}Assert: Successfully inserted const construct
Execute: semedit insert-construct –file request.go –kind type –placement after_symbol –target Request –source -
CLI invocation
$ semedit insert-construct --file request.go --kind type --placement after_symbol --target Request --source -
Equivalent MCP tool call (semantic_insert_construct)
{
"file": "request.go",
"kind": "type",
"placement": "after_symbol",
"source": "-",
"target_symbol": "Request"
}Assert: Successfully inserted type construct
Execute: exec semedit insert-construct –file request.go –kind var –source -
CLI invocation
$ exec semedit insert-construct --file request.go --kind var --source -
Equivalent MCP tool call (semedit_semedit)
{}Expected error: var insertion requires a var declaration
Execute: exec semedit insert-construct –file request.go –kind var –source -
CLI invocation
$ exec semedit insert-construct --file request.go --kind var --source -
Equivalent MCP tool call (semedit_semedit)
{}Expected error: var insertion requires exactly one var declaration
Structural type and function insertions reject duplicates and unsupported overwrites without changing source.
Source: construct_collisions.txtar · Download raw file
Execute: exec semedit insert-construct –file api/model.go –kind type –source ’type Config struct { Port int }’
CLI invocation
$ exec semedit insert-construct --file api/model.go --kind type --source 'type Config struct { Port int }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: Config.*already exists
Execute: exec semedit insert-construct –file api/model.go –kind type –overwrite –source ’type Config struct { Port int }’
CLI invocation
$ exec semedit insert-construct --file api/model.go --kind type --overwrite --source 'type Config struct { Port int }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: unknown flag.*overwrite
Execute: exec semedit insert-construct –file api/model.go –kind function –source ‘func Load() string { return “new” }’
CLI invocation
$ exec semedit insert-construct --file api/model.go --kind function --source 'func Load() string { return "new" }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: Load.*already exists
Execute: exec semedit insert-construct –file api/model.go –kind method –source ‘func (w *Widget) Name() string { return “new” }’
CLI invocation
$ exec semedit insert-construct --file api/model.go --kind method --source 'func (w *Widget) Name() string { return "new" }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: method Widget.Name already exists
Whole named declarations replace by symbol without an enclosing function.
Source: construct_declaration_replacements.txtar · Download raw file
Execute: semedit replace-construct –file declarations.go –kind function –symbol Convert –source ‘func Convert(text string) string { return text }’
CLI invocation
$ semedit replace-construct --file declarations.go --kind function --symbol Convert --source 'func Convert(text string) string { return text }'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "declarations.go",
"kind": "function",
"source": "func Convert(text string) string { return text }",
"symbol": "Convert"
}Execute: semedit replace-construct –file declarations.go –kind type –symbol Config –source ’type Config struct { Port int }’
CLI invocation
$ semedit replace-construct --file declarations.go --kind type --symbol Config --source 'type Config struct { Port int }'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "declarations.go",
"kind": "type",
"source": "type Config struct { Port int }",
"symbol": "Config"
}Execute: semedit replace-construct –file declarations.go –kind const –symbol Limit –source ‘const Limit = 20’
CLI invocation
$ semedit replace-construct --file declarations.go --kind const --symbol Limit --source 'const Limit = 20'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "declarations.go",
"kind": "const",
"source": "const Limit = 20",
"symbol": "Limit"
}Execute: semedit replace-construct –file declarations.go –kind var –symbol Revision –source ‘var Revision = 2’
CLI invocation
$ semedit replace-construct --file declarations.go --kind var --symbol Revision --source 'var Revision = 2'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "declarations.go",
"kind": "var",
"source": "var Revision = 2",
"symbol": "Revision"
}Execute: semedit replace-construct –file declarations.go –kind method –symbol dnsBuilder.Build –source ‘func (b *dnsBuilder) Build(target string, secure bool) (string, error) { return target, nil }’
CLI invocation
$ semedit replace-construct --file declarations.go --kind method --symbol dnsBuilder.Build --source 'func (b *dnsBuilder) Build(target string, secure bool) (string, error) { return target, nil }'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "declarations.go",
"kind": "method",
"source": "func (b *dnsBuilder) Build(target string, secure bool) (string, error) { return target, nil }",
"symbol": "dnsBuilder.Build"
}Execute: semedit replace-construct –file declarations.go –kind method –symbol ‘(*dnsBuilder).Build’ –source ‘func (b *dnsBuilder) Build(target string, secure bool) (string, error) { if secure { return target, nil }; return “”, nil }’
CLI invocation
$ semedit replace-construct --file declarations.go --kind method --symbol '(*dnsBuilder).Build' --source 'func (b *dnsBuilder) Build(target string, secure bool) (string, error) { if secure { return target, nil }; return "", nil }'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "declarations.go",
"kind": "method",
"source": "func (b *dnsBuilder) Build(target string, secure bool) (string, error) { if secure { return target, nil }; return \"\", nil }",
"symbol": "(*dnsBuilder).Build"
}Execute: exec semedit replace-construct –file declarations.go –kind type –symbol Config –source ’type Other struct { Host string }’
CLI invocation
$ exec semedit replace-construct --file declarations.go --kind type --symbol Config --source 'type Other struct { Host string }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: name|identity|Config
Execute: exec semedit replace-construct –file declarations.go –kind method –symbol dnsBuilder.Build –source ‘func (b *otherBuilder) Build(target string, secure bool) (string, error) { return target, nil }’
CLI invocation
$ exec semedit replace-construct --file declarations.go --kind method --symbol dnsBuilder.Build --source 'func (b *otherBuilder) Build(target string, secure bool) (string, error) { return target, nil }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: receiver.*dnsBuilder
Execute: exec semedit replace-construct –file declarations.go –kind method –symbol dnsBuilder.Build –source ‘func (b *dnsBuilder) Resolve(target string, secure bool) (string, error) { return target, nil }’
CLI invocation
$ exec semedit replace-construct --file declarations.go --kind method --symbol dnsBuilder.Build --source 'func (b *dnsBuilder) Resolve(target string, secure bool) (string, error) { return target, nil }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: preserve.*method.*dnsBuilder.Build
Execute: exec semedit replace-construct –file declarations.go –kind method –symbol dnsBuilder.Build –source ‘func (b dnsBuilder) Build(target string, secure bool) (string, error) { return target, nil }’
CLI invocation
$ exec semedit replace-construct --file declarations.go --kind method --symbol dnsBuilder.Build --source 'func (b dnsBuilder) Build(target string, secure bool) (string, error) { return target, nil }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: receiver syntax
Generic construct insertion adds one field and refuses an existing field name.
Source: construct_field_insertion.txtar · Download raw file
Execute: semedit insert-construct –file model.go –kind field –in-type config –source ‘Port int’ –placement type_end
CLI invocation
$ semedit insert-construct --file model.go --kind field --in-type config --source 'Port int' --placement type_end
Equivalent MCP tool call (semantic_insert_construct)
{
"file": "model.go",
"in_type": "config",
"kind": "field",
"placement": "type_end",
"source": "Port int"
}Assert: Successfully inserted field construct
Execute: exec semedit insert-construct –file model.go –kind field –in-type config –source ‘Port string’ –placement type_end
CLI invocation
$ exec semedit insert-construct --file model.go --kind field --in-type config --source 'Port string' --placement type_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: already exists|collision
Execute: exec semedit insert-construct –file model.go –kind field –in-type Config –source ‘Port int’ –placement type_end
CLI invocation
$ exec semedit insert-construct --file model.go --kind field --in-type Config --source 'Port int' --placement type_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: cannot prove positional-literal compatibility for exported owner
Execute: exec semedit insert-construct –file model.go –kind field –in-type config –source ‘Hidden int’ –access private
CLI invocation
$ exec semedit insert-construct --file model.go --kind field --in-type config --source 'Hidden int' --access private
Equivalent MCP tool call (semedit_semedit)
{}Expected error: private|unexported
Execute: semedit insert-construct –file model.go –kind field –in-type config –source ‘Ready bool’ –placement type_start –access public
CLI invocation
$ semedit insert-construct --file model.go --kind field --in-type config --source 'Ready bool' --placement type_start --access public
Equivalent MCP tool call (semantic_insert_construct)
{
"access_modifier": "public",
"file": "model.go",
"in_type": "config",
"kind": "field",
"placement": "type_start",
"source": "Ready bool"
}Unified AST transformation diff
package model
type config struct {
+ Ready bool
Host string
+ Port int
}
type Config struct{}
Expected output state (model.go)
package model
type config struct {
Ready bool
Host string
Port int
}
type Config struct{}Function replacement accepts receiver-bearing source while preserving the selected method and receiver syntax.
Source: construct_function_method_compatibility.txtar · Download raw file
Execute: semedit replace-construct –file request.go –kind function –symbol Request.Validate –source ‘func (r *Request) Validate() string { return “qualified” }’
CLI invocation
$ semedit replace-construct --file request.go --kind function --symbol Request.Validate --source 'func (r *Request) Validate() string { return "qualified" }'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "request.go",
"kind": "function",
"source": "func (r *Request) Validate() string { return \"qualified\" }",
"symbol": "Request.Validate"
}Execute: semedit replace-construct –file request.go –kind function –symbol Validate –source ‘func (r *Request) Validate() string { return “unqualified” }’
CLI invocation
$ semedit replace-construct --file request.go --kind function --symbol Validate --source 'func (r *Request) Validate() string { return "unqualified" }'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "request.go",
"kind": "function",
"source": "func (r *Request) Validate() string { return \"unqualified\" }",
"symbol": "Validate"
}Execute: exec semedit replace-construct –file request.go –kind function –symbol Request.Validate –source ‘func (r *Other) Validate() string { return “wrong” }’
CLI invocation
$ exec semedit replace-construct --file request.go --kind function --symbol Request.Validate --source 'func (r *Other) Validate() string { return "wrong" }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: receiver.*Request
Execute: exec semedit replace-construct –file request.go –kind function –symbol Request.Validate –source ‘func (r Request) Validate() string { return “value” }’
CLI invocation
$ exec semedit replace-construct --file request.go --kind function --symbol Request.Validate --source 'func (r Request) Validate() string { return "value" }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: receiver syntax
Execute: exec semedit replace-construct –file request.go –kind function –symbol Request.Validate –source ‘func Validate() string { return “lost receiver” }’
CLI invocation
$ exec semedit replace-construct --file request.go --kind function --symbol Request.Validate --source 'func Validate() string { return "lost receiver" }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: receiver.*Request
Execute: exec semedit replace-construct –file request.go –kind method –symbol Validate –source ‘func (r *Request) Validate() string { return “unqualified method” }’
CLI invocation
$ exec semedit replace-construct --file request.go --kind method --symbol Validate --source 'func (r *Request) Validate() string { return "unqualified method" }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: receiver
Execute: exec semedit replace-construct –file request.go –kind method –symbol Request.Validate –source ‘func Validate() string { return “lost receiver” }’
CLI invocation
$ exec semedit replace-construct --file request.go --kind method --symbol Request.Validate --source 'func Validate() string { return "lost receiver" }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: preserve.*method
Execute: semedit replace-construct –file request.go –kind method –symbol ‘(*Request).Validate’ –source ‘func (r *Request) Validate() string { return “method” }’
CLI invocation
$ semedit replace-construct --file request.go --kind method --symbol '(*Request).Validate' --source 'func (r *Request) Validate() string { return "method" }'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "request.go",
"kind": "method",
"source": "func (r *Request) Validate() string { return \"method\" }",
"symbol": "(*Request).Validate"
}Rejected insertion must preserve source through direct CLI and MCP batch publication.
Source: construct_import_preflight.txtar · Download raw file
Execute: exec semedit insert-construct –file audit/normalize.go –kind declaration –source ‘import “strings”’
CLI invocation
$ exec semedit insert-construct --file audit/normalize.go --kind declaration --source 'import "strings"'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: imports must appear before other declarations
Execute: exec semedit insert-construct –file audit/normalize.go –kind declaration –source ‘import “strings”’ –auto-organize-imports=false
CLI invocation
$ exec semedit insert-construct --file audit/normalize.go --kind declaration --source 'import "strings"' --auto-organize-imports=false
Equivalent MCP tool call (semedit_semedit)
{}Expected error: imports must appear before other declarations
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: imports must appear before other declarations
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: imports must appear before other declarations
Inspect a concrete candidate, copy its opaque selection revision and path into replacement, and verify the selected write.
Source: construct_inspection.txtar · Download raw file
Execute: semedit inspect-construct –file api/sample.go –in-function Check –kind if –discriminator ready
CLI invocation
$ semedit inspect-construct --file api/sample.go --in-function Check --kind if --discriminator ready
Equivalent MCP tool call (semantic_inspect_construct)
{
"discriminator": "ready",
"file": "api/sample.go",
"in_function": "Check",
"kind": "if"
}Assert: construct_path": “0
Assert: expected_selection_revision”: “c950c86b12ee00875c2b2320365ce498ef2049cf70e5f8d69ae828cfd15a05d5
Execute: semedit replace-construct –file api/sample.go –in-function Check –kind if –discriminator ready –construct-path 0 –expected-selection-revision c950c86b12ee00875c2b2320365ce498ef2049cf70e5f8d69ae828cfd15a05d5 –source ‘if ready { use(2) }’
CLI invocation
$ semedit replace-construct --file api/sample.go --in-function Check --kind if --discriminator ready --construct-path 0 --expected-selection-revision c950c86b12ee00875c2b2320365ce498ef2049cf70e5f8d69ae828cfd15a05d5 --source 'if ready { use(2) }'
Equivalent MCP tool call (semantic_replace_construct)
{
"construct_path": "0",
"discriminator": "ready",
"expected_selection_revision": "c950c86b12ee00875c2b2320365ce498ef2049cf70e5f8d69ae828cfd15a05d5",
"file": "api/sample.go",
"in_function": "Check",
"kind": "if",
"source": "if ready { use(2) }"
}Unified AST transformation diff
- use(1)
package sample
func Check() {
if ready {
+ use(2)
}
}
Expected output state (api/sample.go)
package sample
func Check() {
if ready {
use(2)
}
}The batch read sees the prior buffered mutation; a stale optional guard returns that current choice and stops later edits.
Source: construct_inspection_mcp_batch.txtar · Download raw file
Execute: semedit inspect-construct –file api/sample.go –in-function Check –kind if –discriminator ready
CLI invocation
$ semedit inspect-construct --file api/sample.go --in-function Check --kind if --discriminator ready
Equivalent MCP tool call (semantic_inspect_construct)
{
"discriminator": "ready",
"file": "api/sample.go",
"in_function": "Check",
"kind": "if"
}Assert: expected_selection_revision”: “c950c86b12ee00875c2b2320365ce498ef2049cf70e5f8d69ae828cfd15a05d5
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: selection_revision_mismatch
Assert: application_state”:\s*“not_applied
Assert: file”:\s*“api/sample.go
Assert: in_function”:\s*“Check
Assert: kind”:\s*“if
Assert: discriminator”:\s*“ready
Assert: candidates
Assert: expected_selection_revision
Assert: construct_path
Assert: use(2)
Unified AST transformation diff
- use(1)
package sample
func Check() {
if ready {
+ use(2)
}
}
Expected output state (api/sample.go)
package sample
func Check() {
if ready {
use(2)
}
}Retired insertion command names have no compatibility aliases.
Source: construct_old_commands_rejected.txtar · Download raw file
Execute: exec semedit insert-structure –help
CLI invocation
$ exec semedit insert-structure --help
Equivalent MCP tool call (semedit_semedit)
{}Expected error: unknown command
Execute: exec semedit insert-statement –help
CLI invocation
$ exec semedit insert-statement --help
Equivalent MCP tool call (semedit_semedit)
{}Expected error: unknown command
Structural overwrite requests fail through the public MCP tool without changing source.
Source: construct_overwrite_rejected_mcp.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: supported keys
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: supported keys
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: construct_path.*non-empty string
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: expected_revision.*non-empty string
Replace selected constructs and declarations; insertion collisions fail closed.
Source: construct_replacements.txtar · Download raw file
Execute: exec semedit replace-construct –file api/messages_test.go –in-function TestMessages –kind else –discriminator ’len(original) == 0’ –source ‘if condition {}’
CLI invocation
$ exec semedit replace-construct --file api/messages_test.go --in-function TestMessages --kind else --discriminator 'len(original) == 0' --source 'if condition {}'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: replacement must be one complete Go else construct
Execute: exec semedit insert-decl –file api/settings.go –source ‘var Revision = 2’
CLI invocation
$ exec semedit insert-decl --file api/settings.go --source 'var Revision = 2'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: Revision.*already exists
Execute: exec semedit insert-decl –file api/settings.go –overwrite –source ‘var Revision = 2’
CLI invocation
$ exec semedit insert-decl --file api/settings.go --overwrite --source 'var Revision = 2'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: unknown flag.*overwrite
Execute: semedit replace-construct –file api/settings.go –kind var –symbol Revision –source ‘var Revision = 2’
CLI invocation
$ semedit replace-construct --file api/settings.go --kind var --symbol Revision --source 'var Revision = 2'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "api/settings.go",
"kind": "var",
"source": "var Revision = 2",
"symbol": "Revision"
}Execute: semedit replace-construct –file api/settings.go –kind const –symbol DefaultLimit –source ‘const DefaultLimit = 10’
CLI invocation
$ semedit replace-construct --file api/settings.go --kind const --symbol DefaultLimit --source 'const DefaultLimit = 10'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "api/settings.go",
"kind": "const",
"source": "const DefaultLimit = 10",
"symbol": "DefaultLimit"
}Execute: exec semedit replace-construct –file api/messages_test.go –in-function TestMessages –kind loop –discriminator want –source ‘for _, want := range []string{“alpha”}’
CLI invocation
$ exec semedit replace-construct --file api/messages_test.go --in-function TestMessages --kind loop --discriminator want --source 'for _, want := range []string{"alpha"}'
Equivalent MCP tool call (semedit_semedit)
{}Execute: semedit replace-construct –file api/messages_test.go –in-function TestMessages –kind loop –discriminator want –source ‘for _, want := range []string{“alpha”, “beta”} { if want == "” { t.Fatal(want) } }’
CLI invocation
$ semedit replace-construct --file api/messages_test.go --in-function TestMessages --kind loop --discriminator want --source 'for _, want := range []string{"alpha", "beta"} { if want == "" { t.Fatal(want) } }'
Equivalent MCP tool call (semantic_replace_construct)
{
"discriminator": "want",
"file": "api/messages_test.go",
"in_function": "TestMessages",
"kind": "loop",
"source": "for _, want := range []string{\"alpha\", \"beta\"} { if want == \"\" { t.Fatal(want) } }"
}Execute: exec semedit replace-construct –file api/loops_test.go –in-function TestAmbiguousLoops –kind loop –discriminator item –source ‘for _, item := range []string{“chosen”} { t.Log(item) }’
CLI invocation
$ exec semedit replace-construct --file api/loops_test.go --in-function TestAmbiguousLoops --kind loop --discriminator item --source 'for _, item := range []string{"chosen"} { t.Log(item) }'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: ambiguous loop
Execute: semedit replace-construct –file api/loops_test.go –in-function TestAmbiguousLoops –kind loop –discriminator item –construct-path 0 –source ‘for _, item := range []string{“chosen”} { t.Log(item) }’
CLI invocation
$ semedit replace-construct --file api/loops_test.go --in-function TestAmbiguousLoops --kind loop --discriminator item --construct-path 0 --source 'for _, item := range []string{"chosen"} { t.Log(item) }'
Equivalent MCP tool call (semantic_replace_construct)
{
"construct_path": "0",
"discriminator": "item",
"file": "api/loops_test.go",
"in_function": "TestAmbiguousLoops",
"kind": "loop",
"source": "for _, item := range []string{\"chosen\"} { t.Log(item) }"
}Execute: semedit replace-construct –file api/messages_test.go –in-function TestMessages –kind if –discriminator ’len(original) == 0’ –source ‘if len(original) > 0 { t.Log(“present”) } else { t.Log(“fallback”) }’
CLI invocation
$ semedit replace-construct --file api/messages_test.go --in-function TestMessages --kind if --discriminator 'len(original) == 0' --source 'if len(original) > 0 { t.Log("present") } else { t.Log("fallback") }'
Equivalent MCP tool call (semantic_replace_construct)
{
"discriminator": "len(original) == 0",
"file": "api/messages_test.go",
"in_function": "TestMessages",
"kind": "if",
"source": "if len(original) \u003e 0 { t.Log(\"present\") } else { t.Log(\"fallback\") }"
}Execute: semedit replace-construct –file api/messages_test.go –in-function TestMessages –kind else –discriminator ’len(original) > 0’ –source ‘{ t.Fatal(“fallback”) }’
CLI invocation
$ semedit replace-construct --file api/messages_test.go --in-function TestMessages --kind else --discriminator 'len(original) > 0' --source '{ t.Fatal("fallback") }'
Equivalent MCP tool call (semantic_replace_construct)
{
"discriminator": "len(original) \u003e 0",
"file": "api/messages_test.go",
"in_function": "TestMessages",
"kind": "else",
"source": "{ t.Fatal(\"fallback\") }"
}Unified AST transformation diff (api/loops_test.go)
package api
import "testing"
func TestAmbiguousLoops(t *testing.T) {
for _, item := range []string{"first"} {
t.Log(item)
}
for _, item := range []string{"second"} {
t.Log(item)
}
}
Expected output state (api/loops_test.go)
package api
import "testing"
func TestAmbiguousLoops(t *testing.T) {
for _, item := range []string{"first"} {
t.Log(item)
}
for _, item := range []string{"second"} {
t.Log(item)
}
}Unified AST transformation diff (api/loops_test.go)
- for _, item := range []string{"first"} {
package api
import "testing"
func TestAmbiguousLoops(t *testing.T) {
+ for _, item := range []string{"chosen"} {
t.Log(item)
}
for _, item := range []string{"second"} {
t.Log(item)
}
}
Expected output state (api/loops_test.go)
package api
import "testing"
func TestAmbiguousLoops(t *testing.T) {
for _, item := range []string{"chosen"} {
t.Log(item)
}
for _, item := range []string{"second"} {
t.Log(item)
}
}Unified AST transformation diff (api/messages_test.go)
package api
import "testing"
func TestMessages(t *testing.T) {
original := []string{"old"}
if len(original) == 0 {
t.Fatal("missing originals")
} else {
t.Log("fallback")
}
for _, want := range original {
if want == "" {
t.Fatal(want)
}
}
}
Expected output state (api/messages_test.go)
package api
import "testing"
func TestMessages(t *testing.T) {
original := []string{"old"}
if len(original) == 0 {
t.Fatal("missing originals")
} else {
t.Log("fallback")
}
for _, want := range original {
if want == "" {
t.Fatal(want)
}
}
}Unified AST transformation diff (api/messages_test.go)
- if len(original) == 0 {
- t.Fatal("missing originals")
- t.Log("fallback")
- for _, want := range original {
package api
import "testing"
func TestMessages(t *testing.T) {
original := []string{"old"}
+ if len(original) > 0 {
+ t.Log("present")
} else {
+ t.Fatal("fallback")
}
+ for _, want := range []string{"alpha", "beta"} {
if want == "" {
t.Fatal(want)
}
}
}
Expected output state (api/messages_test.go)
package api
import "testing"
func TestMessages(t *testing.T) {
original := []string{"old"}
if len(original) > 0 {
t.Log("present")
} else {
t.Fatal("fallback")
}
for _, want := range []string{"alpha", "beta"} {
if want == "" {
t.Fatal(want)
}
}
}Unified AST transformation diff (api/settings.go)
- const DefaultLimit = 5
- var Revision = 1
package api
+ const DefaultLimit = 10
+ var Revision = 2
Expected output state (api/settings.go)
package api
const DefaultLimit = 10
var Revision = 2Unified AST transformation diff (api/settings.go)
package api
const DefaultLimit = 5
var Revision = 1
Expected output state (api/settings.go)
package api
const DefaultLimit = 5
var Revision = 1Exercise generic construct replacements through MCP semantic_batch.
Source: construct_replacements_mcp_batch.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: status":“ok
Unified AST transformation diff (api/messages_test.go)
- for _, want := range original {
package api
import "testing"
func TestMessages(t *testing.T) {
original := []string{"old"}
if len(original) == 0 {
t.Fatal("missing originals")
}
+ for _, want := range []string{"alpha", "beta"} {
if want == "" {
t.Fatal(want)
}
}
}
Expected output state (api/messages_test.go)
package api
import "testing"
func TestMessages(t *testing.T) {
original := []string{"old"}
if len(original) == 0 {
t.Fatal("missing originals")
}
for _, want := range []string{"alpha", "beta"} {
if want == "" {
t.Fatal(want)
}
}
}Unified AST transformation diff (api/settings.go)
- const DefaultLimit = 5
- var Revision = 1
package api
+ const DefaultLimit = 10
+ var Revision = 2
Expected output state (api/settings.go)
package api
const DefaultLimit = 10
var Revision = 2Generic replacement targets expression slots and whole statements by explicit selectors.
Source: construct_statement_expression_replacements.txtar · Download raw file
Execute: semedit replace-construct –file values.go –kind statement/expression –in-function Values –discriminator ‘1’ –source ‘3’
CLI invocation
$ semedit replace-construct --file values.go --kind statement/expression --in-function Values --discriminator '1' --source '3'
Equivalent MCP tool call (semantic_replace_construct)
{
"discriminator": "1",
"file": "values.go",
"in_function": "Values",
"kind": "statement/expression",
"source": "3"
}Execute: semedit replace-construct –file values.go –kind statement/expression –in-function Values –discriminator ‘value > 0’ –source ‘value > 2’
CLI invocation
$ semedit replace-construct --file values.go --kind statement/expression --in-function Values --discriminator 'value > 0' --source 'value > 2'
Equivalent MCP tool call (semantic_replace_construct)
{
"discriminator": "value \u003e 0",
"file": "values.go",
"in_function": "Values",
"kind": "statement/expression",
"source": "value \u003e 2"
}Execute: semedit replace-construct –file values.go –kind statement/expression –in-function Values –discriminator ‘return 2’ –source ‘if value > 0 { return 5 }’
CLI invocation
$ semedit replace-construct --file values.go --kind statement/expression --in-function Values --discriminator 'return 2' --source 'if value > 0 { return 5 }'
Equivalent MCP tool call (semantic_replace_construct)
{
"discriminator": "return 2",
"file": "values.go",
"in_function": "Values",
"kind": "statement/expression",
"source": "if value \u003e 0 { return 5 }"
}Execute: exec semedit replace-construct –file values.go –kind statement/expression –in-function Repeated –discriminator ‘1’ –source ‘9’
CLI invocation
$ exec semedit replace-construct --file values.go --kind statement/expression --in-function Repeated --discriminator '1' --source '9'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: ambiguous.*construct_path
Execute: semedit replace-construct –file values.go –kind statement/expression –in-function Repeated –discriminator ‘1’ –construct-path 1.e0 –source ‘9’
CLI invocation
$ semedit replace-construct --file values.go --kind statement/expression --in-function Repeated --discriminator '1' --construct-path 1.e0 --source '9'
Equivalent MCP tool call (semantic_replace_construct)
{
"construct_path": "1.e0",
"discriminator": "1",
"file": "values.go",
"in_function": "Repeated",
"kind": "statement/expression",
"source": "9"
}Execute: exec semedit replace-construct –file values.go –kind statement/expression –in-function Shared –discriminator ‘callValue()’ –source ‘return’
CLI invocation
$ exec semedit replace-construct --file values.go --kind statement/expression --in-function Shared --discriminator 'callValue()' --source 'return'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: ambiguous.*construct_path
Execute: semedit replace-construct –file values.go –kind statement/expression –in-function Shared –discriminator ‘callValue()’ –construct-path 0.e0 –source ‘recordValue()’
CLI invocation
$ semedit replace-construct --file values.go --kind statement/expression --in-function Shared --discriminator 'callValue()' --construct-path 0.e0 --source 'recordValue()'
Equivalent MCP tool call (semantic_replace_construct)
{
"construct_path": "0.e0",
"discriminator": "callValue()",
"file": "values.go",
"in_function": "Shared",
"kind": "statement/expression",
"source": "recordValue()"
}Execute: semedit replace-construct –file values.go –kind statement/expression –in-function Index –discriminator ‘items[17]’ –source ‘items[18]’
CLI invocation
$ semedit replace-construct --file values.go --kind statement/expression --in-function Index --discriminator 'items[17]' --source 'items[18]'
Equivalent MCP tool call (semantic_replace_construct)
{
"discriminator": "items[17]",
"file": "values.go",
"in_function": "Index",
"kind": "statement/expression",
"source": "items[18]"
}Execute: semedit replace-construct –file values.go –kind statement/expression –in-function RuntimeNew –discriminator ’new(value)’ –source ’new(value + 1)’
CLI invocation
$ semedit replace-construct --file values.go --kind statement/expression --in-function RuntimeNew --discriminator 'new(value)' --source 'new(value + 1)'
Equivalent MCP tool call (semantic_replace_construct)
{
"discriminator": "new(value)",
"file": "values.go",
"in_function": "RuntimeNew",
"kind": "statement/expression",
"source": "new(value + 1)"
}Execute: exec semedit replace-construct –file values.go –kind statement/expression –in-function Values –discriminator ‘3’ –source ‘if (’
CLI invocation
$ exec semedit replace-construct --file values.go --kind statement/expression --in-function Values --discriminator '3' --source 'if ('
Equivalent MCP tool call (semedit_semedit)
{}Expected error: syntax|expression
Execute: exec semedit replace-construct –file values.go –kind statement/expression –in-function Injection –discriminator ‘1’ –source ‘2); injected()’
CLI invocation
$ exec semedit replace-construct --file values.go --kind statement/expression --in-function Injection --discriminator '1' --source '2); injected()'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: syntax|expression
Execute: exec semedit replace-construct –file values.go –kind statement/expression –in-function TypeOnly –discriminator int –source string
CLI invocation
$ exec semedit replace-construct --file values.go --kind statement/expression --in-function TypeOnly --discriminator int --source string
Equivalent MCP tool call (semedit_semedit)
{}Expected error: not found|match
Execute: exec semedit replace-construct –file values.go –kind statement/expression –in-function ParenthesizedMake –discriminator ‘[]int’ –source ‘[]string’
CLI invocation
$ exec semedit replace-construct --file values.go --kind statement/expression --in-function ParenthesizedMake --discriminator '[]int' --source '[]string'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: not found|match
Execute: exec semedit replace-construct –file values.go –kind statement/expression –in-function ParenthesizedNew –discriminator int –source string
CLI invocation
$ exec semedit replace-construct --file values.go --kind statement/expression --in-function ParenthesizedNew --discriminator int --source string
Equivalent MCP tool call (semedit_semedit)
{}Expected error: not found|match
Execute: exec semedit replace-construct –file values.go –kind statement/expression –in-function Commented –discriminator ‘old()’ –construct-path 0 –source ’next() // keep this trailing comment’
CLI invocation
$ exec semedit replace-construct --file values.go --kind statement/expression --in-function Commented --discriminator 'old()' --construct-path 0 --source 'next() // keep this trailing comment'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: comment|trailing
Insert around unique direct statement anchors with no expression round trip.
Source: construct_statement_insertion.txtar · Download raw file
Repeated anchors bind both the candidate path and exact file revision. Unique direct statement anchors need no candidate path or revision. Repeated direct statement anchors require a candidate path.
Execute: exec semedit insert-construct –file server.go –kind statement/expression –in-function Two –discriminator ‘flush()’ –source ‘record()’ –anchor after
CLI invocation
$ exec semedit insert-construct --file server.go --kind statement/expression --in-function Two --discriminator 'flush()' --source 'record()' --anchor after
Equivalent MCP tool call (semedit_semedit)
{}Expected error: ambiguous.*expected_revision
Execute: exec semedit insert-construct –file server.go –kind statement/expression –in-function Two –discriminator ‘flush()’ –construct-path 0 –source ‘record()’ –anchor after
CLI invocation
$ exec semedit insert-construct --file server.go --kind statement/expression --in-function Two --discriminator 'flush()' --construct-path 0 --source 'record()' --anchor after
Equivalent MCP tool call (semedit_semedit)
{}Expected error: expected_revision
Execute: exec semedit insert-construct –file server.go –kind statement/expression –in-function Two –discriminator ‘flush()’ –construct-path 0 –expected-revision stale –source ‘record()’ –anchor after
CLI invocation
$ exec semedit insert-construct --file server.go --kind statement/expression --in-function Two --discriminator 'flush()' --construct-path 0 --expected-revision stale --source 'record()' --anchor after
Equivalent MCP tool call (semedit_semedit)
{}Expected error: revision
Execute: semedit insert-construct –file server.go –kind statement/expression –in-function Two –discriminator ‘flush()’ –construct-path 0 –expected-revision 90761e0366f5d16fe48024fe40827de492f5eae767e189b59e6829c99dc7ad8d –source ‘record()’ –anchor after
CLI invocation
$ semedit insert-construct --file server.go --kind statement/expression --in-function Two --discriminator 'flush()' --construct-path 0 --expected-revision 90761e0366f5d16fe48024fe40827de492f5eae767e189b59e6829c99dc7ad8d --source 'record()' --anchor after
Equivalent MCP tool call (semantic_insert_construct)
{
"anchor": "after",
"construct_path": "0",
"discriminator": "flush()",
"expected_revision": "90761e0366f5d16fe48024fe40827de492f5eae767e189b59e6829c99dc7ad8d",
"file": "server.go",
"in_function": "Two",
"kind": "statement/expression",
"source": "record()"
}Execute: semedit insert-construct –file server.go –kind statement/expression –in-function ‘(*Server).Run’ –discriminator ‘flush()’ –source ‘record()’ –anchor before
CLI invocation
$ semedit insert-construct --file server.go --kind statement/expression --in-function '(*Server).Run' --discriminator 'flush()' --source 'record()' --anchor before
Equivalent MCP tool call (semantic_insert_construct)
{
"anchor": "before",
"discriminator": "flush()",
"file": "server.go",
"in_function": "(*Server).Run",
"kind": "statement/expression",
"source": "record()"
}Execute: semedit insert-construct –file server.go –kind statement/expression –in-function ‘(*Server).Run’ –anchor start –source ‘firstRecord()’
CLI invocation
$ semedit insert-construct --file server.go --kind statement/expression --in-function '(*Server).Run' --anchor start --source 'firstRecord()'
Equivalent MCP tool call (semantic_insert_construct)
{
"anchor": "start",
"file": "server.go",
"in_function": "(*Server).Run",
"kind": "statement/expression",
"source": "firstRecord()"
}Execute: semedit insert-construct –file server.go –kind statement/expression –in-function ‘(*Server).Run’ –anchor end –source ’lastRecord()’
CLI invocation
$ semedit insert-construct --file server.go --kind statement/expression --in-function '(*Server).Run' --anchor end --source 'lastRecord()'
Equivalent MCP tool call (semantic_insert_construct)
{
"anchor": "end",
"file": "server.go",
"in_function": "(*Server).Run",
"kind": "statement/expression",
"source": "lastRecord()"
}Execute: semedit insert-construct –file server.go –kind statement/expression –in-function ‘(*Server).Run’ –anchor before_return –source ‘returnRecord()’
CLI invocation
$ semedit insert-construct --file server.go --kind statement/expression --in-function '(*Server).Run' --anchor before_return --source 'returnRecord()'
Equivalent MCP tool call (semantic_insert_construct)
{
"anchor": "before_return",
"file": "server.go",
"in_function": "(*Server).Run",
"kind": "statement/expression",
"source": "returnRecord()"
}Execute: semedit insert-construct –file server.go –kind statement/expression –in-function ‘(*Server).Run’ –discriminator ‘flush()’ –source ‘afterFlush()’ –anchor after
CLI invocation
$ semedit insert-construct --file server.go --kind statement/expression --in-function '(*Server).Run' --discriminator 'flush()' --source 'afterFlush()' --anchor after
Equivalent MCP tool call (semantic_insert_construct)
{
"anchor": "after",
"discriminator": "flush()",
"file": "server.go",
"in_function": "(*Server).Run",
"kind": "statement/expression",
"source": "afterFlush()"
}Execute: exec semedit insert-construct –file server.go –kind statement/expression –in-function Two –discriminator ‘flush()’ –source ‘record()’ –anchor after
CLI invocation
$ exec semedit insert-construct --file server.go --kind statement/expression --in-function Two --discriminator 'flush()' --source 'record()' --anchor after
Equivalent MCP tool call (semedit_semedit)
{}Expected error: ambiguous|matches 2
Execute: semedit insert-construct –file server.go –kind statement/expression –in-function Shared –discriminator ‘first()’ –source ‘record()’ –anchor after
CLI invocation
$ semedit insert-construct --file server.go --kind statement/expression --in-function Shared --discriminator 'first()' --source 'record()' --anchor after
Equivalent MCP tool call (semantic_insert_construct)
{
"anchor": "after",
"discriminator": "first()",
"file": "server.go",
"in_function": "Shared",
"kind": "statement/expression",
"source": "record()"
}Execute: exec semedit insert-construct –file server.go –kind statement/expression –in-function ‘(*Server).Run’ –discriminator ‘flush()’ –source ‘if (’ –anchor before
CLI invocation
$ exec semedit insert-construct --file server.go --kind statement/expression --in-function '(*Server).Run' --discriminator 'flush()' --source 'if (' --anchor before
Equivalent MCP tool call (semedit_semedit)
{}Expected error: syntax|statement
Generic removal deletes direct statements and refuses expression-only targets.
Source: construct_statement_removal.txtar · Download raw file
Execute: semedit remove-construct –file cleanup.go –kind statement/expression –in-function Clean –discriminator ‘obsolete()’
CLI invocation
$ semedit remove-construct --file cleanup.go --kind statement/expression --in-function Clean --discriminator 'obsolete()'
Equivalent MCP tool call (semantic_remove_construct)
{
"discriminator": "obsolete()",
"file": "cleanup.go",
"in_function": "Clean",
"kind": "statement/expression"
}Execute: exec semedit remove-construct –file cleanup.go –kind statement/expression –in-function Clean –discriminator ‘7’
CLI invocation
$ exec semedit remove-construct --file cleanup.go --kind statement/expression --in-function Clean --discriminator '7'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: statement|remove
Accept common kind synonyms and infer method replacement from the receiver selector.
Source: construct_synonyms.txtar · Download raw file
Execute: semedit insert-construct –file api/server.go –kind variable –source ‘var CacheHits int’
CLI invocation
$ semedit insert-construct --file api/server.go --kind variable --source 'var CacheHits int'
Equivalent MCP tool call (semantic_insert_construct)
{
"file": "api/server.go",
"kind": "variable",
"source": "var CacheHits int"
}Assert: Successfully inserted var construct
Execute: semedit replace-construct –file api/server.go –kind procedure –symbol Normalize –source ‘func Normalize(value string) string { return value }’
CLI invocation
$ semedit replace-construct --file api/server.go --kind procedure --symbol Normalize --source 'func Normalize(value string) string { return value }'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "api/server.go",
"kind": "procedure",
"source": "func Normalize(value string) string { return value }",
"symbol": "Normalize"
}Assert: Replaced function construct
Execute: semedit replace-construct –file api/server.go –kind function –symbol ‘(*Server).Start’ –source ‘func (s *Server) Start() { s.running = true }’
CLI invocation
$ semedit replace-construct --file api/server.go --kind function --symbol '(*Server).Start' --source 'func (s *Server) Start() { s.running = true }'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "api/server.go",
"kind": "function",
"source": "func (s *Server) Start() { s.running = true }",
"symbol": "(*Server).Start"
}Assert: Replaced method construct
Execute: semedit replace-construct –file api/server.go –kind function –symbol ‘worker.Flush’ –source ‘func (w *worker) Flush() { w.flushed = true }’
CLI invocation
$ semedit replace-construct --file api/server.go --kind function --symbol 'worker.Flush' --source 'func (w *worker) Flush() { w.flushed = true }'
Equivalent MCP tool call (semantic_replace_construct)
{
"file": "api/server.go",
"kind": "function",
"source": "func (w *worker) Flush() { w.flushed = true }",
"symbol": "worker.Flush"
}Assert: Replaced method construct
Execute: semedit remove-construct –file api/server.go –kind constant –symbol Legacy
CLI invocation
$ semedit remove-construct --file api/server.go --kind constant --symbol Legacy
Equivalent MCP tool call (semantic_remove_construct)
{
"file": "api/server.go",
"kind": "constant",
"symbol": "Legacy"
}Assert: Removed selected node
Execute: semedit remove-construct –file api/server.go –kind variable –symbol CacheHits
CLI invocation
$ semedit remove-construct --file api/server.go --kind variable --symbol CacheHits
Equivalent MCP tool call (semantic_remove_construct)
{
"file": "api/server.go",
"kind": "variable",
"symbol": "CacheHits"
}Assert: Removed selected node
Unified AST transformation diff
- func (s *Server) Start() {}
- func (w *worker) Flush() {}
- const Legacy = 1
- func Normalize(value string) string { return value + "!" }
package api
type Server struct {
running bool
}
+ func (s *Server) Start() { s.running = true }
type worker struct {
flushed bool
}
+ func (w *worker) Flush() { w.flushed = true }
+ func Normalize(value string) string { return value }
Expected output state (api/server.go)
package api
type Server struct {
running bool
}
func (s *Server) Start() { s.running = true }
type worker struct {
flushed bool
}
func (w *worker) Flush() { w.flushed = true }
func Normalize(value string) string { return value }Explicit import insertion preserves a function’s attached documentation for bare and quoted paths.
Source: explicit_import_preserves_function_doc.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:false
Extract one exact compile-time expression and refuse duplicate or runtime selections without writes.
Source: extract_constant_go.txtar · Download raw file
Execute: semedit extract-constant –file retry.go –symbol retryWindow –in-function Retry –discriminator ‘3 * 60’
CLI invocation
$ semedit extract-constant --file retry.go --symbol retryWindow --in-function Retry --discriminator '3 * 60'
Equivalent MCP tool call (semantic_extract_constant)
{
"discriminator": "3 * 60",
"file": "retry.go",
"in_function": "Retry",
"symbol": "retryWindow"
}Assert: symbol: retryWindow
Execute: exec semedit extract-constant –file duplicate.go –symbol duration –in-function Duplicate –discriminator ‘3 * 60’
CLI invocation
$ exec semedit extract-constant --file duplicate.go --symbol duration --in-function Duplicate --discriminator '3 * 60'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: matched 2 current expressions
Execute: exec semedit extract-constant –file localcollision.go –symbol value –in-function LocalCollision –discriminator ‘3 * 60’
CLI invocation
$ exec semedit extract-constant --file localcollision.go --symbol value --in-function LocalCollision --discriminator '3 * 60'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: declared in the selected function or method
Execute: exec semedit extract-constant –file runtime.go –symbol total –in-function Runtime –discriminator ‘value + 1’
CLI invocation
$ exec semedit extract-constant --file runtime.go --symbol total --in-function Runtime --discriminator 'value + 1'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: not a resolved Go constant expression
Unified AST transformation diff
- return 3 * 60
package retry
func Retry() int {
+ return retryWindow
}
+ const retryWindow int = 3 * 60
Expected output state (retry.go)
package retry
func Retry() int {
return retryWindow
}
const retryWindow int = 3 * 60extract_constant_java
Source: extract_constant_java.txtar · Download raw file
Execute: semedit extract-constant –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –symbol MAX –in-function Widget.run() –discriminator ‘1 + 2’
CLI invocation
$ semedit extract-constant --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --symbol MAX --in-function Widget.run() --discriminator '1 + 2'
Equivalent MCP tool call (semantic_extract_constant)
{
"discriminator": "1 + 2",
"file": "src/Widget.java",
"in_function": "Widget.run()",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "MAX",
"trust_workspace": true
}Assert: Extracted the Java expression into a constant
Unified AST transformation diff
- return 1 + 2;
package sample;
class Widget {
+ private static final int MAX = 1 + 2;
int run() {
+ return MAX;
}
}
Expected output state (src/Widget.java)
package sample;
class Widget {
private static final int MAX = 1 + 2;
int run() {
return MAX;
}
}Reject stale full-file revisions without changing the selected source.
Source: extract_constant_revision.txtar · Download raw file
Execute: exec semedit extract-constant –file retry.go –symbol retryWindow –in-function Retry –discriminator ‘3 * 60’ –expected-revision stale
CLI invocation
$ exec semedit extract-constant --file retry.go --symbol retryWindow --in-function Retry --discriminator '3 * 60' --expected-revision stale
Equivalent MCP tool call (semedit_semedit)
{}Expected error: source revision mismatch
Constant extraction must refuse a package name declared only by a same-package test variant.
Source: extract_constant_test_variant_collision.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: redeclared
Refuse package constant names that capture universe bindings in existing functions.
Source: extract_constant_universe_names.txtar · Download raw file
Execute: exec semedit extract-constant –file constants.go –symbol true –in-function Extract –discriminator ‘1’
CLI invocation
$ exec semedit extract-constant --file constants.go --symbol true --in-function Extract --discriminator '1'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: collides with a package or universe binding
Extract safe call statements through the CLI and reject local data flow without mutation.
Source: extract_function.txtar · Download raw file
Execute: exec semedit extract-function –file api/emitter.go –symbol increment –in-function Increment –kind function –start-line 12 –end-line 12
CLI invocation
$ exec semedit extract-function --file api/emitter.go --symbol increment --in-function Increment --kind function --start-line 12 --end-line 12
Equivalent MCP tool call (semedit_semedit)
{}Expected error: only one leading := declaration with matching named results
Execute: semedit extract-function –file api/emitter.go –symbol writeMessages –in-function Emit –kind function –start-line 6 –end-line 7
CLI invocation
$ semedit extract-function --file api/emitter.go --symbol writeMessages --in-function Emit --kind function --start-line 6 --end-line 7
Equivalent MCP tool call (semantic_extract_function)
{
"end_line": "7",
"file": "api/emitter.go",
"in_function": "Emit",
"kind": "function",
"start_line": "6",
"symbol": "writeMessages"
}Assert: symbol: writeMessages
Assert: in_function: Emit
Assert: diagnostic_status:
Execute: semedit extract-function –file api/value.go –symbol buildValue –in-function Build –kind function –start-line 6 –end-line 7
CLI invocation
$ semedit extract-function --file api/value.go --symbol buildValue --in-function Build --kind function --start-line 6 --end-line 7
Equivalent MCP tool call (semantic_extract_function)
{
"end_line": "7",
"file": "api/value.go",
"in_function": "Build",
"kind": "function",
"start_line": "6",
"symbol": "buildValue"
}Assert: symbol: buildValue
Execute: exec semedit extract-function –file api/unsafe.go –symbol extracted –in-function AddressTaken –kind function –start-line 5 –end-line 5
CLI invocation
$ exec semedit extract-function --file api/unsafe.go --symbol extracted --in-function AddressTaken --kind function --start-line 5 --end-line 5
Equivalent MCP tool call (semedit_semedit)
{}Expected error: address-taken in the owner body
Execute: exec semedit extract-function –file api/unsafe.go –symbol extracted –in-function Captured –kind function –start-line 11 –end-line 11
CLI invocation
$ exec semedit extract-function --file api/unsafe.go --symbol extracted --in-function Captured --kind function --start-line 11 --end-line 11
Equivalent MCP tool call (semedit_semedit)
{}Expected error: captured by a closure
Execute: exec semedit extract-function –file api/unsafe.go –symbol extracted –in-function Recover –kind function –start-line 16 –end-line 16
CLI invocation
$ exec semedit extract-function --file api/unsafe.go --symbol extracted --in-function Recover --kind function --start-line 16 --end-line 16
Equivalent MCP tool call (semedit_semedit)
{}Expected error: direct recover() calls
Execute: exec semedit extract-function –file api/unsafe.go –symbol extracted –in-function ValueCall –kind function –start-line 24 –end-line 24
CLI invocation
$ exec semedit extract-function --file api/unsafe.go --symbol extracted --in-function ValueCall --kind function --start-line 24 --end-line 24
Equivalent MCP tool call (semedit_semedit)
{}Expected error: implicit pointer receiver
Execute: exec semedit extract-function –file api/unsafe.go –symbol extracted –in-function OutputAddress –kind function –start-line 28 –end-line 29
CLI invocation
$ exec semedit extract-function --file api/unsafe.go --symbol extracted --in-function OutputAddress --kind function --start-line 28 --end-line 29
Equivalent MCP tool call (semedit_semedit)
{}Expected error: result local “result” is address-taken
Unified AST transformation diff (api/emitter.go)
package api
import "fmt"
func Emit(prefix string, count int) {
+ writeMessages(prefix, count)
fmt.Println("after")
}
+ func writeMessages(prefix string, count int) {
fmt.Println(prefix)
fmt.Printf("%d", count)
}
func Increment(value int) {
value = value + 1
}
Expected output state (api/emitter.go)
package api
import "fmt"
func Emit(prefix string, count int) {
writeMessages(prefix, count)
fmt.Println("after")
}
func writeMessages(prefix string, count int) {
fmt.Println(prefix)
fmt.Printf("%d", count)
}
func Increment(value int) {
value = value + 1
}Unified AST transformation diff (api/value.go)
package api
import "fmt"
func Build() {
+ result := buildValue()
fmt.Println("after", result)
}
+ func buildValue() int {
result := 42
fmt.Println("during", result)
+ return result
}
Expected output state (api/value.go)
package api
import "fmt"
func Build() {
result := buildValue()
fmt.Println("after", result)
}
func buildValue() int {
result := 42
fmt.Println("during", result)
return result
}Preserve dynamic types when extracting supported multiple live-outs.
Source: extract_function_dynamic_types.txtar · Download raw file
Execute: semedit extract-function –file emit.go –symbol capturePair –in-function Emit –kind function –start-line 9 –end-line 9
CLI invocation
$ semedit extract-function --file emit.go --symbol capturePair --in-function Emit --kind function --start-line 9 --end-line 9
Equivalent MCP tool call (semantic_extract_function)
{
"end_line": "9",
"file": "emit.go",
"in_function": "Emit",
"kind": "function",
"start_line": "9",
"symbol": "capturePair"
}Assert: symbol: capturePair
Unified AST transformation diff
package sample
import (
"fmt"
"testing"
)
func Emit() string {
+ left, right := capturePair()
return fmt.Sprintf("%T,%T", left, right)
}
+ func capturePair() (int, int) {
left, right := 1, 2
+ return left, right
}
func TestExtractedValuesKeepDynamicTypes(t *testing.T) {
if got := Emit(); got != "int,int" {
t.Fatalf("Emit() = %q, want int,int", got)
}
}
Expected output state (emit.go)
package sample
import (
"fmt"
"testing"
)
func Emit() string {
left, right := capturePair()
return fmt.Sprintf("%T,%T", left, right)
}
func capturePair() (int, int) {
left, right := 1, 2
return left, right
}
func TestExtractedValuesKeepDynamicTypes(t *testing.T) {
if got := Emit(); got != "int,int" {
t.Fatalf("Emit() = %q, want int,int", got)
}
}extract_function_java
Source: extract_function_java.txtar · Download raw file
Execute: semedit extract-function –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –symbol extracted –kind method –in-function Widget.run() –start-line 4 –end-line 4
CLI invocation
$ semedit extract-function --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --symbol extracted --kind method --in-function Widget.run() --start-line 4 --end-line 4
Equivalent MCP tool call (semantic_extract_function)
{
"end_line": "4",
"file": "src/Widget.java",
"in_function": "Widget.run()",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"kind": "method",
"language": "java",
"start_line": "4",
"symbol": "extracted",
"trust_workspace": true
}Assert: Extracted the Java statements into a method
Unified AST transformation diff
package sample;
class Widget {
+ private void extracted() {
consume(1);
}
void run() {
+ extracted();
}
}
Expected output state (src/Widget.java)
package sample;
class Widget {
private void extracted() {
consume(1);
}
void run() {
extracted();
}
}Extract a leading short declaration with multiple live-out values.
Source: extract_function_multiple_outputs.txtar · Download raw file
Execute: semedit extract-function –file emit.go –symbol writeSummary –in-function Emit –kind function –start-line 4 –end-line 5
CLI invocation
$ semedit extract-function --file emit.go --symbol writeSummary --in-function Emit --kind function --start-line 4 --end-line 5
Equivalent MCP tool call (semantic_extract_function)
{
"end_line": "5",
"file": "emit.go",
"in_function": "Emit",
"kind": "function",
"start_line": "4",
"symbol": "writeSummary"
}Assert: symbol: writeSummary
Unified AST transformation diff
package sample
func Emit() {
+ left, right := writeSummary()
println(left, right)
}
+ func writeSummary() (int, string) {
left, right := 1, "summary"
println("inside")
+ return left, right
}
Expected output state (emit.go)
package sample
func Emit() {
left, right := writeSummary()
println(left, right)
}
func writeSummary() (int, string) {
left, right := 1, "summary"
println("inside")
return left, right
}Refuse output types whose destination binding would differ from the selected local binding.
Source: extract_function_shadowed_universe_type.txtar · Download raw file
Execute: exec semedit extract-function –file emit.go –symbol capturePair –in-function Emit –kind function –start-line 6 –end-line 6
CLI invocation
$ exec semedit extract-function --file emit.go --symbol capturePair --in-function Emit --kind function --start-line 6 --end-line 6
Equivalent MCP tool call (semedit_semedit)
{}Expected error: generated result type “int” is shadowed by a package declaration
Preserve a defined output type and refuse effectful or unsupported output types before writing.
Source: extract_function_typed_outputs.txtar · Download raw file
Execute: semedit extract-function –file distance.go –symbol describeDistance –in-function EmitDistance –kind function –start-line 6 –end-line 6
CLI invocation
$ semedit extract-function --file distance.go --symbol describeDistance --in-function EmitDistance --kind function --start-line 6 --end-line 6
Equivalent MCP tool call (semantic_extract_function)
{
"end_line": "6",
"file": "distance.go",
"in_function": "EmitDistance",
"kind": "function",
"start_line": "6",
"symbol": "describeDistance"
}Assert: symbol: describeDistance
Execute: exec semedit extract-function –file effectful.go –symbol describeResult –in-function EmitEffectful –kind function –start-line 4 –end-line 4
CLI invocation
$ exec semedit extract-function --file effectful.go --symbol describeResult --in-function EmitEffectful --kind function --start-line 4 --end-line 4
Equivalent MCP tool call (semedit_semedit)
{}Expected error: cannot infer a safe return type
Unified AST transformation diff (distance.go)
package distance
type Distance int
func EmitDistance(distance Distance) {
+ value, unit := describeDistance(distance)
println(value, unit)
}
+ func describeDistance(distance Distance) (Distance, string) {
value, unit := distance, "m"
+ return value, unit
}
func readDistance() Distance { return 1 }
Expected output state (distance.go)
package distance
type Distance int
func EmitDistance(distance Distance) {
value, unit := describeDistance(distance)
println(value, unit)
}
func describeDistance(distance Distance) (Distance, string) {
value, unit := distance, "m"
return value, unit
}
func readDistance() Distance { return 1 }Unified AST transformation diff (effectful.go)
package distance
func EmitEffectful() {
value, unit := readDistance(), "m"
println(value, unit)
}
Expected output state (effectful.go)
package distance
func EmitEffectful() {
value, unit := readDistance(), "m"
println(value, unit)
}Refuse helper names that would capture predeclared true or nil in existing functions.
Source: extract_function_universe_helper_names.txtar · Download raw file
Execute: exec semedit extract-function –file emit.go –symbol true –in-function Emit –kind function –start-line 4 –end-line 4
CLI invocation
$ exec semedit extract-function --file emit.go --symbol true --in-function Emit --kind function --start-line 4 --end-line 4
Equivalent MCP tool call (semedit_semedit)
{}Expected error: collides with a predeclared Go identifier
Execute: exec semedit extract-function –file emit.go –symbol nil –in-function Emit –kind function –start-line 4 –end-line 4
CLI invocation
$ exec semedit extract-function --file emit.go --symbol nil --in-function Emit --kind function --start-line 4 --end-line 4
Equivalent MCP tool call (semedit_semedit)
{}Expected error: collides with a predeclared Go identifier
CLI extracts selected direct methods to an existing same-package destination and preserves the source.
Source: extract_interface_go.txtar · Download raw file
Execute: semedit extract-interface –file api/store.go –in-type Store –symbol StoreAPI –destination-file api/contracts.go –receiver-kind pointer –members ‘[{“file”:“api/store.go”,“symbol”:"(*Store).Read"}]’
CLI invocation
$ semedit extract-interface --file api/store.go --in-type Store --symbol StoreAPI --destination-file api/contracts.go --receiver-kind pointer --members '[{"file":"api/store.go","symbol":"(*Store).Read"}]'
Equivalent MCP tool call (semantic_extract_interface)
{
"destination_file": "api/contracts.go",
"file": "api/store.go",
"in_type": "Store",
"members": "[{\"file\":\"api/store.go\",\"symbol\":\"(*Store).Read\"}]",
"receiver_kind": "pointer",
"symbol": "StoreAPI"
}Assert: status":\s*“persisted
Assert: symbol”:\s*“StoreAPI
Assert: contract”:\s*“StoreAPI
Assert: contract_file”:\s*“api/contracts.go
Assert: continuations”:\s*[
Assert: expected_revision":\s*"[0-9a-f]+
extract_interface_java
Source: extract_interface_java.txtar · Download raw file
Execute: semedit extract-interface –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –in-type Widget –symbol Measurable –members ‘[{“file”:“src/Widget.java”,“symbol”:“Widget.size(String)”}]’
CLI invocation
$ semedit extract-interface --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --in-type Widget --symbol Measurable --members '[{"file":"src/Widget.java","symbol":"Widget.size(String)"}]'
Equivalent MCP tool call (semantic_extract_interface)
{
"file": "src/Widget.java",
"in_type": "Widget",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"members": "[{\"file\":\"src/Widget.java\",\"symbol\":\"Widget.size(String)\"}]",
"symbol": "Measurable",
"trust_workspace": true
}Unified AST transformation diff
- public class Widget {
package sample;
+ public class Widget implements Measurable {
public int size(String value) { return value.length(); }
}
+ interface Measurable {
+ public int size(String value);
}
Expected output state (src/Widget.java)
package sample;
public class Widget implements Measurable {
public int size(String value) { return value.length(); }
}
interface Measurable {
public int size(String value);
}The standalone MCP result exposes only the live generated type identity with its final file revision.
Source: extract_type_live_receipt.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Assert: status":“persisted
Assert: symbol”:“cacheState
Assert: expected_revision”:"[0-9a-f]+
Member file identities are workspace-relative even when package loading uses a nested module root.
Source: extract_type_nested_module_file.txtar · Download raw file
Execute: semedit extract-type –file sub/cache.go –symbol cacheState –in-type cache –members ‘[{“file”:“sub/cache.go”,“symbol”:“cache.entries”}]’ –field state
CLI invocation
$ semedit extract-type --file sub/cache.go --symbol cacheState --in-type cache --members '[{"file":"sub/cache.go","symbol":"cache.entries"}]' --field state
Equivalent MCP tool call (semantic_extract_type)
{
"field": "state",
"file": "sub/cache.go",
"in_type": "cache",
"members": "[{\"file\":\"sub/cache.go\",\"symbol\":\"cache.entries\"}]",
"symbol": "cacheState"
}The exact field selection must continue through earlier unrelated type groups.
Source: extract_type_owner_after_unrelated_type.txtar · Download raw file
Execute: semedit extract-type –file cache.go –symbol cacheState –in-type cache –members ‘[{“file”:“cache.go”,“symbol”:“cache.entries”}]’ –field state
CLI invocation
$ semedit extract-type --file cache.go --symbol cacheState --in-type cache --members '[{"file":"cache.go","symbol":"cache.entries"}]' --field state
Equivalent MCP tool call (semantic_extract_type)
{
"field": "state",
"file": "cache.go",
"in_type": "cache",
"members": "[{\"file\":\"cache.go\",\"symbol\":\"cache.entries\"}]",
"symbol": "cacheState"
}Assert: Extracted selected fields into a composed Go struct type.
Extracts one direct private field and rewrites only typed selectors in the selected file.
Source: extract_type_private_fields.txtar · Download raw file
Execute: semedit extract-type –file cache.go –symbol cacheState –in-type cache –members ‘[{“file”:“cache.go”,“symbol”:“cache.entries”}]’ –field state
CLI invocation
$ semedit extract-type --file cache.go --symbol cacheState --in-type cache --members '[{"file":"cache.go","symbol":"cache.entries"}]' --field state
Equivalent MCP tool call (semantic_extract_type)
{
"field": "state",
"file": "cache.go",
"in_type": "cache",
"members": "[{\"file\":\"cache.go\",\"symbol\":\"cache.entries\"}]",
"symbol": "cacheState"
}Assert: Extracted selected fields into a composed Go struct type.
Taking a selected field’s address observes its old storage location.
Source: extract_type_refuses_address_taken.txtar · Download raw file
An ignored same-directory Go source variant invalidates the whole-file proof.
Source: extract_type_refuses_build_variant.txtar · Download raw file
Exported API signatures can expose this private owner to external consumers.
Source: extract_type_refuses_exported_escape.txtar · Download raw file
A same-package field reference outside the selected file refuses without changing either source.
Source: extract_type_refuses_external_file_use.txtar · Download raw file
Generated source is outside this operation’s maintenance and layout proof.
Source: extract_type_refuses_generated_file.txtar · Download raw file
A typed keyed field use is not rewritten and causes a no-write refusal.
Source: extract_type_refuses_keyed_field_use.txtar · Download raw file
A trailing owner comment must remain attached to its original declaration.
Source: extract_type_refuses_owner_trailing_comment.txtar · Download raw file
Execute: exec semedit extract-type –file cache.go –symbol cacheState –in-type cache –members ‘[{“file”:“cache.go”,“symbol”:“cache.entries”}]’ –field state
CLI invocation
$ exec semedit extract-type --file cache.go --symbol cacheState --in-type cache --members '[{"file":"cache.go","symbol":"cache.entries"}]' --field state
Equivalent MCP tool call (semedit_semedit)
{}Expected error: trailing comment
Parentheses do not make an address-taken field safe to move.
Source: extract_type_refuses_parenthesized_address.txtar · Download raw file
Execute: exec semedit extract-type –file cache.go –symbol cacheState –in-type cache –members ‘[{“file”:“cache.go”,“symbol”:“cache.entries”}]’ –field state
CLI invocation
$ exec semedit extract-type --file cache.go --symbol cacheState --in-type cache --members '[{"file":"cache.go","symbol":"cache.entries"}]' --field state
Equivalent MCP tool call (semedit_semedit)
{}Expected error: address-taken
The typed member identity is closed; unknown member properties are refused before source access.
Source: extract_type_rejects_unknown_member_field.txtar · Download raw file
Typed field identity must keep a same-offset field on another struct unchanged with a same-package test variant and a later target file.
Source: extract_type_same_offset_other_field.txtar · Download raw file
Execute: semedit extract-type –file z_cache.go –symbol cacheState –in-type cache –members ‘[{“file”:“z_cache.go”,“symbol”:“cache.entries”}]’ –field state
CLI invocation
$ semedit extract-type --file z_cache.go --symbol cacheState --in-type cache --members '[{"file":"z_cache.go","symbol":"cache.entries"}]' --field state
Equivalent MCP tool call (semantic_extract_type)
{
"field": "state",
"file": "z_cache.go",
"in_type": "cache",
"members": "[{\"file\":\"z_cache.go\",\"symbol\":\"cache.entries\"}]",
"symbol": "cacheState"
}Extract one exact typed argument expression and refuse ambiguous selection without writes.
Source: extract_variable.txtar · Download raw file
Execute: semedit extract-variable –file api/render.go –symbol total –in-function Render –discriminator ‘count + 1’
CLI invocation
$ semedit extract-variable --file api/render.go --symbol total --in-function Render --discriminator 'count + 1'
Equivalent MCP tool call (semantic_extract_variable)
{
"discriminator": "count + 1",
"file": "api/render.go",
"in_function": "Render",
"symbol": "total"
}Assert: symbol: total
Assert: in_function: Render
Assert: discriminator: count + 1.
Execute: exec semedit extract-variable –file api/ambiguous.go –symbol value –in-function RenderAmbiguous –discriminator ‘count’
CLI invocation
$ exec semedit extract-variable --file api/ambiguous.go --symbol value --in-function RenderAmbiguous --discriminator 'count'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: expression selection is ambiguous
Unified AST transformation diff
- Print(count + 1)
package api
func Print(int) {}
func Render(count int) {
+ total := count + 1
+ Print(total)
}
Expected output state (api/render.go)
package api
func Print(int) {}
func Render(count int) {
total := count + 1
Print(total)
}extract_variable_java
Source: extract_variable_java.txtar · Download raw file
Execute: semedit extract-variable –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –symbol amount –in-function Widget.run() –discriminator ‘1 + 2’
CLI invocation
$ semedit extract-variable --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --symbol amount --in-function Widget.run() --discriminator '1 + 2'
Equivalent MCP tool call (semantic_extract_variable)
{
"discriminator": "1 + 2",
"file": "src/Widget.java",
"in_function": "Widget.run()",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "amount",
"trust_workspace": true
}Assert: Extracted the Java expression into a local variable
Unified AST transformation diff
- consume(1 + 2);
package sample;
class Widget {
void run() {
+ int amount = 1 + 2;
+ consume(amount);
}
}
Expected output state (src/Widget.java)
package sample;
class Widget {
void run() {
int amount = 1 + 2;
consume(amount);
}
}Extract a first call argument while preserving the order of later arguments.
Source: extract_variable_multiple_args.txtar · Download raw file
Execute: semedit extract-variable –file render.go –symbol total –in-function Render –discriminator ‘count + 1’
CLI invocation
$ semedit extract-variable --file render.go --symbol total --in-function Render --discriminator 'count + 1'
Equivalent MCP tool call (semantic_extract_variable)
{
"discriminator": "count + 1",
"file": "render.go",
"in_function": "Render",
"symbol": "total"
}Unified AST transformation diff
- Print(count + 1, count)
package render
func Print(int, int) {}
func Render(count int) {
+ total := count + 1
+ Print(total, count)
}
Expected output state (render.go)
package render
func Print(int, int) {}
func Render(count int) {
total := count + 1
Print(total, count)
}Bind a numeric construct path to its exact preimage revision and refuse stale selection.
Source: extract_variable_revision.txtar · Download raw file
Execute: exec semedit extract-variable –file render.go –symbol selected –in-function Render –discriminator count
CLI invocation
$ exec semedit extract-variable --file render.go --symbol selected --in-function Render --discriminator count
Equivalent MCP tool call (semedit_semedit)
{}Expected error: expression selection is ambiguous
Execute: exec semedit extract-variable –file render.go –symbol selected –in-function Render –discriminator count –construct-path 0
CLI invocation
$ exec semedit extract-variable --file render.go --symbol selected --in-function Render --discriminator count --construct-path 0
Equivalent MCP tool call (semedit_semedit)
{}Expected error: expected_revision.*required
Execute: exec semedit extract-variable –file render.go –symbol selected –in-function Render –discriminator count –construct-path 0 –expected-revision 0000000000000000000000000000000000000000000000000000000000000000
CLI invocation
$ exec semedit extract-variable --file render.go --symbol selected --in-function Render --discriminator count --construct-path 0 --expected-revision 0000000000000000000000000000000000000000000000000000000000000000
Equivalent MCP tool call (semedit_semedit)
{}Expected error: selected source revision mismatch
Execute: semedit extract-variable –file render.go –symbol selected –in-function Render –discriminator count –construct-path 0 –expected-revision 83732649809a1fd138cb8e37865fcc6eb824cff8aa84a13cafb7c4507cea8692
CLI invocation
$ semedit extract-variable --file render.go --symbol selected --in-function Render --discriminator count --construct-path 0 --expected-revision 83732649809a1fd138cb8e37865fcc6eb824cff8aa84a13cafb7c4507cea8692
Equivalent MCP tool call (semantic_extract_variable)
{
"construct_path": "0",
"discriminator": "count",
"expected_revision": "83732649809a1fd138cb8e37865fcc6eb824cff8aa84a13cafb7c4507cea8692",
"file": "render.go",
"in_function": "Render",
"symbol": "selected"
}Unified AST transformation diff
package sample
func Print(int) {}
func Render(count int) {
+ selected := count
+ Print(selected)
Print(count)
}
Expected output state (render.go)
package sample
func Print(int) {}
func Render(count int) {
selected := count
Print(selected)
Print(count)
}Preserve defined and interface parameter types; refuse callable parameters.
Source: extract_variable_typed_context.txtar · Download raw file
Execute: semedit extract-variable –file render.go –symbol distanceValue –in-function ‘(*Renderer).Render’ –discriminator distance
CLI invocation
$ semedit extract-variable --file render.go --symbol distanceValue --in-function '(*Renderer).Render' --discriminator distance
Equivalent MCP tool call (semantic_extract_variable)
{
"discriminator": "distance",
"file": "render.go",
"in_function": "(*Renderer).Render",
"symbol": "distanceValue"
}Execute: semedit extract-variable –file render.go –symbol readerValue –in-function ‘(*Renderer).RenderReader’ –discriminator reader
CLI invocation
$ semedit extract-variable --file render.go --symbol readerValue --in-function '(*Renderer).RenderReader' --discriminator reader
Equivalent MCP tool call (semantic_extract_variable)
{
"discriminator": "reader",
"file": "render.go",
"in_function": "(*Renderer).RenderReader",
"symbol": "readerValue"
}Execute: exec semedit extract-variable –file render.go –symbol callbackValue –in-function ‘(*Renderer).Dynamic’ –discriminator value
CLI invocation
$ exec semedit extract-variable --file render.go --symbol callbackValue --in-function '(*Renderer).Dynamic' --discriminator value
Equivalent MCP tool call (semedit_semedit)
{}Expected error: only an unshadowed same-file package function call with no unresolved import binding is supported
Unified AST transformation diff
- consume(distance, distance)
- consume(reader, r)
package render
type Distance int
type Reader interface{ Read() }
type Renderer struct{}
func consume(first any, rest ...any) {}
func (r *Renderer) Render(distance Distance) {
+ distanceValue := distance
+ consume(distanceValue, distance)
}
func (r *Renderer) RenderReader(reader Reader) {
+ readerValue := reader
+ consume(readerValue, r)
}
func (r *Renderer) Dynamic(call func(any), value any) {
call(value)
}
Expected output state (render.go)
package render
type Distance int
type Reader interface{ Read() }
type Renderer struct{}
func consume(first any, rest ...any) {}
func (r *Renderer) Render(distance Distance) {
distanceValue := distance
consume(distanceValue, distance)
}
func (r *Renderer) RenderReader(reader Reader) {
readerValue := reader
consume(readerValue, r)
}
func (r *Renderer) Dynamic(call func(any), value any) {
call(value)
}Find method references across the active module even when the selected file only scopes the target.
Source: find_references.txtar · Download raw file
Execute: semedit find-references –language go –file api/store.go –symbol Store.Read
CLI invocation
$ semedit find-references --language go --file api/store.go --symbol Store.Read
Equivalent MCP tool call (semantic_find_references)
{
"file": "api/store.go",
"language": "go",
"symbol": "Store.Read"
}Assert: kind": “workspace_active_build
Assert: qualified_name”: “Store.Read
Assert: file”: “client/client.go
Assert: enclosing_symbol”: “Use
Java references include trusted cross-source-set usages and exclude declarations.
Source: find_references_java.txtar · Download raw file
Execute: semedit find-references –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/main/java/Widget.java –symbol Widget
CLI invocation
$ semedit find-references --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/main/java/Widget.java --symbol Widget
Equivalent MCP tool call (semantic_find_references)
{
"file": "src/main/java/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "Widget",
"trust_workspace": true
}Assert: file”:\s*"[^"]*/src/test/java/WidgetTest.java
Assert: snippet":\s*“Widget
Assert: complete”:\s*false
task_id: task-07-generate-template-main
Source: generate_template_main.txtar · Download raw file
category: generation instruction: “In main.go, implement main() to execute a text/template that prints ‘Hello World’ along with a random integer, ensuring all necessary standard library packages are imported cleanly.” contexts: - small verification_constraint: “Verify your changes and ensure ‘go build’ succeeds with zero errors before concluding.” prompt_variants: default: “In main.go, implement main() to execute a text/template that prints ‘Hello World’ along with a random integer, ensuring all necessary standard library packages are imported cleanly.” crypto_rand: “In main.go, implement main() to execute a text/template that prints ‘Hello World’ along with a random integer from crypto/rand, ensuring all necessary standard library packages are imported cleanly.” prefer_discover_semedit: “Before editing, inspect the complete available tool inventory, including deferred or lazy tools. If applicable semantic editing tools are callable, prefer them for source mutations. In main.go, implement main() to execute a text/template that prints ‘Hello World’ along with a random integer, ensuring all necessary standard library packages are imported cleanly.” oracle: level_1_mutation_policy: disallowed_files: - “go.mod” - “go.sum” level_2_ast: file: “main.go” must_contain_symbols: - “main” must_contain_imports: - “text/template” level_3_build: clean_compile: true level_4_test: pass_tests: true Golden CLI test verification:
Execute: semedit replace-body –file main.go –symbol main –body ’tmpl := template.Must(template.New(“greeting”).Parse(“Hello World! Random: {{.}}\n”)); _ = tmpl.Execute(os.Stdout, rand.IntN(100))’
CLI invocation
$ semedit replace-body --file main.go --symbol main --body 'tmpl := template.Must(template.New("greeting").Parse("Hello World! Random: {{.}}\n")); _ = tmpl.Execute(os.Stdout, rand.IntN(100))'
Equivalent MCP tool call (semantic_replace_body)
{
"body": "tmpl := template.Must(template.New(\"greeting\").Parse(\"Hello World! Random: {{.}}\\n\")); _ = tmpl.Execute(os.Stdout, rand.IntN(100))",
"file": "main.go",
"symbol": "main"
}Execute: semedit imports –file main.go –add text/template
CLI invocation
$ semedit imports --file main.go --add text/template
Equivalent MCP tool call (semantic_organize_imports)
{
"add": [
"text/template"
],
"file": "main.go"
}Unified AST transformation diff
package main
+ import (
+ "math/rand/v2"
+ "os"
+ "text/template"
+ )
func main() {
+ tmpl := template.Must(template.New("greeting").Parse("Hello World! Random: {{.}}\n"))
+ _ = tmpl.Execute(os.Stdout, rand.IntN(100))
}
Expected output state (main.go)
package main
import (
"math/rand/v2"
"os"
"text/template"
)
func main() {
tmpl := template.Must(template.New("greeting").Parse("Hello World! Random: {{.}}\n"))
_ = tmpl.Execute(os.Stdout, rand.IntN(100))
}Ordinary Go commands use the caller’s build tags, workspace, and caches across CLI and MCP paths.
Source: go_environment_inheritance.txtar · Download raw file
Execute: semedit verify –language go –path . –check-only
CLI invocation
$ semedit verify --language go --path . --check-only
Equivalent MCP tool call (semantic_verify)
{
"check_only": true,
"language": "go",
"path": "."
}Assert: Verification clean: 0 diagnostics
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: id":2,“result”:.*“isError”:false
Assert: id":3,“result”:.*“isError”:false
Assert: status":“ok
Unified AST transformation diff (app.go.mod)
+ module example.com/app
+ go 1.23
Expected output state (app.go.mod)
module example.com/app
go 1.23Unified AST transformation diff (go.work)
go 1.23
use (
./app
./sibling
)
Expected output state (go.work)
go 1.23
use (
./app
./sibling
)Unified AST transformation diff (sibling.go.mod)
+ module example.com/sibling
+ go 1.23
Expected output state (sibling.go.mod)
module example.com/sibling
go 1.23Unified AST transformation diff (user-goenv)
GOFLAGS=-tags=envtag
Expected output state (user-goenv)
GOFLAGS=-tags=envtagUnified AST transformation diff (value.go)
+ // Package app exercises an external workspace module and a tagged declaration.
+ package app
+ import "example.com/sibling"
+ func Value() int {
+ return sibling.Tagged() + 1
+ }
Expected output state (value.go)
// Package app exercises an external workspace module and a tagged declaration.
package app
import "example.com/sibling"
func Value() int {
return sibling.Tagged() + 1
}CLI generates missing panic stubs into an existing same-package file and preserves existing source.
Source: implement_contract_go.txtar · Download raw file
Execute: semedit implement-contract –file worker/worker.go –symbol Worker –contract Runner –contract-file contracts/runner.go –destination-file worker/methods.go –receiver-kind pointer –body-policy panic_stub
CLI invocation
$ semedit implement-contract --file worker/worker.go --symbol Worker --contract Runner --contract-file contracts/runner.go --destination-file worker/methods.go --receiver-kind pointer --body-policy panic_stub
Equivalent MCP tool call (semantic_implement_contract)
{
"body_policy": "panic_stub",
"contract": "Runner",
"contract_file": "contracts/runner.go",
"destination_file": "worker/methods.go",
"file": "worker/worker.go",
"receiver_kind": "pointer",
"symbol": "Worker"
}Assert: status”:\s*“persisted
Assert: Run
Assert: type_target”:\s*{
Assert: generated_methods":\s*[
Assert: expected_revision":\s*"[0-9a-f]+
implement_contract_java
Source: implement_contract_java.txtar · Download raw file
Execute: semedit implement-contract –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –symbol Widget –contract Runner –contract-file src/Runner.java –receiver-kind pointer –body-policy panic_stub
CLI invocation
$ semedit implement-contract --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --symbol Widget --contract Runner --contract-file src/Runner.java --receiver-kind pointer --body-policy panic_stub
Equivalent MCP tool call (semantic_implement_contract)
{
"body_policy": "panic_stub",
"contract": "Runner",
"contract_file": "src/Runner.java",
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"receiver_kind": "pointer",
"symbol": "Widget",
"trust_workspace": true
}Unified AST transformation diff
- class Widget {
package sample;
+ class Widget implements Runner {
+ @Override
+ public void run() {}
}
Expected output state (src/Widget.java)
package sample;
class Widget implements Runner {
@Override
public void run() {}
}Contract reads cannot currently bind a mutable local replacement module’s manifest and file membership into its read set.
Source: implement_contract_refuses_local_replacement.txtar · Download raw file
Execute: exec semedit implement-contract –file worker.go –symbol Worker –contract Runner –contract-file runner.go –receiver-kind pointer –body-policy panic_stub –destination-file worker.go
CLI invocation
$ exec semedit implement-contract --file worker.go --symbol Worker --contract Runner --contract-file runner.go --receiver-kind pointer --body-policy panic_stub --destination-file worker.go
Equivalent MCP tool call (semedit_semedit)
{}Expected error: contract edits do not support mutable local replacement module “example.com/local/token” outside the captured module
A local replacement imported only by destination tests is rejected before contract output or source state changes.
Source: implement_contract_refuses_test_only_local_replacement.txtar · Download raw file
Execute: exec semedit implement-contract –file worker.go –symbol Worker –contract Runner –contract-file runner.go –receiver-kind pointer –body-policy panic_stub –destination-file worker.go
CLI invocation
$ exec semedit implement-contract --file worker.go --symbol Worker --contract Runner --contract-file runner.go --receiver-kind pointer --body-policy panic_stub --destination-file worker.go
Equivalent MCP tool call (semedit_semedit)
{}Expected error: contract edits do not support mutable local replacement module “example.com/local/token” outside the captured module
The concrete type and generated method share a file; its live receipt target uses the planned final digest.
Source: implement_contract_same_file_go.txtar · Download raw file
Execute: semedit implement-contract –file worker.go –symbol Worker –contract Runner –contract-file worker.go –destination-file worker.go –receiver-kind pointer –body-policy panic_stub
CLI invocation
$ semedit implement-contract --file worker.go --symbol Worker --contract Runner --contract-file worker.go --destination-file worker.go --receiver-kind pointer --body-policy panic_stub
Equivalent MCP tool call (semantic_implement_contract)
{
"body_policy": "panic_stub",
"contract": "Runner",
"contract_file": "worker.go",
"destination_file": "worker.go",
"file": "worker.go",
"receiver_kind": "pointer",
"symbol": "Worker"
}Assert: status":\s*“persisted
Assert: type_target”:\s*{
Assert: symbol":\s*“Worker
Assert: expected_revision”:\s*"[0-9a-f]+
A generated method that collides with a same-package test method is refused before publication.
Source: implement_contract_test_variant_collision_go.txtar · Download raw file
Execute: exec semedit implement-contract –file worker.go –symbol Worker –contract Runner –contract-file contracts.go –destination-file methods.go –receiver-kind pointer –body-policy panic_stub
CLI invocation
$ exec semedit implement-contract --file worker.go --symbol Worker --contract Runner --contract-file contracts.go --destination-file methods.go --receiver-kind pointer --body-policy panic_stub
Equivalent MCP tool call (semedit_semedit)
{}Expected error: contract test variant .* has type errors
inline_function_java
Source: inline_function_java.txtar · Download raw file
Execute: semedit inline-function –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Helper.java –symbol Helper.value –call-site ‘{“file”:“src/Caller.java”,“in_function”:“Caller.run”,“discriminator”:“helper.value()”}’
CLI invocation
$ semedit inline-function --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Helper.java --symbol Helper.value --call-site '{"file":"src/Caller.java","in_function":"Caller.run","discriminator":"helper.value()"}'
Equivalent MCP tool call (semantic_inline_function)
{
"call_site": "{\"file\":\"src/Caller.java\",\"in_function\":\"Caller.run\",\"discriminator\":\"helper.value()\"}",
"file": "src/Helper.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "Helper.value",
"trust_workspace": true
}Assert: Successfully inlined one call
Unified AST transformation diff
- return helper.value();
package sample;
class Caller {
int run() {
+ return 41;
}
}
Expected output state (src/Caller.java)
package sample;
class Caller {
int run() {
return 41;
}
}Inline one typed direct literal-return call after a preceding child changes the caller overlay.
Source: inline_function_mcp_batch.txtar · Download raw file
Execute: semedit mcp –live-reload
CLI invocation
$ semedit mcp --live-reload
Equivalent MCP tool call (semedit_mcp)
{}Assert: operation":“inline-function
Assert: status”:“applied_working
A caller-local shadow of the result type makes the conversion binding uncertain, so inlining refuses without an edit.
Source: inline_function_shadow_refusal.txtar · Download raw file
Execute: exec semedit inline-function –file callee.go –symbol adjust –call-site ‘{“file”:“caller.go”,“in_function”:“Run”,“discriminator”:“adjust()”}’
CLI invocation
$ exec semedit inline-function --file callee.go --symbol adjust --call-site '{"file":"caller.go","in_function":"Run","discriminator":"adjust()"}'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: inline function type preflight
Exercise literal inlining through the public CLI and refuse unsafe values and conversion-name bindings.
Source: inline_variable.txtar · Download raw file
Execute: exec semedit inline-variable –file calc.go –symbol value –in-function LocalAlias
CLI invocation
$ exec semedit inline-variable --file calc.go --symbol value --in-function LocalAlias
Equivalent MCP tool call (semedit_semedit)
{}Expected error: cannot inline “value”: default type name int is shadowed by a local or package binding or import
Execute: semedit inline-variable –file calc.go –symbol value –in-function Compute
CLI invocation
$ semedit inline-variable --file calc.go --symbol value --in-function Compute
Equivalent MCP tool call (semantic_inline_variable)
{
"file": "calc.go",
"in_function": "Compute",
"symbol": "value"
}Execute: exec semedit inline-variable –file calc.go –symbol result –in-function Compute
CLI invocation
$ exec semedit inline-variable --file calc.go --symbol result --in-function Compute
Equivalent MCP tool call (semedit_semedit)
{}Expected error: initializer must be a literal expression
Execute: exec semedit inline-variable –file calc.go –symbol typed –in-function Compute
CLI invocation
$ exec semedit inline-variable --file calc.go --symbol typed --in-function Compute
Equivalent MCP tool call (semedit_semedit)
{}Expected error: explicitly typed declarations require preserving their declared type
Execute: exec semedit inline-variable –file calc.go –symbol shadowed –in-function Shadow
CLI invocation
$ exec semedit inline-variable --file calc.go --symbol shadowed --in-function Shadow
Equivalent MCP tool call (semedit_semedit)
{}Expected error: default type name int is shadowed
Execute: exec semedit inline-variable –file sibling/calc.go –symbol value –in-function Compute
CLI invocation
$ exec semedit inline-variable --file sibling/calc.go --symbol value --in-function Compute
Equivalent MCP tool call (semedit_semedit)
{}Expected error: default type name int is shadowed
Unified AST transformation diff
package calc
func Compute() int {
+ println(int(42))
result := compute()
println(result)
var typed int64 = 9
println(typed)
return 0
}
func Shadow() {
int := 7
_ = int
shadowed := 42
println(shadowed)
}
func LocalAlias() {
type int = string
value := 42
println(value)
}
func compute() int { return 1 }
Expected output state (calc.go)
package calc
func Compute() int {
println(int(42))
result := compute()
println(result)
var typed int64 = 9
println(typed)
return 0
}
func Shadow() {
int := 7
_ = int
shadowed := 42
println(shadowed)
}
func LocalAlias() {
type int = string
value := 42
println(value)
}
func compute() int { return 1 }inline_variable_java
Source: inline_variable_java.txtar · Download raw file
Execute: semedit inline-variable –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –symbol limit –in-function Widget.run()
CLI invocation
$ semedit inline-variable --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --symbol limit --in-function Widget.run()
Equivalent MCP tool call (semantic_inline_variable)
{
"file": "src/Widget.java",
"in_function": "Widget.run()",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "limit",
"trust_workspace": true
}Assert: Inlined the Java local through the JDT LS refactor.inline action
Unified AST transformation diff
- int limit = 10;
- consume(limit);
package sample;
class Widget {
void run() {
+ consume(10);
}
}
Expected output state (src/Widget.java)
package sample;
class Widget {
void run() {
consume(10);
}
}Inline all immediate direct literal uses and refuse a side-effecting initializer.
Source: inline_variable_multiple_uses.txtar · Download raw file
Execute: semedit inline-variable –file calc.go –symbol value –in-function Compute
CLI invocation
$ semedit inline-variable --file calc.go --symbol value --in-function Compute
Equivalent MCP tool call (semantic_inline_variable)
{
"file": "calc.go",
"in_function": "Compute",
"symbol": "value"
}Execute: exec semedit inline-variable –file calc.go –symbol result –in-function Unsafe
CLI invocation
$ exec semedit inline-variable --file calc.go --symbol result --in-function Unsafe
Equivalent MCP tool call (semedit_semedit)
{}Expected error: initializer must be a literal expression
Unified AST transformation diff
- value := 42
- Print(value, value)
package calc
func Print(int, int) {}
func Compute() {
+ Print(int(42), int(42))
}
func Unsafe() {
result := sideEffect()
Print(result, result)
}
func sideEffect() int { return 1 }
Expected output state (calc.go)
package calc
func Print(int, int) {}
func Compute() {
Print(int(42), int(42))
}
func Unsafe() {
result := sideEffect()
Print(result, result)
}
func sideEffect() int { return 1 }Insert case clause into switch statement
Source: insert_case.txtar · Download raw file
Repeated switch selectors must fail without changing either switch.
1. Insert case before default clause
CLI invocation
$ exec semedit insert-case --file router/handler.go --func Dispatch --discriminator method --case 'case "POST": return handlePost()'
Equivalent MCP tool call (semedit_semedit)
{}Execute: semedit insert-case –file router/handler.go –in-function Dispatch –discriminator method –placement before_default –case ‘case “POST”: return handlePost()’
CLI invocation
$ semedit insert-case --file router/handler.go --in-function Dispatch --discriminator method --placement before_default --case 'case "POST": return handlePost()'
Equivalent MCP tool call (semantic_insert_case)
{
"case": "case \"POST\": return handlePost()",
"discriminator": "method",
"file": "router/handler.go",
"in_function": "Dispatch",
"placement": "before_default"
}Execute: exec semedit insert-case –file router/nested.go –in-function Route –discriminator mode –placement before_default –case ‘case “new”: return “new”’
CLI invocation
$ exec semedit insert-case --file router/nested.go --in-function Route --discriminator mode --placement before_default --case 'case "new": return "new"'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: ambiguous switch selector
Expected error: 0 cases: “outer”, default
Expected error: 0.1 cases: “inner”, default
Execute: semedit insert-case –file router/nested.go –in-function Route –discriminator mode –construct-path 0.1 –placement before_default –case ‘case “new”: return “new”’
CLI invocation
$ semedit insert-case --file router/nested.go --in-function Route --discriminator mode --construct-path 0.1 --placement before_default --case 'case "new": return "new"'
Equivalent MCP tool call (semantic_insert_case)
{
"case": "case \"new\": return \"new\"",
"construct_path": "0.1",
"discriminator": "mode",
"file": "router/nested.go",
"in_function": "Route",
"placement": "before_default"
}Unified AST transformation diff (router/handler.go)
package router
func Dispatch(method string) string {
switch method {
case "GET":
return handleGet()
+ case "POST":
+ return handlePost()
default:
return handleNotFound()
}
}
func handleGet() string { return "get" }
func handlePost() string { return "post" }
func handleNotFound() string { return "404" }
Expected output state (router/handler.go)
package router
func Dispatch(method string) string {
switch method {
case "GET":
return handleGet()
case "POST":
return handlePost()
default:
return handleNotFound()
}
}
func handleGet() string { return "get" }
func handlePost() string { return "post" }
func handleNotFound() string { return "404" }Unified AST transformation diff (router/nested.go)
// nested.go reproduces a nested switch with the same selector as its parent.
package router
func Route(mode string) string {
switch mode {
case "outer":
switch mode {
case "inner":
return "inner"
+ case "new":
+ return "new"
default:
return "nested fallback"
}
default:
return "outer fallback"
}
}
Expected output state (router/nested.go)
// nested.go reproduces a nested switch with the same selector as its parent.
package router
func Route(mode string) string {
switch mode {
case "outer":
switch mode {
case "inner":
return "inner"
case "new":
return "new"
default:
return "nested fallback"
}
default:
return "outer fallback"
}
}Unified AST transformation diff (router/nested.go)
// nested.go reproduces a nested switch with the same selector as its parent.
package router
func Route(mode string) string {
switch mode {
case "outer":
switch mode {
case "inner":
return "inner"
default:
return "nested fallback"
}
default:
return "outer fallback"
}
}
Expected output state (router/nested.go)
// nested.go reproduces a nested switch with the same selector as its parent.
package router
func Route(mode string) string {
switch mode {
case "outer":
switch mode {
case "inner":
return "inner"
default:
return "nested fallback"
}
default:
return "outer fallback"
}
}insert_case_java
Source: insert_case_java.txtar · Download raw file
Execute: semedit insert-case –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –in-function Widget.run –discriminator status –case ‘case 2: break;’ –placement before_default
CLI invocation
$ semedit insert-case --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --in-function Widget.run --discriminator status --case 'case 2: break;' --placement before_default
Equivalent MCP tool call (semantic_insert_case)
{
"case": "case 2: break;",
"discriminator": "status",
"file": "src/Widget.java",
"in_function": "Widget.run",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"placement": "before_default",
"trust_workspace": true
}Unified AST transformation diff
package sample;
class Widget {
void run(int status) {
switch (status) {
case 1: break;
+ case 2: break;
default: break;
}
}
}
Expected output state (src/Widget.java)
package sample;
class Widget {
void run(int status) {
switch (status) {
case 1: break;
case 2: break;
default: break;
}
}
}Unified insertion uses the public CLI and preserves the resulting Go source.
Source: insert_construct.txtar · Download raw file
Execute: semedit insert-construct –file api/server.go –kind type –source ’type Config struct { Port int }’
CLI invocation
$ semedit insert-construct --file api/server.go --kind type --source 'type Config struct { Port int }'
Equivalent MCP tool call (semantic_insert_construct)
{
"file": "api/server.go",
"kind": "type",
"source": "type Config struct { Port int }"
}Assert: Successfully inserted type construct
Execute: semedit insert-construct –file api/server.go –kind function –source ‘func NewConfig() Config { return Config{} }’
CLI invocation
$ semedit insert-construct --file api/server.go --kind function --source 'func NewConfig() Config { return Config{} }'
Equivalent MCP tool call (semantic_insert_construct)
{
"file": "api/server.go",
"kind": "function",
"source": "func NewConfig() Config { return Config{} }"
}Assert: Successfully inserted function construct
Execute: semedit insert-construct –file api/server.go –kind const –source ‘const DefaultPort = 8080’
CLI invocation
$ semedit insert-construct --file api/server.go --kind const --source 'const DefaultPort = 8080'
Equivalent MCP tool call (semantic_insert_construct)
{
"file": "api/server.go",
"kind": "const",
"source": "const DefaultPort = 8080"
}Assert: Successfully inserted const construct
Execute: semedit insert-construct –file api/server.go –kind case –in-function Handle –discriminator v –source ‘case 1: return 1’
CLI invocation
$ semedit insert-construct --file api/server.go --kind case --in-function Handle --discriminator v --source 'case 1: return 1'
Equivalent MCP tool call (semantic_insert_construct)
{
"discriminator": "v",
"file": "api/server.go",
"in_function": "Handle",
"kind": "case",
"source": "case 1: return 1"
}Assert: Successfully inserted case construct
Execute: exec semedit insert-construct –file api/server.go –kind unknown –source ’type Broken struct{}’
CLI invocation
$ exec semedit insert-construct --file api/server.go --kind unknown --source 'type Broken struct{}'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: unsupported
Append one compiler-typed keyed map and struct element.
Source: insert_construct_element.txtar · Download raw file
Execute: exec semedit insert-composite-element –file routes.go –in-declaration routes –discriminator ‘map[string]int{“health”: 1}’ –source ‘“metrics”: 2’
CLI invocation
$ exec semedit insert-composite-element --file routes.go --in-declaration routes --discriminator 'map[string]int{"health": 1}' --source '"metrics": 2'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: unknown command
Execute: semedit insert-construct –kind element –file routes.go –in-declaration routes –discriminator ‘map[string]int{“health”: 1}’ –source ‘“metrics”: 2’
CLI invocation
$ semedit insert-construct --kind element --file routes.go --in-declaration routes --discriminator 'map[string]int{"health": 1}' --source '"metrics": 2'
Equivalent MCP tool call (semantic_insert_construct)
{
"discriminator": "map[string]int{\"health\": 1}",
"file": "routes.go",
"in_declaration": "routes",
"kind": "element",
"source": "\"metrics\": 2"
}Assert: Appended one keyed composite element.
Execute: semedit insert-construct –kind element –file routes.go –in-declaration config –discriminator ‘Config{Health: 1}’ –source ‘Metrics: 2’
CLI invocation
$ semedit insert-construct --kind element --file routes.go --in-declaration config --discriminator 'Config{Health: 1}' --source 'Metrics: 2'
Equivalent MCP tool call (semantic_insert_construct)
{
"discriminator": "Config{Health: 1}",
"file": "routes.go",
"in_declaration": "config",
"kind": "element",
"source": "Metrics: 2"
}Assert: Appended one keyed composite element.
Nested composite values do not replace the outer literal in refreshed selectors.
Source: insert_construct_element_nested_value.txtar · Download raw file
Execute: semedit insert-construct –kind element –file routes.go –in-declaration routes –discriminator ‘map[string]map[string]int{“health”: map[string]int{“ready”: 1}}’ –source ‘“metrics”: map[string]int{“count”: 2}’
CLI invocation
$ semedit insert-construct --kind element --file routes.go --in-declaration routes --discriminator 'map[string]map[string]int{"health": map[string]int{"ready": 1}}' --source '"metrics": map[string]int{"count": 2}'
Equivalent MCP tool call (semantic_insert_construct)
{
"discriminator": "map[string]map[string]int{\"health\": map[string]int{\"ready\": 1}}",
"file": "routes.go",
"in_declaration": "routes",
"kind": "element",
"source": "\"metrics\": map[string]int{\"count\": 2}"
}Assert: Appended one keyed composite element.
Execute: semedit insert-construct –kind element –file routes.go –in-declaration routes –discriminator ‘map[string]map[string]int{“health”: map[string]int{“ready”: 1}, “metrics”: map[string]int{“count”: 2}}’ –source ‘“dashboard”: map[string]int{“count”: 3}’
CLI invocation
$ semedit insert-construct --kind element --file routes.go --in-declaration routes --discriminator 'map[string]map[string]int{"health": map[string]int{"ready": 1}, "metrics": map[string]int{"count": 2}}' --source '"dashboard": map[string]int{"count": 3}'
Equivalent MCP tool call (semantic_insert_construct)
{
"discriminator": "map[string]map[string]int{\"health\": map[string]int{\"ready\": 1}, \"metrics\": map[string]int{\"count\": 2}}",
"file": "routes.go",
"in_declaration": "routes",
"kind": "element",
"source": "\"dashboard\": map[string]int{\"count\": 3}"
}Assert: Appended one keyed composite element.
Element selectors and placement are distinct from declaration/statement insertion.
Source: insert_construct_element_params.txtar · Download raw file
Unconstrained CLI ingress accepts vocabulary synonyms without restoring the old command.
Execute: exec semedit insert-construct –kind element –file routes.go –source ‘“metrics”: 2’ –discriminator ‘map[string]int{“health”: 1}’
CLI invocation
$ exec semedit insert-construct --kind element --file routes.go --source '"metrics": 2' --discriminator 'map[string]int{"health": 1}'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: in_declaration
Execute: exec semedit insert-construct –kind element –file routes.go –in-declaration routes –source ‘“metrics”: 2’
CLI invocation
$ exec semedit insert-construct --kind element --file routes.go --in-declaration routes --source '"metrics": 2'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: discriminator
Execute: exec semedit insert-construct –kind element –file routes.go –in-declaration ’ ’ –discriminator ‘map[string]int{“health”: 1}’ –source ‘“metrics”: 2’
CLI invocation
$ exec semedit insert-construct --kind element --file routes.go --in-declaration ' ' --discriminator 'map[string]int{"health": 1}' --source '"metrics": 2'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: in_declaration
Execute: exec semedit insert-construct –kind element –file routes.go –in-declaration routes –discriminator ’ ’ –source ‘“metrics”: 2’
CLI invocation
$ exec semedit insert-construct --kind element --file routes.go --in-declaration routes --discriminator ' ' --source '"metrics": 2'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: discriminator
Execute: exec semedit insert-construct –kind element –file routes.go –in-declaration routes –discriminator ‘map[string]int{“health”: 1}’ –source ’ '
CLI invocation
$ exec semedit insert-construct --kind element --file routes.go --in-declaration routes --discriminator 'map[string]int{"health": 1}' --source ' '
Equivalent MCP tool call (semedit_semedit)
{}Expected error: source
Execute: exec semedit insert-construct –kind element –file routes.go –in-declaration routes –discriminator ‘map[string]int{“health”: 1}’ –source ‘“metrics”: 2’ –placement first
CLI invocation
$ exec semedit insert-construct --kind element --file routes.go --in-declaration routes --discriminator 'map[string]int{"health": 1}' --source '"metrics": 2' --placement first
Equivalent MCP tool call (semedit_semedit)
{}Expected error: append
Execute: exec semedit insert-construct –kind element –file routes.go –in-declaration routes –discriminator ‘map[string]int{“health”: 1}’ –source ‘“metrics”: 2’ –in-function Handler
CLI invocation
$ exec semedit insert-construct --kind element --file routes.go --in-declaration routes --discriminator 'map[string]int{"health": 1}' --source '"metrics": 2' --in-function Handler
Equivalent MCP tool call (semedit_semedit)
{}Expected error: in_function
Execute: exec semedit insert-construct –kind function –file routes.go –in-declaration routes –source ‘func Handler() {}’
CLI invocation
$ exec semedit insert-construct --kind function --file routes.go --in-declaration routes --source 'func Handler() {}'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: in_declaration
Execute: exec semedit insert-construct –kind function –file routes.go –source ‘func Handler() {}’ –placement append
CLI invocation
$ exec semedit insert-construct --kind function --file routes.go --source 'func Handler() {}' --placement append
Equivalent MCP tool call (semedit_semedit)
{}Expected error: append
Execute: exec semedit insert-construct –kind element –file routes.go –in-declaration items –discriminator ‘[]int{1}’ –source ‘0: 2’
CLI invocation
$ exec semedit insert-construct --kind element --file routes.go --in-declaration items --discriminator '[]int{1}' --source '0: 2'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: only typed keyed struct and map literals
Execute: exec semedit insert-construct –kind element –file routes.go –in-declaration routes –discriminator ‘map[string]int{“health”: 1}’ –source ‘“metrics”: “wrong”’
CLI invocation
$ exec semedit insert-construct --kind element --file routes.go --in-declaration routes --discriminator 'map[string]int{"health": 1}' --source '"metrics": "wrong"'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: validate structural plan output
Execute: exec semedit insert-construct –kind element –file routes.go –in-declaration routes –discriminator ‘map[string]int{“health”: 1}’ –source ‘“metrics”: 2’ –expected-revision stale
CLI invocation
$ exec semedit insert-construct --kind element --file routes.go --in-declaration routes --discriminator 'map[string]int{"health": 1}' --source '"metrics": 2' --expected-revision stale
Equivalent MCP tool call (semedit_semedit)
{}Expected error: expected_revision
Execute: exec semedit insert-construct –kind element –file routes.go –in-declaration routes –discriminator ‘map[string]int{“health”: 1}’ –source ‘“metrics”: 2’ –expected-revision ’ '
CLI invocation
$ exec semedit insert-construct --kind element --file routes.go --in-declaration routes --discriminator 'map[string]int{"health": 1}' --source '"metrics": 2' --expected-revision ' '
Equivalent MCP tool call (semedit_semedit)
{}Expected error: expected_revision
Execute: semedit insert-construct –kind entry –file routes.go –in-declaration routes –discriminator ‘map[string]int{“health”: 1}’ –source ‘“metrics”: 2’ –placement append
CLI invocation
$ semedit insert-construct --kind entry --file routes.go --in-declaration routes --discriminator 'map[string]int{"health": 1}' --source '"metrics": 2' --placement append
Equivalent MCP tool call (semantic_insert_construct)
{
"discriminator": "map[string]int{\"health\": 1}",
"file": "routes.go",
"in_declaration": "routes",
"kind": "entry",
"placement": "append",
"source": "\"metrics\": 2"
}Refuse duplicate keys, unknown struct members, positional literals, malformed elements, and repeated selectors without changing the source.
Source: insert_construct_element_refusal.txtar · Download raw file
Execute: exec semedit insert-construct –kind element –file config.go –in-declaration routes –discriminator ‘map[string]int{“health”: 1}’ –source ‘“health”: 2’
CLI invocation
$ exec semedit insert-construct --kind element --file config.go --in-declaration routes --discriminator 'map[string]int{"health": 1}' --source '"health": 2'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: already contains the typed key
Execute: exec semedit insert-construct –kind element –file config.go –in-declaration config –discriminator ‘Config{Health: 1}’ –source ‘Missing: 2’
CLI invocation
$ exec semedit insert-construct --kind element --file config.go --in-declaration config --discriminator 'Config{Health: 1}' --source 'Missing: 2'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: absent from the supplied type context
Execute: exec semedit insert-construct –kind element –file config.go –in-declaration point –discriminator ‘Point{1}’ –source ‘X: 2’
CLI invocation
$ exec semedit insert-construct --kind element --file config.go --in-declaration point --discriminator 'Point{1}' --source 'X: 2'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: positional struct literals are unsupported
Execute: exec semedit insert-construct –kind element –file config.go –in-declaration routes –discriminator ‘map[string]int{“health”: 1}’ –source ‘“metrics” 2’
CLI invocation
$ exec semedit insert-construct --kind element --file config.go --in-declaration routes --discriminator 'map[string]int{"health": 1}' --source '"metrics" 2'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: parse keyed composite element
Execute: exec semedit insert-construct –kind element –file config.go –in-declaration repeated –discriminator ‘map[string]int{“same”: 1}’ –source ‘“next”: 2’
CLI invocation
$ exec semedit insert-construct --kind element --file config.go --in-declaration repeated --discriminator 'map[string]int{"same": 1}' --source '"next": 2'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: literal selector matched 2 composites
insert_construct_java
Source: insert_construct_java.txtar · Download raw file
Execute: semedit insert-construct –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –in-function Widget.run –kind statement/expression –anchor start –source ‘audit();’
CLI invocation
$ semedit insert-construct --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --in-function Widget.run --kind statement/expression --anchor start --source 'audit();'
Equivalent MCP tool call (semantic_insert_construct)
{
"anchor": "start",
"file": "src/Widget.java",
"in_function": "Widget.run",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"kind": "statement/expression",
"language": "java",
"source": "audit();",
"trust_workspace": true
}Assert: Successfully inserted Java method construct
Unified AST transformation diff
+ package sample;
+ class Widget {
+ void run() {
+ audit();
+ if (ready()) { work(); }
+ }
+ }
Expected output state (Widget.java)
package sample;
class Widget {
void run() {
audit();
if (ready()) { work(); }
}
}insert_construct_java_element
Source: insert_construct_java_element.txtar · Download raw file
Execute: semedit insert-construct –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –in-declaration Widget.limits –kind element –discriminator ‘Map.of(“DAILY”, 1000)’ –source ‘“MONTHLY”, 5000’
CLI invocation
$ semedit insert-construct --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --in-declaration Widget.limits --kind element --discriminator 'Map.of("DAILY", 1000)' --source '"MONTHLY", 5000'
Equivalent MCP tool call (semantic_insert_construct)
{
"discriminator": "Map.of(\"DAILY\", 1000)",
"file": "src/Widget.java",
"in_declaration": "Widget.limits",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"kind": "element",
"language": "java",
"source": "\"MONTHLY\", 5000",
"trust_workspace": true
}Assert: Appended one element to the selected Java initializer
Unified AST transformation diff
- private final Map<String, Integer> limits = Map.of("DAILY", 1000);
package sample;
import java.util.Map;
class Widget {
+ private final Map<String, Integer> limits = Map.of("DAILY", 1000, "MONTHLY", 5000);
}
Expected output state (src/Widget.java)
package sample;
import java.util.Map;
class Widget {
private final Map<String, Integer> limits = Map.of("DAILY", 1000, "MONTHLY", 5000);
}insert_construct_java_loop
Source: insert_construct_java_loop.txtar · Download raw file
Execute: semedit insert-construct –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –in-function Widget.run –kind loop –anchor after –discriminator ‘if (ready()) { work(); }’ –source ‘for (int i = 0; i < 1; i++) { audit(); }’
CLI invocation
$ semedit insert-construct --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --in-function Widget.run --kind loop --anchor after --discriminator 'if (ready()) { work(); }' --source 'for (int i = 0; i < 1; i++) { audit(); }'
Equivalent MCP tool call (semantic_insert_construct)
{
"anchor": "after",
"discriminator": "if (ready()) { work(); }",
"file": "src/Widget.java",
"in_function": "Widget.run",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"kind": "loop",
"language": "java",
"source": "for (int i = 0; i \u003c 1; i++) { audit(); }",
"trust_workspace": true
}Assert: Successfully inserted Java method construct
Unified AST transformation diff
+ package sample;
+ class Widget {
+ void run() {
+ if (ready()) { work(); }
+ for (int i = 0; i < 1; i++) { audit(); }
+ }
+ }
Expected output state (Widget.java)
package sample;
class Widget {
void run() {
if (ready()) { work(); }
for (int i = 0; i < 1; i++) { audit(); }
}
}Test sentinel-error aware declaration insertion with alphabetical grouping
Source: insert_decl.txtar · Download raw file
Execute: semedit insert-decl –file api/errs.go –source ‘var ErrAlpha = errors.New(“alpha”)’
CLI invocation
$ semedit insert-decl --file api/errs.go --source 'var ErrAlpha = errors.New("alpha")'
Equivalent MCP tool call (semantic_insert_decl)
{
"file": "api/errs.go",
"source": "var ErrAlpha = errors.New(\"alpha\")"
}Execute: semedit insert-decl –file api/plain.go –source ‘var ErrMike = errors.New(“mike”)’
CLI invocation
$ semedit insert-decl --file api/plain.go --source 'var ErrMike = errors.New("mike")'
Equivalent MCP tool call (semantic_insert_decl)
{
"file": "api/plain.go",
"source": "var ErrMike = errors.New(\"mike\")"
}Execute: semedit insert-decl –file api/plain.go –source ‘var Patch = 3’
CLI invocation
$ semedit insert-decl --file api/plain.go --source 'var Patch = 3'
Equivalent MCP tool call (semantic_insert_decl)
{
"file": "api/plain.go",
"source": "var Patch = 3"
}Execute: semedit insert-decl –file api/noblock.go –source ‘var ErrSolo = errors.New(“solo”)’
CLI invocation
$ semedit insert-decl --file api/noblock.go --source 'var ErrSolo = errors.New("solo")'
Equivalent MCP tool call (semantic_insert_decl)
{
"file": "api/noblock.go",
"source": "var ErrSolo = errors.New(\"solo\")"
}Execute: semedit insert-decl –file api/documented.go –source ‘/* ErrTango documents the tango error. */ var ErrTango = “tango”’
CLI invocation
$ semedit insert-decl --file api/documented.go --source '/* ErrTango documents the tango error. */ var ErrTango = "tango"'
Equivalent MCP tool call (semantic_insert_decl)
{
"file": "api/documented.go",
"source": "/* ErrTango documents the tango error. */ var ErrTango = \"tango\""
}Unified AST transformation diff (api/documented.go)
package api
var (
+ /* ErrTango documents the tango error. */ ErrTango = "tango"
// ErrZulu documents the zulu error.
ErrZulu = "zulu"
)
Expected output state (api/documented.go)
package api
var (
/* ErrTango documents the tango error. */ ErrTango = "tango"
// ErrZulu documents the zulu error.
ErrZulu = "zulu"
)Unified AST transformation diff (api/errs.go)
package api
import "errors"
var (
+ ErrAlpha = errors.New("alpha")
ErrBravo = errors.New("bravo")
)
var Version = "1.0"
Expected output state (api/errs.go)
package api
import "errors"
var (
ErrAlpha = errors.New("alpha")
ErrBravo = errors.New("bravo")
)
var Version = "1.0"Unified AST transformation diff (api/noblock.go)
- import "fmt"
package api
+ import (
+ "errors"
+ "fmt"
+ )
+ var ErrSolo = errors.New("solo")
type Server struct{}
func (s *Server) Start() {
fmt.Println("start")
}
Expected output state (api/noblock.go)
package api
import (
"errors"
"fmt"
)
var ErrSolo = errors.New("solo")
type Server struct{}
func (s *Server) Start() {
fmt.Println("start")
}Unified AST transformation diff (api/plain.go)
package api
+ import "errors"
+ var Patch = 3
+ var ErrMike = errors.New("mike")
var Revision = "1.0"
Expected output state (api/plain.go)
package api
import "errors"
var Patch = 3
var ErrMike = errors.New("mike")
var Revision = "1.0"Exercise grouped const and var insertion, sentinel ordering, and standalone placement in one Go file.
Source: insert_decl_sequence.txtar · Download raw file
Execute: semedit insert-decl –file api/settings.go –source ‘const StatusPaused = “paused”’
CLI invocation
$ semedit insert-decl --file api/settings.go --source 'const StatusPaused = "paused"'
Equivalent MCP tool call (semantic_insert_decl)
{
"file": "api/settings.go",
"source": "const StatusPaused = \"paused\""
}Execute: semedit insert-decl –file api/settings.go –source ‘var ErrMike = errors.New(“mike”)’
CLI invocation
$ semedit insert-decl --file api/settings.go --source 'var ErrMike = errors.New("mike")'
Equivalent MCP tool call (semantic_insert_decl)
{
"file": "api/settings.go",
"source": "var ErrMike = errors.New(\"mike\")"
}Execute: semedit insert-decl –file api/settings.go –source ‘var BuildNumber = 3’
CLI invocation
$ semedit insert-decl --file api/settings.go --source 'var BuildNumber = 3'
Equivalent MCP tool call (semantic_insert_decl)
{
"file": "api/settings.go",
"source": "var BuildNumber = 3"
}Execute: semedit insert-decl –file api/settings.go –source ‘const BuildLabel = “debug”’ –group standalone
CLI invocation
$ semedit insert-decl --file api/settings.go --source 'const BuildLabel = "debug"' --group standalone
Equivalent MCP tool call (semantic_insert_decl)
{
"file": "api/settings.go",
"group": "standalone",
"source": "const BuildLabel = \"debug\""
}Execute: semedit insert-decl –file api/settings.go –source ‘var privateCache = false’ –access private –group standalone
CLI invocation
$ semedit insert-decl --file api/settings.go --source 'var privateCache = false' --access private --group standalone
Equivalent MCP tool call (semantic_insert_decl)
{
"access_modifier": "private",
"file": "api/settings.go",
"group": "standalone",
"source": "var privateCache = false"
}Unified AST transformation diff
- StatusReady = "ready"
- ErrAlpha = errors.New("alpha")
- ErrZulu = errors.New("zulu")
package api
import "errors"
+ const BuildLabel = "debug"
const (
+ StatusReady = "ready"
+ StatusPaused = "paused"
)
var (
+ ErrAlpha = errors.New("alpha")
+ ErrMike = errors.New("mike")
+ ErrZulu = errors.New("zulu")
+ BuildNumber = 3
)
var ExistingVersion = "1.0"
+ var privateCache = false
Expected output state (api/settings.go)
package api
import "errors"
const BuildLabel = "debug"
const (
StatusReady = "ready"
StatusPaused = "paused"
)
var (
ErrAlpha = errors.New("alpha")
ErrMike = errors.New("mike")
ErrZulu = errors.New("zulu")
BuildNumber = 3
)
var ExistingVersion = "1.0"
var privateCache = falseMultiline declaration source arrives directly on stdin, including quote and backslash bytes.
Source: insert_decl_stdin.txtar · Download raw file
Execute: semedit insert-decl –file api/settings.go –source -
CLI invocation
$ semedit insert-decl --file api/settings.go --source -
Equivalent MCP tool call (semantic_insert_decl)
{
"file": "api/settings.go",
"source": "-"
}Assert: Successfully inserted declaration.*
Unified AST transformation diff
package api
+ const (
+ Quoted = `quote " and \\ path`
+ Plain = 2
+ )
var Existing = 1
Expected output state (api/settings.go)
package api
const (
Quoted = `quote " and \\ path`
Plain = 2
)
var Existing = 1Test declaration insertion with placement qualifiers and import organization
Source: insert_declaration.txtar · Download raw file
Execute: semedit insert –file api/server.go –placement public_start –source ‘func InitServer() *Server { return &Server{} }’
CLI invocation
$ semedit insert --file api/server.go --placement public_start --source 'func InitServer() *Server { return &Server{} }'
Equivalent MCP tool call (semantic_insert_declaration)
{
"file": "api/server.go",
"placement": "public_start",
"source": "func InitServer() *Server { return \u0026Server{} }"
}Execute: semedit insert –file api/server.go –placement after_symbol –target Server.Start –source ‘func (s *Server) Stop() {}’
CLI invocation
$ semedit insert --file api/server.go --placement after_symbol --target Server.Start --source 'func (s *Server) Stop() {}'
Equivalent MCP tool call (semantic_insert_declaration)
{
"file": "api/server.go",
"placement": "after_symbol",
"source": "func (s *Server) Stop() {}",
"target_symbol": "Server.Start"
}Unified AST transformation diff
package api
import (
"fmt"
)
+ func InitServer() *Server { return &Server{} }
type Server struct{}
func (s *Server) Start() {
fmt.Println("start")
}
+ func (s *Server) Stop() {}
func (s *Server) internalRun() {}
Expected output state (api/server.go)
package api
import (
"fmt"
)
func InitServer() *Server { return &Server{} }
type Server struct{}
func (s *Server) Start() {
fmt.Println("start")
}
func (s *Server) Stop() {}
func (s *Server) internalRun() {}This CLI contract inserts one named field into a private Go struct and proves refused edits stay unchanged.
Source: insert_field.txtar · Download raw file
The target and field source must agree, and collisions and stale revisions make no disk edit.
Execute: semedit insert-field –file config.go –in-type config –symbol config.timeout –source ’timeout int’ –placement type_end
CLI invocation
$ semedit insert-field --file config.go --in-type config --symbol config.timeout --source 'timeout int' --placement type_end
Equivalent MCP tool call (semantic_insert_field)
{
"file": "config.go",
"in_type": "config",
"placement": "type_end",
"source": "timeout int",
"symbol": "config.timeout"
}Execute: exec semedit insert-field –file config.go –in-type config –symbol config.other –source ’timeout string’ –placement type_end
CLI invocation
$ exec semedit insert-field --file config.go --in-type config --symbol config.other --source 'timeout string' --placement type_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: declare exactly the named field
Execute: exec semedit insert-field –file config.go –in-type config –symbol config.timeout –source ’timeout string’ –placement type_end
CLI invocation
$ exec semedit insert-field --file config.go --in-type config --symbol config.timeout --source 'timeout string' --placement type_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: already exists
Execute: exec semedit insert-field –file config.go –in-type config –symbol config.traceID –source ’traceID string’ –placement type_end –expected-revision stale
CLI invocation
$ exec semedit insert-field --file config.go --in-type config --symbol config.traceID --source 'traceID string' --placement type_end --expected-revision stale
Equivalent MCP tool call (semedit_semedit)
{}Expected error: does not match the current selected-file revision
This CLI contract adds a field to the default empty struct emitted by semantic_insert_type.
Source: insert_field_empty_struct.txtar · Download raw file
Execute: semedit insert-field –file config.go –in-type options –symbol options.timeout –source ’timeout int’ –placement type_end
CLI invocation
$ semedit insert-field --file config.go --in-type options --symbol options.timeout --source 'timeout int' --placement type_end
Equivalent MCP tool call (semantic_insert_field)
{
"file": "config.go",
"in_type": "options",
"placement": "type_end",
"source": "timeout int",
"symbol": "options.timeout"
}This CLI contract refuses a field insertion when any same-package source uses positional literals.
Source: insert_field_unkeyed_refusal.txtar · Download raw file
Execute: exec semedit insert-field –file config.go –in-type config –symbol config.timeout –source ’timeout int’ –placement type_end
CLI invocation
$ exec semedit insert-field --file config.go --in-type config --symbol config.timeout --source 'timeout int' --placement type_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: unkeyed config literal
Execute: exec semedit insert-construct –kind field –file config.go –in-type config –source ‘port int’ –placement type_end
CLI invocation
$ exec semedit insert-construct --kind field --file config.go --in-type config --source 'port int' --placement type_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: unkeyed config literal
insert_function_java
Source: insert_function_java.txtar · Download raw file
Execute: semedit insert-func –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –source ‘public Widget() {}’
CLI invocation
$ semedit insert-func --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --source 'public Widget() {}'
Equivalent MCP tool call (semantic_insert_function)
{
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"source": "public Widget() {}",
"trust_workspace": true
}Assert: Inserted Java method or constructor
Unified AST transformation diff
package sample;
class Widget {
int size;
+ public Widget() {}
}
Expected output state (src/Widget.java)
package sample;
class Widget {
int size;
public Widget() {}
}Package initializers may be repeated, while an init-named method is not exempted from collision checks.
Source: insert_init_collisions.txtar · Download raw file
Execute: semedit insert-func –file api/init.go –source ‘func init() {}’
CLI invocation
$ semedit insert-func --file api/init.go --source 'func init() {}'
Equivalent MCP tool call (semantic_insert_function)
{
"file": "api/init.go",
"source": "func init() {}"
}Assert: Successfully inserted function
Execute: exec semedit insert-func –file api/init.go –source ‘func (t *T) init() {}’
CLI invocation
$ exec semedit insert-func --file api/init.go --source 'func (t *T) init() {}'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: already exists
insert_members_java
Source: insert_members_java.txtar · Download raw file
Execute: semedit insert-field –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –symbol Widget.timeout –source ‘private final int timeout;’ –placement type_end
CLI invocation
$ semedit insert-field --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --symbol Widget.timeout --source 'private final int timeout;' --placement type_end
Equivalent MCP tool call (semantic_insert_field)
{
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"placement": "type_end",
"source": "private final int timeout;",
"symbol": "Widget.timeout",
"trust_workspace": true
}Assert: Inserted one Java field
Unified AST transformation diff
package sample;
class Widget {
int size;
+ private final int timeout;
}
Expected output state (src/Widget.java)
package sample;
class Widget {
int size;
private final int timeout;
}Test specialized AST insertion tools: insert-func, insert-type, insert-decl, and explicit imports.
Source: insert_specialized.txtar · Download raw file
- Assert unsupported access modifier in Go is rejected
1. Insert struct type into api/server.go
CLI invocation
$ semedit insert-type --file api/server.go --source 'type Config struct { Port int }'
Equivalent MCP tool call (semantic_insert_type)
{
"file": "api/server.go",
"source": "type Config struct { Port int }"
}Assert: Successfully inserted type. file: api/server.go. symbol: Config. line (navigation only): [0-9]+.
2. Insert public method on Server (clusters after receiver definition)
CLI invocation
$ semedit insert-func --file api/server.go --source 'func (s *Server) Start() error { var _ = crand.Reader; return nil }'
Equivalent MCP tool call (semantic_insert_function)
{
"file": "api/server.go",
"source": "func (s *Server) Start() error { var _ = crand.Reader; return nil }"
}Assert: Successfully inserted function. file: api/server.go. symbol: Server.Start. line (navigation only): [0-9]+.
3. Insert directly after a pointer-receiver anchor.
CLI invocation
$ semedit insert-func --file api/server.go --placement after_symbol --target '(*Server).Start' --source 'func (s *Server) Stop() error { return nil }'
Equivalent MCP tool call (semantic_insert_function)
{
"file": "api/server.go",
"placement": "after_symbol",
"source": "func (s *Server) Stop() error { return nil }",
"target_symbol": "(*Server).Start"
}Assert: Successfully inserted function. file: api/server.go. symbol: Server.Stop. line (navigation only): [0-9]+.
4. Insert private method on Server (clusters in private section)
CLI invocation
$ semedit insert-func --file api/server.go --source 'func (s *Server) stop() error { return nil }'
Equivalent MCP tool call (semantic_insert_function)
{
"file": "api/server.go",
"source": "func (s *Server) stop() error { return nil }"
}Assert: Successfully inserted function. file: api/server.go.
5. Insert constant into existing const group
CLI invocation
$ semedit insert-decl --file api/server.go --source 'const DefaultPort = 8080'
Equivalent MCP tool call (semantic_insert_decl)
{
"file": "api/server.go",
"source": "const DefaultPort = 8080"
}Assert: Successfully inserted declaration. file: api/server.go.
6. Add explicit import with alias
CLI invocation
$ semedit imports --file api/server.go --add 'crand crypto/rand'
Equivalent MCP tool call (semantic_organize_imports)
{
"add": [
"crand crypto/rand"
],
"file": "api/server.go"
}Assert: Successfully organized imports.
7. Verify transformed file matches expected golden state
CLI invocation
$ exec semedit insert-func --file api/server.go --access protected --source 'func Helper() {}'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: must be one of .*infer, public, private
Unified AST transformation diff
package api
+ import crand "crypto/rand"
+ type Config struct{ Port int }
const (
StatusStarting = "starting"
StatusRunning = "running"
+ DefaultPort = 8080
)
type Server struct {
name string
}
+ func (s *Server) Start() error { var _ = crand.Reader; return nil }
+ func (s *Server) Stop() error { return nil }
func (s *Server) helper() {}
+ func (s *Server) stop() error { return nil }
Expected output state (api/server.go)
package api
import crand "crypto/rand"
type Config struct{ Port int }
const (
StatusStarting = "starting"
StatusRunning = "running"
DefaultPort = 8080
)
type Server struct {
name string
}
func (s *Server) Start() error { var _ = crand.Reader; return nil }
func (s *Server) Stop() error { return nil }
func (s *Server) helper() {}
func (s *Server) stop() error { return nil }WHY: Verify anchored insertion resolves a nested statement to its own lexical block and preserves the enclosing loop.
Source: insert_statement_in_loop.txtar · Download raw file
Execute: semedit insert-construct –file loop.go –kind statement/expression –in-function Process –discriminator ‘process(item)’ –source ‘audit(item)’ –anchor before
CLI invocation
$ semedit insert-construct --file loop.go --kind statement/expression --in-function Process --discriminator 'process(item)' --source 'audit(item)' --anchor before
Equivalent MCP tool call (semantic_insert_construct)
{
"anchor": "before",
"discriminator": "process(item)",
"file": "loop.go",
"in_function": "Process",
"kind": "statement/expression",
"source": "audit(item)"
}insert_type_java
Source: insert_type_java.txtar · Download raw file
Execute: semedit insert-type –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –source ‘private static class Helper {}’
CLI invocation
$ semedit insert-type --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --source 'private static class Helper {}'
Equivalent MCP tool call (semantic_insert_type)
{
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"source": "private static class Helper {}",
"trust_workspace": true
}Assert: Inserted Java nested type
Unified AST transformation diff
package sample;
class Widget {
int size;
+ private static class Helper {}
}
Expected output state (src/Widget.java)
package sample;
class Widget {
int size;
private static class Helper {}
}Inspect method-local Java constructs and return a reusable construct_path.
Source: inspect_construct_java.txtar · Download raw file
Execute: semedit inspect-construct –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –in-function Widget.run –kind if –discriminator ready()
CLI invocation
$ semedit inspect-construct --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --in-function Widget.run --kind if --discriminator ready()
Equivalent MCP tool call (semantic_inspect_construct)
{
"discriminator": "ready()",
"file": "src/Widget.java",
"in_function": "Widget.run",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"kind": "if",
"language": "java",
"trust_workspace": true
}Assert: construct_path”:\s*“if[0]
Assert: if (ready()) { work(); } else { miss(); }
Inspect the exact declaration source and revision through trusted JDT LS.
Source: inspect_java.txtar · Download raw file
Execute: semedit inspect-symbol –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –symbol Widget
CLI invocation
$ semedit inspect-symbol --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --symbol Widget
Equivalent MCP tool call (semantic_inspect_symbol)
{
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "Widget",
"trust_workspace": true
}Assert: kind”:\s*“selected_file
Assert: name”:\s*“Widget
Assert: source”:\s*“class Widget{}
Assert: source_extent”:\s*“declaration
Assert: revision”:\s*"[0-9a-f]{64}
Make inspect returns the complete server-projected range and exact variable line.
Source: inspect_make.txtar · Download raw file
Execute: semedit inspect-symbol –language make –trust-workspace –make-bin $SEMEDIT_TEST_MAKE_LS –file Read.mk –symbol all
CLI invocation
$ semedit inspect-symbol --language make --trust-workspace --make-bin $SEMEDIT_TEST_MAKE_LS --file Read.mk --symbol all
Equivalent MCP tool call (semantic_inspect_symbol)
{
"file": "Read.mk",
"language": "make",
"make_bin": "$SEMEDIT_TEST_MAKE_LS",
"symbol": "all",
"trust_workspace": true
}Assert: source": “all:\n\t@echo one\n\t@echo two
Assert: source_extent”: “server_range
Assert: interrupted recipe spans remain incomplete server projections
Execute: semedit inspect-symbol –language make –trust-workspace –make-bin $SEMEDIT_TEST_MAKE_LS –file Variables.mk –symbol X
CLI invocation
$ semedit inspect-symbol --language make --trust-workspace --make-bin $SEMEDIT_TEST_MAKE_LS --file Variables.mk --symbol X
Equivalent MCP tool call (semantic_inspect_symbol)
{
"file": "Variables.mk",
"language": "make",
"make_bin": "$SEMEDIT_TEST_MAKE_LS",
"symbol": "X",
"trust_workspace": true
}Assert: source”: “X = a
Assert: complete”: false
Inspect returns exact method source and declaration metadata without writing source
Source: inspect_read_go.txtar · Download raw file
Execute: semedit inspect-symbol –file api/server.go –symbol Server.Start
CLI invocation
$ semedit inspect-symbol --file api/server.go --symbol Server.Start
Equivalent MCP tool call (semantic_inspect_symbol)
{
"file": "api/server.go",
"symbol": "Server.Start"
}Assert: kind":\s*“method
Assert: qualified_name”:\s*“Server.Start
Assert: source”:\s*“func (s *Server) Start() {}
Assert: revision”:\s*"[0-9a-f]{64}
Assert: source_extent":\s*“declaration
Assert: path”:\s*“encoding/json
Assert: name”:\s*“fmtx
Assert: name”:\s*".
Execute: semedit inspect-symbol –file api/group.go –symbol IotaTarget
CLI invocation
$ semedit inspect-symbol --file api/group.go --symbol IotaTarget
Equivalent MCP tool call (semantic_inspect_symbol)
{
"file": "api/group.go",
"symbol": "IotaTarget"
}Assert: kind":\s*“constant
Assert: qualified_name”:\s*“IotaTarget
Assert: IotaTarget
Assert: iota
Assert: last
Execute: semedit inspect-symbol –file api/group.go –symbol LocalTarget
CLI invocation
$ semedit inspect-symbol --file api/group.go --symbol LocalTarget
Equivalent MCP tool call (semantic_inspect_symbol)
{
"file": "api/group.go",
"symbol": "LocalTarget"
}Assert: kind”:\s*“variable
Assert: source”:\s*“LocalTarget := \"local\\
Execute: semedit inspect-symbol –file api/server_test.go –symbol TestGroup
CLI invocation
$ semedit inspect-symbol --file api/server_test.go --symbol TestGroup
Equivalent MCP tool call (semantic_inspect_symbol)
{
"file": "api/server_test.go",
"symbol": "TestGroup"
}Assert: kind”:\s*“function
Execute: semedit inspect-symbol –symbol Child.Inherited
CLI invocation
$ semedit inspect-symbol --symbol Child.Inherited
Equivalent MCP tool call (semantic_inspect_symbol)
{
"symbol": "Child.Inherited"
}Assert: name”:\s*“Inherited
Assert: qualified_name”:\s*“Child.Inherited
Assert: file”:\s*“api/base.go
Execute: semedit inspect-symbol –symbol Duplicate
CLI invocation
$ semedit inspect-symbol --symbol Duplicate
Equivalent MCP tool call (semantic_inspect_symbol)
{
"symbol": "Duplicate"
}Assert: matches”:\s*[
Assert: file":\s*“ambiguous/a.go
Assert: file”:\s*“ambiguous/b.go
Expected error: symbol not found
Unified AST transformation diff
package api
import (
fmtx "encoding/json"
. "strings"
_ "net/http/httptest"
"net/http"
)
type Server struct{}
func (s *Server) Start() {}
Expected output state (api/server.go)
package api
import (
fmtx "encoding/json"
. "strings"
_ "net/http/httptest"
"net/http"
)
type Server struct{}
func (s *Server) Start() {}Installation help explains both scopes and the preinstalled binary requirement.
Source: install_help.txtar · Download raw file
Execute: semedit install –help
CLI invocation
$ semedit install --help
Equivalent MCP tool call (semedit_install)
{}Assert: Choose –scope user or –scope workspace
Assert: absolute path to an already installed semedit executable
Assert: Human-readable output is the default
Assert: –json
Assert: semedit install copilot –scope user –binary .*command -v semedit
Assert: semedit install copilot –scope workspace –binary .*command -v semedit
Assert: semedit install codex –scope user –binary .*command -v semedit
Assert: semedit install codex –scope workspace –binary .*command -v semedit
Assert: semedit install TARGET –help
Assert: default output shows the saved config path
Assert: Restart the target coding harness or reconnect its MCP session
Assert: dry-run is only a preview and writes nothing
Assert: not-installed.*does not mean MCP installation failed
Execute: semedit install copilot –help
CLI invocation
$ semedit install copilot --help
Equivalent MCP tool call (semedit_install)
{}Assert: Required: absolute path to an already installed semedit executable
Assert: –json
Assert: default output shows the saved config path
Assert: dry-run is only a preview and writes nothing
Execute: semedit install codex –help
CLI invocation
$ semedit install codex --help
Equivalent MCP tool call (semedit_install)
{}Assert: Required: absolute path to an already installed semedit executable
Assert: –json
Assert: default output shows the saved config path
Assert: dry-run is only a preview and writes nothing
Execute: semedit integration status copilot –help
CLI invocation
$ semedit integration status copilot --help
Equivalent MCP tool call (semedit_integration)
{}Assert: –json
Execute: semedit uninstall –help
CLI invocation
$ semedit uninstall --help
Equivalent MCP tool call (semedit_uninstall)
{}Assert: –json
Execute: semedit integration status copilot –scope workspace
CLI invocation
$ semedit integration status copilot --scope workspace
Equivalent MCP tool call (semedit_integration)
{}Assert: semedit is not installed for copilot (workspace)
Execute: semedit integration status copilot –scope workspace –json
CLI invocation
$ semedit integration status copilot --scope workspace --json
Equivalent MCP tool call (semedit_integration)
{}Assert: status”:\s*“not-installed
Assert: path”:\s*.*.mcp.json
The CLI replaces one typed constant in a private function body, updates every direct caller, and refuses mutable reads and unknown nested fields without changing files.
Source: introduce_parameter_go.txtar · Download raw file
Execute: exec semedit introduce-parameter –file service.go –symbol transform –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“mode”,“type”:“int”},“argument”:“3”}]’ –discriminator defaultMode –expected-revision stale
CLI invocation
$ exec semedit introduce-parameter --file service.go --symbol transform --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"mode","type":"int"},"argument":"3"}]' --discriminator defaultMode --expected-revision stale
Equivalent MCP tool call (semedit_semedit)
{}Expected error: expected_revision
Execute: exec semedit introduce-parameter –file service.go –symbol transform –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“mode”,“type”:“int”},“argument”:“4”}]’ –discriminator defaultMode
CLI invocation
$ exec semedit introduce-parameter --file service.go --symbol transform --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"mode","type":"int"},"argument":"4"}]' --discriminator defaultMode
Equivalent MCP tool call (semedit_semedit)
{}Expected error: selected expression
Execute: exec semedit introduce-parameter –file service.go –symbol shadowed –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“mode”,“type”:“int”},“argument”:“3”}]’ –discriminator defaultMode
CLI invocation
$ exec semedit introduce-parameter --file service.go --symbol shadowed --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"mode","type":"int"},"argument":"3"}]' --discriminator defaultMode
Equivalent MCP tool call (semedit_semedit)
{}Expected error: compile-time typed constant
Execute: exec semedit introduce-parameter –file service.go –symbol repeated –parameters ‘[{“source_index”:0,“parameter”:{“name”:“flag”,“type”:“bool”}},{“parameter”:{“name”:“enabled”,“type”:“bool”},“argument”:“true”}]’ –discriminator true
CLI invocation
$ exec semedit introduce-parameter --file service.go --symbol repeated --parameters '[{"source_index":0,"parameter":{"name":"flag","type":"bool"}},{"parameter":{"name":"enabled","type":"bool"},"argument":"true"}]' --discriminator true
Equivalent MCP tool call (semedit_semedit)
{}Expected error: resolve uniquely
Execute: exec semedit introduce-parameter –file service.go –symbol constantDecl –parameters ‘[{“parameter”:{“name”:“enabled”,“type”:“bool”},“argument”:“true”}]’ –discriminator true
CLI invocation
$ exec semedit introduce-parameter --file service.go --symbol constantDecl --parameters '[{"parameter":{"name":"enabled","type":"bool"},"argument":"true"}]' --discriminator true
Equivalent MCP tool call (semedit_semedit)
{}Expected error: is not constant
Execute: exec semedit introduce-parameter –file service.go –symbol overflow –parameters ‘[{“parameter”:{“name”:“small”,“type”:“int8”},“argument”:“257”}]’ –discriminator large
CLI invocation
$ exec semedit introduce-parameter --file service.go --symbol overflow --parameters '[{"parameter":{"name":"small","type":"int8"},"argument":"257"}]' --discriminator large
Equivalent MCP tool call (semedit_semedit)
{}Expected error: assignable to the appended parameter type
Execute: semedit introduce-parameter –file service.go –symbol transform –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“mode”,“type”:“mode”},“argument”:“3”}]’ –discriminator defaultMode
CLI invocation
$ semedit introduce-parameter --file service.go --symbol transform --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"mode","type":"mode"},"argument":"3"}]' --discriminator defaultMode
Equivalent MCP tool call (semantic_introduce_parameter)
{
"discriminator": "defaultMode",
"file": "service.go",
"parameters": "[{\"source_index\":0,\"parameter\":{\"name\":\"id\",\"type\":\"int\"}},{\"parameter\":{\"name\":\"mode\",\"type\":\"mode\"},\"argument\":\"3\"}]",
"symbol": "transform"
}Assert: Replaced the selected constant expression
Execute: exec semedit introduce-parameter –file service.go –symbol unsafe –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“mode”,“type”:“int”},“argument”:“2”}]’ –discriminator mutableMode
CLI invocation
$ exec semedit introduce-parameter --file service.go --symbol unsafe --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"mode","type":"int"},"argument":"2"}]' --discriminator mutableMode
Equivalent MCP tool call (semedit_semedit)
{}Expected error: compile-time typed constant
Execute: exec semedit introduce-parameter –file service.go –symbol transform –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“mode”,“type”:“int”},“argument”:“3”,“unknown”:true}]’ –discriminator defaultMode
CLI invocation
$ exec semedit introduce-parameter --file service.go --symbol transform --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"mode","type":"int"},"argument":"3","unknown":true}]' --discriminator defaultMode
Equivalent MCP tool call (semedit_semedit)
{}Expected error: unknown property
Java introduce-parameter delegates signature/caller updates to JDT LS, then replaces the selected expression.
Source: introduce_parameter_java.txtar · Download raw file
Execute: semedit introduce-parameter –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Service.java –symbol ‘Service.send(int)’ –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“enabled”,“type”:“boolean”},“argument”:“true”}]’ –discriminator true
CLI invocation
$ semedit introduce-parameter --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Service.java --symbol 'Service.send(int)' --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"enabled","type":"boolean"},"argument":"true"}]' --discriminator true
Equivalent MCP tool call (semantic_introduce_parameter)
{
"discriminator": "true",
"file": "src/Service.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"parameters": "[{\"source_index\":0,\"parameter\":{\"name\":\"id\",\"type\":\"int\"}},{\"parameter\":{\"name\":\"enabled\",\"type\":\"boolean\"},\"argument\":\"true\"}]",
"symbol": "Service.send(int)",
"trust_workspace": true
}Unified AST transformation diff (src/Caller.java)
- service.send(7);
package sample;
class Caller {
void run(Service service) {
+ service.send(7, true);
}
}
Expected output state (src/Caller.java)
package sample;
class Caller {
void run(Service service) {
service.send(7, true);
}
}Unified AST transformation diff (src/Service.java)
- void send(int id) {
- audit(id, true);
package sample;
class Service {
+ void send(int id, boolean enabled) {
+ audit(id, enabled);
}
}
Expected output state (src/Service.java)
package sample;
class Service {
void send(int id, boolean enabled) {
audit(id, enabled);
}
}The CLI replaces every parameter of a private function with one same-file object, rewrites bound body uses, and preserves call argument order in keyed literals.
Source: introduce_parameter_object_go.txtar · Download raw file
Execute: exec semedit introduce-parameter-object –file write.go –symbol write –destination-file write.go –parameter ‘{“name”:“options”,“type”:"_"}’ –fields ‘[{“source_index”:0,“field”:{“name”:“path”,“type”:“string”}},{“source_index”:1,“field”:{“name”:“data”,“type”:“string”}},{“source_index”:2,“field”:{“name”:“mode”,“type”:“uint32”}}]’
CLI invocation
$ exec semedit introduce-parameter-object --file write.go --symbol write --destination-file write.go --parameter '{"name":"options","type":"_"}' --fields '[{"source_index":0,"field":{"name":"path","type":"string"}},{"source_index":1,"field":{"name":"data","type":"string"}},{"source_index":2,"field":{"name":"mode","type":"uint32"}}]'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: private identifiers
Execute: exec semedit introduce-parameter-object –file write.go –symbol write –destination-file write.go –parameter ‘{“name”:“status”,“type”:“writeOptions”}’ –fields ‘[{“source_index”:0,“field”:{“name”:“path”,“type”:“string”}},{“source_index”:1,“field”:{“name”:“data”,“type”:“string”}},{“source_index”:2,“field”:{“name”:“mode”,“type”:“uint32”}}]’
CLI invocation
$ exec semedit introduce-parameter-object --file write.go --symbol write --destination-file write.go --parameter '{"name":"status","type":"writeOptions"}' --fields '[{"source_index":0,"field":{"name":"path","type":"string"}},{"source_index":1,"field":{"name":"data","type":"string"}},{"source_index":2,"field":{"name":"mode","type":"uint32"}}]'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: conflicts with an existing body binding
Execute: exec semedit introduce-parameter-object –file write.go –symbol write –destination-file write.go –parameter ‘{“name”:“options”,“type”:“writeOptions”}’ –fields ‘[{“source_index”:0,“field”:{“name”:“path”,“type”:“string”}}]’
CLI invocation
$ exec semedit introduce-parameter-object --file write.go --symbol write --destination-file write.go --parameter '{"name":"options","type":"writeOptions"}' --fields '[{"source_index":0,"field":{"name":"path","type":"string"}}]'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: every original parameter
Execute: semedit introduce-parameter-object –file write.go –symbol write –destination-file write.go –parameter ‘{“name”:“options”,“type”:“writeOptions”}’ –fields ‘[{“source_index”:0,“field”:{“name”:“path”,“type”:“string”}},{“source_index”:1,“field”:{“name”:“data”,“type”:“string”}},{“source_index”:2,“field”:{“name”:“mode”,“type”:“uint32”}}]’
CLI invocation
$ semedit introduce-parameter-object --file write.go --symbol write --destination-file write.go --parameter '{"name":"options","type":"writeOptions"}' --fields '[{"source_index":0,"field":{"name":"path","type":"string"}},{"source_index":1,"field":{"name":"data","type":"string"}},{"source_index":2,"field":{"name":"mode","type":"uint32"}}]'
Equivalent MCP tool call (semantic_introduce_parameter_object)
{
"destination_file": "write.go",
"fields": "[{\"source_index\":0,\"field\":{\"name\":\"path\",\"type\":\"string\"}},{\"source_index\":1,\"field\":{\"name\":\"data\",\"type\":\"string\"}},{\"source_index\":2,\"field\":{\"name\":\"mode\",\"type\":\"uint32\"}}]",
"file": "write.go",
"parameter": "{\"name\":\"options\",\"type\":\"writeOptions\"}",
"symbol": "write"
}Assert: Replaced all function parameters
Java parameter-object conversion preserves bound uses, caller argument order, and evaluation.
Source: introduce_parameter_object_java.txtar · Download raw file
Execute: semedit introduce-parameter-object –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Service.java –symbol ‘Service.send(int, boolean)’ –destination-file src/Service.java –parameter ‘{“name”:“options”,“type”:“SendOptions”}’ –fields ‘[{“source_index”:0,“field”:{“name”:“id”,“type”:“int”}},{“source_index”:1,“field”:{“name”:“enabled”,“type”:“boolean”}}]’
CLI invocation
$ semedit introduce-parameter-object --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Service.java --symbol 'Service.send(int, boolean)' --destination-file src/Service.java --parameter '{"name":"options","type":"SendOptions"}' --fields '[{"source_index":0,"field":{"name":"id","type":"int"}},{"source_index":1,"field":{"name":"enabled","type":"boolean"}}]'
Equivalent MCP tool call (semantic_introduce_parameter_object)
{
"destination_file": "src/Service.java",
"fields": "[{\"source_index\":0,\"field\":{\"name\":\"id\",\"type\":\"int\"}},{\"source_index\":1,\"field\":{\"name\":\"enabled\",\"type\":\"boolean\"}}]",
"file": "src/Service.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"parameter": "{\"name\":\"options\",\"type\":\"SendOptions\"}",
"symbol": "Service.send(int, boolean)",
"trust_workspace": true
}Unified AST transformation diff (src/Caller.java)
- service.send(loadId(), isEnabled());
package sample;
class Caller {
void run(Service service) {
+ service.send(new SendOptions(loadId(), isEnabled()));
}
}
Expected output state (src/Caller.java)
package sample;
class Caller {
void run(Service service) {
service.send(new SendOptions(loadId(), isEnabled()));
}
}Unified AST transformation diff (src/Service.java)
- void send(int id, boolean enabled) {
- audit(id, enabled);
package sample;
class Service {
+ void send(SendOptions options) {
+ audit(options.id(), options.enabled());
}
}
+ final class SendOptions {
+ private final int id;
+ private final boolean enabled;
+ SendOptions(int id, boolean enabled) {
+ this.id = id;
+ this.enabled = enabled;
}
+ int id() {
+ return this.id;
}
+ boolean enabled() {
+ return this.enabled;
}
}
Expected output state (src/Service.java)
package sample;
class Service {
void send(SendOptions options) {
audit(options.id(), options.enabled());
}
}
final class SendOptions {
private final int id;
private final boolean enabled;
SendOptions(int id, boolean enabled) {
this.id = id;
this.enabled = enabled;
}
int id() {
return this.id;
}
boolean enabled() {
return this.enabled;
}
}The CLI resolves named and imported parameter types in the selected subpackage even when another package declares the same unexported name.
Source: introduce_parameter_scope_go.txtar · Download raw file
Execute: semedit introduce-parameter –file service/service.go –symbol transform –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“mode”,“type”:“mode”},“argument”:“3”}]’ –discriminator defaultMode
CLI invocation
$ semedit introduce-parameter --file service/service.go --symbol transform --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"mode","type":"mode"},"argument":"3"}]' --discriminator defaultMode
Equivalent MCP tool call (semantic_introduce_parameter)
{
"discriminator": "defaultMode",
"file": "service/service.go",
"parameters": "[{\"source_index\":0,\"parameter\":{\"name\":\"id\",\"type\":\"int\"}},{\"parameter\":{\"name\":\"mode\",\"type\":\"mode\"},\"argument\":\"3\"}]",
"symbol": "transform"
}Assert: Replaced the selected constant expression
Execute: semedit introduce-parameter –file service/service.go –symbol transformImported –parameters ‘[{“source_index”:0,“parameter”:{“name”:“id”,“type”:“int”}},{“parameter”:{“name”:“step”,“type”:“imported.Mode”},“argument”:“4”}]’ –discriminator importedDefault
CLI invocation
$ semedit introduce-parameter --file service/service.go --symbol transformImported --parameters '[{"source_index":0,"parameter":{"name":"id","type":"int"}},{"parameter":{"name":"step","type":"imported.Mode"},"argument":"4"}]' --discriminator importedDefault
Equivalent MCP tool call (semantic_introduce_parameter)
{
"discriminator": "importedDefault",
"file": "service/service.go",
"parameters": "[{\"source_index\":0,\"parameter\":{\"name\":\"id\",\"type\":\"int\"}},{\"parameter\":{\"name\":\"step\",\"type\":\"imported.Mode\"},\"argument\":\"4\"}]",
"symbol": "transformImported"
}Assert: Replaced the selected constant expression
Lookup an unqualified symbol with multiple candidates
Source: lookup_ambiguous.txtar · Download raw file
Execute: semedit lookup –file api/server.go –symbol “Start”
CLI invocation
$ semedit lookup --file api/server.go --symbol "Start"
Equivalent MCP tool call (semantic_lookup)
{
"file": "api/server.go",
"symbol": "Start"
}Assert: ambiguous":\s*true
Assert: Server.Start
Assert: Client.Start
Bash CLI contracts: trusted selected-file lookup and explicit matching diagnostics; untrusted calls are rejected.
Source: lookup_bash.txtar · Download raw file
Execute: semedit lookup –language bash –trust-workspace –bash-bin $SEMEDIT_TEST_BASH_LS –file scripts/tool.sh –symbol f
CLI invocation
$ semedit lookup --language bash --trust-workspace --bash-bin $SEMEDIT_TEST_BASH_LS --file scripts/tool.sh --symbol f
Equivalent MCP tool call (semantic_lookup)
{
"bash_bin": "$SEMEDIT_TEST_BASH_LS",
"file": "scripts/tool.sh",
"language": "bash",
"symbol": "f",
"trust_workspace": true
}Assert: kind": “function
Assert: file”: “scripts/tool.sh
Expected error: workspace trust required
Execute: semedit verify –language bash –trust-workspace –bash-bin $SEMEDIT_TEST_BASH_LS –file scripts/tool.sh
CLI invocation
$ semedit verify --language bash --trust-workspace --bash-bin $SEMEDIT_TEST_BASH_LS --file scripts/tool.sh
Equivalent MCP tool call (semantic_verify)
{
"bash_bin": "$SEMEDIT_TEST_BASH_LS",
"file": "scripts/tool.sh",
"language": "bash",
"trust_workspace": true
}Assert: Verification clean: 0 diagnostics.
Expected error: operation is not supported
Execute: semedit lookup –language bash –trust-workspace –bash-bin $SEMEDIT_TEST_BASH_LS –file scripts/ambiguous.sh –symbol f
CLI invocation
$ semedit lookup --language bash --trust-workspace --bash-bin $SEMEDIT_TEST_BASH_LS --file scripts/ambiguous.sh --symbol f
Equivalent MCP tool call (semantic_lookup)
{
"bash_bin": "$SEMEDIT_TEST_BASH_LS",
"file": "scripts/ambiguous.sh",
"language": "bash",
"symbol": "f",
"trust_workspace": true
}Assert: ambiguous”: true
Execute: semedit lookup –language bash –trust-workspace –bash-bin $SEMEDIT_TEST_BASH_LS –file scripts/declarations.sh –symbol fun
CLI invocation
$ semedit lookup --language bash --trust-workspace --bash-bin $SEMEDIT_TEST_BASH_LS --file scripts/declarations.sh --symbol fun
Equivalent MCP tool call (semantic_lookup)
{
"bash_bin": "$SEMEDIT_TEST_BASH_LS",
"file": "scripts/declarations.sh",
"language": "bash",
"symbol": "fun",
"trust_workspace": true
}Assert: kind": “function
Execute: semedit lookup –language bash –trust-workspace –bash-bin $SEMEDIT_TEST_BASH_LS –file scripts/declarations.sh –symbol loc
CLI invocation
$ semedit lookup --language bash --trust-workspace --bash-bin $SEMEDIT_TEST_BASH_LS --file scripts/declarations.sh --symbol loc
Equivalent MCP tool call (semantic_lookup)
{
"bash_bin": "$SEMEDIT_TEST_BASH_LS",
"file": "scripts/declarations.sh",
"language": "bash",
"symbol": "loc",
"trust_workspace": true
}Assert: kind”: “variable
Unified AST transformation diff
#!/usr/bin/env bash
f() { echo safe; }
Expected output state (scripts/tool.sh)
#!/usr/bin/env bash
f() { echo safe; }Lookup through the standalone Haskell CLI backend and its explicitly configured toolchain.
Source: lookup_haskell.txtar · Download raw file
Execute: semedit lookup –language haskell –haskell-standalone –trust-workspace –ghc-bin $SEMEDIT_TEST_GHC –hls-bin $SEMEDIT_TEST_HLS –ghc-version 9.8.2 –hls-version 2.9.0 –file src/Widget.hs –symbol Widget
CLI invocation
$ semedit lookup --language haskell --haskell-standalone --trust-workspace --ghc-bin $SEMEDIT_TEST_GHC --hls-bin $SEMEDIT_TEST_HLS --ghc-version 9.8.2 --hls-version 2.9.0 --file src/Widget.hs --symbol Widget
Equivalent MCP tool call (semantic_lookup)
{
"file": "src/Widget.hs",
"ghc_bin": "$SEMEDIT_TEST_GHC",
"ghc_version": "9.8.2",
"hls_bin": "$SEMEDIT_TEST_HLS",
"hls_version": "2.9.0",
"language": "haskell",
"standalone_haskell": true,
"symbol": "Widget",
"trust_workspace": true
}Assert: file”:\s*“src/Widget.hs
Assert: symbol”:\s*“Widget
Lookup methods declared by and embedded into a package interface.
Source: lookup_interface.txtar · Download raw file
Execute: semedit lookup –file api/outer.go –symbol “TransactionalSink.Write”
CLI invocation
$ semedit lookup --file api/outer.go --symbol "TransactionalSink.Write"
Equivalent MCP tool call (semantic_lookup)
{
"file": "api/outer.go",
"symbol": "TransactionalSink.Write"
}Assert: definition”:
Assert: kind":\s*“method
Assert: file”:\s*“api/base.go
Assert: line”:\s*4
Assert: symbol":\s*“TransactionalSink.Write
Lookup through the Java CLI backend and an explicitly configured JDT LS home.
Source: lookup_java.txtar · Download raw file
Execute: semedit lookup –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –symbol Widget
CLI invocation
$ semedit lookup --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --symbol Widget
Equivalent MCP tool call (semantic_lookup)
{
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "Widget",
"trust_workspace": true
}Assert: file”:\s*“src/Widget.java
Assert: symbol”:\s*“Widget
Java lookup discovers the Maven reactor root without invoking Maven.
Source: lookup_java_maven_reactor.txtar · Download raw file
Execute: semedit lookup –language java –trust-workspace –import-maven –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file module/src/Widget.java –symbol Widget
CLI invocation
$ semedit lookup --language java --trust-workspace --import-maven --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file module/src/Widget.java --symbol Widget
Equivalent MCP tool call (semantic_lookup)
{
"file": "module/src/Widget.java",
"import_maven": true,
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "Widget",
"trust_workspace": true
}Assert: file”:\s*“module/src/Widget.java
Assert: kind”:\s*“class
Java lookup distinguishes overloads by normalized parameter signatures.
Source: lookup_java_overloads.txtar · Download raw file
Execute: semedit lookup –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src –symbol OrderService.process
CLI invocation
$ semedit lookup --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src --symbol OrderService.process
Equivalent MCP tool call (semantic_lookup)
{
"file": "src",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "OrderService.process",
"trust_workspace": true
}Assert: qualified_name”:\s*“OrderService.process(Order)
Assert: qualified_name”:\s*“OrderService.process(Order, boolean)
Execute: semedit inspect-symbol –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src –symbol OrderService.process
CLI invocation
$ semedit inspect-symbol --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src --symbol OrderService.process
Equivalent MCP tool call (semantic_inspect_symbol)
{
"file": "src",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "OrderService.process",
"trust_workspace": true
}Assert: qualified_name”:\s*“OrderService.process(Order)
Assert: qualified_name”:\s*“OrderService.process(Order, boolean)
Kotlin CLI contracts: trusted class/function lookup and ambiguity, not-found, untrusted denial, selected-file diagnostics, and timeout on wrong-URI diagnostics.
Source: lookup_kotlin.txtar · Download raw file
Execute: semedit lookup –language kotlin –trust-workspace –kotlin-bin $SEMEDIT_TEST_KOTLIN_LS –file src/Widget.kt –symbol launch
CLI invocation
$ semedit lookup --language kotlin --trust-workspace --kotlin-bin $SEMEDIT_TEST_KOTLIN_LS --file src/Widget.kt --symbol launch
Equivalent MCP tool call (semantic_lookup)
{
"file": "src/Widget.kt",
"kotlin_bin": "$SEMEDIT_TEST_KOTLIN_LS",
"language": "kotlin",
"symbol": "launch",
"trust_workspace": true
}Assert: kind”: “function
Execute: semedit lookup –language kotlin –trust-workspace –kotlin-bin $SEMEDIT_TEST_KOTLIN_LS –file src/Widget.kt –symbol Widget
CLI invocation
$ semedit lookup --language kotlin --trust-workspace --kotlin-bin $SEMEDIT_TEST_KOTLIN_LS --file src/Widget.kt --symbol Widget
Equivalent MCP tool call (semantic_lookup)
{
"file": "src/Widget.kt",
"kotlin_bin": "$SEMEDIT_TEST_KOTLIN_LS",
"language": "kotlin",
"symbol": "Widget",
"trust_workspace": true
}Assert: "file":\s*"src/Widget.kt\
Assert: "symbol":\s*"Widget\
Execute: semedit lookup –language kotlin –trust-workspace –kotlin-bin $SEMEDIT_TEST_KOTLIN_LS –file src/Widget.kt –symbol Widget
CLI invocation
$ semedit lookup --language kotlin --trust-workspace --kotlin-bin $SEMEDIT_TEST_KOTLIN_LS --file src/Widget.kt --symbol Widget
Equivalent MCP tool call (semantic_lookup)
{
"file": "src/Widget.kt",
"kotlin_bin": "$SEMEDIT_TEST_KOTLIN_LS",
"language": "kotlin",
"symbol": "Widget",
"trust_workspace": true
}Assert: "ambiguous": true
Expected error: workspace trust required
Expected error: kotlin symbol not found
Execute: semedit verify –language kotlin –trust-workspace –kotlin-bin $SEMEDIT_TEST_KOTLIN_LS –file src/Widget.kt
CLI invocation
$ semedit verify --language kotlin --trust-workspace --kotlin-bin $SEMEDIT_TEST_KOTLIN_LS --file src/Widget.kt
Equivalent MCP tool call (semantic_verify)
{
"file": "src/Widget.kt",
"kotlin_bin": "$SEMEDIT_TEST_KOTLIN_LS",
"language": "kotlin",
"trust_workspace": true
}Assert: Verification clean: 0 diagnostics.
Execute: semedit verify –language kotlin –trust-workspace –kotlin-bin $SEMEDIT_TEST_KOTLIN_LS –file src/Widget.kt
CLI invocation
$ semedit verify --language kotlin --trust-workspace --kotlin-bin $SEMEDIT_TEST_KOTLIN_LS --file src/Widget.kt
Equivalent MCP tool call (semantic_verify)
{
"file": "src/Widget.kt",
"kotlin_bin": "$SEMEDIT_TEST_KOTLIN_LS",
"language": "kotlin",
"trust_workspace": true
}Assert: selected Kotlin warning
Expected error: diagnostics were not published before the bounded timeout
Expected error: operation is not supported
Makefile CLI contracts: trusted selected-file target lookup; untrusted calls are rejected.
Source: lookup_make.txtar · Download raw file
Execute: semedit lookup –language make –trust-workspace –make-bin $SEMEDIT_TEST_MAKE_LS –file Makefile –symbol all
CLI invocation
$ semedit lookup --language make --trust-workspace --make-bin $SEMEDIT_TEST_MAKE_LS --file Makefile --symbol all
Equivalent MCP tool call (semantic_lookup)
{
"file": "Makefile",
"language": "make",
"make_bin": "$SEMEDIT_TEST_MAKE_LS",
"symbol": "all",
"trust_workspace": true
}Assert: kind”: “function
Assert: file”: “Makefile
Expected error: workspace trust required
Expected error: verification is unsupported
Expected error: symbol not found in selected file
Expected error: symbol not found in selected file
Execute: semedit lookup –language make –trust-workspace –make-bin $SEMEDIT_TEST_MAKE_LS –file Ambiguous.mk –symbol all
CLI invocation
$ semedit lookup --language make --trust-workspace --make-bin $SEMEDIT_TEST_MAKE_LS --file Ambiguous.mk --symbol all
Equivalent MCP tool call (semantic_lookup)
{
"file": "Ambiguous.mk",
"language": "make",
"make_bin": "$SEMEDIT_TEST_MAKE_LS",
"symbol": "all",
"trust_workspace": true
}Assert: ambiguous”: true
Unified AST transformation diff
all:
@touch ran-marker
Expected output state (Makefile)
all:
@touch ran-markerLookup a method symbol by receiver and name
Source: lookup_method.txtar · Download raw file
Execute: semedit lookup –file api/server.go –symbol “Server.Start”
CLI invocation
$ semedit lookup --file api/server.go --symbol "Server.Start"
Equivalent MCP tool call (semantic_lookup)
{
"file": "api/server.go",
"symbol": "Server.Start"
}Assert: file":\s*“api/server.go
Assert: symbol”:\s*“Server.Start
Lookup a non-existent symbol should fail with non-zero exit code
Source: lookup_not_found.txtar · Download raw file
Execute: exec semedit lookup –file api/server.go –symbol “NonExistent”
CLI invocation
$ exec semedit lookup --file api/server.go --symbol "NonExistent"
Equivalent MCP tool call (semedit_semedit)
{}Expected error: symbol not found
Receiver lookup returns its field definition while local bindings remain usage data.
Source: lookup_receiver_scoping.txtar · Download raw file
Execute: semedit lookup –file api/dispatch.go –symbol “Dispatcher.sink”
CLI invocation
$ semedit lookup --file api/dispatch.go --symbol "Dispatcher.sink"
Equivalent MCP tool call (semantic_lookup)
{
"file": "api/dispatch.go",
"symbol": "Dispatcher.sink"
}Assert: definition”:
Assert: definition":\s*{\s*“name”:\s*“sink
Assert: kind”:\s*“field
Assert: symbol”:\s*“Dispatcher.sink
Execute: semedit lookup –file api/dispatch.go –symbol “sink”
CLI invocation
$ semedit lookup --file api/dispatch.go --symbol "sink"
Equivalent MCP tool call (semantic_lookup)
{
"file": "api/dispatch.go",
"symbol": "sink"
}Assert: definition”:
Assert: kind":\s*“function
Assert: usages”:
Lookup through the Rust CLI backend and its configured language server.
Source: lookup_rust.txtar · Download raw file
Execute: semedit lookup –language rust –trust-workspace –file src/lib.rs –symbol Widget
CLI invocation
$ semedit lookup --language rust --trust-workspace --file src/lib.rs --symbol Widget
Equivalent MCP tool call (semantic_lookup)
{
"file": "src/lib.rs",
"language": "rust",
"symbol": "Widget",
"trust_workspace": true
}Assert: file":\s*“src/lib.rs
Assert: symbol”:\s*“Widget
Later-line Rust lookup reports the absolute UTF-8 byte offset.
Source: lookup_rust_later_line.txtar · Download raw file
fake server symbol starts after the UTF-16 encoding of “// 😀 “.
Execute: semedit lookup –language rust –trust-workspace –file src/lib.rs –symbol Widget
CLI invocation
$ semedit lookup --language rust --trust-workspace --file src/lib.rs --symbol Widget
Equivalent MCP tool call (semantic_lookup)
{
"file": "src/lib.rs",
"language": "rust",
"symbol": "Widget",
"trust_workspace": true
}Assert: line”: 2
Assert: column”: 7
Lookup through the Scala CLI backend and direct, pinned Metals and Java executables.
Source: lookup_scala.txtar · Download raw file
Execute: semedit lookup –language scala –trust-workspace –metals-bin $SEMEDIT_TEST_METALS –java-bin $SEMEDIT_TEST_JAVA –java-version 21 –file src/Widget.scala –symbol Widget
CLI invocation
$ semedit lookup --language scala --trust-workspace --metals-bin $SEMEDIT_TEST_METALS --java-bin $SEMEDIT_TEST_JAVA --java-version 21 --file src/Widget.scala --symbol Widget
Equivalent MCP tool call (semantic_lookup)
{
"file": "src/Widget.scala",
"java_bin": "$SEMEDIT_TEST_JAVA",
"java_version": "21",
"language": "scala",
"metals_bin": "$SEMEDIT_TEST_METALS",
"symbol": "Widget",
"trust_workspace": true
}Assert: file”:\s*“src/Widget.scala
Assert: symbol”:\s*“Widget
Trusted Maven compile uses a fixed goal and direct system binary execution.
Source: maven_compile_system.txtar · Download raw file
Execute: semedit maven-compile –trust-workspace –maven-tool system –maven-bin $SEMEDIT_TEST_MAVEN
CLI invocation
$ semedit maven-compile --trust-workspace --maven-tool system --maven-bin $SEMEDIT_TEST_MAVEN
Equivalent MCP tool call (semantic_maven_compile)
{
"maven_bin": "$SEMEDIT_TEST_MAVEN",
"maven_tool": "system",
"trust_workspace": true
}Assert: goal”:“test-compile
Assert: tool”:“system
Assert: exit_code”:0
Nonzero Maven exits surface the structured result and bounded log tail.
Source: maven_failure_result.txtar · Download raw file
Execute: exec semedit maven-test –trust-workspace –maven-tool system –maven-bin $WORK/mvn-fail
CLI invocation
$ exec semedit maven-test --trust-workspace --maven-tool system --maven-bin $WORK/mvn-fail
Equivalent MCP tool call (semedit_semedit)
{}Expected error: exit_code": 7
Expected error: failure-log
Network access is opt-in and removes Maven offline mode only when requested.
Source: maven_network_control.txtar · Download raw file
Execute: semedit maven-test –trust-workspace –maven-tool system –maven-bin $SEMEDIT_TEST_MAVEN –allow-network
CLI invocation
$ semedit maven-test --trust-workspace --maven-tool system --maven-bin $SEMEDIT_TEST_MAVEN --allow-network
Equivalent MCP tool call (semantic_maven_test)
{
"allow_network": true,
"maven_bin": "$SEMEDIT_TEST_MAVEN",
"maven_tool": "system",
"trust_workspace": true
}Assert: exit_code":0
Maven output is bounded and reports explicit truncation metadata.
Source: maven_output_truncation.txtar · Download raw file
Execute: exec semedit maven-test –trust-workspace –maven-tool system –maven-bin $WORK/mvn-large
CLI invocation
$ exec semedit maven-test --trust-workspace --maven-tool system --maven-bin $WORK/mvn-large
Equivalent MCP tool call (semedit_semedit)
{}Expected error: stderr_truncated": true
Expected error: log_tail
A nested root is accepted only when it remains within the trusted cwd.
Source: maven_root_selection.txtar · Download raw file
Execute: exec semedit maven-test –root ../ –trust-workspace –maven-tool system –maven-bin $SEMEDIT_TEST_MAVEN
CLI invocation
$ exec semedit maven-test --root ../ --trust-workspace --maven-tool system --maven-bin $SEMEDIT_TEST_MAVEN
Equivalent MCP tool call (semedit_semedit)
{}Expected error: outside the trusted workspace
Wrapper selection remains root-local and uses the fixed test goal.
Source: maven_test_wrapper.txtar · Download raw file
Execute: semedit maven-test –trust-workspace –maven-tool wrapper
CLI invocation
$ semedit maven-test --trust-workspace --maven-tool wrapper
Equivalent MCP tool call (semantic_maven_test)
{
"maven_tool": "wrapper",
"trust_workspace": true
}Assert: goal":“test
Assert: tool”:“wrapper
Assert: exit_code”:0
Maven execution is refused without request-scoped trust.
Source: maven_untrusted.txtar · Download raw file
Execute: exec semedit maven-test –maven-tool system –maven-bin $SEMEDIT_TEST_MAVEN
CLI invocation
$ exec semedit maven-test --maven-tool system --maven-bin $SEMEDIT_TEST_MAVEN
Equivalent MCP tool call (semedit_semedit)
{}Expected error: workspace trust required
Maven wrappers must resolve canonically inside the selected root.
Source: maven_wrapper_escape.txtar · Download raw file
Execute: exec semedit maven-test –trust-workspace –maven-tool wrapper
CLI invocation
$ exec semedit maven-test --trust-workspace --maven-tool wrapper
Equivalent MCP tool call (semedit_semedit)
{}Expected error: wrapper must resolve within the workspace root
Bash and Make MCP tools/list contract: expose lookup and Bash verify without unsupported mutation tools.
Source: mcp_bash_make_tools.txtar · Download raw file
Execute: semedit mcp –live-reload –enabled-languages=bash,make
CLI invocation
$ semedit mcp --live-reload --enabled-languages=bash,make
Equivalent MCP tool call (semedit_mcp)
{}Assert: name":\s*“semantic_lookup
Assert: name”:\s*“semantic_verify
One buffered batch sees the first unsaved caller edit during signature planning, advertises the tool, and publishes only the final typed callers.
Source: mcp_batch_change_signature.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: name”\s*:\s*“semantic_change_signature
Assert: isError”:false
Buffered extraction reports no finalized target aliases after later removal, same-name replacement, and rename.
Source: mcp_batch_contract_receipt_lifecycle.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
A buffered insertion is visible to extraction, then a later operation resolves the generated interface.
Source: mcp_batch_contracts.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
A guarded batch child accepts the full-file revision of its current buffered owner.
Source: mcp_batch_expected_revision_current.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
A guarded batch child refuses a pre-batch revision after an earlier child edits its owner.
Source: mcp_batch_expected_revision_stale.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: expected_revision does not match captured source
Compose a body edit, constant extraction, and later use through one buffered MCP batch.
Source: mcp_batch_extract_constant.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Compose an earlier buffered declaration, multiple-output extraction, and helper rename.
Source: mcp_batch_extract_function_multiple_outputs.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Assert: operation":“extract_function
Assert: status”:“applied_working
A second extraction resolves the first child’s generated type from the batch working overlay.
Source: mcp_batch_extract_type_overlay.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:false
Assert: applied_working
Extract a typed first argument, rename the new local, then edit through the same buffered server.
Source: mcp_batch_extract_variable.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Assert: operation":“extract_variable
Assert: status”:“applied_working
This mixed batch inserts a contract, generates its missing implementation, then edits the unsaved generated method body.
Source: mcp_batch_implement_contract.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:false
This MCP batch inserts into a declaration after it has been replaced in the shared working view and omits live selectors until publication.
Source: mcp_batch_insert_construct_element.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: applied_working
This MCP batch adds a private type then a field against the shared working view and reports buffered application.
Source: mcp_batch_insert_field.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Assert: applied_working
One buffered batch discovers an earlier unsaved caller edit, introduces a parameter, and lets a later insertion use the final signature.
Source: mcp_batch_introduce_parameter_go.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
One buffered batch sees a newly inserted direct caller before converting all parameters, then edits the surviving function through its new object shape.
Source: mcp_batch_introduce_parameter_object_go.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Buffered parameter-object results omit live function_target claims until the batch publishes its final view.
Source: mcp_batch_introduce_parameter_object_target_go.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
One buffered batch resolves local and imported parameter types in the selected subpackage despite an unrelated package’s same-named type.
Source: mcp_batch_introduce_parameter_scope_go.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Assert: status":\s*“ok
Assert: diagnostic_delta”:
Assert: severity":3
A net-new Go compiler error leaves the batch applied, reports its delta, and signals an MCP error.
Source: mcp_batch_introduced_go_error.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: status":\s*“applied_with_diagnostics
Assert: severity”:1
Assert: introduced":[.*undefined: missing
A new informational Go diagnostic remains visible in the delta without turning a batch into an MCP error.
Source: mcp_batch_introduced_go_information.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Assert: status":\s*“ok
Assert: diagnostic_delta”:
Assert: severity":3
The second Java field insertion uses the first insertion as its member anchor.
Source: mcp_batch_java_shared_buffers.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Assert: applied_working
A failed move observes prior buffered dependencies and publishes only the completed earlier edit.
Source: mcp_batch_move_buffered_refusal.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: source-package dependency
Assert: file":“legacy/source.go
Assert: destination_file”:“api/dest.go
Public MCP batching moves declarations across files and within a file without changing unrelated headers.
Source: mcp_batch_move_construct.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: destination_file”:“one.go
Assert: destination_file”:“two.go
Assert: diagnostic_status”:“deferred
Assert: final_diff”:
Public MCP failures preserve preceding moves and explicitly refuse invalid destinations.
Source: mcp_batch_move_construct_failure.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: destination_file":“missing.go
Assert: no such file or directory
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:true
Assert: parse destination file
Assert: final_diff":
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: same Go package
Assert: final_diff":
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: source-package dependency
Assert: final_diff":
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: regular Go source file
Assert: final_diff":
Structural moves retain test and matching inactive files while an unrelated batch type error is temporary.
Source: mcp_batch_move_same_package_scope.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Assert: destination_file":“b_test.go
Assert: destination_file”:“hidden_b.go
Earlier unsaved calls, cross-file and cross-package moves, rename, and later body edits share one working revision.
Source: mcp_batch_move_shared_cross_package.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:false
Assert: destination_file":“legacy/spare.go
Assert: destination_file”:“api/dest.go
Assert: file”:“legacy/spare.go
Assert: origin_file”:“legacy/source.go
Assert: file”:“api/dest.go
Assert: origin_file”:“legacy/spare.go
Assert: symbol”:“Final
Assert: caller/use.go
A partially executed batch reports final failure and the successful/failed child records before diffs.
Source: mcp_batch_partial_critical_text.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: Critical result (JSON):
Assert: status”:“error
Assert: tool”:“semantic_replace_body
Assert: expected_revision does not match captured source
Assert: Batch child results are intermediate and do not provide final continuation targets.
MCP batch text places a successful typed edit receipt before the full diff body.
Source: mcp_batch_receipt_critical_text.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: Critical result (JSON):
Assert: operation”:“migrate-type
Assert: schema_version”:“semedit.edit-receipt/v1
Assert: status”:“applied_working
A failed later batch edit leaves successful rename edits verbatim until final normalization can run.
Source: mcp_batch_rename_defers_formatting.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:true
Final batch hooks require trust on that request and use it only for the selected root.
Source: mcp_batch_request_trust.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: isError":false
Unified AST transformation diff (value.go)
package sample
func First() int { return 0 }
func Second() int { return 0 }
Expected output state (value.go)
package sample
func First() int { return 0 }
func Second() int { return 0 }Unified AST transformation diff (.scratch/worktrees/selected/value.go)
- func Second() int { return 0 }
package selected
+ func Second() int {
+ return 2
+ }
Expected output state (.scratch/worktrees/selected/value.go)
package selected
func Second() int {
return 2
}Unified AST transformation diff (value_test.go)
- t.Fatalf("unexpected result")
package sample
import "testing"
func TestFirst(t *testing.T) {
if First() != 0 {
+ t.Errorf("unexpected result")
}
}
Expected output state (value_test.go)
package sample
import "testing"
func TestFirst(t *testing.T) {
if First() != 0 {
t.Errorf("unexpected result")
}
}A safe-delete child must analyze references inserted into the current batch overlay and preserve prior child edits on refusal.
Source: mcp_batch_safe_delete_overlay_refusal.txtar · Download raw file
Execute: semedit mcp –live-reload
CLI invocation
$ semedit mcp --live-reload
Equivalent MCP tool call (semedit_mcp)
{}Assert: status":“error
Assert: safe_delete found another Go identifier named
A buffered batch may insert an unrelated declaration before safely deleting an unreferenced private function.
Source: mcp_batch_safe_delete_success.txtar · Download raw file
Execute: semedit mcp –live-reload
CLI invocation
$ semedit mcp --live-reload
Equivalent MCP tool call (semedit_mcp)
{}Assert: status”:“ok
Execute: semedit replace-body –file decls.go –symbol keep –body ‘return 3’
CLI invocation
$ semedit replace-body --file decls.go --symbol keep --body 'return 3'
Equivalent MCP tool call (semantic_replace_body)
{
"body": "return 3",
"file": "decls.go",
"symbol": "keep"
}Assert: Successfully replaced body
Execute: semedit lookup –file decls.go –symbol keep
CLI invocation
$ semedit lookup --file decls.go --symbol keep
Equivalent MCP tool call (semantic_lookup)
{
"file": "decls.go",
"symbol": "keep"
}Assert: symbol”: “keep
A regular buffered MCP batch creates a scaffold parent only when final publication succeeds.
Source: mcp_batch_scaffold_new_directory.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Unified AST transformation diff
+ package batchscaffold
Expected output state (generated/model.go)
package batchscaffoldA selected main-module edit skips an unrelated nested module with an unavailable dependency.
Source: mcp_batch_scoped_nested_module.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: status”:“ok
Assert: package_pattern”:"./app
Unified AST transformation diff (app/app.go)
- func Value() int { return 1 }
package app
+ func Value() int {
+ return 2
+ }
Expected output state (app/app.go)
package app
func Value() int {
return 2
}Unified AST transformation diff (go.mod)
module example.test/main
go 1.23
Expected output state (go.mod)
module example.test/main
go 1.23Unified AST transformation diff (tools/goctl/go.mod)
module example.test/goctl
go 1.23
require example.invalid/missing v0.0.1
Expected output state (tools/goctl/go.mod)
module example.test/goctl
go 1.23
require example.invalid/missing v0.0.1Editing a nested module verifies that module and its reverse importer without verifying the parent module.
Source: mcp_batch_scoped_nested_reverse_importer.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: status":“ok
Assert: module_root”:“tools/goctl
Assert: package_pattern”:"./consumer ./lib
Unified AST transformation diff
- func Value() int { return 1 }
package lib
+ func Value() int {
+ return 2
+ }
Expected output state (tools/goctl/lib/lib.go)
package lib
func Value() int {
return 2
}A Go batch verifies the edited package, transitive importers, and external-test importers.
Source: mcp_batch_scoped_verification.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: status":“ok
Assert: package_pattern”:"./consumer ./lib ./testconsumer
Unified AST transformation diff
- func Value() int { return 1 }
package lib
+ func Value() int {
+ return 2
+ }
Expected output state (lib/lib.go)
package lib
func Value() int {
return 2
}A public MCP batch resolves inserted and renamed declarations in one buffered working revision, including a scaffold receipt and final generated file.
Source: mcp_batch_shared_buffers.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: tool":\s*“semantic_scaffold_file
Assert: tool”:“semantic_scaffold_file”,“file”:“generated.go”,“package”:“sample”,“status”:“ok”,“result”:{“edit_receipt”:{“changes”:[{“path”:“generated.go”,“revision”:"[a-f0-9]{64}"}],“operation”:“scaffold_file”,“schema_version”:“semedit.edit-receipt/v1”,“status”:“applied_working”},“package”:“sample
Assert: isError”:false
skip_hooks suppresses external commands while retaining built-in formatting and Go diagnostics.
Source: mcp_batch_skip_hooks.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: Status":“skipped
Assert: coverage
Unified AST transformation diff
- func Value() int { return 1 }
package batchskiphooks
+ func Value() int {
+ return 2
+ }
Expected output state (value.go)
package batchskiphooks
func Value() int {
return 2
}Both structural planners compose in one buffered batch and report working-view receipts.
Source: mcp_batch_structural.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:false
Assert: applied_working
Module-wide renames retain external references across a batch publication barrier.
Source: mcp_batch_subdirectory.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Assert: ../caller.go
A public MCP batch renames a helper in a scaffolded virtual Go test file using an explicit file selector.
Source: mcp_batch_virtual_test_file.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
The installer uses –profile full; tool discovery still defaults to base.
Source: mcp_default_catalog.txtar · Download raw file
Execute: semedit mcp –profile full –enabled-languages go
CLI invocation
$ semedit mcp --profile full --enabled-languages go
Equivalent MCP tool call (semedit_mcp)
{}Assert: name":\s*“semantic_workspace_outline
Assert: name”:\s*“semantic_change_signature
Assert: name”:\s*“semantic_extract_function
Assert: name”:\s*“semantic_set_doc_comment
A typed constant receipt supplies the live file and symbol for a later rename and fresh lookup.
Source: mcp_extract_constant_receipt.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:false
Assert: schema_version":“semedit.edit-receipt/v1
Assert: status”:“persisted
Assert: continuations”:
Assert: file":“retry.go
Assert: symbol”:“retryWindow
Assert: expected_revision”:"[0-9a-f]{64}
Assert: symbol":“retryDelay
Unified AST transformation diff
- return 3 * 60
package retry
func Retry() int {
+ return retryDelay
}
+ const retryDelay int = 3 * 60
Expected output state (retry.go)
package retry
func Retry() int {
return retryDelay
}
const retryDelay int = 3 * 60A function extraction receipt identifies the live helper for rename and fresh lookup.
Source: mcp_extract_function_receipt.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:false
Assert: schema_version":“semedit.edit-receipt/v1
Assert: status”:“persisted
Assert: continuations”:
Assert: file":“emit.go
Assert: symbol”:“sendSelected
Assert: expected_revision”:"[0-9a-f]{64}
Assert: symbol":“writeSelected
The extraction receipt follows the surviving owner function as a live target.
Source: mcp_extract_variable_receipt.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:false
Assert: operation":“extract_variable
Assert: status”:“persisted
Assert: continuations”:
Assert: file":“render.go
Assert: symbol”:“Render
Assert: expected_revision”:"[0-9a-f]{64}
Assert: symbol":“Display
Inlining returns the surviving owner function, never the removed local binding.
Source: mcp_inline_variable_receipt.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:false
Assert: operation":“inline_variable
Assert: status”:“persisted
Assert: continuations”:
Assert: file":“calc.go
Assert: symbol”:“Compute
Assert: expected_revision”:"[0-9a-f]{64}
Assert: symbol":“Evaluate
MCP inspection exposes the same revision guarded by the following public edit call.
Source: mcp_inspect_continuation_text.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: Critical result (JSON):
Assert: expected_revision”:“145cc376b72487d43e3597c3951d9eda8fd204b8f6e3308d9e30197f2fa4417a
Assert: file”:“main.go
Assert: symbol”:“Value
Assert: isError”:false
Standalone parameter-object output separates the function edit target from inspectable receipt declarations.
Source: mcp_introduce_parameter_object_target_go.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: function_target":{[^}]“file”:“write.go”[^}]“symbol”:“write
Assert: continuations”:[{[^}]“symbol”:“write”[^}]},{[^}]*“symbol”:“writeOptions
Assert: type writeOptions struct
Kotlin-only MCP tools/list contract: lookup and verify are exposed, mutation is not.
Source: mcp_kotlin_tools.txtar · Download raw file
Execute: semedit mcp –enabled-languages=kotlin
CLI invocation
$ semedit mcp --enabled-languages=kotlin
Equivalent MCP tool call (semedit_mcp)
{}Assert: name”:\s*“semantic_lookup
Assert: name”:\s*“semantic_verify
MCP metrics text carries complete measurement records and optional session metrics.
Source: mcp_metrics_critical_text.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: Critical result (JSON):
Assert: completed_at
Assert: session_metrics
Assert: phases
Assert: semantic_verify
Test MCP initialize and tools/list over stdio
Source: mcp_server.txtar · Download raw file
Execute: semedit mcp –tool-profile full –live-reload
CLI invocation
$ semedit mcp --tool-profile full --live-reload
Equivalent MCP tool call (semedit_mcp)
{}Assert: name”:\s*“semedit
Assert: name”:\s*“semantic_rename
Assert: name”:\s*“semantic_verify
Assert: name”:\s*“semantic_lookup
Assert: name”:\s*“semantic_inspect_symbol
Assert: name”:\s*“semantic_inspect_construct
Assert: name”:\s*“semantic_stage
Assert: name”:\s*“semantic_stage_drop
Assert: name”:\s*“semantic_stage_abort
Assert: name”:\s*“semantic_commit
Assert: name”:\s*“semantic_outline
Assert: name”:\s*“semantic_find_references
Assert: name”:\s*“semantic_add_build_dependency
Assert: name”:\s*“semantic_assertion_mode
Assert: name”:\s*“semantic_insert_case
Assert: name”:\s*“semantic_insert_construct
Assert: name”:\s*“semantic_insert_decl
Assert: name”:\s*“semantic_insert_declaration
Assert: name”:\s*“semantic_insert_function
Assert: name”:\s*“semantic_insert_type
Assert: name”:\s*“semantic_insert_field
Assert: name”:\s*“semantic_extract_type
Assert: move selected direct private fields
Assert: name”:\s*“semantic_set_doc_comment
Assert: name”:\s*“semantic_maven_compile
Assert: name”:\s*“semantic_maven_test
Assert: name”:\s*“semantic_organize_imports
Assert: name”:\s*“semantic_replace_body
Assert: name”:\s*“semantic_change_signature
Assert: name”:\s*“semantic_introduce_parameter
Assert: name”:\s*“semantic_introduce_parameter_object
Assert: name”:\s*“semantic_replace_decl
Assert: name”:\s*“semantic_inline_function
Assert: name”:\s*“semantic_migrate_type
Assert: name”:\s*“semantic_replace_construct
Assert: name”:\s*“semantic_remove_construct
Assert: name”:\s*“semantic_move_construct
Assert: name”:\s*“semantic_extract_function
Assert: name”:\s*“semantic_extract_variable
Assert: name”:\s*“semantic_extract_constant
Assert: name”:\s*“semantic_inline_variable
Assert: name”:\s*“semantic_extract_interface
Assert: name”:\s*“semantic_implement_contract
Assert: name”:\s*“semantic_scaffold_file
Assert: name”:\s*“semantic_snapshot
Assert: name”:\s*“semantic_undo
Assert: name”:\s*“semantic_workspace_outline
Assert: name”:\s*“semantic_batch
Assert: name”:\s*“semantic_reload
MCP initialization defaults to prescriptive guidance and honors explicit overrides.
Source: mcp_server_instructions.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: instructions”:\s*“Inspect the complete tool inventory
Execute: semedit mcp –instructions=
CLI invocation
$ semedit mcp --instructions=
Equivalent MCP tool call (semedit_mcp)
{}Assert: name”:\s*“semedit
Execute: semedit mcp –instructions ‘Custom semantic guidance.’
CLI invocation
$ semedit mcp --instructions 'Custom semantic guidance.'
Equivalent MCP tool call (semedit_mcp)
{}Assert: instructions”:\s*“Custom semantic guidance.
An active stage owns its descendants, including a semantic_batch whose canonical root is a child workspace.
Source: mcp_stage_blocks_child_batch.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:true
Assert: overlaps active staging workspace
Unified AST transformation diff
package child
func Value() int { return 1 }
Expected output state (child/value.go)
package child
func Value() int { return 1 }A failed final hook preserves the complete typed staged-commit outcome after publication and consumes the journal.
Source: mcp_stage_commit_hook_failure.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: result":{“application_state”:“persisted
Assert: status”:“applied_with_diagnostics
Assert: application_state”:“persisted
Assert: published_files”:1
Assert: Status":“failed
Assert: return 2
Assert: no staging session is active
Unified AST transformation diff
- func Value() int { return 1 }
package stagecommithookfailure
+ func Value() int {
+ return 2
+ }
Expected output state (value.go)
package stagecommithookfailure
func Value() int {
return 2
}A staged Java mutation remains in the overlay until commit publishes it.
Source: mcp_stage_java_lifecycle.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: stage_receipt
Assert: step_count”:1
Assert: status":“ok
Assert: published_files”:1
Retained stages keep mutations private until commit and discard them on abort.
Source: mcp_stage_lifecycle.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: stage_receipt
Assert: step_count":1
Assert: status":“aborted
Assert: status”:“ok
Unified AST transformation diff
- func Value() int { return 1 }
package stage
+ func Value() int {
+ return 3
+ }
Expected output state (value.go)
package stage
func Value() int {
return 3
}A staged scaffold remains an in-memory overlay and abort leaves no source directory behind.
Source: mcp_stage_scaffold_abort.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: stage_receipt
Assert: step_count”:1
Assert: status":“aborted
A staged scaffold publishes its buffered source and deferred parent directory only on commit.
Source: mcp_stage_scaffold_commit.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: stage_receipt
Assert: step_count”:1
Unified AST transformation diff
+ package stage
Expected output state (generated/model.go)
package stageA staged scaffold is editable through the overlay; abort keeps its new directory private and commit publishes the final mutation.
Source: mcp_stage_scaffold_mutate_overlay.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: step_count":2
Assert: status":“aborted
Unified AST transformation diff
+ package stageoverlay
+ func Model() int { return 1 }
Expected output state (generated/model.go)
package stageoverlay
func Model() int { return 1 }A retained commit can skip configured hooks while still publishing and running built-in final verification.
Source: mcp_stage_skip_hooks.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: Status”:“skipped
Unified AST transformation diff
- func Value() int { return 1 }
package stageskiphooks
+ func Value() int {
+ return 2
+ }
Expected output state (value.go)
package stageskiphooks
func Value() int {
return 2
}Retained stages reject an ancestor and descendant request root that share one Go module.
Source: mcp_stage_workspace_ownership.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:false
Assert: isError":true
Assert: overlaps active staging workspace
Unified AST transformation diff (child/value.go)
package stageownership
func Child() int { return 2 }
Expected output state (child/value.go)
package stageownership
func Child() int { return 2 }Unified AST transformation diff (value.go)
package stageownership
func Value() int { return 1 }
Expected output state (value.go)
package stageownership
func Value() int { return 1 }MCP discovery defaults to generic operations and supports full and filtered catalogs.
Source: mcp_tool_profiles.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: name":\s*“semantic_insert_construct
Assert: name”:\s*“semantic_replace_construct
Assert: name”:\s*“semantic_batch
Execute: semedit mcp –tool-profile full
CLI invocation
$ semedit mcp --tool-profile full
Equivalent MCP tool call (semedit_mcp)
{}Assert: name”:\s*“semantic_insert_function
Assert: name”:\s*“semantic_replace_body
Execute: semedit mcp –expose-tool-variant ‘insert:function,insert:type’
CLI invocation
$ semedit mcp --expose-tool-variant 'insert:function,insert:type'
Equivalent MCP tool call (semedit_mcp)
{}Assert: name”:\s*“semantic_insert_function
Assert: name”:\s*“semantic_insert_type
Execute: semedit mcp –expose-tool-variant ‘:’
CLI invocation
$ semedit mcp --expose-tool-variant '*:*'
Equivalent MCP tool call (semedit_mcp)
{}Assert: name”:\s*“semantic_insert_function
Assert: name”:\s*“semantic_insert_field
Assert: name”:\s*“semantic_replace_body
Execute: semedit mcp –expose-tool-variant ‘*:function’
CLI invocation
$ semedit mcp --expose-tool-variant '*:function'
Equivalent MCP tool call (semedit_mcp)
{}Assert: name”:\s*“semantic_insert_function
Assert: name”:\s*“semantic_replace_body
Execute: exec semedit mcp –expose-tool-variant ‘remove:no_such_construct’
CLI invocation
$ exec semedit mcp --expose-tool-variant 'remove:no_such_construct'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: no registered|matched no
Execute: exec semedit mcp –expose-tool-variant ‘insert-function’
CLI invocation
$ exec semedit mcp --expose-tool-variant 'insert-function'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: invalid tool variant
MCP verify refuses explicit selectors disabled by the enabled-language policy.
Source: mcp_verify_enabled_languages.txtar · Download raw file
Execute: semedit mcp –enabled-languages=go
CLI invocation
$ semedit mcp --enabled-languages=go
Equivalent MCP tool call (semedit_mcp)
{}Assert: disabled by –enabled-languages
Execute: semedit mcp –enabled-languages=go
CLI invocation
$ semedit mcp --enabled-languages=go
Equivalent MCP tool call (semedit_mcp)
{}Assert: disabled by –enabled-languages
Execute: semedit mcp –enabled-languages=go
CLI invocation
$ semedit mcp --enabled-languages=go
Equivalent MCP tool call (semedit_mcp)
{}Assert: disabled by –enabled-languages
Execute: semedit mcp –enabled-languages=java
CLI invocation
$ semedit mcp --enabled-languages=java
Equivalent MCP tool call (semedit_mcp)
{}Assert: disabled by –enabled-languages
Execute: semedit mcp –enabled-languages=java
CLI invocation
$ semedit mcp --enabled-languages=java
Equivalent MCP tool call (semedit_mcp)
{}Assert: disabled by –enabled-languages
Execute: semedit mcp –enabled-languages=java
CLI invocation
$ semedit mcp --enabled-languages=java
Equivalent MCP tool call (semedit_mcp)
{}Assert: disabled by –enabled-languages
Unified AST transformation diff (Widget.java)
class Widget {}
Expected output state (Widget.java)
class Widget {}Unified AST transformation diff (main.go)
package main
func main() {}
Expected output state (main.go)
package main
func main() {}A request-selected worktree root binds batch edits and rejects paths that escape it.
Source: mcp_workspace_root.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:false
Assert: isError":true
Assert: workspace_root
Assert: invalid call_site.file
Assert: invalid contract_file
Assert: invalid members
Unified AST transformation diff (value.go)
package workspace
func Value() int { return 1 }
Expected output state (value.go)
package workspace
func Value() int { return 1 }Unified AST transformation diff (.scratch/worktrees/other/value.go)
package workspace
func Value() int { return 3 }
Expected output state (.scratch/worktrees/other/value.go)
package workspace
func Value() int { return 3 }Unified AST transformation diff (.scratch/worktrees/outside.go)
package workspace
func Outside() int { return 7 }
Expected output state (.scratch/worktrees/outside.go)
package workspace
func Outside() int { return 7 }Unified AST transformation diff (.scratch/worktrees/selected/value.go)
- func Value() int { return 1 }
package workspace
+ func Value() int {
+ return 2
+ }
Expected output state (.scratch/worktrees/selected/value.go)
package workspace
func Value() int {
return 2
}A grouped field declaration has one shared type node, so the tool refuses to edit only one field name.
Source: migrate_type_grouped_field_refusal.txtar · Download raw file
Execute: exec semedit migrate-type –file settings.go –symbol Settings.timeout –type Duration
CLI invocation
$ exec semedit migrate-type --file settings.go --symbol Settings.timeout --type Duration
Equivalent MCP tool call (semedit_semedit)
{}Expected error: refuses grouped struct fields
A distinct named type with the same underlying type is not alias-identical and leaves the source unchanged.
Source: migrate_type_identity_refusal.txtar · Download raw file
Execute: exec semedit migrate-type –file settings.go –symbol Settings.timeout –type Timeout
CLI invocation
$ exec semedit migrate-type --file settings.go --symbol Settings.timeout --type Timeout
Equivalent MCP tool call (semedit_semedit)
{}Expected error: not identical after alias resolution
Alias-preserving field type migrations accept the current buffered file revision between batch children.
Source: migrate_type_mcp_batch.txtar · Download raw file
Execute: semedit mcp –live-reload
CLI invocation
$ semedit mcp --live-reload
Equivalent MCP tool call (semedit_mcp)
{}Assert: status":“applied_working
An already-satisfied spelling is refused instead of being reported as a persisted edit.
Source: migrate_type_same_spelling_refusal.txtar · Download raw file
Execute: exec semedit migrate-type –file settings.go –symbol Settings.timeout –type int64
CLI invocation
$ exec semedit migrate-type --file settings.go --symbol Settings.timeout --type int64
Equivalent MCP tool call (semedit_semedit)
{}Expected error: already uses the requested spelling
Move construct relocates a function within a file with comments intact.
Source: move_construct.txtar · Download raw file
A self-anchor still resolves the symbol before returning success. Move a function between files in the same package and carry its required import. Resolve an implicit import name from the package instead of guessing from its path. Move an exported function across packages and update callers in the source and third packages. A selected member of an iota group fails without moving its siblings or changing values. A single literal variable spec moves with its documentation while the sibling remains. A grouped type member moves with its documentation, and the sibling remains unchanged.
Execute: semedit move-construct –file api/server.go –symbol Run –placement before_symbol –target-symbol Init
CLI invocation
$ semedit move-construct --file api/server.go --symbol Run --placement before_symbol --target-symbol Init
Equivalent MCP tool call (semantic_move_construct)
{
"file": "api/server.go",
"placement": "before_symbol",
"symbol": "Run",
"target_symbol": "Init"
}Assert: Successfully moved construct
Execute: semedit move-construct –file api/server.go –symbol Init –placement before_symbol –target-symbol Init
CLI invocation
$ semedit move-construct --file api/server.go --symbol Init --placement before_symbol --target-symbol Init
Equivalent MCP tool call (semantic_move_construct)
{
"file": "api/server.go",
"placement": "before_symbol",
"symbol": "Init",
"target_symbol": "Init"
}Execute: exec semedit move-construct –file api/server.go –symbol Missing –placement before_symbol –target-symbol Missing
CLI invocation
$ exec semedit move-construct --file api/server.go --symbol Missing --placement before_symbol --target-symbol Missing
Equivalent MCP tool call (semedit_semedit)
{}Expected error: symbol.*not found
Execute: semedit move-construct –file api/source.go –destination-file api/dest.go –symbol Normalize –placement file_end
CLI invocation
$ semedit move-construct --file api/source.go --destination-file api/dest.go --symbol Normalize --placement file_end
Equivalent MCP tool call (semantic_move_construct)
{
"destination_file": "api/dest.go",
"file": "api/source.go",
"placement": "file_end",
"symbol": "Normalize"
}Assert: import
Execute: semedit move-construct –file api/alias_source.go –destination-file api/alias_dest.go –symbol UseNamed –placement file_end
CLI invocation
$ semedit move-construct --file api/alias_source.go --destination-file api/alias_dest.go --symbol UseNamed --placement file_end
Equivalent MCP tool call (semantic_move_construct)
{
"destination_file": "api/alias_dest.go",
"file": "api/alias_source.go",
"placement": "file_end",
"symbol": "UseNamed"
}Execute: semedit move-construct –file other/source.go –destination-file api/cross.go –symbol MoveMe –placement file_end
CLI invocation
$ semedit move-construct --file other/source.go --destination-file api/cross.go --symbol MoveMe --placement file_end
Equivalent MCP tool call (semantic_move_construct)
{
"destination_file": "api/cross.go",
"file": "other/source.go",
"placement": "file_end",
"symbol": "MoveMe"
}Assert: Successfully moved construct
Execute: exec semedit move-construct –file api/group.go –destination-file api/dest.go –symbol First –placement file_end
CLI invocation
$ exec semedit move-construct --file api/group.go --destination-file api/dest.go --symbol First --placement file_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: grouped constant with implicit expressions or iota
Execute: semedit move-construct –file api/group_var.go –destination-file api/group_var_dest.go –symbol GroupedB –placement before_symbol –target-symbol KeepGroupedVar
CLI invocation
$ semedit move-construct --file api/group_var.go --destination-file api/group_var_dest.go --symbol GroupedB --placement before_symbol --target-symbol KeepGroupedVar
Equivalent MCP tool call (semantic_move_construct)
{
"destination_file": "api/group_var_dest.go",
"file": "api/group_var.go",
"placement": "before_symbol",
"symbol": "GroupedB",
"target_symbol": "KeepGroupedVar"
}Execute: semedit move-construct –file api/group_type.go –destination-file api/group_type_dest.go –symbol MoveType –placement before_symbol –target-symbol KeepGroupType
CLI invocation
$ semedit move-construct --file api/group_type.go --destination-file api/group_type_dest.go --symbol MoveType --placement before_symbol --target-symbol KeepGroupType
Equivalent MCP tool call (semantic_move_construct)
{
"destination_file": "api/group_type_dest.go",
"file": "api/group_type.go",
"placement": "before_symbol",
"symbol": "MoveType",
"target_symbol": "KeepGroupType"
}Cross-package move refuses methods, unexported functions, source-local dependencies, and hidden callers.
Source: move_construct_cross_package_refusal.txtar · Download raw file
Execute: exec semedit move-construct –file legacy/decls.go –destination-file api/dest.go –symbol Widget.Method –placement file_end
CLI invocation
$ exec semedit move-construct --file legacy/decls.go --destination-file api/dest.go --symbol Widget.Method --placement file_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: cross-package move requires an exported free function name
Execute: exec semedit move-construct –file legacy/decls.go –destination-file api/dest.go –symbol privateFunc –placement file_end
CLI invocation
$ exec semedit move-construct --file legacy/decls.go --destination-file api/dest.go --symbol privateFunc --placement file_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: cross-package move requires an exported free function name
Execute: exec semedit move-construct –file legacy/decls.go –destination-file api/dest.go –symbol NeedsHelper –placement file_end
CLI invocation
$ exec semedit move-construct --file legacy/decls.go --destination-file api/dest.go --symbol NeedsHelper --placement file_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: source-package dependency “helper
Execute: exec semedit move-construct –file legacy/decls.go –destination-file api/dest.go –symbol HiddenTarget –placement file_end
CLI invocation
$ exec semedit move-construct --file legacy/decls.go --destination-file api/dest.go --symbol HiddenTarget --placement file_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: possible reference to “HiddenTarget
Execute: exec semedit move-construct –file legacy/decls.go –destination-file api/dest.go –symbol ShadowTarget –placement file_end
CLI invocation
$ exec semedit move-construct --file legacy/decls.go --destination-file api/dest.go --symbol ShadowTarget --placement file_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: resolves to a different declaration
Execute: exec semedit move-construct –file legacy/decls.go –destination-file api/dest.go –symbol ShadowAliasTarget –placement file_end
CLI invocation
$ exec semedit move-construct --file legacy/decls.go --destination-file api/dest.go --symbol ShadowAliasTarget --placement file_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: resolves to a different declaration
Execute: exec semedit move-construct –file legacy/decls.go –destination-file api/dest.go –symbol UnlistedTarget –placement file_end
CLI invocation
$ exec semedit move-construct --file legacy/decls.go --destination-file api/dest.go --symbol UnlistedTarget --placement file_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: untyped Go file.*_private/reference.go
Execute: exec semedit move-construct –file legacy/decls.go –destination-file api/dest.go –symbol TestdataTarget –placement file_end
CLI invocation
$ exec semedit move-construct --file legacy/decls.go --destination-file api/dest.go --symbol TestdataTarget --placement file_end
Equivalent MCP tool call (semedit_semedit)
{}Expected error: untyped Go file.*testdata/reference.go
Java move_construct delegates a static member and its workspace edits to JDT LS.
Source: move_construct_java.txtar · Download raw file
Execute: semedit move-construct –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Source.java –destination-file src/Target.java –symbol Source.value –target-symbol sample.Target
CLI invocation
$ semedit move-construct --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Source.java --destination-file src/Target.java --symbol Source.value --target-symbol sample.Target
Equivalent MCP tool call (semantic_move_construct)
{
"destination_file": "src/Target.java",
"file": "src/Source.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "Source.value",
"target_symbol": "sample.Target",
"trust_workspace": true
}Unified AST transformation diff (src/Source.java)
- static int value() { return 1; }
package sample;
class Source {
}
Expected output state (src/Source.java)
package sample;
class Source {
}Unified AST transformation diff (src/Target.java)
package sample;
class Target {
+ static int value() { return 1; }
}
Expected output state (src/Target.java)
package sample;
class Target {
static int value() { return 1; }
}Java move_construct moves a public top-level type across packages and updates callers.
Source: move_construct_java_top_level.txtar · Download raw file
Execute: semedit move-construct –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/oldpkg/Widget.java –destination-file src/newpkg/Target.java –symbol Widget –target-symbol Target
CLI invocation
$ semedit move-construct --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/oldpkg/Widget.java --destination-file src/newpkg/Target.java --symbol Widget --target-symbol Target
Equivalent MCP tool call (semantic_move_construct)
{
"destination_file": "src/newpkg/Target.java",
"file": "src/oldpkg/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "Widget",
"target_symbol": "Target",
"trust_workspace": true
}Unified AST transformation diff (src/client/Caller.java)
- import oldpkg.Widget;
package client;
+ import newpkg.Widget;
public class Caller {
}
Expected output state (src/client/Caller.java)
package client;
import newpkg.Widget;
public class Caller {
}Unified AST transformation diff (src/newpkg/Widget.java)
+ package newpkg;
+ public class Widget {
+ }
Expected output state (src/newpkg/Widget.java)
package newpkg;
public class Widget {
}target_symbol is only meaningful for relative placement and must never be ignored.
Source: move_construct_target_symbol_contract.txtar · Download raw file
A relative target remains a supported placement. Batch parameter preflight rejects the invalid child before any edit dispatches.
Execute: exec semedit move-construct –file direct.go –symbol MoveMe –target-symbol Anchor
CLI invocation
$ exec semedit move-construct --file direct.go --symbol MoveMe --target-symbol Anchor
Equivalent MCP tool call (semedit_semedit)
{}Expected error: target_symbol requires before_symbol or after_symbol
Execute: semedit move-construct –file direct.go –symbol MoveMe –placement before_symbol –target-symbol Anchor
CLI invocation
$ semedit move-construct --file direct.go --symbol MoveMe --placement before_symbol --target-symbol Anchor
Equivalent MCP tool call (semantic_move_construct)
{
"file": "direct.go",
"placement": "before_symbol",
"symbol": "MoveMe",
"target_symbol": "Anchor"
}Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:true
Assert: target_symbol requires before_symbol or after_symbol
Registry requirements reach observable CLI help and enabled-language MCP discovery.
Source: operation_contract_help.txtar · Download raw file
Execute: semedit replace-body –help
CLI invocation
$ semedit replace-body --help
Equivalent MCP tool call (semantic_replace_body)
{}Assert: Variant: selected_file
Assert: the selected file
Assert: Guarantees:
Assert: healthy=supported
Assert: target_syntax=
Execute: semedit change-signature –help
CLI invocation
$ semedit change-signature --help
Equivalent MCP tool call (semantic_change_signature)
{}Assert: the active module
Assert: test variants
Assert: module proof
Assert: conditional when
Assert: mixed faults follow the declared fault matrix
Execute: semedit lookup –help
CLI invocation
$ semedit lookup --help
Equivalent MCP tool call (semantic_lookup)
{}Assert: go: Variant: selected_file
Assert: rust: Variant: selected_file
Assert: java: Variant: selected_file
Assert: scala: Variant: selected_file
Assert: haskell: Variant: selected_file
Assert: kotlin: Variant: selected_file
Assert: bash: Variant: selected_file
Assert: make: Variant: selected_file
Assert: read-only
Execute: semedit rename –help
CLI invocation
$ semedit rename --help
Equivalent MCP tool call (semantic_rename)
{}Assert: go: Variant:
Assert: rust: Variant: selected_file
Assert: java: Variant: selected_file
Execute: semedit verify –help
CLI invocation
$ semedit verify --help
Equivalent MCP tool call (semantic_verify)
{}Assert: java: Variant:
Assert: organize imports
Assert: kotlin: Variant: selected_file
Assert: bash: Variant: selected_file
Assert: Variant: selected_file,check_only
Assert: check_only
Execute: semedit mcp –enabled-languages go –tool-profile full
CLI invocation
$ semedit mcp --enabled-languages go --tool-profile full
Equivalent MCP tool call (semedit_mcp)
{}Assert: go: Variant:
Test automated import organization
Source: organize_imports.txtar · Download raw file
Execute: semedit imports –file api/server.go
CLI invocation
$ semedit imports --file api/server.go
Equivalent MCP tool call (semantic_organize_imports)
{
"file": "api/server.go"
}Assert: changed_files: api/server.go
Unified AST transformation diff
- "bytes"
package api
import (
+ "fmt"
"os"
)
func Greet() {
fmt.Println("hello world")
_ = os.Getenv("ENV")
}
Expected output state (api/server.go)
package api
import (
"fmt"
"os"
)
func Greet() {
fmt.Println("hello world")
_ = os.Getenv("ENV")
}Java import requests are staged, then formatted and organized through JDT LS.
Source: organize_imports_java.txtar · Download raw file
Execute: semedit imports –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –add java.util.List –remove java.util.Set
CLI invocation
$ semedit imports --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --add java.util.List --remove java.util.Set
Equivalent MCP tool call (semantic_organize_imports)
{
"add": [
"java.util.List"
],
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"remove": [
"java.util.Set"
],
"trust_workspace": true
}Assert: Successfully organized imports.
Unified AST transformation diff
- import java.util.Set;
package sample;
import java.time.Instant;
+ import java.util.List;
class Widget {}
Expected output state (src/Widget.java)
package sample;
import java.time.Instant;
import java.util.List;
class Widget {}A failed workspace import pass preserves files already written and reports only those paths.
Source: organize_imports_partial_failure.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:true
Assert: application_state”:“partially_published
Assert: changed_files”:[“a.go”]
Assert: diagnostic_status":“unavailable
Explicit imports remain present even when goimports cannot resolve an independent nested module.
Source: organize_nested_module_explicit_import.txtar · Download raw file
Execute: semedit imports –file main.go –add ’nestedpkg fixture.test/nested/subpkg’
CLI invocation
$ semedit imports --file main.go --add 'nestedpkg fixture.test/nested/subpkg'
Equivalent MCP tool call (semantic_organize_imports)
{
"add": [
"nestedpkg fixture.test/nested/subpkg"
],
"file": "main.go"
}Assert: changed_files: main.go
Unified AST transformation diff
package main
+ import nestedpkg "fixture.test/nested/subpkg"
func main() { _ = nestedpkg.Value() }
Expected output state (main.go)
package main
import nestedpkg "fixture.test/nested/subpkg"
func main() { _ = nestedpkg.Value() }Bash outline preserves the flat selected-file declarations from the server.
Source: outline_bash.txtar · Download raw file
Execute: semedit outline –language bash –trust-workspace –bash-bin $SEMEDIT_TEST_BASH_LS –path tool.sh
CLI invocation
$ semedit outline --language bash --trust-workspace --bash-bin $SEMEDIT_TEST_BASH_LS --path tool.sh
Equivalent MCP tool call (semantic_outline)
{
"bash_bin": "$SEMEDIT_TEST_BASH_LS",
"language": "bash",
"path": "tool.sh",
"trust_workspace": true
}Assert: name”: “f
Assert: kind”: “function
Assert: file”: “tool.sh
Unified AST transformation diff
#!/usr/bin/env bash
f() { echo safe; }
Expected output state (tool.sh)
#!/usr/bin/env bash
f() { echo safe; }Outline one trusted Java source file through the JDT LS backend.
Source: outline_java.txtar · Download raw file
Execute: semedit outline –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –path src/Widget.java –include-unexported
CLI invocation
$ semedit outline --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --path src/Widget.java --include-unexported
Equivalent MCP tool call (semantic_outline)
{
"include_unexported": true,
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"path": "src/Widget.java",
"trust_workspace": true
}Assert: kind”:\s*“selected_file
Assert: language”:\s*“java
Assert: name”:\s*“Widget
Assert: revision”:\s*"[0-9a-f]{64}
Java outlines accept a trusted directory scope and filter non-public declarations.
Source: outline_java_directory.txtar · Download raw file
Execute: semedit outline –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –path src –include-unexported=false
CLI invocation
$ semedit outline --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --path src --include-unexported=false
Equivalent MCP tool call (semantic_outline)
{
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"path": "src",
"trust_workspace": true
}Assert: kind":\s*“directory
Assert: file”:\s*“src/Widget.java
Assert: symbols”:\s*[\s*]
Kotlin CLI contracts: trusted selected-file outline, hierarchy, revision, read-only copy, and explicit unsupported scope/filter errors.
Source: outline_kotlin.txtar · Download raw file
Execute: semedit outline –language kotlin –trust-workspace –kotlin-bin $SEMEDIT_TEST_KOTLIN_LS –path src/Widget.kt –include-unexported
CLI invocation
$ semedit outline --language kotlin --trust-workspace --kotlin-bin $SEMEDIT_TEST_KOTLIN_LS --path src/Widget.kt --include-unexported
Equivalent MCP tool call (semantic_outline)
{
"include_unexported": true,
"kotlin_bin": "$SEMEDIT_TEST_KOTLIN_LS",
"language": "kotlin",
"path": "src/Widget.kt",
"trust_workspace": true
}Assert: kind": “selected_file
Assert: file”: “src/Widget.kt
Assert: language”: “kotlin
Assert: name”: “Widget
Assert: name”: “run
Assert: server_detail
Assert: fun run
Assert: revision”:\s*"[0-9a-f]{64}
Expected error: selected files only
Expected error: visibility filtering
Make outline keeps exact make-ls ranges and reports intentional partial projections.
Source: outline_make.txtar · Download raw file
Execute: semedit outline –language make –trust-workspace –make-bin $SEMEDIT_TEST_MAKE_LS –path Read.mk
CLI invocation
$ semedit outline --language make --trust-workspace --make-bin $SEMEDIT_TEST_MAKE_LS --path Read.mk
Equivalent MCP tool call (semantic_outline)
{
"language": "make",
"make_bin": "$SEMEDIT_TEST_MAKE_LS",
"path": "Read.mk",
"trust_workspace": true
}Assert: name": “all
Assert: complete”: false
Assert: line": 2
Assert: character": 10
Execute: semedit outline –language make –trust-workspace –make-bin $SEMEDIT_TEST_MAKE_LS –path Conditional.mk
CLI invocation
$ semedit outline --language make --trust-workspace --make-bin $SEMEDIT_TEST_MAKE_LS --path Conditional.mk
Equivalent MCP tool call (semantic_outline)
{
"language": "make",
"make_bin": "$SEMEDIT_TEST_MAKE_LS",
"path": "Conditional.mk",
"trust_workspace": true
}Assert: complete": false
Assert: symbols": []
Execute: semedit outline –language make –trust-workspace –make-bin $SEMEDIT_TEST_MAKE_LS –path Include.mk
CLI invocation
$ semedit outline --language make --trust-workspace --make-bin $SEMEDIT_TEST_MAKE_LS --path Include.mk
Equivalent MCP tool call (semantic_outline)
{
"language": "make",
"make_bin": "$SEMEDIT_TEST_MAKE_LS",
"path": "Include.mk",
"trust_workspace": true
}Assert: complete": false
Assert: symbols": []
Expected error: continued declaration
Expected error: continued declaration
Unified AST transformation diff
all:
@echo one
@echo two
next:
@echo next
Expected output state (Read.mk)
all:
@echo one
@echo two
next:
@echo next
Outline a Go directory with visibility, kind, empty-file, test, and exclusion coverage
Source: outline_read_go.txtar · Download raw file
Execute: semedit outline –path api
CLI invocation
$ semedit outline --path api
Equivalent MCP tool call (semantic_outline)
{
"path": "api"
}Assert: path":\s*“api
Assert: kind”:\s*“interface
Assert: qualified_name”:\s*“Server.Start
Assert: qualified_name”:\s*“PublicFunction
Assert: name”:\s*“Visible
Assert: name”:\s*“secretField
Assert: name”:\s*“hiddenMethod
Assert: name”:\s*“fmtx
Assert: name”:\s*".
Assert: symbols":\s*[]
Assert: path":\s*“net/http
Assert: path”:\s*“net/http/httptest
Execute: semedit outline –path api –include-unexported=false –kind field
CLI invocation
$ semedit outline --path api --include-unexported=false --kind field
Equivalent MCP tool call (semantic_outline)
{
"kinds": [
"field"
],
"path": "api"
}Assert: kind”:\s*“type
Assert: name”:\s*“Visible
Execute: semedit outline –path api –include-tests=true
CLI invocation
$ semedit outline --path api --include-tests=true
Equivalent MCP tool call (semantic_outline)
{
"path": "api"
}Assert: name”:\s*“TestServer
Execute: semedit outline –path api/server_test.go
CLI invocation
$ semedit outline --path api/server_test.go
Equivalent MCP tool call (semantic_outline)
{
"path": "api/server_test.go"
}Assert: name”:\s*“TestServer
Execute: semedit outline –path api –kind method
CLI invocation
$ semedit outline --path api --kind method
Equivalent MCP tool call (semantic_outline)
{
"kinds": [
"method"
],
"path": "api"
}Assert: qualified_name”:\s*“Service.Do
Assert: symbols”:\s*[]
Expected error: unknown outline kind
Execute: semedit outline –path api/server.go –kind class –kind target
CLI invocation
$ semedit outline --path api/server.go --kind class --kind target
Equivalent MCP tool call (semantic_outline)
{
"kinds": [
"class",
"target"
],
"path": "api/server.go"
}Assert: symbols":\s*[]
Execute: semedit outline –path api/server.go –kind class –kind function
CLI invocation
$ semedit outline --path api/server.go --kind class --kind function
Equivalent MCP tool call (semantic_outline)
{
"kinds": [
"class",
"function"
],
"path": "api/server.go"
}Assert: qualified_name":\s*“PublicFunction
Execute: semedit outline –path .
CLI invocation
$ semedit outline --path .
Equivalent MCP tool call (semantic_outline)
{
"path": "."
}Assert: file”:\s*“other/extra.go
Execute: semedit outline –path generated.java
CLI invocation
$ semedit outline --path generated.java
Equivalent MCP tool call (semantic_outline)
{
"path": "generated.java"
}Assert: name”:\s*“DirectorySymbol
Execute: semedit outline –path generated.java –language go
CLI invocation
$ semedit outline --path generated.java --language go
Equivalent MCP tool call (semantic_outline)
{
"language": "go",
"path": "generated.java"
}Assert: name”:\s*“DirectorySymbol
Unified AST transformation diff
package api
import (
"fmt"
fmtx "encoding/json"
. "strings"
_ "net/http/httptest"
"net/http"
)
type Base[T any] interface{ Get() T }
type Server struct {
Visible, secretField int
}
func (s *Server) Start() {}
func (s *Server) hiddenMethod() {}
func PublicFunction() {}
type Service interface {
Base[string]
Visible() string
Do(value string, values ...int) (bool, error)
secretMethod()
}
Expected output state (api/server.go)
package api
import (
"fmt"
fmtx "encoding/json"
. "strings"
_ "net/http/httptest"
"net/http"
)
type Base[T any] interface{ Get() T }
type Server struct {
Visible, secretField int
}
func (s *Server) Start() {}
func (s *Server) hiddenMethod() {}
func PublicFunction() {}
type Service interface {
Base[string]
Visible() string
Do(value string, values ...int) (bool, error)
secretMethod()
}Outline one trusted Rust source file and prove the CLI leaves it byte-for-byte unchanged.
Source: outline_rust.txtar · Download raw file
Execute: semedit outline –language rust –trust-workspace –path src/lib.rs –include-unexported
CLI invocation
$ semedit outline --language rust --trust-workspace --path src/lib.rs --include-unexported
Equivalent MCP tool call (semantic_outline)
{
"include_unexported": true,
"language": "rust",
"path": "src/lib.rs",
"trust_workspace": true
}Assert: kind”:\s*“selected_file
Assert: language”:\s*“rust
Assert: name”:\s*“Widget
Assert: revision”:\s*"[0-9a-f]{64}
Expected error: selected files only
Expected error: visibility filtering
Outline one trusted Scala source file with the pinned tools and preserve its exact source bytes.
Source: outline_scala.txtar · Download raw file
Execute: semedit outline –language scala –trust-workspace –metals-bin $SEMEDIT_TEST_METALS –java-bin $SEMEDIT_TEST_JAVA –java-version 21 –path src/Widget.scala –include-unexported
CLI invocation
$ semedit outline --language scala --trust-workspace --metals-bin $SEMEDIT_TEST_METALS --java-bin $SEMEDIT_TEST_JAVA --java-version 21 --path src/Widget.scala --include-unexported
Equivalent MCP tool call (semantic_outline)
{
"include_unexported": true,
"java_bin": "$SEMEDIT_TEST_JAVA",
"java_version": "21",
"language": "scala",
"metals_bin": "$SEMEDIT_TEST_METALS",
"path": "src/Widget.scala",
"trust_workspace": true
}Assert: kind":\s*“selected_file
Assert: language”:\s*“scala
Assert: name”:\s*“Widget
Assert: revision”:\s*"[0-9a-f]{64}
Expected error: selected files only
Expected error: visibility filtering
Outline rejects a selected Go file with a syntax error instead of reporting a complete result
Source: outline_syntax_error.txtar · Download raw file
Exact declaration and case removals preserve siblings; safe deletion refuses incomplete preflights.
Source: remove_construct.txtar · Download raw file
Execute: semedit remove-construct –file api/decls.go –kind var –symbol Remove
CLI invocation
$ semedit remove-construct --file api/decls.go --kind var --symbol Remove
Equivalent MCP tool call (semantic_remove_construct)
{
"file": "api/decls.go",
"kind": "var",
"symbol": "Remove"
}Assert: Removed selected node
Assert: diagnostic_status:
Execute: semedit remove-construct –file api/routes.go –kind case –in-function Route –discriminator route –target-case ‘“old”’
CLI invocation
$ semedit remove-construct --file api/routes.go --kind case --in-function Route --discriminator route --target-case '"old"'
Equivalent MCP tool call (semantic_remove_construct)
{
"discriminator": "route",
"file": "api/routes.go",
"in_function": "Route",
"kind": "case",
"target_case": "\"old\""
}Assert: Removed selected node
Execute: semedit remove-construct –file api/decls.go –kind const –symbol safeMagic –safe-delete
CLI invocation
$ semedit remove-construct --file api/decls.go --kind const --symbol safeMagic --safe-delete
Equivalent MCP tool call (semantic_remove_construct)
{
"file": "api/decls.go",
"kind": "const",
"safe_delete": true,
"symbol": "safeMagic"
}Assert: Safe deletion checks run
Execute: exec semedit remove-construct –file api/decls.go –kind const –symbol blockedConstant –safe-delete
CLI invocation
$ exec semedit remove-construct --file api/decls.go --kind const --symbol blockedConstant --safe-delete
Equivalent MCP tool call (semedit_semedit)
{}Expected error: safe_delete refused
Expected error: module_reference_scan_complete
Execute: exec semedit remove-construct –file api/decls.go –kind var –symbol left
CLI invocation
$ exec semedit remove-construct --file api/decls.go --kind var --symbol left
Equivalent MCP tool call (semedit_semedit)
{}Expected error: shared value spec
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":true
Assert: checks_run":[“go_syntax_parse
Assert: refusal”:
Unified AST transformation diff (api/decls.go)
- const safeMagic = 19
- // Remove documents the target.
- Remove = 2
package api
const blockedConstant = 23
var (
// Keep documents this sibling.
Keep = 1
)
var left, right = 1, 2
// Obsolete remains untouched by the constant-removal request.
func obsolete() {}
Expected output state (api/decls.go)
package api
const blockedConstant = 23
var (
// Keep documents this sibling.
Keep = 1
)
var left, right = 1, 2
// Obsolete remains untouched by the constant-removal request.
func obsolete() {}Unified AST transformation diff (api/routes.go)
- case "old":
- old()
package api
func Route(route string) {
switch route {
case "keep":
println("keep")
}
}
Expected output state (api/routes.go)
package api
func Route(route string) {
switch route {
case "keep":
println("keep")
}
}remove_construct_java_safe_delete
Source: remove_construct_java_safe_delete.txtar · Download raw file
Execute: exec semedit remove-construct –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –kind field –symbol Widget.value –safe-delete
CLI invocation
$ exec semedit remove-construct --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --kind field --symbol Widget.value --safe-delete
Equivalent MCP tool call (semedit_semedit)
{}Expected error: safe_delete refused
Expected error: JDT LS reference analysis was incomplete
Execute: exec semedit remove-construct –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –kind method –symbol Widget.run –safe-delete
CLI invocation
$ exec semedit remove-construct --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --kind method --symbol Widget.run --safe-delete
Equivalent MCP tool call (semedit_semedit)
{}Expected error: safe_delete refused
Expected error: JDT LS reference analysis was incomplete
Execute: semedit remove-construct –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –kind method –symbol Widget.run
CLI invocation
$ semedit remove-construct --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --kind method --symbol Widget.run
Equivalent MCP tool call (semantic_remove_construct)
{
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"kind": "method",
"language": "java",
"symbol": "Widget.run",
"trust_workspace": true
}Assert: Removed selected node
Unified AST transformation diff
- /** Documentation for the removable method. */
- private void run() { work(); }
package sample;
class Widget {
private int value;
void keep() {}
}
Expected output state (src/Widget.java)
package sample;
class Widget {
private int value;
void keep() {}
}A successful MCP removal advertises the exact result shape and a checks_run array.
Source: remove_construct_typed_success.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Assert: checks_run":[“go_syntax_parse
Assert: safe_delete”:false
Unified AST transformation diff
- var Removed = 1
package api
var Kept = 2
Expected output state (api/value.go)
package api
var Kept = 2A qualified method selector remains valid when callers use the function construct kind.
Source: remove_function_method_compatibility.txtar · Download raw file
Execute: semedit remove-construct –file request.go –kind function –symbol Request.Validate
CLI invocation
$ semedit remove-construct --file request.go --kind function --symbol Request.Validate
Equivalent MCP tool call (semantic_remove_construct)
{
"file": "request.go",
"kind": "function",
"symbol": "Request.Validate"
}Cross-package rename compares immutable expected output and preserves compiler health.
Source: rename_cross_package.txtar · Download raw file
Assert changes across files Assert compiler health across modules
Execute: semedit rename –file auth/token.go –symbol “ValidateToken” –to “VerifyToken”
CLI invocation
$ semedit rename --file auth/token.go --symbol "ValidateToken" --to "VerifyToken"
Equivalent MCP tool call (semantic_rename)
{
"file": "auth/token.go",
"symbol": "ValidateToken",
"to": "VerifyToken"
}Unified AST transformation diff (auth/token.go)
- func ValidateToken(t string) bool {
package auth
+ func VerifyToken(t string) bool {
return t != ""
}
Expected output state (auth/token.go)
package auth
func VerifyToken(t string) bool {
return t != ""
}Unified AST transformation diff (cmd/main.go)
- fmt.Println(auth.ValidateToken("secret"))
package main
import (
"fmt"
"example.com/test/auth"
)
func main() {
+ fmt.Println(auth.VerifyToken("secret"))
}
Expected output state (cmd/main.go)
package main
import (
"fmt"
"example.com/test/auth"
)
func main() {
fmt.Println(auth.VerifyToken("secret"))
}Test rename with diagnostic delta verification
Source: rename_diagnostic_delta.txtar · Download raw file
Execute: semedit rename –file api/server.go –symbol “Server.OldName” –to “NewName”
CLI invocation
$ semedit rename --file api/server.go --symbol "Server.OldName" --to "NewName"
Equivalent MCP tool call (semantic_rename)
{
"file": "api/server.go",
"symbol": "Server.OldName",
"to": "NewName"
}Unified AST transformation diff
- func (s *Server) OldName() {}
- s.OldName()
package api
type Server struct{}
+ func (s *Server) NewName() {}
func Run() {
s := &Server{}
+ s.NewName()
}
Expected output state (api/server.go)
package api
type Server struct{}
func (s *Server) NewName() {}
func Run() {
s := &Server{}
s.NewName()
}Batch formatting follows the final changed paths, including an explicitly empty change set.
Source: rename_go_batch_preserve_unrelated.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: final_diff":
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Rename interface, type, method, function, parameters, body local, and loop variables in sequence.
Source: rename_go_local_symbols.txtar · Download raw file
Execute: semedit rename –file api/rename_kinds.go –symbol TaskHandler –to Handler
CLI invocation
$ semedit rename --file api/rename_kinds.go --symbol TaskHandler --to Handler
Equivalent MCP tool call (semantic_rename)
{
"file": "api/rename_kinds.go",
"symbol": "TaskHandler",
"to": "Handler"
}Execute: semedit rename –file api/rename_kinds.go –symbol Worker –to Processor
CLI invocation
$ semedit rename --file api/rename_kinds.go --symbol Worker --to Processor
Equivalent MCP tool call (semantic_rename)
{
"file": "api/rename_kinds.go",
"symbol": "Worker",
"to": "Processor"
}Execute: semedit rename –file api/rename_kinds.go –symbol Processor.Handle –to Run
CLI invocation
$ semedit rename --file api/rename_kinds.go --symbol Processor.Handle --to Run
Equivalent MCP tool call (semantic_rename)
{
"file": "api/rename_kinds.go",
"symbol": "Processor.Handle",
"to": "Run"
}Execute: semedit rename –file api/rename_kinds.go –symbol execute –to perform
CLI invocation
$ semedit rename --file api/rename_kinds.go --symbol execute --to perform
Equivalent MCP tool call (semantic_rename)
{
"file": "api/rename_kinds.go",
"symbol": "execute",
"to": "perform"
}Execute: semedit rename –file api/rename_kinds.go –symbol input –to values
CLI invocation
$ semedit rename --file api/rename_kinds.go --symbol input --to values
Equivalent MCP tool call (semantic_rename)
{
"file": "api/rename_kinds.go",
"symbol": "input",
"to": "values"
}Execute: semedit rename –file api/rename_kinds.go –symbol total –to sum
CLI invocation
$ semedit rename --file api/rename_kinds.go --symbol total --to sum
Equivalent MCP tool call (semantic_rename)
{
"file": "api/rename_kinds.go",
"symbol": "total",
"to": "sum"
}Execute: semedit rename –file api/rename_kinds.go –symbol index –to position
CLI invocation
$ semedit rename --file api/rename_kinds.go --symbol index --to position
Equivalent MCP tool call (semantic_rename)
{
"file": "api/rename_kinds.go",
"symbol": "index",
"to": "position"
}Execute: semedit rename –file api/rename_kinds.go –symbol sample –to item
CLI invocation
$ semedit rename --file api/rename_kinds.go --symbol sample --to item
Equivalent MCP tool call (semantic_rename)
{
"file": "api/rename_kinds.go",
"symbol": "sample",
"to": "item"
}Execute: semedit rename –file api/rename_kinds.go –symbol limit –to bound
CLI invocation
$ semedit rename --file api/rename_kinds.go --symbol limit --to bound
Equivalent MCP tool call (semantic_rename)
{
"file": "api/rename_kinds.go",
"symbol": "limit",
"to": "bound"
}Unified AST transformation diff
- type TaskHandler interface {
- type Worker struct{}
- func (Worker) Handle(input []int) int {
- total := 0
- for index := 0; index < len(input); index++ {
- total += input[index]
- for _, sample := range input {
- total += sample
- return total
- func execute(handler TaskHandler, limit int) int {
- return handler.Process([]int{limit})
package api
+ type Handler interface {
Process([]int) int
}
+ type Processor struct{}
+ func (Processor) Run(values []int) int {
+ sum := 0
+ for position := 0; position < len(values); position++ {
+ sum += values[position]
}
+ for _, item := range values {
+ sum += item
}
+ return sum
}
+ func perform(handler Handler, bound int) int {
+ return handler.Process([]int{bound})
}
Expected output state (api/rename_kinds.go)
package api
type Handler interface {
Process([]int) int
}
type Processor struct{}
func (Processor) Run(values []int) int {
sum := 0
for position := 0; position < len(values); position++ {
sum += values[position]
}
for _, item := range values {
sum += item
}
return sum
}
func perform(handler Handler, bound int) int {
return handler.Process([]int{bound})
}Standalone Go rename normalizes its changed files while preserving unrelated source bytes.
Source: rename_go_preserve_unrelated.txtar · Download raw file
Execute: semedit rename –file config.go –symbol Config.Port –to ListenPort
CLI invocation
$ semedit rename --file config.go --symbol Config.Port --to ListenPort
Equivalent MCP tool call (semantic_rename)
{
"file": "config.go",
"symbol": "Config.Port",
"to": "ListenPort"
}Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}A broken Go runtime must expose the subprocess diagnostic without modifying source.
Source: rename_go_runtime_error.txtar · Download raw file
Execute: exec semedit rename –file api/server.go –symbol Server.Start –to Serve
CLI invocation
$ exec semedit rename --file api/server.go --symbol Server.Start --to Serve
Equivalent MCP tool call (semedit_semedit)
{}Expected error: rename: prepare gopls diagnostics environment: resolve effective Go environment: .*go: cannot find GOROOT directory:
Unified AST transformation diff
package api
type Server struct{}
func (s *Server) Start() {}
Expected output state (api/server.go)
package api
type Server struct{}
func (s *Server) Start() {}Rename Unicode identifiers after supplementary characters and update cross-file uses through the CLI.
Source: rename_go_utf16.txtar · Download raw file
Execute: semedit rename –file value.go –symbol café –to thé
CLI invocation
$ semedit rename --file value.go --symbol café --to thé
Equivalent MCP tool call (semantic_rename)
{
"file": "value.go",
"symbol": "café",
"to": "thé"
}Execute: semedit rename –symbol Value –to Renamed
CLI invocation
$ semedit rename --symbol Value --to Renamed
Equivalent MCP tool call (semantic_rename)
{
"symbol": "Value",
"to": "Renamed"
}Java rename returns a resolved continuation after the fake JDT LS publishes diagnostics.
Source: rename_java.txtar · Download raw file
Execute: semedit rename –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –symbol Widget –to Gadget
CLI invocation
$ semedit rename --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --symbol Widget --to Gadget
Equivalent MCP tool call (semantic_rename)
{
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "Widget",
"to": "Gadget",
"trust_workspace": true
}Assert: Successfully renamed Gadget.
Assert: class Gadget {}
Unified AST transformation diff
- class Widget {}
+ class Gadget {}
Expected output state (src/Widget.java)
class Gadget {}Java rename validates and stages every cross-file edit in the trusted workspace.
Source: rename_java_multifile.txtar · Download raw file
A standalone public top-level rename also moves its Java source file.
Execute: semedit rename –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –symbol Widget –to Gadget
CLI invocation
$ semedit rename --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --symbol Widget --to Gadget
Equivalent MCP tool call (semantic_rename)
{
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "Widget",
"to": "Gadget",
"trust_workspace": true
}Assert: Successfully renamed Gadget.
Execute: semedit rename –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/public/Widget.java –symbol Widget –to Gadget
CLI invocation
$ semedit rename --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/public/Widget.java --symbol Widget --to Gadget
Equivalent MCP tool call (semantic_rename)
{
"file": "src/public/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "Widget",
"to": "Gadget",
"trust_workspace": true
}Assert: Successfully renamed Gadget.
Unified AST transformation diff (src/public/Gadget.java)
+ package com.acme;
+ public class Gadget {}
Expected output state (src/public/Gadget.java)
package com.acme;
public class Gadget {}Unified AST transformation diff (src/Use.java)
- class Use { Widget value; }
+ class Use { Gadget value; }
Expected output state (src/Use.java)
class Use { Gadget value; }Unified AST transformation diff (src/Widget.java)
- class Widget {}
+ class Gadget {}
Expected output state (src/Widget.java)
class Gadget {}Java mutation must reject an untrusted workspace before starting JDT LS.
Source: rename_java_no_trust.txtar · Download raw file
Java mutation rejects foreign-file edits before writing.
Source: rename_java_unsafe_edit.txtar · Download raw file
Run semedit rename
Source: rename_method.txtar · Download raw file
Assert file transformations Assert compiler health in the sandbox
Execute: semedit rename –file api/server.go –symbol “Server.Start” –to “Serve”
CLI invocation
$ semedit rename --file api/server.go --symbol "Server.Start" --to "Serve"
Equivalent MCP tool call (semantic_rename)
{
"file": "api/server.go",
"symbol": "Server.Start",
"to": "Serve"
}Unified AST transformation diff
- func (s *Server) Start() {}
- s.Start()
package api
type Server struct{}
+ func (s *Server) Serve() {}
func Run() {
s := &Server{}
+ s.Serve()
}
Expected output state (api/server.go)
package api
type Server struct{}
func (s *Server) Serve() {}
func Run() {
s := &Server{}
s.Serve()
}A method rename returns only the exact post-rename method identity when a same-leaf peer exists.
Source: rename_postidentity.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError":false
Assert: origin":
Assert: file":“api/server.go
Assert: symbol”:“Server.Serve
Assert: expected_revision”:"[^"]+
Unified AST transformation diff
- func (Server) Start() {}
package api
type Server struct{}
+ func (Server) Serve() {}
type Other struct{}
func (Other) Serve() {}
Expected output state (api/server.go)
package api
type Server struct{}
func (Server) Serve() {}
type Other struct{}
func (Other) Serve() {}Rust rename is file-scoped and uses the deterministic rust-analyzer stand-in.
Source: rename_rust.txtar · Download raw file
Execute: semedit rename –language rust –trust-workspace –file src/lib.rs –symbol Widget –to Gadget
CLI invocation
$ semedit rename --language rust --trust-workspace --file src/lib.rs --symbol Widget --to Gadget
Equivalent MCP tool call (semantic_rename)
{
"file": "src/lib.rs",
"language": "rust",
"symbol": "Widget",
"to": "Gadget",
"trust_workspace": true
}Assert: Final continuation unavailable:
Assert: struct Gadget {}
Unified AST transformation diff
- struct Widget {}
+ struct Gadget {}
Expected output state (src/lib.rs)
struct Gadget {}Later-line Rust rename validates UTF-16 coordinates and writes the selected file.
Source: rename_rust_later_line.txtar · Download raw file
Execute: semedit rename –language rust –trust-workspace –file src/lib.rs –symbol Widget –to Gadget
CLI invocation
$ semedit rename --language rust --trust-workspace --file src/lib.rs --symbol Widget --to Gadget
Equivalent MCP tool call (semantic_rename)
{
"file": "src/lib.rs",
"language": "rust",
"symbol": "Widget",
"to": "Gadget",
"trust_workspace": true
}Assert: Successfully renamed symbol.
Assert: Final continuation unavailable:
Unified AST transformation diff
- // 😀 Widget {}
// é
+ // 😀 Gadget {}
Expected output state (src/lib.rs)
// é
// 😀 Gadget {}
Rust mutation must reject an untrusted workspace before starting rust-analyzer.
Source: rename_rust_no_trust.txtar · Download raw file
Unsafe multi-file WorkspaceEdit must be rejected without modifying the selected file.
Source: rename_rust_unsafe_edit.txtar · Download raw file
Exported type rename updates references in another file in the same package.
Source: rename_same_package_type.txtar · Download raw file
Execute: semedit rename –file api/model.go –symbol Widget –to Gadget
CLI invocation
$ semedit rename --file api/model.go --symbol Widget --to Gadget
Equivalent MCP tool call (semantic_rename)
{
"file": "api/model.go",
"symbol": "Widget",
"to": "Gadget"
}Unified AST transformation diff (api/model.go)
- type Widget struct{}
package api
+ type Gadget struct{}
Expected output state (api/model.go)
package api
type Gadget struct{}Unified AST transformation diff (api/use.go)
- func New() Widget { return Widget{} }
package api
+ func New() Gadget { return Gadget{} }
Expected output state (api/use.go)
package api
func New() Gadget { return Gadget{} }A qualified struct-field rename updates selector uses through the Go compiler.
Source: rename_struct_field.txtar · Download raw file
Execute: semedit rename –file config/config.go –symbol Config.Port –to ListenPort
CLI invocation
$ semedit rename --file config/config.go --symbol Config.Port --to ListenPort
Equivalent MCP tool call (semantic_rename)
{
"file": "config/config.go",
"symbol": "Config.Port",
"to": "ListenPort"
}Unified AST transformation diff
- Host string
- Port int
- return fmt.Sprintf("%s:%d", c.Host, c.Port)
package config
import "fmt"
type Config struct {
+ Host string
+ ListenPort int
}
func (c *Config) Addr() string {
+ return fmt.Sprintf("%s:%d", c.Host, c.ListenPort)
}
Expected output state (config/config.go)
package config
import "fmt"
type Config struct {
Host string
ListenPort int
}
func (c *Config) Addr() string {
return fmt.Sprintf("%s:%d", c.Host, c.ListenPort)
}Attempting to rename a non-existent symbol must fail and leave files untouched
Source: rename_symbol_not_found.txtar · Download raw file
Execute: exec semedit rename –file api/server.go –symbol “NonExistent” –to “NewName”
CLI invocation
$ exec semedit rename --file api/server.go --symbol "NonExistent" --to "NewName"
Equivalent MCP tool call (semedit_semedit)
{}Expected error: symbol not found
Replace function and method body with syntax validation
Source: replace_body.txtar · Download raw file
1. Replace top-level function body
CLI invocation
$ semedit replace-body --file math/calc.go --symbol Add --body 'return a + b'
Equivalent MCP tool call (semantic_replace_body)
{
"body": "return a + b",
"file": "math/calc.go",
"symbol": "Add"
}2. Replace method body with receiver qualification
CLI invocation
$ semedit replace-body --file math/calc.go --symbol (*Calculator).Compute --body 'return c.factor * x'
Equivalent MCP tool call (semantic_replace_body)
{
"body": "return c.factor * x",
"file": "math/calc.go",
"symbol": "(*Calculator).Compute"
}Unified AST transformation diff
- return 0
- return 0
package math
type Calculator struct {
factor int
}
func Add(a, b int) int {
+ return a + b
}
func (c *Calculator) Compute(x int) int {
+ return c.factor * x
}
Expected output state (math/calc.go)
package math
type Calculator struct {
factor int
}
func Add(a, b int) int {
return a + b
}
func (c *Calculator) Compute(x int) int {
return c.factor * x
}Replace a function body from an enclosing block while preserving braces in literals and comments.
Source: replace_body_braces.txtar · Download raw file
Execute: semedit replace-body –file api/run.go –symbol Run –body -
CLI invocation
$ semedit replace-body --file api/run.go --symbol Run --body -
Equivalent MCP tool call (semantic_replace_body)
{
"body": "-",
"file": "api/run.go",
"symbol": "Run"
}Unified AST transformation diff
- return
package api
func Run() {
+ value := "}"
+ // }
+ _ = value
}
Expected output state (api/run.go)
package api
func Run() {
value := "}"
// }
_ = value
}replace_body_java
Source: replace_body_java.txtar · Download raw file
Execute: semedit replace-body –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –symbol Widget.run –body ‘audit();’
CLI invocation
$ semedit replace-body --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --symbol Widget.run --body 'audit();'
Equivalent MCP tool call (semantic_replace_body)
{
"body": "audit();",
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"symbol": "Widget.run",
"trust_workspace": true
}Assert: Successfully replaced body of Widget.run
Unified AST transformation diff
+ package sample;
+ class Widget {
+ void run() {
+ audit();
+ }
+ }
Expected output state (Widget.java)
package sample;
class Widget {
void run() {
audit();
}
}Multiline function-body source arrives directly on stdin and preserves quotes and backslashes.
Source: replace_body_stdin.txtar · Download raw file
Execute: exec semedit replace-body –file api/text.go –symbol Message –body -
CLI invocation
$ exec semedit replace-body --file api/text.go --symbol Message --body -
Equivalent MCP tool call (semedit_semedit)
{}Expected error: replacement body must remain inside its function wrapper
Execute: semedit replace-body –file api/text.go –symbol Message –body -
CLI invocation
$ semedit replace-body --file api/text.go --symbol Message --body -
Equivalent MCP tool call (semantic_replace_body)
{
"body": "-",
"file": "api/text.go",
"symbol": "Message"
}Assert: Successfully replaced body of Message
Unified AST transformation diff (api/text.go)
- return ""
package api
func Message(value string) string {
+ value = value + "!"
+ return value + ` "quoted" \\ slash`
}
Expected output state (api/text.go)
package api
func Message(value string) string {
value = value + "!"
return value + ` "quoted" \\ slash`
}Unified AST transformation diff (api/text.go)
package api
func Message(value string) string {
return ""
}
Expected output state (api/text.go)
package api
func Message(value string) string {
return ""
}replace_construct_java
Source: replace_construct_java.txtar · Download raw file
Execute: semedit replace-construct –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –in-function Widget.run –kind if –discriminator ready() –construct-path if[0] –source ‘if (ready()) { work(); }’
CLI invocation
$ semedit replace-construct --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --in-function Widget.run --kind if --discriminator ready() --construct-path if[0] --source 'if (ready()) { work(); }'
Equivalent MCP tool call (semantic_replace_construct)
{
"construct_path": "if[0]",
"discriminator": "ready()",
"file": "src/Widget.java",
"in_function": "Widget.run",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"kind": "if",
"language": "java",
"source": "if (ready()) { work(); }",
"trust_workspace": true
}Assert: Replaced if construct
Assert: if (ready()) { work(); }
Unified AST transformation diff
+ package sample;
+ class Widget {
+ void run() {
+ if (ready()) { work(); }
+ }
+ }
Expected output state (Widget.java)
package sample;
class Widget {
void run() {
if (ready()) { work(); }
}
}Replacing one grouped var accepts a leading doc comment, preserves its sibling, and rejects malformed input without a write.
Source: replace_decl_comments.txtar · Download raw file
Execute: exec semedit replace-decl –file api/errors.go –symbol ErrAlpha –source ‘var ErrAlpha = {’
CLI invocation
$ exec semedit replace-decl --file api/errors.go --symbol ErrAlpha --source 'var ErrAlpha = {'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: syntax error
Execute: semedit replace-decl –file api/errors.go –symbol ErrZulu –source ‘var ErrZulu = errors.New(“updated zulu”)’
CLI invocation
$ semedit replace-decl --file api/errors.go --symbol ErrZulu --source 'var ErrZulu = errors.New("updated zulu")'
Equivalent MCP tool call (semantic_replace_decl)
{
"file": "api/errors.go",
"source": "var ErrZulu = errors.New(\"updated zulu\")",
"symbol": "ErrZulu"
}Unified AST transformation diff (api/errors.go)
package api
import "errors"
var (
// ErrAlpha is the original sentinel.
ErrAlpha = errors.New("alpha")
// ErrZulu stays documented.
ErrZulu = errors.New("zulu")
)
Expected output state (api/errors.go)
package api
import "errors"
var (
// ErrAlpha is the original sentinel.
ErrAlpha = errors.New("alpha")
// ErrZulu stays documented.
ErrZulu = errors.New("zulu")
)Unified AST transformation diff (api/errors.go)
- // ErrAlpha is the original sentinel.
- ErrAlpha = errors.New("alpha")
- ErrZulu = errors.New("zulu")
package api
import "errors"
var (
+ // ErrAlpha is the updated sentinel.
+ ErrAlpha = errors.New("updated alpha")
// ErrZulu stays documented.
+ ErrZulu = errors.New("updated zulu")
)
Expected output state (api/errors.go)
package api
import "errors"
var (
// ErrAlpha is the updated sentinel.
ErrAlpha = errors.New("updated alpha")
// ErrZulu stays documented.
ErrZulu = errors.New("updated zulu")
)replace_decl_java
Source: replace_decl_java.txtar · Download raw file
Execute: semedit replace-decl –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –symbol Widget.run –source ‘void run() { audit(); }’
CLI invocation
$ semedit replace-decl --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --symbol Widget.run --source 'void run() { audit(); }'
Equivalent MCP tool call (semantic_replace_decl)
{
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"source": "void run() { audit(); }",
"symbol": "Widget.run",
"trust_workspace": true
}Assert: Successfully replaced Java declaration
Unified AST transformation diff
+ package sample;
+ class Widget {
+ void run() { audit(); }
+ }
Expected output state (Widget.java)
package sample;
class Widget {
void run() { audit(); }
}WHY: Prove that private function deletion only ignores dynamic imports outside its own package while retaining module-wide directive refusals.
Source: safe_delete_dynamic_import_scope.txtar · Download raw file
Execute: semedit remove-construct –file core/core.go –kind function –symbol clean –safe-delete
CLI invocation
$ semedit remove-construct --file core/core.go --kind function --symbol clean --safe-delete
Equivalent MCP tool call (semantic_remove_construct)
{
"file": "core/core.go",
"kind": "function",
"safe_delete": true,
"symbol": "clean"
}Assert: Safe deletion checks run
Execute: exec semedit remove-construct –file active/active.go –kind function –symbol blockedByInternalTest –safe-delete
CLI invocation
$ exec semedit remove-construct --file active/active.go --kind function --symbol blockedByInternalTest --safe-delete
Equivalent MCP tool call (semedit_semedit)
{}Expected error: dynamic imports in the target package
Execute: exec semedit remove-construct –file inactive/inactive.go –kind function –symbol blockedByInactiveFile –safe-delete
CLI invocation
$ exec semedit remove-construct --file inactive/inactive.go --kind function --symbol blockedByInactiveFile --safe-delete
Equivalent MCP tool call (semedit_semedit)
{}Expected error: dynamic imports in the target package
Execute: exec semedit remove-construct –file linked/linked.go –kind function –symbol blockedByLinkname –safe-delete
CLI invocation
$ exec semedit remove-construct --file linked/linked.go --kind function --symbol blockedByLinkname --safe-delete
Equivalent MCP tool call (semedit_semedit)
{}Expected error: Go generation or link-name directives
Safe deletion must preserve imported package initialization, with and without import cleanup and in an unsaved batch.
Source: safe_delete_import_initialization.txtar · Download raw file
Execute: exec semedit remove-construct –file main.go –kind function –symbol obsolete –safe-delete
CLI invocation
$ exec semedit remove-construct --file main.go --kind function --symbol obsolete --safe-delete
Equivalent MCP tool call (semedit_semedit)
{}Expected error: final use of an import
Execute: exec semedit remove-construct –file constants.go –kind const –symbol unusedNumber –safe-delete
CLI invocation
$ exec semedit remove-construct --file constants.go --kind const --symbol unusedNumber --safe-delete
Equivalent MCP tool call (semedit_semedit)
{}Expected error: final use of an import
Execute: exec semedit remove-construct –file main.go –kind function –symbol obsolete –safe-delete –auto-organize-imports=false
CLI invocation
$ exec semedit remove-construct --file main.go --kind function --symbol obsolete --safe-delete --auto-organize-imports=false
Equivalent MCP tool call (semedit_semedit)
{}Expected error: final use of an import
Execute: semedit mcp –live-reload
CLI invocation
$ semedit mcp --live-reload
Equivalent MCP tool call (semedit_mcp)
{}Assert: status":“error
Assert: final use of an import
Expected error: initialized
Safe deletion resolves declarations in the compiler’s own file set and retains imports still used by surviving declarations.
Source: safe_delete_multifile.txtar · Download raw file
Execute: semedit remove-construct –file z.go –kind function –symbol obsolete –safe-delete
CLI invocation
$ semedit remove-construct --file z.go --kind function --symbol obsolete --safe-delete
Equivalent MCP tool call (semantic_remove_construct)
{
"file": "z.go",
"kind": "function",
"safe_delete": true,
"symbol": "obsolete"
}Assert: Safe deletion checks run
Execute: exec semedit remove-construct –file z.go –kind function –symbol unusedRecursive –safe-delete
CLI invocation
$ exec semedit remove-construct --file z.go --kind function --symbol unusedRecursive --safe-delete
Equivalent MCP tool call (semedit_semedit)
{}Expected error: another Go identifier named
Execute: semedit remove-construct –file z.go –kind var –symbol unusedCount –safe-delete
CLI invocation
$ semedit remove-construct --file z.go --kind var --symbol unusedCount --safe-delete
Equivalent MCP tool call (semantic_remove_construct)
{
"file": "z.go",
"kind": "var",
"safe_delete": true,
"symbol": "unusedCount"
}Assert: Safe deletion checks run
Only standalone unexported basic package variables with zero or constant initialization may be safely deleted.
Source: safe_delete_variables.txtar · Download raw file
Execute: semedit remove-construct –file vars.go –kind var –symbol safeCount –safe-delete
CLI invocation
$ semedit remove-construct --file vars.go --kind var --symbol safeCount --safe-delete
Equivalent MCP tool call (semantic_remove_construct)
{
"file": "vars.go",
"kind": "var",
"safe_delete": true,
"symbol": "safeCount"
}Assert: Safe deletion checks run
Execute: exec semedit remove-construct –file vars.go –kind var –symbol effectfulCount –safe-delete
CLI invocation
$ exec semedit remove-construct --file vars.go --kind var --symbol effectfulCount --safe-delete
Equivalent MCP tool call (semedit_semedit)
{}Expected error: initializer is not proven to be effect-free
Scaffold new Go files with explicit or inferred package declaration
Source: scaffold_file.txtar · Download raw file
1. Scaffold new file inferring package from non-test siblings
CLI invocation
$ semedit scaffold-file --file service/helper.go --package infer
Equivalent MCP tool call (semantic_scaffold_file)
{
"file": "service/helper.go",
"package": "infer"
}2. Scaffold new file with explicit package name
CLI invocation
$ semedit scaffold-file --file service/sub/types.go --package sub
Equivalent MCP tool call (semantic_scaffold_file)
{
"file": "service/sub/types.go",
"package": "sub"
}3. Preserve optional purpose headers in CLI scaffolds
CLI invocation
$ semedit scaffold-file --file service/documented.go --package infer --purpose-header '// WHY: This file documents the service package.'
Equivalent MCP tool call (semantic_scaffold_file)
{
"file": "service/documented.go",
"package": "infer",
"purpose_header": "// WHY: This file documents the service package."
}4. Reject invalid header syntax before creating the file
CLI invocation
$ exec semedit scaffold-file --file service/invalid.go --package infer --purpose-header 'type Invalid struct {'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: invalid purpose header
Unified AST transformation diff (service/documented.go)
+ // WHY: This file documents the service package.
+ package service
Expected output state (service/documented.go)
// WHY: This file documents the service package.
package serviceUnified AST transformation diff (service/helper.go)
+ package service
Expected output state (service/helper.go)
package serviceUnified AST transformation diff (service/sub/types.go)
+ package sub
Expected output state (service/sub/types.go)
package subScaffold a Java source file using its sibling package declaration
Source: scaffold_file_java.txtar · Download raw file
Execute: semedit scaffold-file –language java –file module/src/main/java/com/acme/billing/InvoiceService.java –package infer
CLI invocation
$ semedit scaffold-file --language java --file module/src/main/java/com/acme/billing/InvoiceService.java --package infer
Equivalent MCP tool call (semantic_scaffold_file)
{
"file": "module/src/main/java/com/acme/billing/InvoiceService.java",
"language": "java",
"package": "infer"
}Unified AST transformation diff
+ // WHY: Starts this Java source file in its package so declarations can be added with semantic operations.
+ package com.acme.billing;
Expected output state (module/src/main/java/com/acme/billing/InvoiceService.java)
// WHY: Starts this Java source file in its package so declarations can be added with semantic operations.
package com.acme.billing;Wrap plain and mixed purpose text as Go comments while preserving existing comments.
Source: scaffold_purpose_wrapping.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: isError”:false
Assert: isError":false
Unified AST transformation diff (api/config.go)
+ // Provides application configuration primitives and parsing.
+ package api
Expected output state (api/config.go)
// Provides application configuration primitives and parsing.
package apiUnified AST transformation diff (api/mixed.go)
+ // WHY: Documents the package.
+ // Owns parsing and validation.
+ package api
Expected output state (api/mixed.go)
// WHY: Documents the package.
// Owns parsing and validation.
package apiSet and remove an explicitly owned Go declaration documentation comment.
Source: set_doc_comment.txtar · Download raw file
An identical comment is an observable no-op. A present empty comment removes the attached doc comment. Missing comment is malformed; a directive-owned group is refused without edits.
Execute: semedit set-doc-comment –file doc.go –scope declaration –symbol Serve –comment ‘Serve answers.’
CLI invocation
$ semedit set-doc-comment --file doc.go --scope declaration --symbol Serve --comment 'Serve answers.'
Equivalent MCP tool call (semantic_set_doc_comment)
{
"comment": "Serve answers.",
"file": "doc.go",
"scope": "declaration",
"symbol": "Serve"
}Execute: semedit set-doc-comment –file doc.go –scope declaration –symbol Serve –comment ‘Serve answers.’
CLI invocation
$ semedit set-doc-comment --file doc.go --scope declaration --symbol Serve --comment 'Serve answers.'
Equivalent MCP tool call (semantic_set_doc_comment)
{
"comment": "Serve answers.",
"file": "doc.go",
"scope": "declaration",
"symbol": "Serve"
}Execute: semedit set-doc-comment –file doc.go –scope declaration –symbol Serve –comment '’
CLI invocation
$ semedit set-doc-comment --file doc.go --scope declaration --symbol Serve --comment ''
Equivalent MCP tool call (semantic_set_doc_comment)
{
"comment": "true",
"file": "doc.go",
"scope": "declaration",
"symbol": "Serve"
}Execute: exec semedit set-doc-comment –file doc.go –scope declaration –symbol Serve
CLI invocation
$ exec semedit set-doc-comment --file doc.go --scope declaration --symbol Serve
Equivalent MCP tool call (semedit_semedit)
{}Expected error: comment
Execute: exec semedit set-doc-comment –file directives.go –scope declaration –symbol Keep –comment ‘Replacement.’
CLI invocation
$ exec semedit set-doc-comment --file directives.go --scope declaration --symbol Keep --comment 'Replacement.'
Equivalent MCP tool call (semedit_semedit)
{}Expected error: directive
set_doc_comment_java
Source: set_doc_comment_java.txtar · Download raw file
Execute: semedit set-doc-comment –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –scope declaration –symbol Widget.run –comment ‘Runs work.’
CLI invocation
$ semedit set-doc-comment --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --scope declaration --symbol Widget.run --comment 'Runs work.'
Equivalent MCP tool call (semantic_set_doc_comment)
{
"comment": "Runs work.",
"file": "src/Widget.java",
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"scope": "declaration",
"symbol": "Widget.run",
"trust_workspace": true
}Unified AST transformation diff
- /** Old documentation. */
package sample;
class Widget {
+ /**
+ * Runs work.
+ */
void run() {}
}
Expected output state (src/Widget.java)
package sample;
class Widget {
/**
* Runs work.
*/
void run() {}
}Transactional snapshots and conflict-checked undo
Source: snapshot_undo.txtar · Download raw file
1. Capture snapshot before refactoring
CLI invocation
$ semedit snapshot --label before-calc-edit --paths calc.go
Equivalent MCP tool call (semantic_snapshot)
{
"label": "before-calc-edit",
"paths": [
"calc.go"
]
}Assert: snapshot_id":
Assert: calc.go
2. Modify function body with semantic edit
CLI invocation
$ semedit replace-body --file calc.go --symbol Compute --body 'return x * 10'
Equivalent MCP tool call (semantic_replace_body)
{
"body": "return x * 10",
"file": "calc.go",
"symbol": "Compute"
}3. Restore pre-edit state using latest snapshot
CLI invocation
$ semedit undo --id latest
Equivalent MCP tool call (semantic_undo)
{
"snapshot_id": "latest"
}Assert: restored_files":
Assert: calc.go
Unified AST transformation diff (calc.go)
package main
func Compute(x int) int {
return x + 1
}
Expected output state (calc.go)
package main
func Compute(x int) int {
return x + 1
}Unified AST transformation diff (calc.go)
- return x + 1
package main
func Compute(x int) int {
+ return x * 10
}
Expected output state (calc.go)
package main
func Compute(x int) int {
return x * 10
}Undo reports unavailable diagnostics while keeping a completed restore applied
Source: snapshot_undo_diagnostics_unavailable.txtar · Download raw file
Execute: semedit snapshot –label before-edit –paths main.go
CLI invocation
$ semedit snapshot --label before-edit --paths main.go
Equivalent MCP tool call (semantic_snapshot)
{
"label": "before-edit",
"paths": [
"main.go"
]
}Assert: snapshot_id":
Execute: semedit undo –id latest
CLI invocation
$ semedit undo --id latest
Equivalent MCP tool call (semantic_undo)
{
"snapshot_id": "latest"
}Assert: diagnostic_status":\s*“unavailable
Assert: diagnostic_error”:.*gopls
Assert: restored_files":
Unified AST transformation diff
package main
func Value() int { return 1 }
Expected output state (main.go)
package main
func Value() int { return 1 }Staging commands require one retained MCP session and refuse standalone CLI calls without changing source.
Source: staging_cli_session_required.txtar · Download raw file
Execute: exec semedit stage
CLI invocation
$ exec semedit stage
Equivalent MCP tool call (semedit_semedit)
{}Expected error: staging requires a retained MCP session
Execute: exec semedit stage-drop –step-id step_example
CLI invocation
$ exec semedit stage-drop --step-id step_example
Equivalent MCP tool call (semedit_semedit)
{}Expected error: staging requires a retained MCP session
Execute: exec semedit stage-abort
CLI invocation
$ exec semedit stage-abort
Equivalent MCP tool call (semedit_semedit)
{}Expected error: staging requires a retained MCP session
Execute: exec semedit commit
CLI invocation
$ exec semedit commit
Equivalent MCP tool call (semedit_semedit)
{}Expected error: staging requires a retained MCP session
Java staging controls require a retained MCP session and fail closed from the CLI.
Source: staging_java_cli_session_required.txtar · Download raw file
Execute: exec semedit stage
CLI invocation
$ exec semedit stage
Equivalent MCP tool call (semedit_semedit)
{}Expected error: staging requires a retained MCP session
Execute: exec semedit stage-drop –step-id step_example
CLI invocation
$ exec semedit stage-drop --step-id step_example
Equivalent MCP tool call (semedit_semedit)
{}Expected error: staging requires a retained MCP session
Execute: exec semedit stage-abort
CLI invocation
$ exec semedit stage-abort
Equivalent MCP tool call (semedit_semedit)
{}Expected error: staging requires a retained MCP session
Execute: exec semedit commit
CLI invocation
$ exec semedit commit
Equivalent MCP tool call (semedit_semedit)
{}Expected error: staging requires a retained MCP session
A canonical method selector from inspection must select a pointer receiver.
Source: statement_insert_pointer_receiver_continuation.txtar · Download raw file
Execute: semedit insert-construct –file dispatch.go –kind statement/expression –in-function Dispatcher.Record –discriminator flush() –source record() –anchor before
CLI invocation
$ semedit insert-construct --file dispatch.go --kind statement/expression --in-function Dispatcher.Record --discriminator flush() --source record() --anchor before
Equivalent MCP tool call (semantic_insert_construct)
{
"anchor": "before",
"discriminator": "flush()",
"file": "dispatch.go",
"in_function": "Dispatcher.Record",
"kind": "statement/expression",
"source": "record()"
}Resolve symbols within a directly selected Go package directory.
Source: symbol_lookup_directory.txtar · Download raw file
Execute: semedit lookup –file pkg –symbol Start
CLI invocation
$ semedit lookup --file pkg --symbol Start
Equivalent MCP tool call (semantic_lookup)
{
"file": "pkg",
"symbol": "Start"
}Assert: file":\s*“pkg/start.go
Assert: line”:\s*3
Execute: semedit outline –file pkg
CLI invocation
$ semedit outline --file pkg
Equivalent MCP tool call (semantic_outline)
{}Assert: Start
Execute: semedit outline –path ’ ’ –file pkg
CLI invocation
$ semedit outline --path ' ' --file pkg
Equivalent MCP tool call (semantic_outline)
{
"path": " "
}Assert: Start
Test build-level verification: gofmt rewrite plus gopls diagnostics
Source: verify.txtar · Download raw file
Execute: semedit verify –path .
CLI invocation
$ semedit verify --path .
Equivalent MCP tool call (semantic_verify)
{
"path": "."
}Assert: Verification clean: 0 diagnostics
Unified AST transformation diff
package api
import "fmt"
func Greet() {
fmt.Println("hello world")
}
Expected output state (api/server.go)
package api
import "fmt"
func Greet() {
fmt.Println("hello world")
}Auto verification selects Bash when a matching source and language server are available.
Source: verify_auto_bash.txtar · Download raw file
Execute: semedit verify –trust-workspace
CLI invocation
$ semedit verify --trust-workspace
Equivalent MCP tool call (semantic_verify)
{
"trust_workspace": true
}Assert: language":“bash
An installed Make server enables detection, then reports its unsupported verify capability.
Source: verify_auto_make_unsupported.txtar · Download raw file
Execute: exec semedit verify –trust-workspace
CLI invocation
$ exec semedit verify --trust-workspace
Equivalent MCP tool call (semedit_semedit)
{}Assert: status”:“unsupported
Assert: verification is unsupported for language “make
An outer batch runs normalization and checks once, after both edits are committed.
Source: verify_batch_hooks.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Batch verification preserves accepted launcher and trust aliases from the child operation.
Source: verify_batch_java_aliases.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: language”:“java”,“status”:“verified
Assert: diagnostic_delta_note”:“diagnostic delta omitted
Unified AST transformation diff
- class Widget {}
+ class Gadget {}
Expected output state (src/Widget.java)
class Gadget {}Identical relative diagnostics in separate modules remain distinct in a batch delta.
Source: verify_batch_module_delta.txtar · Download raw file
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: introduced”:[”[b] value.go
Assert: resolved":["[a] value.go
Verify a trusted Java selected file through the central CLI operation registry.
Source: verify_java.txtar · Download raw file
Check-only suppresses both mutation flags.
Execute: semedit verify –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –format-selected-file –organize-imports –check-only
CLI invocation
$ semedit verify --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --format-selected-file --organize-imports --check-only
Equivalent MCP tool call (semantic_verify)
{
"check_only": true,
"file": "src/Widget.java",
"format_selected_file": true,
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"organize_imports": true,
"trust_workspace": true
}Execute: semedit verify –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –file src/Widget.java –format-selected-file –organize-imports
CLI invocation
$ semedit verify --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --file src/Widget.java --format-selected-file --organize-imports
Equivalent MCP tool call (semantic_verify)
{
"file": "src/Widget.java",
"format_selected_file": true,
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"organize_imports": true,
"trust_workspace": true
}Assert: Verification clean: 0 diagnostics
Unified AST transformation diff
- class Widget {
- }
+ class Widget {}
Expected output state (src/Widget.java)
class Widget {}Java scope verification normalizes each selected source through the shared JDT LS session.
Source: verify_java_scope.txtar · Download raw file
Execute: semedit verify –language java –trust-workspace –java-bin $SEMEDIT_TEST_JAVA –jdtls-home tools/jdtls –path src –format-selected-file –organize-imports
CLI invocation
$ semedit verify --language java --trust-workspace --java-bin $SEMEDIT_TEST_JAVA --jdtls-home tools/jdtls --path src --format-selected-file --organize-imports
Equivalent MCP tool call (semantic_verify)
{
"format_selected_file": true,
"java_bin": "$SEMEDIT_TEST_JAVA",
"jdtls_home": "tools/jdtls",
"language": "java",
"organize_imports": true,
"path": "src",
"trust_workspace": true
}Assert: Verification clean: 0 diagnostics.
Unified AST transformation diff (src/main/One.java)
class One {}
Expected output state (src/main/One.java)
class One {}Unified AST transformation diff (src/test/Two.java)
class Two {}
Expected output state (src/test/Two.java)
class Two {}An explicitly configured missing Bash server fails verification instead of disappearing from coverage.
Source: verify_missing_configured_bash.txtar · Download raw file
Execute: exec semedit verify –file scripts/check.sh –bash-bin missing-bash-language-server –trust-workspace
CLI invocation
$ exec semedit verify --file scripts/check.sh --bash-bin missing-bash-language-server --trust-workspace
Equivalent MCP tool call (semedit_semedit)
{}Assert: status":“failed
Assert: executable file not found
Verify formats real workspace Go sources while preserving invalid scratch, vendor, and module cache files.
Source: verify_scratch_exclusion.txtar · Download raw file
Execute: semedit verify –path .
CLI invocation
$ semedit verify --path .
Equivalent MCP tool call (semantic_verify)
{
"path": "."
}Assert: Verification clean: 0 diagnostics
Unified AST transformation diff (.scratch/go/mod/example.com/cache/cache.go)
package invalid {
Expected output state (.scratch/go/mod/example.com/cache/cache.go)
package invalid {Unified AST transformation diff (main.go)
- package main
- func main( ) {}
+ package main
+ func main() {}
Expected output state (main.go)
package main
func main() {}Unified AST transformation diff (vendor/example.com/invalid/invalid.go)
package invalid {
Expected output state (vendor/example.com/invalid/invalid.go)
package invalid {Verify enables filesystem checks from project signals, not installed executables alone.
Source: verify_signal_contract.txtar · Download raw file
A detected linter configuration enables the filesystem check. Explicit configuration selects an alternative without a golangci configuration. Explicit overrides replace the detected check, rather than running both. Explicit disable removes the detected check. An unrelated hook does not require trust or run for the selected Go scope. A required configured check failure is a failed CLI invocation.
Execute: semedit verify –language go –check-only –trust-workspace
CLI invocation
$ semedit verify --language go --check-only --trust-workspace
Equivalent MCP tool call (semantic_verify)
{
"check_only": true,
"language": "go",
"trust_workspace": true
}Execute: exec semedit verify –language go –check-only
CLI invocation
$ exec semedit verify --language go --check-only
Equivalent MCP tool call (semedit_semedit)
{}Execute: semedit verify –language go –check-only –trust-workspace
CLI invocation
$ semedit verify --language go --check-only --trust-workspace
Equivalent MCP tool call (semantic_verify)
{
"check_only": true,
"language": "go",
"trust_workspace": true
}Execute: semedit verify –language go –check-only –trust-workspace
CLI invocation
$ semedit verify --language go --check-only --trust-workspace
Equivalent MCP tool call (semantic_verify)
{
"check_only": true,
"language": "go",
"trust_workspace": true
}Execute: semedit verify –language go –check-only –trust-workspace
CLI invocation
$ semedit verify --language go --check-only --trust-workspace
Equivalent MCP tool call (semantic_verify)
{
"check_only": true,
"language": "go",
"trust_workspace": true
}Execute: semedit verify –language go –check-only –trust-workspace
CLI invocation
$ semedit verify --language go --check-only --trust-workspace
Equivalent MCP tool call (semantic_verify)
{
"check_only": true,
"language": "go",
"trust_workspace": true
}Execute: semedit verify –language go –check-only
CLI invocation
$ semedit verify --language go --check-only
Equivalent MCP tool call (semantic_verify)
{
"check_only": true,
"language": "go"
}Execute: exec semedit verify –language go –check-only –trust-workspace
CLI invocation
$ exec semedit verify --language go --check-only --trust-workspace
Equivalent MCP tool call (semedit_semedit)
{}Selecting an unsupported verifier does not send a foreign source to Go formatting.
Source: verify_unsupported_source.txtar · Download raw file
Execute: exec semedit verify –file sample.rs
CLI invocation
$ exec semedit verify --file sample.rs
Equivalent MCP tool call (semedit_semedit)
{}Assert: verification is unsupported for language
Test semedit workspace-outline discovering packages, descriptions, and modules
Source: workspace_outline.txtar · Download raw file
Scoped outline to api/
Execute: semedit workspace-outline
CLI invocation
$ semedit workspace-outline
Equivalent MCP tool call (semantic_workspace_outline)
{}Assert: Packages:
Assert: . (main) — Package main is the Root package for wsoutline.
Assert: api (api) — Package api provides API endpoints.
Assert: submod (submod) — Package submod is a sub-module.
Assert: api/sub (sub) — Package sub provides nested utilities.
Assert: Modules:
Assert: . (example.com/wsoutline, go 1.24) [root]
Assert: submod (example.com/wsoutline/submod, go 1.24)
Execute: semedit workspace-outline –path api
CLI invocation
$ semedit workspace-outline --path api
Equivalent MCP tool call (semantic_workspace_outline)
{
"path": "api"
}Assert: Packages:
Assert: api (api) — Package api provides API endpoints.
Assert: api/sub (sub) — Package sub provides nested utilities.
go.work reports every declared module, including an external module path
Source: workspace_outline_go_work.txtar · Download raw file
Execute: semedit workspace-outline
CLI invocation
$ semedit workspace-outline
Equivalent MCP tool call (semantic_workspace_outline)
{}Assert: Modules:
Assert: . (example.com/workspace, go 1.24) [root]
Assert: ../workspace_outline_go_work_external (example.com/outside, go 1.24)
Assert: modules/local (example.com/local, go 1.24)
Assert: modules/local/pkg (pkg) — Package pkg is a local workspace package.
Test semedit workspace-outline discovering Java Maven modules and package synopses
Source: workspace_outline_java.txtar · Download raw file
Automatic language selection finds the Maven reactor too
Execute: semedit workspace-outline –language java –include-tests
CLI invocation
$ semedit workspace-outline --language java --include-tests
Equivalent MCP tool call (semantic_workspace_outline)
{
"include_tests": true,
"language": "java"
}Assert: Packages:
Assert: api/com/acme/ledger/api (com.acme.ledger.api) — Ledger API contracts.
Assert: core/com/acme/ledger/core (com.acme.ledger.core) — Core ledger domain models.
Assert: core/com/acme/ledger/core/tests (com.acme.ledger.core.tests) —
Assert: Modules:
Assert: . (com.acme:ledger-parent:1.0.0, pom) [root]
Assert: api (com.acme:ledger-api:1.0.0, jar)
Assert: core (com.acme:ledger-core:1.0.0, jar)
Execute: semedit workspace-outline
CLI invocation
$ semedit workspace-outline
Equivalent MCP tool call (semantic_workspace_outline)
{}Assert: core/com/acme/ledger/core (com.acme.ledger.core) — Core ledger domain models.
Java outline discovers standalone Maven modules and keeps their packages attached.
Source: workspace_outline_java_independent_module.txtar · Download raw file
Execute: semedit workspace-outline –language java
CLI invocation
$ semedit workspace-outline --language java
Equivalent MCP tool call (semantic_workspace_outline)
{
"language": "java"
}Assert: independent/org/example (org.example)
Assert: independent (org.independent:standalone:2.0, jar)
Execute: semedit workspace-outline –language java –path independent
CLI invocation
$ semedit workspace-outline --language java --path independent
Equivalent MCP tool call (semantic_workspace_outline)
{
"language": "java",
"path": "independent"
}Assert: Modules:
Assert: independent (org.independent:standalone:2.0, jar)
Scoped Java workspace outline skips an unrelated malformed Maven sibling.
Source: workspace_outline_java_scoped_malformed_sibling.txtar · Download raw file
Execute: semedit workspace-outline –language java –path core
CLI invocation
$ semedit workspace-outline --language java --path core
Equivalent MCP tool call (semantic_workspace_outline)
{
"language": "java",
"path": "core"
}Assert: Modules:
Assert: core (com.acme:core:1.0, jar)
Assert: core/com/acme (com.acme)
Expected error: parse Maven module POM.*api/pom.xml
Invalid Go manifests return contextual errors and remain unchanged on disk
Source: workspace_outline_manifest_errors.txtar · Download raw file
Execute: exec semedit workspace-outline –language go
CLI invocation
$ exec semedit workspace-outline --language go
Equivalent MCP tool call (semedit_semedit)
{}Expected error: .go.mod.
Execute: exec semedit workspace-outline –language go
CLI invocation
$ exec semedit workspace-outline --language go
Equivalent MCP tool call (semedit_semedit)
{}Expected error: .go.work.
Execute: exec semedit workspace-outline –language java
CLI invocation
$ exec semedit workspace-outline --language java
Equivalent MCP tool call (semedit_semedit)
{}Expected error: .pom.xml.
Automatic workspace discovery combines the root Go module and nested Maven reactor
Source: workspace_outline_polyglot.txtar · Download raw file
MCP exposes the complete structured module and package contract. Explicit language selection returns only that backend’s packages and modules Automatic selection also recognizes a Go ownership subtree beneath the root module
Execute: semedit workspace-outline
CLI invocation
$ semedit workspace-outline
Equivalent MCP tool call (semantic_workspace_outline)
{}Assert: Packages:
Assert: cmd (cmd) [go] — Package cmd is the command entry point.
Assert: go (worker) [go] — Package worker owns the Go subtree.
Assert: java/client/com/example/client (com.example.client) [java] — Client API contracts.
Assert: Modules:
Assert: . (example.com/polyglot, go 1.24) [root] [go]
Assert: java (com.example:polyglot-java:1.0.0, pom) [java]
Assert: java/client (com.example:polyglot-client:1.0.0, jar) [java]
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: Critical result (JSON):
Assert: language”:“java
Assert: module”:“com.example:polyglot-client
Assert: synopsis”:“Coordinates modules in this polyglot workspace.
Assert: doc”:“Coordinates modules in this polyglot workspace.
Assert: packages_count”:1
Assert: packages_count":0
Assert: language":“go
Assert: module”:“example.com/polyglot
Assert: packages_count”:2
Execute: semedit workspace-outline –language go
CLI invocation
$ semedit workspace-outline --language go
Equivalent MCP tool call (semantic_workspace_outline)
{
"language": "go"
}Assert: go (worker) — Package worker owns the Go subtree.
Execute: semedit workspace-outline –language java
CLI invocation
$ semedit workspace-outline --language java
Equivalent MCP tool call (semantic_workspace_outline)
{
"language": "java"
}Assert: java/client/com/example/client (com.example.client) — Client API contracts.
Assert: java (com.example:polyglot-java:1.0.0, pom)
Execute: semedit workspace-outline –path go
CLI invocation
$ semedit workspace-outline --path go
Equivalent MCP tool call (semantic_workspace_outline)
{
"path": "go"
}Assert: go (worker) — Package worker owns the Go subtree.
A scoped outline reports the nearest Go module and its packages, excluding ancestors
Source: workspace_outline_scoping.txtar · Download raw file
Structured ownership and counts agree with the selected module.
Execute: semedit workspace-outline –path submod
CLI invocation
$ semedit workspace-outline --path submod
Equivalent MCP tool call (semantic_workspace_outline)
{
"path": "submod"
}Assert: Packages:
Assert: submod (submod) — Package submod is an independently versioned service.
Assert: submod/internal (internal) — Package internal provides internal support for the submodule.
Assert: Modules:
Assert: submod (example.com/scoped/submod, go 1.24)
Execute: semedit mcp
CLI invocation
$ semedit mcp
Equivalent MCP tool call (semedit_mcp)
{}Assert: module":“example.com/scoped/submod
Assert: module_path”:“example.com/scoped/submod
Assert: packages_count”:2
CI Drift Invariant
Continuous integration regenerates documentation from compiler capabilities and regression test archives before publication.