Skip to content

feat(edit): add native and pure source mutations - #13

Merged
PHPCraftdream merged 5 commits into
mainfrom
source-mutate09
Oct 27, 2026
Merged

PHPCraftdream merged 5 commits into
mainfrom
source-mutate09

Conversation

@PHPCraftdream

@PHPCraftdream PHPCraftdream commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add insert_value, remove_value, and rename_key, with textual and decoded-segment variants, to the PyO3 bridge and standalone pure backend.
  • Create only new final Object keys under existing parents; report collisions as KtavAlreadyExistsError. Remove existing values/subtrees/Array elements without pruning empty ancestors. Rename literal keys while preserving value, order, and same-name no-op bytes.
  • Use positional splices and intended-tree verification; preserve untouched source, comments, BOM, key spelling, and EOL/EOF.
  • Parse source through the selected backend before converting mutation arguments. Never silently fall back from native to pure.
  • Cover exact source, independent semantic expectations, source/error priority, layout, Unicode, dotted materialization, and i64 fidelity across native and pure APIs.
  • Fix mypy through sound dictionary/optional-node/indent narrowing; retain Ruff compliance without casts, ignores, configuration weakening, or a minimum-Python increase.
  • Pin Rust core 8b6b45ffbd9e50e1588e8ab6b1ae5d422bbe8910; update source/generated EN/RU/ZH documentation.

Validation

Exact head: 96b27990c8631040f0204a2b1d1ddb32d36cfc61.

GitHub CI 40495403343 passed 17/17 jobs: native Python 3.9/3.11/3.13 across Linux/macOS/Windows, pure without native on Python 3.9/3.13, test summary, Ruff and mypy, Rust formatting/clippy, and generated documentation.

The actual implementation and independent regression oracles were reviewed. Locked polydoc 0.1.0 check passed. Product builds, runtime tests, and typechecks were not run locally by the parent. Earlier delegated pytest failed with ModuleNotFoundError: No module named 'ktav'; an earlier delegated py_compile also violated the local-execution constraint. Both were disclosed, neither was repeated by the parent, and neither is validation. Acceptance comes from exact-head host-language CI above.

Scope

Preparation for 0.9, not a published 0.8.1 change. No package versions, tags, or releases changed. Scratch files/backups were retained outside the product tree; the pre-existing local spec checkout change is excluded. Unsupported source shapes fail explicitly. This PR remains draft; no merge or release is requested.

🤖 Generated with Claude Code

PHPCraftdream and others added 5 commits October 27, 2026 08:31
Expose insertion, removal and key renaming through the PyO3 bridge and standalone pure backend, with textual and literal-segment paths. Preserve source-first diagnostics, lossless splice boundaries, empty ancestors and semantic verification.

Add independent source-byte and semantic regressions, publish the collision exception consistently, pin the verified Rust core and update generated EN/RU/ZH documentation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sort imports and public exports, wrap long lines, remove unused bindings and split composite assertions. Preserve every distinct regression oracle and remove only an exact duplicate parameter case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PHPCraftdream
PHPCraftdream marked this pull request as ready for review October 27, 2026 14:13
@PHPCraftdream
PHPCraftdream merged commit 7f2b815 into main Oct 27, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant