Skip to content

release: rustez 0.14.1 — atomic candidate-change for the warnings path - #42

Merged
fastrevmd-lab merged 1 commit into
mainfrom
fix/40-atomic-candidate-change-with-warnings
Aug 20, 2026
Merged

fastrevmd-lab merged 1 commit into
mainfrom
fix/40-atomic-candidate-change-with-warnings

Conversation

@fastrevmd-lab

Copy link
Copy Markdown
Member

Closes #40. Picks up rustnetconf 0.14.1, which adds rpc_candidate_change_with_warnings() (upstream #58).

What was wrong

0.14.0 left load_with_warnings() as the one candidate-modifying call that had to hand-roll its own preflight — validate the fragment, then mark_candidate_dirty(), then rpc_with_warnings() — because no atomic candidate-change call returned warnings, and this one needs them.

That workaround closed the malformed-XML hole but was never equivalent to the atomic path. It could not reach rustnetconf's keepalive_check() / ensure_established(), both private, so a dead or unreachable session could still leave a false dirty mark.

False is the dangerous direction: close() acting on a mark this session did not earn discards another operator's uncommitted work on the shared Junos candidate — the exact bug 0.14.0 fixed, reached by a different route.

The fix

rpc_candidate_change_with_warnings() validates, preflights, marks, and only then sends, as one step.

The hand-rolled sequence is gone, and mark_candidate_dirty() is now called nowhere in rustEZ — the atomic calls own the mark, so nothing can mark for an RPC that never reached the device. A comment at the call site says not to reintroduce a separate mark, since that is the specific regression to guard against.

Also removed the now-unused NetconfError import, corrected the build_load_xml() doc comment that still claimed it "needs raw RPC", and updated the two CLAUDE.md bullets that documented hand-marking as the required pattern.

One behavioural detail, stated plainly

Validation now happens inside the atomic call, which runs after auto_open_if_needed() rather than before it. A malformed payload no longer fails before the configuration database is opened; instead the call errors and close_auto_opened_on_error() closes the database this call opened.

Cleanup is still correct. The cost is one open/close round trip on an error path, in exchange for validation having a single source of truth rather than being duplicated in rustEZ and upstream. Deliberate trade, not an oversight.

Unchanged

No public rustEZ API changed. commit_with_comment()'s inverse limitation stands — it still cannot clear the flag on the raw rpc() path, because there is still no typed commit-with-comment upstream.

Verification

  • cargo clippy -p rustez / -p rustez-py / workspace --all-targets, all with -D warnings → clean
  • 58 unit + 4 doctests pass
  • Python suite: 20 passed against a freshly built 0.14.1 extension — the first release where this check exists at all (added in ci: run the Python binding tests #39)
  • cargo deny check advisories bans sources licenses → all ok
  • cargo audit → clean over 237 crates
  • check_versions.py → agrees at 0.14.1

🤖 Generated with Claude Code

Closes #40. Picks up rustnetconf 0.14.1, which adds
rpc_candidate_change_with_warnings() (upstream #58).

0.14.0 left load_with_warnings() as the one candidate-modifying call that had
to hand-roll its own preflight: validate the fragment, then
mark_candidate_dirty(), then rpc_with_warnings(). There was no atomic
candidate-change call that returns warnings, and load_with_warnings() needs
them.

That workaround closed the malformed-XML hole but was never equivalent to the
atomic path. It could not reach rustnetconf's keepalive_check() /
ensure_established(), both private, so a dead or unreachable session could
still leave a FALSE dirty mark. False is the dangerous direction: close()
acting on a mark this session did not earn discards another operator's
uncommitted work on the shared Junos candidate — the exact bug 0.14.0 fixed,
reached by a different route.

rpc_candidate_change_with_warnings() validates, preflights, marks, and only
then sends, as one step. The hand-rolled sequence is gone, and
mark_candidate_dirty() is now called nowhere in rustEZ — the atomic calls own
the mark, so nothing can mark for an RPC that never reached the device. A
comment at the call site says not to reintroduce a separate mark, since that
is the specific regression to guard against.

Validation now happens inside the atomic call, after auto_open_if_needed()
rather than before it. A malformed payload is still cleaned up correctly:
the call errors, so close_auto_opened_on_error() closes the database this
call opened. The cost is one open/close round trip on an error path, in
exchange for a single source of truth for validation.

No public rustEZ API changed. commit_with_comment()'s inverse limitation is
unchanged — it still cannot clear the flag on the raw rpc() path, because
there is still no typed commit-with-comment upstream.

Verified: clippy -p rustez / -p rustez-py / workspace --all-targets with
-D warnings all clean; 58 unit + 4 doctests pass; Python suite 20 passed
against a freshly built 0.14.1 extension; cargo deny advisories/bans/sources/
licenses all ok; cargo audit clean over 237 crates; check_versions.py agrees
at 0.14.1.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

Switch load_with_warnings() to rpc_candidate_change_with_warnings once rustnetconf#58 lands

1 participant