Skip to content

I2157 — Ready means ready: a lost lease, a degraded layer or a failing mesh is not reported ready

Fold lease loss and a degraded index into readiness with a named reason, add a mesh check to health.report, and make majordomus doctor report the runtime or say that it does not.

DONE wave 0 · p1 · implementation profile · runs alone

Part of failure-is-visible — Every failure the runtime can suffer is bounded, tested or stated, and changes the health it reports.

Objective

Fold lease loss and a degraded index into readiness with a named reason, add a mesh check to health.report, and make majordomus doctor report the runtime or say that it does not.

Why

Readiness (apps/majordomus-cli/src/capability/builtin/health.rs:214, GET /api/v1/ready) checks a non-empty registry and that the code is not replaced; a degraded index stays ready:true with layer: warn, and mesh state and lease loss are absent: was_lost() reaches only GET / through LEASEHOLDER_KEY (apps/majordomus-cli/src/http/router.rs:710). health.report (apps/majordomus-cli/src/capability/builtin/health.rs:299) has no mesh and no policy-allowed dimension; mesh health lives only in mesh.status, mesh doctor and mesh verify. Running, ready, mesh-healthy and degraded are split across /live, /ready, server.standing_at (apps/majordomus-cli/src/capability/builtin/server.rs:403), MeshStatus, index::State::Degraded (apps/majordomus-cli/src/index.rs:34) and LinkState::Degraded (apps/majordomus-cli/src/mesh/cooperation.rs:265). The top-level majordomus doctor is a governance doctor (lib/doctor.sh:53-77) that checks nothing about the server, the lease or the mesh, which its name suggests it does. Baseline audit of 2026-10-09 at master 1fb8d6be44, failure gap 10 and premise 4.

Current state

A server that lost its lease, or serves a degraded index, answers /api/v1/ready with ready true.

Desired state

GET /api/v1/ready answers ready false after a lease loss, with reasons naming lease_lost (and stale, as before); a degraded layer is listed as layer_degraded and stays ready, which docs/MCP.md says; health.report carries a mesh check that applies mesh doctor's runtime verdict (doctor::runtime_verdict) in a process whose server decided the mesh, and reports unknown elsewhere. The deferred part, majordomus doctor reporting the runtime or saying that it checks governance only, is I2707.

Scope

  • apps/majordomus-cli/src/capability/builtin/health.rs
  • apps/majordomus-cli/src/http/router.rs
  • apps/majordomus-cli/src/lease.rs
  • apps/majordomus-cli/src/mesh/doctor.rs
  • lib/doctor.sh
  • apps/majordomus-cli/tests/health_server.rs
  • docs/MCP.md

Dependencies

None. This issue is a root of the graph.

What waits on this

Acceptance criteria

  • A server that lost its lease answers /api/v1/ready with ready false and the reason lease_lost
  • A degraded index is reported on /api/v1/ready with its reason, and docs/MCP.md says whether that is ready
  • health.report carries a mesh check whose status follows mesh doctor's verdict when the mesh is enabled

Validation

  • bin/majordomus plan validate
  • cargo test --test health_server --test lease_lost

Evidence required

  • ready_false_on_lease_loss_test
  • health_mesh_check_test

Evidence

coverstypecommandresultat commit
ready_false_on_lease_loss_testtestcargo test --locked --manifest-path apps/majordomus-cli/Cargo.toml --test lease_losttest result: ok. 1 passed; 0 failed (run 2026-10-14 12:00-12:15Z on master 2ca25bb9cf plus this change)2ca25bb
health_mesh_check_testtestcargo test --locked --manifest-path apps/majordomus-cli/Cargo.toml --test health_server && cargo test --locked --manifest-path apps/majordomus-cli/Cargo.toml --lib capability::builtin::health::tests::readiness_names_a_degraded_layer_and_is_still_readytest result: ok. 7 passed; ok. 1 passed; docs/MCP.md says layer_degraded does not make a server not ready (run 2026-10-14 12:00-12:15Z on master 2ca25bb9cf plus this change)2ca25bb

Timeline

started
2026-10-14T12:15:59Z
verified
—
completed
2026-10-14T12:16:39Z

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/I2157.yaml. Read it back with majordomus plan show I2157.

Searches the titles and descriptions of every page this site publishes.