Skip to content

Model assembly base: per-slot model configuration, shared advice interfaces and contract fields for returned models - #37

Merged
Jeffreyliu0131 merged 6 commits into
mainfrom
claude/144-model-assembly
Oct 12, 2026
Merged

Jeffreyliu0131 merged 6 commits into
mainfrom
claude/144-model-assembly

Conversation

@Jeffreyliu0131

Copy link
Copy Markdown
Collaborator

Base of the model-reception wave (task book 143, line 144): the contract fields, shared advice interfaces and per-slot model configuration that the returned models from the data/model owner will plug into. No new user-visible behaviour; the zh/en feedback page still shows "等待模型接入".

What changes

  • Contract (optional fields only, old records byte-identical): RegisteredModelIdentity gains kind, task_type, criteria, dataset, components, fusion, weights_stage, rubric_version; RegisteredModelAdvice gains task_type, per-sentence units, aggregation, reconciliation and new error codes; FeedbackProvenance records multiple registrations and the support model. Advice from a synthetic_fixture registration may now carry labels and evidence (decision 2026-10-12) and is always marked synthetic_mechanism_only.
  • Per-slot model configuration: four slots — ROLES (colleagues), JUDGE, SUPPORT (falls back to JUDGE), ASSISTANT — each with CAREER_LAB_<SLOT>_{PROVIDER,KEY_FILE,BASE_URL,MODEL,MAX_TOKENS,TIMEOUT}; a slot's identity is taken from one layer only (its own variables with the provider's defaults, or the shared configuration as a whole), never mixed, so a shared key is never sent to another provider. openai_compatible is a new provider for local services; a non-loopback endpoint without its own key refuses to start. With no slot variables set, requests are byte-identical to main. Real calls stay retries=0; keys never reach logs, database or provenance.
  • Shared interfaces for the follow-up lines: models/v3/consumer.py (AdviceSource), projection.py, registry.describe_registration, measure(), return_cli.py, and CAREER_LAB_MODEL_REGISTRATIONS ({"relation": …, "criterion": …}; the criterion entry is parsed only). Moves are byte-identical to the pre-move behaviour (SPLIT-01 against sessions recorded on main).
  • Contract exports regenerated once: expansion-v3 → bdeee6db, engineer-review-v1 → 37bedd6f (previous 14439473); manifest_history gains one entry; errors.json +9 codes.

Review and verification

  • Independent review 080-review-144.md: first round sent back (shared key could leak across providers through field-level fallback; criterion entry was loaded instead of parsed), fixed in ea82f04, second round 可合入. The reviewer re-recorded the main goldens, re-generated the contracts byte for byte, and reproduced the three key-routing cases over HTTP.
  • 86 new test IDs (DTO-01..03, SPLIT-01, REG-01/02, SLOT-01..06, KEY-01..04, MEASURE-01), each red on the previous tree.
  • Locked gate on 1521d8e: lint 0 new; backend 3298 passed / 31 skipped; frontend 404 / 7; 72 state checks; build; per-ID "Regression gate: 0 problems"; browser 20 steps zh+en; MCP bilingual pass. The branch contains main d163747, so the merge tree equals the gated tree.

Not claimed / registered

No real provider was called; model quality is not verified. Startup fingerprint is printed by the worker only (serve keeps its whitelisted log). P3 follow-ups registered for line 150: invalid port raises an uncaught ValueError at startup; base_url host/port is readable in session provenance. Receipt: 完成回执/claude-coordination/144-契约与装配基座.md.

Optional RegisteredModelIdentity fields (kind, task_type, criteria, dataset,
components, fusion, weights_stage, rubric_version), FeedbackProvenance
registered_models and support_model, and RegisteredModelAdvice criterion
results, sentence units, aggregation and rule reconciliation; synthetic
registrations may show labels. Unset fields keep historical bytes.

Move the R2.support input and export projections to models/v3/projection,
advice production to models/v3/consumer.AdviceSource, add
describe_registration with per-protocol handlers, measure() on every model,
return_cli for verify-return, and CAREER_LAB_MODEL_REGISTRATIONS. Behaviour
is unchanged: inputs and advice match the pre-move tree byte for byte.
expansion-v3-d4178f30... (previous expansion-v3-14439473...): optional
model-assembly fields on RegisteredModelIdentity, FeedbackProvenance and
RegisteredModelAdvice, and two registration configuration error codes.
Examples are unchanged. engineer-review-v1 follows the new legacy manifest
digest. Generated with the official exporters; nothing edited by hand.
CAREER_LAB_<SLOT>_{PROVIDER,KEY_FILE,BASE_URL,MODEL,MAX_TOKENS,TIMEOUT} and
JUDGE/SUPPORT _INPUT_BYTES, read once at startup. SUPPORT falls back to
JUDGE, every slot to the shared variables and --provider, then provider
defaults; with no slot variable set requests match main byte for byte.
openai_compatible needs an explicit base URL and model and may omit the
key only on loopback hosts. Keys without an sk- prefix are accepted and
never logged, stored or echoed in errors. Feedback provenance records the
Judge slot and, when it differs, the support model. The worker prints each
slot's provider, model and non-secret fingerprint at startup; invalid
configuration refuses to start with only an error code. Real calls keep
retries=0.
expansion-v3-a7136a29... (previous expansion-v3-14439473...). The export now
fingerprints runtime/model_slots.py and runtime/model_adapter.py with the
other assembly inputs, so their startup error codes are published; the
reproducibility test's input list follows. The model-assembly history entry
also records the slot and registration variables. Examples are unchanged
from main; engineer-review-v1 follows the new legacy manifest digest.
A slot with its own _PROVIDER takes key file, base URL and model only from
its own variables or that provider's defaults; SUPPORT without a provider
takes the whole JUDGE slot; other slots take the whole shared layer.
Identity variables without their slot provider refuse to start
(model_slot_provider_required), so a shared key is never sent to another
provider's endpoint. Feedback provenance records the Judge and support
endpoints actually called when slot variables configure them.

A criterion registration is now only checked for shape and handed to
consumer.criterion_source, which loads nothing yet: feedback, provenance
and model loading match a deployment without it. The W14 receipt test pins
the local models through configured_slots, which assembly reads.
expansion-v3-bdeee6db... (previous expansion-v3-14439473...): optional
FeedbackProvenance.base_url and SupportModelIdentity.base_url, the
model_slot_provider_required startup code, and the updated model-assembly
history text. Examples are unchanged from main; engineer-review-v1 follows
the new legacy manifest digest.
@Jeffreyliu0131
Jeffreyliu0131 merged commit 95d4883 into main Oct 12, 2026
1 check failed
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