dsh-hs-classify 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,37 @@
1
+ # Changelog
2
+
3
+ ## 0.2.2
4
+
5
+ - Rework the README first screen. The H1 now names what the plugin checks rather
6
+ than repeating the package name, and a question-and-answer table and a standards
7
+ table come before the boundary paragraph.
8
+
9
+ The substance is unchanged and the boundary paragraph is verbatim: in a
10
+ compliance tool that paragraph is what stops a wrong "pass" being read as
11
+ approval, so it moved rather than shrank. What changed is the order - a reader
12
+ or an extractor previously met eleven badges, an install command and a
13
+ disclaimer before learning what the plugin does. The Q&A rows are derived from
14
+ each plugin's own rules and the standards table from the rule pack's
15
+ `document`/`number` fields, so no answer and no standard is hand-typed.
16
+
17
+ All five languages were restructured together; `check:readmes` holds them to the
18
+ same section count, install command and configuration keys.
19
+
20
+ ## 0.2.1
21
+
22
+ - Ship `CHANGELOG.md` and `SECURITY.md` inside the package. `files` is an
23
+ allowlist and neither was on it, so no release note had ever reached anyone
24
+ who installed this package, and npm had no changelog section to show.
25
+ ## 0.2.0
26
+
27
+ - Release infrastructure brought to the family standard: `verify:self-contained`,
28
+ `check:lockfile`, `check:readmes` and `check:citations` gates, a `prepublishOnly` that
29
+ re-runs the whole chain, SECURITY.md, dependabot, and the OpenSSF Scorecard workflow.
30
+ - `check:citations` enforces the rule this pack's own header states: every `excerpt`
31
+ must be a verbatim quotation, findable in `rules/evidence/`. Rules that are not
32
+ traceable yet are listed in `rules/citations-baseline.json`, and that file can only
33
+ shrink - anything new has to be sourced before it can land.
34
+ - The README install command now names the published package instead of a local tarball.
35
+ - Five-language READMEs hold the same section count and the same configuration keys.
36
+ - Rule pack: 6 rules across HC-001..HC-006.
37
+ - Licensed Apache-2.0.
package/README-es.md CHANGED
@@ -1,4 +1,25 @@
1
- # dsh-hs-classify
1
+ # dsh-hs-classify — Verificación de la coherencia jerárquica del registro de clasificación de mercancías
2
+
3
+ `dsh-hs-classify` lee un registro de clasificación de mercancías —la cabecera del declarante más una fila por partida— y comprueba la estructura de los números que registra: que el código de mercancía tenga diez dígitos, que el capítulo, la partida y la subpartida sean prefijos sucesivos de ese código, que los niveles vayan de lo general a lo específico, que cada fila registre una base de clasificación, que la cabecera declare la versión del arancel a la que pertenecen los códigos, que los números de ítem sean únicos en el registro y que no quede ningún marcador de plantilla sin sustituir en la denominación.
4
+
5
+ ## Qué responde
6
+
7
+ | Usted pregunta | Qué responde |
8
+ |---|---|
9
+ | Algunos códigos del registro tienen ocho dígitos y uno termina en letra. ¿Se informa de ellos? | Sí. `HC-001` contrasta cada `hsCode` relleno con el `pattern` del paquete de reglas, `^[0-9]{10}$`, e informa de la fila junto con el valor que leyó. Solo comprueba el número de dígitos y los caracteres, nunca si la mercancía corresponde a ese código. Una celda de código vacía no se mira: lo que informa es un código con la forma incorrecta, no un código que falta. Los diez dígitos son un ajuste del paquete de reglas: cuando el arancel anual cambie la longitud, se edita el `pattern`, no el código. |
10
+ | El 章, el 品目 y el 子目 de una fila no concuerdan con su 商品编号. ¿Se detecta? | Sí. `HC-002` lee las columnas de nivel de lo general a lo específico —章, 品目 y 子目, dos, cuatro y seis dígitos en el ejemplo del propio paquete de reglas— e informa del nivel que no es prefijo del `hsCode` leído, o que no es más fino que el nivel anterior. Solo comprueba esa relación de prefijo y ese orden: si el código corresponde a la mercancía es una determinación aduanera que exige el arancel y las decisiones de clasificación, que este plugin no consulta. Una celda de nivel vacía no se compara. |
11
+ | Una fila deja vacía la 归类依据. | `HC-003` informa de esa fila: `basis` debe estar relleno en todas las filas que llevan la columna. Comprueba que haya algo escrito, no que la disposición arancelaria, la nota de capítulo, la decisión de clasificación o el dictamen anticipado citados existan o respalden la clasificación: este plugin no consulta nada de eso. Si el registro no tiene columna `basis`, `HC-003` aparece en `skipped` indicando que el material no tiene esa columna, en lugar de pasar en silencio. |
12
+ | La cabecera no dice a qué versión del arancel pertenecen los códigos. | `HC-004` exige que la cabecera declare `tariffVersion` e informa del registro cuando la deja vacía. Comprueba que la declaración esté presente, no que la edición nombrada sea la de estos códigos: la regla no lee los códigos, y los códigos se dividen y se fusionan entre ediciones. Su lista `fields` es un ajuste del paquete de reglas: añada `declarant` si su cabecera lo registra. |
13
+ | El 项号 5 aparece en dos filas. | `HC-005` informa de la fila posterior como duplicada de la anterior, porque `itemNo` debe ser único dentro de un mismo registro; la comparación ignora los espacios, así que `5` y ` 5 ` son el mismo número de ítem. Solo comprueba la unicidad. Una mercancía declarada en varias filas, por especificaciones distintas, necesita un número de ítem distinto en cada una. Aunque no haya ningún número repetido, `HC-005` sigue apareciendo en `skipped`: entonces con el motivo de que el material cumple las precondiciones de la comprobación y no se hallaron entradas divergentes, un motivo distinto del que da una regla cuando no puede ejecutarse porque falta la columna. |
14
+ | La columna 品名 todavía tiene 【】 o 待填 de la plantilla. | `HC-006` informa de la fila y del marcador que encontró. El paquete de reglas busca 【, 】, {{, }}, XXX, xxx, 待填, 待补充, TBD, todo y 示例, y `terms` se puede recortar a su propia plantilla. Solo busca marcadores sin sustituir: no juzga si el nombre es correcto y tampoco exige que la columna esté rellena: una celda `description` vacía no le produce ningún hallazgo, y ninguna otra regla de este paquete la exige. |
15
+
16
+ ## Normas que sigue
17
+
18
+ | Documento | Número | Reglas que lo citan |
19
+ |---|---|---|
20
+ | 《中华人民共和国进出口税则》 | 现行版本本次未核实 | HC-001, HC-004, HC-005, HC-006 |
21
+ | 《商品名称及编码协调制度》 | 现行版本本次未核实 | HC-002 |
22
+ | 《中华人民共和国进出口关税条例》 | 国务院令第392号(2003年11月23日公布;根据2011年1月8日、2013年12月7日、2016年2月6日三次《国务院关于修改(废止)部分行政法规的决定》修订) | HC-003 |
2
23
 
3
24
  **Boundary:** this plugin checks a **商品归类台账** for the *structure* of the numbers it records — that a
4
25
  commodity code is ten digits, that its chapter, heading and subheading are successive prefixes of it, that the
package/README-hi.md CHANGED
@@ -1,4 +1,25 @@
1
- # dsh-hs-classify
1
+ # dsh-hs-classify — माल वर्गीकरण रजिस्टर के पदानुक्रम की संगति की जाँच
2
+
3
+ `dsh-hs-classify` एक वर्गीकरण रजिस्टर — घोषणाकर्ता का हेडर और प्रत्येक मद की एक पंक्ति — पढ़ता है और उसमें दर्ज संख्याओं की संरचना की जाँच करता है: क्या माल-कोड दस अंकों का है, क्या उसका अध्याय, हेडिंग और उप-हेडिंग उस कोड के क्रमिक पूर्व-खंड हैं, क्या स्तर मोटे से बारीक की ओर जाते हैं, क्या हर पंक्ति में वर्गीकरण का आधार दर्ज है, क्या हेडर उस टैरिफ़ संस्करण की घोषणा करता है जिससे ये कोड संबंधित हैं, क्या मद-क्रमांक रजिस्टर में अद्वितीय हैं, और क्या मद के नाम में कोई बदला न गया प्लेसहोल्डर शेष है।
4
+
5
+ ## यह किन सवालों का जवाब देता है
6
+
7
+ | आपका सवाल | इसका जवाब |
8
+ |---|---|
9
+ | हमारे रजिस्टर में कुछ कोड आठ अंकों के हैं और एक के अंत में अक्षर है। क्या ये दर्ज होंगे? | हाँ। `HC-001` हर भरे हुए `hsCode` की तुलना नियम-पैक के `pattern` (`^[0-9]{10}$`) से करता है और उस पंक्ति को उस मान के साथ दर्ज करता है जो उसने पढ़ा। यह केवल अंकों की संख्या और अक्षरों की जाँच करता है, यह कभी नहीं कि माल उसी कोड के अंतर्गत आता है। खाली कोड सेल छोड़ दिया जाता है, इसलिए यह गलत आकार के कोड को दर्ज करता है, अनुपस्थित कोड को नहीं। दस अंक नियम-पैक की सेटिंग है: वार्षिक टैरिफ़ से लंबाई बदले तो `pattern` बदलें, कोड नहीं। |
10
+ | किसी पंक्ति के 章, 品目 और 子目 उसके 商品编号 से मेल नहीं खाते। क्या यह पकड़ में आता है? | हाँ। `HC-002` स्तर-कॉलमों को मोटे से बारीक क्रम में पढ़ता है — 章, 品目, 子目, नियम-पैक के अपने उदाहरण में दो, चार और छह अंक — और वह स्तर दर्ज करता है जो पढ़े गए `hsCode` का पूर्व-खंड (prefix) नहीं है, या जो अपने पिछले स्तर से अधिक बारीक नहीं है। यह केवल उस पूर्व-खंड संबंध और उस क्रम की जाँच करता है: कोड उस माल पर लागू होता है या नहीं, यह सीमा-शुल्क का निर्णय है जिसके लिए टैरिफ़ और वर्गीकरण निर्णय चाहिए, जिन्हें यह प्लगइन नहीं देखता। खाली छोड़ा गया स्तर-कॉलम तुलना में नहीं आता। |
11
+ | एक पंक्ति में 归类依据 खाली है। | `HC-003` उस पंक्ति को दर्ज करता है: जिन पंक्तियों में यह कॉलम है, उनमें `basis` भरा होना चाहिए। यह देखता है कि कुछ लिखा है या नहीं, यह नहीं कि उद्धृत टैरिफ़ प्रावधान, अध्याय-टिप्पणी, वर्गीकरण निर्णय या अग्रिम निर्णय मौजूद है या उस वर्गीकरण का समर्थन करता है — यह प्लगइन इनमें से कुछ भी नहीं देखता। यदि रजिस्टर में `basis` कॉलम ही न हो, तो `HC-003` चुपचाप पास होने के बजाय `skipped` में यह बताते हुए आता है कि सामग्री में वह कॉलम नहीं है। |
12
+ | हेडर यह नहीं बताता कि कोड टैरिफ़ के किस संस्करण के हैं। | `HC-004` अपेक्षा करता है कि हेडर `tariffVersion` घोषित करे, और हेडर में वह खाली होने पर रजिस्टर को दर्ज करता है। यह देखता है कि घोषणा मौजूद है, यह नहीं कि बताया गया संस्करण इन्हीं कोड का है: यह नियम कोड नहीं पढ़ता, और संस्करणों के बीच कोड बँटते और जुड़ते हैं। इसकी `fields` सूची नियम-पैक की सेटिंग है: हेडर में घोषणाकर्ता भी दर्ज हो तो `declarant` जोड़ दें। |
13
+ | 项号 5 दो पंक्तियों में आया है। | `HC-005` बाद वाली पंक्ति को पहली की दोहराई हुई बताता है, क्योंकि एक ही रजिस्टर में `itemNo` अद्वितीय होना चाहिए; तुलना में खाली जगह नहीं गिनी जाती, इसलिए `5` और ` 5 ` एक ही मद-क्रमांक हैं। यह केवल अद्वितीयता की जाँच करता है। एक ही माल कई पंक्तियों में (जैसे भिन्न विशिष्टताओं के साथ) घोषित हो तो हर पंक्ति में अलग मद-क्रमांक चाहिए। सारे क्रमांक अलग होने पर भी `HC-005` `skipped` में रहता है: तब यह कारण दर्ज होता है कि सामग्री ने इस जाँच की पूर्व-शर्तें पूरी कीं और कोई भिन्न प्रविष्टि नहीं मिली — जो उस कारण से अलग है जो कॉलम न होने पर जाँच न चल पाने की स्थिति में दिया जाता है। |
14
+ | 品名 कॉलम में अब भी टेम्पलेट के 【】 या 待填 पड़े हैं। | `HC-006` उस पंक्ति और मिले हुए प्लेसहोल्डर को दर्ज करता है। नियम-पैक 【, 】, {{, }}, XXX, xxx, 待填, 待补充, TBD, todo और 示例 खोजता है, और `terms` को अपने टेम्पलेट के अनुसार घटाया-बढ़ाया जा सकता है। यह केवल बदले न गए प्लेसहोल्डर खोजता है: यह नहीं आँकता कि नाम सही है, और यह भी नहीं माँगता कि कॉलम भरा हो — खाली `description` सेल से इसका कोई अंतर दर्ज नहीं होता, और इस नियम-पैक का कोई अन्य नियम भी इसे नहीं माँगता। |
15
+
16
+ ## यह किन मानकों पर आधारित है
17
+
18
+ | दस्तावेज़ | संख्यांक | इन्हें उद्धृत करने वाले नियम |
19
+ |---|---|---|
20
+ | 《中华人民共和国进出口税则》 | 现行版本本次未核实 | HC-001, HC-004, HC-005, HC-006 |
21
+ | 《商品名称及编码协调制度》 | 现行版本本次未核实 | HC-002 |
22
+ | 《中华人民共和国进出口关税条例》 | 国务院令第392号(2003年11月23日公布;根据2011年1月8日、2013年12月7日、2016年2月6日三次《国务院关于修改(废止)部分行政法规的决定》修订) | HC-003 |
2
23
 
3
24
  **Boundary:** this plugin checks a **商品归类台账** for the *structure* of the numbers it records — that a
4
25
  commodity code is ten digits, that its chapter, heading and subheading are successive prefixes of it, that the
package/README-pt.md CHANGED
@@ -1,4 +1,25 @@
1
- # dsh-hs-classify
1
+ # dsh-hs-classify — Verificação da coerência hierárquica do registo de classificação de mercadorias
2
+
3
+ `dsh-hs-classify` lê um registo de classificação de mercadorias —o cabeçalho do declarante mais uma linha por item— e verifica a estrutura dos números que regista: se o código de mercadoria tem dez dígitos, se o capítulo, a posição e a subposição são prefixos sucessivos desse código, se os níveis vão do mais geral para o mais específico, se cada linha regista um fundamento de classificação, se o cabeçalho declara a versão da pauta a que os códigos pertencem, se os números de item são únicos no registo e se não resta nenhum marcador de modelo por substituir na designação.
4
+
5
+ ## O que ele responde
6
+
7
+ | Você pergunta | O que ele responde |
8
+ |---|---|
9
+ | Alguns códigos do registo têm oito dígitos e um termina numa letra. Isso é reportado? | Sim. `HC-001` compara cada `hsCode` preenchido com o `pattern` do pacote de regras, `^[0-9]{10}$`, e reporta a linha com o valor que leu. Verifica apenas o número de dígitos e os caracteres, nunca se a mercadoria pertence a esse código. Uma célula de código em branco é ignorada: o que ele reporta é um código com a forma errada, não um código em falta. Os dez dígitos são uma definição do pacote de regras: quando a pauta anual mudar o comprimento, edita-se o `pattern`, não o código. |
10
+ | O 章, o 品目 e o 子目 de uma linha não concordam com o seu 商品编号. Isso é detetado? | Sim. `HC-002` lê as colunas de nível do mais geral para o mais específico — 章, 品目 e 子目, dois, quatro e seis dígitos no exemplo do próprio pacote de regras — e assinala o nível que não é prefixo do `hsCode` lido, ou que não é mais fino do que o nível anterior. Verifica apenas essa relação de prefixo e essa ordem: se o código corresponde à mercadoria é uma determinação aduaneira que exige a pauta e as decisões de classificação, que este plugin não consulta. Uma célula de nível em branco não é comparada. |
11
+ | Uma linha deixa a 归类依据 vazia. | `HC-003` reporta essa linha: `basis` tem de estar preenchido em todas as linhas que trazem a coluna. Verifica que algo esteja escrito, não que a disposição pautal, a nota de capítulo, a decisão de classificação ou a informação pautal vinculativa citadas existam ou sustentem a classificação — este plugin não consulta nada disso. Se o registo não tiver coluna `basis`, `HC-003` aparece em `skipped` a indicar que o material não tem essa coluna, em vez de passar em silêncio. |
12
+ | O cabeçalho não diz a que versão da pauta pertencem os códigos. | `HC-004` exige que o cabeçalho declare `tariffVersion` e reporta o registo quando o deixa vazio. Verifica que a declaração exista, não que a edição indicada seja a destes códigos: a regra não lê os códigos, e os códigos são divididos e fundidos entre edições. A sua lista `fields` é uma definição do pacote de regras: acrescente `declarant` se o seu cabeçalho o registar. |
13
+ | O 项号 5 aparece em duas linhas. | `HC-005` reporta a linha posterior como duplicada da anterior, porque `itemNo` tem de ser único dentro do mesmo registo; a comparação ignora espaços, por isso `5` e ` 5 ` são o mesmo número de item. Verifica apenas a unicidade. Uma mercadoria declarada em várias linhas, por especificações diferentes, precisa de um número de item diferente em cada uma. Mesmo sem números repetidos, `HC-005` continua a aparecer em `skipped`: aí com o motivo de que o material cumpre as precondições da verificação e não foram encontradas entradas divergentes, um motivo diferente do que é dado quando a regra não pode ser executada por faltar a coluna. |
14
+ | A coluna 品名 ainda tem 【】 ou 待填 do modelo. | `HC-006` reporta a linha e o marcador que encontrou. O pacote de regras procura 【, 】, {{, }}, XXX, xxx, 待填, 待补充, TBD, todo e 示例, e `terms` pode ser ajustado ao seu próprio modelo. Procura apenas marcadores não substituídos: não julga se o nome está correto e também não exige que a coluna esteja preenchida — uma célula `description` vazia não lhe produz qualquer achado, e nenhuma outra regra deste pacote a exige. |
15
+
16
+ ## Normas que segue
17
+
18
+ | Documento | Número | Regras que o citam |
19
+ |---|---|---|
20
+ | 《中华人民共和国进出口税则》 | 现行版本本次未核实 | HC-001, HC-004, HC-005, HC-006 |
21
+ | 《商品名称及编码协调制度》 | 现行版本本次未核实 | HC-002 |
22
+ | 《中华人民共和国进出口关税条例》 | 国务院令第392号(2003年11月23日公布;根据2011年1月8日、2013年12月7日、2016年2月6日三次《国务院关于修改(废止)部分行政法规的决定》修订) | HC-003 |
2
23
 
3
24
  **Boundary:** this plugin checks a **商品归类台账** for the *structure* of the numbers it records — that a
4
25
  commodity code is ten digits, that its chapter, heading and subheading are successive prefixes of it, that the
package/README-zh.md CHANGED
@@ -1,4 +1,25 @@
1
- # dsh-hs-classify
1
+ # dsh-hs-classify — 商品归类层级一致性核对
2
+
3
+ `dsh-hs-classify` 读取一份商品归类台账——表头加每个商品项一行——核对其中编号的结构:商品编号是否为十位数字、章/品目/子目是否为该编号的逐级前缀、层级是否由粗到细、每行是否填写归类依据、表头是否声明商品编号适用的税则版本、项号是否在台账内唯一、品名栏是否残留未替换的占位符。
4
+
5
+ ## 它回答什么问题
6
+
7
+ | 你会问 | 它怎么答 |
8
+ |---|---|
9
+ | 台账里的编号有的是八位,还有一个末位是字母,会被报出吗? | 会。`HC-001` 把每个已填写的 `hsCode` 与规则库的 `pattern`(`^[0-9]{10}$`)比对,报出该行并附上它读到的值。它只核对位数与字符合法性,绝不判断该商品是否应归入这个编号。编号栏留空的不在本条范围内,所以它报的是形式不对的编号,不是缺填的编号。十位是规则库配置:年度税则改了位数,改 `pattern` 即可,不必改代码。 |
10
+ | 某行的章、品目、子目与商品编号对不上,能查出来吗? | 能。`HC-002` 按由粗到细的顺序读取层级栏——章、品目、子目,规则库自己的示例为 2、4、6 位——报出不是所读 `hsCode` 前缀的那一栏,或不比上一级更细的那一栏。它只核对这一前缀关系与这一顺序:编号是否适用于该商品属海关的归类判断,要查税则与归类决定,本插件不查这些。层级栏留空的不作比较。 |
11
+ | 有一行的归类依据是空的。 | `HC-003` 会报出这一行:凡是带这一栏的行,`basis` 都必须填写。它只核对该栏写了没有,不核对所引税则条文、章注、归类决定或预裁定是否存在、是否支持该归类——这些本插件都不查。台账若完全没有 `basis` 栏,`HC-003` 会在 `skipped` 中说明「材料没有『basis』列,本条不适用」,而不是静默通过。 |
12
+ | 表头没有声明这些编号适用哪一版税则。 | `HC-004` 要求表头声明 `tariffVersion`,表头留空即报出该台账。它只核对声明在不在,不判断所写的版本是不是这些编号所属的那一版——本条不读编号,而编码会在各版税则之间拆分与合并。它检查的 `fields` 是规则库配置:表头还记申报人的话,把 `declarant` 加进去即可。 |
13
+ | 项号 5 在两行里各出现一次。 | `HC-005` 会把后一行报为与前行重复:`itemNo` 在同一台账内应唯一,比较时忽略空白字符,所以 `5` 与 ` 5 ` 是同一个项号。它只核对唯一性。同一商品分多行申报(例如不同规格)时,每行要用不同的项号。项号全都不重复时,`HC-005` 仍会出现在 `skipped` 中:此时给的理由是「材料满足该检查的前置条件且未发现差异条目」,与规则因缺列而无法执行时给的理由不同。 |
14
+ | 品名栏还留着模板里的【】或待填。 | `HC-006` 会报出该行以及它匹配到的占位符。规则库查找的是【、】、{{、}}、XXX、xxx、待填、待补充、TBD、todo 与 示例,`terms` 可按本机构模板增减。它只找未替换的占位符:不判断品名对不对,也不要求这一栏必须填写——`description` 单元格留空不会产生差异条目,本规则库中也没有别的规则要求填写品名。 |
15
+
16
+ ## 依据的标准
17
+
18
+ | 文件 | 文号 | 引用它的规则 |
19
+ |---|---|---|
20
+ | 《中华人民共和国进出口税则》 | 现行版本本次未核实 | HC-001, HC-004, HC-005, HC-006 |
21
+ | 《商品名称及编码协调制度》 | 现行版本本次未核实 | HC-002 |
22
+ | 《中华人民共和国进出口关税条例》 | 国务院令第392号(2003年11月23日公布;根据2011年1月8日、2013年12月7日、2016年2月6日三次《国务院关于修改(废止)部分行政法规的决定》修订) | HC-003 |
2
23
 
3
24
  **Boundary:** this plugin checks a **商品归类台账** for the *structure* of the numbers it records — that a
4
25
  commodity code is ten digits, that its chapter, heading and subheading are successive prefixes of it, that the
package/README.md CHANGED
@@ -1,4 +1,25 @@
1
- # dsh-hs-classify
1
+ # dsh-hs-classify — Commodity classification register hierarchy consistency check
2
+
3
+ `dsh-hs-classify` reads one classification register — the declarant header plus one row per item — and checks the structure of the numbers it records: that a commodity code is ten digits, that its chapter, heading and subheading are successive prefixes of the code, that the levels get progressively finer, that each row records a classification basis, that the header declares the tariff version the codes belong to, that item numbers are unique within the register, and that no unreplaced placeholder survives in the item name.
4
+
5
+ ## What it answers
6
+
7
+ | You ask | What it answers |
8
+ |---|---|
9
+ | Some codes in our register are eight digits, and one ends with a letter. Will the check report them? | Yes. `HC-001` matches every filled `hsCode` against the pack's `pattern`, `^[0-9]{10}$`, and reports the row together with the value it read. It checks the digit count and the characters only, never whether the goods belong under that code. A blank code cell is passed over, so what it reports is a code of the wrong shape, not a code that is missing. The ten digits are a pack setting: when the annual tariff changes the length, edit the `pattern`, not the code. |
10
+ | A row's 章, 品目 and 子目 do not agree with its 商品编号. Is that caught? | Yes. `HC-002` reads the level columns in coarse-to-fine order — 章, 品目, 子目, two, four and six digits in the pack's own example — and reports the level that is not a prefix of the `hsCode` it read, or that is not finer than the level above it. It checks that prefix relation and that order only: whether the code fits the goods is a customs determination needing the tariff and the classification decisions, which this plugin does not consult. A level cell left blank is not compared. |
11
+ | One row leaves 归类依据 blank. | `HC-003` reports that row: `basis` has to be filled in on every row that carries the column. It checks that something is written there, not that the tariff clause, chapter note, classification decision or advance ruling cited exists or supports the classification — this plugin consults none of them. If the register has no `basis` column at all, `HC-003` is listed in `skipped` with the reason that the material has no such column, instead of passing silently. |
12
+ | The header does not say which tariff version the codes belong to. | `HC-004` requires the header to declare `tariffVersion` and reports the register when the header leaves it empty. It checks that the declaration is present, not that the edition named is the one these codes come from: the rule does not read the codes, and codes are split and merged between editions. Its `fields` list is a pack setting — add `declarant` if your header records one. |
13
+ | 项号 5 appears on two rows. | `HC-005` reports the later row as a duplicate of the earlier one, because `itemNo` has to be unique within one register; whitespace is ignored in the comparison, so `5` and ` 5 ` count as the same item number. It checks uniqueness only. One goods item declared on several rows, for different specifications say, needs a different item number on each row. Item numbers that are all distinct still leave `HC-005` in `skipped`: it is then listed with the reason that the material met the check's preconditions and no differing entries were found — a different reason from the one a rule gives when it could not run because the column is absent. |
14
+ | The 品名 column still holds 【】 or 待填 from the template. | `HC-006` reports the row and the placeholder it matched. The pack looks for 【, 】, {{, }}, XXX, xxx, 待填, 待补充, TBD, todo and 示例, and `terms` can be trimmed to your own template. It finds unreplaced placeholders only: it does not judge whether the name is right, and it does not require the column to be filled — a blank `description` cell draws no finding from it, and no other rule in this pack requires one. |
15
+
16
+ ## Standards it follows
17
+
18
+ | Document | Number | Cited by rules |
19
+ |---|---|---|
20
+ | 《中华人民共和国进出口税则》 | 现行版本本次未核实 | HC-001, HC-004, HC-005, HC-006 |
21
+ | 《商品名称及编码协调制度》 | 现行版本本次未核实 | HC-002 |
22
+ | 《中华人民共和国进出口关税条例》 | 国务院令第392号(2003年11月23日公布;根据2011年1月8日、2013年12月7日、2016年2月6日三次《国务院关于修改(废止)部分行政法规的决定》修订) | HC-003 |
2
23
 
3
24
  **Boundary:** this plugin checks a **商品归类台账** for the *structure* of the numbers it records — that a
4
25
  commodity code is ten digits, that its chapter, heading and subheading are successive prefixes of it, that the
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-hs-classify/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-hs-classify",
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
  },
@@ -0,0 +1,72 @@
1
+ # 条文核查报告 —— 《中华人民共和国进出口关税条例》
2
+
3
+ - **核查日期**:2026-10-07
4
+ - **核查对象**:`HC-003` 引用的《中华人民共和国进出口关税条例》第三十一条
5
+ - **核查方法**:按**国务院公报**取回全文,逐字复制。
6
+ - **结论**:**取得逐字条文**,并**修正两处问题**(来源错配、条款描述漏字)。
7
+
8
+ ---
9
+
10
+ ## 一、本轮更正:来源错配
11
+
12
+ `HC-003` 原先的 `source` 为 **`http://www.wcoomd.org/`**(世界海关组织)。
13
+
14
+ **这是一份中国国务院行政法规,来源却是国际组织首页,且该页并无正文可链接** —— 属于来源错配。
15
+ 已换为**国务院公报**:
16
+
17
+ <https://www.gov.cn/gongbao/content/2016/content_5139497.htm>
18
+ (《国务院公报》增刊 2016·2,中国政府网 · 中央发布渠道)
19
+
20
+ ---
21
+
22
+ ## 二、版本事实(逐字照录自该页正文)
23
+
24
+ > (2003年11月23日中华人民共和国国务院令第392号公布
25
+ > 根据2011年1月8日《国务院关于废止和修改部分行政法规的决定》第一次修订
26
+ > 根据2013年12月7日《国务院关于修改部分行政法规的决定》第二次修订
27
+ > 根据2016年2月6日《国务院关于修改部分行政法规的决定》第三次修订)
28
+
29
+ ⇒ **文号国务院令第 392 号,历经三次修订,现行版本为 2016-02-06 第三次修订本。**
30
+
31
+ ---
32
+
33
+ ## 三、逐字条文
34
+
35
+ > **第三十一条** 纳税义务人应当按照《税则》规定的目录条文和归类总规则、类注、章注、子目注释以及其他归类注释,对其申报的进出口货物进行商品归类,并归入相应的税则号列;海关应当依法审核确定该货物的商品归类。
36
+
37
+ ---
38
+
39
+ ## 四、本轮更正的第二处:条款描述漏了主语
40
+
41
+ `HC-003` 的 `clause` 字段原写作:
42
+
43
+ > 第三十一条(**应当按照《税则》规定的目录条文和归类总规则**、类注、章注、子目注释以及其他归类注释,
44
+ > 对其申报的进出口货物进行商品归类,并归入相应的税则号列)
45
+
46
+ **漏掉了主语「纳税义务人」**。这不是可有可无的省略:该条**同时**规定了两个主体的义务 ——
47
+ **纳税义务人**负责归类申报,**海关**负责依法审核确定。省略主语会让读者以为是某一方的单方义务,
48
+ 而本条恰恰是"申报—审核"的双边结构。
49
+
50
+ 已在条款描述中补回主语,`excerpt` 亦按逐字原文填入。
51
+
52
+ ⚠️ 该条 `kind` 与 `severity` **未改动**。
53
+
54
+ ---
55
+
56
+ ## 五、仍未取得的部分(如实标注)
57
+
58
+ | 文件 | 状态 |
59
+ |---|---|
60
+ | 《中华人民共和国进出口税则》 | **未取得**。税则是逐年发布的**商品编码与税率表**(体量极大),非条文式法规;本插件**不内置任何税则表**,因此 `HC-001`/`HC-004`/`HC-005`/`HC-006` 四条**保持诚实占位**。 |
61
+ | 《商品名称及编码协调制度》(HS) | **未取得**。该制度为**世界海关组织(WCO)出版物**,正文不公开;`HC-002` **保持诚实占位**。 |
62
+ | 归类总规则、类注、章注、子目注释 | **未取得**;属税则组成部分,同上。 |
63
+
64
+ 📌 **这五条不是"漏做",而是"无可引之条文"** —— 税则与 HS 是**表与制度**,不是"第X条"式的规范条款。
65
+ 取证记录在此说明清楚,避免后续被误当成待办。
66
+
67
+ ## 六、复现方法
68
+
69
+ ```sh
70
+ curl -sL -A 'Mozilla/5.0' 'https://www.gov.cn/gongbao/content/2016/content_5139497.htm' \
71
+ | sed 's/<[^>]*>//g' | tr -s ' ' | grep -o '第三十一条[^第]*'
72
+ ```
@@ -90,11 +90,11 @@ rules:
90
90
  severity: warn
91
91
  basis:
92
92
  document: 《中华人民共和国进出口关税条例》
93
- number: 现行版本与条号本次未核实
94
- clause: 第三十一条(应当按照《税则》规定的目录条文和归类总规则、类注、章注、子目注释以及其他归类注释,对其申报的进出口货物进行商品归类,并归入相应的税则号列)
95
- excerpt: 该条文本次未取得:核查未获得该文件的逐字原文,本规则库不伪造引文。
96
- kind: derived-from-principle
97
- source: https://www.gov.cn/
93
+ number: 国务院令第392号(2003年11月23日公布;根据2011年1月8日、2013年12月7日、2016年2月6日三次《国务院关于修改(废止)部分行政法规的决定》修订)
94
+ clause: 第三十一条——纳税义务人应当按照《税则》规定的目录条文和归类总规则、类注、章注、子目注释以及其他归类注释,对其申报的进出口货物进行商品归类,并归入相应的税则号列;海关应当依法审核确定该货物的商品归类
95
+ excerpt: 纳税义务人应当按照《税则》规定的目录条文和归类总规则、类注、章注、子目注释以及其他归类注释,对其申报的进出口货物进行商品归类,并归入相应的税则号列;海关应当依法审核确定该货物的商品归类。
96
+ kind: direct
97
+ source: https://www.gov.cn/gongbao/content/2016/content_5139497.htm
98
98
  params:
99
99
  check:
100
100
  kind: presence