The diff_context document shape exists in three independent
hand-maintained copies:
crates/diffctx-native/src/render.rs:46-77 — the serde structs, consumed by
main.rs:322-326;
crates/diffctx-native/src/pybridge.rs:207-303 — ~97 lines of set_item;
src/diffctx/writer.py — four emitters plus _has_diff_metadata enumerating
the key set a fourth time.
On every diffctx . --diff from the installed wheel, copies 2 and 3 run and
copy 1 does not. pybridge.rs:195-206 already documents this exact shape
losing pre_phase_ms at two call sites at once (#183) — the fork was closed
inside Rust and left open across the language boundary.
Observed drift today, and it is user-visible rather than cosmetic:
main.rs:322-327 hard-errors on anything but json/yaml
("unsupported --format (native binary: yaml, json)"). So cargo install diffctx gets no md — the documented default output — no txt, no graph
subcommand, and none of -o/-c/-i/-w, because all of that lives only in the
Python layer. raw_diff exists in copies 2 and 3 only, injected Python-side at
_native/pipeline.py:183, so --with-raw-diff is likewise wheel-only.
Two things worth separating:
- the duplication (collapsing copy 3 onto copy 1 is roughly −320 Python /
−97 Rust, the largest single reduction found in the audit), and
- the product question the duplication hides: is the crates.io binary meant
to be a second-class surface? If yes, say so in the README, because today it
advertises the Python feature set. If no, markdown rendering has to move into
the engine.
Medium risk: tree mode still needs a dict path, so this is not a mechanical
collapse. Gate: scripts/bitcheck.sh covers the native side only, so the
Python emitters need their own byte-diff through the installed wheel (3 ranges x
{yaml,json,txt,md}) on top of the corpus run.
Found during the code-cleanliness tournament (2026-08-20); protocol in
ANALYSIS_code_cleanliness_refactoring.md §F11.
The
diff_contextdocument shape exists in three independenthand-maintained copies:
crates/diffctx-native/src/render.rs:46-77— the serde structs, consumed bymain.rs:322-326;crates/diffctx-native/src/pybridge.rs:207-303— ~97 lines ofset_item;src/diffctx/writer.py— four emitters plus_has_diff_metadataenumeratingthe key set a fourth time.
On every
diffctx . --difffrom the installed wheel, copies 2 and 3 run andcopy 1 does not.
pybridge.rs:195-206already documents this exact shapelosing
pre_phase_msat two call sites at once (#183) — the fork was closedinside Rust and left open across the language boundary.
Observed drift today, and it is user-visible rather than cosmetic:
main.rs:322-327hard-errors on anything butjson/yaml(
"unsupported --format (native binary: yaml, json)"). Socargo install diffctxgets nomd— the documented default output — notxt, nographsubcommand, and none of
-o/-c/-i/-w, because all of that lives only in thePython layer.
raw_diffexists in copies 2 and 3 only, injected Python-side at_native/pipeline.py:183, so--with-raw-diffis likewise wheel-only.Two things worth separating:
−97 Rust, the largest single reduction found in the audit), and
to be a second-class surface? If yes, say so in the README, because today it
advertises the Python feature set. If no, markdown rendering has to move into
the engine.
Medium risk: tree mode still needs a dict path, so this is not a mechanical
collapse. Gate:
scripts/bitcheck.shcovers the native side only, so thePython emitters need their own byte-diff through the installed wheel (3 ranges x
{yaml,json,txt,md}) on top of the corpus run.
Found during the code-cleanliness tournament (2026-08-20); protocol in
ANALYSIS_code_cleanliness_refactoring.md§F11.