# Soundness: what "safe" guarantees (and what it doesn't) > **TL;DR.** `format` never changes behaviour. `upgrade` is **minimal-bump by > default**: `profile=` moves only when strictly needed for validity, and a tool > that validates where it sits is kept byte-untouched. `upgrade --modernize` is > the **behavior-preserving walk**: it advances the profile only as far as it > can prove no applicable breaking (`must_fix`) Galaxy behaviour change is > crossed un-fixed, stops there with an actionable report, and the result is > **structurally valid** at the profile it declares. Going further is an > explicit choice (`--modernize --allow-behavior-change`). > Behaviour-affecting edits are applied **only where the tool can prove them safe**; > everything else is reported, not changed. That conservatism is the point: it's what > makes the automation trustworthy. ## Two different promises **Formatting is behaviour-preserving by construction.** Indentation, blank lines, attribute/element order, empty-element shorthand, and CDATA-wrapping a pure-text body change *bytes*, not *meaning*. `format` is safe and idempotent and never touches `profile=`. **Upgrading is semantic, and its guarantee is two-part.** Bumping a tool's `profile=` can change how Galaxy interprets it. Structurally, the oracle is **XSD validity at the target profile**: the engine only advances a tool to a profile where it still validates. Validity is a sound oracle for **structural** changes, not a behaviour oracle, so a second, behavioural gate caps the walk: the engine computes every Galaxy-catalogued behaviour change the bump would cross, detects per tool which actually apply, and **stops below the first applicable `must_fix` change it cannot provably fix on that tool**. A fix is credited only by execution (applied, then re-detected); the stop report names the blocking code and links to [`docs/profile_boundaries.md`](https://github.com/richard-burhans/galaxy-tool-refactor/blob/main/docs/profile_boundaries.md), the per-boundary what-changed-and-what-to-do reference. Advisory (`consider`) changes are warned about, never crossed silently. The full argument is [behavior-gate.md](proofs/behavior-gate.md), part of the published [rule proofs](proofs/index.md). ## How we know `format` is behaviour-preserving: the audit "Behaviour-preserving by construction" is a strong claim, so it is **adversarially audited**, not just asserted. Every fixable rule's behaviour-preservation claim was stress-tested by independent skeptics that try to *execute a counterexample* breaking it; each "refuted" verdict was then **re-verified by execution on the current code and against Galaxy's own source** before being acted on (adversarial agents over-claim). The result is recorded, rule by rule, in [`docs/behavior_preservation.md`](https://github.com/richard-burhans/galaxy-tool-refactor/blob/main/docs/behavior_preservation.md), the proof ledger. This is an honest process, and it *found real bugs* in formatting rules once assumed safe, all now fixed, each pinned by a regression fixture so a future change can't silently reintroduce the break: - a whitespace-only ``/``/`` body was collapsed, dropping template content (**GTR004**); a carriage return was lost through a CDATA wrap (**GTR018.1/GTR019.1**); a multi-flag `