Resolve ExtractionRecipe conflicts with #329/#330: keep
collateral_margin and extraction_layer, and keep the entry-point
special_token_policy pop before the extraction_layer pop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Take main's versions of files unrelated to #310 that earlier fix rounds
had modified against a stale base (entry points, token-policy schema
and tests, conditional waivers); keep only the MoE routing additions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Allow packs and the CLI to pin per-model extraction layers, recorded as
pinned or selected, and add grouped layer CV. The pain pack pins the
paper's layers for Qwen2.5-7B-Instruct, Gemma-2-2B-it and Gemma-2-9B-it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add an optional BOS policy to pack entry points (schema 1.2), warn or
fail on EOS-as-BOS and policy mismatches, and persist resolved special
tokens through extraction, run and export provenance.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace significance-only FAIL with a configurable non-inferiority
decision (default 3 points): PASS, FAIL, INCONCLUSIVE, UNDERPOWERED.
Plumb the margin through recipes, CLI, reports, cards, metadata and the
Q4 export gate, and add 'concepts rescore' for saved batteries.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preserve layer pins through informed selection and refinement, validate
pins against model depth, honour pins in concept extraction, record
pinning honestly in metadata, plumb --layers through self-improve and
remote runs, and keep positional API compatibility.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Concept Pack can now declare how to locate and activate its latent
representation, as schema v1.1 (v1 packs and refusal are unchanged):
- `entry_point.messages`: a system message and prior turns wrapping each
prompt, rendered with the chat template (plain-text fallback recorded).
- `entry_point.prefill`: assistant prefill so readout can happen at an
assistant position.
- `entry_point.readout`: final_token, mean_pool, span:<name> (a marked
span in the template) or last_k:<k>.
- `entry_point.template`: `{variable}` rendering over prompt record fields.
- `entry_point.group_by`: grouped CV folds and held-out validation, so
related samples never straddle folds.
Record annotations (person, split, group) now survive pack loading and
selectors. Unknown recipe and entry-point keys are rejected instead of
silently ignored. The entry point is part of activation identity, direction
metadata and provenance, so changing it invalidates cached activations and
saved directions. Generated-state readout is documented as not yet
supported.
Fixes#311
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>