Skip to content

fix(learning): support uploaded D1 tasksets - #334

Open
alliscode wants to merge 2 commits into
build/hub/newfrom
alliscode-audit-decision-runtime
Open

alliscode wants to merge 2 commits into
build/hub/newfrom
alliscode-audit-decision-runtime

Conversation

@alliscode

Copy link
Copy Markdown
Contributor

Why

The customer-operated D1 runtime crashed when Hub started it without a mounted taskset and then uploaded the taskset through the runtime API. That upload-only flow is the documented Hub integration, so a real D1 connector could not complete the same lifecycle as the fixture connector.

What changes

The D1 connector now accepts each validated uploaded taskset when its training job starts. The resulting immutable adapter records the taskset identity and SHA-256 identities for its learning text, so promoted inference rejects requests from another taskset without copying the private learning text into the adapter.

Mounted tasksets and existing mounted-taskset adapters remain compatible. The readiness endpoint also returns the operator-safe backend capability details that the runtime already computes, without exposing model paths, taskset IDs, or candidate IDs.

The Hub decision-runtime client is unchanged and its current request and response contracts still match the runtime. Its local Vitest suite could not be rerun because dependency downloads repeatedly reset from both the configured registry and the Microsoft npm proxy.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@alliscode
alliscode requested review from a team and nshki as code owners November 21, 2026 01:33
Copilot AI adaptive review requested due to automatic review settings November 21, 2026 01:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Key D1 upload-only success and digest-validation cases remain untested, and the README does not explain taskset pinning or older-adapter failures after mount removal.

3 open issues
What changed in this PR

This PR enables Hub’s upload-only taskset flow for customer-operated D1 runtimes while preserving mounted-taskset support.

Changes:

  • Allow D1 startup without a mounted taskset and use each training job’s validated taskset.
  • Record taskset identity and learning-text digests in adapters for inference checks, without copying private learning text.
  • Return backend readiness details and update setup guidance and regression coverage.
File Description
packages/​learning/​environments/​brand-check/​tests/​test_runtime.py Adds upload-only startup and readiness-response tests.
packages/​learning/​environments/​brand-check/​tests/​test_d1_connector.py Checks adapter digest metadata and mismatched inference requests.
packages/​learning/​environments/​brand-check/​runtime_server.py Supports startup without a taskset mount and returns readiness details.
packages/​learning/​environments/​brand-check/​README.md Documents the upload-first D1 setup.
packages/​learning/​environments/​brand-check/​d1_connector.py Uses job-selected tasksets and validates adapter learning contracts.

Review effort: Max (adaptive)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

2 participants