fix(formatters): render backend function names in markdown diff (closes #299)#301
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
#299) _md_diff() read `fn` from backend node entries, but _diff_backend() renames the field to `name` on the way out, so every function name fell through to the empty-string default. The diff reported correct counts with blank identities: "- + `` (a.py)". Fixed on the consumer side — commands/diff.py, dashboard and MCP already consume `name`, so changing the producer would break them. Tests pin the contract against real _diff_backend() output, not a hand-written stand-in, and fail if the fix is reverted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #299.
Masalah
impact --check diff --format markdownselalu mencetak nama fungsi backend kosong. Producer/consumer memakai key berbeda:diff_engine._diff_backend()mengemit{"name": "freshFn", "file": "a.py", ...}formatters/markdown.py:_md_diff()membacanode.get('fn', '')→ selalu jatuh ke default''Sebelum:
Sesudah:
Jumlahnya benar, identitasnya kosong — tidak crash, jadi tak pernah ketahuan. Blok frontend di fungsi yang sama sudah benar (
cls.get('name')); ini murni sisi backend.Kenapa diperbaiki di consumer, bukan producer
commands/diff.py, dashboard, dan MCP sudah mengonsumsiname. Mengubah producer memecah mereka. Constraint ini ditulis di issue sebelum implementasi.Verifikasi (dijalankan)
tests/test_markdown_diff.py). Salah satunya merender output_diff_backend()asli, bukan dict tiruan — jadi kontrak producer↔consumer benar-benar terkunci, bukan cuma asumsi saya tentang bentuknya.git stash→ run → pop). Yang frontend tetap lolos, sesuai — memang tak pernah rusak.test_formatters,test_formatters_base,test_formatters_phase2,test_graphml_formatter).Konteks penemuan
Ditemukan saat navigasi untuk #297 (edge-diff), difile terpisah sesuai aturan Issue Radar dan tidak dicampur ke PR #298 agar scope-nya bersih.
Command count tetap 12. Bug fix →
skip-design-doc.🤖 Generated with Claude Code