How to Preserve Failed Gate Attempts in an IOSM Cycle
A quality gate does not become trustworthy when it turns green. It becomes trustworthy when I can explain every attempt that led to green.
IOSM deliberately sends control back to the same phase when a gate fails. The specification also limits the number of phase iterations and requires a phase report for each evaluation. That creates a subtle storage problem: if a tool keeps only the latest report, a successful retry can overwrite the evidence that caused the retry.
The final state says pass: true. The engineering history says something richer: attempt one failed, remediation changed a bounded part of the system, attempt two used new evidence, and only then did the gate pass. Losing that sequence converts an improvement cycle into a mutable dashboard.
I would model the sequence as a gate-attempt ledger.
A gate result is an event, not a field
A compact cycle report needs the current state of each gate. That is useful for navigation, but it is not enough for audit.
Consider this apparently harmless representation:
{
"gate_I": {
"pass": true,
"report": "phase-reports/improve.json"
}
}
If improve.json is rewritten on every retry, three different questions collapse into one file:
- What did the gate observe?
- What changed after it failed?
- Why is the current result allowed to replace the previous decision?
The answer is not to make the cycle report enormous. The cycle report should remain an index. The attempt history should be append-only and addressable.
phase-reports/improve/
├── attempt-001.json
├── attempt-002.json
└── current.json # pointer or generated projection
current.json may point to attempt two. It must not pretend attempt one never existed.
This extends the same principle I used in evidence binding: a decision should identify its exact inputs. Here the missing identity is temporal. We need to know which evaluation occurred before which remediation.
The attempt receipt
I would keep each receipt small enough to inspect and strict enough to validate:
{
"cycle_id": "cycle-2026-08-05-01",
"phase": "IMPROVE",
"gate": "gate_I",
"attempt": 2,
"started_at": "2026-08-05T13:02:11Z",
"evaluated_at": "2026-08-05T13:06:44Z",
"input_revision": "sha256:...",
"policy_revision": "sha256:...",
"evidence_manifest": "evidence/gate-I-002.json",
"result": "pass",
"violations": [],
"supersedes": "gate-I-attempt-001",
"remediation": "remediation/rem-001.json"
}
The important fields are not decorative metadata.
input_revisionbinds the evaluated system state. A rerun against changed code is a new attempt, not a recheck of the old one.policy_revisionprevents a threshold change from masquerading as a system improvement.evidence_manifestbinds the result to measurements rather than a prose summary.supersedescreates an explicit lineage without deleting the previous record.remediationstates what was intentionally changed between attempts.
The W3C PROV data model makes a useful distinction here: entities can be generated by activities, derived from prior entities, and invalidated without being erased from provenance. IOSM does not need to adopt RDF to use that idea. Immutable attempt records plus explicit derivation edges are enough.
Retry needs a change contract
A retry with identical inputs is not remediation. It is repetition.
Before the runtime admits another gate attempt, it should compare four identities:
| Identity | If unchanged | If changed |
|---|---|---|
| system input | repeated evaluation | candidate remediation |
| gate policy | same decision rule | policy migration or waiver path |
| evidence set | evidence replay | evidence refresh |
| hypothesis/scope | same claim boundary | re-plan the cycle |
This table prevents a common category error. Fresh evidence can justify a new attempt without a code change. A code change can justify a new attempt even when the policy is stable. But changing the policy, scope, and implementation together destroys attribution. The runtime can no longer tell what made the gate pass.
That is why a remediation record should declare one primary transition:
remediation_id: rem-001
triggered_by: gate-I-attempt-001
change_class: implementation
allowed_paths:
- src/auth/validator.ts
protected:
- public/auth-contract.json
expected_effect:
logic: remove invariant violation INV-17
recheck:
- INV-17
- contract-compatibility
This is narrower than a new Hypothesis Card. The hypothesis explains why the cycle should improve the system. The remediation explains why one failed phase attempt deserves another evaluation.
A deterministic admission rule
The runtime can decide whether a retry is legitimate before spending another agent run:
ADMIT_RETRY(previous, candidate):
require previous.result == fail
require candidate.attempt == previous.attempt + 1
require candidate.remediation.triggered_by == previous.id
require exactly one primary change class
require protected boundaries still match
require evidence identities are complete
reject if all compared identities are unchanged
branch the cycle if hypothesis or scope changed materially
The last rule matters most. A phase retry is allowed to repair execution within the current claim boundary. It should not quietly replace the claim.
If the expected outcome, target metric, or cycle scope changes, I would create a new hypothesis revision or a child cycle. The old attempt remains a valid negative result. This aligns with the stop contract: continue, revise, accept, and terminate are different engineering decisions, not synonyms for “try again.”
Keep policy changes out of the success path
Threshold changes are especially dangerous during remediation. Suppose Gate O fails because p95 latency exceeds its configured maximum. Lowering the requirement—or attaching a waiver—may permit progression, but it does not prove that optimization succeeded.
The ledger should therefore distinguish:
pass: the candidate satisfies the same effective policy;waived: a recorded exception permits progression;policy_changed: the decision boundary changed and requires separate approval;inconclusive: evidence is incomplete or incomparable;fail: the candidate violates the effective policy.
A boolean can still exist in the generated cycle summary, but it must be derived from one of these explicit states. A waived gate must never be rendered as an ordinary pass.
This also connects to rollback rehearsal. If remediation makes the system worse, the ledger identifies the exact candidate revision and the checkpoint that preceded it. Recovery is no longer based on “the last known good state” as a vague phrase; it is a graph edge.
What this mechanism does not prove
An immutable ledger proves sequence and identity only if the runtime captures those identities correctly. It does not prove that a metric is meaningful, that a test covers the real risk, or that an operator chose the right remediation. Cryptographic digests protect addressability, not judgment.
The current IOSM v1.0 schema records final gate status, and the normative orchestrator describes bounded attempts and saved phase reports. The gate-attempt ledger is my implementation-level extension for preserving that history; it is not a claim that the present schema already requires these exact fields.
That boundary is useful. IOSM should specify the semantics: failed gates return control, retries are bounded, evidence persists, and waivers remain visible. A runtime can then implement the history as JSON files, database rows, or an event stream—as long as it cannot rewrite failure into success after the fact.
Green is the end of a chain
I do not want a green gate that asks me to trust the latest file. I want a green gate that can show its ancestry.
The final report may stay concise:
Gate I: PASS
current_attempt: gate-I-attempt-002
previous_attempts: 1
remediation: rem-001
policy_changed: false
One line for the operator. A complete chain for the engineer.
That is the balance I want from IOSM: compact decisions on the surface, immutable engineering state underneath. A failed attempt is not noise to clean up. It is the evidence that the next attempt had something specific to repair.