The classification pipeline - #6
Open
roed-math wants to merge 1 commit into
Open
Conversation
Closed
roed-math
force-pushed
the
split/04-matchers
branch
from
August 8, 2026 16:12
7082747 to
9b81d40
Compare
roed-math
force-pushed
the
split/05-classify
branch
from
August 8, 2026 16:12
bb8a7b4 to
ebd9750
Compare
roed-math
force-pushed
the
split/04-matchers
branch
from
August 9, 2026 02:43
9b81d40 to
7ebfa9d
Compare
roed-math
force-pushed
the
split/05-classify
branch
from
August 9, 2026 02:43
ebd9750 to
ee06c19
Compare
roed-math
force-pushed
the
split/04-matchers
branch
from
August 9, 2026 05:01
7ebfa9d to
006dca5
Compare
roed-math
force-pushed
the
split/05-classify
branch
from
August 9, 2026 05:01
ee06c19 to
041cd3e
Compare
roed-math
force-pushed
the
split/04-matchers
branch
from
August 9, 2026 05:21
006dca5 to
51c029f
Compare
roed-math
force-pushed
the
split/05-classify
branch
from
August 9, 2026 05:21
041cd3e to
174de58
Compare
roed-math
force-pushed
the
split/04-matchers
branch
from
August 9, 2026 08:23
51c029f to
c442b80
Compare
roed-math
force-pushed
the
split/05-classify
branch
from
August 9, 2026 08:23
174de58 to
72efc5a
Compare
The classification pipeline. `classify()` parses, splits reducible equations into components, runs the matchers, and ranks the results by depth in the family DAG, so the most specific family wins. `Classification.explain()` is the human report and `as_dict()` is the JSON contract for the future website backend. **API notes:** - `Classification` separates the problem as submitted (`parsed`) from the model the matchers saw (`model`, read through `working`), with the map between them in `reduction`. Reducing `(x + y)^2 = 0` to `x + y = 0` used to return the factor's classification as if it were the input, losing the original text, the requested domain, the unknown order and the side conditions; all four now survive, and factors of a reducible equation inherit the parent's domain, parameters and checkable conditions instead of falling back to `classify()`'s default argument. - `match_for(slug)` / `data_for(slug)` look up an emitted match, and `code()` fills each family's template from *its own* match. Filling an ancestor's template with the primary match's data produced confident nonsense, because a DAG edge says nothing about whose data meets whose input contract. - `explain()` prints one arrow line per genuine lineage path, and `as_dict()` carries `lineage_paths`/`lineage_graph`, the structured `conditions`, and the `transform` — composed from the very objects the solvers use. `tests/test_classify.py` starts the classification corpus (famous equation to expected family); each family PR adds its own rows. Part of the series that splits #1 into reviewable pieces: 1. `01-bibliography` — packaging, docs, annotated bibliography 2. `02-parsing` — equation strings to a term model 3. `03-registry` — the YAML family registry (3 seed families) 4. `04-matchers` — shape recognizers 5. `05-classify` — the classification pipeline 6. `06-solvers` — solver framework, two seed solvers, and the CLI 7. `07..09-backbone` — the 23 parent families of the DAG, by depth 8. one PR per remaining family (38 of them, mutually independent) 9. `99-polish` — restore the full doctests and tighten the invariants
roed-math
force-pushed
the
split/04-matchers
branch
from
August 9, 2026 20:35
c442b80 to
b6219b9
Compare
roed-math
force-pushed
the
split/05-classify
branch
from
August 9, 2026 20:35
72efc5a to
b90e5d6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The classification pipeline.
classify()parses, splits reducible equations into components, runs thematchers, and ranks the results by depth in the family DAG, so the most
specific family wins.
Classification.explain()is the human report andas_dict()is the JSON contract for the future website backend.API notes:
Classificationseparates the problem as submitted (parsed) from the modelthe matchers saw (
model, read throughworking), with the map between themin
reduction. Reducing(x + y)^2 = 0tox + y = 0used to return thefactor's classification as if it were the input, losing the original text,
the requested domain, the unknown order and the side conditions; all four now
survive, and factors of a reducible equation inherit the parent's domain,
parameters and checkable conditions instead of falling back to
classify()'sdefault argument.
match_for(slug)/data_for(slug)look up an emitted match, andcode()fills each family's template from its own match. Filling an ancestor's
template with the primary match's data produced confident nonsense, because a
DAG edge says nothing about whose data meets whose input contract.
explain()prints one arrow line per genuine lineage path, andas_dict()carries
lineage_paths/lineage_graph, the structuredconditions, and thetransform— composed from the very objects the solvers use.tests/test_classify.pystarts the classification corpus (famous equation toexpected family); each family PR adds its own rows.
Part of the series that splits #1 into reviewable pieces:
01-bibliography— packaging, docs, annotated bibliography02-parsing— equation strings to a term model03-registry— the YAML family registry (3 seed families)04-matchers— shape recognizers05-classify— the classification pipeline06-solvers— solver framework, two seed solvers, and the CLI07..09-backbone— the 23 parent families of the DAG, by depth99-polish— restore the full doctests and tighten the invariants