Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions compliance/FORMAT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.2` (draft). 0.2 adds three optional counts per role; a 0.1 file still loads.
- Format name: `openbep-compliance-series`, version `0.3` (draft). 0.2 added three optional counts per role; 0.3 adds the plan's escalation steps and the owner of a failing rule, both 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.
Expand Down Expand Up @@ -40,6 +40,7 @@ plan
milestones[] { id, name, date, targetPercent } in date order
holidays[] { name, from, to } weeks inside are not counted
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 }
rules[] { id, goal, label, limit, unit, limitText, direction }
Expand All @@ -51,7 +52,7 @@ versions[] in order
byRole { CODE: { elements, required, met, uploaded, elementsAdded, valuesFixed, valuesBroken,
wrong, newRequired, newMet } } the last three are optional (0.2)
valueChecks { checkId: { CODE: [required, met] } } adds up to byRole
rules { ruleId: { value, pass } }
rules { ruleId: { value, pass, byRole } } byRole = failing elements per role (optional, 0.3)
```

- **required** = the number of values the plan asks for at the milestone in force (elements × the parameters
Expand Down Expand Up @@ -80,12 +81,22 @@ versions[] in order
| Model rules | pass or fail as the checker says; never averaged into a percentage |
| Gate | passes when overall compliance ≥ target and every model rule passes |
| Gap | per value check and role: target × required − met, largest first |
| Milestone result | judged on the last version checked on or before the milestone date: passed when the gate passes |
| Deficiency | one per value check and role below the target, one per failing model rule |
| Open since | first version of the current unbroken run of that deficiency |
| Closes at this pace | size ÷ pace of the last four working periods, counted forward skipping holidays |
| Urgency | Overdue: open through a milestone it should have met. Will miss: closes after the milestone, or never. On course: closes in time. |
| 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

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 the largest gaps, by check and by firm.
compliance, model rules met, forecast, versions checked.
Then one card per milestone: date, target, result, failing rules, firms below the target.
Then the active deficiencies, grouped by firm or all together, most urgent first, each with its owner,
size, age, pace and closing date. Then one accountability row per firm: milestones met and missed,
missed in a row, the plan's step, what is open now.
2. Overall compliance over time, with the stepped target, milestones, holidays and unchecked versions; the
same chart in values shows what the plan requires against what is filled.
3. One row per role: compliance, wrong and empty, pace, how clean new elements arrive, needed pace, uploads.
Expand Down
14 changes: 12 additions & 2 deletions compliance/build_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ def lerp(points, x):
# Of the values required on elements added this week, the share that arrives filled. A firm that models
# clean keeps this high; a firm that models first and fills later does not.
CLEAN = {'ARCH': .82, 'STRUCT': .93, 'MECH': .44, 'CON': .66}
# Whose elements fail each count rule (share of the failing elements). A rule with no entry belongs to the whole model.
RULE_OWNERS = {'clashes': {'MECH': .6, 'STRUCT': .25, 'ARCH': .15}, 'warnings': {'ARCH': .55, 'MECH': .35, 'STRUCT': .1},
'dup-mark': {'ARCH': .7, 'MECH': .3}, 'worksets-exist': {'MECH': 1}, 'dup-levels': {'STRUCT': 1}}
# What the plan says happens when a firm misses milestones in a row (same steps as the Scorecard's example).
ESCALATION = ['Recovery plan within 10 working days', 'Formal notice under the contract', 'Milestone not accepted and its payment held until the gap is closed']
# Weeks a role uploaded nothing new. The federated version keeps that role's previous model.
NO_UPLOAD = {
'ARCH': {'2027-04-16', '2027-04-30', '2027-05-07'},
Expand Down Expand Up @@ -188,13 +193,18 @@ def rule_values(day, i):
for ru in RULES:
val = rv[ru['id']]
v['rules'][ru['id']] = {'value': val, 'pass': val >= ru['limit'] if ru['direction'] == 'higherIsBetter' else val <= ru['limit']}
sh = {c: w for c, w in RULE_OWNERS.get(ru['id'], {}).items() if state.get(c)}
if sh and val: # whose elements fail the rule
tot_w = sum(sh.values()); parts = {c: int(val * w / tot_w) for c, w in sh.items()}
parts[max(sh, key=sh.get)] += val - sum(parts.values())
v['rules'][ru['id']]['byRole'] = {c: n for c, n in parts.items() if n}
versions.append(v)

doc = {
'format': 'openbep-compliance-series', 'formatVersion': '0.2', 'example': True,
'format': 'openbep-compliance-series', 'formatVersion': '0.3', '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},
'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')} for vc in VALUE_CHECKS],
Expand Down
Loading
Loading