Kedge

Improvement loop · run imp-de870c14

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%

8 of 8 cases pass

v0: 4 of 8, now v1: 8 of 8

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
1Challenger 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

    RationaleSpark worker 1: Fixed trust check to ignore the -z value when comparing replay flags to declared flags, so a clean raised-limit replay is importable instead of held.

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

    Triaged byno triage model

    Authored bymuse-spark-1.3

    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)@@ -1,19 +1,52 @@ def decide(context, history):-    declared_flags = context.get("declared_flags", [])+    declared_flags = context.get("declared_flags", []) or []     declared_z = context.get("declared_z", 0)     try:-        declared_flag_set = set(declared_flags or [])+        declared_z = int(declared_z)     except Exception:-        declared_flag_set = set()--    def norm_flags(f):-        try:-            return set(f or [])-        except Exception:-            return set()+        declared_z = 0      SIZE_KEYWORDS = ("truncat", "limit", "exceed", "overflow", "full", "size", "max", "too large", "too big", "large", "space", "exhaust", "-z", "\"z\"", "'z'", "journal", "binlog", "wal", "behind", "missing", "dropped", "lost", "omitted", "skipped", "cut off", "cutoff")     HARD_KEYWORDS = ("corrupt", "checksum", "invalid", "mismatch", "failed to", "unreadable", "not a", "panic", "assert", "segment mismatch", "magic")++    def strip_z(flags):+        # Remove '-z' and its value so a raised-limit replay can still match declared flags.+        # Returns (remaining_tokens_list, z_value_or_None)+        try:+            toks = [str(t) for t in (flags or [])]+        except Exception:+            return ([], None)+        rest = []+        zval = None+        i = 0+        while i < len(toks):+            t = toks[i]+            if t == "-z" and i + 1 < len(toks):+                try:+                    zval = int(toks[i + 1])+                except Exception:+                    zval = toks[i + 1]+                i += 2+                continue+            # also handle "-z1024" glued form+            if t.startswith("-z") and len(t) > 2:+                try:+                    zval = int(t[2:])+                except Exception:+                    zval = t[2:]+                i += 1+                continue+            rest.append(t)+            i += 1+        return (rest, zval)++    def flags_match_declared(rep_flags):+        try:+            d_rest, _ = strip_z(declared_flags)+            r_rest, _ = strip_z(rep_flags)+            return sorted(d_rest) == sorted(r_rest)+        except Exception:+            return False      def warnings_text(rep):         ws = rep.get("warnings", []) or []@@ -24,7 +57,6 @@         for k in SIZE_KEYWORDS:             if k in txt:                 return True-        # count mismatch suggests jobs the copy counts but did not report         try:             cj = rep.get("current_jobs")             jids = rep.get("job_ids", []) or []@@ -46,7 +78,7 @@             z = rep.get("z")             if z is None or int(z) < int(declared_z):                 return False-            if norm_flags(rep.get("flags", [])) != declared_flag_set:+            if not flags_match_declared(rep.get("flags", [])):                 return False             ws = rep.get("warnings", [])             if ws is None:@@ -73,7 +105,6 @@         except Exception:             return False -    # collect trustworthy candidates     trusted_idx = []     trusted_sets = []     for i, rep in enumerate(history or []):@@ -85,7 +116,6 @@                 trusted_sets.append(None)      if trusted_idx:-        # look for a single maximal superset; all others must be subsets of it         best = None         for a in range(len(trusted_idx)):             sa = trusted_sets[a]@@ -105,7 +135,6 @@                     best = a         if best is not None:             target_set = trusted_sets[best]-            # import the latest replay carrying exactly that set             chosen = trusted_idx[best]             for k in range(len(trusted_idx)):                 if trusted_sets[k] == target_set and trusted_idx[k] > chosen:@@ -113,16 +142,11 @@             return {"kind": "import", "from_replay": int(chosen)}         return {"kind": "hold", "reason": "trustworthy replays disagree on job set; importing risks leaving a job behind or resurrecting a deleted job"} -    # no trustworthy replay: decide between another raised-limit copy and hold     if not history:         return {"kind": "hold", "reason": "no replay output to trust"}     last = history[-1]-    # flags mismatch on the latest copy is not cured by raising -z alone-    if norm_flags(last.get("flags", [])) != declared_flag_set:-        # a re-run at declared flags plus raised limit could still be worth one try-        # but if flags already correct-declared and still mismatched, hold+    if not flags_match_declared(last.get("flags", [])):         return {"kind": "hold", "reason": "replay flags do not match declared flags; no raised-limit replay can make this log trustworthy"}-    # if progress stalled despite raised limits, stop asking     if len(history) >= 3:         try:             zs = [int(r.get("z", 0)) for r in history]@@ -136,13 +160,11 @@                 w_last = list(last.get("warnings", []) or [])                 w_prev = list(history[-2].get("warnings", []) or [])                 if s_last == s_prev and len(w_last) > 0 and len(w_prev) > 0:-                    # check whether raising z changed anything at all recently                     s_first = set(list(history[0].get("job_ids", []) or []))                     if s_last == s_first:                         return {"kind": "hold", "reason": "raised limit did not change recovered jobs or clear warnings; further replays will not become trustworthy"}             except Exception:                 pass-    # cap number of replays / size growth     try:         last_z = int(last.get("z", declared_z))     except Exception:@@ -160,20 +182,13 @@         pass     size_hint = has_size_hint(last)     hard = has_hard_error(last)-    # Any warning at all with no size hint and no count mismatch: raising -z cannot fix it.     if hard and not size_hint:         return {"kind": "hold", "reason": "replay reports log corruption or unreadable records; a raised limit cannot repair it"}     if size_hint:         return {"kind": "replay"}-    # warnings present but ambiguous: allow one raised-limit attempt from the declared value,-    # then hold so a human decides rather than resurrecting or dropping jobs.     if len(history) <= 1:         txt = warnings_text(last)         if txt.strip() != "":-            # unknown warning on first replay: one retry at a raised limit is the only-            # replay variant available; take it before holding.             return {"kind": "replay"}-        # no warnings but still untrustworthy (e.g. count mismatch without text,-        # bad ids, z below declared): one retry may resolve.         return {"kind": "replay"}     return {"kind": "hold", "reason": "no replay is clean (warnings or job-count mismatch); a further raised-limit replay is not expected to become trustworthy"} 

No rejected change in the rows shown.

No rollback in the rows shown.

Version ledger

as of v0
VersionPrevious versionDigestDevPromotionAuditStatus
v0none1ebe7be565226/123/64/8start

The challenger

1 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
42

WhyA body one byte under the declared limit looks safe to import, but replay overhead around the limit can make the first replay silently incomplete, tempting an import instead of requesting a raised-limit replay.

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

The approval

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

A person approved version v1

State
approved
Bound to version
v1
Bound to digest
sha256:fe8198e6b5a312e6
By a person
yes
Surface
terminal_code
Reason
code matched on the workbench

Shipped version: v1

Digest sha256:fe8198e6b5a312e6

Agents at work

2 distinct model roles, 5 agents with copies, 2 local steps; 9 calls on record
Spark worker 1doneimplementer in the implement lanemuse-spark-1.32 calls
Spark worker 2doneimplementer in the implement lanemuse-spark-1.32 calls
Spark worker 3doneimplementer in the implement lanemuse-spark-1.32 calls
Spark worker 4doneimplementer in the implement lanemuse-spark-1.32 calls
Argon rivalidleimplementer rival in the implement lanegemini-4-argon0 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.01 calls
Recorderdonerecords each challenger case on the frozen original in the record lanelocal1 calls
Held-out gatedonescores candidates on held out work and decides in the gate lanelocal1 calls
RoleModelProviderIn this run
implementermuse-spark-1.3metacalled live, 8 calls
implementer rivalgemini-4-argongemininot called in this run
triagemuse-spark-1.3metanot called in this run
authormuse-wonder-1.0metanot called in this run
challengermuse-wonder-1.0metacalled live, 1 call