Skip to content

refactor(agent-context): replace positional-arg chain with param structs - #6195

Merged
bug-ops merged 2 commits into
mainfrom
feat/issue-5992/zeph-agent-context-graph-retri
Jul 13, 2026
Merged

refactor(agent-context): replace positional-arg chain with param structs#6195
bug-ops merged 2 commits into
mainfrom
feat/issue-5992/zeph-agent-context-graph-retri

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Refactor the graph-retrieval-strategy call chain in crates/zeph-agent-context/src/helpers.rs away from the "parameter bag" anti-pattern: six functions each threaded 8-14 positional arguments and individually suppressed clippy::too_many_arguments.
  • Introduce GraphStrategyParams (per-call query state), GraphRecallConfig (shared immutable config), GraphRecallBudget (mutable token-budget accumulator), and SemanticRecallRawParams, grouped by mutability/ownership rather than bundled arbitrarily.
  • Remove all six clippy::too_many_arguments allows and the crate's #![recursion_limit = "256"] override, verified unnecessary after the refactor's reduced Future-nesting depth (checked against the specific --features postgres --all-targets combination the original comment named as the trigger).
  • Pure internal signature refactor — no behavior change, no config/CLI/user-visible surface touched.

Closes #5992

Test plan

  • cargo nextest run -p zeph-agent-context — 86/86 passed
  • cargo test --doc -p zeph-agent-context — 2/2 passed
  • cargo nextest run -p zeph-core --lib --bins (only other dependent crate) — 1822/1822 passed, no regressions
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 13283/13283 passed, 35 skipped
  • cargo +nightly fmt --check — clean
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings — clean
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler" — clean
  • gitleaks protect --staged --no-banner --redact — no leaks found
  • Adversarial critique pass (caught and fixed a private-struct naming collision with pre-existing zeph_common::memory::GraphRecallParams before review)
  • Code review — approved

@github-actions github-actions Bot added refactor Code refactoring without functional changes size/XL Extra large PR (500+ lines) documentation Improvements or additions to documentation rust Rust code changes and removed size/XL Extra large PR (500+ lines) labels Jul 13, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 13, 2026 00:54
bug-ops added 2 commits July 13, 2026 02:54
The graph-retrieval-strategy call chain in helpers.rs threaded 8-14
positional arguments through six functions, each individually
suppressing clippy::too_many_arguments. Introduce GraphStrategyParams
(per-call query state), GraphRecallConfig (shared immutable config),
GraphRecallBudget (mutable token-budget accumulator), and
SemanticRecallRawParams, grouped by mutability/ownership. Remove all
six too_many_arguments allows and the crate's recursion_limit override,
which the reduced Future-nesting depth no longer requires.

Closes #5992
The recursion_limit=256 removal in the graph-retrieval param-struct
refactor was only verified under -p zeph-agent-context --features
postgres, not the full feature bundle combined with postgres at the
workspace level. That combination pulls in enough extra dependent
crates to push the Future-layout query depth past the default 128,
failing CI's build-postgres job. Restore the attribute with a comment
documenting the actual trigger condition.
@bug-ops
bug-ops force-pushed the feat/issue-5992/zeph-agent-context-graph-retri branch from daf80c9 to 869dbd2 Compare July 13, 2026 00:54
@bug-ops
bug-ops merged commit 52db089 into main Jul 13, 2026
43 checks passed
@bug-ops
bug-ops deleted the feat/issue-5992/zeph-agent-context-graph-retri branch July 13, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation refactor Code refactoring without functional changes rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zeph-agent-context: graph-retrieval-strategy call chain threads 10-14 positional params through 6 functions instead of a params struct

1 participant