Skip to content

feat(core): make Definition symbolic and separate generation policy - #55

Merged
krafczyk merged 12 commits into
mainfrom
symbolic-definitions-2
Oct 2, 2026
Merged

krafczyk merged 12 commits into
mainfrom
symbolic-definitions-2

Conversation

@krafczyk

@krafczyk krafczyk commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Make Definition the sole runtime symbolic construction value with immutable discovery, binding, remapping, and selector projection.
  • Make Template a non-materializing receiving role; keep Mat[Definition], Ref[Definition], and explicit QuotedDef boundaries distinct and preserve effect-free admission.
  • Replace runtime Template generation with Generator and exact GeneratorSelector, preserving compatible portable selector bytes while retiring beta Template carriers without aliases. Migrate Experiment artifact mappings, metrics, transport, docs, and fixtures.
  • Integrate GeneratorSelector with reference-aware containment, retaining graph-distinct proof and source evidence across fixed results, caps, and set operations.

This PR contains only the symbolic/integration commits after merged PRs #53 and #54. The original local symbolic-definitions branch remains an untouched sentinel.

Verification

  • Rebased onto current main without conflict.
  • Focused symbolic, roles, Generator, query, result, and import checks: 166 passed.
  • Real-notebook and exact-dispatch worker checks: 2 passed. Prior integrated good-enough run passed; CI checks this exact PR head.

Post-Deploy Monitoring & Validation

  • In notebooks and persisted Stores, validate Definition.sub(...), Template-role quotation, Generator.support_selector() and exact reference-aware nested queries. Healthy: no unwanted Object construction or source imports during symbolic authoring, and no false-empty/falsely materializable query results. Investigate malformed quotation, changed selector bytes, or lost Store replica provenance; revert the PR if authoritative result identity is affected.

Move symbolic discovery, substitution, remapping, and loose projection onto Definition while preserving graph topology and quotation boundaries. Reject distributions in Definition-owned structure, adopt the parameterization error hierarchy, and author metric recipes as class-rooted Fold definitions.\n\nVerified with the focused symbolic, immutable graph, metrics, and public import tests (124 passed).
Make Template an annotation-only Definition role, enforce distinct Mat and Ref admission, and preflight symbolic materialization before cache or repository effects. Persist role-carried Definitions through bounded QuotedDef expression data and support canonical flat Template mappings.\n\nVerified with focused signature, quotation, materialization, and metric tests (140 passed).
Introduce Definition-based Generator and GeneratorSelector while preserving portable selector bytes and exact support behavior. Retire runtime Template carriers and bundles, migrate Experiment artifact mappings, and remove obsolete codecs, fixtures, exports, and consumers.\n\nVerified with the focused generation, query, persistence, Experiment, transport, and import gates (159 passed).
Document Definition-native parameterization, Mat/Ref/Template receiving roles, Generator policy, quoted persistence, and Experiment artifact mappings. Record the intentional beta API removals and synchronize affected public docstrings and format guidance.\n\nVerified with symbolic API, persistence, public import, and documentation tests (45 passed).
Reuse shared encoding and graph-building helpers, centralize role edge selection, avoid no-op generator projection rebuilds, and remove dead imports. Preserve settled symbolic Definition and role semantics.\n\nVerified with compileall and focused symbolic, generator, metrics, and signature tests (73 and 61 passed).
Harden quotation codecs, role-aware generator matching, metric recipe binding, and symbolic rewrite validation found during review.

Restore representative profile coverage and add regressions for malformed data, pre-effect rejection, topology, hashing, and fork-safe graph traversal. Verified with focused affected tests and the good-enough suite.
Convert unresolved semantic-parameter lookup failures to AttributeError when accessed through Definition.__getattr__, while retaining the direct parameters TypeError.

This keeps Python 3.10 and 3.11 runtime Protocol checks from failing during Definition thaw. Verified with the failing categorical test and a direct hasattr regression.
Encode symbolic Definition values explicitly across core worker calls so materializing arguments no longer degrade through the Mapping interface. Preserve frozen call spelling and reject malformed nodes before symbol resolution.

Make incomplete Dispatch coverage warnings actionable with bounded diagnostic categories and document the core failure boundary.

Verified with focused Dispatch tests, 184 core Execute tests, the exact ArrayDataset reproduction, and the good-enough representative suite.
Give bare Definitions at Ref[AutoRef] boundaries an actionable Ref(...) diagnostic while preserving explicitly asserted Definitions through core worker transport.

Extend symbolic and subprocess regressions and document the CachedDataset source contract. Refs #48.
Move fixed-result selector coverage to the Definition-based Generator API and prove that Template-role symbolic recipes remain opaque quotation data in both containment entries. Clarify the deterministic-empty scan exception and retain one representative regression.\n\nVerification: focused query, result, Generator, symbolic-role, package, and Experiment tests passed.
Preserve private topology and source evidence across direct/raw projections, fixed requeries, and compatible result-set operations while keeping structural public deduplication. Merge capped replica evidence from primed roots without draining later paths or double-charging exact Generator budgets.\n\nVerification: 211 focused query/federation/generator/result tests passed; targeted lint passed.
Keep exact-selection tests on the same checkout as their coordinator without weakening worker identity validation. Make the notebook worker exercise this source tree and update the warning-message fixture to reflect the policy-owned report category after rebasing Symbolic 2 onto the notebook dispatch fixes.

Verified with focused Dispatch, Execute, and symbolic tests plus the good-enough representative suite.
@krafczyk

krafczyk commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

CI residual: the PR-triggered run 37035835912 passed, including macOS good-enough, notebook dispatch, and the platform matrix. The duplicate push run 37035789352 failed twice in the unchanged tests/core/test_execute_integration.py::test_real_subprocess_core_publishes_results_refreshes_nested_updates_and_keeps_control_store_separate with CleanupError: cleanup reconciliation remains incomplete. The same macOS cleanup failure occurred while landing #53, before this symbolic change. This is not claimed fixed here; investigate the intermittent Execute cleanup separately. The PR-triggered run is the successful merge validation, not a claim that every duplicate CI run passed.

@krafczyk
krafczyk merged commit 29a11c3 into main Oct 2, 2026
41 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant