Commit Graph
419 Commits
Author SHA1 Message Date
Joseph Magly 8bdd844e09 fix(handles): clean up remaining ModelHandle sites and name the snapshot path once
Section D of #675: the neuron lab's load() drops the previous handle and its
state even when its cleanup fails (the failure is raised and nothing new is
loaded); `experiments trace` cleans up its handle on success and failure
without masking the trace error; default_model_factory cleans up the handle
when .to(device) fails, keeping the move error; a snapshot error raised
through a handle names the restore-point path once. Adds tests for the
sequence refusal branch and write_step(changed=False), and registers the
cleanup-site tests for inputs.py and trace_cli.py in the risk map.

Refs #675
2026-11-25 13:45:14 -05:00
Joseph Magly 3c7a6ca920 fix(models): harden ModelHandle cleanup sites and messages
Moves cleanup_on_exit/cleanup_during_error to the light
obliteratus.handle_cleanup module (re-exported from the loader) and imports
them at module top, so no import runs after a handle exists. Stores the closed
policy before detaching the restore point, names the path to remove in
handle-surfaced SnapshotErrors, guards post-load work in candidate,
smaller_change and the sequence loaders, keeps observer-close and neuron-lab
cleanup failures from replacing the primary error or skipping state reset, and
adds failure-plus-failing-close tests for every listed site.

Fixes #669
2026-11-25 10:06:29 -05:00
Joseph Magly 17b2ae36bd fix(strategies): resolve Gemma 3 multimodal decoder layers and hint bfloat16 on fp16 baseline overflow
Gemma 3 4B/12B/27B checkpoints load as Gemma3ForConditionalGeneration with the
text decoder at model.language_model.layers; get_layer_modules now falls back
to that path (model.layers stays primary), and text-only gemma3_text is mapped
explicitly. A non-finite stock baseline on float16 weights now suggests
--dtype bfloat16. The default dtype is unchanged.

Fixes #643
2026-11-25 02:37:29 -05:00
Joseph Magly f2abf5557a fix(viewer,report): share one numeric-string grammar and read metrics in file order
Codex review r2 for #618: the results viewer reads uploaded files with an
order-preserving JSON reader so metric selection walks baseline keys in file
order like Python (integer-like keys included), and the viewer and
report._metric_value share one strict numeric-string grammar (ASCII digits,
sign, decimal point, exponent; ASCII whitespace only; finite).
2026-11-24 19:13:22 -05:00
Joseph Magly 86407c7760 fix(viewer,report): render results as text, mirror plot metric selection, write plots atomically
Codex review r1 for #618: the results viewer builds its stats, chart and
table with DOM nodes and text only (no innerHTML), so a crafted results.json
cannot inject markup; its impact-metric selection mirrors save_plots exactly
(string primary only, measured baseline plus at least one measured ablation);
every render clears all result regions. Plots are written to a temp file and
moved into place only on success, figures are always closed, and a fallback
metric is labelled on the chart. A node-based test exercises the viewer.
2026-11-24 18:31:18 -05:00
Joseph Magly 16f181a578 Merge pull request #605 from elder-plinius/feat/590-analysis-on-device
Run abliteration analysis math on the model's device
2026-11-24 15:36:12 -05:00
Joseph Magly 2d79987f9b Merge remote-tracking branch 'upstream/main' into fix/589-search-process-groups 2026-11-23 12:21:30 -05:00
Joseph Magly f2db169384 Merge upstream/main into feat/590-analysis-on-device
Resolve against #593 (quick-check settings) and #591 (tied-head
migration) by keeping both sides: the pipeline gains analysis_device
alongside refusal_check_mode/confidence; migration and the shipped
recipes emit allow_tied_head_edit and the analysis_device cpu pin;
_structured relaxes both the refusal-check settings and
analysis_device for historical resolution records; both sides' tests
are kept.
2026-11-23 12:20:52 -05:00
Joseph Magly d62f4aafe9 feat(abliterate): run analysis math on the model's device
When the model is on CUDA or MPS, activation stacks and the analysis
math (difference means, winsorizing, whitening, per-layer SVD in
float32, refinement and KL logits) now stay on that device instead of
being copied to the host, where they used about 10 host cores per edit.
A new analysis_device setting (auto | model | cpu) is a v2 projection
parameter: auto, the default for v2 recipes, uses the model's device and
falls back to the CPU with a logged reason for offloaded, split or meta
models or when the pre-collection memory estimate exceeds free device
memory. The device actually used is recorded in resolution records and
checkpoint metadata. v1-migrated recipes and the shipped recipes pin
cpu so confirmations made with CPU-extracted directions re-apply
exactly; direct pipeline calls keep their CPU default. CPU results are
unchanged.

Fixes #590
2026-11-23 12:19:09 -05:00
Joseph Magly 1de580f7a1 Merge pull request #595 from younger-plinius/research/vocabulary-row-edits
Add experimental vocabulary-row editing with prompt and export audits
2026-11-23 12:18:46 -05:00
Joseph Magly cb49b92777 Merge remote-tracking branch 'upstream/main' into fix/589-search-process-groups 2026-11-23 12:18:43 -05:00
Pliny the Younger 5e55cdae09 Add experimental vocabulary-row editing with prompt and export audits 2026-11-22 22:18:34 -05:00
Joseph Magly 3c8c20242f fix(recipes): stop candidate subprocess trees when a search is interrupted
recipe search, recipe confirm and verify-edit's capability vLLM server
started subprocesses that survived when the parent was stopped. An
orphaned edit kept 18 GB of GPU memory and broke the next queued
search. Subprocesses now start in their own process group; on
SIGTERM, SIGINT or an exception the whole group gets SIGTERM, a grace
period, then SIGKILL. The interruption is recorded in the candidate
record so a resumed search retries it. POSIX only; Windows behaviour
is unchanged.

Fixes #589
2026-11-22 11:51:16 -05:00
Joseph Magly c47c2c1033 fix(recipes): preserve v1 tied-head behaviour when migrating to v2
v1 recipes projected a tied LM head implicitly; the v2 projection
technique refuses that unless the recipe declares it. migrate_v1 now
emits allow_tied_head_edit: true when v1 would project the head (a
no-op on untied models) and lm_head: skip when v1 disabled head
projection, with provenance. It never silently skips a head edit v1
would have made. Migrated v1 search grids follow the same rule, and
shipped v1-derived data is updated.

Fixes #588
2026-11-22 11:51:15 -05:00
Joseph Magly a897159ad8 fix(export): copy source processor configs into abliteration checkpoints
Checkpoints saved weights, configs and tokenizer files but not the
source model's processor configuration, so models packaged as
multimodal wrappers (Qwen3.5, Gemma 4 E-models) could not be served
from an exported checkpoint (vLLM: "Can't load image processor").
Export now copies processor-side config files present in the local
source directory or the exact cached Hub revision, records their
SHA-256 digests in the checkpoint metadata and projection resolution
records, and checkpoint validation rejects a listed file that is
missing or changed. No network access; a source without these files
exports exactly as before.

Fixes #585
2026-11-21 06:24:28 -05:00
Joseph Magly ee4935e798 Merge upstream/main into feat/569-concept-unification
Apply #571's projection resolution schema additions (reference,
$defs) before wrapping it in the concept-or-projection conditional.
2026-11-21 01:40:04 -05:00
Joseph Magly 7c9f9764ec feat(recipes): unify concept packs with v2 edit steps
Concept-pack ExtractionRecipe maps onto the direction_source and
placement of v2 techniques: concept_recipe_to_v2 converts every shipped
pack into a normalized v2 step whose direction source is a pinned
concept_pack input, with pack-level extraction pins normalized into
explicit parameters. Packs applied by activation steering use a new
steering.activation_addition v1 technique wrapping the existing
intervention code; refusal is expressed as weight projection like any
other concept. Applied steps may register cleanup that the executor
runs if a later step fails, so steering hooks are removed.

Fixes #569
2026-11-21 01:27:14 -05:00
Joseph Magly 134bd2c32c feat(recipes): move recipe tools to v2 pipelines; v1 read-only
recipe search, confirm, promote and obliterate --recipe now operate on
v2 recipes: search grids are v2 step variations (recipe-search-grid v2,
same preregistered selection rule), confirmation and promotion consume
evaluation profiles and bind evidence to applied resolution records,
and --recipe applies pipelines through apply_recipe. v1 recipes and
grids load through mechanical migration with a notice; writing v1 is
refused. Shipped v1 data is migrated to v2, and the two recipes
confirmed on the protocol final test in the initial core run ship as
accepted v2 data: llama3.1-8b-e03-reg02 and qwen2.5-1.5b-mid10-18-dim1,
with KL-advisory profiles and value-only confirmation evidence.

Fixes #571
2026-11-21 01:27:13 -05:00
Joseph Magly 824adeeb21 Merge upstream/main into feat/567-evaluation-profiles
Keep both the evaluation-profile and pinned-input exports and risk-map
entries; apply_projection takes both #568's recipe_metadata and this
branch's device, dtype and reference_prompts.
2026-11-20 22:11:26 -05:00
Joseph Magly 635fff939b Merge upstream/main into feat/568-pinned-inputs
Resolve projection_runtime imports and risk-map entries; the LoRA
repair recipe's input declarations are reconciled in the next commit.
2026-11-20 21:46:01 -05:00
Joseph Magly ad32fb54d1 Merge upstream/main into feat/567-evaluation-profiles 2026-11-20 21:41:38 -05:00
Joseph Magly 790731ffea feat(recipes): add versioned evaluation profiles
Add obliteratus.evaluation-profile/v1: one digest-referenced evaluation
contract for v2 recipes. A profile carries a partial verify-edit spec
(endpoints, margins, capability decoding and tier), a kl_policy (gate or
advisory) and calibration evidence references (noise floor or random
control) whose digests and schemas are verified and whose adopted
thresholds are recorded per field. Profiles layer family then
individual over defaults with resolve_margins precedence; advisory KL
sets the endpoint not required. v2 recipe confirmation resolves the
profile and records the resolved spec digest; the v1 spec path is
unchanged. Ships a candidate Llama-3.1-8B-Instruct profile with advisory
KL and its random-control evidence, local paths redacted.

Fixes #567
2026-11-20 21:41:32 -05:00
Joseph Magly d57585ecae feat(recipes): add adapter.lora_repair technique and pipeline executor
The second v2 technique, registered only through the technique
registry with no change to the model-recipe.v2 schema or validator.
adapter.lora_repair v1 wraps the existing LoRA recovery (assistant-only
loss): explicit defaults from RecoveryConfig, LoRA targets from
placement writer roles, training on the previous step's model state,
and an adapter or merged-weight artifact with SHA-256 digests in its
resolution payload. apply_recipe runs ordered steps fail-fast, binds
declared inputs and outputs between steps, and chains each step's
payload into one resolution record. recover.py gains keyword-only
dropout and exact-target seams with unchanged defaults.

Fixes #570
2026-11-20 17:23:40 -05:00
Joseph Magly 65439c0a8b feat(recipes): pin v2 inputs by digest with declared split roles
Add an extensible input-kind registry (protocol_split, prompt_pairs_file,
concept_pack, chat_template, reference_model). resolve_inputs
materializes each named input, verifies its SHA-256 and returns its
declared role. Normalization validates input declarations and step
consumption before hashing: technique steps may consume only train or
calibration inputs, search evaluation only tune and confirmation only
final_test, so the final test set cannot reach fitting. The projection
technique extracts from the resolved train input, and the resolution
record carries verified input digests. Protocol disjointness checks are
shared with search.

Fixes #568
2026-11-20 17:23:39 -05:00
Joseph Magly e25c6e94e7 Merge upstream/main into feat/565-projection-technique
Resolve docs/MODEL_RECIPES.md keeping both the projection technique
section and the checkpoint resolution records section from #576, and
correct the latter's stale note: legacy records use a fixed created_at
sentinel, not the metadata file's modification time.
2026-11-20 16:45:18 -05:00
Joseph Magly c10db5abee feat(recipes): persist checkpoint resolution records
Add obliteratus.recipe-resolution/v1: what an applied recipe actually
did, as a canonical record (recipe digest, engine and code commit,
target with structure facts such as tied embeddings, per-step technique
payloads validated by registered techniques, artifacts with digests).
Checkpoints now save recipe-resolution.json atomically beside the
weights. resolution_from_metadata adapts older checkpoints from
abliteration_metadata.json; such records use a fixed created_at
sentinel because the metadata has no timestamp, so their digest depends
on content (bound by the metadata sha256), not on file times. The
random-direction control reads the record when present and records its
digest, and confirmation records the resolution digest.

Fixes #566
2026-11-19 18:54:59 -05:00
Joseph Magly 370ab37352 feat(recipes): register the v2 abliteration.projection technique
The first technique in the v2 registry. Its normalizer expands the
authoring form (preset plus overrides, which v1 migration emits) into
fully explicit parameters through _effective_projection_options, now the
single source for both AbliterationPipeline.__init__ and recipes, so
implicit defaults such as embed_regularization 0.35 (fallback) versus
0.5 (advanced) become explicit. The applier resolves placement, runs the
pipeline with pinned layers and returns a resolution payload (resolved
layers, writers, effective ranks, KL-restored groups, effective params,
checkpoint digests). On models that tie input and output embeddings an
LM-head edit is rejected unless allow_tied_head_edit is set (or the head
is skipped), and safeguards that would change the plan reject unless
declared.

Fixes #565
2026-11-19 18:54:57 -05:00
Joseph MaglyandClaude Opus 5.5 2e13bdff53 Merge upstream/main into feat/564-placement-resolver
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:30:42 -05:00
Joseph Magly 94c7a47a5f feat(recipes): placement vocabulary and per-model resolver
Add a technique-independent placement contract (recipe-placement v1)
and resolver. Layers are absolute indices, a depth fraction window, or a
registered selector with params: middle_fraction (middle60 at 0.2-0.8
reproduces today's indices), all, all_except_first, and score-based
knee, knee_cosmic and top_k, which declare their required inputs.
Writers are roles (attn_out, mlp_out, embeddings, lm_head, router,
experts) or module patterns, mapped to the modules EXCISE edits today.
resolve_placement returns explicit layers and module names with
provenance, fails clearly on empty or invalid results, and flags tied
input/output embeddings so techniques can apply structure rules. New
selectors register without schema changes.

Fixes #564
2026-11-19 18:23:02 -05:00
Joseph Magly a2e9301063 feat(recipes): v2 core schema, normalizer and technique registry
Add obliteratus.model-recipe/v2, a technique-neutral core: engine
requirements, target (identity or family match plus typed structural
requirements), inputs by reference with split roles, an ordered
pipeline of steps (technique id and version, params, placement, inputs,
outputs, constraints), an evaluation profile reference, and the v1
lifecycle fields. Steps are validated and normalized by their technique
through a versioned registry interface. normalize_recipe produces an
idempotent, fully explicit record with a canonical SHA-256.
load_recipe dispatches on the schema version; migrate_v1 maps a v1
recipe to one abliteration.projection step carrying its preset and
overrides. V1_AUTHORING_ALLOWED stays True until the tools move to v2.

Fixes #563
2026-11-19 18:23:01 -05:00
Joseph Magly 0a90b86fcb fix(verify-edit): score capability with greedy, seeded generation
The capability endpoint ran matric-eval with the provider's default
sampling (vLLM: temperature 1.0); EVAL_SEED only selects samples. Two
runs of stock Llama-3.1-8B-Instruct on the same 75 arc items disagreed
on 4 answers, and per-benchmark stock scores moved 1-3 points between
runs, more than the default 2-point capability margin. In a recipe
search, a gentler edit (higher regularization, lower KL) measured a 5.0
point capability drop against 1.6 for the stronger edit.

The spec's capability endpoint gains temperature (default 0.0) and
generation_seed (default 42), passed to matric-eval run as --temperature
and --generation-seed, so stock and edited are a repeatable paired
comparison on the same items. Null keeps provider-default sampling for
an older matric-eval, which otherwise fails with an actionable reason.
The capability tier may now also be full. The contract test that
rejected tier "full" now uses an unknown tier name.

Requires roctinam/matric-eval#269 for pinned generation.
2026-11-19 16:00:57 -05:00
Joseph Magly 8b39cbfc4d feat(verify-edit): calibrate KL with matched random-direction edits
Stock-vs-stock calibration measures numerical noise: on an RTX 4090 it
suggested KL limits about 100x stricter than the defaults (Llama-3.1-8B
0.0012/0.0087) while a refusal-removing edit measured 1.55/0.37.

verify-edit --calibrate-random --stock S --edited E reads the reference
edit's metadata (final strong layers, effective per-layer ranks,
projection target and EXCISE settings, layer weights, KL-restored
groups), applies K seeded random orthonormal subspaces of the same rank
to the same writers on freshly loaded stock weights (never saving a
checkpoint), and measures first-token and next-token KL on the tune
partition's harmless prompts. The evidence records each trial, the
distribution and suggested limits (multiplier times the chosen
statistic); suggestions are recorded, not adopted.

KL-optimized references are matched by their final static state: their
strong layers already exclude restored layers, and restored global
writers (including tied input embeddings) are left unprojected; the
control never runs KL optimization itself. Edit metadata now records
the projection settings and layer excise weights the control needs, so
older checkpoints must be regenerated to serve as references.

Fixes #560
2026-11-19 15:28:06 -05:00
Joseph Magly 365ba07a9d fix(recipes): pass capability-evaluator settings through search and confirm
recipe search and recipe confirm launched verify-edit without a way to
supply --matric-eval-bin, --vllm-command or --batch-size, so the
capability endpoint could only be untested (or disabled) in every
search candidate and confirmation. The search grid's runtime block now
accepts batch_size, matric_eval_bin and vllm_command, and recipe confirm
takes --batch-size, --matric-eval-bin and --vllm-command. They are
forwarded to verify-edit only, with a per-attempt capability directory;
the edit request and verify-checkpoint are unchanged.
2026-11-19 15:02:45 -05:00
Joseph Magly df20cd76ba Merge pull request #557 from elder-plinius/feat/542-bind-qwen38-presets
Bind the Qwen3.8 presets to the pinned 27B revision
2026-11-19 14:02:31 -05:00
Joseph Magly 11cbddb2df fix(recipes): bind Qwen3.8 presets to the pinned 27B revision
qwen38_e01/e02/e03 were validated for Qwen/Qwen3.8-27B but ran on any
model. A single binding table now maps each preset to the pinned stock
identity. When run() would edit with a bound preset and the model
identity (explicit recipe_model_id/recipe_revision or a Hugging Face
snapshot path) is not the bound one, the edit is refused unless
allow_recipe_transfer is set, which records the transfer in metadata and
logs a warning. Construction and evaluation-only uses (checkpoint
evaluation) are unaffected. obliterate exposes the presets locally with
--allow-recipe-transfer; remote runs reject them. The campaign passes
its locked stock identity and sets transfer only for the small-model
rehearsal. The new options are appended to the constructor signature and
added to the refusal golden configs (tensors unchanged).

--recipe now labels a family recipe applied to a member with a passing
confirmation of the unchanged recipe confirmed-family-member instead of
family-application.

Fixes #542
2026-11-19 13:40:11 -05:00
Joseph MaglyandClaude Opus 5.5 6434ff702d Merge upstream/main into feat/547-family-promotion
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 13:36:17 -05:00
Joseph Magly e3a5386176 feat(recipes): require two model sizes for family promotion
A family recipe becomes accepted only through an explicit promotion
that finds passing confirmations of the unchanged family recipe (same
digest) on at least two matching member models of different sizes:
different layer counts, or at least 25% more estimated parameters at
equal depth. Failed, stale and non-matching confirmations do not count,
and the reason for each record is reported. recipe promote writes the
accepted family recipe with frozen evidence (counted confirmation
records and digests) into a review directory; recipe promote-member
writes an individual recipe that inherits the family, bound to one
confirmed member. RecipeRegistry gains an exact model/revision
confirmed-member query for the family-application label. Confirmation
records may carry the model's architectures (optional; older records
remain valid).

Fixes #547
2026-11-19 13:24:09 -05:00
Joseph MaglyandClaude Opus 5.5 e44928013e Merge upstream/main into feat/541-recipe-application
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 13:11:58 -05:00
Joseph Magly 70f62f8e1a feat(recipes): one-time final-test confirmation for candidate recipes
obliteratus recipe confirm runs the single final-test confirmation for a
candidate recipe on one model: it resolves the edit for the model's
depth and the recipe's frozen margins (family default, individual
override), refuses before any subprocess when status, identity, margins
or the final-test spec are wrong, then runs the train-prompt edit,
verify-checkpoint and verify-edit on the protocol final test as isolated
steps. A pass accepts an individual recipe (accepted_by required) with
evidence; a fail keeps it a candidate with the failure recorded; a
family pass records a member confirmation without accepting the family.
A ledger keyed by model, revision and test-set digest refuses a second
confirmation unless --reconfirm-reason is given and recorded.
Confirmation records follow a shipped recipe-confirmation v1 schema, can
be written to a recipes directory for review by PR, and are listed by
the registry. Search's verify-edit report validation is shared with
confirmation without changing tune behaviour.

Fixes #544
2026-11-19 12:58:15 -05:00
Joseph Magly 0996bfe27a Merge upstream/main into feat/541-recipe-application
Resolve docs/MODEL_RECIPES.md and ci/test-risk-map.json keeping both
sides: this branch's recipe application section and test mapping, and
the recipe search section and mapping from #552, dropping the now-stale
'tracked in #541' notes.
2026-11-19 12:57:55 -05:00
Joseph Magly d42fbf076a feat(obliterate): apply model recipes with --recipe
obliterate --recipe NAME applies one recipe; --recipe auto resolves by
model identity and profile in the documented order (accepted individual,
individual inheriting from a family, accepted family match). Identity
comes from --recipe-model-id/--recipe-revision or a Hugging Face cache
snapshot path, and an unknown identity fails before any model load. A
recipe bound to another model, or a family whose match rule does not
cover the profile, is refused unless --allow-recipe-transfer; candidates
need --allow-candidate-recipe; a matching family member without a
recorded confirmation is labelled family-application. The recipe's
method and overrides are applied exactly (family layers resolved to
absolute indices); conflicting CLI options are rejected unless
--allow-recipe-override, and are then recorded. Hub weights are fetched
at the pinned revision only after all checks pass. Metadata carries a
recipe block (name, version, scope, status, digest, inheritance sources,
resolved layers, application label, CLI overrides). Remote and plan-only
runs reject --recipe.

Fixes #541
2026-11-19 12:45:01 -05:00
Joseph Magly 54994ae5da Merge upstream/main into feat/543-recipe-search
Resolve docs/MODEL_RECIPES.md and ci/test-risk-map.json by keeping both
sides: the family matching section and family test mappings from #551
(#546) and this branch's recipe search section and mappings.
2026-11-19 12:33:49 -05:00
Joseph MaglyandClaude Opus 5.5 0f63571f83 Merge upstream/main into fix/533-layer-selection
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 12:12:16 -05:00
Joseph Magly 54a28b4fe8 Merge pull request #550 from elder-plinius/feat/537-refusal-increase-gate
Fail VERIFY when an edit increases refusal
2026-11-19 12:04:16 -05:00
Joseph Magly 406bf4790b feat(recipes): add preregistered tune split search
obliteratus recipe search runs a digest-locked candidate grid on the
protocol tune split only. Before any candidate runs it verifies the spec
and tune file hashes and their disjointness from the train and final
test partitions. Each candidate runs as isolated subprocesses (edit with
train prompts, verify-checkpoint, verify-edit on tune) and every result
is recorded, including failures; runs resume from completed candidates.
A preregistered rule ranks recorded results and writes a candidate
recipe. The edit subprocess records its reload reference from train
prompts, because the default reference samples the full built-in corpus
including final-test prompts. Fractional placement requires a resolver
callable (family resolution, #546).

Fixes #543
2026-11-19 11:56:24 -05:00
Joseph Magly cd8db6aeaa feat(recipes): resolve family recipes and inheritance
Family recipes match models by config fields read without loading
weights (model_type, architectures, layer/parameter/hidden-size ranges,
model-id globs) and express placement relative to depth: layer windows
and extraction layers as fractions, resolved to absolute indices per
model by a documented rule. Individual recipes may inherit from a family
recipe; resolution merges per field and records provenance and the
resolved layers. RecipeRegistry.resolve applies the order: accepted
exact individual, individual inheriting from a family, accepted family
match, none; two matching accepted families are an error naming both.
Adds a candidate Llama 3 Instruct family seed resting on one member.

Fixes #546
2026-11-19 11:56:22 -05:00
Joseph Magly 46d6dc69aa feat(verify): fail VERIFY when an edit increases refusal
On Llama-3.1-8B a basic all-layer edit raised refusal from 88.7% to 99.3%
and benign over-refusal by 84.5 points, and the built-in VERIFY did not
fail it; only the separate verify-edit did.

The stock baseline now measures refusal on a bounded deterministic
sample of the evaluation harmful and harmless prompts
(refusal_baseline_size, default 32; 0 disables). VERIFY measures the
edited model on the same sample with the same generation settings and
rejects the run with PipelineQualityRejectedError when either rate rises
by more than max_refusal_increase (default 0.05; None measures without
rejecting). A baseline skipped for admission or memory records its
reason and never rejects. Both options are appended to the constructor
signature, and the refusal golden configs gain them.

The beam-output qualification test now disables the gate, so it keeps
asserting its original scoring and post-verify probe behaviour; the
gate itself is covered by tests/test_refusal_increase_gate.py.

Refs #537
2026-11-19 11:40:18 -05:00
Joseph Magly 1b9a6ee819 Merge pull request #549 from elder-plinius/feat/539-recipe-registry
Versioned per-model recipe registry and schema
2026-11-19 11:28:19 -05:00
Joseph Magly be6093dcb8 fix(abliterate): scale-aware layer selection with recorded diagnostics
Automatic layer selection ranked layers by raw activation-strength
scores, and the small-model cap kept the strongest N of the knee and
COSMIC union, so COSMIC's mid-network candidates could all be dropped.
On Qwen2.5-1.5B the default selected only layers 23-27.

- Rank candidates by strength normalized to each layer's activation
  scale (selection is invariant to per-layer rescaling); raw strengths,
  used for KL rollback ordering, and directions are unchanged.
- When the small-model cap applies, reserve a quota for COSMIC-only
  candidates instead of truncating purely by strength.
- Share one selection routine between both distillation paths.
- Record selection diagnostics (raw and normalized scores, knee and
  COSMIC candidates, caps applied, final layers) and effective direction
  counts and per-layer ranks in metadata; n_directions stays the
  requested value.

Fixes #533
2026-11-19 11:19:20 -05:00
Joseph Magly 3788e28c12 feat(verify-edit): calibrate per-model margins
Add margin resolution with precedence individual > family > defaults,
validated by the existing spec validator and returned with provenance
for every endpoint field and each input spec's canonical digest. Add
stock noise-floor calibration: stock-vs-stock harmless-prompt KL and
seeded bootstrap intervals over per-prompt rates, written as a
calibration evidence record with suggested thresholds that never fall
below the measured floor. Suggestions are recorded, not adopted; specs
are frozen by digest before final-test confirmation.
verify-edit --calibrate runs it on the protocol tune partition.

Fixes #540
2026-11-19 11:19:17 -05:00