Commit Graph
376 Commits
Author SHA1 Message Date
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 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
Joseph Magly aa43a5eb42 feat(recipes): versioned per-model recipe registry and schema
Add obliteratus.recipes: a shipped model-recipe v1 JSON schema, a
dependency-free validator cross-checked against jsonschema in tests, and
a registry that lists recipes and looks them up by name or exact stock
model id and revision. Records carry scope (individual or family),
inherits, identity, the edit (method preset plus allow-listed overrides),
frozen margins, evidence and status. Family recipes reject absolute
layer indices; family matching and depth-relative placement follow in
#546, and application in #541.

Seeds: qwen38-27b-e03 (accepted, with its historical margins), and the
initial-core-run candidates llama3.1-8b-e03 and qwen2.5-1.5b-mid12-16.

Fixes #539
2026-11-19 11:19:15 -05:00
Joseph Magly 2e1cd2d379 Merge upstream/main into fix/e03-small-model-safeguards
Resolve the refusal golden fixture: keep main's refusal_extraction_layer
config key (#538) and this branch's small_model_safeguards key and
recaptured E02/E03 tensors.
2026-11-19 09:49:17 -05:00
Joseph Magly d2137bd005 fix(abliterate): keep the qwen38_e03 recipe intact on small models
The small-model safeguards cap the layer list to 20-25% of layers and the
direction count to 2 whenever hidden size < 2048, parameters < 2B or the
model has 16 layers or fewer. They applied to the frozen qwen38_e03
recipe too, so on stand-in models E03 silently became a different edit.
On Qwen2.5-1.5B its middle-60% window (layers 5-22) was truncated to
layers 5-9 and its 4 SVD directions to 2; the edit left held-out refusal
unchanged (92.0% -> 92.0%).

Presets can now set small_model_safeguards (default True); qwen38_e03
sets False, so the layer window, early-layer guard and direction cap no
longer rewrite it. AbliterationPipeline(small_model_safeguards=...)
overrides the preset either way, and method_config records the
effective value. Other methods keep their caps.
2026-11-19 09:19:16 -05:00
Joseph Magly b1375cafd5 feat(obliterate): global refusal direction and chat-template override
The published refusal-ablation recipe takes one direction from a single
layer and removes it from every edited writer. obliterate could only
extract a separate direction per layer for refusal; --extraction-layer
rejected refusal runs. On Llama-3.1-8B-Instruct per-layer edits barely
moved refusal, and the raw-text basic preset made benign prompts refuse.

- --extraction-layer / extraction_layer now selects a global scope for
  refusal: after DISTILL, every strong layer's direction and subspace are
  replaced by the unit direction extracted at that layer (rank 1), so
  EXCISE and the embedding projection remove one shared direction. The
  scope and layer are recorded in method_config (direction_scope,
  refusal_extraction_layer). Non-refusal concepts behave as before.
- --chat-template / --no-chat-template override the preset's prompt
  formatting for extraction (default: preset). Remote runs reject the
  override before connecting, as their builder cannot forward it.
2026-11-19 09:07:59 -05:00
Joseph Magly be5da03024 fix(numerical): project large weights in bounded slices
project_weight_against_direction widened the whole weight to the compute
dtype and then materialised the outer product and the projected result as
further full-size temporaries. For a 128256 x 4096 LM head that is about
5.9 GiB of extra peak memory, which made 8B bf16 abliteration run out of
memory on a 24 GB GPU after every transformer layer had been edited.

Weights whose compute-dtype copy exceeds PROJECTION_CHUNK_BYTES (256 MiB)
are now projected slice by slice along the coefficient axis: one pass
collects coefficients and the norm, the second writes each projected
slice into a weight-dtype output. Each element uses the same formula and
compute dtype; the norm-preserve ratio is derived before the write pass,
and non-finite and degenerate inputs keep their fail-closed results.
Smaller weights keep the dense path unchanged.

On an RTX 4090 the LM-head projection's extra peak falls from 5.88 GiB to
1.73 GiB, with outputs within one bf16 rounding step of the dense path.

Fixes #535
2026-11-18 20:20:16 -05:00
Joseph Magly bb0f69a70b fix(concepts,docs): verdict gate for baselines and setup fixes from the first local run
Fixes found while running the initial core run on a local RTX 4090.

- `concepts baseline --require-verdict {pass,warn}` exits 3 with the
  reasons after saving the report when the validation verdict is worse
  than required. Refusal validation stays in report mode, so without the
  option the command exits 0 even on a failing verdict; default
  behaviour is unchanged.
- Runbook: the L1 dry run no longer sets a hard stop (dry runs charge
  production stage allowances, so a 2-hour cap refused stages); the
  campaign needs its own CUDA environment from
  scripts/qwen38_campaign_setup.sh (qwen-hybrid kernels and PEFT);
  incomplete cached snapshots are passed as local snapshot directories.
- Layer placement: check strong_layers, pin a window with --layers when
  the default selection lands on the final layers (#533), and compare
  settings on the tune split rather than the final test set.
- verify-edit vLLM launch disables the FlashInfer sampler, whose startup
  JIT build fails when the system nvcc or host compiler doesn't match
  vLLM's CUDA build.
- Campaign setup docs: torch backend and nvcc must share a CUDA major
  version, and CUDA 12.4 needs a host compiler older than GCC 14 (use
  CC/CXX/CUDAHOSTCXX=gcc-13/g++-13 with --torch-backend cu126).
2026-11-18 19:51:10 -05:00
Joseph Magly 3c62b87410 docs: initial core abliteration run runbook
Add docs/INITIAL_CORE_RUN.md: the operator sequence that proves the
core abliteration pathway on a local 24 GB GPU first, then spends one
budget-capped H200 window on Qwen3.8-27B (#531).

- Prerequisites: licences, local pinned revisions, a frozen margins
  spec passed by digest, and extraction prompts exported disjoint from
  the verify-edit held-out set.
- Local steps L1-L6 with exact commands and pass/stop rules: GPU gates
  and campaign dry run, concept gate, obliterate --record-reference with
  verify-checkpoint, verify-edit including the matric-eval vLLM path,
  and the 8B bridge.
- The rented window: the campaign with --budget-usd, --hard-stop-hours,
  --reserve-hours and --elapsed-offset-hours, stop and teardown rules,
  and evidence copy-out.
- Linked from the campaign, verify-edit and checkpoint-verification
  docs; registered in the test-risk map.
2026-11-18 13:00:17 -05:00
Joseph MaglyandClaude Opus 5.5 3359177d25 Merge upstream/main into feat/issue-525
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 12:08:03 -05:00
Joseph Magly 31129a069e Merge pull request #530 from elder-plinius/feat/issue-526
verify-edit: edited-vs-stock verification stack with matric-eval glue
2026-11-18 12:04:48 -05:00
Joseph Magly 7fde9afa2c feat(obliterate): verify-edit edited-vs-stock verification stack
Nothing produced a single preregistered pass/fail report for an
abliteration, and there was no glue to matric-eval (#526).

- `obliteratus verify-edit --stock M --edited CKPT --spec SPEC` reports
  pass/fail/untested per endpoint: held-out refusal with Wilson
  intervals, collateral over-refusal and coherence, first- and
  next-token KL on harmless prompts, advisory perplexity, and
  capability.
- Held-out data defaults to the pinned 200-pair final_test partition of
  the qwen38-v1 split; `--write-extraction-pairs` exports its disjoint
  train partition for `obliterate --prompt-pairs-file`, and
  `--extraction-prompts` proves zero overlap (overlap exits 2; unproven
  disjointness leaves held-out refusal untested).
- Margins come from a strict, digest-bound JSON spec
  (obliteratus.verify-edit.spec/v1) with proposed defaults.
- Capability runs matric-eval over vLLM against existing endpoints or
  servers launched from a command template, one model at a time; since
  matric-eval exits 0 on benchmark errors, the run summary is parsed and
  any missing or failed benchmark is untested, never a pass. lm-eval
  reuses capability-check.
- Exit 0 pass, 1 required failure, 3 incomplete (required untested),
  2 usage or integrity error; reports carry model, checkpoint, dataset
  and spec digests and runtime, but no prompt or completion text.
2026-11-18 11:58:46 -05:00
Joseph Magly 3ff6e8e020 feat(qwen38): enforced budget hard stop for the A100/H200 campaign
`--budget-hours` only warned, so an overrunning stage kept spending a
fixed rental budget (#527).

- `--hard-stop-hours` and/or `--budget-usd` with `--usd-per-gpu-hour`
  set a wall-clock deadline (the lower of the two); `--reserve-hours`
  (default 2, 0 in dry runs) keeps time for evidence copy-out and
  teardown; `--elapsed-offset-hours` counts rental time already used.
- A stage starts only if its allowance fits before the deadline minus
  the reserve; refused stages and their dependants are skipped while
  later stages that fit still run. Stages run in priority order with
  optional stages (load path, pain axis, multistep) last.
- At the deadline the running stage's whole process group gets SIGTERM,
  then SIGKILL after a grace; the receipt records stopped_by_budget,
  outputs stay hashed and nothing is deleted. A budget stop exits 75 and
  --resume continues from the last completed stage in a later window.
- Ctrl-C now stops the whole process group the same way, so an operator
  stop also frees the GPU; a second Ctrl-C kills immediately.
- Without the new flags behaviour is unchanged; the script still loads
  no ML stack at startup. New logic lives in
  scripts/qwen38_campaign_budget.py.
2026-11-18 11:57:14 -05:00
Joseph Magly 811854194e feat(obliterate): verify-checkpoint reload-and-generate parity
The REBIRTH save stage only checked that files exist and parse, so a
save that dropped or mangled the edit passed silently (#525).

- `obliterate --record-reference` records greedy outputs of the
  in-memory edited model on the pinned obliteratus-verify-v1 prompt set
  (8 harmful + 8 harmless, 32 tokens) into a sidecar with digests of the
  files the reload reads.
- `obliteratus verify-checkpoint` reloads the checkpoint from local
  safetensors only, regenerates greedily and compares token ids: exact
  match, prefix agreement and harmful refusal-rate change against
  per-reload tolerances (strict for full precision, provisional for
  bitsandbytes 8/4-bit, overridable and recorded).
- Fails with named reasons for no or empty reference, files changed
  since the reference, tokenizer mismatch, divergence, invalid outputs
  and, with --stock-model, an edit that was not persisted. A
  structural-only check can never pass.
- Versioned report bound to checkpoint digests, prompt-set digest and
  runtime; exit 0 pass, 2 input error, 3 verification failed.
- CPU tests use a tiny local GPT-2 through the real REBIRTH; a CUDA and
  bitsandbytes test runs in the conditional gates.
2026-11-18 11:56:26 -05:00
Joseph Magly 2faab4b6bc feat(mcp): mount the runtime closure of non-FHS interpreters in the sandbox
Let the MCP worker sandbox run Nix/Guix interpreters by mounting exactly
the interpreter's resolved runtime closure, read-only (#521).

- obliteratus/mcp_runtime_layout.py resolves the closure only when the
  interpreter's loader isn't already mounted: the interpreter, its
  loader, stdlib lib-dynload modules and every shared object listed in
  installed distributions' RECORD files, following DT_NEEDED with
  glibc's search order (DT_RPATH chain, LD_LIBRARY_PATH, DT_RUNPATH,
  loader directory; $ORIGIN only).
- Each required /nix/store or /gnu/store path is mounted read-only at
  its original location; other libraries are mounted as single files.
  Never /, a store root, home, tmp, runtime dirs or the checkout;
  store names are validated and every mount stays fd-pinned.
- The sandbox and the supervisor receive only the LD_LIBRARY_PATH
  entries the closure actually used, never the ambient value; FHS hosts
  get none and their mount set is unchanged.
- Bounded parsing and resolution with precise fail-closed refusals; the
  #522 loader refusal still applies to anything unresolved.
- The bubblewrap boundary test now runs and passes under the Nix flake,
  and the worker-boundary and crash-window tests pass there again.
2026-11-17 12:59:21 -05:00
Joseph MaglyandClaude Opus 5.5 5e451b7a92 fix(mcp): fail closed on interpreters whose loader the sandbox can't mount
The MCP worker sandbox mounts interpreter libraries from standard (FHS)
locations only. A Nix-built interpreter's dynamic loader lives under
/nix/store, so bubblewrap failed with an opaque execvp error.

- New obliteratus/mcp_runtime_layout.py reads the interpreter's ELF
  PT_INTERP loader with a bounded program-header parse; malformed or
  non-ELF binaries fail closed.
- _runtime_paths refuses with "unsupported interpreter layout" when the
  loader isn't among the mounted paths; FHS and static interpreters are
  unchanged. runtime_layout_supported() reports the reason.
- The real bubblewrap boundary test skips with that reason on
  unsupported layouts, as it already does without bubblewrap; on FHS
  interpreters it still runs. Mount-construction and supervisor tests
  no longer depend on the host loader layout.
- Unit tests cover real and synthetic ELF loaders, static binaries,
  non-ELF and truncated input, refusal and acceptance.

Full non-FHS support (mounting the runtime closure) is tracked in #521.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:16:36 -05:00
Joseph MaglyandClaude Opus 5.5 ca622d290d fix(aspa): fail closed on unreadable Pareto controller evidence
load_json() caught every exception and returned None, so a truncated,
empty or undecodable ship-gate report looked like missing evidence: the
candidate silently left the leaderboard, the controller recommended the
wrong leader and still exited 0 (#518).

- load_json returns None only for a missing file; read, decode, JSON
  and non-object errors raise UnreadableEvidence with the path and
  reason.
- collect scans every evidence directory, then raises
  UnreadableEvidenceSet listing all unreadable files; corrupt
  interpolation metadata is treated the same way.
- main exits 2, reports each file on stderr and writes no frontier, so a
  ranking is never published from a partial evidence set. Unrelated
  valid JSON in an evidence directory is still ignored.
- Outcome tests cover truncated, empty, binary and non-object reports,
  multiple evidence kinds, missing files, unreadable directory entries
  and corrupt interpolation metadata; the script is registered in the
  test-risk map.

Reported-by: soarkit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 10:25:46 -05:00
Joseph Magly 284d9e09dc Merge pull request #517 from elder-plinius/feat/issue-511
Opt-in numeric geometry preservation evaluation
2026-11-16 22:17:27 -05:00
Joseph Magly 751b05e2c5 Merge pull request #516 from elder-plinius/feat/issue-510
Field-level evidence scoring for structured outputs
2026-11-16 22:11:57 -05:00
Joseph MaglyandClaude Opus 5.5 101cfa7c88 feat(analysis): opt-in numeric geometry preservation evaluation
Add a bounded evaluation of whether shifting a known predictive mean
preserves a known non-target spread (#511), producing reproducible
evidence and negative results rather than a universal steering claim.

- Whole sequences are split into fit, calibration and held-out
  partitions per seed block before any activation is collected.
  Geometry is fitted on fit rows only, matched-mean scales are found on
  calibration rows only, and the preregistration (tolerances, arm
  choices, scales) is frozen by digest before any held-out pass.
- Seven arms with exposed choices and reversible, restoration-checked
  hooks; matched-displacement and matched-mean comparisons are reported
  separately, and PCA-plane proximity can never establish preservation.
- Paired intervals over seed blocks, separate AdamW and L-BFGS probe
  fits (optimizer-dependent outcomes flagged conditional), explicit
  zero handling, separate costs, and exploratory labels for
  extrapolated cells. Curvature stays null.
- Golden synthetic arc fixtures with known answers: a spread-preserving
  variant and a radius-dependent variant the chord arm distorts.
- Every attempted cell, arm and comparison is logged; synthetic runs are
  rated hypothesis and never claim pretrained reproduction. The opt-in
  pretrained campaign refuses until both model revisions are pinned and
  runs only behind an explicit environment flag.
- `obliteratus experiments numeric-geometry`, catalog rows and a new
  documentation section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 22:09:11 -05:00
Joseph MaglyandClaude Opus 5.5 0a1b72c828 feat(concepts): field-level evidence scoring for structured outputs
Add a separately versioned field_evidence evaluator that distinguishes a
valid JSON answer from a grounded one, without changing structured_output
v1 semantics (#510).

- Strict single-document parsing with no repair (duplicate keys,
  non-finite numbers and coercions refused, raw bytes kept); parse,
  schema and content are reported as separate layers.
- Field states PRESENT, EXPLICIT_NULL, UNKNOWN, KNOWN_EMPTY and
  MISSING_KEY; outcomes supported-correct, supported-wrong,
  unsupported-concrete, authorized and unauthorized abstention, missing
  and wrong-type.
- Exact IDs and enums, absolute-plus-relative numeric tolerances with
  declared unit factors, verbatim evidence quotes, and one-to-one array
  alignment with missed, duplicate and spurious items.
- Data-only field policies; source, schema, policy, gold and output
  identities kept distinct so an output can't supply its own oracle.
- The 12 synthetic absent/present fixtures ship as package data, bound
  by hash, and run under required, nullable and tagged-unknown schemas
  (36 cases). Reports include every scheduled case; an outage makes the
  fabrication gate INCOMPLETE, never a pass.
- A registered, never-executed opt-in pilot specification, versioned
  result and pilot schemas, `obliteratus experiments field-eval`, and
  docs/FIELD_EVALUATION.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 22:04:21 -05:00
Joseph MaglyandClaude Opus 5.5 6c2f79672f feat(experiments): matched-precision reasoning controls for backend qualification
Extend backend qualification so precision-induced changes in reasoning
outcomes are separated from intervention effects (#512).

- Precision declarations record weight, activation and KV-cache
  precision, quantizer and calibration identity; incomplete or
  inconsistent declarations are refused.
- A bounded, preregistered pilot protocol fixes candidate, dataset,
  decoding, output budget, seed blocks, final-answer parser, margins,
  drift limit, resource objective and disjoint splits.
- The pilot loads four fresh cells on the same rows: the unedited parent
  and the saved candidate at the CPU float32 reference and at the
  declared precision.
- Per-row outcomes separate final-answer correctness from reasoning and
  total tokens and termination; truncated or unparsable outputs count
  as wrong.
- Paired bootstraps give precision effects within each artifact,
  intervention effects within each precision and their interaction.
  Gates apply per task and pooled, and expose harm hidden by a pooled
  pass. Shared-prefix KL is reported apart from free-running
  disagreement.
- Token cost never gates; an efficiency claim needs every gate to pass
  and the preregistered resource to improve.
- Support matrix schema 2 carries precision fields and pilot attempts;
  pilots never add qualified pairs, and schema 1 records still load.
- `obliteratus experiments qualify reasoning`; CUDA path in the
  conditional gate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 22:03:40 -05:00
Joseph MaglyandClaude Opus 5.5 64c2751216 ci: run the Nix test flake in CI and document it for contributors
Make the committed Nix test environment usable by others and by CI.

- .github/workflows/nix-parity.yml installs Nix from the official
  release installer, pinned by version and SHA-256 (recorded in
  ci/digests.txt; the installer verifies the tarball hashes it embeds),
  checks the flake outputs and runs a parity smoke set on Python 3.12
  and 3.13. Release-gate tests run only on 3.12, the release
  interpreter. It triggers on changes to the flake, lock, pyproject,
  .envrc or the workflow, and on dispatch; it is not a required check.
- .envrc (`use flake`) loads the 3.12 shell for direnv users.
- tests/test_nix_parity_policy.py keeps the flake's uv pin, CI extras,
  non-editable install and marker filter in step with ci.yml, and the
  workflow's action and installer pins in step with ci/digests.txt.
- A nix-test-environment contract surface maps the flake, lock, .envrc,
  workflow and doc to that test.
- docs/NIX_TEST_ENVIRONMENT.md gains direnv and CI sections;
  CONTRIBUTING and README point to the flake, and CONTRIBUTING's
  supported-interpreter line now matches pyproject (3.11+, CI and
  release on 3.11 and 3.12).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 18:09:50 -05:00
Joseph MaglyandClaude Opus 5.5 08a04e3bd4 fix(bayesian): close Optuna SQLite storage and backup connections
On Python 3.13+, an sqlite3 connection that is garbage-collected
without being closed raises ResourceWarning, which the project's
filterwarnings=error turns into test failures. pyproject declares
requires-python >=3.11 with no upper bound, so these versions must work.

- The durable study's RDBStorage is now owned by an ExitStack in both
  public entry points and closed (remove_session, then engine.dispose)
  on success, failure and cancellation.
- _atomic_sqlite_backup closes both handles with contextlib.closing;
  sqlite3's own context manager only ends the transaction.
- Two tests that reopened or connected to study databases now close
  their handles.
- New regression test tracks every sqlite3 handle opened during a real
  durable study (success, failure, KeyboardInterrupt) and the backup,
  asserting all are closed independent of the 3.13+ warning.

Storage URLs, file names, snapshots and resume behaviour are unchanged;
as with any edit to this module, the study identity (which hashes the
module source) changes, so pre-existing durable studies start fresh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 17:43:05 -05:00
Joseph MaglyandClaude Opus 5.5 8170f531eb Merge upstream/main into feat/f21-1116
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:46:52 -05:00
Joseph MaglyandClaude Opus 5.5 7e6e680592 Merge upstream/main into feat/f21-1116
Keep both the arch-profile and regression exit-code rules, each with its
own exit, and both sets of risk-map entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:43:12 -05:00
Joseph Magly 534a568bb0 Merge pull request #506 from elder-plinius/feat/o08-1116
Smaller-change study for mature targets (O08)
2026-11-16 13:43:05 -05:00
Joseph MaglyandClaude Opus 5.5 d71726c417 Merge upstream/main into feat/o08-1116
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:37:42 -05:00
Joseph MaglyandClaude Opus 5.5 35f9d24652 feat(experiments): smaller-change study for mature targets
Add optimization O08: compare the smallest effective edit for a mature
target against broader edits, ordinary rank selection and simple
heuristics, with full cost accounting.

- Only persistent-pilot eligible targets are accepted (fixture results
  marked software-contract); ablation operations only.
- Arms: a broad baseline (registered target plus leading directions),
  variance-only rank, a development rank sweep, operator-declared
  directions, and signal-aware geometry rank, optionally at last-token
  scope.
- Every arm, baseline included, must restore the reference, reproduce
  its temporary edit after reload, meet the useful effect, pass every
  collateral endpoint and qualify on the CPU float32 reference backend.
- Accounting records which resource changes: artifact size, extra
  inference FLOPs per representation (a permanent edit changes none),
  and one-time capture, decomposition, search, build, confirmation and
  qualification costs; latency stays outside the digest.
- A saving is claimed only when total compute is no higher than the
  baseline's in every seed (at least 3); gains are attributed to
  geometry only when no ordinary or heuristic arm matches.
- `obliteratus experiments smaller-change`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:36:50 -05:00
Joseph MaglyandClaude Opus 5.5 122d73bdab Merge upstream/main into feat/f21-1116
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:36:03 -05:00
Joseph MaglyandClaude Opus 5.5 6e34593cd4 Merge upstream/main into feat/f22-1116
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:34:52 -05:00
Joseph MaglyandClaude Opus 5.5 189311e5d0 feat(experiments): regression library and dependency-triggered revalidation
Add F22: versioned regression suites built from confirmed cases,
failures and interaction surprises, with computed staleness when a
dependency changes and append-only re-run history.

- Cases point at the original evidence by path, digest and pointer
  (never copying scores) and record what reproduces them: model and
  weight fingerprint, tokenizer, dataset revision and rows digest,
  scorer versions, backend descriptor and recipe, plus the expected
  outcome with tolerance. Suite versions are write-once and chained.
- A dependency graph covers weights, tokenizer, dataset, scorer,
  backend runtime, directions, report files and artifacts. Staleness is
  computed on read; models match by weight fingerprint, so a same-name
  model with new weights inherits no qualification.
- Re-runs go through each feature's own run function and append to a
  hash-chained results log; regressions link to their case, and history
  stays byte-identical.
- Status and the conditions table report per intervention and condition
  (task, domain, backend, model), with no single aggregate.
- `obliteratus experiments regression build|observe|status|revalidate|run`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:32:01 -05:00
Joseph MaglyandClaude Opus 5.5 abae042774 feat(analysis): architecture adapters, MoE coverage and transfer dossiers
Add F21: architecture adapters that record tensor semantics and staged
support levels, MoE observation with explicit coverage, and transfer
dossiers compared against within-model baselines.

- Adapters record site meaning, block order, norm placement and module
  roles (attention, MLP, router, routed and shared experts) and check
  residual semantics on a real forward. Support is staged:
  observation, then reversible intervention, then persistent editing.
  Dense decoders support all three; sparse MoE decoders support
  observation and residual intervention and refuse persistent editing.
- MoE observation reports per-expert routed tokens and rows with
  intervals; experts below the coverage floor are insufficient coverage
  with null effects, never no effect. Route and load changes, shared
  expert contributions and routing restoration are measured.
- Transfer needs its own alignment-fit and test rows (refused on
  overlap), the same row budget for a direction fitted directly on the
  target, and must beat that baseline and random directions with
  bootstrap intervals. Tested and untested conditions are listed;
  experts listed as tested must be covered on the test rows; new
  modalities need their own targets and scoring tasks.
- `obliteratus experiments transfer run` and `arch-profile`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:31:08 -05:00
Joseph MaglyandClaude Opus 5.5 7294f6b691 Merge upstream/main into feat/f19-1116
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:27:27 -05:00
Joseph MaglyandClaude Opus 5.5 b04906e15c feat(experiments): bounded mutation search with Pareto selection
Add F19: a replayable, budgeted search over qualified operations only,
with an all-attempt ledger, Pareto-first selection and independently
confirmed finalists.

- The space is built from persistent-pilot eligible registrations
  (declared coefficient grids and forms), selected candidates and
  recovered candidates, and complete sequences in their evidenced
  order; anything else is refused. Confirmation and test rows are
  refused for search. The space is write-once and digest-identified.
- Proposals reuse the project's Optuna TPE multi-objective approach
  with per-trial seeding, so replay reproduces the ledger; pruning uses
  the anytime-valid screening rule.
- An append-only, hash-chained ledger records every trial; trial ids are
  content digests, and an interrupted trial is marked incomplete and
  re-run or discarded once. Incomplete trials never win.
- Trials with invalid outputs, failing or unmeasured collateral
  endpoints, or target gains flagged by the weak-scorer check are
  infeasible. The Pareto front is reported before any pre-declared
  aggregate score.
- Finalists must pass a fresh locked confirmation registration created
  after the search and disjoint from development rows; search winner
  and confirmed finalist are reported separately.
- `obliteratus experiments search plan|run|resume|front|confirm`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:26:24 -05:00
Joseph Magly dbb6dada03 Merge pull request #501 from elder-plinius/ci/renew-env-waivers-1116
Renew no-support environment waivers to 2026-11-30
2026-11-16 13:14:55 -05:00
Joseph MaglyandClaude Opus 5.5 3caa82923e Merge upstream/main into feat/f20-1116
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:06:43 -05:00
Joseph MaglyandClaude Opus 5.5 458059e066 feat(experiments): backend qualification and support matrix
Start milestone 5 (F20): qualify each saved artifact on an explicit
backend against the CPU float32 reference of the same artifact, and
record exactly which pairs qualify.

- Only fully verified persistent candidates are accepted; each run
  loads the saved artifact fresh from disk on the reference and on the
  declared backend after checking digests.
- Backend descriptors make device, dtype, quantization, attention,
  tokenizer and cache mode explicit; their digest is the backend id, so
  native and quantized results are separate rows.
- Paired evaluation on independent rows checks realized settings,
  target rate, completion agreement, logit and site-activation drift and
  collateral endpoints. Latency and memory stay outside the digest.
- Unsupported combinations are recorded unsupported without loading or
  falling back; unavailable hardware is refused and leaves the pair
  untested. Failures are permanent and block broader claims.
- A versioned support matrix lists exactly the qualified pairs. CUDA
  tests run in the cuda-runtime conditional gate.
- `obliteratus experiments qualify run|matrix`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:05:58 -05:00
Joseph MaglyandClaude Opus 5.5 3153af08a3 ci: renew the five no-support environment waivers to 2026-11-30
The cuda-runtime, bitsandbytes-runtime, mps-runtime, mlx-runtime and
remote-execution waivers expired on 2026-11-16. Renew them from
2026-11-16 through 2026-11-30, within the 30-day maximum, with reasons
and blocked claims unchanged. No GitHub self-hosted lane is registered
yet; issue #110 stays open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:05:38 -05:00
Joseph MaglyandClaude Opus 5.5 d0433a5734 Merge upstream/main into feat/f18-1116
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:50:33 -05:00
Joseph MaglyandClaude Opus 5.5 7a759eee4a Merge upstream/main into feat/f17-1116
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:42:56 -05:00
Joseph MaglyandClaude Opus 5.5 b97599c091 Merge upstream/main into feat/f18-1116
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:41:55 -05:00
Joseph MaglyandClaude Opus 5.5 90e3ca55de feat(experiments): recovery tuning for persistent candidates
Add F18: recovery runs that start from a verified persistent candidate
and produce a separate recovered candidate, assessed against both the
edited candidate and the pristine reference.

- Only selected, digest-verified, persistent-pilot eligible parents are
  accepted. The output is a write-once removable recovery adapter with
  learning curves; parent and reference are only read and re-checked.
- Recovery data lineage, training configuration and teacher provenance
  (model, revision, weight fingerprint) are recorded and re-hashed
  before assessment.
- Recovery and assessment rows that overlap discovery, dossier
  confirmation data, registered confirmation sets, the parent's
  verification rows or each other are refused before training.
- A reload assessment compares pristine, edited and recovered arms on
  independent rows. Restoring the unwanted target behaviour beyond
  tolerance fails the run permanently; passing needs persisting target
  effect, retained capability versus pristine, no new damage and a
  useful gain.
- Efficiency or freed-capacity claims need matched random-target and
  pristine same-steps controls and must beat both; otherwise they are
  unsupported. Loss curves are never reported as mechanism.
- `obliteratus experiments recovery run|verify|show`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:38:05 -05:00
Joseph MaglyandClaude Opus 5.5 1a26c0c850 Merge upstream/main into feat/f17-1116
Resolved shared registration files by keeping both sides.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:34:55 -05:00
Joseph MaglyandClaude Opus 5.5 bdc87ce97a feat(experiments): transactional two-step edit sequences
Add F17: promote only validated two-step edit sequences into a
persistent, resumable executor with tested rollback.

- Components must be verified F16 candidates or persistent-pilot
  eligible registrations, and an F14 interaction result must cover the
  exact order requested; untested orders are refused. Plans are
  write-once and content-addressed, so reversed order is a distinct
  identity.
- Each step saves a checkpoint plus ordered adapters and records input
  and output identities, order, file digests, intermediate target and
  collateral results, failure state and recovery path. A reloaded step
  must reproduce the composed temporary operations, keep every applied
  component's effect and pass collateral endpoints.
- A crash leaves an incomplete step that resume discards before
  continuing from the last verified step; incomplete sequences can't be
  published. A failed step is permanent and never selected.
- Rollback restores the reference or a verified step by digest-checked
  copy and reload, never by applying an inverse edit.
- `obliteratus experiments sequence plan|run|resume|rollback|show`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:34:03 -05:00