Skip to content

Make public mathematical contracts canonical and composable - #2185

Merged
morluto merged 13 commits into
mainfrom
codex/public-math-contracts
Aug 20, 2026
Merged

Make public mathematical contracts canonical and composable#2185
morluto merged 13 commits into
mainfrom
codex/public-math-contracts

Conversation

@morluto

@morluto morluto commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Problem

Public mathematical operations accepted loosely related strings, axes, parents,
and derived structures that did not establish the domains required by their
implementations. Several results also discarded units, multiplicities,
generators, quotient maps, or other data needed for reconstruction and
composition.

Advances #2174.

Closes #2122.
Closes #2125.
Closes #2126.
Closes #2127.
Closes #2128.
Closes #2131.
Closes #2133.
Closes #2134.
Closes #2135.
Closes #2136.
Closes #2137.
Closes #2141.
Closes #2145.
Closes #2146.
Closes #2147.
Closes #2148.
Closes #2149.
Closes #2151.
Closes #2152.
Closes #2153.
Closes #2154.
Closes #2156.
Closes #2157.
Closes #2158.
Closes #2159.

Solution

Replace expression-shaped polynomial and rational inputs with canonical exact
values carrying their ordered domains. Enforce parent, axis, dimension,
degeneracy, and work constraints in operation request models before backend
execution. Return composable certificates for finite-field factorizations,
Galois groups, Newton forms, quotient algebras, projective coordinates, and
authoritative finite-field derivations.

The established mathematical kernels remain delegated to SymPy and FLINT. This
PR changes Jacobian's public contracts and conversions around them.

Testing

  • make check — 1,986 tests passed; Ruff, formatting, complexity, and mypy passed.
  • Specialist validation run (if any): none for this branch.

Public contract impact

Breaking pre-stable request and result schema changes across affected operations.
Canonical polynomial, rational-function, finite-field, universal-algebra, and
derived certificate values replace expression strings and incomplete result
shapes. Operation versions and invocation examples are updated with their
contracts; no new operation IDs are introduced.

Public operation admission

  • Concrete gap: existing operations accepted values outside their mathematical or backend domains and returned values that were not reliably composable.
  • Why existing operations or typed values are insufficient: the old string and field-bag representations did not carry complete parent, axis, or reconstruction information.
  • Stable mathematical result: exact canonical values and complete bounded certificates for the existing operations.
  • Admission decision: retain the existing owner-local KEEP decisions with corrected pre-stable contracts.

Closure matrix

Candidate Outcome Operation ID or follow-up issue
Canonical exact inputs delivered Existing affected operation IDs
Complete Galois certificates delivered polynomial.galois.*
Authentic finite-field derivations delivered finite_field.*
Closed universal-algebra terms and quotients delivered universal_algebra.*

Checklist

  • make check passes
  • Explicitly relevant specialist validation is listed above
  • Harbor task or verifier changes are not applicable
  • Public operation changes retain owner-local admission decisions
  • Result semantics distinguish exact and unavailable outcomes where applicable
  • Shared canonical values serve multiple production domains

@morluto

morluto commented Aug 20, 2026

Copy link
Copy Markdown
Owner Author

@codex

@morluto
morluto requested a review from N0zoM1z0 as a code owner August 20, 2026 21:14

@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: ef738779bc

ℹ️ 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 src/jacobian/math/matrices/symbolic/_models.py
Comment thread src/jacobian/math/finite_stochastic_processes/operations.py
Comment thread src/jacobian/math/polynomial_interpolation_ops/_operations.py
Comment thread src/jacobian/math/galois_theory/_models.py

@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: c4f4c7478e

ℹ️ 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 src/jacobian/math/polynomials/maps/_models.py
Comment thread src/jacobian/math/polynomial_vector_calc/_models.py
Comment thread src/jacobian/math/finite_game_theory/_models.py

@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: a08ec9229a

ℹ️ 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 src/jacobian/_models.py
Comment thread src/jacobian/math/graphical_models/_tools.py

@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: fa982b4a12

ℹ️ 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 src/jacobian/math/projective_coords_ops/_operations.py
Comment thread src/jacobian/math/matrices/symbolic/_models.py Outdated
@morluto
morluto merged commit 4c7b265 into main Aug 20, 2026
25 checks passed
@morluto
morluto deleted the codex/public-math-contracts branch August 20, 2026 22:07

@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: 57437ac0f8

ℹ️ 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 +171 to +173
if any(
not 0 <= value < len(self.algebra.carrier) for value in self.quotient_map
):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject non-surjective quotient maps

A QuotientResult whose quotient algebra has two carrier classes still accepts quotient_map=(0, 0), because this validator checks only that values are in range. Such a map never reaches class 1 and therefore cannot be the canonical projection onto the advertised quotient, so wire validation can admit a false composable quotient certificate. Require the map's image to equal the complete quotient carrier.

AGENTS.md reference: AGENTS.md:L103-L114

Useful? React with 👍 / 👎.

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