lotocard-inspector 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +38 -2
- package/bin/cli.mjs +29 -0
- package/package.json +40 -4
- package/src/index.d.ts +64 -0
- package/src/index.mjs +233 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LotoCard Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
-
#
|
|
1
|
+
# lotocard-inspector
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Build visual photo-pinned LOTO placards 100% locally in your browser (zero photo upload) at **[LotoCard](https://lotocards.com?utm_source=github&utm_medium=oss&utm_campaign=lotocard-inspector)**.
|
|
4
|
+
|
|
5
|
+
Zero-dependency MIT parser, CLI, and deterministic **29 CFR 1910.147(c)(4)(ii) Field-Presence Completeness Checker** for portable `.lotocard.json` Lockout/Tagout procedure files.
|
|
6
|
+
|
|
7
|
+
## What This Package Includes
|
|
8
|
+
- `parseProjectFile(rawJson)` — safe `.lotocard.json` parser (clamps pin coordinates, strips non-raster data URLs, enforces 12 MB safety cap).
|
|
9
|
+
- `runFieldPresenceCheck(project)` — deterministic 8-item 29 CFR 1910.147(c)(4)(ii) field-presence completeness report.
|
|
10
|
+
- `lotocard-inspector` CLI — inspect local `.lotocard.json` files in CI or maintenance audits.
|
|
11
|
+
|
|
12
|
+
> **Disclaimer**: `lotocard-inspector` performs a deterministic **1910.147(c)(4)(ii) Field-Presence Completeness Check** only — it is **NOT** an OSHA compliance certification or legal review. Final procedure accuracy, zero-energy verification, and regulatory compliance remain the sole responsibility of the employer and authorized personnel.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install lotocard-inspector
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## CLI Usage
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx lotocard-inspector ./cnc-mill.lotocard.json
|
|
24
|
+
npx lotocard-inspector ./cnc-mill.lotocard.json --json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## JavaScript / TypeScript API
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
import fs from "node:fs";
|
|
31
|
+
import { parseProjectFile, runFieldPresenceCheck } from "lotocard-inspector";
|
|
32
|
+
|
|
33
|
+
const project = parseProjectFile(fs.readFileSync("./cnc-mill.lotocard.json", "utf8"));
|
|
34
|
+
const report = runFieldPresenceCheck(project);
|
|
35
|
+
console.log(report.completenessPercent, report.items);
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Visual Placard Builder (100% Browser-Local)
|
|
39
|
+
Need laminated-ready 8.5×11 or 11×17 visual LOTO placards with pinned machine photos and QR codes? Try the full browser-local workbench at **[https://lotocards.com](https://lotocards.com?utm_source=npm&utm_medium=oss&utm_campaign=lotocard-inspector)**.
|
package/bin/cli.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import { parseProjectFile, runFieldPresenceCheck } from "../src/index.mjs";
|
|
4
|
+
|
|
5
|
+
const args = process.argv.slice(2);
|
|
6
|
+
const asJson = args.includes("--json");
|
|
7
|
+
const filePath = args.find((a) => !a.startsWith("-"));
|
|
8
|
+
|
|
9
|
+
if (!filePath || args.includes("-h") || args.includes("--help")) {
|
|
10
|
+
console.log("Usage: lotocard-inspector <file.lotocard.json> [--json]");
|
|
11
|
+
process.exit(filePath ? 0 : 1);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const raw = fs.readFileSync(filePath, "utf8");
|
|
15
|
+
const project = parseProjectFile(raw);
|
|
16
|
+
const result = runFieldPresenceCheck(project);
|
|
17
|
+
|
|
18
|
+
if (asJson) {
|
|
19
|
+
console.log(JSON.stringify({ equipmentId: project.equipmentId, equipmentName: project.equipmentName, ...result }, null, 2));
|
|
20
|
+
} else {
|
|
21
|
+
console.log(`Equipment: ${project.equipmentId || "(missing)"} — ${project.equipmentName || "(missing)"}`);
|
|
22
|
+
console.log(`1910.147(c)(4)(ii) Field-Presence: ${result.completenessPercent}% (${result.presentCount}/${result.totalCount})`);
|
|
23
|
+
for (const item of result.items) {
|
|
24
|
+
console.log(` [${item.present ? "PASS" : "MISS"}] ${item.clause} ${item.label}: ${item.detail}`);
|
|
25
|
+
}
|
|
26
|
+
console.log(`\nDisclaimer: ${result.disclaimer}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
process.exit(result.allRequiredPresent ? 0 : 2);
|
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lotocard-inspector",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Zero-dependency parser and 29 CFR 1910.147(c)(4)(ii) field-presence completeness checker for portable .lotocard.json Lockout/Tagout procedure files.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./src/index.mjs",
|
|
8
|
+
"types": "./src/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./src/index.d.ts",
|
|
12
|
+
"import": "./src/index.mjs"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"lotocard-inspector": "bin/cli.mjs"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"src/",
|
|
20
|
+
"bin/",
|
|
21
|
+
"README.md",
|
|
22
|
+
"LICENSE"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"test": "node --test test/inspector.test.mjs"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"loto",
|
|
29
|
+
"lockout-tagout",
|
|
30
|
+
"osha",
|
|
31
|
+
"1910-147",
|
|
32
|
+
"ehs",
|
|
33
|
+
"safety",
|
|
34
|
+
"placard",
|
|
35
|
+
"inspector",
|
|
36
|
+
"lotocard"
|
|
37
|
+
],
|
|
38
|
+
"homepage": "https://lotocards.com/loto-viewer?utm_source=npm&utm_medium=oss&utm_campaign=lotocard-inspector",
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=18.0.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export type EnergyType = "E" | "P" | "H" | "T" | "G" | "M";
|
|
2
|
+
|
|
3
|
+
export interface EnergyTypeMeta {
|
|
4
|
+
code: EnergyType;
|
|
5
|
+
label: string;
|
|
6
|
+
colorHex: string;
|
|
7
|
+
defaultLockDevice: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface EnergyPin {
|
|
11
|
+
id: string;
|
|
12
|
+
tag: string;
|
|
13
|
+
energyType: EnergyType;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
magnitude: string;
|
|
17
|
+
isolationDevice: string;
|
|
18
|
+
lockMethod: string;
|
|
19
|
+
verificationMethod: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type PaperSize = "letter" | "tabloid";
|
|
23
|
+
|
|
24
|
+
export interface PlacardProject {
|
|
25
|
+
schemaVersion: 1;
|
|
26
|
+
equipmentId: string;
|
|
27
|
+
equipmentName: string;
|
|
28
|
+
facility: string;
|
|
29
|
+
department: string;
|
|
30
|
+
revision: string;
|
|
31
|
+
effectiveDate: string;
|
|
32
|
+
authorizedBy: string;
|
|
33
|
+
paperSize: PaperSize;
|
|
34
|
+
photoDataUrl: string;
|
|
35
|
+
photoCaption: string;
|
|
36
|
+
pins: EnergyPin[];
|
|
37
|
+
shutdownSteps: string[];
|
|
38
|
+
verificationSteps: string[];
|
|
39
|
+
restorationSteps: string[];
|
|
40
|
+
ppeRequired: string[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface FieldCheckItem {
|
|
44
|
+
id: string;
|
|
45
|
+
clause: string;
|
|
46
|
+
label: string;
|
|
47
|
+
present: boolean;
|
|
48
|
+
detail: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface FieldPresenceResult {
|
|
52
|
+
completenessPercent: number;
|
|
53
|
+
presentCount: number;
|
|
54
|
+
totalCount: number;
|
|
55
|
+
allRequiredPresent: boolean;
|
|
56
|
+
items: FieldCheckItem[];
|
|
57
|
+
disclaimer: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export declare const ENERGY_TYPE_META: Readonly<Record<EnergyType, EnergyTypeMeta>>;
|
|
61
|
+
export declare const FIELD_PRESENCE_DISCLAIMER: string;
|
|
62
|
+
export declare function parseProjectFile(rawJson: string): PlacardProject;
|
|
63
|
+
export declare function serializeProjectFile(project: PlacardProject): string;
|
|
64
|
+
export declare function runFieldPresenceCheck(project: PlacardProject): FieldPresenceResult;
|
package/src/index.mjs
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
export const ENERGY_TYPE_META = Object.freeze({
|
|
2
|
+
E: {
|
|
3
|
+
code: "E",
|
|
4
|
+
label: "Electrical",
|
|
5
|
+
colorHex: "#da1e28",
|
|
6
|
+
defaultLockDevice: "Personal Padlock + Hasps + Breaker Lockout",
|
|
7
|
+
},
|
|
8
|
+
P: {
|
|
9
|
+
code: "P",
|
|
10
|
+
label: "Pneumatic",
|
|
11
|
+
colorHex: "#0f62fe",
|
|
12
|
+
defaultLockDevice: "Ball Valve Lockout + Padlock + Bleed Verification",
|
|
13
|
+
},
|
|
14
|
+
H: {
|
|
15
|
+
code: "H",
|
|
16
|
+
label: "Hydraulic",
|
|
17
|
+
colorHex: "#b28600",
|
|
18
|
+
defaultLockDevice: "Valve Lockout + Accumulator Bleed + Padlock",
|
|
19
|
+
},
|
|
20
|
+
T: {
|
|
21
|
+
code: "T",
|
|
22
|
+
label: "Thermal",
|
|
23
|
+
colorHex: "#ba4e00",
|
|
24
|
+
defaultLockDevice: "Steam/Hot Line Valve Lockout + Cool-Down Check",
|
|
25
|
+
},
|
|
26
|
+
G: {
|
|
27
|
+
code: "G",
|
|
28
|
+
label: "Gravity",
|
|
29
|
+
colorHex: "#6929c4",
|
|
30
|
+
defaultLockDevice: "Mechanical Safety Block / Pin + Padlock",
|
|
31
|
+
},
|
|
32
|
+
M: {
|
|
33
|
+
code: "M",
|
|
34
|
+
label: "Mechanical",
|
|
35
|
+
colorHex: "#525252",
|
|
36
|
+
defaultLockDevice: "Spring/Flywheel Restraint + Padlock",
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const FIELD_PRESENCE_DISCLAIMER =
|
|
41
|
+
"1910.147(c)(4)(ii) Field-Presence Completeness Check only — NOT an OSHA compliance certification or legal review. Final procedure accuracy, zero-energy verification, and regulatory compliance remain the sole responsibility of the employer and authorized personnel.";
|
|
42
|
+
|
|
43
|
+
const VALID_ENERGY_TYPES = new Set(["E", "P", "H", "T", "G", "M"]);
|
|
44
|
+
const MAX_JSON_BYTES = 12 * 1024 * 1024;
|
|
45
|
+
|
|
46
|
+
function sanitizeText(val, maxLen = 240) {
|
|
47
|
+
return String(val ?? "")
|
|
48
|
+
.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g, "")
|
|
49
|
+
.trim()
|
|
50
|
+
.slice(0, maxLen);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function sanitizeDataUrl(val) {
|
|
54
|
+
const s = String(val ?? "").trim();
|
|
55
|
+
if (!s || s.length > 8 * 1024 * 1024) return "";
|
|
56
|
+
const m = s.match(/^data:image\/(jpeg|png|webp);base64,([A-Za-z0-9+/]+=*)$/);
|
|
57
|
+
return m ? s : "";
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function hasText(val) {
|
|
61
|
+
return typeof val === "string" && val.trim().length > 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function serializeProjectFile(project) {
|
|
65
|
+
return JSON.stringify(project, null, 2);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function parseProjectFile(rawJson) {
|
|
69
|
+
if (typeof rawJson !== "string" || rawJson.length === 0) {
|
|
70
|
+
throw new Error("Empty .lotocard.json payload");
|
|
71
|
+
}
|
|
72
|
+
if (rawJson.length > MAX_JSON_BYTES) {
|
|
73
|
+
throw new Error("Project file exceeds 12 MB local safety limit");
|
|
74
|
+
}
|
|
75
|
+
let parsed;
|
|
76
|
+
try {
|
|
77
|
+
parsed = JSON.parse(rawJson);
|
|
78
|
+
} catch {
|
|
79
|
+
throw new Error("Malformed JSON in .lotocard.json file");
|
|
80
|
+
}
|
|
81
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
82
|
+
throw new Error("Invalid .lotocard.json root object");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const rawPins = Array.isArray(parsed.pins) ? parsed.pins : [];
|
|
86
|
+
const pins = rawPins.slice(0, 24).map((raw, idx) => {
|
|
87
|
+
const p = raw && typeof raw === "object" ? raw : {};
|
|
88
|
+
const etRaw = String(p.energyType || "E").toUpperCase();
|
|
89
|
+
const energyType = VALID_ENERGY_TYPES.has(etRaw) ? etRaw : "E";
|
|
90
|
+
const xNum = Number(p.x);
|
|
91
|
+
const yNum = Number(p.y);
|
|
92
|
+
return {
|
|
93
|
+
id: sanitizeText(p.id || `pin-${idx + 1}`, 40),
|
|
94
|
+
tag: sanitizeText(p.tag || `${energyType}-${idx + 1}`, 12),
|
|
95
|
+
energyType,
|
|
96
|
+
x: Number.isFinite(xNum) ? Math.max(0.02, Math.min(0.98, xNum)) : 0.5,
|
|
97
|
+
y: Number.isFinite(yNum) ? Math.max(0.02, Math.min(0.98, yNum)) : 0.5,
|
|
98
|
+
magnitude: sanitizeText(p.magnitude, 120),
|
|
99
|
+
isolationDevice: sanitizeText(p.isolationDevice, 180),
|
|
100
|
+
lockMethod: sanitizeText(p.lockMethod, 180),
|
|
101
|
+
verificationMethod: sanitizeText(p.verificationMethod, 200),
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const cleanList = (arr, limit = 10) =>
|
|
106
|
+
Array.isArray(arr)
|
|
107
|
+
? arr.slice(0, limit).map((item) => sanitizeText(item, 220)).filter(Boolean)
|
|
108
|
+
: [];
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
schemaVersion: 1,
|
|
112
|
+
equipmentId: sanitizeText(parsed.equipmentId, 60),
|
|
113
|
+
equipmentName: sanitizeText(parsed.equipmentName, 120),
|
|
114
|
+
facility: sanitizeText(parsed.facility, 100),
|
|
115
|
+
department: sanitizeText(parsed.department, 100),
|
|
116
|
+
revision: sanitizeText(parsed.revision || "Rev 1.0", 30),
|
|
117
|
+
effectiveDate: sanitizeText(parsed.effectiveDate || "2026-11-01", 30),
|
|
118
|
+
authorizedBy: sanitizeText(parsed.authorizedBy, 80),
|
|
119
|
+
paperSize: parsed.paperSize === "tabloid" ? "tabloid" : "letter",
|
|
120
|
+
photoDataUrl: sanitizeDataUrl(parsed.photoDataUrl),
|
|
121
|
+
photoCaption: sanitizeText(parsed.photoCaption, 140),
|
|
122
|
+
pins,
|
|
123
|
+
shutdownSteps: cleanList(parsed.shutdownSteps),
|
|
124
|
+
verificationSteps: cleanList(parsed.verificationSteps),
|
|
125
|
+
restorationSteps: cleanList(parsed.restorationSteps),
|
|
126
|
+
ppeRequired: cleanList(parsed.ppeRequired, 12),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function runFieldPresenceCheck(project) {
|
|
131
|
+
const pins = Array.isArray(project?.pins) ? project.pins : [];
|
|
132
|
+
const hasPins = pins.length > 0;
|
|
133
|
+
const allPinsHaveMagnitude = hasPins && pins.every((p) => hasText(p.magnitude));
|
|
134
|
+
const allPinsHaveIsolation = hasPins && pins.every((p) => hasText(p.isolationDevice));
|
|
135
|
+
const allPinsHaveLockMethod = hasPins && pins.every((p) => hasText(p.lockMethod));
|
|
136
|
+
const allPinsHaveVerify = hasPins && pins.every((p) => hasText(p.verificationMethod));
|
|
137
|
+
const hasShutdown = Array.isArray(project?.shutdownSteps) && project.shutdownSteps.some(hasText);
|
|
138
|
+
const hasVerifySteps =
|
|
139
|
+
Array.isArray(project?.verificationSteps) && project.verificationSteps.some(hasText);
|
|
140
|
+
const hasRestoration =
|
|
141
|
+
Array.isArray(project?.restorationSteps) && project.restorationSteps.some(hasText);
|
|
142
|
+
|
|
143
|
+
const items = [
|
|
144
|
+
{
|
|
145
|
+
id: "equipment-id",
|
|
146
|
+
clause: "1910.147(c)(4)(ii)(A)",
|
|
147
|
+
label: "Specific Equipment ID & Machine Name",
|
|
148
|
+
present: hasText(project?.equipmentId) && hasText(project?.equipmentName),
|
|
149
|
+
detail:
|
|
150
|
+
hasText(project?.equipmentId) && hasText(project?.equipmentName)
|
|
151
|
+
? `${project.equipmentId.trim()} — ${project.equipmentName.trim()}`
|
|
152
|
+
: "Populate both Equipment ID and Machine Name.",
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: "facility-location",
|
|
156
|
+
clause: "1910.147(c)(4)(ii)(A)",
|
|
157
|
+
label: "Facility & Department Location",
|
|
158
|
+
present: hasText(project?.facility) && hasText(project?.department),
|
|
159
|
+
detail:
|
|
160
|
+
hasText(project?.facility) && hasText(project?.department)
|
|
161
|
+
? `${project.facility.trim()} / ${project.department.trim()}`
|
|
162
|
+
: "Populate Facility and Department/Bay location.",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: "energy-sources",
|
|
166
|
+
clause: "1910.147(c)(4)(ii)(B)",
|
|
167
|
+
label: "Energy Source Pins & Magnitudes",
|
|
168
|
+
present: allPinsHaveMagnitude,
|
|
169
|
+
detail: allPinsHaveMagnitude
|
|
170
|
+
? `${pins.length} energy isolation point(s) documented with magnitudes.`
|
|
171
|
+
: "Add at least one EnergyPin with explicit energy magnitude (e.g., 480V 3-Phase, 120 PSI).",
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: "isolation-devices",
|
|
175
|
+
clause: "1910.147(c)(4)(ii)(B)",
|
|
176
|
+
label: "Shutoff & Energy-Isolating Devices",
|
|
177
|
+
present: allPinsHaveIsolation,
|
|
178
|
+
detail: allPinsHaveIsolation
|
|
179
|
+
? "All pins specify exact physical shutoff/isolation device locations."
|
|
180
|
+
: "Specify the physical isolation device for every EnergyPin.",
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: "lockout-devices",
|
|
184
|
+
clause: "1910.147(c)(4)(ii)(C)",
|
|
185
|
+
label: "Placement & Lock/Tag Hardware Method",
|
|
186
|
+
present: allPinsHaveLockMethod,
|
|
187
|
+
detail: allPinsHaveLockMethod
|
|
188
|
+
? "All pins specify lockout hardware and personal lock/tag placement."
|
|
189
|
+
: "Specify lockout hardware/device for every EnergyPin.",
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: "shutdown-sequence",
|
|
193
|
+
clause: "1910.147(c)(4)(ii)(B)",
|
|
194
|
+
label: "Orderly Machine Shutdown Steps",
|
|
195
|
+
present: hasShutdown,
|
|
196
|
+
detail: hasShutdown
|
|
197
|
+
? `${project.shutdownSteps.filter(hasText).length} shutdown step(s) listed.`
|
|
198
|
+
: "Add at least one orderly shutdown step.",
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: "stored-energy-verification",
|
|
202
|
+
clause: "1910.147(c)(4)(ii)(D)",
|
|
203
|
+
label: "Zero-Energy & Stored-Energy Verification",
|
|
204
|
+
present: allPinsHaveVerify && hasVerifySteps,
|
|
205
|
+
detail:
|
|
206
|
+
allPinsHaveVerify && hasVerifySteps
|
|
207
|
+
? "Per-pin and overall zero-energy verification steps populated."
|
|
208
|
+
: "Specify verification method on every pin plus overall zero-energy test steps.",
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
id: "restoration-steps",
|
|
212
|
+
clause: "1910.147(c)(4)(ii)(C)",
|
|
213
|
+
label: "Lock Removal & Service Restoration Sequence",
|
|
214
|
+
present: hasRestoration,
|
|
215
|
+
detail: hasRestoration
|
|
216
|
+
? `${project.restorationSteps.filter(hasText).length} restoration step(s) listed.`
|
|
217
|
+
: "Add at least one step for guard replacement, area clearance, and lock removal.",
|
|
218
|
+
},
|
|
219
|
+
];
|
|
220
|
+
|
|
221
|
+
const presentCount = items.filter((item) => item.present).length;
|
|
222
|
+
const totalCount = items.length;
|
|
223
|
+
const completenessPercent = Math.round((presentCount / totalCount) * 100);
|
|
224
|
+
|
|
225
|
+
return {
|
|
226
|
+
completenessPercent,
|
|
227
|
+
presentCount,
|
|
228
|
+
totalCount,
|
|
229
|
+
allRequiredPresent: presentCount === totalCount,
|
|
230
|
+
items,
|
|
231
|
+
disclaimer: FIELD_PRESENCE_DISCLAIMER,
|
|
232
|
+
};
|
|
233
|
+
}
|