Skip to content

Adopt Kida 0.7 capabilities across milo-cli#58

Merged
lbliii merged 3 commits intomainfrom
lbliii/upgrade-kida
Apr 21, 2026
Merged

Adopt Kida 0.7 capabilities across milo-cli#58
lbliii merged 3 commits intomainfrom
lbliii/upgrade-kida

Conversation

@lbliii
Copy link
Copy Markdown
Owner

@lbliii lbliii commented Apr 21, 2026

Summary

Five-sprint adoption epic for kida 0.7 capabilities. Wires inline_components / validate_calls / opt-in enable_capture into get_env(); routes the gateway / registry / saga executor pools through kida.get_optimal_workers (IO_BOUND vs RENDER); adds {% flush %} boundaries to pipeline_progress and pipeline_detail; ships milo.live re-exports + a new examples/liverender; adds a milo components subcommand backed by kida.DefMetadata; and gates CI on a new template-compile script. Pins kida-templates>=0.7.0,<0.8.0 and adds two towncrier fragments.

Test suite: 1422 → 1431 (+9). Plan and per-sprint results in .context/plans/kida-0.7-adoption.md.

Test plan

  • uv run pytest -q (1431 passed, 1 skipped)
  • uv run ruff check src/milo/ tests/ clean on touched files
  • uv run ruff format --check clean
  • uv run python scripts/check_templates.py (new gate) passes
  • uv run milo components lists 22 bundled defs; --json parses cleanly
  • uv run python examples/liverender/app.py smoke test
  • uv run towncrier build --draft --version 0.3.0 renders without warnings

🤖 Generated with Claude Code

lbliii and others added 2 commits April 21, 2026 11:17
Five-sprint epic landing strict-safe defaults, workload-aware
executor sizing, streaming flush boundaries, live-rendering
re-exports, and component introspection — taking get_env() from
1 to 4 kida features and milo subcommands from 4 to 5.

- get_env(): inline_components=True, validate_calls=True, opt-in
  enable_capture; default-singleton fast path updated.
- gateway.py / registry.py / state.py: use kida.get_optimal_workers
  with IO_BOUND (gateway, registry) and RENDER (saga executor)
  workload types; integration spy tests confirm wiring.
- _defs.kida: {% flush %} boundaries on pipeline_progress (×2)
  and pipeline_detail (×3) to encode streaming contract.
- src/milo/live.py: re-export LiveRenderer/Spinner/
  stream_to_terminal/terminal_env from kida.terminal; new
  examples/liverender; site/content/docs/usage/live.md covers
  App+Tick vs LiveRenderer decision.
- src/milo/components_cli.py + cli.py: new `milo components`
  subcommand backed by kida.DefMetadata, with --json and --path.
- scripts/check_templates.py + ci.yml: compile-time template
  validation gate using milo's actual env.
- pyproject.toml: pin kida-templates>=0.7.0,<0.8.0.
- changelog.d: two towncrier fragments documenting adoption +
  strict_undefined conformance.

Test suite: 1422 → 1431 (+9). Fixed latent {% def %}-in-{% elif %}
in examples/filepicker, and a progress.kida bug surfaced by the
new template-check gate. Plan and per-sprint results recorded in
.context/plans/kida-0.7-adoption.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sprint 2 set Store's auto-sized executor to WorkloadType.RENDER, which
caps at 4 workers and is halved to 2 under CI=true. With 2 workers and
8 blocking Take() waiters, only 2 sagas consumed BROADCAST per dispatch
and the other 6 each waited their full 5s timeout — blowing the
test_bench_take_multiple_waiters[waiters-8] per-round budget and
exceeding the 120s pytest-timeout on the pytest-benchmark CI job.

Sagas execute side-effect code (Call / Take / Retry / Race) which is
I/O-shaped, not template rendering. IO_BOUND is the correct
classification and matches the gateway/registry pools (also IO_BOUND).
Restores the pre-Sprint-2 effective worker count of 4 in CI.

Verified locally: CI=true uv run pytest .../waiters-8 finishes in
115s of the 120s budget. Full suite still 1431 passed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

Coverage Report

87.7% overall coverage

File Coverage
src/milo/\_\_init\_\_.py 100.0%
src/milo/\_child.py 92.7%
src/milo/\_cli\_help.py 90.5%
src/milo/\_command\_defs.py 99.2%
src/milo/\_compat.py 63.3%
src/milo/\_errors.py 92.8%
src/milo/\_jsonrpc.py 95.7%
src/milo/\_mcp\_router.py 100.0%
src/milo/\_protocols.py 100.0%
src/milo/\_scaffold/\_\_init\_\_.py 100.0%
src/milo/\_types.py 100.0%
src/milo/app.py 58.0%
src/milo/cli.py 87.3%
src/milo/commands.py 88.9%
src/milo/completions.py 96.0%
src/milo/components\_cli.py 88.1%
src/milo/config.py 87.3%
src/milo/context.py 86.6%
src/milo/dev.py 91.9%
src/milo/doctor.py 89.9%
src/milo/flow.py 96.2%
src/milo/form.py 89.7%
src/milo/gateway.py 69.0%
src/milo/groups.py 92.5%
src/milo/help.py 100.0%
src/milo/input/\_\_init\_\_.py 100.0%
src/milo/input/\_platform.py 77.8%
src/milo/input/\_reader.py 96.2%
src/milo/input/\_sequences.py 100.0%
src/milo/live.py 0.0%
src/milo/llms.py 78.6%
src/milo/mcp.py 84.4%
src/milo/middleware.py 100.0%
src/milo/observability.py 100.0%
src/milo/output.py 77.8%
src/milo/pipeline.py 90.1%
src/milo/plugins.py 100.0%
src/milo/reducers.py 100.0%
src/milo/registry.py 89.1%
src/milo/schema.py 93.2%
src/milo/state.py 91.1%
src/milo/streaming.py 100.0%
src/milo/templates/\_\_init\_\_.py 100.0%
src/milo/testing/\_\_init\_\_.py 100.0%
src/milo/testing/\_mcp.py 100.0%
src/milo/testing/\_record.py 86.7%
src/milo/testing/\_replay.py 87.1%
src/milo/testing/\_snapshot.py 100.0%
src/milo/theme.py 100.0%
src/milo/verify.py 84.8%
src/milo/version\_check.py 60.6%

test_race_inside_all and test_take_inside_all use the default Store
executor sizing (IO_BOUND -> 4 workers under CI=true, even fewer on
3-core macOS GitHub-hosted runners). Their nested All/Race/Take
compositions starved the pool, causing 120s pytest-timeout and missed
Take dispatches.

Mirror the existing precedent at test_all_inside_race (line 1373):
explicit max_workers=8 with a comment documenting the nested-effect
starvation case.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@lbliii lbliii merged commit fe29ed7 into main Apr 21, 2026
7 checks passed
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