Skip to content
Cockpit0.29.0
A snapshot: read at commit 707a04c7ce8 on 2026-10-18T00:06:01Z by majordomus 0.29.0. Nothing on this page is read again. See it live

I2463

A train of stacked pull requests is a typed object, served everywhere and drawn as a graph

Where it stands

devtask.issue
Readiness
complete completion is recorded and every required evidence token is present
Status
DONE
Can start
not now
Milestone
Milestone status
ACTIVE
Wave
0
Waiting on
none
Holds back
none
Behind it in all
0
Evidence
2 of 2
A move writes the repository: it stamps one field of this issue's record and appends one event to the ledger, and a commit will carry both.
The same moves from a terminal

majordomus plan start I2463

majordomus plan verify I2463

majordomus plan done I2463

What it is

Objective
Derive the trains of open pull requests (chains and DAGs of declared and base-branch stacks) from the executor's own recorded observation as a typed read model, project it once as the capability integration.trains to the command line (majordomus prs trains), HTTP and MCP, and draw it in the Cockpit at /cockpit/trains as an interactive graph with a server-rendered table beside it.
Why
The executor already parses every `Stacked on #N` / `Depends on #N` line and every base branch that is another pull request's head into dependencies, and it prepares the next head of each link under refs/prep/<n> before pushing it at its turn. What a train is, which link is next, which prepared head is still unpushed and how far each link is behind master lived only in session messages and in local refs nobody else could read; two sessions asked each other for the order of the same eleven links in one evening. The owner asked on 2026-10-11 for an interactive, detailed visualisation of the train in the style of the Neo4j Browser.
Now
Dependencies and reasons such as stacked_on:#807 are visible one pull request at a time in majordomus prs status; nothing groups them into trains, orders their turns, or compares refs/prep/<n> with the head the forge serves.
Wanted
majordomus prs trains, GET /api/v1/pull-requests/trains and MCP majordomus_pull_request_trains answer the same typed trains: links with number, title, branch, head, disposition and reasons, required checks, relation to master, the prepared head and whether it is pushed, turn and position, root and top; /cockpit/trains draws them with Cytoscape (colour by disposition from the design tokens, master as the anchor, labelled STACKED_ON / DEPENDS_ON arrows, property panel, filters, search, fit and zoom, keyboard access, reduced motion honoured) and lists the same facts as a table without JavaScript.
Done when
unknown: the record declares no `completion`
Risk
unknown: the record declares no `risk`

Acceptance

  • Trains are derived by pure, unit-tested functions from the recorded observation, the queue and the local refs/prep/<n> refs; nothing reaches the network or writes a ref
  • integration.trains is declared once with capability! and projected to the command line, HTTP and MCP by majordomus generate
  • /cockpit/trains draws the trains interactively and renders the same facts as a table without JavaScript; colours come from the design tokens
  • test/cases/1072_the_train_is_seen.sh passes with the change and fails against master without it
Validation
cargo test --manifest-path apps/majordomus-cli/Cargo.toml --lib integration::trainMJ_TEST_JOBS=4 bash test/run.sh 1072_the_train_is_seen
Evidence required
train_model_unit_teststrains_projection_case
Evidence present
train_model_unit_teststrains_projection_case

Scope

Touches
apps/majordomus-cli/src/integration/train.rsapps/majordomus-cli/src/integration/mod.rsapps/majordomus-cli/src/capability/builtin/integration.rsapps/majordomus-cli/src/cli.rsapps/majordomus-cli/src/commands/prs.rsapps/majordomus-cli/src/cockpit/mod.rsapps/majordomus-cli/src/cockpit/nav.rsapps/majordomus-cli/src/cockpit/pages.rsapps/majordomus-cli/src/cockpit/trains.rsshare/cockpit/trains.js.ai/repo/adrs/0138-a-train-of-pull-requests-is-a-typed-object-that-can-be-seen.mddocs/INTEGRATION.mddocs/COCKPIT.mdtest/cases/1072_the_train_is_seen.shshare/version.txtapps/majordomus-cli/Cargo.tomlapps/majordomus-cli/Cargo.lockdocs/generatedsite/datasite/content
Not
Moving, pushing or deleting any ref, refs/prep/<n> included: the model reads themA new stream: the page polls the HTTP capability (majordomus monitor is I2400-I2407)
Depends on
none
Priority
p2
Profile
implementation
Parallel safe
true
Owner
unknown: the record declares no `owner`

The work so far

Branches
none
Merged
none
Commits
0
Trunk
master
Sessions
none
Created
2026-10-11
Updated
2026-10-12T10:59:59Z
Started
2026-10-12T10:59:39Z
Verified
2026-10-12T10:59:46Z
Completed
2026-10-12T10:59:59Z

Synchronisation

Adapter
scripts/github-sync
Repository
unknown: the derived plan's header carries no repository
External issue
unknown: a live GitHub state; this executable makes no network call, so only `scripts/github-sync --check` can answer it
State there
unknown: a live GitHub state; this executable makes no network call, so only `scripts/github-sync --check` can answer it

Findings

Nothing is wrong with these records.