I2701 — The idle timeout is declared beside the other server timings, and serve --idle overrides the declaration
Declare the server's idle timeout under policy.yaml server: beside the lease timings, validate it by the policy schema, and make every server that starts stop after the declared time unless serve --idle says otherwise.
DONE wave 1 · p2 · implementation profile · runs alone
Objective
Declare the server's idle timeout under policy.yaml server: beside the lease timings, validate it by the policy schema, and make every server that starts stop after the declared time unless serve --idle says otherwise.
Why
Split from I2129 on 2026-10-14. I2129 made the declared lease timings the ones mcp and serve elect by, and its desired_state said 'Not done here' of the idle timeout as a declared server key, while its acceptance criteria still required it, so it could never close. The idle timeout is the one server timing a repository cannot declare: a compiled constant, absent from policy.yaml server:. Baseline audit of 2026-10-09 at master 1fb8d6be44, lifecycle drift 1.
Current state
DEFAULT_IDLE_SECONDS (900, apps/majordomus-cli/src/cli.rs) is the clap default of serve --idle and serve ensure --idle, and env enter passes it to the server it starts (apps/majordomus-cli/src/commands/env.rs). .ai/repo/policy.yaml server: declares probe_timeout_seconds, bind_grace_seconds, join_timeout_seconds, busy_grace_seconds and read_deadline_seconds (lease::Timings, apps/majordomus-cli/src/lease.rs); the policy schema (share/schemas/majordomus/policy/policy.v1.schema.json) knows no idle key.
Desired state
policy.yaml server: may declare the idle timeout (server.idle_seconds) and the policy schema validates it; a server started by serve, serve ensure or env enter without --idle stops after the declared time, an absent key keeps 900 s, and --idle given on the command line overrides the declaration. docs/MCP.md lists the key with the other server timings.
Scope
- apps/majordomus-cli/src/cli.rs
- apps/majordomus-cli/src/commands/serve.rs
- apps/majordomus-cli/src/commands/env.rs
- apps/majordomus-cli/src/policy.rs
- .ai/repo/policy.yaml
- share/schemas/majordomus/policy
- apps/majordomus-cli/tests/serve_lifecycle.rs
- test/cases
- docs/MCP.md
Out of scope
- The lease timings the elections read, which I2129 delivered
Dependencies
Acceptance criteria
- The idle timeout is a declared policy key validated by the policy schema, and serve --idle overrides it
- A server started without --idle under a declared idle timeout of a few seconds stops after the declared time, not after 900 s
Validation
- bin/majordomus plan validate
- cargo test --test serve_lifecycle
Evidence required
- idle_timeout_declared_test
Evidence
| covers | type | command | result | at commit |
|---|---|---|---|---|
| idle_timeout_declared_test | test | cargo test --test serve_lifecycle | 17 passed, 0 failed, incl. idle_timeout_declared_test (code on master since 7111f846b83; re-run at master 01227a0) | 01227a0 |
Timeline
- started
- 2026-10-17T12:01:46Z
- verified
- 2026-10-17T12:01:59Z
- completed
- 2026-10-17T12:02:08Z
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/I2701.yaml. Read it back with majordomus plan show I2701.