dsh-hazplan-check 0.2.10 → 0.2.11
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/README-es.md +41 -2
- package/README-hi.md +41 -2
- package/README-pt.md +41 -2
- package/README-zh.md +60 -33
- package/README.md +49 -3
- package/lib/index.d.mts +8 -9
- package/lib/index.mjs +4 -0
- package/package.json +4 -4
package/README-es.md
CHANGED
|
@@ -8,6 +8,7 @@ dsh plugin --profile <name> add dsh-hazplan-check
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
[](https://dsh.market/)
|
|
11
|
+
[](https://dshfind.com/en/plugins/PerryLink/dsh-hazplan-check?ref=badge)
|
|
11
12
|
|
|
12
13
|
`dsh-hazplan-check` lee una hoja de trabajo HAZOP —filas organizadas según los propios nombres de columna de la hoja, en chino o en inglés, más una cabecera opcional que declara el 分析对象— y comprueba la completitud y la trazabilidad interna de esa misma hoja: que cada fila rellene las columnas que exige su plantilla (`偏差` y `原因` por defecto), que cada fila registre su `节点`, que los `引导词` procedan de las tablas 1 y 2 de la norma o de la lista que el estudio declaró de antemano, que cada fila deje ver de qué elemento proviene la desviación, que el `风险等级` salga del vocabulario de riesgo de su organización, que la hoja identifique el objeto de análisis y que cada `偏差` sea literalmente el `工艺参数` leído a través de su `引导词`; toda comprobación que no pueda ejecutarse por falta de una columna se informa en `skipped` en lugar de pasar en silencio.
|
|
13
14
|
|
|
@@ -20,14 +21,48 @@ dsh --profile <name> --dump-config | grep 'dsh-hazplan-check'
|
|
|
20
21
|
|
|
21
22
|
## Cómo se ve la salida
|
|
22
23
|
|
|
23
|
-

|
|
25
|
+
|
|
26
|
+
*Resumen del flujo: documento → reglas → hallazgos. Los ejemplos siguientes usan la superficie de comandos real.*
|
|
24
27
|
|
|
25
|
-

|
|
26
28
|
|
|
27
29
|
Salida real de este plugin sobre su propio fixture de prueba `HZ-004` — no es un montaje. El paquete de reglas no inventa citas, así que cada hallazgo nombra la cláusula aplicada y advierte que su texto no se obtuvo.
|
|
28
30
|
|
|
29
31
|
## Qué responde
|
|
30
32
|
|
|
33
|
+
### Ejemplos
|
|
34
|
+
|
|
35
|
+
La tabla siguiente es el conjunto de ejemplos: la primera fila es el caso detallado y las demás son casos breves.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
#### Salida detallada
|
|
39
|
+
|
|
40
|
+
**Herramienta** `hazplan_check`
|
|
41
|
+
|
|
42
|
+
**Entrada**
|
|
43
|
+
|
|
44
|
+
~~~json
|
|
45
|
+
{"rows":[{"节点":"进料单元","工艺参数":"流量","引导词":"无","偏差":"无流量","原因":""}]}
|
|
46
|
+
~~~
|
|
47
|
+
|
|
48
|
+
**Salida**
|
|
49
|
+
|
|
50
|
+
~~~json
|
|
51
|
+
{
|
|
52
|
+
"id": "dsh-hazplan-check.HZ-001.de09b5a6",
|
|
53
|
+
"ruleId": "HZ-001",
|
|
54
|
+
"severity": "warn",
|
|
55
|
+
"locator": {
|
|
56
|
+
"row": 1
|
|
57
|
+
},
|
|
58
|
+
"found": "第 1 行缺少 原因",
|
|
59
|
+
"expected": "每一个危险和可操作性问题都应作为单项记录,并与其原因一起记录;本机构配置的必填项为 偏差、原因",
|
|
60
|
+
"fix": "补齐栏目;本条只核对是否填写,不判断该问题是否找全"
|
|
61
|
+
}
|
|
62
|
+
~~~
|
|
63
|
+
|
|
64
|
+
*Observado en `tests/fixtures/HZ-001/HZ-001-unsafe.json (cases.json expects HZ-001 count 1); run via lib/index.mjs rules/hazplan-check.yaml`*
|
|
65
|
+
|
|
31
66
|
| Usted pregunta | Qué responde |
|
|
32
67
|
|---|---|
|
|
33
68
|
| Una fila registra la desviación pero deja vacía la causa. ¿Se informa de ello? | Sí. `HZ-001` exige los campos que debe rellenar cada fila; sin configurar, recurre al par que la propia cláusula nombra, `偏差` y `原因`, de modo que un `原因` vacío ya es una falta por sí solo. Comprueba que la columna esté rellena, no que la lista de problemas esté completa ni que la causa sea técnicamente válida. |
|
|
@@ -138,6 +173,10 @@ node ../scripts/sync-shared.mjs dsh-hazplan-check
|
|
|
138
173
|
|
|
139
174
|
El último comando copia el kit compartido de `../_shared` a `src/shared/`; vuelva a ejecutarlo tras cada cambio compartido.
|
|
140
175
|
|
|
176
|
+
## PerryLink DSH Plugin Family
|
|
177
|
+
|
|
178
|
+
Full family index: [choose a checker by material](https://perrylink.github.io/zh/checkers/choose/) and [all plugins](https://github.com/PerryLink). This repository is one of them.
|
|
179
|
+
|
|
141
180
|
## License
|
|
142
181
|
|
|
143
182
|
[Apache License 2.0](LICENSE) © 2026 dsh-hazplan-check contributors.
|
package/README-hi.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
[English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
|
|
4
4
|
|
|
5
5
|
[](https://dsh.market/)
|
|
6
|
+
[](https://dshfind.com/en/plugins/PerryLink/dsh-hazplan-check?ref=badge)
|
|
6
7
|
|
|
7
8
|
`dsh-hazplan-check` एक HAZOP वर्कशीट पढ़ता है — शीट के अपने कॉलम नामों पर आधारित पंक्तियाँ (चीनी या अंग्रेज़ी नाम, दोनों चलते हैं), साथ में विश्लेषण-वस्तु बताने वाला वैकल्पिक हेडर — और उसी शीट की पूर्णता तथा आंतरिक अनुरेखणीयता की जाँच करता है: क्या हर पंक्ति अपने टेम्पलेट में माँगे गए कॉलम भरती है (डिफ़ॉल्ट रूप से `偏差` और `原因`), क्या हर पंक्ति में `节点` दर्ज है, क्या `引导词` मानक की तालिका 1 और तालिका 2 से या अध्ययन द्वारा पहले घोषित सूची से लिए गए हैं, क्या हर पंक्ति से दिखता है कि विचलन किस तत्व से आया, क्या `风险等级` आपके संस्थान की जोखिम-शब्दावली से है, क्या शीट विश्लेषण-वस्तु को पहचानती है, और क्या हर `偏差` शब्दशः अपने `引导词` के माध्यम से पढ़ा गया `工艺参数` है; किसी कॉलम के अभाव में जो जाँच चल नहीं सकती, वह चुपचाप पास होने के बजाय `skipped` में दर्ज होती है।
|
|
8
9
|
|
|
@@ -15,14 +16,48 @@ dsh --profile <name> --dump-config | grep 'dsh-hazplan-check'
|
|
|
15
16
|
|
|
16
17
|
## आउटपुट कैसा दिखता है
|
|
17
18
|
|
|
18
|
-

|
|
20
|
+
|
|
21
|
+
*कार्यप्रवाह: दस्तावेज़ → नियम → निष्कर्ष। नीचे के उदाहरण वास्तविक कमांड सतह का उपयोग करते हैं।*
|
|
19
22
|
|
|
20
|
-

|
|
21
23
|
|
|
22
24
|
इस प्लगइन का अपने ही `HZ-004` टेस्ट फ़िक्स्चर पर वास्तविक आउटपुट — कोई नकली चित्र नहीं। नियम-पैक उद्धरण नहीं गढ़ता, इसलिए हर निष्कर्ष लागू किए गए खंड का नाम और यह भी बताता है कि उसका मूल पाठ इस बार प्राप्त नहीं हुआ।
|
|
23
25
|
|
|
24
26
|
## यह किन सवालों का जवाब देता है
|
|
25
27
|
|
|
28
|
+
### उदाहरण
|
|
29
|
+
|
|
30
|
+
नीचे दी गई तालिका उदाहरण-समुच्चय है: पहली पंक्ति विस्तृत केस है, बाकी संक्षिप्त केस हैं।
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#### विस्तृत आउटपुट
|
|
34
|
+
|
|
35
|
+
**उपकरण** `hazplan_check`
|
|
36
|
+
|
|
37
|
+
**इनपुट**
|
|
38
|
+
|
|
39
|
+
~~~json
|
|
40
|
+
{"rows":[{"节点":"进料单元","工艺参数":"流量","引导词":"无","偏差":"无流量","原因":""}]}
|
|
41
|
+
~~~
|
|
42
|
+
|
|
43
|
+
**आउटपुट**
|
|
44
|
+
|
|
45
|
+
~~~json
|
|
46
|
+
{
|
|
47
|
+
"id": "dsh-hazplan-check.HZ-001.de09b5a6",
|
|
48
|
+
"ruleId": "HZ-001",
|
|
49
|
+
"severity": "warn",
|
|
50
|
+
"locator": {
|
|
51
|
+
"row": 1
|
|
52
|
+
},
|
|
53
|
+
"found": "第 1 行缺少 原因",
|
|
54
|
+
"expected": "每一个危险和可操作性问题都应作为单项记录,并与其原因一起记录;本机构配置的必填项为 偏差、原因",
|
|
55
|
+
"fix": "补齐栏目;本条只核对是否填写,不判断该问题是否找全"
|
|
56
|
+
}
|
|
57
|
+
~~~
|
|
58
|
+
|
|
59
|
+
*स्रोत `tests/fixtures/HZ-001/HZ-001-unsafe.json (cases.json expects HZ-001 count 1); run via lib/index.mjs rules/hazplan-check.yaml`*
|
|
60
|
+
|
|
26
61
|
| आपका सवाल | इसका जवाब |
|
|
27
62
|
|---|---|
|
|
28
63
|
| एक पंक्ति में विचलन दर्ज है पर कारण खाली है। क्या यह दर्ज होता है? | हाँ। `HZ-001` हर पंक्ति में अनिवार्य कॉलम भरे होने की अपेक्षा करता है; बिना कॉन्फ़िगर किए यह उसी जोड़ी पर लौट आता है जिसे धारा स्वयं नाम देती है — `偏差` और `原因` — इसलिए खाली `原因` अपने आप में एक कमी है। यह केवल देखता है कि कॉलम भरा है, यह नहीं कि समस्याओं की सूची पूरी है या कारण तकनीकी रूप से सही है। |
|
|
@@ -133,6 +168,10 @@ node ../scripts/sync-shared.mjs dsh-hazplan-check
|
|
|
133
168
|
|
|
134
169
|
अंतिम कमांड `../_shared` का साझा किट `src/shared/` में कॉपी करता है; हर साझा बदलाव के बाद इसे दोबारा चलाएँ।
|
|
135
170
|
|
|
171
|
+
## PerryLink DSH Plugin Family
|
|
172
|
+
|
|
173
|
+
Full family index: [choose a checker by material](https://perrylink.github.io/zh/checkers/choose/) and [all plugins](https://github.com/PerryLink). This repository is one of them.
|
|
174
|
+
|
|
136
175
|
## License
|
|
137
176
|
|
|
138
177
|
[Apache License 2.0](LICENSE) © 2026 dsh-hazplan-check contributors.
|
package/README-pt.md
CHANGED
|
@@ -8,6 +8,7 @@ dsh plugin --profile <name> add dsh-hazplan-check
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
[](https://dsh.market/)
|
|
11
|
+
[](https://dshfind.com/en/plugins/PerryLink/dsh-hazplan-check?ref=badge)
|
|
11
12
|
|
|
12
13
|
`dsh-hazplan-check` lê uma folha de trabalho HAZOP —linhas organizadas pelos próprios nomes de coluna da folha, em chinês ou em inglês, mais um cabeçalho opcional que declara o 分析对象— e verifica a completude e a rastreabilidade interna dessa mesma folha: se cada linha preenche as colunas exigidas pelo seu modelo (`偏差` e `原因` por omissão), se cada linha regista o seu `节点`, se os `引导词` vêm das tabelas 1 e 2 da norma ou da lista que o estudo declarou antecipadamente, se cada linha deixa ver de que elemento veio o desvio, se o `风险等级` sai do vocabulário de risco da sua organização, se a folha identifica o objeto de análise e se cada `偏差` é literalmente o `工艺参数` lido através do seu `引导词`; qualquer verificação que não possa correr por falta de uma coluna é reportada em `skipped` em vez de passar em silêncio.
|
|
13
14
|
|
|
@@ -20,14 +21,48 @@ dsh --profile <name> --dump-config | grep 'dsh-hazplan-check'
|
|
|
20
21
|
|
|
21
22
|
## Como é a saída
|
|
22
23
|
|
|
23
|
-

|
|
25
|
+
|
|
26
|
+
*Visão geral do fluxo: documento → regras → achados. Os exemplos abaixo usam a superfície real de comandos.*
|
|
24
27
|
|
|
25
|
-

|
|
26
28
|
|
|
27
29
|
Saída real deste plugin sobre o seu próprio fixture de teste `HZ-004` — não é uma simulação. O pacote de regras não inventa citações, por isso cada achado nomeia a cláusula aplicada e avisa que o seu texto não foi obtido.
|
|
28
30
|
|
|
29
31
|
## O que ele responde
|
|
30
32
|
|
|
33
|
+
### Exemplos
|
|
34
|
+
|
|
35
|
+
A tabela abaixo é o conjunto de exemplos: a primeira linha é o caso detalhado e as demais são casos curtos.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
#### Saída detalhada
|
|
39
|
+
|
|
40
|
+
**Ferramenta** `hazplan_check`
|
|
41
|
+
|
|
42
|
+
**Entrada**
|
|
43
|
+
|
|
44
|
+
~~~json
|
|
45
|
+
{"rows":[{"节点":"进料单元","工艺参数":"流量","引导词":"无","偏差":"无流量","原因":""}]}
|
|
46
|
+
~~~
|
|
47
|
+
|
|
48
|
+
**Saída**
|
|
49
|
+
|
|
50
|
+
~~~json
|
|
51
|
+
{
|
|
52
|
+
"id": "dsh-hazplan-check.HZ-001.de09b5a6",
|
|
53
|
+
"ruleId": "HZ-001",
|
|
54
|
+
"severity": "warn",
|
|
55
|
+
"locator": {
|
|
56
|
+
"row": 1
|
|
57
|
+
},
|
|
58
|
+
"found": "第 1 行缺少 原因",
|
|
59
|
+
"expected": "每一个危险和可操作性问题都应作为单项记录,并与其原因一起记录;本机构配置的必填项为 偏差、原因",
|
|
60
|
+
"fix": "补齐栏目;本条只核对是否填写,不判断该问题是否找全"
|
|
61
|
+
}
|
|
62
|
+
~~~
|
|
63
|
+
|
|
64
|
+
*Observado em `tests/fixtures/HZ-001/HZ-001-unsafe.json (cases.json expects HZ-001 count 1); run via lib/index.mjs rules/hazplan-check.yaml`*
|
|
65
|
+
|
|
31
66
|
| Você pergunta | O que ele responde |
|
|
32
67
|
|---|---|
|
|
33
68
|
| Uma linha regista o desvio mas deixa a causa em branco. Isso é reportado? | Sim. `HZ-001` exige os campos que cada linha tem de preencher; sem configuração, recorre ao par que a própria cláusula nomeia, `偏差` e `原因`, pelo que um `原因` em branco já é uma falha por si. Verifica que a coluna está preenchida, não que a lista de problemas esteja completa nem que a causa seja tecnicamente válida. |
|
|
@@ -138,6 +173,10 @@ node ../scripts/sync-shared.mjs dsh-hazplan-check
|
|
|
138
173
|
|
|
139
174
|
O último comando copia o kit compartilhado de `../_shared` para `src/shared/`; execute-o novamente após cada alteração compartilhada.
|
|
140
175
|
|
|
176
|
+
## PerryLink DSH Plugin Family
|
|
177
|
+
|
|
178
|
+
Full family index: [choose a checker by material](https://perrylink.github.io/zh/checkers/choose/) and [all plugins](https://github.com/PerryLink). This repository is one of them.
|
|
179
|
+
|
|
141
180
|
## License
|
|
142
181
|
|
|
143
182
|
[Apache License 2.0](LICENSE) © 2026 dsh-hazplan-check contributors.
|
package/README-zh.md
CHANGED
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
|
|
4
4
|
|
|
5
|
+
<!-- topblock:v1 -->
|
|
6
|
+
> **这是什么** HAZOP 分析表核对。输出一份「哪一行、哪一栏、差什么」的清单。
|
|
7
|
+
> **给谁用** 工艺安全、HAZOP 分析组;不用懂命令行。
|
|
8
|
+
> **你交什么** 这项核对用到的原始材料(表格、清单或文书);不改原件。Excel 可先转成 JSON/YAML,对话里也能代转。
|
|
9
|
+
> **它不做什么** 不判合规、不认定责任、不替代审核人;只列材料内部能逐条指认的差异。
|
|
10
|
+
> **怎么开始** 在 WorkBuddy / 扣子搜「安全合规核对包」(本检查是其中一项;上架以商城为准);或命令行:
|
|
11
|
+
> `dsh plugin --profile <name> add dsh-hazplan-check`
|
|
12
|
+
<!-- /topblock:v1 -->
|
|
13
|
+
|
|
5
14
|
[](https://dsh.market/)
|
|
15
|
+
[](https://dshfind.com/en/plugins/PerryLink/dsh-hazplan-check?ref=badge)
|
|
6
16
|
|
|
7
17
|
`dsh-hazplan-check` 读取一份 HAZOP 分析表——按表格自身的列名组织的行(中英文列名均可),加上可选的、写明分析对象的表头——核对这份表格自身的齐备与可追溯:每行是否填了模板要求的栏目(默认 `偏差` 与 `原因`)、每行是否写明 `节点`、`引导词` 是否取自标准表1与表2或本分析事先声明的清单、每行是否看得出偏差来自哪个要素、`风险等级` 是否出自本机构的风险档位、表头能否识别分析对象、以及每个 `偏差` 是否字面上等于 `工艺参数` 与 `引导词` 的组合;因缺列而无法执行的核对会出现在 `skipped` 里,而不是静默通过。
|
|
8
18
|
|
|
@@ -15,14 +25,48 @@ dsh --profile <name> --dump-config | grep 'dsh-hazplan-check'
|
|
|
15
25
|
|
|
16
26
|
## 实际输出长什么样
|
|
17
27
|
|
|
18
|
-

|
|
29
|
+
|
|
30
|
+
*工作流概览:文档 → 规则包 → 核对结果。下面的示例使用实际命令面。*
|
|
19
31
|
|
|
20
|
-

|
|
21
32
|
|
|
22
33
|
本插件对自己 `HZ-004` 测试夹具的**真实输出**,不是示意图。规则库不伪造引文,因此每条发现都会同时写明所引条款,以及该条款原文本次未取得。
|
|
23
34
|
|
|
24
35
|
## 它回答什么问题
|
|
25
36
|
|
|
37
|
+
### 示例
|
|
38
|
+
|
|
39
|
+
下表是示例集:第一行是详细走查,其余行是简短案例。
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
#### 详细输出
|
|
43
|
+
|
|
44
|
+
**工具** `hazplan_check`
|
|
45
|
+
|
|
46
|
+
**输入**
|
|
47
|
+
|
|
48
|
+
~~~json
|
|
49
|
+
{"rows":[{"节点":"进料单元","工艺参数":"流量","引导词":"无","偏差":"无流量","原因":""}]}
|
|
50
|
+
~~~
|
|
51
|
+
|
|
52
|
+
**输出**
|
|
53
|
+
|
|
54
|
+
~~~json
|
|
55
|
+
{
|
|
56
|
+
"id": "dsh-hazplan-check.HZ-001.de09b5a6",
|
|
57
|
+
"ruleId": "HZ-001",
|
|
58
|
+
"severity": "warn",
|
|
59
|
+
"locator": {
|
|
60
|
+
"row": 1
|
|
61
|
+
},
|
|
62
|
+
"found": "第 1 行缺少 原因",
|
|
63
|
+
"expected": "每一个危险和可操作性问题都应作为单项记录,并与其原因一起记录;本机构配置的必填项为 偏差、原因",
|
|
64
|
+
"fix": "补齐栏目;本条只核对是否填写,不判断该问题是否找全"
|
|
65
|
+
}
|
|
66
|
+
~~~
|
|
67
|
+
|
|
68
|
+
*来源 `tests/fixtures/HZ-001/HZ-001-unsafe.json (cases.json expects HZ-001 count 1); run via lib/index.mjs rules/hazplan-check.yaml`*
|
|
69
|
+
|
|
26
70
|
| 你会问 | 它怎么答 |
|
|
27
71
|
|---|---|
|
|
28
72
|
| 某行填了偏差,但原因栏空着,会被报出吗? | 会。`HZ-001` 要求每行填写必填栏目;出厂未配置 `requiredFields` 时,回退到条款本身点名的一对:`偏差` 与 `原因`,所以 `原因` 空着本身就是缺项。它只核对栏目是否填写,不判断问题是否找全、原因是否成立。 |
|
|
@@ -39,44 +83,23 @@ dsh --profile <name> --dump-config | grep 'dsh-hazplan-check'
|
|
|
39
83
|
| 《危险与可操作性分析(HAZOP分析)应用指南》 | GB/T 35320-2017 | HZ-001, HZ-002, HZ-003, HZ-004, HZ-005, HZ-006, HZ-007 |
|
|
40
84
|
| 《风险管理 风险评估技术》 | GB/T 27921-2023 | HZ-005 |
|
|
41
85
|
|
|
42
|
-
|
|
43
|
-
records the analysis content your template requires, that each 偏差 actually follows from the 工艺参数 and
|
|
44
|
-
引导词 beside it, that risk levels come from your own vocabulary, that every node has rows, and that
|
|
45
|
-
recommendations carry their closure fields. It does **not** judge whether the causes are complete, whether
|
|
46
|
-
the consequences are analysed far enough, whether the safeguards are adequate, or whether a risk rating is
|
|
47
|
-
correct. **Those four judgements are the study team's, and they are where HAZOP's value lies.**
|
|
86
|
+
**边界(中文译文,以英文原文为准):** 本插件核对一份 **HAZOP 工作表**,范围限于表格可以要求到的内容——每行是否记录了模板要求的分析内容,每个偏差是否确实由其旁的工艺参数与引导词推出,风险等级是否取自你自己的取值口径,每个节点是否有对应行,以及建议措施是否填写其闭环字段。它**不**判定原因是否完整、后果分析是否充分、现有安全措施是否足够,也不判定风险评级是否正确。**这四项判断属于分析小组,也正是 HAZOP 的价值所在。**
|
|
48
87
|
|
|
49
|
-
> ### ⚠️
|
|
88
|
+
> ### ⚠️ 这里没有任何 `error`,原因在条款措辞(以英文原文为准)
|
|
50
89
|
>
|
|
51
|
-
> **GB/T 35320-2017《危险与可操作性分析(HAZOP分析)应用指南》**
|
|
52
|
-
> 2017-12-29, identical to IEC 61882:2001), and its clause text was obtained verbatim.
|
|
90
|
+
> **GB/T 35320-2017《危险与可操作性分析(HAZOP分析)应用指南》** 是现行标准(2017-12-29 发布并实施,与 IEC 61882:2001 等同),其条款原文已逐字取得。
|
|
53
91
|
>
|
|
54
|
-
>
|
|
55
|
-
> 宜 — "should" — not 应.** That applies to the two clauses an earlier version of this pack rated as
|
|
56
|
-
> `error`: **6.6.4** reads 「每一个危险和可操作性性问题都**宜**作为单项记录」 and **6.6.3** opens
|
|
57
|
-
> 「HAZOP 分析输出**宜**包括:」. **A recommendation cannot support an error rating**, so both rules are
|
|
58
|
-
> now `warn` and **this plugin reports no error at all** — consistent with how the family treats every
|
|
59
|
-
> other recommended standard. A test pins this so a later edit cannot quietly re-escalate one.
|
|
92
|
+
> **该标准是*推荐性*标准(标准号带“/T”),本规则库引用的每一条条款用的都是“宜”——“should”——而不是“应”。** 这一点适用于本规则库早期版本评为 `error` 的那两条条款:**6.6.4** 写的是「每一个危险和可操作性性问题都**宜**作为单项记录」,**6.6.3** 开头是「HAZOP 分析输出**宜**包括:」。**推荐性要求不能支撑错误评级**,因此这两条规则现在都是 `warn`,**本插件根本不报告任何错误**——这与本系列插件对待其他每一部推荐性标准的方式一致。有测试固定这一点,使日后的修改无法悄悄把其中一条重新升级。
|
|
60
93
|
>
|
|
61
|
-
>
|
|
94
|
+
> **其余一切都封顶在 `warn` 或 `info`,理由有三条,规则库均有记录:**
|
|
62
95
|
>
|
|
63
|
-
> 1.
|
|
64
|
-
>
|
|
65
|
-
>
|
|
66
|
-
> 2. **Clause 4.2 gives no criterion for node granularity.** It says the size of a node "取决于系统的
|
|
67
|
-
> 复杂性和危险的严重程度" and nothing quantitative follows. This plugin **does not** judge node size.
|
|
68
|
-
> 3. **The standard fixes no risk-level scale.** 6.5 mentions a risk matrix as useful and defers the method
|
|
69
|
-
> to IEC 60300-3-9; GB/T 27921-2023's matrix description is likewise informative. Levels must come from
|
|
70
|
-
> your own risk criteria, so the vocabulary ships **empty**.
|
|
96
|
+
> 1. **附录 A.2——唯一出现栏目清单的地方——是资料性附录。** 其措辞是“表列的标题**可为**以下各项”,还补充“**也可记录**其他信息”,并直说“工作表的版面设计**各有不同**”。**不存在强制性的栏目清单**,因此缺少某一栏最多只能算建议。
|
|
97
|
+
> 2. **第 4.2 条没有给出节点划分粒度的准则。** 它说节点的大小“取决于系统的复杂性和危险的严重程度”,其后没有任何量化规定。本插件**不**判断节点大小。
|
|
98
|
+
> 3. **标准没有规定风险等级刻度。** 6.5 提到风险矩阵有用,并把方法交由 IEC 60300-3-9;GB/T 27921-2023 对矩阵的描述同样属资料性。等级必须来自你自己的风险准则,因此词表出厂为**空**。
|
|
71
99
|
>
|
|
72
|
-
>
|
|
73
|
-
> **「相反」, not the colloquial "相逆"** — and combines table 1 with table 2; a custom guide word is
|
|
74
|
-
> **not** non-compliant, because 6.4.3 permits one "只要在分析开始前进行了定义". And **SH/T 3240-2025**
|
|
75
|
-
> (the petrochemical HAZOP specification, in force 2025-11-01) had only its identity, status and glossary
|
|
76
|
-
> verified — **its clause text was not obtained, so this pack cites none of it**.
|
|
100
|
+
> 规则库中还有两条关于诚实性的说明。引导词词表采用标准自己的措辞——**「相反」,而不是俗写的“相逆”**——并合并表 1 与表 2;自定义引导词**并不**不合规,因为 6.4.3 允许自定义,条件是“只要在分析开始前进行了定义”。另外,**SH/T 3240-2025**(石油化工 HAZOP 规范,2025-11-01 实施)只核实了其名称、状态和术语表——**其条款原文本次未取得,因此本规则库不引用其中任何内容**。
|
|
77
101
|
>
|
|
78
|
-
>
|
|
79
|
-
> are analysed far enough, whether the safeguards are adequate, whether a risk rating is correct.
|
|
102
|
+
> 本插件不作的四项判断:原因是否完整、后果分析是否深入充分、现有安全措施是否充分、风险评级是否正确。
|
|
80
103
|
|
|
81
104
|
## Compatibility
|
|
82
105
|
|
|
@@ -133,6 +156,10 @@ node ../scripts/sync-shared.mjs dsh-hazplan-check
|
|
|
133
156
|
|
|
134
157
|
第 4 项把 `../_shared` 的共享件同步进 `src/shared/`;每次改动共享件后都要重跑。
|
|
135
158
|
|
|
159
|
+
## PerryLink DSH Plugin Family
|
|
160
|
+
|
|
161
|
+
完整清单(62 个核查器 + 通用插件)见 [按材料选核查器](https://perrylink.github.io/zh/checkers/choose/);本仓只是其中一个。
|
|
162
|
+
|
|
136
163
|
## License
|
|
137
164
|
|
|
138
165
|
[Apache License 2.0](LICENSE) © 2026 dsh-hazplan-check contributors.
|
package/README.md
CHANGED
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
|
|
4
4
|
|
|
5
|
+
<!-- topblock:v1 -->
|
|
6
|
+
> **What it is** — HAZOP worksheet element completeness and deviation derivation consistency check. It returns a list of what is inconsistent, where, and what to fix.
|
|
7
|
+
> **Who it is for** — process-safety and HAZOP teams; no command line required.
|
|
8
|
+
> **What you give it** — the source material the check works on (a table, register or document); the original is never modified. Excel can be converted to JSON/YAML first, in chat if the platform supports it.
|
|
9
|
+
> **What it does not do** — no compliance verdict, no liability finding, no replacement for the reviewer; differences only.
|
|
10
|
+
> **How to start** — search "Safety Compliance Suite" in WorkBuddy / Coze (this check is one part of it; availability as listed); or:
|
|
11
|
+
> `dsh plugin --profile <name> add dsh-hazplan-check`
|
|
12
|
+
<!-- /topblock:v1 -->
|
|
13
|
+
|
|
5
14
|
[](https://dsh.market/)
|
|
15
|
+
[](https://dshfind.com/en/plugins/PerryLink/dsh-hazplan-check?ref=badge)
|
|
6
16
|
|
|
7
17
|
`dsh-hazplan-check` reads one HAZOP worksheet — rows keyed by the sheet's own column names, in Chinese or English, plus an optional header naming the 分析对象 — and checks that same sheet's completeness and internal traceability: that every row fills the fields your template requires (`偏差` and `原因` by default), that each row records its `节点`, that `引导词` come from the standard's tables 1 and 2 or from the list the study declared beforehand, that each row shows which element its deviation came from, that `风险等级` come from your own risk vocabulary, that the sheet names its analysis subject, and that every `偏差` is literally the `工艺参数` read through its `引导词`; a check that cannot run for want of a column is reported in `skipped` rather than passing silently.
|
|
8
18
|
|
|
@@ -15,14 +25,46 @@ dsh --profile <name> --dump-config | grep 'dsh-hazplan-check'
|
|
|
15
25
|
|
|
16
26
|
## What it looks like
|
|
17
27
|
|
|
18
|
-

|
|
29
|
+
|
|
30
|
+
*Workflow overview: document → rule pack → findings. The examples below use the real command surface.*
|
|
19
31
|
|
|
20
|
-

|
|
21
32
|
|
|
22
|
-
Real output from this plugin over its own `HZ-004` test fixture — not a mock-up. The rule pack ships no invented quotations, so a finding names both the clause it applied and the fact that the clause text was not obtained.
|
|
23
33
|
|
|
24
34
|
## What it answers
|
|
25
35
|
|
|
36
|
+
### Examples
|
|
37
|
+
|
|
38
|
+
The table below is the example set: the first row is the detailed walkthrough, the remaining rows are short cases.
|
|
39
|
+
|
|
40
|
+
#### Detailed output
|
|
41
|
+
|
|
42
|
+
**Tool** `hazplan_check`
|
|
43
|
+
|
|
44
|
+
**Input**
|
|
45
|
+
|
|
46
|
+
~~~json
|
|
47
|
+
{"rows":[{"节点":"进料单元","工艺参数":"流量","引导词":"无","偏差":"无流量","原因":""}]}
|
|
48
|
+
~~~
|
|
49
|
+
|
|
50
|
+
**Output**
|
|
51
|
+
|
|
52
|
+
~~~json
|
|
53
|
+
{
|
|
54
|
+
"id": "dsh-hazplan-check.HZ-001.de09b5a6",
|
|
55
|
+
"ruleId": "HZ-001",
|
|
56
|
+
"severity": "warn",
|
|
57
|
+
"locator": {
|
|
58
|
+
"row": 1
|
|
59
|
+
},
|
|
60
|
+
"found": "第 1 行缺少 原因",
|
|
61
|
+
"expected": "每一个危险和可操作性问题都应作为单项记录,并与其原因一起记录;本机构配置的必填项为 偏差、原因",
|
|
62
|
+
"fix": "补齐栏目;本条只核对是否填写,不判断该问题是否找全"
|
|
63
|
+
}
|
|
64
|
+
~~~
|
|
65
|
+
|
|
66
|
+
*Observed from `tests/fixtures/HZ-001/HZ-001-unsafe.json (cases.json expects HZ-001 count 1); run via lib/index.mjs rules/hazplan-check.yaml`*
|
|
67
|
+
|
|
26
68
|
| You ask | What it answers |
|
|
27
69
|
|---|---|
|
|
28
70
|
| A row records the deviation but leaves the cause blank. Is that reported? | Yes. `HZ-001` requires the fields every row must fill; shipped unset, it falls back to the pair the clause itself names, `偏差` and `原因`, so a blank `原因` is a gap on its own. It checks that the column is filled, not that the problem list is complete or the cause technically sound. |
|
|
@@ -203,6 +245,10 @@ pnpm run build # tsdown -> lib/index.mjs + lib/index.d.mts
|
|
|
203
245
|
node ../scripts/sync-shared.mjs dsh-hazplan-check # refresh src/shared from ../_shared
|
|
204
246
|
```
|
|
205
247
|
|
|
248
|
+
## PerryLink DSH Plugin Family
|
|
249
|
+
|
|
250
|
+
Full family index: [choose a checker by material](https://perrylink.github.io/zh/checkers/choose/) and [all plugins](https://github.com/PerryLink). This repository is one of them.
|
|
251
|
+
|
|
206
252
|
## License
|
|
207
253
|
|
|
208
254
|
[Apache License 2.0](LICENSE) © 2026 dsh-hazplan-check contributors.
|
package/lib/index.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ import { Context } from "@deepseek-ai/cordis";
|
|
|
6
6
|
* `cordis.yml` without editing code (the family's "no hard-coded tunables"
|
|
7
7
|
* redline). The rule pack itself is data as well and can be pointed elsewhere.
|
|
8
8
|
*/
|
|
9
|
-
interface Config {
|
|
9
|
+
export interface Config {
|
|
10
10
|
/** Rule-pack path relative to the plugin package root. */
|
|
11
11
|
rulesFile: string;
|
|
12
12
|
/** Rule ids disabled for this deployment. */
|
|
@@ -22,13 +22,13 @@ interface Config {
|
|
|
22
22
|
/** Tool timeout budget in milliseconds. */
|
|
23
23
|
timeoutMs: number;
|
|
24
24
|
}
|
|
25
|
-
declare const Config: Schema<Config>;
|
|
25
|
+
export declare const Config: Schema<Config>;
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/index.d.ts
|
|
28
|
-
declare const name = "dsh-hazplan-check";
|
|
29
|
-
declare const inject: string[];
|
|
28
|
+
export declare const name = "dsh-hazplan-check";
|
|
29
|
+
export declare const inject: string[];
|
|
30
30
|
/** Tool id exposed to the model, and the row id in `cordis.patch.yml`. */
|
|
31
|
-
declare const TOOL_NAME = "hazplan_check";
|
|
31
|
+
export declare const TOOL_NAME = "hazplan_check";
|
|
32
32
|
/**
|
|
33
33
|
* Locate a package-owned file such as the rule pack.
|
|
34
34
|
*
|
|
@@ -40,7 +40,7 @@ declare const TOOL_NAME = "hazplan_check";
|
|
|
40
40
|
* @returns the resolved absolute path.
|
|
41
41
|
* @throws Error naming every location tried, when the file is absent.
|
|
42
42
|
*/
|
|
43
|
-
declare function resolvePackageFile(relative: string): string;
|
|
43
|
+
export declare function resolvePackageFile(relative: string): string;
|
|
44
44
|
/**
|
|
45
45
|
* Register the checker tool.
|
|
46
46
|
*
|
|
@@ -51,6 +51,5 @@ declare function resolvePackageFile(relative: string): string;
|
|
|
51
51
|
* @param ctx - plugin context, with `tools` already available.
|
|
52
52
|
* @param config - validated configuration.
|
|
53
53
|
*/
|
|
54
|
-
declare function apply(ctx: Context, config: Config): () => void;
|
|
55
|
-
//#endregion
|
|
56
|
-
export { Config, TOOL_NAME, apply, inject, name, resolvePackageFile };
|
|
54
|
+
export declare function apply(ctx: Context, config: Config): () => void;
|
|
55
|
+
//#endregion
|
package/lib/index.mjs
CHANGED
|
@@ -398,6 +398,10 @@ var Reader = class {
|
|
|
398
398
|
if (!isSequenceItem(line.text)) break;
|
|
399
399
|
this.index += 1;
|
|
400
400
|
const rest = line.text === "-" ? "" : line.text.slice(2).trim();
|
|
401
|
+
if (rest.startsWith("{") || rest.startsWith("[")) {
|
|
402
|
+
items.push(parseScalar(rest, line.num));
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
401
405
|
if ((rest === "" ? -1 : findKeySeparator(rest)) >= 0) {
|
|
402
406
|
items.push(this.readMapping(indent + 2, {
|
|
403
407
|
text: rest,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-hazplan-check",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "HAZOP 分析表要素齐备性与偏差推导一致性核对(依据公开的危险与可操作性分析标准,仅提示差异,不作出定性结论)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.mjs",
|
|
@@ -77,14 +77,14 @@
|
|
|
77
77
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"@deepseek-ai/cordis": "4.0.5
|
|
80
|
+
"@deepseek-ai/cordis": "4.0.5",
|
|
81
81
|
"@deepseek-ai/dsh-package-manifest": "0.2.1-rc.2",
|
|
82
82
|
"@deepseek-ai/dsh-tools": "0.2.1-rc.2",
|
|
83
|
-
"@deepseek-ai/schemastery": "3.18.5
|
|
83
|
+
"@deepseek-ai/schemastery": "3.18.5",
|
|
84
84
|
"@types/node": "^22.20.1",
|
|
85
85
|
"vitest": "^3.2.7",
|
|
86
86
|
"@deepseek-ai/dsh-working-directory": "0.2.1-rc.2",
|
|
87
|
-
"tsdown": "^0.
|
|
87
|
+
"tsdown": "^0.23.1",
|
|
88
88
|
"typescript": "^5.9.3"
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {}
|