Kedge

Improvement loop · run imp-69aef6f6

LIVEfinishedCurrent version v1

Port the cutover import decision for a message queue: decide what to import from what the old queue shows after a restart, without ever seeing its ledger.

Dev pass rate

100%

12 of 12 cases pass

v0: 6 of 12, now v1: 12 of 12

The cases the loop learns from.

Promotion pass rate

100%

6 of 6 cases pass

v0: 3 of 6, now v1: 6 of 6

Held out. A change must gain here to be adopted.

Audit pass rate

100%

9 of 9 cases pass

v0: 5 of 9, now v1: 9 of 9

Held out and checked last. A regression here rolls back.

The counters

Read from the run record, which derives them from its own changes, rollbacks and challenges.

1Proposed
1Adopted
0Rejected
0Rolled back
2Challenger cases

Version timeline

1 events

Each change starts from one failing case. It is adopted only when the held-out gate confirms it, and rolled back when audit regresses.

  1. 01 / 01artifactChange c1: v0 to v1adoptedLIVE

    Failing casez1024-z-1-seed1

    What went wrongheld although a clean replay existed

    RationaleArgon rival: Strips the `-z` option and its argument when comparing replay flags against `declared_flags` so replays at raised `-z` limits are recognized as matching. Also allows a clean replay at a higher `-z` to lack jobs that appeared in an earlier truncated replay, because aborting WAL recovery early on a too-big job skips subsequent delete records for earlier jobs.

    Predicted effectz1024-z-1-seed1 passes under the current kit

    Triaged byno triage model

    Authored bygemini-4-argon

    ShardBase v0Candidate v1Dev6/1212/12Promotion3/66/6Audit4/77/7

    adopted promotion gains 3/6 to 6/6 with no regression; audit 7/7 with no audit regression

    Show the diff
    --- decide.py (current)+++ decide.py (candidate)@@ -3,24 +3,56 @@     declared_flags = (context or {}).get("declared_flags", [])     if declared_flags is None:         declared_flags = []-    try:-        declared_flags_set = set(declared_flags)-    except TypeError:-        declared_flags_set = None++    def strip_z_flags(flags):+        if not flags:+            return []+        out = []+        i = 0+        fl = list(flags)+        while i < len(fl):+            tok = str(fl[i])+            if tok == "-z":+                i += 2+                continue+            if tok.startswith("-z") and len(tok) > 2:+                i += 1+                continue+            out.append(tok)+            i += 1+        return out++    base_declared_flags = strip_z_flags(declared_flags)+     n = len(history) if history else 0     if n == 0:         return {"kind": "hold", "reason": "no replay available"}      def flags_of(r):-        return r.get("flags", [])+        return r.get("flags", []) or []      def flags_match(r):-        if declared_flags_set is None:-            return True-        try:-            return set(flags_of(r) or []) == declared_flags_set-        except TypeError:-            return list(flags_of(r) or []) == list(declared_flags or [])+        rf = flags_of(r)+        if strip_z_flags(rf) != base_declared_flags:+            return False+        z_val = r.get("z")+        if z_val is not None:+            fl = list(rf)+            for i, tok in enumerate(fl):+                s = str(tok)+                if s == "-z" and i + 1 < len(fl):+                    try:+                        if int(fl[i + 1]) != int(z_val):+                            return False+                    except Exception:+                        return False+                elif s.startswith("-z") and len(s) > 2:+                    try:+                        if int(s[2:]) != int(z_val):+                            return False+                    except Exception:+                        return False+        return True      def warnings_of(r):         w = r.get("warnings", [])@@ -36,22 +68,61 @@         except Exception:             return False -    RETRY_SUBS = ("too big", "too large", "too-big", "too-large", "exceed", "larger than", "greater than", "limit", "max job", "max-job", "-z", " size", "size ", "truncat", "skip", "ignor", "dropp", "omit")+    RETRY_SUBS = (+        "too big",+        "too large",+        "too-big",+        "too-large",+        "exceed",+        "larger than",+        "greater than",+        "limit",+        "max job",+        "max-job",+        "-z",+        " size",+        "size ",+        "truncat",+        "skip",+        "ignor",+        "dropp",+        "omit",+    )++    FATAL_SUBS = (+        "corrupt",+        "invalid",+        "bad ",+        "unexpect",+        "short read",+        "eof",+        "checksum",+        "crc",+        "magic",+        "version",+        "permission",+        "denied",+        "no such",+        "i/o",+        "io error",+        "out of memory",+        "oom",+        "unknown",+        "malform",+    )      def is_retryable(r):         ws = warnings_of(r)-        # count says more jobs exist than listed -> truncated listing-        try:-            if int(r.get("current_jobs")) > len(jobs_of(r)):-                return True-        except Exception:-            pass+        has_retry = False         for line in ws:             s = str(line).lower()+            for f in FATAL_SUBS:+                if f in s:+                    return False             for sub in RETRY_SUBS:                 if sub in s:-                    return True-        return False+                    has_retry = True+        return has_retry      def is_clean(i):         r = history[i]@@ -61,7 +132,6 @@             return False         if not flags_match(r):             return False-        # job ids must be unique ints         j = jobs_of(r)         try:             if len(set(j)) != len(j):@@ -75,48 +145,19 @@     last_clean = is_clean(n - 1)     last_retry = is_retryable(last) -    # Latest replay is clean: import it if consistent with prior clean replays.     if last_clean:-        # all clean replays must be mutually consistent (equal sets);-        # otherwise we cannot trust any of them.         last_set = set(jobs_of(last))         for i in clean_idx:             if set(jobs_of(history[i])) != last_set:-                # If sets grow monotonically and earlier ones were clean but-                # smaller, the earlier "clean" missed jobs silently; the-                # largest is still the only candidate, but silent miss means-                # cleanliness is unreliable. Hold unless the only difference-                # is explained by a raised -z (monotonic superset).-                # Require monotonic superset chain ending at last; else hold.-                pass-        # verify monotonic superset chain for clean replays ordered by z-        # if a clean replay has jobs not in last, last is missing jobs -> hold-        for i in clean_idx:-            s = set(jobs_of(history[i]))-            if not s.issubset(last_set):-                return {"kind": "hold", "reason": "clean replays disagree; possible resurrected or missing jobs"}-        # if any non-clean replay reports a job id not in last, last missed it-        # (only when that replay's flags match, else ignore)-        # To avoid importing a subset, hold in that case.+                return {"kind": "hold", "reason": "clean replays disagree on job set"}         for i in range(n):-            if i in clean_idx:-                continue-            if not flags_match(history[i]):-                continue-            # if the unclean replay was retryable (truncated) its set should be subset;-            # if it contains extras, last is incomplete-            try:-                s = set(jobs_of(history[i]))-            except TypeError:-                continue-            if not s.issubset(last_set):-                return {"kind": "hold", "reason": "another replay shows jobs missing from latest clean replay"}+            if i not in clean_idx and not is_retryable(history[i]):+                return {"kind": "hold", "reason": "earlier replay had non-size fatal errors or mismatches"}         return {"kind": "import", "from_replay": n - 1} -    # Latest replay is not clean.     if last_retry:-        # Raising -z may still help. Detect futility: z not increasing or-        # job set stagnant across increases -> hold.+        if not count_ok(last) or not flags_match(last):+            return {"kind": "hold", "reason": "replay has flag or job count mismatch alongside warnings"}         if n >= 2:             try:                 z_prev = int(history[n - 2].get("z"))@@ -125,38 +166,16 @@                 z_prev = None                 z_last = None             if z_prev is not None and z_last is not None and z_last <= z_prev:-                return {"kind": "hold", "reason": "size-limit warning persists without raised -z; no trustworthy replay obtainable"}-            # if z increased but job set and warnings identical, further raises unlikely to help after repeats+                return {"kind": "hold", "reason": "size-limit warning persists without raised -z"}             if n >= 3:                 try:-                    sets = [set(jobs_of(history[k])) for k in range(n - 3, n)]                     warns = [tuple(map(str, warnings_of(history[k]))) for k in range(n - 3, n)]-                    if sets[0] == sets[1] == sets[2] and warns[0] == warns[1] == warns[2]:-                        return {"kind": "hold", "reason": "repeated replays at raised limits show no progress"}+                    if warns[0] == warns[1] == warns[2]:+                        return {"kind": "hold", "reason": "repeated replays at raised limits show identical warnings"}                 except Exception:                     pass-            # gentle cap: many attempts with no clean replay -> hold-            if n >= 6:-                return {"kind": "hold", "reason": "too many replays without a clean result"}+            if n >= 8:+                return {"kind": "hold", "reason": "too many replays without reaching a clean replay"}         return {"kind": "replay"} -    # Latest is fatal (non-size warnings, count mismatch, or flag mismatch).-    # If an earlier clean replay exactly matches latest job set and latest only-    # adds benign-seeming noise, we could still import it; but in general a-    # fatal latest means completeness cannot be established -> hold.-    # Narrow exception: latest z overshoots (too large) while an earlier clean-    # exists with identical job set -> import the earlier clean one.-    if clean_idx:-        try:-            last_set = set(jobs_of(last))-            for i in reversed(clean_idx):-                if set(jobs_of(history[i])) == last_set and count_ok(history[i]) and not warnings_of(history[i]):-                    # only allow fallback when latest failure looks like overshoot, not corruption-                    s = " ".join(map(str, warnings_of(last))).lower()-                    if ("too large" in s or "too big" in s or "exceed" in s or "maximum" in s or "limit" in s) and not count_ok(last):-                        return {"kind": "import", "from_replay": i}-                    break-        except Exception:-            pass-        return {"kind": "hold", "reason": "latest replay untrustworthy; earlier clean replay cannot be proven complete"}-    return {"kind": "hold", "reason": "latest replay reports errors that raising -z cannot fix"}+    return {"kind": "hold", "reason": "latest replay is unclean and cannot be resolved by raising -z"} 

No rejected change in the rows shown.

No rollback in the rows shown.

Version ledger

as of v1
VersionPrevious versionDigestDevPromotionAuditStatus
v0noneac68bfcf55556/123/65/9start
v1v0222398f7183212/126/69/9current

The challenger

2 proposed

A separate model writes new held-out cases from the protocol text alone. It never sees the implementer's context, so the audit pool grows in ways the loop can't tune to.

Challenge ch1LIVE

Modelmuse-wonder-1.0

What it proposed

z
4096
pad
z-1
seed
73

WhyA job one byte under the declared limit can still be lost on same-limit replay, so a naive at-or-under-is-safe rule would import an incomplete set instead of replaying at a raised limit.

RecordedYes, as case ch1-z4096-z-1-seed73 in the audit shard.

Challenge ch2LIVE

Modelmuse-wonder-1.0

What it proposed

z
4096
pad
z-2
seed
73

WhyA body two bytes under the limit fits once replay-side line overhead is counted, so ports that treat every near-limit job as dropped should wrongly replay or hold instead of importing the first replay.

RecordedYes, as case ch2-z4096-z-2-seed73 in the audit shard.

The approval

Shipping a version needs a person's approval, bound to that version's digest. No agent may approve.

The approval for version v1 expired

State
expired
Bound to version
v1
Bound to digest
sha256:222398f71832280d
By a person
no
Reason
the code expired unused

No version has shipped

A version ships only after a person approves it.

Agents at work

3 distinct model roles, 6 agents with copies, 2 local steps; 8 calls on record
Spark worker 1doneimplementer in the implement lanemuse-spark-1.31 calls
Spark worker 2doneimplementer in the implement lanemuse-spark-1.31 calls
Spark worker 3doneimplementer in the implement lanemuse-spark-1.31 calls
Spark worker 4doneimplementer in the implement lanemuse-spark-1.31 calls
Argon rivaldoneimplementer rival in the implement lanegemini-4-argon2 calls
Triageidlelabels a failure with one kind of kit change in the triage lanemuse-spark-1.30 calls
Authoridlewrites one kit change in the author lanemuse-wonder-1.00 calls
Challengerdonewrites held out cases from the task text alone in the challenge lanemuse-wonder-1.02 calls
Recorderdonerecords each challenger case on the frozen original in the record lanelocal2 calls
Held-out gatedonescores candidates on held out work and decides in the gate lanelocal1 calls
RoleModelProviderIn this run
implementermuse-spark-1.3metacalled live, 4 calls
implementer rivalgemini-4-argongeminicalled live, 2 calls
triagemuse-spark-1.3metanot called in this run
authormuse-wonder-1.0metanot called in this run
challengermuse-wonder-1.0metacalled live, 2 calls