Commit Graph
78 Commits
Author SHA1 Message Date
Joseph Magly b95ec3bea6 Merge pull request #271 from jmagly/feat/244-tp2-probe-distill
feat(distributed): add experimental deterministic TP2 PROBE and DISTILL stages (2/6, #244)
2026-10-07 14:27:05 -04:00
Joseph MaglyandClaude Opus 5.5 1b936c1dfc feat(distributed): add deterministic probe distill stages
(cherry picked from commit f9a289e267889c297cefcdc67eea92c4b8eb8d4d)

Ported for #244 (part 2/6). Internal-only content from the archived
commit was dropped: .aiwg records and the internal security-docs test.
Marked experimental in user docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 14:00:29 -04:00
Joseph MaglyandClaude Opus 5.5 f28f0a15f1 fix(snapshot): derive default staging budget from available host memory
DiskSnapshot admitted six largest-tensor copies against a fixed 1 GiB
default, so any model with a tensor over ~179 MB (e.g. a large-vocabulary
embedding) could not create a restore point regardless of free memory.

staging_bytes now defaults to None, which admits half of currently
available host memory (DEFAULT_STAGING_HOST_FRACTION). Explicit values keep
their existing hard-cap semantics, min(staging_bytes, available). Rejection
stays fail-closed and names required bytes, admitted bytes, the budget
source and the snapshot.staging_bytes / staging_bytes= knob.

Closes #269

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 13:58:57 -04:00
Joseph MaglyandClaude Opus 5.5 8066e59c73 feat(distributed): add exact Llama native TP loader
(cherry picked from commit 4caf45b04a8faa55f191b22c069f58714236689b)

Ported for #244 (part 1/6). Internal-only content from the archived
commit was dropped: .aiwg records, internal runner-policy routing, and the
internal security-docs test. Marked experimental in user docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 11:23:27 -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 Magly d66ae4828a Merge pull request #261 from jmagly/feat/232-pain-pack
feat(concepts): add research-tier pain pack with pinned upstream data
2026-10-05 23:11:49 -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 Magly bd66f8b253 Merge remote-tracking branch 'upstream/main' into feat/232-pain-pack
# Conflicts:
#	ci/test-risk-map.json
2026-10-05 22:18:13 -04:00
Joseph MaglyandClaude Opus 5.5 14854019dd feat(concepts): add research-tier pain pack with pinned upstream data
Ship `pain` as a research-tier Concept Pack for the representational
direction reported in The Pain Axis (Tagliabue, Dung & Berg,
arXiv:2609.16247). No third-party sentences are committed. The manifest
references valen-research/Pain-axis at pinned commit 4d75cd90, with a
per-file SHA-256 for every positive, control, confound/neighbour, battery
and reference file. Data is fetched only by an explicit step, then cached
and verified; a mismatch fails closed.

Remote references gain a declarative, data-only JSON selector (path,
category filter, text field) applied after hash verification. Selectors are
bounded and strictly validated, with no code execution. This is an additive
schema change.

The recipe mirrors the replication spike (signed cosine 0.972 against the
published Qwen2.5-7B-Instruct vector): raw prompts, final-token readout
after " I feel:" with a mean-pool comparison, pooled controls, 50%
control-PC denoising, cv_auc layer selection, and a norm_ratio 0.6
intervention layer for steering. The first-party dataset card records
intended use, confounds (numbness and injury-without-pain wording), the
upstream MIT licence, citations and differences from the authors' grouped
CV. Caveat: the pack identifies a representational direction; it does not
measure or remove pain or any experience.

`obliteratus concepts baseline` fetches explicitly, extracts with the pack
recipe, runs the gate in report mode and writes validation.json plus
direction files. A test checks that no upstream sentence is committed.

Refs #232

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 22:18:08 -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 Magly a347a5f486 Merge remote-tracking branch 'upstream/main' into feat/229-intervention-modes
# Conflicts:
#	ci/test-risk-map.json
2026-10-05 21:31:38 -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
Joseph MaglyandClaude Opus 5.5 691c75129d fix(concepts): calibrate the validation gate against the refusal baseline
A calibration spike on Qwen2.5-1.5B-Instruct (842 prompts per class)
confirmed the AUC and percentile thresholds, but found four gate defects:

- Arbitrary SVD/eigen signs failed valid directions. Directions are now
  oriented on training rows only, so the positive class projects higher.
  Reference and neighbour cosines keep the sign of the supplied vector.
- Supplied vectors were validated by refitting the recipe, so random
  vectors scored held-out AUC 0.99. A supplied vector is now scored as-is
  on held-out folds, and recipe-refit CV AUC is reported separately.
- A suffix-only lexical confound scored AUC 1.0 and only warned. A seeded,
  cross-validated text-only lexical baseline now flags lexical_confound
  when wording alone is about as separable as the activation direction.
- The default is now 1000 norm-matched null draws, up from 20.

Power floors: fail below 16 per class, warn below 32. The refusal default
(off) is unchanged. The docs and the ADR-004 amendment record the
calibration.

Closes #256

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 21:17:58 -04:00
Joseph MaglyandClaude Opus 5.5 13a20bc147 feat(concepts): add validation gate and report before intervention
Any contrast set yields a direction, and separability can come from
wording. The gate (obliteratus/concepts/gate.py) checks a concept direction
on cached activations before any weight edit:

- in-sample and held-out k-fold AUC, refitting the full recipe per fold;
- percentile against N seeded, norm-matched random directions;
- semantic-control AUCs, and neighbour-concept cosine and AUC;
- a confound scan (discriminating tokens, masked AUC) comparing
  final-token and mean-pool readouts;
- an optional reference-vector cosine.

It returns pass | warn | fail with reasons and writes validation.json,
including the effective thresholds and a fixed statement of what validation
does not establish (causal use, behavioural effect, anything about
experience). Thresholds come from the pack, falling back to the initial
defaults, and await calibration.

Modes: enforce (default for concept entry points) stops the run after
DISTILL and before EXCISE unless --override-gate "<reason>" is given, and
the reason is recorded. report never blocks. off records validation:
skipped. Legacy refusal runs, including concept="refusal", default to off;
report is opt-in, so existing runs are never blocked and pay no gate cost.
Non-gate validation errors are raised as PipelineFailure with cleanup.

New obliterate flags: --concept, --override-gate and --gate-mode. ADR-004
gains an amendment documenting the neighbour forward-pass budget and the
refusal default.

Closes #228

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:06:19 -04:00
Joseph Magly a8460b5f54 Merge remote-tracking branch 'upstream/main' into feat/225-concept-pack
# Conflicts:
#	ci/test-risk-map.json
2026-10-05 19:15:11 -04:00
Joseph MaglyandClaude Opus 5.5 88e8ceeb57 feat(concepts): add Concept Pack format v1 with pinned remote references
Concept Packs are data-only directories or byte-deterministic .cvpack zips:
manifest.yaml, positive.jsonl, controls/*.jsonl, and optional neighbours,
battery, baseline and reference files, plus a dataset card. Every file
carries a SHA-256 and an SPDX licence. A packaged JSON Schema and built-in
validation gate the schema_version major. Tiers: core (refusal only),
research, and user (namespaced user/<id>).

Loading treats packs as untrusted. It rejects hash mismatches, missing
licences, executable content, symlinks, hardlinks, special files, nested
archives, path traversal, duplicate and colliding names, unsafe YAML,
control characters in decoded text, oversized members and unknown major
versions.

A data file may instead be a pinned remote reference (https repository,
40-hex commit, path, sha256). It is fetched only by an explicit fetch step,
cached atomically and verified, and a mismatch fails closed; lint works
before fetch. URL import requires --sha256, and installs are exclusive.

The built-in refusal pack is generated from the built-in harmful and
harmless sets and equals the #224 refusal target. New CLI group: concepts
list | show | init | lint | pack | import | fetch. Ids resolve before paths,
and corrupt cache entries are skipped with a warning. DatasetSource gains an
optional licence field. No new runtime dependencies.

Closes #225

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 19:14:54 -04:00
Joseph Magly cdcc92b58d Merge pull request #250 from jmagly/integrate/1a-4-restore
fix(checkpoint): require validated restore points and bound lazy disk restore
2026-10-05 18:43:40 -04:00
Joseph Magly f03671469d Merge remote-tracking branch 'upstream/main' into integrate/1a-4-restore 2026-10-05 18:22:10 -04:00
Joseph Magly 7568a71c08 Merge remote-tracking branch 'upstream/main' into integrate/1b-small-picks
# Conflicts:
#	tests/test_loader_boundaries.py
2026-10-05 18:17:01 -04:00
Joseph Magly 8a8fe01240 Merge pull request #243 from jmagly/integrate/1a-1-offload
fix(ablation): transact legacy edits against offloaded weights
2026-10-05 18:16:23 -04:00
Joseph Magly b2878d5386 feat(gpu): allow per-call activation cache qualification
(cherry picked from commit 2e8c362430830f1b4ce23757b9a364596bcee6ac)

Adapted for upstream: _admit_phase does not exist upstream (grep finds no
definition in obliteratus/), so dropped the internal mock and rewrote the
main test to group model forwards per cache policy instead of assuming a
single two-prompt batch (upstream batches by available memory; on CPU-only
hosts each prompt runs its own forward). Kept docs/attention-cache-
qualification.md verbatim (no hostnames, receipts, or private refs; the
#95/#96/#97 refs are public issue numbers) and the
ci/test-risk-map.json registration, which matches the final test file name.
2026-10-05 18:08:18 -04:00
Joseph Magly 30d9647779 fix(checkpoint): restore lazy disk backing within current host budgets
(cherry picked from commit d96054f91219cf866f77c3aedd4268768ee922e5)
2026-10-05 17:54:30 -04:00
Joseph Magly 21973c780f fix(checkpoint): require validated restore points throughout study lifecycle
(cherry picked from commit 72346504a49f2ceec4102f7f393159e3a6de0687)
2026-10-05 17:54:30 -04:00
Joseph Magly ce139d4d6c Merge pull request #242 from jmagly/integrate/1a-3-loader
fix(loader): honor explicit quantized placement and reject unsupported Qwen targets
2026-10-05 17:54:04 -04:00
Joseph Magly 5fda03db79 Merge pull request #241 from jmagly/integrate/1a-2-device-routing
fix(gpu): route inputs by execution device and align padded KL logits
2026-10-05 17:53:55 -04:00
Joseph Magly a433510a43 fix(loader): honor explicit device maps for quantized loads
(cherry picked from commit 90faf38efb47966bc27f49e8729a15b115d6fd2c)
2026-10-05 17:27:19 -04:00
Joseph Magly 560cbf7c61 docs: explain legacy offload mutation and failure contracts
(cherry picked from commit 7f295d2d70f3c7ffff686999c046eb397511c219)
2026-10-05 17:27:18 -04:00
Joseph Magly 8c451c3d0b docs: explain input execution device resolution
(cherry picked from commit 029a3d2e823bccc31c55e10f18fc117d8fdcb47c)
2026-10-05 17:27:18 -04:00
Joseph MaglyandClaude Opus 5.5 9ed497e074 fix(leace): describe the leace method as a Fisher LDA direction
analysis/leace.py documents that it returns the Fisher LDA direction
S_w^{-1} delta and is not a faithful LEACE (Belrose et al.,
arXiv:2306.03819), but the pipeline logged "closed-form optimal concept
erasure", and the informed preset, CLI help, UI and docs advertised
optimal LEACE erasure.

Reword the logs, preset description, CLI help, UI hint, docstrings and docs
to "Fisher LDA direction (LEACE-inspired)", and label the per-layer loss as
an LDA quantity in log text only. The leace option name, numerics,
signatures and persisted keys are unchanged; a test pins the direction to
an independently computed S_w^{-1} delta.

Fixes #221

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 17:23:03 -04:00
Joseph Magly 92db941ed0 Merge branch 'main' into packaging/unpinned-build-backends 2026-09-20 21:01:14 -04:00
Joseph Magly d34be80688 Fix offline test isolation and restore mature CPU coverage 2026-09-20 18:40:30 -04:00
Brian 73601bb13d packaging: stop exact-pinning build backends
Exact setuptools/wheel pins block platform-specific backend patches and
make isolated pip installs fail on Android/Termux Python. Keep a setuptools
lower bound only, drop the unused wheel backend pin, keep requirements.txt
aligned with core package deps, and install the Spaces extra in Docker
instead of pulling bitsandbytes by default.

Android/Termux is still not a supported runtime; the new platform note
documents host wheels, ANDROID_API_LEVEL, and --no-build-isolation so
pip does not isolate a second setuptools or compile manylinux-only
extensions.
2026-09-20 06:25:34 -07:00
Joseph Magly 707e762904 fix(packaging): install and validate the Bayesian optimizer by default 2026-09-07 16:23:48 -04:00
Joseph Magly 985c9e9363 feat: add safe distributed checkpoint intake and preflight 2026-09-04 19:43:53 -04:00
Joseph Magly 6755bd3df2 docs: record Qwen3.8 E03 4-bit release 2026-08-29 23:12:45 -04:00
Joseph Magly db731bc350 docs: link published Qwen3.8 E03 model 2026-08-29 20:52:17 -04:00
Joseph Magly dd1336f9de docs: record Qwen3.8 qualification evidence 2026-08-29 19:33:24 -04:00
Joseph Magly 4b737cba64 feat(qwen38): add E03 coherence recovery candidate 2026-08-29 18:45:57 -04:00
Joseph Magly 941869d909 feat: add tune-only Qwen3.8 E02 candidate (#185) 2026-08-29 03:54:53 -04:00
Joseph Magly d3533d382f fix: align broker pending window with cold loads (#185) 2026-08-29 01:36:37 -04:00
Joseph Magly 02cafde149 fix: make supervised pipeline timeout configurable (#185) 2026-08-29 01:12:34 -04:00
Joseph Magly 9e149bf656 feat: add held-out Qwen3.8 experiment protocol (#185) 2026-08-29 00:17:41 -04:00
Joseph Magly e8a36d796c feat: add durable reconnect-safe experiment runs (#184) 2026-08-28 23:50:45 -04:00
Joseph Magly 089c6eb5c0 docs: clarify shared-host admission budget 2026-08-28 10:46:24 -04:00
Joseph Magly 683b39ba53 fix: surface bounded GPU admission failures 2026-08-28 10:42:41 -04:00