Repository navigation
plugin: context collapses utility calls in a narrative walk onto one line (#1835) - #1964
Open
swapnilpaliwal-sd wants to merge 1 commit into
Open
swapnilpaliwal-sd wants to merge 1 commit into
swapnilpaliwal-sd wants to merge 1 commit into
Conversation
swapnilpaliwal-sd
requested review from
JaredHLZhang,
Whua689 and
suyashpaliwal26
as code owners
October 14, 2026 22:16
…line Asked how a feature works, the call flow descended into every logger, metrics counter, string helper and serializer it passed: on an order-cancel flow 13 of 25 steps (Python) and 13 of 26 (TypeScript) were such helpers, and the domain steps were spread between them. A callee is now utility when the graph's shape says so, not its name: its package (directory) is a bottom layer that no resolved call leaves for non-utility project code, the package is called from at least 3 other directories (2 when it is named for logging or metrics, the only name-based rule, a tie-breaker), and the callable is a sink in the flow, so a retry wrapper that runs the wrapped call stays a step. Utility callees are not walked; each step names them on one line, "also calls (utility, not walked): increment, normalize_id, to_json", and --json carries them as also_calls, so nothing becomes invisible. A callable whose name, class, file or directory carries one of the task's words, or that sits in a file the flow starts in, is never demoted, so "how is a cancellation logged" still walks into the logger. Synthetic cancel flow, first 12 steps: domain 8 -> 11 (Python) and 6 -> 11 (TypeScript); every domain step still shown. On 9 questions over 3 open-source Python services, 3 walks collapse clock, URL and object-storage helpers with no step lost, and 6 are unchanged (a package that calls back into project code is not a bottom layer). Refs #1835
Open
8 tasks
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 #1974
Part of #1835.
Asked how a feature works, the call flow descended into every logger,
metrics counter, string helper and serializer it passed: on an
order-cancel flow 13 of 25 steps (Python) and 13 of 26 (TypeScript)
were such helpers, and the domain steps were spread between them.
A callee is now utility when the graph's shape says so, not its name:
its package (directory) is a bottom layer that no resolved call leaves
for non-utility project code, the package is called from at least 3
other directories (2 when it is named for logging or metrics, the only
name-based rule, a tie-breaker), and the callable is a sink in the
flow, so a retry wrapper that runs the wrapped call stays a step.
Utility callees are not walked; each step names them on one line,
"also calls (utility, not walked): increment, normalize_id, to_json",
and --json carries them as also_calls, so nothing becomes invisible.
A callable whose name, class, file or directory carries one of the
task's words, or that sits in a file the flow starts in, is never
demoted, so "how is a cancellation logged" still walks into the logger.
Synthetic cancel flow, first 12 steps: domain 8 -> 11 (Python) and
6 -> 11 (TypeScript); every domain step still shown. On 9 questions
over 3 open-source Python services, 3 walks collapse clock, URL and
object-storage helpers with no step lost, and 6 are unchanged (a
package that calls back into project code is not a bottom layer).
Tests: tests/cases/{python,typescript}/context-utility-collapses-under-its-caller, 3 checks each: domain steps come first and utilities collapse; a retry wrapper stays a step while its backoff collapses; a control asking about logging still walks into the logger. On the base, 2 of 6 pass (the two controls); after the change, 6 of 6. run.py --lang python 448/448, --lang typescript 355/355, front_door.py 21/21, no_exec.py 7/7.
Not changed: library calls such as
logger.infowere never steps and are not listed. Separate finding: without--from, the narrative form chose the constructor and a validation helper as entry points rather than the cancel method itself. That is entry selection, which this change does not touch.