Selective training research branch
The published portable-core-0.1.0 tag remains the extraction baseline. This
branch adds a candidate trainScope: 'head-only' beside the existing defaultall recipe. Source review and experimental execution have separate receipts.
Contract
numerical.computeSupervisedGradients(model, samples, { trainScope }),numerical.createAdam(model, { trainScope }) andnumerical.applyAdam(model, optimizer, gradients, learningRate, maxNorm, accept
{ trainScope })all or head-only. Omission selects all.
An optimizer created for one scope cannot be applied with the other scope.
harness.fitTeam(examples, { team, seed, iterations, batchSize, learningRate, clones its owned parent and trains every bound role's
trainScope: 'head-only' })
policy head. It updates wp and bp; w1, b1, w2, b2, wv and bv
and their Adam moments remain frozen. Clipping uses only the selected head
gradient norm. The head path skips trunk backpropagation but retains full-shaped
gradient and optimizer buffers; no memory or speed improvement is claimed.
Head fitting captures options and examples before asynchronous progress. Its
examples must be plain finite canonical JSON: omit undefined fields and class
instances. Capturing normalizes signed zero, and adapter functions must accept
frozen state without mutating it. The legacy all path retains its broader
existing behavior. Progress callbacks receive one event argument without a
bound this value in head mode.
The receipt binds source/task semantics, parent/result checkpoint content, frozen
parameters and moments, counts, encoded training data and sampler state. This
is provenance for a fresh fit: checkpoints still contain inference weights
without optimizer or sampler continuation. Older checkpoint envelopes have a
different source binding and require a separately specified migration.
The original numerical body and full-training body are preserved for the frozen
Task A replay. Scope dispatch rejects inherited/accessor selectors so a requested
head fit cannot silently fall back to full training. Inputs are trusted local
objects; this API does not isolate hostile code or arbitrary JavaScript proxies.
Validation boundary
Independent source criteria precede execution. The new regressions check
finite-difference gradients, an independent Adam recurrence, nonzero frozen
momentum, signed zeros, tensor identities, invalid-update refusal, parent
preservation and captured training/metric data.
The activity protocol (HEAD-ONLY-ACTIVITY-PROTOCOL.v1.json) fixes three seeds,
64 training points and 100 disjoint evaluation points before running. A declared
engineered ReLU basis supplies quadrant features; only the readout must learn.
Matched fresh, full-training, head-only and exact-rule controls remain visible.
All three head arms must meet the unchanged accuracy/loss thresholds and frozen
state checks. Results qualify only this authored mathematical activity.
This increment does not implement arbitrary layer selection, a named skill
registry, adapter training, resumable optimization, autonomous architecture
search or retention of changed policy behavior on earlier tasks. Historical
ANN06/ANN07 failures and unfinished larger campaigns remain open. The next
boundary is typed skill identity, transfer tests and per-task retention before
composing multiple learned modules.
The baseline import manifest is retained at
SOURCE-CHECKPOINT-PORTABLE-CORE-0.1.0.json (SOURCE-CHECKPOINT-PORTABLE-CORE-0.1.0.json).
The current manifest records changed core digests separately from their origins.
Do not apply the baseline evidence to this branch without fresh validation.