mixle.task.design_prior module

Persistent what-works prior over structural design families.

DesignModel already ledgers every evaluated design point with an arbitrary tag dict, so a caller can tag each accepted structural recipe with which FAMILY it belongs to (a quotient leaf vs a plain head, a richer factorization vs a simpler one, or capability-conditioned recipes). This module is the thin query layered on that existing ledger: rank the families seen so far by their mean recorded quality, so the NEXT round’s structural-search proposal starts from a sharper prior instead of from scratch – “what has actually worked” persisted across rounds and design searches, not re-derived each time.

record_accepted_recipe(design, point, quality, violations, family=”quotient_leaf”) rank_design_families(design) # [(“quotient_leaf”, 0.91), (“plain_head”, 0.62)] best_family(design) # “quotient_leaf”

An untried candidate family (never recorded) has no evidence and ranks below every family that has been recorded, via an explicit, named default_score – never silently tied with a proven winner.

best_family(design, *, tag_key='family')[source]

The single top-ranked recorded family, or None if nothing has been recorded yet.

Parameters:
  • design (DesignModel)

  • tag_key (str)

Return type:

str | None

rank_design_families(design, *, tag_key='family', candidates=None, default_score=float('-inf'))[source]

Rank every family tag recorded in design by its mean quality, best first.

candidates, if given, are ALSO included in the ranking even if never recorded – an untried family gets default_score (-inf by default: no evidence ranks strictly below any recorded family, however weak, rather than being silently omitted or tied with a proven winner).

Parameters:
Return type:

list[tuple[str, float]]

record_accepted_recipe(design, point, quality, violations, *, family, fingerprint=None, **tag)[source]

Record an accepted structural recipe under its family tag – the training signal for rank_design_families(). A thin, named wrapper over DesignModel.add so callers do not have to remember which tag key the prior reads.

Parameters:
Return type:

None