Skip to content
Merged

090 #179

Show file tree
Hide file tree
Changes from 80 commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
105a6fe
feat: start 0.9.0 Spark and MLflow initiative with runtime tests
flyingriverhorse Sep 21, 2026
b9eef16
feat(core): define execution contracts and explicit node capabilities
flyingriverhorse Sep 21, 2026
f8a353a
feat(core): add optional Spark engine and distributed conversion guards
flyingriverhorse Sep 21, 2026
2d8cd8e
documents
flyingriverhorse Sep 21, 2026
44b5241
feat(core): add keyed Spark feature execution and capability preflight
flyingriverhorse Sep 21, 2026
81216e1
feat(core): add versioned bounded portable preprocessing state
flyingriverhorse Sep 21, 2026
992d13b
feat(core): add native Spark mean and constant imputation
flyingriverhorse Sep 21, 2026
802f60d
feat(core): add native Spark StandardScaler fit and apply
flyingriverhorse Sep 21, 2026
7099733
feat(core): add portable feature pipeline export and restore
flyingriverhorse Sep 21, 2026
81745a7
feat(core): add validated standalone inference bundles
flyingriverhorse Sep 21, 2026
74ceacb
feat(core): add native Spark batch model inference
flyingriverhorse Sep 21, 2026
a910e08
docs: explain inference paths with diagrams
flyingriverhorse Sep 21, 2026
0070813
docs: record Spark inference session handoff
flyingriverhorse Sep 21, 2026
df63d23
feat(core): add worker Python pipeline inference
flyingriverhorse Sep 22, 2026
add50eb
docs: mark SM-10 worker inference available
flyingriverhorse Sep 22, 2026
a930f8a
docs: refresh Spark inference handoff
flyingriverhorse Sep 22, 2026
04dbe30
feat(core): add distributed classification inference
flyingriverhorse Sep 22, 2026
cef9d50
docs: refresh SM-11 Spark handoff
flyingriverhorse Sep 22, 2026
7cdd622
fix(core): harden Spark classification contract
flyingriverhorse Sep 22, 2026
80dc9ee
docs: close SM-11 validation gate
flyingriverhorse Sep 22, 2026
ee2eddc
docs: refresh SM-12 handoff pointer
flyingriverhorse Sep 22, 2026
f8f188c
feat(core): add optional MLflow tracking
flyingriverhorse Sep 22, 2026
6731525
docs: close SM-12 handoff
flyingriverhorse Sep 22, 2026
be058e7
feat(core): add MLflow pyfunc packaging
flyingriverhorse Sep 22, 2026
4a613cb
feat(core): add MLflow registry adapter
flyingriverhorse Sep 22, 2026
d43e74c
feat(core): add guarded monthly Spark Delta batches
flyingriverhorse Sep 22, 2026
09f3f11
feat(core): load pinned registry bundles for Spark validation
flyingriverhorse Sep 22, 2026
311547f
feat(core): coordinate Delta publishers and support serverless identi…
flyingriverhorse Sep 22, 2026
63dd3e2
fix(core): validate serverless Delta publication and permissions
flyingriverhorse Sep 22, 2026
bd8689b
docs: plan local-first Databricks Bundle rollout
flyingriverhorse Sep 23, 2026
903c8c9
feat(core): package fitted local pipelines with MLflow
flyingriverhorse Sep 23, 2026
1575525
feat: validate local Databricks workflows and MLflow inference
flyingriverhorse Sep 23, 2026
5e1d541
feat: publish bounded local predictions to UC Delta
flyingriverhorse Sep 23, 2026
b597fdd
feat: score new Delta records automatically with local models
flyingriverhorse Sep 23, 2026
fc23941
test: validate Skyulf incremental scoring on real taxi data
flyingriverhorse Sep 23, 2026
2fbafc5
refactor: use generic prediction metadata columns
flyingriverhorse Sep 23, 2026
326e1e3
feat: compare pinned MLflow candidate and champion models
flyingriverhorse Sep 23, 2026
23182d4
refactor: reuse core metrics for local MLflow evaluation
flyingriverhorse Sep 23, 2026
68d90c0
test: validate held-out metrics on Databricks
flyingriverhorse Sep 23, 2026
6673858
chore: remove unnecessary future annotations import
flyingriverhorse Sep 23, 2026
8452ebd
refactor: show direct SkyulfPipeline fit in Databricks example
flyingriverhorse Sep 23, 2026
ea68efb
feat: guard MLflow champion promotion and rollback
flyingriverhorse Sep 23, 2026
f42cbf7
feat(mlflow): add challenger and previous champion aliases
flyingriverhorse Sep 23, 2026
5c922c0
feat: add label-aware local candidate retraining
flyingriverhorse Sep 24, 2026
749894a
feat: add local-engine Databricks bundle template
flyingriverhorse Sep 24, 2026
b4e6cae
feat: add company-target local bundle variant
flyingriverhorse Sep 24, 2026
6010a49
feat: reset Skyulf tests and validate generic local bundle
flyingriverhorse Sep 24, 2026
b2403c0
feat: simplify local Databricks bundle to two jobs
flyingriverhorse Sep 24, 2026
2251769
refactor: move Databricks bundle template into core
flyingriverhorse Sep 24, 2026
312205f
feat: select prediction row key during bundle init
flyingriverhorse Sep 24, 2026
277e98e
feat: add optional monthly local retraining schedule
flyingriverhorse Sep 24, 2026
d12d6aa
feat: select model-change scoring and configure train schedule
flyingriverhorse Sep 24, 2026
68f6493
feat: gate automatic champion selection before scoring
flyingriverhorse Sep 24, 2026
556b63f
docs: plan isolated champion and rescore rehearsal
flyingriverhorse Sep 24, 2026
7c3a086
docs: record live champion and rescore validation
flyingriverhorse Sep 24, 2026
fcfcee3
feat: retain challengers and extract reusable bundle workflows
flyingriverhorse Sep 24, 2026
94b2832
feat: add evidence-based manual approval and relocate core tests
flyingriverhorse Sep 24, 2026
6a7f9e9
feat: add explicit candidate rejection and repeatable rollback
flyingriverhorse Sep 25, 2026
5ba388e
feat: complete bundle lifecycle controls and readable operator reports
flyingriverhorse Sep 25, 2026
0c0fd17
feat: validate bundle configuration and support per-run scoring versions
flyingriverhorse Sep 25, 2026
fa7a117
refactor: use direct record and result column names
flyingriverhorse Sep 25, 2026
7cec33a
feat: validate training dates before source filtering
flyingriverhorse Sep 25, 2026
fe3897c
feat: support date-free bundle training and input budgets
flyingriverhorse Sep 25, 2026
516b3f8
feat: add guided bundle setup and verified local training CV
flyingriverhorse Sep 26, 2026
8a88b2b
feat: simplify bundle setup and package Python preprocessing
flyingriverhorse Sep 26, 2026
522c6e8
fix: guard temporal features and plan pre-split cleanup
flyingriverhorse Sep 26, 2026
55b31ca
feat: add pre-split cleanup and plan complete node integration
flyingriverhorse Sep 26, 2026
d5d2398
feat: verify saved pre-split recipes across local and Databricks work…
flyingriverhorse Sep 26, 2026
676fedd
feat: add independent Databricks schedules and preserve training evid…
flyingriverhorse Sep 26, 2026
3e92d14
feat: expose Databricks lifecycle phases in the Bundle graph
flyingriverhorse Sep 26, 2026
bd49f49
feat: simplify and validate the Databricks lifecycle graph
flyingriverhorse Sep 26, 2026
daa1e1c
fix: render first-candidate Databricks reports without a champion
flyingriverhorse Sep 26, 2026
454d2da
gitignore
flyingriverhorse Sep 26, 2026
e16b27e
refactor: share Databricks training evidence and simplify lifecycle v…
flyingriverhorse Sep 27, 2026
f4d654c
perf: avoid redundant Databricks lifecycle replay
flyingriverhorse Sep 27, 2026
d8e4949
refactor: simplify Databricks setup and generated project examples
flyingriverhorse Sep 27, 2026
d959676
refactor: make Databricks scoring notebook entrypoint explicit
flyingriverhorse Sep 27, 2026
5c9798b
fix(databricks): restore custom registrations across lifecycle tasks
flyingriverhorse Sep 27, 2026
b67594b
feat: add multi-metric quality gates to model lifecycle
flyingriverhorse Sep 27, 2026
ac7ff69
feat: complete Databricks model search and true nested tuning
flyingriverhorse Sep 27, 2026
4f7999a
refactor: simplify lifecycle code and repair CI analysis gates
flyingriverhorse Sep 27, 2026
9aa17f3
docs: remove obsolete TOON guidance from agent instructions
flyingriverhorse Sep 27, 2026
79ff49f
add necessary improvement for pre commit and agent.md
flyingriverhorse Sep 27, 2026
0cc5154
test: align missing sort column expectations with temporal guards
flyingriverhorse Sep 27, 2026
4992ab3
ci: reuse coverage reports and streamline workflow checks
flyingriverhorse Sep 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
* text=auto
.gitattributes text eol=lf
# Use LF for code and docs across platforms
*.py text eol=lf
*.sh text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.json text eol=lf
*.tmpl text eol=lf
*.html text eol=lf
*.css text eol=lf
*.js text eol=lf
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/spark-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Spark Runtime Tests

on:
pull_request:
branches: [main, master]
paths:
- "skyulf-core/**"
- "requirements-spark.txt"
- "requirements-delta.txt"
- ".github/workflows/spark-tests.yml"
workflow_dispatch:

permissions:
contents: read

jobs:
spark:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
SKYULF_REQUIRE_SPARK: "1"
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
- name: Install optional Spark test dependencies
run: uv pip install --system -r requirements-spark.txt
- name: Exercise Spark JVM and Python workers
run: python -m pytest skyulf-core/tests/spark -q -o addopts=

delta:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
SKYULF_REQUIRE_DELTA: "1"
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
- name: Install optional Delta test dependencies
run: uv pip install --system -r requirements-delta.txt
- name: Exercise real Delta transactions and publish admission
run: >-
python -m pytest
skyulf-core/tests/integrations/test_batch_contract.py
skyulf-core/tests/integrations/test_batch_admission.py
skyulf-core/tests/integrations/test_delta_publish.py -q -o addopts=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ site/
.github/instructions/codacy.instructions.md

.worktrees/
.venv-spark/
sast/architecture.md
sast/final-report.md
sast/hardcodedsecrets-results.md
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Each major/minor series has its own file in the [`changelog/`](changelog/) folde

| Series | File | Status | Description |
|--------|------|--------|-------------|
| **0.9.x** | [changelog/0.9.x.md](changelog/0.9.x.md) | Unreleased | Spark execution and optional MLflow integration — in development |
| **0.8.x** | [changelog/0.8.x.md](changelog/0.8.x.md) | Active | (v0.8.0+) |
| **0.7.x** | [changelog/0.7.x.md](changelog/0.7.x.md) | Stable | Model Explainability, Segmentation Models & Unified Training Pipeline (v0.7.0 — v0.7.9) |
| **0.6.x** | [changelog/0.6.x.md](changelog/0.6.x.md) | Stable | Ensemble Models, Security Hardening & Codebase Audit Sweeps (v0.6.0 — v0.6.10) |
Expand Down
11 changes: 11 additions & 0 deletions backend/ml_pipeline/_execution/_leakage_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
leakage_exemption_reason,
step_learns_from_data,
train_test_splitters,
validate_temporal_target,
)

from .schemas import NodeConfig
Expand Down Expand Up @@ -346,6 +347,9 @@ def validate_no_preprocessing_before_split(
instead of silence — the leakage guarantee simply does not apply there —
unless ``on_leakage="ignore"``.

Rolling the known current target is an invalid feature definition and
always raises, independently of the leakage warning mode or split position.

Returns the gate verdict so the engine can persist it on the job record
(Job Details shows it as factual per-job information):
``{"status": "passed" | "no_split" | "warnings", "messages": [...],
Expand Down Expand Up @@ -377,6 +381,13 @@ def validate_no_preprocessing_before_split(
execution_splitters = splitter_ids & execution_ids
execution_nodes = [n for n in nodes if n.node_id in execution_ids]
data_dependent = data_dependent_step_types()
for node in execution_nodes:
if node.step_type == "RollingAggregate":
validate_temporal_target(
node.step_type,
node.params,
target_column=_target_column_for_node(execution_nodes, node.node_id),
)

checked, exempted, messages = _inspect_pre_split_nodes(
nodes,
Expand Down
23 changes: 18 additions & 5 deletions backend/ml_pipeline/_execution/engine/_node_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ def _build_fixed_run_params(self, node: NodeConfig, calculator: Any) -> dict[str
"n_trials": 1,
"cv_enabled": node.params.get("cv_enabled", False),
"cv_folds": node.params.get("cv_folds", 5),
"cv_inner_folds": node.params.get("cv_inner_folds"),
"cv_type": node.params.get("cv_type", "k_fold"),
"cv_shuffle": node.params.get("cv_shuffle", True),
"cv_random_state": node.params.get("cv_random_state", DEFAULT_RANDOM_STATE),
Expand Down Expand Up @@ -871,6 +872,8 @@ def _extract_tuning_metrics(
or tuning_params.get("tuning_config", {}).get("metric")
or tuning_params.get("metric"),
}
if getattr(tuning_result, "nested_cv", None) is not None:
metrics["nested_cv"] = tuning_result.nested_cv
# F-13: surface the tuned decision thresholds (string keys so the
# job metrics stay JSON-serializable regardless of label dtype).
thresholds = getattr(tuning_result, "decision_thresholds", None)
Expand All @@ -896,9 +899,8 @@ def _run_tuned_cv(
) -> dict[str, Any]:
"""Run post-tuning cross-validation with the tuned model's best params.

For ``nested_cv``, the inner CV loop already ran during the search, so
post-tuning CV only needs the outer evaluation and downgrades to
``stratified_k_fold`` (classification) or ``k_fold`` (regression).
New nested searches already contain independent outer-fold scores.
Older artifacts retain the historical fixed-model diagnostic fallback.

``fold_preprocessing`` (F-15): ``(adapter, (X_pre, y_pre),
validation_payload)`` — CV must slice the pre-transform rows so the
Expand All @@ -909,6 +911,9 @@ def _run_tuned_cv(
"""
if not tuning_params.get("cv_enabled", False):
return {}
nested = getattr(tuning_result, "nested_cv", None)
if nested is not None:
return self._aggregate_cv_metrics(nested)
best_params: dict[str, Any] = tuning_result.best_params if tuning_result else {}
cv_estimator = StatefulEstimator(calculator, applier, node.node_id)

Expand All @@ -917,8 +922,8 @@ def _run_tuned_cv(
is_classification = getattr(calculator, "problem_type", "") == "classification"
post_cv_type = "stratified_k_fold" if is_classification else "k_fold"
self.log(
"Nested CV inner loop already ran during tuning. "
f"Using {post_cv_type} for post-tuning evaluation."
"Legacy result has no nested search evidence; "
f"using {post_cv_type} for fixed-model diagnostics only."
)

preprocessing = None
Expand Down Expand Up @@ -1011,6 +1016,14 @@ def _run_training_tuned(
# Unsupported learned graphs fail closed. Explicit warn/ignore mode
# permits fallback, recorded by the stable reason code in the metrics.
fold_preprocessing, refit_fallback = self._resolve_fold_preprocessing(node, target_col)
if (
tuning_params.get("cv_enabled", False)
and tuning_params.get("cv_type") == "nested_cv"
and refit_fallback is not None
):
raise ValueError(
f"Nested CV requires fold-local preprocessing; cannot use {refit_fallback}."
)

# Audit telemetry (findings 2026-08-26 §3/B): record the input row
# count of every per-fold fit/transform so the run can be audited
Expand Down
2 changes: 2 additions & 0 deletions backend/ml_pipeline/_internal/_numeric_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def _training(params: dict[str, Any], *, tuned: bool = False) -> None:
_finite_candidates(params.get("search_space"))
if params.get("cv_enabled", tuned):
_number(params, "cv_folds", 2, integer=True)
if params.get("cv_type") == "nested_cv" and params.get("cv_inner_folds") is not None:
_number(params, "cv_inner_folds", 2, integer=True)
for seed in ("random_state", "cv_random_state"):
if params.get(seed) is not None:
_number(params, seed, 0, 4294967295, integer=True)
Expand Down
Loading
Loading