Skip to content

docs(delegation): document WeightedStrategy object-identity invariant#206

Merged
miguelgfierro merged 2 commits into
mainfrom
docs/weighted-identity-note
May 21, 2026
Merged

docs(delegation): document WeightedStrategy object-identity invariant#206
miguelgfierro merged 2 commits into
mainfrom
docs/weighted-identity-note

Conversation

@miguelgfierro
Copy link
Copy Markdown
Contributor

Summary

WeightedStrategy dedupes per-agent blended scores via id(agent). That's fine for the typical static pool, but if a child strategy returns a wrapped/forked copy of an agent, or if the pool contains two distinct objects representing the same logical agent, the blend silently double-counts or drops contributions — no error, just wrong scores.

Adds a .. note:: block to the class docstring spelling out the invariant so callers wiring up custom strategies don't have to discover it empirically.

Docs-only; no behavior change.

miguelgfierro and others added 2 commits May 21, 2026 10:07
WeightedStrategy dedupes blended scores via id(agent). If a child strategy
returns wrapped/forked copies, or if the pool contains two distinct objects
for the same logical agent, the blend silently double-counts or drops
contributions. Document the invariant so callers wiring up custom strategies
don't get surprised.
@miguelgfierro miguelgfierro merged commit 5c3ca25 into main May 21, 2026
7 checks passed
@miguelgfierro miguelgfierro deleted the docs/weighted-identity-note branch May 21, 2026 08:16
ancongui pushed a commit that referenced this pull request May 31, 2026
…note

docs(delegation): document WeightedStrategy object-identity invariant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant