core/generate/contemplation
Shay 57156857bd
Some checks failed
full-pytest / full pytest (-m "not quarantine" -n 2) (push) Waiting to run
lane-shas / verify pinned lane SHAs (push) Failing after 5m48s
workbench-ui / build + vitest (push) Failing after 13s
workbench-ui / playwright smoke (push) Failing after 7s
chore(kernel): tighten construction_affordances catalog invariants (#930)
* chore(kernel): tighten construction_affordances catalog invariants

- Delete stale make_proposal (deferred from PR #919; no live callers remain)
- Derive _PROPOSAL_FIRST_FAMILIES from _CATALOG keys to eliminate hidden
  sync obligation (was a manual restatement of all four catalog entries)
- Introduce _SERVING_AUTHORIZED_FAMILIES frozenset so the serving-allowed
  exemption in ConstructionFamily and ConstructionProposal __post_init__
  consults one central authority instead of two string-literal comparisons
- Pre-compute _SORTED_FAMILIES at module load so all_diagnostic_families()
  returns a constant rather than re-sorting on every call
- Remove _VALID_STATUS ClassVar from ConstructionProposal; the field is
  already typed Literal["proposed"] and the indirection adds no safety

No behavior change to serving, assessment, or proposal creation paths.
ADR-0236: small load-bearing PR, single-file, invariants as code.

* refactor(contemplation): unify organ pipelines in pass_manager

- Introduce OrganPipeline descriptor (organ, reader, solver, reason_adapter)
  so every routed solve path shares one _solve_and_verify implementation.
  Adding a new organ is now a single OrganPipeline(...) declaration.

- Extract _maybe_ask helper that collapses the triply-duplicated
  family_by_name / assess_from_family / exercise_ask inline block.

- Add _result() helper that appends the terminal Finding and constructs
  ContemplationResult in one call, enforcing terminal-is-last-finding
  by construction across every return site.

- Replace assert not isinstance(problem, Refusal) with
  InternalContemplationError so the routing invariant is enforceable
  under python -O and surfaces a named, debuggable exception.

No behavior change: all Terminal states, Finding sequences, family
resolution, CMB-over-R3 precedence, boundary-first ordering, and
ask/proposal emission logic are preserved exactly.
2026-07-06 08:38:23 -07:00
..
__init__.py feat(contemplation): contemplation v0 pass manager (N6) + boundary-first growth fix 2026-06-07 08:59:47 -07:00
findings.py feat(epistemic): Q1-D — off-serving ASK delivery (QUESTION_NEEDED tenant) 2026-06-08 19:10:54 -07:00
pass_manager.py chore(kernel): tighten construction_affordances catalog invariants (#930) 2026-07-06 08:38:23 -07:00