diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 014f1a5..7b2ba73 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: - node-version: 24 + node-version: 26 - name: List documentation URLs run: node tools/validate-data.mjs --urls > lychee-urls.txt - name: Check links @@ -31,10 +31,17 @@ jobs: lychee-urls.txt output: ./lychee/out.md fail: false - - name: Open issue if links are broken - if: steps.lychee.outputs.exit_code != 0 - uses: peter-evans/create-issue-from-file@v6 - with: - title: Broken documentation links - content-filepath: ./lychee/out.md - labels: data, links + - name: Update link check issue + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + BROKEN: ${{ steps.lychee.outputs.exit_code != 0 }} + run: | + gh label create links --force --description "Broken documentation links" || true + n=$(gh issue list --state open --search 'in:title "Broken documentation links"' --json number --jq '.[0].number // empty') + if [ "$BROKEN" = "true" ]; then + if [ -n "$n" ]; then gh issue edit "$n" --body-file ./lychee/out.md + else gh issue create --title "Broken documentation links" --body-file ./lychee/out.md --label links; fi + elif [ -n "$n" ]; then + gh issue close "$n" --comment "All documentation links pass." + fi diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index f9dcd83..a296036 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -24,9 +24,11 @@ jobs: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: - node-version: 24 + node-version: 26 - name: Validate data run: npm run validate + - name: Run tests + run: npm test - name: Assemble site run: | mkdir _site diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 423433d..df57169 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,10 +1,11 @@ name: Validate data on: - push: - branches: [main] pull_request: +permissions: + contents: read + jobs: validate: runs-on: ubuntu-latest @@ -12,5 +13,6 @@ jobs: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: - node-version: 24 + node-version: 26 - run: npm run validate + - run: npm test diff --git a/CLAUDE.md b/CLAUDE.md index f96a94e..32a35c1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,3 +10,4 @@ Context for Claude Code or similar tools working in Constellate, an interactive - Stars and labels are counter-scaled with `--inv`; new SVG elements inside nodes should go in the `.inner` group, and new lines need `vector-effect: non-scaling-stroke`. - UI copy uses sentence case and British/South African spelling (licence, centre, enrolment). - Respect `prefers-reduced-motion` (`RM` in atlas.js) for any new animation. +- Licence rules live in `assets/js/licence.js`; run `npm test` after changing them or the plan data. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e7fe33..97bdd0b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,13 +6,17 @@ Most contributions are content: correcting a summary, updating a licence tier, f 1. Create a branch: `git switch -c data/update-purview-labels`. 2. Edit `data/services.js`. -3. Run `npm run validate` and fix any errors. Review warnings. +3. Run `npm run validate` and `npm test`. Fix any errors and review warnings. 4. Open `index.html` and check the change on the map (zoom in, select the item, check the threads). 5. Open a pull request. CI runs the validator again. ## Data schema -`data/services.js` returns five things. +`data/services.js` returns six things. + +### `REVIEWED`: licensing review date + +An ISO date string (`'YYYY-MM-DD'`) for when the licensing data was last checked against Microsoft's documentation. It is shown in the page footer. `npm run validate` errors if it is not a real date and warns when it is more than 100 days old, since a review is due each quarter. ### `LIC`: licence tiers @@ -30,8 +34,8 @@ Most contributions are content: correcting a summary, updating a licence tier, f | Key | Label | Meaning | | --- | --- | --- | -| `defender` | Defender Suite | Formerly E5 Security. Entra ID P2 and the E5 Defender workloads, as an add-on to E3 or Business Premium. A frontline (FLW) version adds to F1 and F3 | -| `purview` | Purview Suite | Formerly E5 Compliance. E5 Purview features, as an add-on to E3 or Business Premium. A frontline (FLW) version adds to F1 and F3 | +| `defender` | Defender Suite | Formerly E5 Security. Entra ID P2 and the E5 Defender workloads, as an add-on to a plan that takes suites. A frontline (FLW) version adds to F1 and F3 | +| `purview` | Purview Suite | Formerly E5 Compliance. E5 Purview features, as an add-on to a plan that takes suites. A frontline (FLW) version adds to F1 and F3 | Tag an `e5` component with `suite: 'defender'` or `suite: 'purview'` when that suite unlocks it without E5. The filter then lights it up when a plan with `suites: true` is chosen and that suite is added. @@ -75,7 +79,7 @@ Example: Business Standard is `upTo:'core'` with the Microsoft 365 Apps features | `note` | no | Licensing caveat, under 160 characters | | `aka` | no | Space-separated search terms: acronyms, old names | | `related` | no | Component IDs this works with. One direction is enough; the app makes links two-way | -| `suite` | no | `e5` components only: the `SUITES` key that unlocks it on E3 or Business Premium | +| `suite` | no | `e5` components only: the `SUITES` key that unlocks it on a plan that takes suites | ### `LINKS`: dashed lines between services @@ -99,5 +103,7 @@ Pairs of service IDs, for example `['entra', 'intune']`. ## Pull request checklist - [ ] `npm run validate` passes +- [ ] `npm test` passes - [ ] Checked the change visually in light and dark themes - [ ] Licence changes include a source link in the PR description +- [ ] Licensing changes update `REVIEWED` in `data/services.js` diff --git a/README.md b/README.md index 312cf15..7b2252d 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Microsoft 365 is hard to hold in your head. Customers hear "Entra", "Defender" a - **Feature detail.** Each feature has a short summary, a licence tier, licensing caveats, and a Microsoft Learn link. Services also link to their admin centre. - **Cross-service threads.** Selecting a feature draws lines to related features in other services, such as Conditional Access to Intune compliance and ID Protection. - **Licence filter.** Pick a plan (Business Basic, Standard or Premium, Office 365 E1 or E3, Microsoft 365 E3, E5 or E7, or frontline F1 or F3) and optionally add the Defender and Purview Suites. Everything outside it dims, to show what an upgrade would unlock. +- **Deep links.** The URL follows the view, so a feature and plan can be shared, such as `https://robinpza.github.io/constellate/#ca?plan=e3`. - **Search.** Matches names, acronyms (MDE, DLP, PIM, SPF) and summaries. - **Light and dark themes.** Follows the system setting: a printed atlas in light mode, a night sky in dark mode. - **Responsive and accessible.** Works on mobile with a bottom-sheet panel, supports keyboard navigation (Tab, Enter, Esc) and respects reduced motion. @@ -38,7 +39,7 @@ cd constellate npm start # serves on http://localhost:8080 ``` -`npm start` uses `npx http-server`, so the only requirement is Node.js 18 or later. VS Code's Live Server extension works too. +`npm start` uses `npx http-server`, so the only requirement is Node.js 26 or later. VS Code's Live Server extension works too. For first-time repo setup, GitHub Pages and branch protection, see [docs/GETTING-STARTED.md](docs/GETTING-STARTED.md). @@ -78,7 +79,7 @@ Then run: npm run validate ``` -The validator checks for duplicate IDs, unknown licence tiers, broken `related` references, non-Learn doc URLs, overlong summaries and overlapping clusters. The full schema and writing guide are in [CONTRIBUTING.md](CONTRIBUTING.md). +The validator checks for duplicate IDs, unknown licence tiers, broken `related` references, non-Learn doc URLs, overlong summaries and overlapping clusters. `npm test` runs the unit tests for the licence rules and deep links. The full schema and writing guide are in [CONTRIBUTING.md](CONTRIBUTING.md). ## Deployment diff --git a/assets/js/atlas.js b/assets/js/atlas.js index 64d301a..8046fc6 100644 --- a/assets/js/atlas.js +++ b/assets/js/atlas.js @@ -2,7 +2,7 @@ * Constellate: rendering and interaction * Depends on: d3 v7 (global), data/services.js (window.ATLAS) */ -const { LIC, SUITES, PLANS, SERVICES, LINKS } = window.ATLAS; +const { REVIEWED, LIC, SUITES, PLANS, SERVICES, LINKS } = window.ATLAS; /* ---------- build model ---------- */ function mulberry(a){return function(){a|=0;a=a+0x6D2B79F5|0;let t=Math.imul(a^a>>>15,1|a);t=t+Math.imul(t^t>>>7,61|t)^t;return((t^t>>>14)>>>0)/4294967296}} @@ -166,19 +166,41 @@ function fitTo(b,dur=850){ function refreshOverviewK(){ overviewK=transformFor(ALL_B,true).k; } /* ---------- state ---------- */ -function selectNode(id){ +function selectNode(id,fromRoute,dur){ const n=N[id]; if(!n) return; hideHint(); closeResults(); state.focus = n.type==='svc' ? n.id : n.svc; state.sel = id; apply(); showPanel(id); - requestAnimationFrame(()=>fitTo(clusterB(state.focus))); + requestAnimationFrame(()=>fitTo(clusterB(state.focus),dur)); + if(!fromRoute) syncUrl(true); } -function resetAll(){ +function resetAll(fromRoute,dur){ const back=state.focus; state.focus=null; state.sel=null; apply(); hidePanel(back); - fitTo(ALL_B); + fitTo(ALL_B,dur); + if(!fromRoute) syncUrl(true); +} +/* ---------- deep links ---------- */ +function syncUrl(push){ + const h=window.ATLAS.formatHash({id:state.sel,plan:state.plan,suites:state.suites}); + const cur=location.hash==='#'?'':location.hash; + if(h===cur) return; + try{ + history[push?'pushState':'replaceState'](null,'',location.pathname+location.search+h); + }catch(e){} +} +function restore(animate){ + const r=window.ATLAS.parseHash(location.hash); + if(r.id===state.sel && r.plan===state.plan && r.suites.join('+')===state.suites.join('+')) return; + state.plan=r.plan; state.suites=r.suites; + planSel.value=r.plan; suitesSel.value=r.suites.join('+'); + suiteFilter.hidden=!PLANS[state.plan]?.suites; + const dur=animate?undefined:0; + if(r.id) selectNode(r.id,true,dur); + else if(state.focus||state.sel) resetAll(true,dur); + applyLicence(); } function apply(){ svgEl.classList.toggle('focused',!!state.focus); @@ -200,20 +222,7 @@ function drawThreads(){ .style('stroke',d=>`var(--${d.b.svc})`); cn.classed('rel',d=>!!(n&&n.type==='cmp'&&REL[n.id].has(d.id))); } -// A plan covers its tier and below, plus its own `with` list, minus its `without` list. -// Suites only count on plans that can take them. A plan's `suites` object lists extra -// components each suite adds on that plan, such as Defender for Endpoint on F3. -function inPlan(c){ - if(state.plan==='all') return true; - if(state.plan==='addon') return c.lic==='addon'; - const p=PLANS[state.plan]; - if(p.without?.includes(c.id)) return false; - if(p.with?.includes(c.id)) return true; - if(typeof p.suites==='object' && state.suites.some(s=>p.suites[s]?.includes(c.id))) return true; - if(c.lic==='addon') return false; - if(LIC[c.lic].rank<=LIC[p.upTo].rank) return true; - return !!(p.suites && c.suite && state.suites.includes(c.suite)); -} +const inPlan = c => window.ATLAS.inPlan(c, state.plan, state.suites); function applyLicence(){ cn.classed('muted',d=>!inPlan(d)); declutter(); @@ -225,12 +234,18 @@ function applyLicence(){ } const lastPlanOpt=planSel.querySelector('option[value="addon"]'); Object.entries(PLANS).forEach(([k,p])=>lastPlanOpt.before(new Option(p.label,k))); +{ + const sk=Object.keys(SUITES); + sk.forEach(k=>suitesSel.add(new Option(`+ ${SUITES[k].label}`,k))); + if(sk.length>1) suitesSel.add(new Option('+ '+sk.map(k=>SUITES[k].label.replace(/ Suite$/,'')).join(' & ')+' Suites',sk.join('+'))); +} planSel.addEventListener('change',()=>{ state.plan=planSel.value; suiteFilter.hidden=!PLANS[state.plan]?.suites; applyLicence(); + syncUrl(false); }); -suitesSel.addEventListener('change',()=>{ state.suites=suitesSel.value?suitesSel.value.split('+'):[]; applyLicence(); }); +suitesSel.addEventListener('change',()=>{ state.suites=suitesSel.value?suitesSel.value.split('+'):[]; applyLicence(); syncUrl(false); }); /* ---------- crumbs & panel ---------- */ function renderCrumbs(){ @@ -246,6 +261,8 @@ const EX = ` // Plans below the component's tier that include it anyway, e.g. desktop apps in Business Standard. const extraPlans = c => { const ps=Object.values(PLANS).filter(p=>p.with?.includes(c.id)).map(p=>p.label); return ps.length ? `or ${esc(ps.join(', '))}` : ''; }; +const addToPlans = c => Object.values(PLANS).filter(p=>p.suites && !p.without?.includes(c.id)).map(p=>p.label); +const addTo = c => { const ps=addToPlans(c); return ps.length ? `Add to: ${esc(ps.join(', '))}` : ''; }; const licShort = c =>LIC[c.lic].short + (c.suite ? ' / '+SUITES[c.suite].label.split(' ')[0] : ''); function showPanel(id){ const n=N[id], s=SVC[n.type==='svc'?n.id:n.svc]; @@ -253,16 +270,16 @@ function showPanel(id){ let h=``; if(n.type==='svc'){ h+=`

Service

${esc(n.name)}

${esc(n.summary)}

-
Open documentation - Open admin centre
+
Open documentation + Open admin centre

${n.components.length} components

`; + `
  • `).join('')}`; } else { const rel=[...REL[n.id]].map(r=>N[r]); h+=`

    Part of

    ${esc(n.name)}

    ${esc(n.summary)}

    -

    ${LIC[n.lic].label}${extraPlans(n)}${n.suite?`or ${esc(SUITES[n.suite].label)} on Business Premium / E3`:''}${n.note?`${esc(n.note)}`:''}

    -
    Open Microsoft Learn docs
    +

    ${esc(LIC[n.lic].label)}${extraPlans(n)}${n.suite?`or ${esc(SUITES[n.suite].label)}${addTo(n)}`:''}${n.note?`${esc(n.note)}`:''}

    +
    Open Microsoft Learn docs
    ${rel.length?`

    Works with

    `:''}`; } @@ -282,6 +299,7 @@ function closePanel(){ hidePanel(state.sel); if(state.sel && N[state.sel].type==='cmp'){ state.sel=state.focus; apply(); } requestAnimationFrame(()=>fitTo(state.focus?clusterB(state.focus):ALL_B)); + syncUrl(true); } document.addEventListener('click',e=>{ const go=e.target.closest('[data-go]'); @@ -308,8 +326,8 @@ q.addEventListener('input',()=>{ resultsStatus.textContent = m.length ? `${m.length} ${m.length===1?'result':'results'}. Press the down arrow to choose.` : 'No matches.'; }); q.addEventListener('keydown',e=>{ - if(e.key==='Enter'){ const b=results.querySelector('button'); if(b){ b.click(); q.value=''; q.blur(); } } - if(e.key==='ArrowDown'){ const b=results.querySelector('button'); if(b){ e.preventDefault(); b.focus(); } } + if(e.key==='Enter'){ if(results.hidden) return; const b=results.querySelector('button'); if(b){ b.click(); q.value=''; q.blur(); } } + if(e.key==='ArrowDown'){ if(results.hidden) return; const b=results.querySelector('button'); if(b){ e.preventDefault(); b.focus(); } } }); results.addEventListener('keydown',e=>{ const bs=[...results.querySelectorAll('button')], i=bs.indexOf(document.activeElement); @@ -327,8 +345,16 @@ document.addEventListener('keydown',e=>{ /* ---------- hint, init, resize ---------- */ function hideHint(){ hint.classList.add('gone'); } +{ + const el=document.getElementById('reviewed'), d=new Date(`${REVIEWED}T00:00:00Z`); + if(el&&!isNaN(d)) el.textContent=` Licensing reviewed ${d.toLocaleDateString('en-GB',{day:'numeric',month:'long',year:'numeric',timeZone:'UTC'})}.`; +} refreshOverviewK(); renderCrumbs(); fitTo(ALL_B,0); +addEventListener('popstate',()=>restore(true)); +addEventListener('hashchange',()=>restore(true)); +if(location.hash) restore(false); +syncUrl(false); let rt; addEventListener('resize',()=>{ clearTimeout(rt); rt=setTimeout(()=>{ refreshOverviewK(); fitTo(state.focus?clusterB(state.focus):ALL_B,0); },120); }); diff --git a/assets/js/licence.js b/assets/js/licence.js new file mode 100644 index 0000000..b00c679 --- /dev/null +++ b/assets/js/licence.js @@ -0,0 +1,18 @@ +// Licence rules. Pure: reads LIC and PLANS from window.ATLAS and adds window.ATLAS.inPlan. +(function(){ +const {LIC,PLANS}=window.ATLAS; +// A plan covers its tier and below, plus its own `with` list, minus its `without` list. +// Suites only count on plans that can take them. A plan's `suites` object lists extra +// components each suite adds on that plan, such as Defender for Endpoint on F3. +window.ATLAS.inPlan=function inPlan(c,plan,suites){ + if(plan==='all') return true; + if(plan==='addon') return c.lic==='addon'; + const p=PLANS[plan]; + if(p.without?.includes(c.id)) return false; + if(p.with?.includes(c.id)) return true; + if(typeof p.suites==='object' && suites.some(s=>p.suites[s]?.includes(c.id))) return true; + if(c.lic==='addon') return false; + if(LIC[c.lic].rank<=LIC[p.upTo].rank) return true; + return !!(p.suites && c.suite && suites.includes(c.suite)); +}; +})(); diff --git a/assets/js/route.js b/assets/js/route.js new file mode 100644 index 0000000..99f29ea --- /dev/null +++ b/assets/js/route.js @@ -0,0 +1,40 @@ +// Deep-link hash rules. Pure: adds window.ATLAS.parseHash and window.ATLAS.formatHash. +// Format: #?plan=&suites=. Every part is optional. +(function(){ +const {PLANS,SUITES,SERVICES}=window.ATLAS; +const ids=new Set(); +for(const s of SERVICES){ ids.add(s.id); for(const c of s.components||[]) ids.add(c.id); } +const takesSuites=plan=>plan!=='all' && plan!=='addon' && !!PLANS[plan]?.suites; + +window.ATLAS.parseHash=function parseHash(hash){ + const out={id:null,plan:'all',suites:[]}; + try{ + const h=String(hash||'').replace(/^#/,''); + const q=h.indexOf('?'); + const idPart=decodeURIComponent(q<0?h:h.slice(0,q)); + const query=q<0?'':h.slice(q+1); + if(ids.has(idPart)) out.id=idPart; + let suites=[]; + for(const pair of query.split('&')){ + const e=pair.indexOf('='); + if(e<0) continue; + const k=pair.slice(0,e), v=decodeURIComponent(pair.slice(e+1)); + if(k==='plan' && (v==='all'||v==='addon'||Object.hasOwn(PLANS,v))) out.plan=v; + else if(k==='suites') suites=v.split('+'); + } + if(takesSuites(out.plan)) out.suites=Object.keys(SUITES).filter(k=>suites.includes(k)); + }catch(e){ + return {id:null,plan:'all',suites:[]}; + } + return out; +}; + +window.ATLAS.formatHash=function formatHash({id,plan,suites}){ + const parts=[]; + if(plan && plan!=='all') parts.push('plan='+encodeURIComponent(plan)); + if(takesSuites(plan) && suites && suites.length) parts.push('suites='+suites.map(encodeURIComponent).join('+')); + const idPart=id?encodeURIComponent(id):''; + if(!idPart && !parts.length) return ''; + return '#'+idPart+(parts.length?'?'+parts.join('&'):''); +}; +})(); diff --git a/assets/og.png b/assets/og.png new file mode 100644 index 0000000..c1eb5be Binary files /dev/null and b/assets/og.png differ diff --git a/data/services.js b/data/services.js index 5eead4c..03004dd 100644 --- a/data/services.js +++ b/data/services.js @@ -5,10 +5,11 @@ * Schema and writing guide: CONTRIBUTING.md * Validate after editing: npm run validate * - * Licensing last reviewed: 1 October 2026, against Microsoft Learn and + * Licensing review date: see REVIEWED below. Reviewed against Microsoft Learn and * Microsoft's product names and service plan identifiers CSV. */ window.ATLAS = (() => { + const REVIEWED = '2026-10-01'; const L = 'https://learn.microsoft.com/en-us/'; const LIC = { core:{label:'Core Microsoft 365',short:'Core',rank:0}, @@ -47,16 +48,16 @@ window.ATLAS = (() => { // The kiosk mailbox is for the Teams calendar only, with no mail rights. No Office for the web, // Power Apps or Power Automate. Cloud App Discovery gives access to the Defender portal. // The frontline (FLW) suites unlock their usual E5 features plus the listed extras; - // both FLW suites include Entra ID P2. + // only the Defender Suite FLW includes Entra ID P2. DSPM for AI is excluded because no source lists it for the FLW suites. f1:{label:'Microsoft 365 F1',upTo:'core', with:[...IDENTITY_DEVICE,'xdr','labels'], - without:['mailboxes','powerapps','cloud-flows','insights','learning'], - suites:{defender:['mde','mdo'],purview:['pim','idp','dlp','retention','ediscovery']}}, + without:['mailboxes','powerapps','cloud-flows','insights','learning','dspmai'], + suites:{defender:['mde','mdo'],purview:['dlp','retention','ediscovery']}}, // Web and mobile apps only. Kiosk mailbox with no archive unless the Purview Suite adds one. f3:{label:'Microsoft 365 F3',upTo:'core', with:[...IDENTITY_DEVICE,'xdr','labels','ome','ediscovery'], - without:['insights'], - suites:{defender:['mde','mdo'],purview:['pim','idp','dlp','retention','archiving']}} + without:['insights','dspmai'], + suites:{defender:['mde','mdo'],purview:['dlp','retention','archiving']}} }; const SERVICES = [ @@ -435,5 +436,5 @@ window.ATLAS = (() => { ['copilot','collab'],['copilot','purview'],['copilot','exchange'],['copilot','defender'], ['apps365','entra'],['apps365','intune'],['power','entra'],['power','purview'],['viva','collab'],['admin','exchange'],['admin','defender']]; - return { LIC, SUITES, PLANS, SERVICES, LINKS }; + return { REVIEWED, LIC, SUITES, PLANS, SERVICES, LINKS }; })(); diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 64740f4..43b92c4 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -2,7 +2,7 @@ ## Overview -Constellate is a static page. `index.html` loads D3 v7 from cdnjs, then `data/services.js` (which sets `window.ATLAS`) and `assets/js/atlas.js` (which renders it). Scripts load as classic scripts rather than ES modules, so the page works when opened from the file system as well as when hosted. +Constellate is a static page. `index.html` loads D3 v7 from cdnjs, then `data/services.js` (which sets `window.ATLAS`), `assets/js/licence.js` (the licence rules, `ATLAS.inPlan`), `assets/js/route.js` (reads and writes the URL hash for deep links) and `assets/js/atlas.js` (which renders it). Scripts load as classic scripts rather than ES modules, so the page works when opened from the file system as well as when hosted. ```mermaid flowchart LR @@ -27,7 +27,11 @@ The whole scene sits in one `` transformed by `d3.zoom`. To stop stars and la ## State -A single `state` object holds `focus` (service in view), `sel` (selected node), `plan` and `suites` (licence filter; see `inPlan()`). `selectNode(id)` is the one entry point for navigation from stars, search results, breadcrumbs and panel lists. `apply()` syncs CSS classes, threads and breadcrumbs from state. +A single `state` object holds `focus` (service in view), `sel` (selected node), `plan` and `suites` (licence filter; see `ATLAS.inPlan()` in `assets/js/licence.js`, covered by `npm test`). `selectNode(id)` is the one entry point for navigation from stars, search results, breadcrumbs and panel lists. `apply()` syncs CSS classes, threads and breadcrumbs from state. + +## Deep links + +The URL hash follows the view: `#?plan=&suites=`, for example `#ca?plan=e3&suites=defender`. `ATLAS.parseHash` and `ATLAS.formatHash` (route.js) validate and build it. In atlas.js, `syncUrl(push)` writes it (push for selection changes, replace for plan and suite changes) and `restore(animate)` applies it on load, `popstate` and `hashchange`. The default state has no hash. ## Relationships diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index a173a42..7c38d49 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -4,7 +4,7 @@ Ideas in rough priority order. Move items into GitHub issues as work starts. ## Near term -- [ ] **Deep links.** Put the selected node in the URL hash (`#ca`) so a specific feature can be shared or linked from a proposal. +- [x] **Deep links.** Put the selected node in the URL hash (`#ca`) so a specific feature can be shared or linked from a proposal. - [ ] **More constellations.** Decide whether Windows 365 joins Intune or gets its own. Consider Azure as a separate atlas. - [ ] **Entra Verified ID.** Left out of the October 2026 gap fill because Entra is at the 12-component limit. Needs a swap or a split. - [ ] **Theme toggle.** A button that sets `data-theme` on ``, remembered in `localStorage`. @@ -12,7 +12,7 @@ Ideas in rough priority order. Move items into GitHub issues as work starts. - [x] **Licensing review.** All 121 components checked against Microsoft Learn and the service plan CSV on 1 October 2026; date recorded in the data file. - [x] **Plan-based filter.** Business Basic, Standard and Premium, Office 365 E1, and Microsoft 365 E3, E5 and E7, with add-on suites as a separate control. - [x] **Frontline and Office 365 E3 plans.** F1, F3 and Office 365 E3 added on 1 October 2026, checked against the service plan CSV and Microsoft Learn. -- [ ] **Plan follow-ups.** Confirm Microsoft 365 F3 gets eDiscovery (Standard): Learn names Office 365 F3 only. Confirm the Purview Suite FLW covers Information Barriers and DSPM for AI (Learn publishes no plan list for either). Check whether the suites can be added to Office 365 E3. +- [ ] **Plan follow-ups.** Confirm Microsoft 365 F3 gets eDiscovery (Standard): Learn names Office 365 F3 only. Information Barriers is confirmed for the Purview Suite FLW (service plan CSV, 10 November 2026). DSPM for AI is still unconfirmed for the FLW suites, so it is shown as not included on F1/F3. Check whether the suites can be added to Office 365 E3. - [ ] **Licensing follow-ups.** Recheck Copilot Pages & Notebooks (whether Copilot Chat users get them without a licence) and Copilot Tuning (no published licensing yet). Repeat the full review each quarter. ## Medium term @@ -23,5 +23,5 @@ Ideas in rough priority order. Move items into GitHub issues as work starts. ## Maintenance -- [ ] Weekly link check (done: `.github/workflows/link-check.yml`). +- [x] Weekly link check (done: `.github/workflows/link-check.yml`). - [ ] Quarterly content review against Microsoft 365 roadmap and Message Center renames. diff --git a/index.html b/index.html index 87a8aa1..756c758 100644 --- a/index.html +++ b/index.html @@ -5,11 +5,20 @@ Constellate: a star chart of Microsoft 365 + + + + + + + + + - + @@ -39,9 +48,6 @@

    Constellate

    @@ -50,10 +56,12 @@

    Constellate

    Select a constellation to zoom in. Drag, scroll or pinch to look around.

    -

    Licensing shown is indicative. Confirm against current Microsoft plans before quoting.

    +

    Licensing shown is indicative. Confirm against current Microsoft plans before quoting.

    + + diff --git a/package.json b/package.json index 37da17e..a91da64 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,13 @@ { "name": "constellate", - "version": "0.1.0", + "version": "0.2.0", "private": true, "description": "Constellate: an interactive star chart of Microsoft 365 services, features, licensing and documentation.", "type": "module", "scripts": { "validate": "node tools/validate-data.mjs", + "test": "node --test \"tests/*.test.mjs\"", "start": "npx --yes http-server . -p 8080 -c-1 -o" }, - "engines": { "node": ">=18" } + "engines": { "node": ">=26" } } diff --git a/tests/helpers.mjs b/tests/helpers.mjs new file mode 100644 index 0000000..fc82c76 --- /dev/null +++ b/tests/helpers.mjs @@ -0,0 +1,22 @@ +// Loads data/services.js and the pure scripts in assets/js/ (all but atlas.js) into one vm context. +import { readFileSync, readdirSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import path from 'node:path'; +import vm from 'node:vm'; + +const root = fileURLToPath(new URL('../', import.meta.url)); + +export function loadAtlas() { + const sandbox = { window: {} }; + vm.createContext(sandbox); + const run = rel => vm.runInContext(readFileSync(path.join(root, rel), 'utf8'), sandbox, { filename: rel }); + run('data/services.js'); + const jsDir = path.join(root, 'assets', 'js'); + for (const f of readdirSync(jsDir).filter(f => f.endsWith('.js') && f !== 'atlas.js').sort()) run(`assets/js/${f}`); + return sandbox.window.ATLAS; +} + +export function byId(ATLAS, id) { + for (const s of ATLAS.SERVICES) for (const c of s.components ?? []) if (c.id === id) return c; + throw new Error(`Unknown component id: ${id}`); +} diff --git a/tests/licence.test.mjs b/tests/licence.test.mjs new file mode 100644 index 0000000..1f2eb42 --- /dev/null +++ b/tests/licence.test.mjs @@ -0,0 +1,68 @@ +import { test } from 'node:test'; +import assert from 'node:assert/strict'; +import { loadAtlas, byId } from './helpers.mjs'; + +const ATLAS = loadAtlas(); +const t = (id, plan, suites) => ATLAS.inPlan(byId(ATLAS, id), plan, suites); + +test('everything shows all', () => { + assert.equal(t('sentinel', 'all', []), true); +}); +test('add-ons only', () => { + assert.equal(t('sentinel', 'addon', []), true); + assert.equal(t('ca', 'addon', []), false); +}); +test('Business Basic is core only', () => { + assert.equal(t('mailboxes', 'bb', []), true); + assert.equal(t('dlp', 'bb', []), false); + assert.equal(t('desktop-apps', 'bb', []), false); +}); +test('Business Standard adds the apps', () => { + assert.equal(t('desktop-apps', 'bs', []), true); +}); +test('Office 365 E3 has no Entra P1 or MDE', () => { + assert.equal(t('ca', 'o3', []), false); + assert.equal(t('mde', 'o3', []), false); + assert.equal(t('dlp', 'o3', []), true); + assert.equal(t('mdo', 'o3', []), true); +}); +test('E3 suites unlock their own components', () => { + assert.equal(t('mdi', 'e3', []), false); + assert.equal(t('mdi', 'e3', ['defender']), true); + assert.equal(t('irm', 'e3', ['defender']), false); + assert.equal(t('irm', 'e3', ['purview']), true); +}); +test('suites do nothing on plans that cannot take them', () => { + assert.equal(t('mdi', 'bb', ['defender']), false); +}); +test('F1 exclusions and extras', () => { + assert.equal(t('mailboxes', 'f1', []), false); + assert.equal(t('ca', 'f1', []), true); + assert.equal(t('mde', 'f1', []), false); + assert.equal(t('mde', 'f1', ['defender']), true); + assert.equal(t('pim', 'f1', ['purview']), false); +}); +test('Entra ID P2 on frontline comes only with the Defender suite', () => { + assert.equal(t('pim', 'f1', ['purview']), false); + assert.equal(t('pim', 'f1', ['defender']), true); + assert.equal(t('idp', 'f3', ['purview']), false); + assert.equal(t('idp', 'f3', ['defender']), true); +}); +test('DSPM for AI is not in the frontline suites', () => { + assert.equal(t('dspmai', 'f1', ['purview']), false); + assert.equal(t('dspmai', 'f3', ['defender', 'purview']), false); + assert.equal(t('dspmai', 'e3', ['purview']), true); +}); +test('F3 archive needs the Purview Suite', () => { + assert.equal(t('archiving', 'f3', []), false); + assert.equal(t('archiving', 'f3', ['purview']), true); +}); +test('E5 stops below E7 and add-ons', () => { + assert.equal(t('mdi', 'e5', []), true); + assert.equal(t('iga', 'e5', []), false); + assert.equal(t('sentinel', 'e5', []), false); +}); +test('E7 excludes add-ons', () => { + assert.equal(t('iga', 'e7', []), true); + assert.equal(t('sentinel', 'e7', []), false); +}); diff --git a/tests/route.test.mjs b/tests/route.test.mjs new file mode 100644 index 0000000..56ef948 --- /dev/null +++ b/tests/route.test.mjs @@ -0,0 +1,48 @@ +import { test } from 'node:test'; +import assert from 'node:assert/strict'; +import { loadAtlas } from './helpers.mjs'; + +const ATLAS = loadAtlas(); +const DEF = { id: null, plan: 'all', suites: [] }; +const plain = (o) => JSON.parse(JSON.stringify(o)); // vm-realm objects fail strict deepEqual on prototypes +const parse = (h) => plain(ATLAS.parseHash(h)); + +test('empty hash is the default state', () => { + assert.deepEqual(parse(''), DEF); + assert.deepEqual(parse('#'), DEF); +}); +test('component and service ids', () => { + assert.equal(parse('#ca').id, 'ca'); + assert.equal(parse('#entra').id, 'entra'); +}); +test('plan and suites', () => { + assert.deepEqual(parse('#ca?plan=e3&suites=defender+purview'), + { id: 'ca', plan: 'e3', suites: ['defender', 'purview'] }); +}); +test('plan without an id', () => { + assert.deepEqual(parse('#?plan=addon'), { id: null, plan: 'addon', suites: [] }); +}); +test('unknown values fall back', () => { + assert.deepEqual(parse('#nope?plan=zz&suites=x'), DEF); +}); +test('suites dropped on plans that cannot take them', () => { + assert.deepEqual(parse('#ca?plan=bb&suites=defender').suites, []); +}); +test('malformed escapes do not throw', () => { + assert.deepEqual(parse('#%E0%A4%A'), DEF); +}); +test('suites keep data order', () => { + assert.deepEqual(parse('#?plan=e3&suites=purview+defender').suites, ['defender', 'purview']); +}); +test('format defaults to empty', () => { + assert.equal(ATLAS.formatHash({ id: null, plan: 'all', suites: [] }), ''); +}); +test('format round trip', () => { + const s = { id: 'mdi', plan: 'f1', suites: ['defender'] }; + assert.equal(ATLAS.formatHash(s), '#mdi?plan=f1&suites=defender'); + assert.deepEqual(parse(ATLAS.formatHash(s)), s); +}); +test('format drops stale suites and default plan', () => { + assert.equal(ATLAS.formatHash({ id: 'ca', plan: 'bb', suites: ['defender'] }), '#ca?plan=bb'); + assert.equal(ATLAS.formatHash({ id: 'ca', plan: 'all', suites: [] }), '#ca'); +}); diff --git a/tools/validate-data.mjs b/tools/validate-data.mjs index 5600749..b4e6093 100644 --- a/tools/validate-data.mjs +++ b/tools/validate-data.mjs @@ -1,5 +1,5 @@ #!/usr/bin/env node -// Validates data/services.js: IDs, licence tiers, cross-links, doc URLs and summary length. +// Validates data/services.js: IDs, licence tiers, cross-links, doc URLs and summary length, plus colour tokens in atlas.css. // Usage: node tools/validate-data.mjs (or: npm run validate) import { readFileSync } from 'node:fs'; import { fileURLToPath } from 'node:url'; @@ -8,12 +8,12 @@ import vm from 'node:vm'; const file = fileURLToPath(new URL('../data/services.js', import.meta.url)); const sandbox = { window: {} }; vm.runInNewContext(readFileSync(file, 'utf8'), sandbox, { filename: 'data/services.js' }); -const { LIC, SUITES, PLANS, SERVICES, LINKS } = sandbox.window.ATLAS ?? {}; +const { REVIEWED, LIC, SUITES, PLANS, SERVICES, LINKS } = sandbox.window.ATLAS ?? {}; const errors = [], warnings = []; const err = m => errors.push(m), warn = m => warnings.push(m); -if (!LIC || !SUITES || !PLANS || !SERVICES || !LINKS) { console.error('data/services.js must return { LIC, SUITES, PLANS, SERVICES, LINKS }'); process.exit(1); } +if (!LIC || !SUITES || !PLANS || !SERVICES || !LINKS) { console.error('data/services.js must return { REVIEWED, LIC, SUITES, PLANS, SERVICES, LINKS }'); process.exit(1); } // --urls: print every docs URL, one per line, for the link checker (URLs are built from L + path, so they can't be scraped from source). if (process.argv.includes('--urls')) { @@ -22,6 +22,17 @@ if (process.argv.includes('--urls')) { process.exit(0); } +// Review date: must be a real ISO date; warn when a quarterly review is overdue. +if (typeof REVIEWED !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(REVIEWED)) err('REVIEWED must be an ISO date string (YYYY-MM-DD)'); +else { + const reviewed = new Date(`${REVIEWED}T00:00:00Z`); + if (Number.isNaN(reviewed.getTime()) || reviewed.toISOString().slice(0, 10) !== REVIEWED) err(`REVIEWED "${REVIEWED}" is not a real date`); + else { + const days = Math.floor((Date.now() - reviewed.getTime()) / 86400000); + if (days > 100) warn(`licensing review is ${days} days old; a review is due each quarter`); + } +} + const ids = new Map(); const MAX_SUMMARY = 240; const DOC_PREFIX = 'https://learn.microsoft.com/'; @@ -30,6 +41,7 @@ for (const s of SERVICES) { for (const k of ['id', 'name', 'short', 'summary', 'docs', 'portal', 'x', 'y', 'angle', 'components']) if (s[k] === undefined) err(`service "${s.id ?? '?'}": missing "${k}"`); if (ids.has(s.id)) err(`duplicate id "${s.id}"`); ids.set(s.id, 'svc'); + if (s.docs && !s.docs.startsWith('https://')) err(`service "${s.id}": docs must be an https URL`); if (s.docs && !s.docs.startsWith(DOC_PREFIX)) warn(`service "${s.id}": docs is not a Microsoft Learn URL`); if (!s.portal?.startsWith('https://')) err(`service "${s.id}": portal must be https`); if (!s.components?.length) err(`service "${s.id}": has no components`); @@ -46,6 +58,7 @@ for (const s of SERVICES) { if (!SUITES?.[c.suite]) err(`${where}: unknown suite "${c.suite}" (use ${Object.keys(SUITES ?? {}).join(', ')})`); if (c.lic !== 'e5') err(`${where}: suite only applies to e5 components (this one is "${c.lic}")`); } + if (c.docs && !c.docs.startsWith('https://')) err(`${where}: docs must be an https URL`); if (c.docs && !c.docs.startsWith(DOC_PREFIX)) warn(`${where}: docs is not a Microsoft Learn URL`); if (c.docs?.includes('/en-us/') === false) warn(`${where}: docs URL has no /en-us/ locale`); if ((c.summary ?? '').length > MAX_SUMMARY) warn(`${where}: summary is ${c.summary.length} chars (aim for under ${MAX_SUMMARY})`); @@ -74,7 +87,7 @@ for (const [k, p] of Object.entries(PLANS)) { for (const id of p.without ?? []) { const c = cmpById.get(id); if (!c) err(`PLANS.${k}.without: "${id}" is not a component id`); - else if (c.lic === 'addon' || LIC[c.lic].rank > rank) warn(`PLANS.${k}.without: "${id}" isn't included by upTo "${p.upTo}" anyway`); + else if ((c.lic === 'addon' || LIC[c.lic].rank > rank) && !(p.suites && c.suite)) warn(`PLANS.${k}.without: "${id}" isn't included by upTo "${p.upTo}" anyway`); } if (p.suites !== undefined && p.suites !== true) { if (typeof p.suites !== 'object') err(`PLANS.${k}.suites: use true or { suiteKey: [component ids] }`); @@ -100,6 +113,17 @@ for (let i = 0; i < SERVICES.length; i++) for (let j = i + 1; j < SERVICES.lengt if (d < 330) warn(`services "${a.id}" and "${b.id}" are ${Math.round(d)} units apart; clusters may overlap (aim for 330+)`); } +// Colour tokens: every service needs a -- token in all three theme blocks (light, dark media query, dark attribute). +const css = readFileSync(fileURLToPath(new URL('../assets/css/atlas.css', import.meta.url)), 'utf8'); +const themeBlocks = [...css.matchAll(/\{([^{}]*--sky:[^{}]*)\}/g)].map(m => m[1]); +if (themeBlocks.length !== 3) err(`atlas.css: expected 3 theme blocks, found ${themeBlocks.length}`); +else { + themeBlocks.forEach((b, i) => { + for (const s of SERVICES) if (!new RegExp(String.raw`--${s.id}\s*:`).test(b)) err(`atlas.css: theme block ${i + 1} has no --${s.id} token`); + }); + if (themeBlocks[1].replace(/\s+/g, '') !== themeBlocks[2].replace(/\s+/g, '')) err('atlas.css: the two dark theme blocks differ'); +} + const count = SERVICES.reduce((n, s) => n + (s.components?.length ?? 0), 0); warnings.forEach(w => console.warn(`warn ${w}`)); errors.forEach(e => console.error(`error ${e}`));