Skip to content

Interventions ​

An intervention changes or removes the declared relation while keeping the frame, the input and the encounter as they are. The plan of trials is derived from the frame alone, before any call.


The trials ​

Each trial is asked quorum times. The full cost is the inputs times the planned trials times quorum, which calls_needed(frame) gives without a call.

TrialWhat changesWhat it testsCost
baselinenothingthe level being explainedquorum calls
repeatnothingwhether that level is stable enough to comparequorum calls
ablationthe anchors are removedrequired influencequorum calls
ablation-<anchor>one anchor removed, the others kept (eachAnchor)how several anchors carry it, as evidence onlyone quorum per anchor
cumulativeanchors plus the spans they may fall back onsupport carried elsewherequorum calls
sham-*as much text of the anchors' kinds (or the kind sham.kind names for one), never an anchor, a bypassed span or a declared fallbackspecificity of the changeone quorum per draw
presentationmapped words renamed in one pass, body and inputwhether wording rather than meaning drives the scorerquorum calls
placementone span moved after another, its text unchangedwhether the structure rather than the meaning drives the scorerquorum calls
inversionthe anchors' sense inverted in their own words; the input left as it iswhether the answer follows the relation's sense, reaching allowed.inversionquorum calls
input-inversionwhat is asked inverted (a case, a question); the evidence left as it iswhether the answer follows what is asked, reaching allowed.inputInversionquorum calls
bypassa named connection is cutno hidden fallback; with allowed.bypass, only that opening clears itquorum calls
controlspans any reader needswhether the scorer can move at all; cooled needs it toquorum calls

A sham never cuts a span declared under cumulative. The frame says that span may carry the relation, so cutting it would test nothing. This is a change to how shams are planned; no kept example's plan changes, as none drew one.

A sham matches the anchors by length in characters, within their kind, so kind is how a frame chooses the unit a sham matches. To cut as many lines as the anchors, give each block a kind that names its line count, such as lines-8.

An anchor that is the only span of its kind gets no sham, so under the default policy its frame is never carried, as plan says before a call. "sham": {"draws": 2, "kind": {"failure": "console"}} draws the shams of the anchor failure from the spans of kind console, and the anchor keeps the kind it has.


What each trial can establish ​

A trial shows something when the answer moves and something else when it holds, and neither settles everything.

TrialA move meansNo move meansWhat it cannot establish
baselinethe starting levelnothing yet: it is what the others are read againstthat the relation matters
repeata split level is unstable at this quorumthe observed level recurredthat the input is representative
ablationthe anchors influenced the outcomeno operative influence herethat another span is not a fallback
ablation-<anchor>that anchor is needed on its ownthe other anchors carry it without this onea category: it is evidence only
cumulativesupport moved elsewherethe initial cut removed the effectcarriage on its own
shamthe scorer responds to irrelevant same-kind textthe ablation's change is more specificthat every possible irrelevant change is controlled
presentationwording drives the observationthe tested wording change is invariantthat all paraphrases are
placementthe span's place drives the observationthe tested move is invariantthat every reordering is
inversionthe answer follows the relation's senseafter a carried ablation, the reading drops the sense: coupled but misalignedthat every way of stating the sense is read
input-inversionthe answer follows what is askedafter a carried ablation, the reading drops what is asked: coupled but misalignedthat every way of asking is read
bypassa hidden connection still carries the relationno tested fallback is visiblereceiving-system materialization
controlthe scorer can move under a required removalthe scorer or task is insensitivethat it moves for the right reason

Bypass and control are different ​

Both cut more than the anchors, but they answer different questions.

  • Bypass: cuts the connection that makes the relation operative, and asks whether some fallback still produces the required outcome. With allowed.bypass, the bypass must land on that designated opening to clear the check; without it, any move from baseline clears it, a weaker claim to state as such.
  • Control: cuts what any competent reader of the task needs, a check that the reader can tell at all. If the ablation and the control both leave the observation, a reader that never moves looks like an idle relation, so under carriage: all-checks a finding is cooled only beside a control that moved.

Presentation is one pass ​

presentation maps words to their replacements and applies the mapping once, longest phrase first, to the body and the input alike, so swaps cannot collapse and chains cannot compound. A mapping that reaches nothing the reader reads would repeat the baseline, and is refused. The tutorial's frame renames three words:

json
"presentation": {
  "quill": "heron",
  "retry_after": "wait_hint",
  "backoff": "pause"
}

Placement is one move ​

placement moves one span to follow another and changes no text, asking what presentation cannot: does a clause's place decide, such as a grant before or after an instruction? A move that changes the level reads as coupled but misaligned, and a move that leaves the order as it is would repeat the baseline, so it is refused. This moves the grant after the audit line:

json
"placement": {"span": "grant", "after": "audit"}

Inversion asks for a direction ​

Every other trial asks whether the answer rests on the anchors; inversion asks whether it follows their sense. It maps phrases of the anchors to their inversions, applied once as presentation is, to the anchors alone: a phrase found in any other span is refused, and the case and question stay as they are. allowed.inversion names what the inverted answer must reach, and the baseline's own label never counts:

json
"interventions": {
  "inversion": {
    "the incident commander approves the restore":
      "the incident commander does not approve the restore"
  }
},
"allowed": {"ablation": ["open"], "inversion": ["Yes", "No", "open"]}

It is read after a carried ablation. An inversion that stays at the baseline, or reaches a label allowed.inversion does not list, is coupled but misaligned; one with no agreed level leaves direction open. It is a change to the method, read only when a frame declares it, so no earlier frame reads differently.

Its limits are three. A who-question may rightly keep its answer when a description of the person is inverted, so a person declares the phrase. A conditional answer reads only as conditional, so an inversion inside its condition does not show at that grain; and it inverts words, so a reader that works on graphs needs its own guard as well.


Input inversion turns what is asked ​

inputInversion maps phrases of the input to their inversions, applied once to each input and never to the evidence: a case negated, or the description in a question. allowed.inputInversion names what the answer may reach, and the reading is the inversion's: a stay, or an outcome the frame does not allow, is coupled but misaligned. A map can swap two phrases in one pass:

json
"inputInversion": {
  "has approved": "has not approved",
  "has not approved": "has approved"
}

An input the map does not reach is asked as it stands, and its level is not read as a stay. Opening is not failing: a negated description often leaves a question open, which the frame allows by listing open.


Each anchor alone says how several carry it ​

With several anchors, the ablation cuts them all at once, so it cannot tell a chain from two routes. eachAnchor also cuts each anchor alone, right after the ablation, as trials named ablation-<anchor>:

json
"interventions": {"ablation": true, "eachAnchor": true}

What they show is evidence only, never a category. Once the ablation has moved the answer, one line says how the anchors carry it:

Each anchor cut aloneThe evidence
every one moves iteach anchor carries it
neither of two moves itthe anchors carry it independently; either suffices
none of three or more moves itno anchor alone is needed; the others carry it without it
some do, some do nots1 carries it; s2 adds nothing alone
one has no agreed levels2 alone has no agreed level

Where the ablation left the answer, an anchor that moves it alone is named as the oddity it is, since cutting more should not move it less. An anchor that adds nothing alone is cited but not needed while the others stand, which is worth seeing before it is worth a rule.

A frame with one anchor that declares eachAnchor is refused, as its one trial would be the ablation again. A bypass that cuts one anchor alone reads the same body as that anchor's trial, and both are asked: the bypass settles no hidden fallback, while the anchor's trial is evidence.


Cost ​

For one input the call count is the planned trials times quorum, and a sham with {"draws": n} adds up to n trials; a draw with no match is left out, and the finding says so. Among spans of the same kind and length, the frame's own seed picks each draw, one span at a time, so a frame with hundreds of such spans takes noticeably longer to plan; varying their lengths or kinds avoids it. This lists the plan and its cost without spending anything:

python
from midwife.pipeline import calls_needed, plan

for trial in plan(frame):
    print(trial.id, len(trial.removed), trial.body_hash)
print("full run:", calls_needed(frame), "calls")

run(..., only={"baseline", "ablation"}) runs a subset. A planned trial left out makes the finding unresolved, so use a partial run for diagnosis, never for a final carried verdict. A one-anchor trial left out is only said to have no agreed level, since it is evidence.


Choosing a useful first set ​

Start small, and add a trial when its question becomes yours.

  • A deterministic scorer: start with repeat, ablation, one sham and presentation.
  • A separate connection: add bypass when a binding line, cut, should expose an opening.
  • A plausible cooled result: add control, which cooled needs.
  • Support that could shift: add cumulative only when support could move to another span rather than disappear.
  • A sampled model: use a quorum of at least three, and decide agree before the run; raising the quorum after seeing labels changes the frame's hash.