Skip to content

plugin: context collapses utility calls in a narrative walk onto one line (#1835) - #1964

Open
swapnilpaliwal-sd wants to merge 1 commit into
0.2.1from
fix/context-demote-utility
Open

swapnilpaliwal-sd wants to merge 1 commit into
0.2.1from
fix/context-demote-utility

Conversation

@swapnilpaliwal-sd

@swapnilpaliwal-sd swapnilpaliwal-sd commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

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.info were 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.

@swapnilpaliwal-sd swapnilpaliwal-sd added enhancement New feature or request typescript TypeScript python Python plugin the axiomcode plugin: skill + MCP layer labels Oct 14, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request plugin the axiomcode plugin: skill + MCP layer python Python typescript TypeScript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant