Skip to content

feat(contracts): add native loss and metric semantics - #21

Draft
GBeurier wants to merge 8 commits into
agent/loss-runtime-integrationfrom
agent/loss-native-contracts
Draft

feat(contracts): add native loss and metric semantics#21
GBeurier wants to merge 8 commits into
agent/loss-runtime-integrationfrom
agent/loss-native-contracts

Conversation

@GBeurier

@GBeurier GBeurier commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • transfer the absent score-provider scope into the native DAG-ML roadmap and record the integrated training/runtime/TCV1 authority from PR feat(runtime): integrate native training handoff #20
  • add backend-neutral LossSpec, MetricSpec, distinct role references, and one generic implementation descriptor with opaque local registry keys
  • add versioned built-in catalogs, compile-time loss resolution, strict schemas/fingerprints, executable-payload rejection, fixtures, and an independent Python oracle
  • add typed metric evaluation task/result contracts, exact provider registry dispatch, decomposition/reduction validation, and a built-in adapter that reuses the existing numerical kernels
  • route native score reports through validated provider results while preserving existing aggregate and per-target values

Independent review

  • ownership amendment 8206fcc: approved with three documentation followups
  • ownership followup 7c83262: approved, no findings
  • semantic contracts fcd1afc: approved with four schema/Rust parity followups
  • parity followup 7e9a363: approved, all prior findings resolved, no findings
  • metric provider f062bb7: approved; one low-severity followup records that the legacy regression scoring API lacks a real classification task-kind input

Validation

  • cargo test --workspace: 787 passed, 2 ignored
  • cargo clippy --workspace --all-targets -- -D warnings: clean
  • python3 -m pytest parity/criteria/tests/test_criteria_contracts.py parity/training/tests/test_training_replay_contracts.py -q: 22 passed
  • python3 scripts/validate_contracts.py: passed
  • python3 scripts/validate_training_replay_contracts.py: passed

Stack

Depends on draft PR #20 (agent/loss-runtime-integration).

Followups

  • controller FIT_CV/REFIT loss transport and execution attestation will be a separate stacked PR
  • binding-local executable registries will follow the controller protocol instead of expanding this contract PR
  • replace the legacy generic regression/classification scoring entry point with a typed task-kind surface before exposing provider injection there

GBeurier added 3 commits July 16, 2026 02:08
…contracts

# Conflicts:
#	crates/dag-ml-py/python/dag_ml/_dag_ml.abi3.so
#	docs/contracts/training_contract_conformance_pack.v1.json
#	docs/contracts/training_replay_contract_conformance_pack.v1.json
#	parity/training/generate_training_replay_fixtures.py
#	parity/training/tests/test_training_replay_contracts.py
#	scripts/validate_training_replay_contracts.py
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