dsh-warranty-calc 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
+ - Seven source URLs were broken by a duplicated path segment and could not be opened.
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 WC-001..WC-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-warranty-calc/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-warranty-calc",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "质保期与索赔金额核对(按质保期月数与里程、索赔金额算式核对自洽,仅提示差异,不作出定性结论)",
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
  },
@@ -1,8 +1,4 @@
1
1
  {
2
2
  "note": "Excerpt segments that are not yet traceable to this repository's rules/evidence/ record. The check:citations gate fails on anything new and on any entry that has become traceable, so this list can only shrink.",
3
- "untraceable": [
4
- "WC-001:6b8768521ea3",
5
- "WC-005:5e802e274f83",
6
- "WC-007:6b8768521ea3"
7
- ]
3
+ "untraceable": []
8
4
  }
@@ -0,0 +1,85 @@
1
+ # 条文核查报告 —— dsh-warranty-calc(家用汽车三包期限核对)
2
+
3
+ - **核查日期**:2026-10-07
4
+ - **核查对象**:`WC-001`、`WC-005`、`WC-007` 引用的《家用汽车产品修理更换退货责任规定》
5
+ - **核查方法**:按规则 `basis.source` 指向的**国务院公报页面**取回全文,逐字复制。
6
+ - **结论**:**取得逐字条文** —— 第九条、第十七条、第十八条、第十九条。
7
+
8
+ ---
9
+
10
+ ## 一、本轮先修的一处真实缺陷:`source` URL 是坏的
11
+
12
+ 规则库中 **7 处** `source` 字段写成了下面这个**拼接错误的 URL**:
13
+
14
+ ```
15
+ https://www.gov.cn/gongbao/content/2021/content_5639836.htmgongbao/content/2021/content_5639836.htm
16
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17
+ 多拼接了一段,浏览器无法打开
18
+ ```
19
+
20
+ 正确地址应为
21
+ `https://www.gov.cn/gongbao/content/2021/content_5639836.htm`。
22
+ **7 处已全部修正。** 这类坏链会让读者完全无法核对引文来源,与「引文应可追溯」的纪律直接冲突。
23
+
24
+ ---
25
+
26
+ ## 二、已取得逐字条文的文件
27
+
28
+ ### 《家用汽车产品修理更换退货责任规定》
29
+
30
+ - **版本事实**(逐字照录自该页正文):
31
+ **国家市场监督管理总局令第 43 号**。《规定》已经 **2021 年 3 月 18 日**国家市场监督管理总局
32
+ 第 4 次局务会议通过,**2021 年 7 月 22 日**公布(局长 张工签署),**自 2022 年 1 月 1 日起施行**。
33
+ - **来源**:《国务院公报》2021 年第 27 号,中国政府网
34
+ <https://www.gov.cn/gongbao/content/2021/content_5639836.htm>
35
+ (**中央人民政府门户网站 · 国务院公报**,属中央发布渠道)
36
+ - **取得方式**:整页取回后剥离标签、逐字复制;顿号、括号与项号按原页保留。
37
+
38
+ 逐字条文(与本插件规则相关的各条):
39
+
40
+ > **第九条** 三包凭证应当包括下列内容:
41
+ >   (一)产品品牌、型号、车辆类型、车辆识别代号(VIN)、生产日期;
42
+ >   (二)生产者的名称、地址、邮政编码、客服电话;
43
+ >   (三)销售者的名称、地址、邮政编码、客服电话、开具购车发票的日期、交付车辆的日期;
44
+ >   (四)生产者或者销售者约定的修理者(以下简称修理者)网点信息的查询方式;
45
+ >   (五)家用汽车产品的三包条款、包修期、三包有效期、使用补偿系数;
46
+ >   (六)主要零部件、特殊零部件的种类范围,易损耗零部件的种类范围及其质量保证期;
47
+ >   (七)家用纯电动、插电式混合动力汽车产品的动力蓄电池在包修期、三包有效期内的容量衰减限值;
48
+ >   (八)按照规定需要明示的其他内容。
49
+
50
+ > **第十七条** 修理者应当建立修理记录存档制度。修理记录保存期限不得低于6年。
51
+ >   修理记录应当包括送修时间、行驶里程、消费者质量问题陈述、检查结果、修理项目、更换的零部件名称和编号、材料费、工时及工时费、车辆拖运费用、提供备用车或者交通费用补偿的情况、交车时间、修理者和消费者签名或者盖章等信息,并提供给消费者一份。
52
+ >   消费者因遗失修理记录或者其他原因需要查阅或者复印修理记录,修理者应当提供便利。
53
+
54
+ > **第十八条** 家用汽车产品的三包有效期不得低于2年或者行驶里程50,000公里,以先到者为准;包修期不得低于3年或者行驶里程60,000公里,以先到者为准。
55
+ >   三包有效期和包修期自销售者开具购车发票之日起计算;开具购车发票日期与交付家用汽车产品日期不一致的,自交付之日起计算。
56
+
57
+ > **第十九条** 家用汽车产品在包修期内出现质量问题或者易损耗零部件在其质量保证期内出现质量问题的,消费者可以凭三包凭证选择修理者免费修理(包括免除工时费和材料费)。
58
+ >   修理者能够通过查询相关信息系统等方式核实购买信息的,应当免除消费者提供三包凭证的义务。
59
+
60
+ ---
61
+
62
+ ## 三、条号归属核对(未发现错置)
63
+
64
+ `WC-001`/`WC-007`(第十七条、第九条)、`WC-005`(第十九条)各条号与本规定原文一致。
65
+
66
+ ⚠️ **本规定第十八条含两个硬性下限**(三包有效期 **2 年或 50,000 公里**、包修期 **3 年或 60,000 公里**,
67
+ 均"以先到者为准"),且**起算点有兜底规则**(发票日期与交付日期不一致时自交付之日起计算)。
68
+ 若本插件的计算逻辑未体现"以先到者为准"或该兜底起算规则,即为**实质错误**——本次已把该条全文录入,
69
+ 供后续核对计算逻辑时直接比对。
70
+
71
+ ⚠️ 本规则库的 `kind`、`severity`、`excerpt` **一律未改动**。
72
+
73
+ ## 四、仍未取得的部分(如实标注)
74
+
75
+ | 文件 | 状态 |
76
+ |---|---|
77
+ | 本规定第二十条及以后(更换、退货的具体情形与折旧计算) | 页面已含全文,但本插件规则未引用,故不全录。 |
78
+ | 《中华人民共和国产品质量法》《消费者权益保护法》 | **未取得**;本规定第一条列为立法依据,本插件不直接引用。 |
79
+
80
+ ## 五、复现方法
81
+
82
+ ```sh
83
+ curl -sL -A 'Mozilla/5.0' 'https://www.gov.cn/gongbao/content/2021/content_5639836.htm' \
84
+ | sed 's/<[^>]*>//g' | tr -s ' ' | grep -o '第十七条[^第]*'
85
+ ```
@@ -41,7 +41,7 @@ rules:
41
41
  clause: 第十七条(修理记录应当包括……更换的零部件名称和编号……)、第九条(三包凭证的内容)
42
42
  excerpt: 修理者应当建立修理记录存档制度。修理记录保存期限不得低于6年。修理记录应当包括送修时间、行驶里程、消费者质量问题陈述、检查结果、修理项目、更换的零部件名称和编号、材料费、工时及工时费、车辆拖运费用、提供备用车或者交通费用补偿的情况、交车时间、修理者和消费者签名或者盖章等信息,并提供给消费者一份。
43
43
  kind: direct
44
- source: https://www.gov.cn/gongbao/content/2021/content_5639836.htmgongbao/content/2021/content_5639836.htm
44
+ source: https://www.gov.cn/gongbao/content/2021/content_5639836.htm
45
45
  params:
46
46
  check:
47
47
  kind: presenceAny
@@ -64,7 +64,7 @@ rules:
64
64
  clause: 第十八条(三包有效期与包修期均为"不得低于"的下限)、第四条(鼓励经营者作出严于本规定的承诺)
65
65
  excerpt: 本条依据为本机构配置的口径,不存在可引用的标准条文;本规则库不伪造引文。
66
66
  kind: institutional-configuration
67
- source: https://www.gov.cn/gongbao/content/2021/content_5639836.htmgongbao/content/2021/content_5639836.htm
67
+ source: https://www.gov.cn/gongbao/content/2021/content_5639836.htm
68
68
  params:
69
69
  check:
70
70
  kind: date
@@ -97,7 +97,7 @@ rules:
97
97
  clause: 第十八条(三包有效期、包修期与其起算点)
98
98
  excerpt: 家用汽车产品的三包有效期不得低于2年或者行驶里程50,000公里,以先到者为准;包修期不得低于3年或者行驶里程60,000公里,以先到者为准。三包有效期和包修期自销售者开具购车发票之日起计算;开具购车发票日期与交付家用汽车产品日期不一致的,自交付之日起计算。
99
99
  kind: derived-from-principle
100
- source: https://www.gov.cn/gongbao/content/2021/content_5639836.htmgongbao/content/2021/content_5639836.htm
100
+ source: https://www.gov.cn/gongbao/content/2021/content_5639836.htm
101
101
  params:
102
102
  check:
103
103
  kind: number
@@ -121,7 +121,7 @@ rules:
121
121
  clause: 第十八条(行驶里程 50,000 公里/60,000 公里,以先到者为准)
122
122
  excerpt: 本条依据为本机构配置的口径,不存在可引用的标准条文;本规则库不伪造引文。
123
123
  kind: institutional-configuration
124
- source: https://www.gov.cn/gongbao/content/2021/content_5639836.htmgongbao/content/2021/content_5639836.htm
124
+ source: https://www.gov.cn/gongbao/content/2021/content_5639836.htm
125
125
  params:
126
126
  check:
127
127
  kind: fieldComparison
@@ -145,7 +145,7 @@ rules:
145
145
  clause: 第十九条(免费修理,包括免除工时费和材料费)
146
146
  excerpt: 家用汽车产品在包修期内出现质量问题或者易损耗零部件在其质量保证期内出现质量问题的,消费者可以凭三包凭证选择修理者免费修理(包括免除工时费和材料费)。
147
147
  kind: direct
148
- source: https://www.gov.cn/gongbao/content/2021/content_5639836.htmgongbao/content/2021/content_5639836.htm
148
+ source: https://www.gov.cn/gongbao/content/2021/content_5639836.htm
149
149
  params:
150
150
  check:
151
151
  kind: productOf
@@ -171,7 +171,7 @@ rules:
171
171
  clause: 第十八条(起算点:自销售者开具购车发票之日起;不一致时自交付之日起)
172
172
  excerpt: 家用汽车产品的三包有效期不得低于2年或者行驶里程50,000公里,以先到者为准;包修期不得低于3年或者行驶里程60,000公里,以先到者为准。三包有效期和包修期自销售者开具购车发票之日起计算;开具购车发票日期与交付家用汽车产品日期不一致的,自交付之日起计算。
173
173
  kind: derived-from-principle
174
- source: https://www.gov.cn/gongbao/content/2021/content_5639836.htmgongbao/content/2021/content_5639836.htm
174
+ source: https://www.gov.cn/gongbao/content/2021/content_5639836.htm
175
175
  params:
176
176
  check:
177
177
  kind: date
@@ -199,7 +199,7 @@ rules:
199
199
  clause: 第十七条(修理记录存档制度)、第九条(三包凭证的内容)
200
200
  excerpt: 修理者应当建立修理记录存档制度。修理记录保存期限不得低于6年。修理记录应当包括送修时间、行驶里程、消费者质量问题陈述、检查结果、修理项目、更换的零部件名称和编号、材料费、工时及工时费、车辆拖运费用、提供备用车或者交通费用补偿的情况、交车时间、修理者和消费者签名或者盖章等信息,并提供给消费者一份。
201
201
  kind: derived-from-principle
202
- source: https://www.gov.cn/gongbao/content/2021/content_5639836.htmgongbao/content/2021/content_5639836.htm
202
+ source: https://www.gov.cn/gongbao/content/2021/content_5639836.htm
203
203
  params:
204
204
  check:
205
205
  kind: unique