Skip to content

I2656 — The diagram viewer serves the Cockpit and majordomus ui, and a node that is a repository file links to its source

Extend what I2653 built in two directions it left out: let the Cockpit and majordomus ui render a Mermaid diagram through the same viewer instead of a second implementation, and link a node whose label is a tracked file path to that file at the commit the site was built from.

READY wave 1 · p3 · implementation profile · parallel safe

Part of surfaces-never-disagree — Every surface projects the same state, says when it was observed, and keeps no list of its own.

Ready. Every dependency is done, so majordomus plan start I2656 will be accepted.

Objective

Extend what I2653 built in two directions it left out: let the Cockpit and majordomus ui render a Mermaid diagram through the same viewer instead of a second implementation, and link a node whose label is a tracked file path to that file at the commit the site was built from.

Why

ADR 0152 scoped the viewer to the published site. Rule project.a-diagram-is-drawn-not-typed names four renderings of one relationship (site, Cockpit, terminal, API); the site now has one viewer and the other browser surfaces have none. Diagrams on the site name files (.ai/repo/policy.yaml, scripts/generate-site-data) that the inference leaves as text, although scripts/ci/link-check already decides blob links against git.

Current state

share/design/figure.css is imported by the site only; share/cockpit and share/ui load no diagram viewer; the link index holds site routes only.

Desired state

The viewer and its stylesheet are served to the Cockpit and the UI from one source under the content policy those surfaces set, with the design contrast derivation reading figure.css; a node whose whole label is a tracked path links to its blob at the built commit, and scripts/ci/link-check resolves it.

Scope

  • site/diagrams.js
  • share/design/figure.css
  • share/cockpit/src/cockpit.css
  • share/ui/src/ui.css
  • apps/majordomus-cli/src/design/contrast.rs
  • scripts/lib/diagrams.mjs
  • scripts/lib/diagrams.test.mjs
  • .ai/repo/project/issues/I2656.yaml

Out of scope

  • A second viewer for any surface

Dependencies

Acceptance criteria

  • A diagram in the Cockpit is drawn by site/diagrams.js under the Cockpit content policy
  • A node labelled with a tracked path is listed as a link to that file and link-check passes it; an untracked path is not linked
  • majordomus design contrast measures the pairs figure.css uses

Validation

  • node --test scripts/lib/diagrams.test.mjs
  • scripts/rust-check

Evidence required

  • cockpit_viewer_case
  • file_link_unit_tests

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

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