dsh-hazplan-check 0.2.0 → 0.2.2
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/CHANGELOG.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.2
|
|
4
|
+
|
|
5
|
+
- Ship `CHANGELOG.md` and `SECURITY.md` inside the package. `files` is an
|
|
6
|
+
allowlist and neither was on it, so no release note had ever reached anyone
|
|
7
|
+
who installed this package, and npm had no changelog section to show.
|
|
8
|
+
## 0.2.1
|
|
9
|
+
|
|
10
|
+
- Citation pass: every `excerpt` was checked against this repository's own
|
|
11
|
+
`rules/evidence/` record, and the record was completed for the clauses the
|
|
12
|
+
rules quote.
|
|
13
|
+
- The source moved from a commercial document site to the national standards platform record for AQ/T 3049—2013, with its authoritative version facts.
|
|
14
|
+
- Adds `rules/citations-baseline.json`, which the `check:citations` gate reads:
|
|
15
|
+
it lists any excerpt not yet traceable to the evidence, and that list can
|
|
16
|
+
only shrink.
|
|
17
|
+
## 0.2.0
|
|
18
|
+
|
|
19
|
+
- Release infrastructure brought to the family standard: `verify:self-contained`,
|
|
20
|
+
`check:lockfile`, `check:readmes` and `check:citations` gates, a `prepublishOnly` that
|
|
21
|
+
re-runs the whole chain, SECURITY.md, dependabot, and the OpenSSF Scorecard workflow.
|
|
22
|
+
- `check:citations` enforces the rule this pack's own header states: every `excerpt`
|
|
23
|
+
must be a verbatim quotation, findable in `rules/evidence/`. Rules that are not
|
|
24
|
+
traceable yet are listed in `rules/citations-baseline.json`, and that file can only
|
|
25
|
+
shrink - anything new has to be sourced before it can land.
|
|
26
|
+
- The README install command now names the published package instead of a local tarball.
|
|
27
|
+
- Five-language READMEs hold the same section count and the same configuration keys.
|
|
28
|
+
- Rule pack: 7 rules across HZ-001..HZ-007.
|
|
29
|
+
- Licensed Apache-2.0.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting a vulnerability
|
|
4
|
+
|
|
5
|
+
Please report security vulnerabilities **privately** through GitHub's private
|
|
6
|
+
vulnerability reporting:
|
|
7
|
+
|
|
8
|
+
**Security → Report a vulnerability** at
|
|
9
|
+
https://github.com/PerryLink/dsh-hazplan-check/security/advisories/new
|
|
10
|
+
|
|
11
|
+
Do **not** open a public issue for security findings.
|
|
12
|
+
|
|
13
|
+
Before reporting, **sanitize everything you paste**: remove tokens, API keys,
|
|
14
|
+
credentials, authorization headers, session contents, and personal data. Logs
|
|
15
|
+
without secrets only.
|
|
16
|
+
|
|
17
|
+
## Scope note
|
|
18
|
+
|
|
19
|
+
This plugin is an offline checker. It reads the material you hand it and
|
|
20
|
+
compares it against a versioned rule pack; it makes no network calls and no
|
|
21
|
+
model calls, and it stores nothing.
|
|
22
|
+
|
|
23
|
+
## What to include
|
|
24
|
+
|
|
25
|
+
- affected package version (and DeepSeek Harness runtime version)
|
|
26
|
+
- a minimal reproduction
|
|
27
|
+
- your impact assessment
|
|
28
|
+
|
|
29
|
+
## Response expectations
|
|
30
|
+
|
|
31
|
+
- acknowledgement within **7 days**
|
|
32
|
+
- status updates at least every **14 days** until resolution
|
|
33
|
+
- coordinated disclosure: the fix and advisory are prepared first; the finding
|
|
34
|
+
is disclosed publicly after the fix ships
|
|
35
|
+
|
|
36
|
+
## Credits and disclosure
|
|
37
|
+
|
|
38
|
+
- reporters are credited in the advisory and CHANGELOG unless they ask to stay anonymous
|
|
39
|
+
- advisories follow GitHub's advisory workflow and are published together with the fix
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-hazplan-check",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "HAZOP 分析表要素齐备性与偏差推导一致性核对(依据公开的危险与可操作性分析标准,仅提示差异,不作出定性结论)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.mjs",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"README-hi.md",
|
|
24
24
|
"locale/*.json",
|
|
25
25
|
"icon.svg",
|
|
26
|
-
"rules"
|
|
26
|
+
"rules",
|
|
27
|
+
"CHANGELOG.md",
|
|
28
|
+
"SECURITY.md"
|
|
27
29
|
],
|
|
28
30
|
"scripts": {
|
|
29
31
|
"build": "tsdown",
|
|
@@ -32,7 +34,7 @@
|
|
|
32
34
|
"verify:self-contained": "node scripts/verify-self-contained.mjs",
|
|
33
35
|
"check:lockfile": "node scripts/check-lockfile-drift.mjs",
|
|
34
36
|
"check:readmes": "node scripts/check-readme-sync.mjs",
|
|
35
|
-
"prepublishOnly": "pnpm run typecheck && pnpm test && pnpm run build && pnpm run verify:self-contained && pnpm run check:readmes && pnpm run check:citations",
|
|
37
|
+
"prepublishOnly": "pnpm run typecheck && pnpm test && pnpm run build && pnpm run verify:self-contained && pnpm run check:lockfile && pnpm run check:readmes && pnpm run check:citations",
|
|
36
38
|
"prepare": "tsdown",
|
|
37
39
|
"check:citations": "node scripts/check-citations.mjs"
|
|
38
40
|
},
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# 取证受阻记录 —— 《危险与可操作性分析(HAZOP分析)应用导则》AQ/T 3049—2013
|
|
2
|
+
|
|
3
|
+
- **记录日期**:2026-10-07
|
|
4
|
+
- **状态**:⚠️ **条文本轮未取得**(`citations-baseline.json` 中本插件的条目仍然有效,未被撤销)
|
|
5
|
+
- **但来源已从商业站定位到官方平台**,且权威版本事实已取得。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 一、已确认的权威版本事实(可引用)
|
|
10
|
+
|
|
11
|
+
来自**国家市场监督管理总局**主办的**全国标准信息公共服务平台 / 行业标准信息服务平台**:
|
|
12
|
+
|
|
13
|
+
- **记录页**:<https://hbba.sacinfo.org.cn/stdDetail/8fc5458a9fa6fa55ccf5d2056d9f5589>
|
|
14
|
+
- **标准号**:**AQ/T 3049—2013**
|
|
15
|
+
- **标准名称**:**危险与可操作性分析(HAZOP分析)应用导则**
|
|
16
|
+
- **行业**:安全生产 **标准状态**:**现行**
|
|
17
|
+
- **发布日期**:**2013-06-08** **实施日期**:**2013-10-01**
|
|
18
|
+
- **批准发布部门**:**国家安全生产监督管理总局**
|
|
19
|
+
- **技术归口**:全国安全生产标准化技术委员会化学品安全分技术委员会
|
|
20
|
+
- **备案号**:**41158-2013** **备案日期**:2014-12-26 **备案公告**:2013 年第 8 号(总第 164 号)
|
|
21
|
+
- **起草单位**:中国石油化工股份有限公司青岛安全工程研究院、国家安全生产监督管理总局化学品登记中心等
|
|
22
|
+
- **起草人**:张海峰、牟善军 等
|
|
23
|
+
|
|
24
|
+
⚠️ 注意标准号是 **AQ/T(推荐性行业标准)**,不是 AQ(强制性)。
|
|
25
|
+
若规则库或文档中把本标准称作强制性标准,即为错误。
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 二、为什么本轮仍未取得条文
|
|
30
|
+
|
|
31
|
+
该官方记录页提供「**查看文本**」入口,但**正文不在页面 HTML 中**——
|
|
32
|
+
本轮取回的页面只有 594 个字符(导航、元数据、页脚),**无任何条文文字**,
|
|
33
|
+
也没有指向 PDF/全文的直链(页面内唯一的脚本引用是平台的通用 JS)。
|
|
34
|
+
|
|
35
|
+
⇒ **无法通过文本抓取获得条文。**
|
|
36
|
+
|
|
37
|
+
## 三、规则引用了哪些条款(供取证时逐条核对)
|
|
38
|
+
|
|
39
|
+
本插件 7 条规则的 `clause` 字段指向以下位置,取证时需逐一比对:
|
|
40
|
+
|
|
41
|
+
| 规则 | 所引位置 |
|
|
42
|
+
|---|---|
|
|
43
|
+
| `HZ-001` | 6.6.4 |
|
|
44
|
+
| `HZ-002` | 6.6.3 |
|
|
45
|
+
| `HZ-003` | 表 1、表 2(引导词及其含义);6.4.3 |
|
|
46
|
+
| `HZ-004` | 3.3(偏离 deviation 的定义);6.4.3 |
|
|
47
|
+
| `HZ-005` | 6.5;附录 B.10.3(资料性) |
|
|
48
|
+
| `HZ-006` | 附录 A.2(资料性) |
|
|
49
|
+
| `HZ-007` | 6.4.3 |
|
|
50
|
+
|
|
51
|
+
📌 **取证时请特别留意 `HZ-006`**:其 `excerpt` 写作
|
|
52
|
+
「表头含项目名称、分析对象、设计意图、节点、小组成员、分析的图纸或文件、日期和页码。」
|
|
53
|
+
——「**表头含**……」是**叙述性措辞**,读起来像对附录 A.2 的**概括**而非逐字引文。
|
|
54
|
+
取得原文后应核对:若原文并非此措辞,该条 `excerpt` 需要按原文更正,
|
|
55
|
+
或改标 `derived-from-principle` 并在 `note` 中说明是概括。
|
|
56
|
+
|
|
57
|
+
## 四、可行的取证路径(供后续选择)
|
|
58
|
+
|
|
59
|
+
| 路径 | 说明 |
|
|
60
|
+
|---|---|
|
|
61
|
+
| **官方平台「查看文本」查看器** | 在浏览器中打开记录页并点击「查看文本」;若查看器可复制文本,即可逐字取证。**本轮无法自动化访问。** |
|
|
62
|
+
| **应急管理部标准发布渠道** | 批准发布部门为国家安全生产监督管理总局(现应急管理部),其网站可能提供标准文本。 |
|
|
63
|
+
| **正式出版物** | 该标准由标准出版机构出版发行;纸质/正版电子版是条文权威载体,需购买。 |
|
|
64
|
+
| **由维护者手工录入并逐字复核** | 若上述渠道均不可得,可由人对照正版逐字录入,并在本目录另附录入来源与复核记录。 |
|
|
65
|
+
|
|
66
|
+
## 五、复现本记录
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
# 官方记录页(版本事实)
|
|
70
|
+
curl -sL -A 'Mozilla/5.0' \
|
|
71
|
+
'https://hbba.sacinfo.org.cn/stdDetail/8fc5458a9fa6fa55ccf5d2056d9f5589' \
|
|
72
|
+
| sed 's/<[^>]*>//g' | tr -s ' ' | grep -o 'AQ/T 3049-2013'
|
|
73
|
+
# 证明页面无正文:清理后总长仅 ~594 字符,且不含任何条文文字
|
|
74
|
+
```
|
package/rules/hazplan-check.yaml
CHANGED
|
@@ -46,7 +46,7 @@ rules:
|
|
|
46
46
|
clause: '6.6.4'
|
|
47
47
|
excerpt: 每一个危险和可操作性问题都宜作为单项记录。
|
|
48
48
|
kind: direct
|
|
49
|
-
source:
|
|
49
|
+
source: https://hbba.sacinfo.org.cn/stdDetail/8fc5458a9fa6fa55ccf5d2056d9f5589
|
|
50
50
|
params:
|
|
51
51
|
check:
|
|
52
52
|
kind: presence
|
|
@@ -71,7 +71,7 @@ rules:
|
|
|
71
71
|
clause: '6.6.3'
|
|
72
72
|
excerpt: 列出所有分析的节点清单,以及没有被分析节点的理由。
|
|
73
73
|
kind: direct
|
|
74
|
-
source:
|
|
74
|
+
source: https://hbba.sacinfo.org.cn/stdDetail/8fc5458a9fa6fa55ccf5d2056d9f5589
|
|
75
75
|
params:
|
|
76
76
|
check:
|
|
77
77
|
kind: presence
|
|
@@ -95,7 +95,7 @@ rules:
|
|
|
95
95
|
clause: 表1、表2
|
|
96
96
|
excerpt: 无,没有|完全没有达到设计意图;多,过量|数量上的增加;少,减量|数量上的减少;伴随|性质上的变化(增多);部分|性质上的变化(减少);相反|与设计意图逻辑相反;异常|完全替代
|
|
97
97
|
kind: direct
|
|
98
|
-
source:
|
|
98
|
+
source: https://hbba.sacinfo.org.cn/stdDetail/8fc5458a9fa6fa55ccf5d2056d9f5589
|
|
99
99
|
params:
|
|
100
100
|
check:
|
|
101
101
|
kind: enum
|
|
@@ -107,7 +107,7 @@ rules:
|
|
|
107
107
|
clause: 6.4.3
|
|
108
108
|
excerpt: 所有引导词及其相关要素/特性组合都要被明确定义并存档。
|
|
109
109
|
kind: direct
|
|
110
|
-
source:
|
|
110
|
+
source: https://hbba.sacinfo.org.cn/stdDetail/8fc5458a9fa6fa55ccf5d2056d9f5589
|
|
111
111
|
note: >-
|
|
112
112
|
表1 给出工艺参数类引导词(无/多/少/伴随/部分/相反/异常),
|
|
113
113
|
表2 给出与时间和先后顺序相关的引导词(早/晚/先/后),故 values 同时收录两表。
|
|
@@ -125,7 +125,7 @@ rules:
|
|
|
125
125
|
clause: '3.3'
|
|
126
126
|
excerpt: 偏离 deviation 设计意图的偏差。
|
|
127
127
|
kind: derived-from-principle
|
|
128
|
-
source:
|
|
128
|
+
source: https://hbba.sacinfo.org.cn/stdDetail/8fc5458a9fa6fa55ccf5d2056d9f5589
|
|
129
129
|
params:
|
|
130
130
|
check:
|
|
131
131
|
kind: presenceAny
|
|
@@ -136,7 +136,7 @@ rules:
|
|
|
136
136
|
clause: 6.4.3
|
|
137
137
|
excerpt: 如果某一组合在指定设计中有一种以上解释,则这些解释均建议被一一列出。
|
|
138
138
|
kind: direct
|
|
139
|
-
source:
|
|
139
|
+
source: https://hbba.sacinfo.org.cn/stdDetail/8fc5458a9fa6fa55ccf5d2056d9f5589
|
|
140
140
|
note: >-
|
|
141
141
|
3.3 把"偏离"定义为"设计意图的偏差",6.4.3 要求引导词与"相关要素/特性"的组合被明确
|
|
142
142
|
定义并存档 —— 两者合起来意味着记录中应能看出"哪个要素 + 哪个引导词 → 哪个偏离"。
|
|
@@ -153,7 +153,7 @@ rules:
|
|
|
153
153
|
clause: '6.5'
|
|
154
154
|
excerpt: 对某些应用来说,根据后果潜在的严重性或基于风险矩阵的风险分级对偏离进行分类是有用的。
|
|
155
155
|
kind: institutional-configuration
|
|
156
|
-
source:
|
|
156
|
+
source: https://hbba.sacinfo.org.cn/stdDetail/8fc5458a9fa6fa55ccf5d2056d9f5589
|
|
157
157
|
alsoBasis:
|
|
158
158
|
- document: 《风险管理 风险评估技术》
|
|
159
159
|
number: GB/T 27921-2023
|
|
@@ -184,7 +184,7 @@ rules:
|
|
|
184
184
|
clause: 附录A.2(资料性)
|
|
185
185
|
excerpt: 表头含项目名称、分析对象、设计意图、节点、小组成员、分析的图纸或文件、日期和页码。
|
|
186
186
|
kind: derived-from-principle
|
|
187
|
-
source:
|
|
187
|
+
source: https://hbba.sacinfo.org.cn/stdDetail/8fc5458a9fa6fa55ccf5d2056d9f5589
|
|
188
188
|
params:
|
|
189
189
|
check:
|
|
190
190
|
kind: headerPresence
|
|
@@ -205,7 +205,7 @@ rules:
|
|
|
205
205
|
clause: 6.4.3
|
|
206
206
|
excerpt: 所有引导词及其相关要素/特性组合都要被明确定义并存档。
|
|
207
207
|
kind: derived-from-principle
|
|
208
|
-
source:
|
|
208
|
+
source: https://hbba.sacinfo.org.cn/stdDetail/8fc5458a9fa6fa55ccf5d2056d9f5589
|
|
209
209
|
params:
|
|
210
210
|
check:
|
|
211
211
|
kind: derivedDeviation
|