36 Commits
Author SHA1 Message Date
Joseph MaglyandClaude Opus 5.5 6f925caf1d feat(concepts): versioned task scorers and paired scorecards
The behavioural battery treated any greedy-text difference as an effect,
so a punctuation-only edit looked like a change and nothing measured
task success.

Add a local, versioned scorer registry with deterministic exact-answer
and structured-output (JSON + declared schema) scorers. Each completion
yields separate endpoints: task success, invalid output and abstention;
raw text change is reported as descriptive only. Paired summaries use a
one-sided exact McNemar test and Wilson bounds against a declared
per-task margin; min_pairs defaults to the smallest sample that could
pass that margin, and untested or underpowered endpoints never aggregate
to PASS. Every aggregate keeps its per-example records.

EvaluationBattery(scorers=...) writes behavioural["scorecard"]; without
scorers nothing changes. Pipeline admission refuses batteries that carry
scorers until their generation is modelled. Dataset-built examples read
select/calibrate rows; locked test still needs explicit acknowledgement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 21:44:52 -05:00
Joseph MaglyandClaude Opus 5.5 fb7f474a27 fix: post-merge audit findings (eval)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 21:55:38 -04:00
Joseph Magly e1e1375a59 Merge remote-tracking branch 'upstream/main' into feat/336-preserve-directions
# Conflicts:
#	ci/test-risk-map.json
#	docs/CONCEPT_INTERVENTIONS.md
#	obliteratus/abliterate.py
#	obliteratus/cli.py
#	obliteratus/concepts/geometry.py
#	obliteratus/concepts/intervention.py
#	obliteratus/concepts/schema/concept-pack.v1.schema.json
#	obliteratus/concepts/target.py
2026-10-17 19:11:12 -04:00
Joseph Magly 79b44be065 Merge remote-tracking branch 'upstream/main' into feat/310-moe-expert-concepts
# Conflicts:
#	ci/test-risk-map.json
2026-10-17 18:53:52 -04:00
Joseph MaglyandClaude Opus 5.5 64a4b1aad7 docs: record the D4 GPU result (protection does not preserve refusal)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 18:52:44 -04:00
Joseph MaglyandClaude Opus 5.5 952793c252 feat: operator-selected embedding geometry for protected removals
Per-layer protected spans make the embedding projector ambiguous; embedding_geometry_layer
picks one layer's geometry and is recorded for export and replay. D4 uses the first layer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 18:13:01 -04:00
Joseph Magly 7b772196f0 Merge remote-tracking branch 'upstream/main' into feat/310-moe-expert-concepts
# Conflicts:
#	README.md
#	ci/test-risk-map.json
#	obliteratus/concepts/direction.py
#	obliteratus/concepts/evaluation_model.py
#	obliteratus/concepts/intervention.py
#	obliteratus/concepts/repair_model.py
2026-10-17 17:51:22 -04:00
Joseph Magly d165567dbd Merge remote-tracking branch 'upstream/main' into feat/336-preserve-directions
# Conflicts:
#	ci/test-risk-map.json
#	obliteratus/concepts/evaluation.py
#	obliteratus/concepts/geometry.py
#	obliteratus/concepts/intervention.py
#	obliteratus/concepts/target.py
2026-10-17 17:51:22 -04:00
Joseph Magly 749075f08d Merge remote-tracking branch 'upstream/main' into feat/328-raw-steering
# Conflicts:
#	ci/test-risk-map.json
#	docs/CONCEPT_INTERVENTIONS.md
#	docs/CONCEPT_WORKFLOW.md
#	obliteratus/concepts/intervention.py
2026-10-17 17:48:03 -04:00
Joseph MaglyandClaude Opus 5.5 a4a2eb4961 Merge upstream/main into feat/310-moe-expert-concepts
Resolve the risk-map conflict with #133 by keeping both new contract
surfaces.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 16:05:27 -04:00
Joseph MaglyandClaude Opus 5.5 e7d1bea6b9 docs(concepts): record #310 OLMoE GPU acceptance run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 15:20:53 -04:00
Joseph MaglyandClaude Opus 5.5 05c0857128 Merge upstream/main into feat/328-raw-steering
Resolve ExtractionRecipe conflict with #329: keep collateral_margin and
steering_scale and validate both in __post_init__.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 14:39:03 -04:00
Joseph MaglyandClaude Opus 5.5 f764576fa1 Merge upstream/main into feat/335-subspace-affine-erasure
Resolve additive conflicts with #329/#330 in the concept card and the
risk map.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 14:38:39 -04:00
Joseph MaglyandClaude Opus 5.5 623f72eee7 fix: address review findings for #310
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:47:07 -04:00
Joseph MaglyandClaude Opus 5.5 e0c59859f0 fix: address review findings for #310
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:41:08 -04:00
Joseph MaglyandClaude Opus 5.5 60aed72b25 fix: address review findings for #310
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:32:54 -04:00
Joseph MaglyandClaude Opus 5.5 719e6e590a feat(concepts): preserve protected directions during removal; D4 repair (#336)
Add preserve= to concept interventions so the removed span is first
orthogonalised against protected directions (e.g. refusal), with
overlap metadata and export replay; a protected_direction repair step
gated on the collateral battery; CLI/recipe support including
--preserve refusal; and a D4 arm in the Appendix D script. Paths
without preserve are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:22:03 -04:00
Joseph MaglyandClaude Opus 5.5 b612c54acc fix: address review findings for #310
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:22:03 -04:00
Joseph MaglyandClaude Opus 5.5 1d80676b12 fix: address review findings for #335
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:17:20 -04:00
Joseph MaglyandClaude Opus 5.5 8e3d01b37e feat(concepts): per-expert concept targeting for MoE models (#310)
Lift the dense-only restriction for supported OLMoE, Qwen2-MoE and
Qwen3-MoE layouts: routing-aware extraction readout, per-expert
down-projection edits through the fused/ModuleList MoE paths, optional
router orthogonalization, expert gate checks, and routing-drift and
expert-load reports. Unsupported MoE layouts still fail closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:07:33 -04:00
Joseph MaglyandClaude Opus 5.5 d1504faf88 feat(concepts): rank-k subspace and affine (LEACE / mean-centred) erasure (#335)
Remove whole per-layer subspaces in project, orthogonalize and lora
modes; add mean-centred orthogonal and LEACE erasure at inference time
and, where a native bias exists, as a permanent edit with recorded
reference provenance. k=1 zero-origin paths are unchanged. Adds the
Pain Axis Appendix D script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:07:11 -04:00
Joseph MaglyandClaude Opus 5.5 24b2342229 feat(concepts): non-inferiority margin for the collateral refusal test (#329)
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>
2026-10-17 13:07:10 -04:00
Joseph MaglyandClaude Opus 5.5 83ac05aead feat(concepts): fixed-magnitude steering scale modes (#328)
Add scale=residual_norm|raw|vector to concept steering across the API,
CLI, recipes and run metadata, recording effective vector norms. The
default residual-norm path is unchanged. The Pain Axis resteer stage now
uses the concept API with identical arithmetic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:07:10 -04:00
Joseph MaglyandClaude Opus 5.5 7fa2ae87e8 Forward fold_post_norms to remote runs and record it in golden metadata
Remote obliterate commands accept the folding opt-out, folded repair
candidates are validated after storage-dtype conversion, the refusal golden
fixtures record the new provenance key (numeric values unchanged), and the
risk map registers the shared post-norm module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 23:22:29 -04:00
Joseph MaglyandClaude Opus 5.5 d664199cc7 Fold post-sublayer norms in pipeline excise
AbliterationPipeline now folds Gemma 2/3 and OLMo 2 post-attention and
post-feedforward RMSNorm scales into residual-writer projections across
excise, Bayesian, SAE, LoRA-ablation and repair paths, sharing the
recognition rules with the concept API. fold_post_norms=False
(--no-fold-post-norms) reproduces the previous numerics and is recorded in
run metadata. Combinations that cannot be folded fail explicitly.

Fixes #320

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 22:42:35 -04:00
Joseph MaglyandClaude Opus 5.5 8d6e38bd35 Fold post-sublayer norms and optionally project embeddings in concept weight interventions
Concept orthogonalize/lora now remove the direction from what Gemma 2/3 and
OLMo 2 sandwich-norm layers write to the residual by folding the post-norm
scale into the projection, and fail closed on unrecognized post-norm layouts.
project_embeddings adds the input embedding edit, with an explicit
tied_embeddings choice (edit_both or untie) for tied models.

Fixes #318

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 21:50:53 -04:00
Joseph MaglyandClaude Opus 5.5 5f558a78db feat(concepts): apply #223 maintainer rulings on publication, leace and steering
Maintainer decisions for epic #223 (2026-10-15):

- Q1: `leace` is a deprecated alias of the Fisher LDA direction. It keeps
  its numerical behaviour, warns once per public resolution with a
  DeprecationWarning naming `fisher_lda` and `leace_exact`, and will be
  removed in a future minor release.
- Q4: a collateral FAIL blocks both the model card and any Hub push of
  modified weights or adapters on every path (pipeline, export_run, both
  CLIs, Concept Lab, the Hub UI and tourney uploads), checked before any
  network call. `--allow-collateral-fail REASON` (and the matching API
  argument and UI field) overrides the block and stamps the FAIL and
  reason into the card, checkpoint metadata and provenance. Local save
  and export are never blocked.
- Q5: research-tier packs no longer carry publication or local-export
  restrictions; the tier is provenance only and Q4 applies to every pack.
- Steering defaults are removal-first: `steer` defaults to alpha -1 and
  the default dose ladder is non-positive. Positive doses stay available
  explicitly; `project` keeps its positive removal strength.
- Q3 (gate modes) and Q7 (dense only, follow-up #310) are unchanged and
  documented.

Refs #223

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 15:37:51 -04:00
Joseph Magly df9d9ad679 Merge remote-tracking branch 'upstream/main' into feat/234-concept-lab-ui 2026-10-06 00:09:26 -04:00
Joseph MaglyandClaude Opus 5.5 f40b51f20c feat(ui): add Concept Lab tab for the concept workflow
A new Concept Lab tab (obliteratus/ui_concept_lab.py) drives the merged
concept APIs in six steps:

1. select a concept or pack;
2. extract with the pack recipe;
3. validate through the gate (an override needs a non-empty, recorded
   reason);
4. intervene (orthogonalize, project, steer, lora), with pristine and
   modified previews;
5. evaluate with the collateral battery, and run the repair ladder for
   every intervention mode;
6. export through the #231 guards.

Under those guards, research-tier packs never push modified weights, a
collateral FAIL blocks only the publish card, and incomplete repairs need
an explicit acknowledgement. The UI never fetches pack data implicitly.
Selecting a concept pack disables or rejects the custom-prompt and dataset
controls, with a clear message.

The Obliterate tab still defaults to refusal and is unchanged. Legacy
refusal runs also expose their extraction as a ConceptDirection artifact,
best effort: a layout the artifact cannot represent is logged and never
aborts the run. Operator-UI coverage follows the existing conditional
policy pattern.

Closes #234

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 00:09:26 -04:00
Joseph MaglyandClaude Opus 5.5 d531158d30 docs(concepts): add concept workflow and interpretation guide
docs/CONCEPT_WORKFLOW.md walks a concept from definition to export
(define, extract, validate, intervene, evaluate, repair, compare/export),
with offline CLI examples. Its interpretation guide covers what
validation, ablation and steering do and do not show: behavioural nulls
as first-class results, hidden KV-cache channels, steering fragility, and
why "direction removed" is not "experience removed". A responsible-use
section covers user-defined concepts.

Every literature claim is cited by arXiv id or DOI. The existing concept
docs link to the guide, and the README gains a short "Concept vectors
beyond refusal" section. A test runs the outcome-language lint over the
concept docs, resolves local links and anchors, checks that every
documented `obliteratus` command parses, and checks the required
citations.

Closes #235

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 23:50:49 -04:00
Joseph MaglyandClaude Opus 5.5 acdd418663 feat(concepts): require the collateral battery for research-tier exports
Any intervention export for a research-tier concept, such as the pain pack,
now requires the run's evaluation record to show that the collateral
battery ran with a refusal-rate result. A skipped or missing battery blocks
the export, with an error naming the missing channel; research tier has no
override. Direction- and validation-only exports stay allowed. User-tier
runs that skip the battery still export, with the skip reason recorded.

This implements the #232 acceptance criterion that the collateral battery,
including refusal rate, is required for any pain intervention export.

Refs #231 #232

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 23:24:35 -04:00
Joseph Magly 373af6bd81 Merge remote-tracking branch 'upstream/main' into feat/231-compare-export
# Conflicts:
#	ci/test-risk-map.json
#	docs/CONCEPT_INTERVENTIONS.md
#	obliteratus/abliterate.py
#	obliteratus/concepts/cli.py
#	obliteratus/concepts/evaluation.py
#	obliteratus/concepts/intervention.py
2026-10-05 23:21:14 -04:00
Joseph MaglyandClaude Opus 5.5 c8bde1d9be feat(concepts): add compare, export and provenance for concept runs
Concept runs can now be compared and exported as directions, reports,
reversible adapters or full checkpoints. Each export carries
schema-validated provenance (concept-provenance.v1) with sorted content
digests, pack identity, gate verdict, evaluation outcome and repair status.
Exported cards use outcome language ("direction removed / behaviour
changed"), and a lint rejects claims about removing pain, suffering or
experience. Pack data is excluded from exports through a strict file
allowlist (model files, shard index cross-check, symlink rejection).

Publication guards follow the interim maintainer decisions on #223:

- Q4: a collateral FAIL blocks only --publish-card. Other exports proceed
  with the FAIL recorded. Publishing anyway needs an explicit, recorded
  reason, from the CLI or the UI acknowledgement panel.
- Q5: research-tier packs never push modified weights or adapters to the
  Hub, from the pipeline, the CLI or the UI. Malformed concept metadata
  fails closed.

Incomplete repairs need an explicit acknowledgement before export or a UI
Hub push. Refusal metadata changes are additive only.

Closes #231

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 23:12:08 -04:00
Joseph MaglyandClaude Opus 5.5 b089f60d75 feat(concepts): add coherence repair ladder with strict acceptance
When an intervention costs coherence, a repair ladder runs steps in order
of invasiveness:

1. norm preservation;
2. retained-fraction regularization;
3. KL-budget rollback;
4. RDO refinement;
5. a reversible LoRA repair adapter.

A step is accepted only if coherence is within budget, the target
projection stays removed, and collateral metrics are no worse than before
the step. A step that re-introduces the direction is rejected, and its
weights are rolled back bit-exactly, including on exceptions. Every attempt
and its reasons are recorded. Non-finite measurements become rejection
reasons rather than errors. repair: incomplete is reported, and the report
saved, when no step satisfies all criteria. Steps that are unavailable for a
layout (for example offloaded or quantized weights) are recorded as
unavailable. The legacy refusal path is unchanged.

Closes #233

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 22:42:55 -04:00
Joseph MaglyandClaude Opus 5.5 9cd3810d8d feat(concepts): add default-on evaluation battery after interventions
Weight orthogonalization can drive a direction's projection to about 0
while behaviour is unchanged (arXiv:2609.16247, App. D), and valence state
can persist through the KV cache (arXiv:2609.35591). Every non-refusal
concept intervention is now followed by an evaluation battery:

- mechanistic: per-layer residual projection before and after;
- collateral (on by default): refusal rate on 320 paired, seeded built-in
  harmful prompts versus the pristine model, using a one-sided exact
  McNemar test on discordant pairs. The report includes Wilson CIs for both
  rates, a paired bootstrap CI for the drop, and loss/gain transitions.
  Below 284 prompts a non-significant result is UNDERPOWERED, and a
  significant drop is FAIL at any size. Also first-token KL, coherence
  anchors and neighbour-concept projections;
- optional re-steer and KV-cache persistence probes, and a pack-supplied
  behavioural battery hook.

evaluation.json separates mechanistic, behavioural and collateral outcomes,
and lists untested channels (the KV channel unless probed). Skipping the
battery is recorded with a reason. Pristine refusal flags are cached by model
id and revision, prompt-set hash, decoding config and scorer identity (mode
plus pattern hash); runs with no pinned revision are not cached. Legacy
refusal runs are unchanged.

Closes #230

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 22:02:47 -04:00
Joseph MaglyandClaude Opus 5.5 f0faaca545 feat(concepts): add reversible concept intervention modes
apply_concept_intervention(model, direction, mode, layers, positions, ...)
supports four modes:

- orthogonalize: the permanent weight projection, routed through the
  offload-aware transactional path (all targets resolved before the first
  mutation, including tied aliases; rollback on failure);
- project: a reversible inference-time projection hook;
- steer: reversible steering with signed alpha, per-layer vectors, a
  runtime-mutable coefficient, and safetensors+JSON save/load;
- lora: a forward-time adapter that never modifies base weights, so
  removal restores pristine logits exactly.

The pipeline and SteeringHookManager now share one hook mechanism, with the
public API kept compatible. Installation is transactional: a failure partway
removes any hooks already installed. evaluate_dose_ladder reports steering
over a default alpha ladder, with invalid-output and refusal denominators and
a caution that steering effects are coefficient-fragile and non-monotonic.

The validation gate is enforced. Only the built-in refusal pack (matched by
pack hash, not by label) is exempt. Other directions need a passing or
warning verdict, or a recorded override.

Closes #229

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 21:31:34 -04:00