Files
OBLITERATUS/docs/TRANSACTIONAL_SEQUENCES.md
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

7.1 KiB

Transactional edit sequences

A sequence applies two validated edits in a fixed order, A then B, as a chain of saved artifacts. Every step is reloaded from disk and measured before the next step starts. A sequence counts as complete and selected only after both steps and a final reload verification pass. Only two-step sequences are supported.

obliteratus experiments sequence plan candidate:<run>@sha256:<A> candidate:<run>@sha256:<B> \
    --store ./sequences-store --source ./models/reference \
    --interaction ./observations/<digest>/interactions/<spec>/attempts/0001/result.json \
    --pack ./packs/verification --revision sha256:<revision> --role select
obliteratus experiments sequence run sha256:<sequence> --store ./sequences-store
obliteratus experiments sequence resume sha256:<sequence> --store ./sequences-store
obliteratus experiments sequence rollback sha256:<sequence> --store ./sequences-store \
    --to reference --dest ./restored
obliteratus experiments sequence show [sha256:<sequence>] --store ./sequences-store
from obliteratus.experiments.sequence import plan_sequence
from obliteratus.experiments.sequence_run import run_sequence, show
from obliteratus.experiments.sequence_rollback import rollback

plan = plan_sequence(store, [{"run": run_a, "candidate": a}, {"run": run_b, "candidate": b}],
                     "models/reference", "result.json", dataset)
run_sequence(store, plan["id"])                 # or resume=True after an interruption
rollback(store, plan["id"], "reference", "restored")

Admission

plan refuses the pair unless:

  • each component is a selected persistent candidate (every verification passed; see docs/PERSISTENT_CANDIDATES.md) or a confirmation registration whose key is persistent-pilot eligible, and its key still passes that gate. Candidates must be activation_adapter or weight_edit, and must have been built from the selected reference. A weight edit cannot follow an activation adapter, because it would run before the adapter;
  • a verified interaction result (docs/INTERACTION_EXPERIMENTS.md) matches both components (dossier, hypothesis digest, estimate, operation and coefficient) and measured exactly this order. A result that ran only A>B admits A>B and refuses B>A. The plan records the interaction and order-sensitivity outcomes per task, order_dependence and order_pinned. These are descriptive;
  • both components share the model, tasks and decoding, and the evaluation rows differ from the interaction result's rows.

The plan is written once to <store>/sequences/<id>/plan.json (schema obliteratus.edit-sequence-plan, version 1). Its id is the canonical digest of the frozen content: components in order, reference file digests, interaction evidence, dataset and tolerances (target_rate 0.05, agreement 0.95, logit_atol 1e-4 by default). Reversing the order gives a different id. Planning the same content again returns the existing plan.

Steps

Each step writes steps/NN/artifact/, a stack made of a base checkpoint and ordered activation adapters (stack.json):

  • a candidate's activation adapter is copied and checked against the candidate's artifact digests. Loading wraps the site module in order, so B acts on A's output, as B's hook does in the interaction experiment's A>B;
  • a candidate weight edit on the reference is the candidate's edited copy. On an edited parent, the edit is recomputed from the re-derived target on the parent's weights and saved as a new copy;
  • a registration component writes an activation adapter at its registered decision coefficient.

Before any step runs, each component's target is re-derived from its registered recipe on the reference, and a candidate whose saved direction differs from that target is refused. The evaluation rows must be independent of every component's discovery data, its dossier confirmation data and every registered confirmation set. For step k, using greedy decoding, the session measures the reference, the reference with the temporary operations of steps 1..k installed in order (with a restoration check afterwards), and the step artifact reloaded from disk. The step passes when:

  • reproduces_composed_temporary, completion_agreement and probe_logits are within tolerance;
  • intended_effects: every applied component's target-task effect against the baseline meets its threshold in its declared direction;
  • collateral_endpoints: every task no applied component targets, and each target task's invalid-output endpoint, is PASS at the strictest applied collateral margin;
  • reference_restored: the reference is unchanged after the temporary arm.

steps/NN/step.json (schema obliteratus.edit-sequence-step) is written last. It records the input identity (the reference identity, or the previous step's output identity), the output identity (a digest over parent, position, component, artifact digest and loaded parameter/buffer state), the stack and every file digest it loads, the order, the checks, rates against the baseline, the temporary arm and the parent, scorecards, completions, the dataset and independence evidence, and the recovery path.

Failure, resume and publication

  • A step that fails its measurement marks the sequence failed for good. A failed sequence is never resumed, published or selected.
  • A crash is not a failure. A step directory without step.json was never verified. resume discards it, checks every completed step's chain and artifact digests and that the reference is unchanged, and checks that the reference reproduces the recorded baseline. It then continues from the last completed step. run refuses a sequence that has already started.
  • After the last step, the final verification reloads the final stack on its own. It repeats the composed-temporary comparison and checks the last step's completions, loaded state and file digests. It is stored as verification/verification.json.
  • published.json is written once, only when every step and the final verification passed. show reports planned, incomplete, failed, complete (selected) or invalid. A sequence is invalid when a step record, an artifact or the published record has changed since it was written.

Rollback

rollback --to reference|<step> copies a known artifact into a new directory: the reference files, or a passed step's base checkpoint and adapters. Every restored file must have its recorded SHA-256. The copy is then loaded and run on the plan's rows: its loaded state must equal the recorded state and its completions must equal the recorded completions. Each attempt is stored as rollbacks/NNNN.json. Rollback never applies an inverse edit, because under finite precision an inverse edit need not restore anything. Neither rollback nor anything else in a sequence writes to the reference.

Limits

Only sequences of two steps are supported, and only the activation-adapter and weight-edit forms. LoRA candidates are refused. Results hold only for the tested model, components, order, coefficients and rows. Deployment qualification on other backends is a separate step.