Skip to content

I3203 — Delivery lead time is measured per phase, from a pull request's opening to its verified publication

Time the phases of the delivery stages plan.delivery derives per issue (I2740: pr_open, merged, released, deployed, each with the object that proved it) and report p50/p95, sample size and observation time per phase, taking a merged pull request's opened and merged times from the forge's pull request record so merges made outside the drain are counted, and writing no join of its own.

BLOCKED wave 1 · p1 · implementation profile · parallel safe

Part of delivery-flow-is-measured — The way from a pull request to a verified publication is measured per phase, and its bounds are read where work starts.

Blocked. This issue cannot start until I3202, milestone:delivery-flow-is-measured are done. The status is derived from that, not declared.

Objective

Time the phases of the delivery stages plan.delivery derives per issue (I2740: pr_open, merged, released, deployed, each with the object that proved it) and report p50/p95, sample size and observation time per phase, taking a merged pull request's opened and merged times from the forge's pull request record so merges made outside the drain are counted, and writing no join of its own.

Why

The owner asked for minutes, not hours or days, between a change and its deploy (c204#0) and later for releases as fast as possible (c291#0); every audit since 2026-10-09 reconstructed lead time by hand from run timestamps (c204#2, c238#2, c295#7). No single figure for green pull request to verified deploy exists. Proposed in ADR 0196 (Delivery latency targets are budgets of benchmark policy, measured per phase, and never a correctness gate on runners the repository does not own); ADR 0198 (Delivery is judged by verified outcomes landed per day, with lead time p95 as its control, never by commits, pull requests or sessions) (proposed; it carries no authority until the owner accepts it). Sources: chatgpt-majordomus:c204#2, chatgpt-majordomus:c216#6, chatgpt-majordomus:c238#2, chatgpt-majordomus:c280#2, chatgpt-majordomus:c287#2, chatgpt-majordomus:c295#7.

Current state

integration.events holds the drain's own trail only: no opened time, and no merge made by a person or an expedited landing. I2474 (DONE) draws merges per day; served.observe records what each deployment served; release records under .ai/repo/releases carry their commits. I2740 (master, READY, p0) plans plan.delivery's stages none, branch, pr_open, merged, released and deployed with their proving objects (ADR 0166). I2946 (on the board on 2026-10-18, not on master) measures throughput from prs and ci-timings. Nothing times the phases.

Desired state

A delivery lead-time reading, computed only from recorded sources, with unmeasured phases shown as unmeasured; drawn on the drain screen and served by CLI, HTTP and MCP from the same capability.

Scope

  • apps/majordomus-cli/src/integration/metrics.rs
  • apps/majordomus-cli/src/capability/builtin/integration.rs
  • docs/INTEGRATION.md
  • apps/majordomus-cli/src/ui/prs.rs
  • apps/majordomus-cli/src/integration/forge.rs
  • site/content/docs/integration.md
  • docs/generated/openapi.json
  • .claude/skills/mj-integration/SKILL.md

Out of scope

  • A second metrics store
  • Forecasts or scores
  • A delivery or throughput figure as ADR 0198 (proposed, not on master) defines it; this issue measures lead time only
  • Publishing lead-time readings to majordomus.dev before a measured window exists
  • Depending on I2946 (board, not on master); it remains an overlap only

Dependencies

What waits on this

Acceptance criteria

  • Each phase's p50 and p95 come with their sample size and the moment they were observed
  • A change whose publication was never observed is counted as unmeasured, never as zero
  • CLI JSON, HTTP and MCP return the same reading for the same inputs
  • The stages (pr_open, merged, released, deployed) and the objects that prove them are read from plan.delivery (I2740); this issue adds only per-phase timing over them and writes no join of its own
  • The opened and merged times of a merged pull request come from the forge's pull request record (createdAt, mergedAt) and its merge commit, including merges made outside the drain; a merge whose opening cannot be read is counted as unmeasured with its count reported, never dropped silently

Validation

  • cargo test --manifest-path apps/majordomus-cli/Cargo.toml --lib integration::metrics
  • majordomus plan validate

Evidence required

  • test_delivery_lead_time_phases

Evidence

None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.

Timeline

started
—
verified
—
completed
—

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

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