Make execution boundaries explicit and fully typed - #2102
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96aa343d5e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3347ba49db
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| def stationary_distribution_extremes( | ||
| request: StationaryDistributionRequest, | ||
| ) -> list[tuple[tuple[int, ...], tuple[Fraction, ...]]]: |
There was a problem hiding this comment.
Accept a domain value in the native Markov API
For native Python callers, the newly typed stationary_distribution_extremes, stationary_distribution, and ergodic_properties APIs now require Pydantic request envelopes, coupling mathematical composition to the wire contract instead of accepting an exact transition-matrix domain value and calling the kernel directly. Introduce a domain-owned transition-matrix value for these public helpers and keep StationaryDistributionRequest/TransitionMatrixRequest conversion in the operation adapters.
AGENTS.md reference: AGENTS.md:L96-L99
Useful? React with 👍 / 👎.
Fixes #2075.
Fixes #2078.
Fixes #2080.
Problem
Three execution boundaries were weaker than their contracts implied:
no-untyped-defandno-untyped-callsuppressions.Solution
benchmarks/tooling/providers, leave only passive fixture data undertests/fixtures/providers, and require an explicit working directory at the executable boundary.ToolCommandRequestthrough provider runners. The process tests now compare executable, arguments, environment, working directory, timeout, stdin, and output limits, and reject reordered, extra, or unconsumed calls.The MCP operation IDs and request/result schemas are unchanged.
Suggested review order: graph deadline propagation and its fake-clock regressions; provider request matching and fixture relocation; typed native math boundaries.
Testing
make check— Ruff, formatting, mypy, and 1,971 tests passed.make test-process— 117 tests passed.Focused provider, graph, code theory, Markov chain, spectral, and recurrence suite — 359 tests passed.
uv run python tools/check_benchmark_static.py— passed.git diff --check— passed.Specialist validation run:
make test-processPublic contract impact
The native Python APIs for code theory, graph spectral operations, Markov chains, and recurrence solving now accept exported typed domain values or validated request models and return typed values. This intentionally replaces their previous raw list/dictionary shapes while Jacobian is pre-stable. MCP operation IDs, wire schemas, and mathematical semantics are unchanged.
Public operation admission
Not applicable; this PR adds no public operations and does not broaden an admitted mathematical contract.
Closure matrix
None; each linked issue has one focused acceptance surface and is fully addressed here.
Checklist
make checkpassesmake harbor-prepare-taskthenmake harbor-validate-task(not applicable)