How computeRoleDiff() compares two roles category-by-category, the A/B convention, what each change category means, and the difference between the in-builder Diff tab and the standalone diff route.
A role diff is the structured difference between two roles: profile edges added or removed, profile classification changes, IRI/ICI shifts, and flow-stage reorders. It is the transformation artefact in RPF — when you see what's different between today's and tomorrow's role, you see what to learn, what to teach, and what to procure.
Three audiences read the diff differently. Professional bodies read it as evidence of what "future-ready" actually means in practice. Org leaders read it as the gap their roles need to close. Practitioners read it as the curriculum they need to walk.
The role diff is a pure function over two published roles, A and B. It returns a structured RoleDiff package with five sections: profile edges (added / removed / changed-classification / IRI shift / ICI shift) and flow stages (added / removed / reordered). It does not return prose; it returns categorised structured data the UI renders.
Like the profile gap (M18.1), the diff is computed, not authored. There is no "diff editor". The diff is a live read over both roles, recomputed every time either side changes.
A is the role you opened the diff from; B is the comparison target (typically A's successor, or set via ?vs=<slug>). Visually, A renders on the left in slate tones; B renders on the right in emerald tones. Green tones mean "added on B / increased toward B"; amber tones mean "removed / decreased."
The subject role — usually the legacy or hybrid one. Renders on the left side of the diff. Slate tones match the archetype-badge palette for legacy.
The comparison target — usually the future-ready successor. Renders on the right side of the diff. Emerald tones match the archetype-badge palette for future-ready.
Profiles attached to B but not to A. Each row shows the classification (core / primary / supporting). "Added" means the future-ready role expects competence in a profile the legacy role didn't require.
Profiles attached to A but not to B. "Removed" means a competence the legacy role required is no longer central to the future-ready role — often a workflow that has been automated or delegated.
Profiles present on both sides where the classification changed (e.g. core → primary). The change category captures the shift in centrality of a profile within the role, even when both sides carry it.
Per-profile-edge IRI delta (B − A), summed into iriShiftTotal. A positive shift means the future-ready role demands more information across the profile; a negative shift means less. IRI ranges 0–3 per profile per role.
Per-profile-edge ICI delta (B − A), summed into iciShiftTotal. A positive shift means the future-ready role demands more competency depth (a higher cognitive / execution bar). ICI ranges 0–3 per profile per role.
Flow stages present on both sides where the ordinal position changed, plus stages added or removed. A reorder typically signals a flow restructuring — e.g. "design coordination" moving earlier in the lifecycle.
The Diff tab inside the role builder (LeftPane) shows the same diff as the standalone route, but with authoring affordances: clicking a row may jump you to the relevant builder section, and the agent first-run hint is shared with the standalone route via a single dismissal key so the tour only runs once across both surfaces. The Diff tab replaced the prior Compare tab in M18.3.3c.
The standalone route is a read-only server component, statically cacheable, and the canonical link to share when someone wants to see the diff without entering the builder. It accepts ?vs=<other-slug> to override the comparison target, and renders the agent panel + first-run hint inline.