Repository navigation
fix(callflow): mark compacted labels — non_ai_ silently renders as "ai" - #2510
Tomaskobel wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This PR modifies the humanize_label function in graphify/callflow_html.py, which shortens snake_case identifiers for display. It raises the compaction threshold from 28 to 42 characters (to match the render width) and prepends a leading "..." to labels that do get shortened by dropping leading words. Two new tests are added covering that fitting-width labels are left unchanged and that compacted labels are prefixed with the ellipsis.
No blocking issues surfaced. 1 lower-confidence candidate did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 371 functions depend on the 151 functions this change touches.
Health — grade A; 9 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):
_rebuild_code()— 87 callers, 51 callees (high)dispatch_command()— 2 callers, 118 callees (high)write_callflow_html()— 7 callers, 25 callees (high)watch()— 5 callers, 6 callees (medium)load_graph()— 3 callers, 7 callees (medium)derive_sections_from_communities()— 3 callers, 6 callees (medium)generate_section_flowchart()— 1 callers, 11 callees (medium)generate_call_table_rows()— 1 callers, 6 callees (medium)- …and 1 more
Verification — 371 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 241 function(s) in the blast radius were not formally verified this run
70d1bf0 to
a6060cd
Compare
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This PR adjusts the humanize_label function in graphify/callflow_html.py so that snake_case identifiers are only compacted when they exceed 42 characters (up from 28), aligning the threshold with the render width, and prepends a "..." prefix when leading words are dropped. Two new tests in tests/test_callflow_html.py cover that labels fitting within the width are left unchanged and that compacted labels are marked as truncated.
No blocking issues surfaced. 4 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 390 functions depend on the 164 functions this change touches.
Health — grade A; 9 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):
_rebuild_code()— 93 callers, 52 callees (high)dispatch_command()— 2 callers, 118 callees (high)write_callflow_html()— 7 callers, 25 callees (high)load_graph()— 8 callers, 7 callees (high)generate_call_table_rows()— 8 callers, 6 callees (high)watch()— 5 callers, 6 callees (medium)derive_sections_from_communities()— 3 callers, 6 callees (medium)generate_section_flowchart()— 1 callers, 11 callees (medium)- …and 1 more
Verification — 390 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 260 function(s) in the blast radius were not formally verified this run
a6060cd to
51947d0
Compare
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This PR modifies humanize_label in graphify/callflow_html.py to add a configurable compact_over threshold parameter and to prepend a leading "..." when a long snake_case label is compacted down to its last three words. It updates node_display_name to pass compact_over=42 so table cells compact only at the render width rather than the default 28 used for Mermaid boxes. It also adds three tests covering the render-width behavior, the truncation ellipsis, and the unchanged diagram-width threshold.
No blocking issues surfaced. 4 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 392 functions depend on the 166 functions this change touches.
Health — grade A; 9 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):
_rebuild_code()— 93 callers, 52 callees (high)dispatch_command()— 2 callers, 118 callees (high)write_callflow_html()— 7 callers, 25 callees (high)load_graph()— 8 callers, 7 callees (high)generate_call_table_rows()— 8 callers, 6 callees (high)watch()— 5 callers, 6 callees (medium)derive_sections_from_communities()— 3 callers, 6 callees (medium)generate_section_flowchart()— 1 callers, 11 callees (medium)- …and 1 more
Verification — 392 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 262 function(s) in the blast radius were not formally verified this run
… that fit
humanize_label reduces a snake_case name to its last three words past 28
characters. It drops *leading* words, which silently reverses meaning
when the head carries a negation, and leaves no ellipsis to signal that
anything was removed:
api_list_non_ai_email_templates -> "ai email templates"
skip_company_content_too_short -> "content too short"
Both read as complete, correct identifiers of a different function.
truncate_text appends '...' when it cuts; this path did not.
Prefix compacted labels with an ellipsis, and make the threshold a
parameter. Mermaid node boxes keep the historical 28 so diagram width is
unchanged (measured: mean 24.3 -> 25.6 chars, the ellipsis only). Table
cells are flowing HTML, not fixed-width boxes, so node_display_name
passes the 42-char render width -- 87 of 96 affected labels there were
being shortened despite fitting.
Three regression tests, all failing on v8 as-is.
51947d0 to
c37f7c2
Compare
There was a problem hiding this comment.
Graphify reviewed this change.
Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).
Graphify review — findings
This PR modifies humanize_label in graphify/callflow_html.py to add a configurable compact_over threshold parameter (defaulting to the previous 28) and to prepend a leading "..." when a snake_case label is compacted to its last three words. It also updates node_display_name to pass compact_over=42 so table cells only compact labels that exceed the render width, while Mermaid boxes keep the original threshold. Three new tests are added covering table-cell labels that fit the render width, the leading-ellipsis marking on compacted labels, and the unchanged diagram-width behavior.
No blocking issues surfaced. 4 lower-confidence candidates did not survive cross-model review.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 402 functions depend on the 166 functions this change touches.
Health — grade A; 10 existing hotspot(s) in the area this change touches (pre-existing, not introduced here):
_rebuild_code()— 93 callers, 51 callees (high)dispatch_command()— 2 callers, 117 callees (high)write_callflow_html()— 7 callers, 25 callees (high)load_graph()— 8 callers, 7 callees (high)generate_call_table_rows()— 8 callers, 6 callees (high)watch()— 5 callers, 6 callees (medium)derive_sections_from_communities()— 3 callers, 6 callees (medium)generate_section_flowchart()— 1 callers, 11 callees (medium)- …and 2 more
Verification — 402 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 262 function(s) in the blast radius were not formally verified this run
|
Still reproducible on 0.9.45 — No rush at all, and happy to reshape it if you'd prefer a different approach — e.g. keeping the head ( |
Problem
humanize_labelreduces a snake_case name to its last three words past 28 characters. It drops leading words — where negations live — and leaves no ellipsis to signal that anything was removed:api_list_non_ai_email_templatesai email templatesapi_update_non_ai_email_templateai email templategenerate_non_ai_template_emailai template emailskip_company_content_too_shortcontent too shortThe first three drop
non_, inverting the meaning. The fourth turns a skip condition into what reads as an assertion. Each reads as a complete, correct identifier — of a function that does the opposite.truncate_textappends...when it cuts; this path does not.Separately, the threshold is 28 while the render width applied on the next line is 42, so names of 29–42 characters are shortened even though they fit.
Fix
Two changes, deliberately narrow:
humanize_labelfeeds two surfaces with different constraints, which is why a single threshold cannot be right for both:node_label) — width is scarce. Unchanged at 28. Measured on a 4,990-node graph: mean label width 24.3 → 25.6 chars, entirely from the ellipsis. No layout change.node_display_name→format_node_refs) — flowing HTML, width is not scarce. These now pass the 42-char render width, so 87 of 96 affected labels show their real name instead of a rewritten one.The main table label column already uses the raw label, so it is unaffected.
Result
api_list_non_ai_email_templates()...ai email templates()api_list_non_ai_email_templates()skip_company_content_too_short()...content too short()skip_company_content_too_short()Meaning is no longer silently inverted on either surface, and diagram width is preserved.
Notes
v8as-is (verified against a clean checkout, not a working-tree revert).v8(31 pre-existing, mostlytest_terraform.py/test_skillgen.py).test_labeling.py::test_label_communities_batches_when_over_batch_sizeis flaky and fails intermittently on unpatchedv8too....to matchtruncate_textrather than….api_list_non_ai...), that is a one-line change.