dsh-origin-rvc-check 0.2.9 → 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/LICENSE CHANGED
@@ -2,14 +2,200 @@
2
2
  Version 2.0, January 2004
3
3
  http://www.apache.org/licenses/
4
4
 
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
6
 
9
- http://www.apache.org/licenses/LICENSE-2.0
7
+ 1. Definitions.
10
8
 
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 PerryLink
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README-es.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
  [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/)
6
+ [![dshfind](https://dshfind.com/api/badge/PerryLink/dsh-origin-rvc-check?metric=downloads)](https://dshfind.com/en/plugins/PerryLink/dsh-origin-rvc-check?ref=badge)
6
7
 
7
8
  `dsh-origin-rvc-check` lee un registro de determinación de origen (原产地判定台账) —la cabecera del acuerdo más una fila por material— y comprueba la aritmética de ese mismo registro: que se declaren el acuerdo y el producto, que el contenido de valor regional sea igual a (FOB − valor de los materiales no originarios) ÷ FOB × 100, que el RVC alcance el umbral que usted configura, que cada material indique su origen, que el criterio de origen proceda del vocabulario de su acuerdo, que los números de material no se repitan y que no quede ningún marcador de plantilla sin sustituir en la descripción.
8
9
 
@@ -15,14 +16,47 @@ dsh --profile <name> --dump-config | grep 'dsh-origin-rvc-check'
15
16
 
16
17
  ## Cómo se ve la salida
17
18
 
18
- ![Terminal demo of dsh-origin-rvc-check: real output over its OR-001 fixture](https://raw.githubusercontent.com/PerryLink/dsh-origin-rvc-check/main/docs/assets/dsh-origin-rvc-check-hero.png)
19
+ ![Diagrama de flujo de dsh-origin-rvc-check: documento → reglas → hallazgos.](docs/assets/dsh-origin-rvc-check-flow.svg)
20
+
21
+ *Resumen del flujo: documento → reglas → hallazgos. Los ejemplos siguientes usan la superficie de comandos real.*
19
22
 
20
- ![Animated terminal demo of dsh-origin-rvc-check](https://raw.githubusercontent.com/PerryLink/dsh-origin-rvc-check/main/docs/assets/dsh-origin-rvc-check-demo.gif)
21
23
 
22
24
  Salida real de este plugin sobre su propio fixture de prueba `OR-001` — 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.
23
25
 
24
26
  ## Qué responde
25
27
 
28
+ ### Ejemplos
29
+
30
+ La tabla siguiente es el conjunto de ejemplos: la primera fila es el caso detallado y las demás son casos breves.
31
+
32
+
33
+ #### Salida detallada
34
+
35
+ **Herramienta** `origin_rvc_check`
36
+
37
+ **Entrada**
38
+
39
+ ~~~json
40
+ {"product":"某型电子元件","rows":[{"序号":"1","商品编号":"8541400000","品名":"某型电子元件","原产国":"日本","成交价格":"180","币制":"USD","非原产材料价值":"180","是否原产":"否","区域价值成分":"55.00","原产地标准":"RVC"}]}
41
+ ~~~
42
+
43
+ **Salida**
44
+
45
+ ~~~json
46
+ {
47
+ "id": "dsh-origin-rvc-check.OR-001.811c9dc5",
48
+ "ruleId": "OR-001",
49
+ "severity": "warn",
50
+ "locator": {
51
+ "field": "agreement"
52
+ },
53
+ "found": "材料表头缺少 agreement",
54
+ "expected": "表头应提供 agreement、product"
55
+ }
56
+ ~~~
57
+
58
+ *Observado en `dsh-origin-rvc-check/tests/fixtures/OR-001/OR-001-unsafe.json`*
59
+
26
60
  | Usted pregunta | Qué responde |
27
61
  |---|---|
28
62
  | La columna «区域价值成分» dice `70.00`, pero el «净价值» de la fila es `220` y el FOB de la cabecera es `400`. ¿Se detecta? | Sí. `OR-002` recalcula la fórmula de deducción (FOB − valor de los materiales no originarios) ÷ FOB × 100 a partir de la columna «净价值» y del FOB, con una tolerancia de 0,5 puntos, y señala la fila cuando el RVC declarado no coincide. Solo hace la aritmética y supone el método de deducción: un registro calculado por el método de acumulación se señala aunque su convención sea la correcta, así que cambie `expression` o desactive la regla. Si el RVC, el «净价值» o el FOB no se pueden leer como número, la regla se informa en `skipped` en lugar de pasar en silencio. |
@@ -121,6 +155,10 @@ node ../scripts/sync-shared.mjs dsh-origin-rvc-check
121
155
 
122
156
  El último comando copia el kit compartido de `../_shared` a `src/shared/`; vuelva a ejecutarlo tras cada cambio compartido.
123
157
 
158
+ ## PerryLink DSH Plugin Family
159
+
160
+ 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.
161
+
124
162
  ## License
125
163
 
126
164
  [Apache License 2.0](LICENSE) © 2026 dsh-origin-rvc-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
  [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/)
6
+ [![dshfind](https://dshfind.com/api/badge/PerryLink/dsh-origin-rvc-check?metric=downloads)](https://dshfind.com/en/plugins/PerryLink/dsh-origin-rvc-check?ref=badge)
6
7
 
7
8
  `dsh-origin-rvc-check` एक उद्गम-निर्धारण रजिस्टर (原产地判定台账) पढ़ता है — समझौते का हेडर और प्रत्येक सामग्री की एक पंक्ति — और उसी रजिस्टर के अपने अंकगणित की जाँच करता है: कि समझौता और उत्पाद घोषित हैं, कि क्षेत्रीय मूल्य-अंश (FOB − गैर-उद्गम सामग्री मूल्य) ÷ FOB × 100 के बराबर है, कि RVC आपकी निर्धारित सीमा तक पहुँचता है, कि प्रत्येक सामग्री अपना उद्गम बताती है, कि उद्गम मानदंड आपके समझौते की शब्दावली से आता है, कि सामग्री क्रमांक दोहराए नहीं गए हैं, और कि विवरण में कोई अप्रतिस्थापित प्लेसहोल्डर शेष नहीं है।
8
9
 
@@ -15,14 +16,47 @@ dsh --profile <name> --dump-config | grep 'dsh-origin-rvc-check'
15
16
 
16
17
  ## आउटपुट कैसा दिखता है
17
18
 
18
- ![Terminal demo of dsh-origin-rvc-check: real output over its OR-001 fixture](https://raw.githubusercontent.com/PerryLink/dsh-origin-rvc-check/main/docs/assets/dsh-origin-rvc-check-hero.png)
19
+ ![dsh-origin-rvc-check कार्यप्रवाह आरेख: दस्तावेज़ → नियम → निष्कर्ष।](docs/assets/dsh-origin-rvc-check-flow.svg)
20
+
21
+ *कार्यप्रवाह: दस्तावेज़ → नियम → निष्कर्ष। नीचे के उदाहरण वास्तविक कमांड सतह का उपयोग करते हैं।*
19
22
 
20
- ![Animated terminal demo of dsh-origin-rvc-check](https://raw.githubusercontent.com/PerryLink/dsh-origin-rvc-check/main/docs/assets/dsh-origin-rvc-check-demo.gif)
21
23
 
22
24
  इस प्लगइन का अपने ही `OR-001` टेस्ट फ़िक्स्चर पर वास्तविक आउटपुट — कोई नकली चित्र नहीं। नियम-पैक उद्धरण नहीं गढ़ता, इसलिए हर निष्कर्ष लागू किए गए खंड का नाम और यह भी बताता है कि उसका मूल पाठ इस बार प्राप्त नहीं हुआ।
23
25
 
24
26
  ## यह किन सवालों का जवाब देता है
25
27
 
28
+ ### उदाहरण
29
+
30
+ नीचे दी गई तालिका उदाहरण-समुच्चय है: पहली पंक्ति विस्तृत केस है, बाकी संक्षिप्त केस हैं।
31
+
32
+
33
+ #### विस्तृत आउटपुट
34
+
35
+ **उपकरण** `origin_rvc_check`
36
+
37
+ **इनपुट**
38
+
39
+ ~~~json
40
+ {"product":"某型电子元件","rows":[{"序号":"1","商品编号":"8541400000","品名":"某型电子元件","原产国":"日本","成交价格":"180","币制":"USD","非原产材料价值":"180","是否原产":"否","区域价值成分":"55.00","原产地标准":"RVC"}]}
41
+ ~~~
42
+
43
+ **आउटपुट**
44
+
45
+ ~~~json
46
+ {
47
+ "id": "dsh-origin-rvc-check.OR-001.811c9dc5",
48
+ "ruleId": "OR-001",
49
+ "severity": "warn",
50
+ "locator": {
51
+ "field": "agreement"
52
+ },
53
+ "found": "材料表头缺少 agreement",
54
+ "expected": "表头应提供 agreement、product"
55
+ }
56
+ ~~~
57
+
58
+ *स्रोत `dsh-origin-rvc-check/tests/fixtures/OR-001/OR-001-unsafe.json`*
59
+
26
60
  | आपका सवाल | इसका जवाब |
27
61
  |---|---|
28
62
  | «区域价值成分» कॉलम में `70.00` लिखा है, पर उस पंक्ति का «净价值» `220` है और हेडर का FOB `400` — क्या यह पकड़ में आता है? | हाँ। `OR-002` «净价值» कॉलम और FOB से कटौती-सूत्र (FOB − गैर-उद्गम सामग्री मूल्य) ÷ FOB × 100 दोबारा जोड़ता है, 0.5 अंक की सहनशीलता के साथ, और घोषित RVC मेल न खाने पर वह पंक्ति दर्ज करता है। यह केवल अंकगणित करता है और कटौती पद्धति मान लेता है: जोड़ाई पद्धति से भरा रजिस्टर भी दर्ज होगा, चाहे उसकी अपनी परिपाटी सही हो — इसलिए `expression` बदलें या नियम बंद करें। RVC, «净价值» या FOB में से कोई संख्या के रूप में न पढ़ा जाए तो यह नियम चुपचाप पास होने के बजाय `skipped` में बताता है। |
@@ -121,6 +155,10 @@ node ../scripts/sync-shared.mjs dsh-origin-rvc-check
121
155
 
122
156
  अंतिम कमांड `../_shared` का साझा किट `src/shared/` में कॉपी करता है; हर साझा बदलाव के बाद इसे दोबारा चलाएँ।
123
157
 
158
+ ## PerryLink DSH Plugin Family
159
+
160
+ 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.
161
+
124
162
  ## License
125
163
 
126
164
  [Apache License 2.0](LICENSE) © 2026 dsh-origin-rvc-check contributors.
package/README-pt.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
  [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/)
6
+ [![dshfind](https://dshfind.com/api/badge/PerryLink/dsh-origin-rvc-check?metric=downloads)](https://dshfind.com/en/plugins/PerryLink/dsh-origin-rvc-check?ref=badge)
6
7
 
7
8
  `dsh-origin-rvc-check` lê um registo de determinação de origem (原产地判定台账) —o cabeçalho do acordo mais uma linha por material— e verifica a aritmética desse próprio registo: que o acordo e o produto sejam declarados, que o conteúdo de valor regional seja igual a (FOB − valor dos materiais não originários) ÷ FOB × 100, que o RVC atinja o limiar que configura, que cada material indique a sua origem, que o critério de origem venha do vocabulário do seu acordo, que os números de material não se repitam e que não reste nenhum marcador de modelo por substituir na descrição.
8
9
 
@@ -15,14 +16,47 @@ dsh --profile <name> --dump-config | grep 'dsh-origin-rvc-check'
15
16
 
16
17
  ## Como é a saída
17
18
 
18
- ![Terminal demo of dsh-origin-rvc-check: real output over its OR-001 fixture](https://raw.githubusercontent.com/PerryLink/dsh-origin-rvc-check/main/docs/assets/dsh-origin-rvc-check-hero.png)
19
+ ![Diagrama de fluxo de dsh-origin-rvc-check: documento → regras → achados.](docs/assets/dsh-origin-rvc-check-flow.svg)
20
+
21
+ *Visão geral do fluxo: documento → regras → achados. Os exemplos abaixo usam a superfície real de comandos.*
19
22
 
20
- ![Animated terminal demo of dsh-origin-rvc-check](https://raw.githubusercontent.com/PerryLink/dsh-origin-rvc-check/main/docs/assets/dsh-origin-rvc-check-demo.gif)
21
23
 
22
24
  Saída real deste plugin sobre o seu próprio fixture de teste `OR-001` — 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.
23
25
 
24
26
  ## O que ele responde
25
27
 
28
+ ### Exemplos
29
+
30
+ A tabela abaixo é o conjunto de exemplos: a primeira linha é o caso detalhado e as demais são casos curtos.
31
+
32
+
33
+ #### Saída detalhada
34
+
35
+ **Ferramenta** `origin_rvc_check`
36
+
37
+ **Entrada**
38
+
39
+ ~~~json
40
+ {"product":"某型电子元件","rows":[{"序号":"1","商品编号":"8541400000","品名":"某型电子元件","原产国":"日本","成交价格":"180","币制":"USD","非原产材料价值":"180","是否原产":"否","区域价值成分":"55.00","原产地标准":"RVC"}]}
41
+ ~~~
42
+
43
+ **Saída**
44
+
45
+ ~~~json
46
+ {
47
+ "id": "dsh-origin-rvc-check.OR-001.811c9dc5",
48
+ "ruleId": "OR-001",
49
+ "severity": "warn",
50
+ "locator": {
51
+ "field": "agreement"
52
+ },
53
+ "found": "材料表头缺少 agreement",
54
+ "expected": "表头应提供 agreement、product"
55
+ }
56
+ ~~~
57
+
58
+ *Observado em `dsh-origin-rvc-check/tests/fixtures/OR-001/OR-001-unsafe.json`*
59
+
26
60
  | Você pergunta | O que ele responde |
27
61
  |---|---|
28
62
  | A coluna «区域价值成分» diz `70.00`, mas o «净价值» da linha é `220` e o FOB do cabeçalho é `400`. Isso é detetado? | Sim. O `OR-002` recalcula a fórmula de dedução (FOB − valor dos materiais não originários) ÷ FOB × 100 a partir da coluna «净价值» e do FOB, com uma tolerância de 0,5 pontos, e assinala a linha quando o RVC declarado não coincide. Faz apenas a aritmética e assume o método de dedução: um registo calculado pelo método de acumulação é assinalado embora a sua convenção esteja correta, pelo que deve alterar `expression` ou desativar a regra. Se o RVC, o «净价值» ou o FOB não forem legíveis como número, a regra reporta-se em `skipped` em vez de passar em silêncio. |
@@ -121,6 +155,10 @@ node ../scripts/sync-shared.mjs dsh-origin-rvc-check
121
155
 
122
156
  O último comando copia o kit compartilhado de `../_shared` para `src/shared/`; execute-o novamente após cada alteração compartilhada.
123
157
 
158
+ ## PerryLink DSH Plugin Family
159
+
160
+ 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.
161
+
124
162
  ## License
125
163
 
126
164
  [Apache License 2.0](LICENSE) © 2026 dsh-origin-rvc-check contributors.
package/README-zh.md CHANGED
@@ -1,8 +1,27 @@
1
1
  # dsh-origin-rvc-check — 原产地区域价值成分核对
2
2
 
3
+ ### 快速试跑(1 分钟)
4
+
5
+ ```bash
6
+ node samples/quickstart/run.mjs --check
7
+ ```
8
+
9
+ 样例在 `samples/quickstart/input/`,期望输出在 `samples/quickstart/expected/result.json`;截图见 `docs/assets/quickstart.png`。
10
+
11
+
3
12
  [English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
4
13
 
14
+ <!-- topblock:v1 -->
15
+ > **这是什么** 原产地区域价值成分核对。输出一份「哪一行、哪一栏、差什么」的清单。
16
+ > **给谁用** 原产地证申领、关务;不用懂命令行。
17
+ > **你交什么** 这项核对用到的原始材料(表格、清单或文书);不改原件。Excel 可先转成 JSON/YAML,对话里也能代转。
18
+ > **它不做什么** 不判合规、不认定责任、不替代审核人;只列材料内部能逐条指认的差异。
19
+ > **怎么开始** 在 WorkBuddy / 扣子搜「关务合规核对包」(本检查是其中一项;上架以商城为准);或命令行:
20
+ > `dsh plugin --profile <name> add dsh-origin-rvc-check`
21
+ <!-- /topblock:v1 -->
22
+
5
23
  [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/)
24
+ [![dshfind](https://dshfind.com/api/badge/PerryLink/dsh-origin-rvc-check?metric=downloads)](https://dshfind.com/en/plugins/PerryLink/dsh-origin-rvc-check?ref=badge)
6
25
 
7
26
  `dsh-origin-rvc-check` 读取一份原产地判定台账——表头写明协定与产品,每种料件一行——核对这份台账自身的算术:协定与产品是否声明、区域价值成分是否等于 (FOB − 非原产材料价值) ÷ FOB × 100、RVC 是否达到你配置的门槛、每条料件是否填写原产国、原产地标准是否出自你所适用协定的口径、料件序号是否唯一、品名栏是否残留未替换的占位符。
8
27
 
@@ -15,14 +34,47 @@ dsh --profile <name> --dump-config | grep 'dsh-origin-rvc-check'
15
34
 
16
35
  ## 实际输出长什么样
17
36
 
18
- ![Terminal demo of dsh-origin-rvc-check: real output over its OR-001 fixture](https://raw.githubusercontent.com/PerryLink/dsh-origin-rvc-check/main/docs/assets/dsh-origin-rvc-check-hero.png)
37
+ ![dsh-origin-rvc-check 工作流图:文档 → 规则包 → 核对结果。](docs/assets/dsh-origin-rvc-check-flow.svg)
38
+
39
+ *工作流概览:文档 → 规则包 → 核对结果。下面的示例使用实际命令面。*
19
40
 
20
- ![Animated terminal demo of dsh-origin-rvc-check](https://raw.githubusercontent.com/PerryLink/dsh-origin-rvc-check/main/docs/assets/dsh-origin-rvc-check-demo.gif)
21
41
 
22
42
  本插件对自己 `OR-001` 测试夹具的**真实输出**,不是示意图。规则库不伪造引文,因此每条发现都会同时写明所引条款,以及该条款原文本次未取得。
23
43
 
24
44
  ## 它回答什么问题
25
45
 
46
+ ### 示例
47
+
48
+ 下表是示例集:第一行是详细走查,其余行是简短案例。
49
+
50
+
51
+ #### 详细输出
52
+
53
+ **工具** `origin_rvc_check`
54
+
55
+ **输入**
56
+
57
+ ~~~json
58
+ {"product":"某型电子元件","rows":[{"序号":"1","商品编号":"8541400000","品名":"某型电子元件","原产国":"日本","成交价格":"180","币制":"USD","非原产材料价值":"180","是否原产":"否","区域价值成分":"55.00","原产地标准":"RVC"}]}
59
+ ~~~
60
+
61
+ **输出**
62
+
63
+ ~~~json
64
+ {
65
+ "id": "dsh-origin-rvc-check.OR-001.811c9dc5",
66
+ "ruleId": "OR-001",
67
+ "severity": "warn",
68
+ "locator": {
69
+ "field": "agreement"
70
+ },
71
+ "found": "材料表头缺少 agreement",
72
+ "expected": "表头应提供 agreement、product"
73
+ }
74
+ ~~~
75
+
76
+ *来源 `dsh-origin-rvc-check/tests/fixtures/OR-001/OR-001-unsafe.json`*
77
+
26
78
  | 你会问 | 它怎么答 |
27
79
  |---|---|
28
80
  | 「区域价值成分」栏填的是 `70.00`,但该行「净价值」是 `220`、表头 FOB 是 `400`,这种情况查得出来吗? | 查得出来。`OR-002` 拿「净价值」栏与 FOB 按扣减法 (FOB − 非原产材料价值) ÷ FOB × 100 重算,容差 0.5 个百分点,填报值与之不符即逐行报出。它只做算术,而且按扣减法核对:台账若按累加法填写,即使口径本身正确也会被报出差异,此时请改 `expression` 或停用本条。RVC、净价值、FOB 有一项读不成数值时,本条报告「无法执行」,不会静默通过。 |
@@ -40,31 +92,17 @@ dsh --profile <name> --dump-config | grep 'dsh-origin-rvc-check'
40
92
  |---|---|---|
41
93
  | 各自由贸易协定原产地规则(协定文本,本次未取得) | 现行协定版本本次未核实 | OR-001, OR-002, OR-003, OR-004, OR-005, OR-006, OR-007 |
42
94
 
43
- **Boundary:** this plugin checks an **原产地判定台账** for arithmetic — that the agreement and product are
44
- declared, that regional value content equals (FOB − non-originating value) ÷ FOB × 100, that RVC meets the
45
- threshold you configure, that every material states its origin, that the origin criterion comes from your
46
- agreement's vocabulary, that material numbers are unique, and that no placeholder survives. It does **not**
47
- decide whether goods qualify as originating, whether a preferential rate applies, whether an origin declaration
48
- is valid, or whether origin circumvention occurred.
95
+ **边界(中文译文,以英文原文为准):** 本插件核对一份**原产地判定台账**的算术——是否声明协定与产品,区域价值成分是否等于(FOB − 非原产材料价值)÷ FOB × 100,RVC 是否达到你配置的门槛,每种材料是否写明其原产地,原产地标准是否取自你所适用协定的取值口径,材料编号是否唯一,以及是否残留占位符。它**不**判定货物是否具备原产资格、是否适用优惠税率、原产地声明是否有效,也不判定是否发生原产地规避。
49
96
 
50
- > ### ⚠️ Origin rules are treaty text, and this pack does not pretend to quote one
97
+ > ### ⚠️ 原产地规则是条约文本,本规则库不假装引用其中任何一条(以英文原文为准)
51
98
  >
52
- > RVC and the other origin criteria — wholly obtained, change of tariff classification — are set by **each free
53
- > trade agreement's rules of origin**. RCEP, ASEAN–China, China–Korea and the rest differ in their thresholds
54
- > (40%, 30% and other tiers) and in their calculation methods. **The verification pass obtained no verbatim text
55
- > from any agreement**, so every rule's `basis` says exactly that and stays at `warn` or `info`.
99
+ > RVC 以及其他原产地标准——完全获得、税则归类改变——由**各自由贸易协定自己的原产地规则**设定。RCEP、中国—东盟、中国—韩国等协定在阈值上(40%、30% 及其他档次)和计算方法上都各不相同。**核验环节没有从任何协定中取得逐字原文**,因此每条规则的 `basis` 都如实写明这一点,并停留在 `warn` 或 `info`。
56
100
  >
57
- > Three consequences are worth knowing before trusting a finding:
101
+ > 在信任一项发现之前,有三点后果值得了解:
58
102
  >
59
- > - **`OR-002` assumes the build-down method** — RVC = (FOB − VNM) ÷ FOB × 100. Some agreements permit the
60
- > **build-up** method (regional value ÷ FOB × 100), which yields a different number for the same goods. A
61
- > register computed that way will report a difference; change `expression` or disable the rule. The check
62
- > reads FOB and the net value through a header fallback, so a figure stated once for the whole set is found.
63
- > - **`OR-003`'s threshold ships unset.** Thresholds vary by agreement *and* by tariff line, so the plugin
64
- > hard-codes none. A finding means "below the threshold you set", **not** "these goods are not originating" —
65
- > because origin can also be earned through wholly-obtained or tariff-classification-change criteria.
66
- > **RVC is only one path.** That distinction matters, and the rule's note states it.
67
- > - **`OR-005`'s criterion vocabulary ships empty**; criterion names and abbreviations differ per agreement.
103
+ > - **`OR-002` 假定的是扣减法**——RVC = (FOB − VNM) ÷ FOB × 100。有些协定允许**累加法**(区域价值 ÷ FOB × 100),对同样的货物会得出不同的数值。按那种方法计算的台账会被报出差异;请修改 `expression` 或停用该规则。该项检查通过表头回退来读取 FOB 和净价值,因此整套数据只声明一次的数值也能被找到。
104
+ > - **`OR-003` 的阈值出厂时未设定。** 阈值因协定*和*税则行而异,因此本插件不硬编码任何阈值。一项发现的意思是「低于你设定的阈值」,**而不是**「这些货物非原产」——因为原产地也可以通过完全获得或税则归类改变标准取得。**RVC 只是其中一条路径。** 这一区分很重要,该规则的说明也写明了它。
105
+ > - **`OR-005` 的标准词表出厂为空**;标准名称和缩写因协定而异。
68
106
 
69
107
  ## Compatibility
70
108
 
@@ -121,6 +159,10 @@ node ../scripts/sync-shared.mjs dsh-origin-rvc-check
121
159
 
122
160
  第 4 项把 `../_shared` 的共享件同步进 `src/shared/`;每次改动共享件后都要重跑。
123
161
 
162
+ ## PerryLink DSH Plugin Family
163
+
164
+ 完整清单(62 个核查器 + 通用插件)见 [按材料选核查器](https://perrylink.github.io/zh/checkers/choose/);本仓只是其中一个。
165
+
124
166
  ## License
125
167
 
126
168
  [Apache License 2.0](LICENSE) © 2026 dsh-origin-rvc-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** — Regional value content check for an origin determination register. It returns a list of what is inconsistent, where, and what to fix.
7
+ > **Who it is for** — origin-certificate and customs staff; 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 "Customs Compliance Suite" in WorkBuddy / Coze (this check is one part of it; availability as listed); or:
11
+ > `dsh plugin --profile <name> add dsh-origin-rvc-check`
12
+ <!-- /topblock:v1 -->
13
+
5
14
  [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/)
15
+ [![dshfind](https://dshfind.com/api/badge/PerryLink/dsh-origin-rvc-check?metric=downloads)](https://dshfind.com/en/plugins/PerryLink/dsh-origin-rvc-check?ref=badge)
6
16
 
7
17
  `dsh-origin-rvc-check` reads one origin determination register (原产地判定台账) — the agreement header plus one row per material — and checks that register's own arithmetic: that the agreement and product are declared, that regional value content equals (FOB − non-originating value) ÷ FOB × 100, that RVC meets the threshold you configure, that every material states its origin, that the origin criterion comes from your agreement's vocabulary, that material numbers are unique, and that no unreplaced placeholder survives in the description.
8
18
 
@@ -15,14 +25,45 @@ dsh --profile <name> --dump-config | grep 'dsh-origin-rvc-check'
15
25
 
16
26
  ## What it looks like
17
27
 
18
- ![Terminal demo of dsh-origin-rvc-check: real output over its OR-001 fixture](https://raw.githubusercontent.com/PerryLink/dsh-origin-rvc-check/main/docs/assets/dsh-origin-rvc-check-hero.png)
28
+ ![Workflow diagram for dsh-origin-rvc-check: document → rule pack → findings.](docs/assets/dsh-origin-rvc-check-flow.svg)
29
+
30
+ *Workflow overview: document → rule pack → findings. The examples below use the real command surface.*
19
31
 
20
- ![Animated terminal demo of dsh-origin-rvc-check](https://raw.githubusercontent.com/PerryLink/dsh-origin-rvc-check/main/docs/assets/dsh-origin-rvc-check-demo.gif)
21
32
 
22
- Real output from this plugin over its own `OR-001` 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** `origin_rvc_check`
43
+
44
+ **Input**
45
+
46
+ ~~~json
47
+ {"product":"某型电子元件","rows":[{"序号":"1","商品编号":"8541400000","品名":"某型电子元件","原产国":"日本","成交价格":"180","币制":"USD","非原产材料价值":"180","是否原产":"否","区域价值成分":"55.00","原产地标准":"RVC"}]}
48
+ ~~~
49
+
50
+ **Output**
51
+
52
+ ~~~json
53
+ {
54
+ "id": "dsh-origin-rvc-check.OR-001.811c9dc5",
55
+ "ruleId": "OR-001",
56
+ "severity": "warn",
57
+ "locator": {
58
+ "field": "agreement"
59
+ },
60
+ "found": "材料表头缺少 agreement",
61
+ "expected": "表头应提供 agreement、product"
62
+ }
63
+ ~~~
64
+
65
+ *Observed from `dsh-origin-rvc-check/tests/fixtures/OR-001/OR-001-unsafe.json`*
66
+
26
67
  | You ask | What it answers |
27
68
  |---|---|
28
69
  | The 区域价值成分 column says `70.00`, but the row's 净价值 is `220` and the header's FOB is `400`. Is that caught? | Yes. `OR-002` recomputes the build-down formula (FOB − non-originating value) ÷ FOB × 100 from the 净价值 column and FOB, with a 0.5-point tolerance, and reports the row when the declared RVC differs. It does only the arithmetic, and it assumes the build-down method: a register filled in by the build-up method is reported although its own convention is right, so change `expression` or disable the rule. If the RVC, the 净价值 or the FOB cannot be read as a number, the rule reports itself in `skipped` instead of passing silently. |
@@ -169,6 +210,10 @@ node ../scripts/sync-shared.mjs dsh-origin-rvc-check # refresh src/shared from
169
210
  The plugin is **data-only**: `src/model.ts` declares the table shape, the shared kit supplies the reader and
170
211
  the check engine, and the rule pack declares every check.
171
212
 
213
+ ## PerryLink DSH Plugin Family
214
+
215
+ 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.
216
+
172
217
  ## License
173
218
 
174
219
  [Apache License 2.0](LICENSE) © 2026 dsh-origin-rvc-check contributors.
@@ -0,0 +1,34 @@
1
+ # Troubleshooting `dsh-origin-rvc-check`
2
+
3
+ ## The package is not found or refuses to install
4
+
5
+ - This checker targets DSH `>=0.2.1-0 <0.3.0` and Node `^22.19.0 || >=24.0.0`.
6
+ - Install it through the profile closure: `dsh plugin --profile <name> add dsh-origin-rvc-check`.
7
+ - If npm reports a peer conflict, check the host line first; do not force-install an older DSH core.
8
+
9
+ ## It installs, but I see no findings
10
+
11
+ - The checker only reports what it can decide from the document you pass to its tool.
12
+ - Confirm the tool ran and returned a result; an empty result is not the same as a skipped run.
13
+ - Check the document's required columns/fields against the checker's README table. Missing input is usually reported as `skipped`, not as a guessed finding.
14
+
15
+ ## A finding says the clause text was not obtained
16
+
17
+ - The rule pack follows a citation gate: it never invents clause text.
18
+ - When the exact text is unavailable, the finding stays at `warn`/`info` and says so in its `excerpt`.
19
+ - Treat that as a verification gap, not as proof that the document is compliant.
20
+
21
+ ## Everything is `warn` or `info`
22
+
23
+ - By design, this checker does not make a legal, medical, customs, or safety determination.
24
+ - It reports differences and gaps; a human owner decides what to do with them.
25
+
26
+ ## Reporting a bug
27
+
28
+ Open an issue at `https://github.com/PerryLink/dsh-origin-rvc-check/issues` with:
29
+
30
+ - the checker version and DSH host version;
31
+ - the command or tool call you used;
32
+ - a minimal, redacted input and the actual vs expected result.
33
+
34
+ Never paste credentials, tokens, personal data, or sealed evidence bytes into an issue.
@@ -0,0 +1,19 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="1200" height="360" viewBox="0 0 1200 360" role="img" aria-label="dsh-origin-rvc-check workflow">
2
+ <title>dsh-origin-rvc-check workflow</title>
3
+ <rect width="1200" height="360" rx="18" fill="#0d1117"/>
4
+ <text x="60" y="58" fill="#f0f6fc" font-family="ui-sans-serif,system-ui,sans-serif" font-size="30" font-weight="700">dsh-origin-rvc-check</text>
5
+ <text x="60" y="92" fill="#8b949e" font-family="ui-monospace,monospace" font-size="16">DeepSeek Harness plugin</text>
6
+ <line x1="60" y1="118" x2="1140" y2="118" stroke="#30363d"/>
7
+ <rect x="120" y="150" width="240" height="140" rx="14" fill="#161b22" stroke="#2563eb" stroke-width="2"/>
8
+ <rect x="213" y="185" width="54" height="66" rx="8" fill="none" stroke="#2563eb" stroke-width="3"/><path d="M226 205h28M226 217h28M226 229h18" stroke="#2563eb" stroke-width="3" stroke-linecap="round"/>
9
+ <circle cx="330" cy="270" r="13" fill="#2563eb"/><text x="330" y="276" fill="#0d1117" text-anchor="middle" font-family="ui-monospace,monospace" font-size="14" font-weight="700">1</text>
10
+ <path d="M368 220h64" stroke="#2563eb" stroke-width="3"/><path d="M422 213l10 7-10 7" fill="none" stroke="#2563eb" stroke-width="3" stroke-linecap="round"/>
11
+ <rect x="480" y="150" width="240" height="140" rx="14" fill="#161b22" stroke="#2563eb" stroke-width="2"/>
12
+ <path d="M577 203h46M577 219h46M577 235h46" stroke="#2563eb" stroke-width="3" stroke-linecap="round"/><circle cx="591" cy="203" r="6" fill="#2563eb"/><circle cx="611" cy="219" r="6" fill="#2563eb"/><circle cx="597" cy="235" r="6" fill="#2563eb"/>
13
+ <circle cx="690" cy="270" r="13" fill="#2563eb"/><text x="690" y="276" fill="#0d1117" text-anchor="middle" font-family="ui-monospace,monospace" font-size="14" font-weight="700">2</text>
14
+ <path d="M728 220h64" stroke="#2563eb" stroke-width="3"/><path d="M782 213l10 7-10 7" fill="none" stroke="#2563eb" stroke-width="3" stroke-linecap="round"/>
15
+ <rect x="840" y="150" width="240" height="140" rx="14" fill="#161b22" stroke="#2563eb" stroke-width="2"/>
16
+ <circle cx="960" cy="218" r="28" fill="none" stroke="#2563eb" stroke-width="3"/><path d="M947 219l9 9 18-20" fill="none" stroke="#2563eb" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
17
+ <circle cx="1050" cy="270" r="13" fill="#2563eb"/><text x="1050" y="276" fill="#0d1117" text-anchor="middle" font-family="ui-monospace,monospace" font-size="14" font-weight="700">3</text>
18
+ <text x="60" y="332" fill="#8b949e" font-family="ui-monospace,monospace" font-size="14">PerryLink DSH plugin family · Apache-2.0</text>
19
+ </svg>
@@ -0,0 +1,3 @@
1
+ $ node samples/quickstart/run.mjs
2
+ origin_rvc_check: 1 issue(s) — error 0, warn 1, info 0
3
+ skipped: 3
Binary file
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. */
@@ -18,13 +18,13 @@ interface Config {
18
18
  /** Tool timeout budget in milliseconds. */
19
19
  timeoutMs: number;
20
20
  }
21
- declare const Config: Schema<Config>;
21
+ export declare const Config: Schema<Config>;
22
22
  //#endregion
23
23
  //#region src/index.d.ts
24
- declare const name = "dsh-origin-rvc-check";
25
- declare const inject: string[];
24
+ export declare const name = "dsh-origin-rvc-check";
25
+ export declare const inject: string[];
26
26
  /** Tool id exposed to the model, and the row id in `cordis.patch.yml`. */
27
- declare const TOOL_NAME = "origin_rvc_check";
27
+ export declare const TOOL_NAME = "origin_rvc_check";
28
28
  /**
29
29
  * Locate a package-owned file such as the rule pack.
30
30
  *
@@ -36,7 +36,7 @@ declare const TOOL_NAME = "origin_rvc_check";
36
36
  * @returns the resolved absolute path.
37
37
  * @throws Error naming every location tried, when the file is absent.
38
38
  */
39
- declare function resolvePackageFile(relative: string): string;
39
+ export declare function resolvePackageFile(relative: string): string;
40
40
  /**
41
41
  * Register the checker tool.
42
42
  *
@@ -47,6 +47,5 @@ declare function resolvePackageFile(relative: string): string;
47
47
  * @param ctx - plugin context, with `tools` already available.
48
48
  * @param config - validated configuration.
49
49
  */
50
- declare function apply(ctx: Context, config: Config): () => void;
51
- //#endregion
52
- export { Config, TOOL_NAME, apply, inject, name, resolvePackageFile };
50
+ export declare function apply(ctx: Context, config: Config): () => void;
51
+ //#endregion
package/lib/index.mjs CHANGED
@@ -365,6 +365,10 @@ var Reader = class {
365
365
  if (!isSequenceItem(line.text)) break;
366
366
  this.index += 1;
367
367
  const rest = line.text === "-" ? "" : line.text.slice(2).trim();
368
+ if (rest.startsWith("{") || rest.startsWith("[")) {
369
+ items.push(parseScalar(rest, line.num));
370
+ continue;
371
+ }
368
372
  if ((rest === "" ? -1 : findKeySeparator(rest)) >= 0) {
369
373
  items.push(this.readMapping(indent + 2, {
370
374
  text: rest,
@@ -833,7 +837,7 @@ function optionalNumber(params, key) {
833
837
  function locatorOf(row, field) {
834
838
  const out = {};
835
839
  if (row !== void 0) out.row = row;
836
- if (field !== "") out.field = field;
840
+ if (field !== "") out.column = field;
837
841
  return out;
838
842
  }
839
843
  /**
@@ -1164,7 +1168,7 @@ function sumToConstant(ctx) {
1164
1168
  const total = parsed.reduce((sum, value) => sum + value, 0);
1165
1169
  const gap = Math.abs(total - target);
1166
1170
  if (gap <= tolerance) return;
1167
- ctx.add(locatorOf(void 0, field), `${parsed.length} 行的「${field}」合计 ${Number(total.toFixed(4))},与配置的目标值 ${target} 相差 ${Number(gap.toFixed(4))}`, `「${field}」的合计应为 ${target},允许偏差 ${tolerance}`, str(ctx.params, "fix", "核对是否有行遗漏或数值抄错;本条只做加法核对,不判断设置是否合规"));
1171
+ ctx.add(locatorOf(void 0, field), `${parsed.length} 行的「${field}」合计 ${Number(total.toFixed(4))},与配置的目标值 ${target} 相差 ${Number(gap.toFixed(4))}`, `「${field}」的合计应为 ${target},允许偏差 ${tolerance}`, str(ctx.params, "fix", "核对是否有行遗漏或数值抄错;本条只做加法核对,不评价分值设置本身"));
1168
1172
  }
1169
1173
  /** `countPerGroup` — each group value must appear at least N times. */
1170
1174
  function countPerGroup(ctx) {
@@ -2112,7 +2116,10 @@ function runChecks(input, ruleset, options) {
2112
2116
  const issues = [];
2113
2117
  const reasons = /* @__PURE__ */ new Map();
2114
2118
  const fired = /* @__PURE__ */ new Set();
2119
+ const disabled = /* @__PURE__ */ new Set([...ruleset.disabled, ...options.disabledRules]);
2120
+ const only = new Set(options.onlyRules);
2115
2121
  for (const rule of ruleset.rules) {
2122
+ if (disabled.has(rule.id) || only.size > 0 && !only.has(rule.id)) continue;
2116
2123
  const declaredCheck = typeof rule.params.check === "object" && rule.params.check !== null && !Array.isArray(rule.params.check) ? rule.params.check : {};
2117
2124
  const check = {
2118
2125
  ...rule.params,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-origin-rvc-check",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "原产地区域价值成分核对(按 RVC 定义式与门槛核对原产地判定自洽,仅提示差异,不作出定性结论)",
5
5
  "type": "module",
6
6
  "main": "lib/index.mjs",
@@ -25,7 +25,11 @@
25
25
  "icon.svg",
26
26
  "rules",
27
27
  "CHANGELOG.md",
28
- "SECURITY.md"
28
+ "SECURITY.md",
29
+ "docs/assets/*",
30
+ "samples",
31
+ "TROUBLESHOOTING.md",
32
+ "screenshots.json"
29
33
  ],
30
34
  "scripts": {
31
35
  "build": "tsdown",
@@ -42,7 +46,23 @@
42
46
  "manifestVersion": 1,
43
47
  "bundle": {
44
48
  "patch": "./cordis.patch.yml"
45
- }
49
+ },
50
+ "demo": {
51
+ "sample": "samples/quickstart/input/OR-001-unsafe.json",
52
+ "prompt": "用自带样例跑一次这项检查,告诉我发现了几条问题、分别是什么级别。",
53
+ "expect": "samples/quickstart/expected/result.json",
54
+ "screenshot": "docs/assets/quickstart.png",
55
+ "reads": [
56
+ "用户指定的材料文件"
57
+ ],
58
+ "writes": [],
59
+ "network": false,
60
+ "external": []
61
+ },
62
+ "capabilities": [
63
+ "tools:register"
64
+ ],
65
+ "labels": []
46
66
  },
47
67
  "keywords": [
48
68
  "deepseek-harness",
@@ -78,14 +98,14 @@
78
98
  "@deepseek-ai/schemastery": "^3.18.2"
79
99
  },
80
100
  "devDependencies": {
81
- "@deepseek-ai/cordis": "4.0.5-alpha.1",
101
+ "@deepseek-ai/cordis": "4.0.5",
82
102
  "@deepseek-ai/dsh-package-manifest": "0.2.1-rc.2",
83
103
  "@deepseek-ai/dsh-tools": "0.2.1-rc.2",
84
- "@deepseek-ai/schemastery": "3.18.5-alpha.1",
104
+ "@deepseek-ai/schemastery": "3.18.5",
85
105
  "@types/node": "^22.20.1",
86
106
  "vitest": "^3.2.7",
87
107
  "@deepseek-ai/dsh-working-directory": "0.2.1-rc.2",
88
- "tsdown": "^0.22.14",
108
+ "tsdown": "^0.23.1",
89
109
  "typescript": "^5.9.3"
90
110
  },
91
111
  "dependencies": {}
@@ -0,0 +1,10 @@
1
+ {
2
+ "tool": "origin_rvc_check",
3
+ "issueCount": 1,
4
+ "summary": {
5
+ "error": 0,
6
+ "warn": 1,
7
+ "info": 0
8
+ },
9
+ "skippedCount": 3
10
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "product": "某型电子元件",
3
+ "rows": [
4
+ {
5
+ "序号": "1",
6
+ "商品编号": "8541400000",
7
+ "品名": "某型电子元件",
8
+ "原产国": "日本",
9
+ "供应商": "某某商社",
10
+ "成交价格": "180",
11
+ "币制": "USD",
12
+ "非原产材料价值": "180",
13
+ "是否原产": "否",
14
+ "区域价值成分": "55.00",
15
+ "原产地标准": "RVC",
16
+ "原产地证书号": "",
17
+ "申报日期": "2026-03-10"
18
+ }
19
+ ]
20
+ }
@@ -0,0 +1,27 @@
1
+ import { readFile } from 'node:fs/promises'
2
+ import { dirname, join } from 'node:path'
3
+ import { fileURLToPath } from 'node:url'
4
+ import * as plugin from '../../lib/index.mjs'
5
+
6
+ const here = dirname(fileURLToPath(import.meta.url))
7
+ const material = await readFile(join(here, 'input', "OR-001-unsafe.json"), 'utf8')
8
+
9
+ const registered = []
10
+ const ctx = { tools: { register: (tool) => { registered.push(tool); return () => {} } } }
11
+ plugin.apply(ctx, plugin.Config ? plugin.Config({}) : {})
12
+ const tool = registered.find((t) => t.name === plugin.TOOL_NAME)
13
+ if (!tool) throw new Error('tool not registered: ' + plugin.TOOL_NAME)
14
+
15
+ const result = await tool.execute({ material }, { signal: new AbortController().signal })
16
+ const summary = {
17
+ tool: tool.name,
18
+ issueCount: result.issueCount,
19
+ summary: result.summary,
20
+ skippedCount: result.skippedCount,
21
+ }
22
+ if (process.argv.includes('--json')) console.log(JSON.stringify(summary, null, 2))
23
+ else {
24
+ console.log('$ node samples/quickstart/run.mjs')
25
+ console.log(tool.name + ': ' + summary.issueCount + ' issue(s) — error ' + summary.summary.error + ', warn ' + summary.summary.warn + ', info ' + summary.summary.info)
26
+ console.log('skipped: ' + summary.skippedCount)
27
+ }
@@ -0,0 +1,14 @@
1
+ [
2
+ {
3
+ "path": "docs/assets/dsh-origin-rvc-check-hero.png",
4
+ "kind": "hero",
5
+ "alt": "dsh-origin-rvc-check terminal output",
6
+ "caption": "Real dsh-origin-rvc-check checker output; 31 tests passed."
7
+ },
8
+ {
9
+ "path": "docs/assets/dsh-origin-rvc-check-demo.gif",
10
+ "kind": "demo",
11
+ "alt": "Animated dsh-origin-rvc-check terminal session",
12
+ "caption": "The same run, assembled line by line."
13
+ }
14
+ ]