Diff, known diffs and drift
ruby-anything diff <repo> <unit-id>
diff replays every recorded case against the Ruby port. It must be N/N. It groups the
mismatches and names where each first differs. A mismatch is a behavior difference: fix the port,
never the recording.
How values are compared
- Error families map across languages:
ValueError/IllegalArgumentException/ArgumentException->ArgumentError;KeyError/NoSuchElementException->KeyError;IndexError/IndexOutOfBounds->IndexError;ZeroDivisionError/ArithmeticException->ZeroDivisionError; plainError/RuntimeException->RuntimeError. - Messages are compared only with
diff --messages. - Numbers keep their type:
difftells1from1.0.
Stalled
When three changes to the port in a row gain no matching case, diff says the port is
stalled. Stop editing, show the remaining mismatches to the user and ask: they may know the
rule that is missing.
Known diffs
A port keeps behavior, bugs included. Port a known bug as it is; fix it in its own change after
gate passes, with each case it changes in rails/port/known-diffs.jsonl
({"unit", "args", "actual", "reason"}) and the user's yes.
Drift
ruby-anything drift <repo>
The original keeps changing? drift re-runs the original on every recorded unit case and HTTP/CLI
case, and lists what now answers differently, plus routes no case records. For each drifted unit,
record again, then diff: the new mismatches are what changed upstream.