I3097 — An older executable never takes the shared-server lease from a newer one because the newer one's file was rebuilt
Make the replaced-executable takeover in apps/majordomus-cli/src/lease.rs compare versions before it fires, so a process whose own version is older than the version the lease records attaches to the newer server (or reports it) and never replaces it, whatever happened to the file at the lease's executable path.
DONE wave 0 · p1 · implementation profile · parallel safe
Objective
Make the replaced-executable takeover in apps/majordomus-cli/src/lease.rs compare versions before it fires, so a process whose own version is older than the version the lease records attaches to the newer server (or reports it) and never replaces it, whatever happened to the file at the lease's executable path.
Why
On 2026-10-20 at 22:27:58Z the shared server of this repository, 1.0.0-alpha.1 (pid 77871), lost its lease to a 0.30.2 process (pid 57957): apps/majordomus-cli/target/debug/majordomus had been rewritten at 22:27:01Z, and `superseded` (lease.rs) takes over whenever the file at the lease's path changed, before the version verdict of I2163 is asked. The board and every mesh claim dropped twice in 20 minutes, and for 8 minutes the repository was served by an older release (server.log lines 425265-425268).
Current state
`superseded(doc)` returns a takeover reason when the lease's executable path is this process's and its mtime or size differ; it is checked before `version_verdict`, so it never asks which side is newer.
Desired state
A replaced executable takes over only when its version is the same as or newer than the lease's recorded version; an older one is told the newer server's address and attaches, and the log names both versions.
Scope
- apps/majordomus-cli/src/lease.rs
- .ai/repo/project/issues/I3097.yaml
Out of scope
- Where branch builds write their binaries (a build of a branch into the primary's target directory is its own issue)
Dependencies
None. This issue is a root of the graph.
Acceptance criteria
- A lease recorded by a newer version, whose executable file is then replaced by an older build at the same path, is not taken over by that older build
- A replaced file of the same or a newer version still takes over, as before
- The log line of a refused takeover names both versions
Validation
- cargo test --manifest-path apps/majordomus-cli/Cargo.toml --lib lease
Evidence required
- older_replacement_attaches
- newer_replacement_takes_over
Evidence
| covers | type | command | result | at commit |
|---|---|---|---|---|
| older_replacement_attaches | ci | cargo test --manifest-path apps/majordomus-cli/Cargo.toml --lib lease::tests::older_replacement_attaches | ok, the rust job passed in master validate 39784979979 (success at 2034d4a3f0b, which holds lease.rs older_replacement_attaches, landed in a57482183bf) | 376493c |
| newer_replacement_takes_over | ci | cargo test --manifest-path apps/majordomus-cli/Cargo.toml --lib lease::tests::newer_replacement_takes_over | ok, the rust job passed in master validate 39784979979 (success at 2034d4a3f0b, which holds newer_replacement_takes_over, landed in a57482183bf) | 376493c |
Timeline
- started
- 2026-10-21T02:42:11Z
- verified
- 2026-10-21T02:42:43Z
- completed
- 2026-10-23T16:41:55Z
Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.
Canonical record: .ai/repo/project/issues/I3097.yaml. Read it back with majordomus plan show I3097.