diff --git a/compliance/FORMAT.md b/compliance/FORMAT.md index b941ca1..a20a060 100644 --- a/compliance/FORMAT.md +++ b/compliance/FORMAT.md @@ -6,7 +6,7 @@ results are shown over time, and fixes the contract so that **a different plan n The page at `/compliance/` contains no project name, no goal, no firm, no rule and no milestone. It reads all of them from one file. A VIM Flex page, or any other screen, can read the same file and follow the same rules. -- Format name: `openbep-compliance-series`, version `0.4` (draft). 0.2 added three optional counts per role; 0.3 the plan's escalation steps and the owner of a failing rule; 0.4 an icon per check. All optional. Older files still load. +- Format name: `openbep-compliance-series`, version `0.6` (draft). 0.2 added three optional counts per role; 0.3 the plan's escalation steps and the owner of a failing rule; 0.4 an icon per check; 0.5 the roles that use each check's data; 0.6 a plain-words sentence per check. All optional. Older files still load. - Example: [example-school.json](example-school.json), simulated, written by `build_example.py`. - Validator: [series.js](series.js), `validateSeries(doc)` returns a list of problems in plain words. The page runs it on every file and refuses a file that fails, with the reasons. @@ -42,8 +42,10 @@ plan roles[] { code, role, firm, document, from } from = null, or the date the role joins escalation[] the plan's steps when a firm misses milestones in a row, in order (optional, 0.3) model { server, project, source, schedule, cadenceDays (7 when absent) } -valueChecks[] { id, goal, label, icon } -rules[] { id, goal, label, limit, unit, limitText, direction, icon } +valueChecks[] { id, goal, label, icon, usedBy } +rules[] { id, goal, label, limit, unit, limitText, direction, icon, usedBy } + usedBy (optional, 0.5): role codes that need this data to do their own work. + help (optional, 0.6): one plain sentence saying why this check matters, for readers who do not know BIM. icon (optional, 0.4): one of value, code, material, fire, asset, room, workset, name, level, clash, warning, duplicate. Anything else, or none, shows the icon of the kind of check. direction: lowerIsBetter | higherIsBetter @@ -90,11 +92,23 @@ versions[] in order | Urgency | Overdue: open through a milestone it should have met. Will miss: closes after the milestone, or never. On course: closes in time. | | Severity | Required values: points below the target. Critical 15 or more, major 5 to 15, minor under 5. A rule in %: the same, in points from its limit. A counted rule: critical at half its limit or more beyond it, major from a tenth; with a limit of 0, critical from 10, major from 3. | | Payment check | Per firm, four conditions: its model was uploaded and checked in the latest working period; its own compliance is at the target; no model rule fails on its elements; nothing of its own is overdue. A rule not split by firm holds no single firm. The contract decides payment. | +| Late or ahead | values short of the target ÷ (values fixed − values broken per working period), against the working periods left | +| Firm verdict | Badly behind: 4 working periods or more late, or never reaches the target at its pace, or 2 milestones missed in a row. Behind: late by less, or an item overdue or going to miss. Otherwise on track. | +| Holds back | a firm holds back each other role named in `usedBy` of one of its open deficiencies | +| Share of what is missing | the firm's values short of the target ÷ all firms' values short | | Step set by the plan | milestones a firm missed in a row on its own elements, read against `plan.escalation` | | New elements arrive filled | newMet ÷ newRequired over the last four working periods | ## What every screen shows the same way +Three levels, from the owner to the investigator. The address keeps the level (`firm`, `item`). + +- **Project.** The gate, who needs attention first and who is doing well, one card per firm (verdict, compliance and trend, late or ahead, share of what is missing, who it holds back, milestones missed in a row, open items, payment claim), the five biggest problems, the milestone track, compliance over time. +- **Firm.** Its verdict and facts, its compliance over time, its deficiencies, its accountability row, its payment check. +- **Item.** One check of one firm: severity and urgency, the numbers now, the chart over every version, the timeline, the result at each milestone, and every version's numbers. + +The parts, in the order they were added: + 1. The gate: would this version pass the milestone, and which conditions fail. Then the summary: overall compliance, model rules met, forecast, versions checked. Then one card per milestone: date, target, result, failing rules, firms below the target. diff --git a/compliance/build_example.py b/compliance/build_example.py index ae63516..836ca3d 100644 --- a/compliance/build_example.py +++ b/compliance/build_example.py @@ -29,8 +29,8 @@ {'id': 'basics', 'name': 'Basics every plan requires', 'uses': ['Design in BIM, all disciplines']}, ] MILESTONES = [ - {'id': 'prelim100', 'name': 'Preliminary design 100%', 'date': '2027-03-26', 'targetPercent': 70}, - {'id': 'final90', 'name': 'Final design 90%', 'date': '2027-06-25', 'targetPercent': 85}, + {'id': 'prelim100', 'name': 'Preliminary design', 'date': '2027-03-26', 'targetPercent': 70}, + {'id': 'final90', 'name': 'Final design', 'date': '2027-06-25', 'targetPercent': 85}, {'id': 'ifc', 'name': 'Issued for construction', 'date': '2027-09-10', 'targetPercent': 95}, {'id': 'constr', 'name': 'Construction, first coordination cycle', 'date': '2027-11-26', 'targetPercent': 95}, ] @@ -39,22 +39,22 @@ # Value checks: required values that must be filled with a real value. k = required values per element, by role. # lag < 1 means the role fills this check later than its other work. VALUE_CHECKS = [ - {'id': 'assembly-code', 'icon': 'code', 'goal': 'cost', 'label': 'Assembly Code filled', 'k': {'ARCH': 1, 'STRUCT': 1, 'MECH': 1, 'CON': .2}, 'lag': {'MECH': .85}}, - {'id': 'real-material', 'icon': 'material', 'goal': 'cost', 'label': 'Elements with a real material', 'k': {'ARCH': 1, 'STRUCT': 1}, 'lag': {'ARCH': .9}}, - {'id': 'lod-params', 'icon': 'value', 'goal': 'change', 'label': 'Parameters required by the LOD matrix at this milestone', 'k': {'ARCH': 2.2, 'STRUCT': 2.6, 'MECH': 2.0, 'CON': .5}, 'lag': {}}, - {'id': 'fire-rating', 'icon': 'fire', 'goal': 'change', 'label': 'Fire rating on walls, doors and floors', 'k': {'ARCH': .35, 'STRUCT': .2}, 'lag': {'ARCH': 1.05}}, - {'id': 'asset-data', 'icon': 'asset', 'goal': 'handover', 'label': 'Equipment asset data (OB_ asset parameters)', 'k': {'MECH': 1.6, 'ARCH': .15, 'CON': 3.0}, 'lag': {'MECH': .55, 'ARCH': .7, 'CON': .8}}, - {'id': 'rooms', 'icon': 'room', 'goal': 'handover', 'label': 'Rooms numbered and named by the plan', 'k': {'ARCH': .12}, 'lag': {'ARCH': 1.1}}, - {'id': 'worksets', 'icon': 'workset', 'goal': 'basics', 'label': 'Elements on a named workset', 'k': {'ARCH': 1, 'STRUCT': 1, 'MECH': 1, 'CON': 1}, 'lag': {'ARCH': 1.15, 'STRUCT': 1.2, 'MECH': 1.1, 'CON': 1.2}}, - {'id': 'view-names', 'icon': 'name', 'goal': 'basics', 'label': 'Views named by the naming rules', 'k': {'ARCH': .06, 'STRUCT': .05, 'MECH': .05, 'CON': .03}, 'lag': {'MECH': .8}}, + {'id': 'assembly-code', 'help': 'Every element needs its cost code so quantities can be priced.', 'usedBy': ['CON'], 'icon': 'code', 'goal': 'cost', 'label': 'Assembly Code filled', 'k': {'ARCH': 1, 'STRUCT': 1, 'MECH': 1, 'CON': .2}, 'lag': {'MECH': .85}}, + {'id': 'real-material', 'help': 'An element with a placeholder material cannot be measured or priced.', 'icon': 'material', 'goal': 'cost', 'label': 'Elements with a real material', 'k': {'ARCH': 1, 'STRUCT': 1}, 'lag': {'ARCH': .9}}, + {'id': 'lod-params', 'help': 'The information the plan asks for on each element at this stage of the project.', 'icon': 'value', 'goal': 'change', 'label': 'Parameters required by the LOD matrix at this milestone', 'k': {'ARCH': 2.2, 'STRUCT': 2.6, 'MECH': 2.0, 'CON': .5}, 'lag': {}}, + {'id': 'fire-rating', 'help': 'Walls, doors and floors must carry their fire rating so the other trades can coordinate with them.', 'usedBy': ['MECH'], 'icon': 'fire', 'goal': 'change', 'label': 'Fire rating on walls, doors and floors', 'k': {'ARCH': .35, 'STRUCT': .2}, 'lag': {'ARCH': 1.05}}, + {'id': 'asset-data', 'help': 'Each piece of equipment needs its maintenance data so the owner can run the building after handover.', 'usedBy': ['CON'], 'icon': 'asset', 'goal': 'handover', 'label': 'Equipment asset data (OB_ asset parameters)', 'k': {'MECH': 1.6, 'ARCH': .15, 'CON': 3.0}, 'lag': {'MECH': .55, 'ARCH': .7, 'CON': .8}}, + {'id': 'rooms', 'help': 'Rooms need a number and a name so equipment and finishes can be tied to a place.', 'usedBy': ['MECH'], 'icon': 'room', 'goal': 'handover', 'label': 'Rooms numbered and named by the plan', 'k': {'ARCH': .12}, 'lag': {'ARCH': 1.1}}, + {'id': 'worksets', 'help': 'Elements must sit on a named workset so each team can find and control its own work.', 'icon': 'workset', 'goal': 'basics', 'label': 'Elements on a named workset', 'k': {'ARCH': 1, 'STRUCT': 1, 'MECH': 1, 'CON': 1}, 'lag': {'ARCH': 1.15, 'STRUCT': 1.2, 'MECH': 1.1, 'CON': 1.2}}, + {'id': 'view-names', 'help': 'Views named by the rules can be found by everyone on the project.', 'icon': 'name', 'goal': 'basics', 'label': 'Views named by the naming rules', 'k': {'ARCH': .06, 'STRUCT': .05, 'MECH': .05, 'CON': .03}, 'lag': {'MECH': .8}}, ] RULES = [ - {'id': 'on-level', 'icon': 'level', 'goal': 'cost', 'label': 'Elements on a level', 'limit': 95, 'unit': '%', 'limitText': 'at least 95 %', 'direction': 'higherIsBetter'}, - {'id': 'clashes', 'icon': 'clash', 'goal': 'change', 'label': 'Clashes open for more than one coordination cycle', 'limit': 25, 'unit': '', 'limitText': 'at most 25', 'direction': 'lowerIsBetter'}, - {'id': 'warnings', 'icon': 'warning', 'goal': 'change', 'label': 'Revit warnings', 'limit': 1500, 'unit': '', 'limitText': 'at most 1,500', 'direction': 'lowerIsBetter'}, - {'id': 'dup-mark', 'icon': 'duplicate', 'goal': 'handover', 'label': 'No duplicate Mark', 'limit': 0, 'unit': '', 'limitText': 'limit 0', 'direction': 'lowerIsBetter'}, - {'id': 'worksets-exist', 'icon': 'workset', 'goal': 'basics', 'label': 'The named worksets exist', 'limit': 0, 'unit': '', 'limitText': 'limit 0 missing', 'direction': 'lowerIsBetter'}, - {'id': 'dup-levels', 'icon': 'level', 'goal': 'basics', 'label': 'Duplicate levels', 'limit': 0, 'unit': '', 'limitText': 'limit 0', 'direction': 'lowerIsBetter'}, + {'id': 'on-level', 'help': 'An element that is not tied to a level cannot be counted by floor.', 'usedBy': ['CON'], 'icon': 'level', 'goal': 'cost', 'label': 'Elements on a level', 'limit': 95, 'unit': '%', 'limitText': 'at least 95 %', 'direction': 'higherIsBetter'}, + {'id': 'clashes', 'help': 'Places where elements of two firms occupy the same space and nobody has resolved it.', 'usedBy': ['ARCH', 'STRUCT', 'MECH', 'CON'], 'icon': 'clash', 'goal': 'change', 'label': 'Clashes open for more than one coordination cycle', 'limit': 25, 'unit': '', 'limitText': 'at most 25', 'direction': 'lowerIsBetter'}, + {'id': 'warnings', 'help': 'Revit warnings point to modelling errors that make quantities unreliable.', 'icon': 'warning', 'goal': 'change', 'label': 'Revit warnings', 'limit': 1500, 'unit': '', 'limitText': 'at most 1,500', 'direction': 'lowerIsBetter'}, + {'id': 'dup-mark', 'help': 'Two pieces of equipment with the same Mark cannot be told apart at handover.', 'icon': 'duplicate', 'goal': 'handover', 'label': 'No duplicate Mark', 'limit': 0, 'unit': '', 'limitText': 'limit 0', 'direction': 'lowerIsBetter'}, + {'id': 'worksets-exist', 'help': 'The worksets named in the plan must exist in every model.', 'icon': 'workset', 'goal': 'basics', 'label': 'The named worksets exist', 'limit': 0, 'unit': '', 'limitText': 'limit 0 missing', 'direction': 'lowerIsBetter'}, + {'id': 'dup-levels', 'help': 'Two levels at the same height make elements land on the wrong floor.', 'icon': 'level', 'goal': 'basics', 'label': 'Duplicate levels', 'limit': 0, 'unit': '', 'limitText': 'limit 0', 'direction': 'lowerIsBetter'}, ] D = date.fromisoformat @@ -201,13 +201,13 @@ def rule_values(day, i): versions.append(v) doc = { - 'format': 'openbep-compliance-series', 'formatVersion': '0.4', 'example': True, + 'format': 'openbep-compliance-series', 'formatVersion': '0.6', 'example': True, 'note': 'SIMULATED. Invented numbers for a made-up school project. No real model, firm or VIM Server was measured. Written by compliance/build_example.py.', 'plan': {'name': 'Example: Primary school renovation and extension', 'owner': 'School service centre (example)', 'delivery': 'Design-bid-build', 'goals': GOALS, 'milestones': MILESTONES, 'holidays': HOLIDAYS, 'roles': ROLES, 'escalation': ESCALATION}, 'model': {'server': 'VIM Server (simulated)', 'project': 'Primary school (example)', 'source': 'SCH-FEDERATED.vim', 'schedule': 'One version every Friday, built from the Revit models each firm uploaded that week.'}, - 'valueChecks': [{k: v for k, v in vc.items() if k in ('id', 'goal', 'label', 'icon')} for vc in VALUE_CHECKS], + 'valueChecks': [{k: v for k, v in vc.items() if k in ('id', 'goal', 'label', 'icon', 'usedBy', 'help')} for vc in VALUE_CHECKS], 'rules': RULES, 'versions': versions, } diff --git a/compliance/example-school.json b/compliance/example-school.json index 8f3bc69..b5a3d80 100644 --- a/compliance/example-school.json +++ b/compliance/example-school.json @@ -1,6 +1,6 @@ { "format": "openbep-compliance-series", - "formatVersion": "0.4", + "formatVersion": "0.6", "example": true, "note": "SIMULATED. Invented numbers for a made-up school project. No real model, firm or VIM Server was measured. Written by compliance/build_example.py.", "plan": { @@ -43,13 +43,13 @@ "milestones": [ { "id": "prelim100", - "name": "Preliminary design 100%", + "name": "Preliminary design", "date": "2027-03-26", "targetPercent": 70 }, { "id": "final90", - "name": "Final design 90%", + "name": "Final design", "date": "2027-06-25", "targetPercent": 85 }, @@ -118,48 +118,68 @@ "valueChecks": [ { "id": "assembly-code", + "help": "Every element needs its cost code so quantities can be priced.", + "usedBy": [ + "CON" + ], "icon": "code", "goal": "cost", "label": "Assembly Code filled" }, { "id": "real-material", + "help": "An element with a placeholder material cannot be measured or priced.", "icon": "material", "goal": "cost", "label": "Elements with a real material" }, { "id": "lod-params", + "help": "The information the plan asks for on each element at this stage of the project.", "icon": "value", "goal": "change", "label": "Parameters required by the LOD matrix at this milestone" }, { "id": "fire-rating", + "help": "Walls, doors and floors must carry their fire rating so the other trades can coordinate with them.", + "usedBy": [ + "MECH" + ], "icon": "fire", "goal": "change", "label": "Fire rating on walls, doors and floors" }, { "id": "asset-data", + "help": "Each piece of equipment needs its maintenance data so the owner can run the building after handover.", + "usedBy": [ + "CON" + ], "icon": "asset", "goal": "handover", "label": "Equipment asset data (OB_ asset parameters)" }, { "id": "rooms", + "help": "Rooms need a number and a name so equipment and finishes can be tied to a place.", + "usedBy": [ + "MECH" + ], "icon": "room", "goal": "handover", "label": "Rooms numbered and named by the plan" }, { "id": "worksets", + "help": "Elements must sit on a named workset so each team can find and control its own work.", "icon": "workset", "goal": "basics", "label": "Elements on a named workset" }, { "id": "view-names", + "help": "Views named by the rules can be found by everyone on the project.", "icon": "name", "goal": "basics", "label": "Views named by the naming rules" @@ -168,6 +188,10 @@ "rules": [ { "id": "on-level", + "help": "An element that is not tied to a level cannot be counted by floor.", + "usedBy": [ + "CON" + ], "icon": "level", "goal": "cost", "label": "Elements on a level", @@ -178,6 +202,13 @@ }, { "id": "clashes", + "help": "Places where elements of two firms occupy the same space and nobody has resolved it.", + "usedBy": [ + "ARCH", + "STRUCT", + "MECH", + "CON" + ], "icon": "clash", "goal": "change", "label": "Clashes open for more than one coordination cycle", @@ -188,6 +219,7 @@ }, { "id": "warnings", + "help": "Revit warnings point to modelling errors that make quantities unreliable.", "icon": "warning", "goal": "change", "label": "Revit warnings", @@ -198,6 +230,7 @@ }, { "id": "dup-mark", + "help": "Two pieces of equipment with the same Mark cannot be told apart at handover.", "icon": "duplicate", "goal": "handover", "label": "No duplicate Mark", @@ -208,6 +241,7 @@ }, { "id": "worksets-exist", + "help": "The worksets named in the plan must exist in every model.", "icon": "workset", "goal": "basics", "label": "The named worksets exist", @@ -218,6 +252,7 @@ }, { "id": "dup-levels", + "help": "Two levels at the same height make elements land on the wrong floor.", "icon": "level", "goal": "basics", "label": "Duplicate levels", diff --git a/compliance/index.html b/compliance/index.html index af917d2..c36e1ab 100644 --- a/compliance/index.html +++ b/compliance/index.html @@ -198,6 +198,22 @@ .steps .pass .nd{background:var(--good);border-color:var(--good);color:var(--surface)}.steps .miss .nd{background:var(--bad);border-color:var(--bad);color:var(--surface)}.steps .now .nd{border-color:var(--accent);color:var(--accent-ink)} .steps b{color:var(--ink);font-weight:500} .steps .td{position:absolute;top:-28px;transform:translateX(-50%);font-size:10px;color:var(--ink);white-space:nowrap;line-height:1.15;z-index:2} +#app[data-level="1"] [data-lv]:not([data-lv~="1"]),#app[data-level="2"] [data-lv]:not([data-lv~="2"]),#app[data-level="3"] [data-lv]:not([data-lv~="3"]),#app[data-level="x"] [data-lv]:not([data-lv~="x"]){display:none!important} +.crumb{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:center;margin-top:12px;font-size:14px}.crumb:empty{display:none}.crumb b{font-weight:700} +.crumb button,.lnk{background:none;border:0;padding:0;color:var(--accent-ink);cursor:pointer;font:inherit;font-weight:500;text-align:left;text-decoration:underline} +#dig>summary{font-size:15px;font-weight:700;color:var(--ink);padding:12px 16px;border:1px solid var(--line);border-radius:var(--r-md);background:var(--surface);margin-top:26px} +.fc.good{border-top-color:var(--good)}.fc.warn{border-top-color:var(--warn)}.fc.bad{border-top-color:var(--bad)} +.big{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px}.big .mv{font-size:26px;font-weight:700}.big .mv small{font-size:13px;font-weight:400;color:var(--muted)} +.lead{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;margin-top:12px} +.lead>div{border:1px solid var(--line);border-left:5px solid var(--faint);border-radius:var(--r-md);background:var(--surface);padding:10px 14px;display:flex;flex-direction:column;gap:4px;align-items:flex-start;min-width:0} +.lead .bad{border-left-color:var(--bad)}.lead .good{border-left-color:var(--good)} +.lead .k{font-size:12px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}.lead .t{font-size:17px;font-weight:700} +.gate.one{margin-top:12px;border-left-width:5px}.gate.one .gt{font-size:17px} +.example.hist{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;justify-content:space-between;border-left-color:var(--accent);background:var(--accent-soft)} +@media (pointer:coarse){.btn,select{min-height:44px}.crumb button,.lnk{padding:10px 0}details>summary{padding:10px 0}.top nav a{padding:8px 0}} +@media print{.foot,#notice .btn{display:none!important}} +.gate.warn{border-left-color:var(--warn)}.gate .dl{min-width:0} +.tl.big{width:100%;max-width:460px} .rules{margin:8px 0 0;padding-left:18px;font-size:13px;color:var(--muted);max-width:100ch}.rules li{margin:2px 0}.rules b{color:var(--ink)} td small.sm{display:block;color:var(--muted);font-size:12px} .seg{display:inline-flex}.seg .btn{border-radius:0;margin-left:-1px}.seg .btn:first-child{border-radius:var(--r-sm) 0 0 var(--r-sm);margin-left:0}.seg .btn:last-child{border-radius:0 var(--r-sm) var(--r-sm) 0} @@ -208,10 +224,11 @@ .gate li{display:inline-flex;gap:6px;align-items:baseline} .gate .ok{color:var(--good);font-weight:700}.gate .no{color:var(--bad);font-weight:700} .bar .w{position:absolute;top:0;bottom:0;background:repeating-linear-gradient(135deg,var(--bad) 0 2px,transparent 2px 4px);opacity:.75} +.chart .miss{fill:var(--bad-soft)}.chart .solid{fill:var(--surface)}.chart .none{fill:none;stroke:none} .chart .scope{fill:none;stroke:var(--ink);stroke-width:1.6;opacity:.75} tr.dim td{opacity:.45} @media print{ - .top nav,.ctl,.example,details,#firmsBtn,.seg{display:none!important} + .top nav,.ctl,.example,details:not(.keep),#firmsBtn,.seg,.crumb,.msc .btn,.lead .btn{display:none!important} body{background:#fff;font-size:11px}.wrap{max-width:none;padding:0} .top{background:none;color:#000}.top .home,.top h1{color:#000} .panel,.tile,.gate,.tw{break-inside:avoid} @@ -271,44 +288,66 @@ -
-
-
+
+ +
+
+
+
+

Compliance over time

The plan asks for more values as firms model more and as each milestone raises the bar. The dark line is what is required, the blue area what is filled, the red band what is missing.
+
+
+
+
+
Show the numbers as a table
+
+
-
+
+
+
+
+

The firms

The firm that needs the most attention comes first. Open a firm to see its work.
+
+
How these verdicts are worked out
    +
  • Late or ahead: the values a firm still has to fill for the target, divided by what it fills a week (net of what it breaks) over its last four working weeks, against the working weeks left to the milestone. It is a straight line from four weeks, not a promise.
  • +
  • Badly behind: four working weeks or more late, or not reaching the target at its pace, or two milestones missed in a row. Behind: late by less, or an item overdue or going to miss the milestone. On track: neither. The card says which rule applied.
  • +
  • Share of what is missing: the firm's missing values for the target, out of all firms' missing values.
  • +
  • Holds back: the plan lists which roles use each piece of data. A firm holds another back when one of its open items is data the other uses. The page does not measure the delay it causes.
  • +
  • Payment conditions: four conditions per firm, the same for every plan: model uploaded and checked, own compliance at the target, no model rule failing on its elements, nothing overdue from an earlier milestone. The contract decides payment; these count only where the contract makes them part of a valid payment claim.
  • +
+
+
+

For the meeting: the biggest problems

The most urgent and most severe open items across all firms, with what to ask each owner for. Open one for its full history.
+
+
+ + +

Major milestones

What the model had to reach at each milestone, and what it reached. Seen from the version selected above.
    -
    +
    Show each milestone in detail
    -
    +

    Active deficiencies

      -
      +

      Accountability

      Each firm's record against the milestones, what it has open now, and the step the plan sets.
      -
      +

      Payment check

      • A claim is valid under the plan when the firm meets all four conditions. The contract decides payment: these conditions count only where the contract makes them part of a valid payment claim.
      -
      -

      Overall compliance

      Share of the values the plan requires that are filled, in every element of every firm's model. The dashed line is the target of the milestone in force.
      -
      -
      -
      -
      -
      Show the numbers as a table
      -
      -
      - +
      Show more detail: pace by firm, each goal, what changed since another version, every check by version

      Who contributes at what pace

      Each firm's own elements. Pace is counted over the last four working weeks; holiday weeks are not counted.
      @@ -335,6 +374,8 @@

      Values fixed each week, by firm

      Every check, every version

      Green is met, red is failed. The arrow shows which way the value moved since the version before; its colour says whether that is better or worse. Select a column or a cell to open that version.
      +
      +
      ${msList()}
      `; + $('#lgOverall').innerHTML=`Required by the plan (grows as firms model more and as milestones ask for more)Filled, ${esc(who)}, with the share filled at each milestoneRequired and not filledTarget in valuesAgreed holiday, not countedVersion not checked
      ${msList()}
      `; return; } el.dataset.label='Overall compliance by version, with the milestone targets'; @@ -737,8 +933,9 @@

      How the numbers are worked out

      /* ---------- pace ---------- */ function paceOf(c,i){ const v=V[i],r=v.byRole[c];if(!r) return null; - const d=dayOf(v),from=addDays(d,-4*CAD());let fixed=0,broken=0,uploads=0,weeks=0,nq=0,nm=0; - for(let w=addDays(from,CAD());w<=d;w=addDays(w,CAD())){if(isHol(w)) continue;weeks++;const x=V.find(u=>dayOf(u)===w);if(x&&checked(x)&&x.byRole[c]){fixed+=x.byRole[c].valuesFixed;broken+=x.byRole[c].valuesBroken;nq+=x.byRole[c].newRequired||0;nm+=x.byRole[c].newMet||0;if(x.byRole[c].uploaded) uploads++}else if(x&&!checked(x)) uploads+=x.uploadedBy.includes(c)?1:0} + const d=dayOf(v),ws=[];let fixed=0,broken=0,uploads=0,weeks=0,nq=0,nm=0; + for(let w=d;ws.length<4&&w>=dayOf(V[0]);w=addDays(w,-CAD())) if(!isHol(w)) ws.push(w); + for(const w of ws){const x=V.find(u=>dayOf(u)===w);if(x&&checked(x)&&!x.byRole[c]) continue;weeks++;if(x&&checked(x)&&x.byRole[c]){fixed+=x.byRole[c].valuesFixed;broken+=x.byRole[c].valuesBroken;nq+=x.byRole[c].newRequired||0;nm+=x.byRole[c].newMet||0;if(x.byRole[c].uploaded) uploads++}else if(x&&!checked(x)) uploads+=x.uploadedBy.includes(c)?1:0} const m=msOf(v),left=workingWeeks(d,m.date),gap=Math.max(0,Math.ceil(m.targetPercent/100*r.required-r.met)); return {fixed:fixed/Math.max(1,weeks),broken:broken/Math.max(1,weeks),uploads,weeks,left,gap,need:left>0?gap/left:null,m,r,clean:nq?100*nm/nq:null}; } @@ -746,7 +943,7 @@

      How the numbers are worked out

      const v=V[sel],b=cmp>=0?V[cmp]:null; const hasWrong=Object.values(v.byRole).some(r=>r.wrong!=null),hasNew=V.some(u=>checked(u)&&Object.values(u.byRole).some(r=>r.newRequired!=null)); const rows=ROLES.filter(r=>v.byRole[r.code]).map(ro=>{const c=ro.code,p=paceOf(c,sel),now=roleP(v,c),was=b?roleP(b,c):null,net=p.fixed-p.broken; - let st;if(p.gap===0) st='✓ Target met';else if(p.left===0) st=`✕ ${fmt(p.gap)} values short at the milestone`;else if(net>=p.need) st='✓ On pace';else if(net>=p.need*.75) st='! Slightly behind';else st='✕ Behind'; + let st;if(p.gap===0) st='✓ Target met';else if(p.left===0) st=`✕ ${fmt(p.gap)} values missing at the milestone`;else if(net>=p.need) st='✓ On pace';else if(net>=p.need*.75) st='! Slightly behind';else st='✕ Behind'; const firstWeek=ro.from&&ro.from>addDays(dayOf(v),-4*CAD())?' (joined '+dShort(ro.from)+')':''; const wr=p.r.wrong!=null?100*p.r.wrong/p.r.required:0,empty=p.r.required-p.r.met-(p.r.wrong||0); return ` diff --git a/compliance/series.js b/compliance/series.js index ae2e8c9..9268291 100644 --- a/compliance/series.js +++ b/compliance/series.js @@ -13,7 +13,7 @@ const need = (ok, msg) => { if (!ok) e.push(msg); return ok; }; if (!need(d && typeof d === 'object', 'The file is not a JSON object.')) return e; need(d.format === 'openbep-compliance-series', 'format must be "openbep-compliance-series".'); - need(typeof d.formatVersion === 'string' && /^0\./.test(d.formatVersion), 'formatVersion must be 0.x (this page reads 0.1 to 0.4).'); + need(typeof d.formatVersion === 'string' && /^0\./.test(d.formatVersion), 'formatVersion must be 0.x (this page reads 0.1 to 0.6).'); const p = d.plan || {}; need(typeof p.name === 'string' && p.name, 'plan.name is missing.'); const goals = Array.isArray(p.goals) ? p.goals : [], ms = Array.isArray(p.milestones) ? p.milestones : [], roles = Array.isArray(p.roles) ? p.roles : []; @@ -28,8 +28,8 @@ (p.holidays || []).forEach((h, i) => need(isDate(h.from) && isDate(h.to) && h.to >= h.from, `plan.holidays[${i}] needs from and to dates, in order.`)); const vcs = Array.isArray(d.valueChecks) ? d.valueChecks : [], rules = Array.isArray(d.rules) ? d.rules : []; const vid = new Set(), rid = new Set(); - vcs.forEach((c, i) => { need(c.id && c.label, `valueChecks[${i}] needs id and label.`); need(gid.has(c.goal), `Value check "${c.label}" names goal "${c.goal}", which is not in plan.goals.`); need(c.icon == null || typeof c.icon === 'string', `Value check "${c.label}": icon must be a word.`); vid.add(c.id); }); - rules.forEach((r, i) => { need(r.id && r.label, `rules[${i}] needs id and label.`); need(gid.has(r.goal), `Rule "${r.label}" names goal "${r.goal}", which is not in plan.goals.`); need(r.icon == null || typeof r.icon === 'string', `Rule "${r.label}": icon must be a word.`); need(DIRS.includes(r.direction), `Rule "${r.label}": direction must be lowerIsBetter or higherIsBetter.`); need(isNum(r.limit), `Rule "${r.label}" needs a numeric limit.`); need(typeof r.limitText === 'string' && r.limitText, `Rule "${r.label}" needs limitText (for example "at most 1,500").`); rid.add(r.id); }); + vcs.forEach((c, i) => { need(c.id && c.label, `valueChecks[${i}] needs id and label.`); need(gid.has(c.goal), `Value check "${c.label}" names goal "${c.goal}", which is not in plan.goals.`); need(c.icon == null || typeof c.icon === 'string', `Value check "${c.label}": icon must be a word.`); need(c.usedBy == null || (Array.isArray(c.usedBy) && c.usedBy.every(x => codes.has(x))), `Value check "${c.label}": usedBy must list role codes from plan.roles.`); vid.add(c.id); }); + rules.forEach((r, i) => { need(r.id && r.label, `rules[${i}] needs id and label.`); need(gid.has(r.goal), `Rule "${r.label}" names goal "${r.goal}", which is not in plan.goals.`); need(r.icon == null || typeof r.icon === 'string', `Rule "${r.label}": icon must be a word.`); need(r.usedBy == null || (Array.isArray(r.usedBy) && r.usedBy.every(x => codes.has(x))), `Rule "${r.label}": usedBy must list role codes from plan.roles.`); need(DIRS.includes(r.direction), `Rule "${r.label}": direction must be lowerIsBetter or higherIsBetter.`); need(isNum(r.limit), `Rule "${r.label}" needs a numeric limit.`); need(typeof r.limitText === 'string' && r.limitText, `Rule "${r.label}" needs limitText (for example "at most 1,500").`); rid.add(r.id); }); need(vcs.length, 'valueChecks needs at least one check: compliance is the share of required values filled.'); const vs = Array.isArray(d.versions) ? d.versions : []; if (!need(vs.length, 'versions is empty.')) return e; diff --git a/compliance/test/test_page.js b/compliance/test/test_page.js index f9999b5..c8a1647 100644 --- a/compliance/test/test_page.js +++ b/compliance/test/test_page.js @@ -10,6 +10,7 @@ const ex = JSON.parse(fs.readFileSync(path.join(root, 'compliance', 'example-sch const clone = o => JSON.parse(JSON.stringify(o)); function keepRoles(d, codes) { + for (const x of [...d.valueChecks, ...d.rules]) if (x.usedBy) x.usedBy = x.usedBy.filter(c => codes.includes(c)); d.plan.roles = d.plan.roles.filter(r => codes.includes(r.code)); for (const v of d.versions) { v.uploadedBy = v.uploadedBy.filter(c => codes.includes(c)); @@ -22,6 +23,7 @@ function keepRoles(d, codes) { } function renameRoles(d, map) { for (const r of d.plan.roles) r.code = map[r.code]; + for (const x of [...d.valueChecks, ...d.rules]) if (x.usedBy) x.usedBy = x.usedBy.map(c => map[c]); for (const v of d.versions) { v.uploadedBy = v.uploadedBy.map(c => map[c]); if (v.state !== 'checked') continue; @@ -103,13 +105,37 @@ const server = http.createServer((req, res) => { // Select the first version and back, to exercise the "no earlier version" path. await page.selectOption('#selV', '0'); await page.waitForTimeout(50); ok(!errs.length, `${k} @${width}: first version selectable`); + // Round five: three levels. The overview, then a firm, then one item, and back up. + await page.selectOption('#selV', String(d.versions.indexOf(last))); await page.waitForTimeout(50); + const vis = sel => page.evaluate(q => { const e = document.querySelector(q); return !!e && e.getClientRects().length > 0; }, sel); + const cards = await page.locator('#firms .fc').count(); + ok(cards === Object.keys(last.byRole).length && await vis('#firms') && !(await vis('#gaps')) && !(await vis('#item')), `${k} @${width}: level 1 shows one card per firm and no detail (${cards})`); + await page.locator('#firms .fc .btn').first().click(); await page.waitForTimeout(50); + ok(await vis('#firmSum .gate') && await vis('#chOverall svg') && !(await vis('#firms')) && await vis('#crumb button'), `${k} @${width}: level 2 shows the firm summary, its chart and the way back`); + const l2 = await page.evaluate(() => ({ wide: document.documentElement.scrollWidth > innerWidth + 1, cut: [...document.querySelectorAll('#firmSum *, #gaps *, #pay *, #acc *')].filter(e => { const b = e.getBoundingClientRect(); return innerWidth < 700 && !e.closest('svg') && b.width && b.right > innerWidth + 1; }).length })); + ok(!l2.wide && !l2.cut, `${k} @${width}: level 2 fits the screen (${l2.cut})`); + const items = await page.locator('#gaps .lnk').count(); + if (items) { + await page.locator('#gaps .lnk').first().click(); await page.waitForTimeout(50); + ok(await vis('#chItem svg') && !(await vis('#gaps')) && new URLSearchParams(await page.evaluate(() => location.search)).get('item'), `${k} @${width}: level 3 shows one item with its chart`); + const l3 = await page.evaluate(() => ({ wide: document.documentElement.scrollWidth > innerWidth + 1, cut: [...document.querySelectorAll('#item *')].filter(e => { const b = e.getBoundingClientRect(); return !e.closest('.tw') && !e.closest('svg') && b.width && b.right > innerWidth + 1; }).length })); + ok(!l3.wide && !l3.cut, `${k} @${width}: level 3 fits the screen`); + const u3 = await page.evaluate(() => location.search); + await page.goto(`http://127.0.0.1:${port}/compliance/${u3}`); await page.waitForSelector('#chItem svg'); + ok(await vis('#item .gate'), `${k} @${width}: the link reopens the same item`); + } + await page.locator('#crumb button').first().click(); await page.waitForTimeout(50); + ok(await vis('#firms') && !(await vis('#crumb')), `${k} @${width}: the trail leads back to the overview`); + ok(!errs.length, `${k} @${width}: no page errors across the levels ${errs.join(' ')}`); + const l1 = await page.evaluate(() => ({ wide: document.documentElement.scrollWidth > innerWidth + 1, cut: [...document.querySelectorAll('#lead *, #firms *, #top *')].filter(e => { const b = e.getBoundingClientRect(); return !e.closest('svg') && b.width && b.right > innerWidth + 1; }).length })); + ok(!l1.wide && !l1.cut, `${k} @${width}: level 1 fits the screen (${l1.cut})`); // Round two: one firm only, the values chart, and a link that reopens the same view. const code = Object.keys(last.byRole)[0]; await page.selectOption('#selV', String(d.versions.indexOf(last))); await page.selectOption('#firmF', code); await page.click('#modeV'); await page.waitForTimeout(50); const r2 = await page.evaluate(() => ({ gate: !!document.querySelector('#gate .gate'), gaps: !!document.querySelector('#gaps').textContent.trim() && document.querySelectorAll('#msCards .msc').length > 0 && document.querySelectorAll('#acc tbody tr').length > 0, url: location.search, scope: !!document.querySelector('#chOverall .scope'), wide: document.documentElement.scrollWidth > innerWidth + 1 })); ok(!errs.length && r2.gate && r2.gaps && r2.scope && !r2.wide, `${k} @${width}: firm filter, gate, gaps and values chart ${errs.join(' ')}`); ok(new URLSearchParams(r2.url).get('firm') === code && new URLSearchParams(r2.url).get('v') === String(last.order), `${k} @${width}: the address keeps version and firm (${r2.url})`); - await page.goto(`http://127.0.0.1:${port}/compliance/${r2.url}`); await page.waitForSelector('#tiles .tile'); + await page.goto(`http://127.0.0.1:${port}/compliance/${r2.url}`); await page.waitForSelector('#firmSum .gate'); ok(await page.evaluate(c => document.querySelector('#firmF').value === c, code), `${k} @${width}: the link reopens the same firm`); await page.close(); }