Skip to content

Make execution boundaries explicit and fully typed - #2102

Merged
morluto merged 5 commits into
mainfrom
codex/resolve-2075-2078-2080
Aug 20, 2026
Merged

Make execution boundaries explicit and fully typed#2102
morluto merged 5 commits into
mainfrom
codex/resolve-2075-2078-2080

Conversation

@morluto

@morluto morluto commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Fixes #2075.
Fixes #2078.
Fixes #2080.

Problem

Three execution boundaries were weaker than their contracts implied:

  • provider tests kept executable spike programs under passive fixtures, read pin files during collection, and accepted variadic runners that did not prove the exact subprocess request;
  • graph optimization started wall-clock accounting after preprocessing or synchronous seed heuristics, so those operations could exceed their advertised budget before entering the bounded solver;
  • the code theory, graph spectral, Markov chain, and recurrence native APIs used raw wire-shaped values behind no-untyped-def and no-untyped-call suppressions.

Solution

  • Move provider programs to benchmarks/tooling/providers, leave only passive fixture data under tests/fixtures/providers, and require an explicit working directory at the executable boundary.
  • Pass one complete ToolCommandRequest through provider runners. The process tests now compare executable, arguments, environment, working directory, timeout, stdin, and output limits, and reject reordered, extra, or unconsumed calls.
  • Start one monotonic deadline before graph construction and carry it through incumbent construction and every threshold search. Replace the synchronous NetworkX seed heuristics with deterministic constant- or linear-work valid incumbents.
  • Give all four native math owners explicit parameter and result types, validate inputs through their domain models, and remove the targeted mypy suppressions.

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-process

Public 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 check passes
  • Explicitly relevant specialist validation is listed above
  • Harbor task or verifier changes ran make harbor-prepare-task then make harbor-validate-task (not applicable)
  • Public operation changes include an owner-local admission decision (not applicable)
  • Result semantics distinguish exact, approximate, incomplete, unknown, and unavailable outcomes where applicable
  • New shared abstractions replace duplication in at least two surviving production paths (the exact provider request runner covers all five provider spikes)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread benchmarks/tooling/providers/cddlib.py Outdated
@morluto
morluto merged commit e6205bf into main Aug 20, 2026
25 checks passed
@morluto
morluto deleted the codex/resolve-2075-2078-2080 branch August 20, 2026 11:30

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +127 to +129
def stationary_distribution_extremes(
request: StationaryDistributionRequest,
) -> list[tuple[tuple[int, ...], tuple[Fraction, ...]]]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant