Skip to content

fix(evolve): Budget/Runtime/Observability settings bags - #816

Open
Birfy wants to merge 2 commits into
mainfrom
fix/804-policies-consolidation
Open

Birfy wants to merge 2 commits into
mainfrom
fix/804-policies-consolidation

Conversation

@Birfy

@Birfy Birfy commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Finishes the Policies consolidation promised when the bundle landed (#804).

  • Add BudgetSettings / RuntimeSettings / ObservabilitySettings with flat kwargs as shortcuts (merged_with-style resolve).
  • Wire bags into evolve and async_evolve; regenerate docs/api.md.
  • Freeze the flat surface with EVOLVE_PARAM_ALLOWLIST + test; document the stable subset in docs/evolution.md, CONTRIBUTING.md, and algorithm-authoring.
  • Replace the stale “thirty-five parameters” copy.

Closes #804.

Test plan

  • pytest -q tests/test_evolve_settings.py tests/test_async_early_stop.py tests/test_budget.py tests/test_api_docs.py
  • python -m tools.gen_api_docs --check

Birfy added 2 commits November 7, 2026 06:28
Fold post-Policies numerics into typed bags while keeping flat kwargs as
shortcuts. Freeze the public evolve() surface with EVOLVE_PARAM_ALLOWLIST,
document the stable subset, and point new knobs at Policies or a bag.
@Birfy

Birfy commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS
Tip SHA: 56b27ac
Ran: pytest -q tests/test_evolve_settings.py tests/test_async_early_stop.py tests/test_budget.py tests/test_api_docs.py (all green); python -m tools.gen_api_docs --check (up to date); .github/scripts/risk_gate.py → T3
Not run: full matrix beyond the author's targeted suite (deferred to required CI build + test 3.9–3.13)

Summary

Closes #804 cleanly: folds the post-Policies numeric/flag surface into typed BudgetSettings / RuntimeSettings / ObservabilitySettings, keeps flat kwargs as shortcuts, freezes the sync evolve() signature with EVOLVE_PARAM_ALLOWLIST, and updates the stale “thirty-five parameters” copy across Policies / docs / CONTRIBUTING / algorithm-authoring.

Correctness

  • _resolve matches the documented merged_with rule: with no bag, flats (including defaults) populate; with a bag, only non-default flats override. Same intentional limitation as Policies (cannot “clear” a bag field back to its dataclass default via an explicit flat default).
  • Sync evolve folds bags once then reassigns locals; async path maps max_iters ↔ max_rollouts and preserves the historical max_seconds=20.0 floor when the resolved value is still None.
  • asynchronous=True forwards both folded flats and the original bags so a bag-only caller still works if resolve re-runs — double-resolve stays consistent under the non-default-wins rule.
  • Allowlist test locks the public sync surface; stable subset ⊆ allowlist; bag + flat integration tests cover patience / max_rollouts / flat-without-bag paths.

Design fit

Right homes for the knobs: Policies for replaceable pieces, bags for spend/runtime/observability. Docs + CONTRIBUTING tell authors where new knobs go. Public exports and tools/gen_api_docs MODULES/CONSTANTS keep the generated API honest. Changelog fragment present.

Nits (non-blocking)

  • Flat surface still grows by three bag kwargs; that is the intended trade for evolve: finish Policies consolidation — 57 top-level kwargs past the documented 35 budget #804, and the allowlist makes further growth deliberate.
  • No async_evolve allowlist twin yet — fine for this PR since Spec/MCP/CLI mirror the sync entry; worth a follow-up if async drifts.
  • _resolve identity/== on callables/objects is fine for these fields; just be aware mutable defaults are not in play (frozen dataclasses).

Risk

risk_gate → T3 (paths: agentdescent/evolution.py, agentdescent/async_evolve.py, CONTRIBUTING.md). No auto-merge; waiting on Danyang click after required CI green.

@Birfy

Birfy commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

PASS

Tip 556fe4b7400344db44f8b1c293372f8a98e5b658 — Policies consolidation settings bags (#804). risk_gate T3 (evolution.py / async_evolve.py / CONTRIBUTING). Flat kwargs remain shortcuts; EVOLVE_PARAM_ALLOWLIST freezes growth. Ready for Danyang merge click when CI is green.

@Birfy

Birfy commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator Author

Verdict: PASS
Tip SHA: 556fe4b
Ran: re-checked after tip advanced (merge main into fix/804 after #812); pytest -q tests/test_evolve_settings.py tests/test_api_docs.py (green); python -m tools.gen_api_docs --check (up to date); risk_gate → T3
Not run: full 3.9–3.13 matrix (deferred to required CI on this tip)

Note on tip change

Prior PASS was on 56b27ac (bag implementation). Tip is now merge commit 556fe4b bringing main/#812 (MCP Path A) into the branch. Diff vs previous tip is only #812 files — no conflict with Budget/Runtime/Observability bags, allowlist, or evolve wiring. Re-verified bags + allowlist tests on the new tip.

Summary (unchanged intent)

Closes #804: typed settings bags, flat kwargs as shortcuts, EVOLVE_PARAM_ALLOWLIST freeze, docs/CONTRIBUTING/algorithm-authoring updated. Design and correctness notes from the prior tip review still hold.

Risk

risk_gate → T3 (evolution.py, async_evolve.py, CONTRIBUTING.md). No auto-merge; waiting on Danyang click after required CI green on 556fe4b.

This branch has not been deployed

No deployments
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.

evolve: finish Policies consolidation — 57 top-level kwargs past the documented 35 budget

1 participant