Kedge

You can't retire an old service until you can prove no accepted work gets lost in the switch.

BLOCKED
306/306 of its own tests pass.17 accepted messages unaccounted for after cutover.10 finished messages came back.
-z 1024, declaredstock programprocess isolation on the Mac, not a containerPREPARED reference repair: the labelled fallback, never the default
RECORDEDSYNTHETICLeah, integration maintainer

All its own tests pass, and the check measured 17 lost and 10 finished messages back. Scenario messages are SYNTHETIC.

RECORDED REPLAYAn earlier run, replayed to explain. This is not happening live.

01 / 08

The rejection

A replacement that passes every one of its own tests was turned away. It grades its own work. The messages it dropped were never in those tests.

The program being retired

name
beanstalkd stock at 25085c5 (25085c5f090031fd7110613a77fd6f816681d801); its own -v prints 'beanstalkd unknown' because the clone had no tags
licence
MIT-style permissive licence, read from LICENSE (Copyright (c) 2007 The authors of beanstalkd.) sha256:bad1fd0e5c
binary hash
sha256:58d45e6bad82a56bb83d
build kind
stock
flags
/Users/sidra/aie-code-lab/reference/frozen/beanstalkd-25085c5 -l 127.0.0.1 -p {port} -b {recovery_dir} -z 1024 -s 1048576
durability
persistence on; log sync every 50 ms

Stock build, unmodified. The hash above is the frozen binary that ran. Nothing to disclose.

Which rules lost it

PREPARED reference repair: the labelled fallback, never the default. Written by the team with knowledge of the edge, before the run. Live, Gemini Argon writes this repair from the same failing case. The shipped naive mapper and recovery rules are constructed foils, disclosed at the top of mapper.go and rules.go.

Consequences are counted at message level only.

02 / 08

The flip

Workers agree with each other. That counts for nothing until a probe runs against the real original. Then a belief changes, or it does not.

Wonder and Spark investigate. They never write code. 0 of 0 agents listed here worked in this run.

ClaimStateAgreement (never enough)If wrong
H-01 A message accepted at this size survives a kill and restart with the log on, and so does the work after it.INFERREDbecameREFUTED0 concur, 0 dissent (from PREPARED probe design)If wrong, accepted messages vanish in a restart and nothing reports it.
H-02 A body at the -z limit or one byte under it is accepted, then refused on replay, and the rest of that log file is ignored.INFERREDbecameOBSERVED0 concur, 0 dissent (from PREPARED probe design)If right, a recovery that trusts the replay loses pending work and brings finished work back.

The one uncommon part, in the original's own words: sizes and limits

It wrote 3 lines to stderr when it started again

  1. stderr …/recovery/binlog.1:132: job 2 is too big (1025 > 1024)
  2. stderr …/frozen/beanstalkd-25085c5: Errors reading one or more WAL files.
  3. stderr …/frozen/beanstalkd-25085c5: Continuing. You may be missing data.

Its binlog files

filebytes
binlog.11,048,576
lock0
binlog.21,048,576
after the restartbody bytesstill there
The job before yours24yes
Your message1,023gone
The job after yours23gone
-z 1024, declaredprocess isolation on the Mac, not a container

…/frozen/beanstalkd-25085c5 -l 127.0.0.1 -p 51746 -b …/probe-p-prep-sizes-and-limits-z-1/recovery -z 1024 -s 1048576

What the tracer saw on the real original, line by line. Probe P-PREP-SIZES-AND-LIMITS-Z-1 RECORDED pids 78655, 78656 · process isolation on the Mac, not a container

  1. 35 ms binlog after start: binlog.1 1048576 bytes
  2. 35 ms binlog after start: lock 0 bytes
  3. 36 ms binlog after SIGKILL: binlog.1 1048576 bytes
  4. 36 ms binlog after SIGKILL: lock 0 bytes
  5. 71 ms stderr …/recovery/binlog.1:132: job 2 is too big (1025 > 1024)
  6. 71 ms stderr …/frozen/beanstalkd-25085c5: Errors reading one or more WAL files.
  7. 71 ms stderr …/frozen/beanstalkd-25085c5: Continuing. You may be missing data.
  8. 71 ms binlog after start: binlog.1 1048576 bytes
  9. 71 ms binlog after start: binlog.2 1048576 bytes
  10. 71 ms binlog after start: lock 0 bytes

03 / 08

The repair

This is the PREPARED reference repair, the labelled fallback. Live, Gemini Argon writes the repair in an Antigravity builder, from the ledger, and never grades it.

replacement/internal/recovery/rules.go PREPARED PREPARED

diff --git a/replacement/internal/mapper/mapper.go b/replacement/internal/mapper/mapper.go--- a/replacement/internal/mapper/mapper.go+++ b/replacement/internal/mapper/mapper.go@@ -140,15 +140,17 @@ const NaiveCarryTubePause = false  // Active is the shipped table. Each line is independent of the others. A repair edits these lines.+// Repaired (PREPARED reference repair): reserved jobs come back ready, delayed jobs keep the time they+// had left, and tube pauses carry across. var Active = map[string]string{ 	"ready":    "keep_ready",-	"delayed":  "restart_full_delay",-	"reserved": "skip_in_flight",+	"delayed":  "keep_remaining",+	"reserved": "requeue_ready", 	"buried":   "keep_buried", }  // CarryTubePause is the shipped choice for tube pauses. A repair may flip it.-var CarryTubePause = false+var CarryTubePause = true  // Rules is a resolved table for one import. type Rules struct {diff --git a/replacement/internal/recovery/rules.go b/replacement/internal/recovery/rules.go--- a/replacement/internal/recovery/rules.go+++ b/replacement/internal/recovery/rules.go@@ -16,8 +16,10 @@ 	"strings" ) -// Shipped is the rule set a cutover uses unless told otherwise. As shipped: the naive foil.-const Shipped = "naive"+// Shipped is the rule set a cutover uses unless told otherwise. Repaired: the PREPARED reference+// repair, because a replay that warned on stderr dropped accepted work and brought finished work+// back. It replays at a raised -z when the program warns, and holds if any warning is left.+const Shipped = "prepared"  // Sets is every rule set the switch can pick. var Sets = map[string]RuleSet{ 

Written by the team with knowledge of the edge, before the run. Live, Gemini Argon writes this repair from the same failing case. The shipped naive mapper and recovery rules are constructed foils, disclosed at the top of mapper.go and rules.go.

04 / 08

The independent check

The team that built it does not grade it. A separate executor, with the network off, rebuilt it from the package alone.

Executor

Hybrid: local isolated executor, network none

Hash matches the package: yes. Hybrid: local isolated executor.

candidate sha256:9bd4a2ecc440af36

Conformance

48/48 sealed cases pass

The judge's own case: the message you typed on /demo, at z-1 size, in the probe

Blind sequences

25/25 pass never seen by the replacement

identity

OBSERVED PASS

executed linux/arm64/kedge-replacement sha256:3a5188088943… is the expected artifact (set sha256:6f4d92055e7f…)

measured by Hybrid: local isolated executor (network none) RECORDED

reproducible build

OBSERVED PASS

4/4 artifacts byte-identical: darwin/arm64 (go1.27.3) and linux/arm64 (Debian GNU/Linux 13 (trixie)), set sha256:6f4d92055e7f…

measured by Hybrid: local isolated executor (network none) RECORDED

conformance

OBSERVED PASS

sealed 48/48 cases (2497/2497 checks); original observations 25/25; public suite 306/306 assertions

measured by Hybrid: local isolated executor (network none) RECORDED

05 / 08

The stop

Waiting for the human

Nothing stops until a person approves. Surface: workbench (/mission-control), ASI:One (Kedge Custodian). The wait here was s. The approval carries a one-use id, and the server binds it to this exact candidate.

action
stop_original
candidate hash
sha256:9bd4a2ecc440af3639dc4c11
decision
APPROVED: operator, action, candidate and expiry all match

Free text never authorizes a stop. A change to the candidate voids the approval.

06 / 08

The fence and the count

The fence sits outside the program, in three places, because fencing the queue alone is not enough. Then the count: lost work and finished work are different errors, and both are counted.

  1. 1Ingress closed. The proxy stops routing to the original. A producer now hears DRAINING. 8 reservations are held frozen so the fence doesn't release them.
  2. 2Recovery source sealed. Sealed from outside the program, digest 86e2005fdb99. A test write was denied. same user: a convention, not isolation; the container path is the isolated one.
  3. 3Epoch advanced. Epoch 1 to 2. The sink now refuses a commit from the old epoch.
  4. 4The original ends. PID 78547 ends. SIGKILL, exit -9. Still alive: no. Writes after the seal: none.
  5. 5Sealed source replayed. WARNINGS ON STDERR Replay 1 of a copy, by the original's own binary at -z 1024: 38 jobs came back, and the server counts 38. It wrote 3 warning lines to stderr, the first: 'binlog.1:37913: job 142 is too big (1025 > 1024)'. Next: replay.
  6. 6Sealed source replayed. Replay 2 of a copy, by the original's own binary at -z 2050: 45 jobs came back, and the server counts 45. Nothing on stderr. Next: import.
  7. 7Recovery rules decide. Import, by the prepared rules (PREPARED reference repair: the labelled fallback, never the default): the replay at -z 2050 is clean and accounts for all 45 pending jobs.
  8. 8Pending state read. 45 jobs from the sealed source, digest cad04adfab53: 17 ready, 10 delayed, 8 reserved, 10 buried.
  9. 9Mapper import. The replacement took the pending jobs through the mapper's rule table.
  10. 10Replacement resumes. Traffic now goes to the replacement, pid 78799, epoch 2.
With the prepared rules, measured on the original, of 201 acceptedPREPARED reference repair: the labelled fallback, never the default
17
accepted, then lost
pending messages that vanished
10
finished, then came back
work already done, handed out a second time

The naive and reconciling rule sets are constructed foils, written knowing the edge. They show what a reasonable-looking recovery does, and they are not blind work. Prepared is a reference repair, PREPARED, the labelled fallback: live, Argon writes the repair.

After the stop and the repaired recovery
0
accepted, then lost
pending messages that vanished
0
finished, then came back
work already done, handed out a second time

Under the prepared rules, 10 finished messages would reach the sink a second time. Duplicates the sink caught after the stop: 0.

0
accepted messages unaccounted for (of 202 accepted)
  1. 17
  2. 0

Attempts are not effects. 183 attempts reached synthetic-sink; 182 committed effects. The ambiguous-ACK window was 22 ms.

SinkDurable dedupAttemptsCommitted effectsDupes suppressedStale epoch rejectedAmbiguous-ACK window
synthetic-sinkyes1831820122 ms

07 / 08

The return

Starting the old program is not the test. Processing the new work is.

New work

New work accepted by the replacement only

Message: new-r3d2f1db38d-000 SYNTHETIC

The way back

PASS On the original: after a restart from its sealed recovery source, 1 message(s) accepted only by the replacement reached a committed effect.

Approval: APPROVED. operator, action, candidate and expiry all match

08 / 08

The receipt

One receipt. Three separate claims, attempts against effects, the unknowns, the way back, the exact flags.

HOLD

  • no person approved this candidate
-z 1024, declaredstock programprocess isolation on the Mac, not a containerPREPARED reference repair: the labelled fallback, never the default

Candidate 9bd4a2ecc440af36. RECORDED

Open the receipt