dsh-origin-rvc-check 0.2.8 → 0.2.10
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 +6 -0
- package/README-es.md +42 -2
- package/README-hi.md +42 -2
- package/README-pt.md +42 -2
- package/README-zh.md +58 -23
- package/README.md +50 -3
- package/lib/index.d.mts +8 -9
- package/lib/index.mjs +9 -2
- package/package.json +7 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.9] - 2026-10-18
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Move `tsdown` and `typescript` from runtime dependencies to devDependencies; a published checker no longer pulls a build chain into the profile. Same rollout as the 0.2.11 pilot.
|
|
8
|
+
|
|
3
9
|
## [0.2.8] - 2026-10-18
|
|
4
10
|
|
|
5
11
|
### Changed
|
package/README-es.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# dsh-origin-rvc-check — Verificación del contenido de valor regional de un registro de determinación de origen
|
|
2
2
|
|
|
3
|
+
[English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
|
|
4
|
+
|
|
3
5
|
[](https://dsh.market/)
|
|
6
|
+
[](https://dshfind.com/en/plugins/PerryLink/dsh-origin-rvc-check?ref=badge)
|
|
4
7
|
|
|
5
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.
|
|
6
9
|
|
|
@@ -13,14 +16,47 @@ dsh --profile <name> --dump-config | grep 'dsh-origin-rvc-check'
|
|
|
13
16
|
|
|
14
17
|
## Cómo se ve la salida
|
|
15
18
|
|
|
16
|
-

|
|
20
|
+
|
|
21
|
+
*Resumen del flujo: documento → reglas → hallazgos. Los ejemplos siguientes usan la superficie de comandos real.*
|
|
17
22
|
|
|
18
|
-

|
|
19
23
|
|
|
20
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.
|
|
21
25
|
|
|
22
26
|
## Qué responde
|
|
23
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
|
+
|
|
24
60
|
| Usted pregunta | Qué responde |
|
|
25
61
|
|---|---|
|
|
26
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. |
|
|
@@ -119,6 +155,10 @@ node ../scripts/sync-shared.mjs dsh-origin-rvc-check
|
|
|
119
155
|
|
|
120
156
|
El último comando copia el kit compartido de `../_shared` a `src/shared/`; vuelva a ejecutarlo tras cada cambio compartido.
|
|
121
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
|
+
|
|
122
162
|
## License
|
|
123
163
|
|
|
124
164
|
[Apache License 2.0](LICENSE) © 2026 dsh-origin-rvc-check contributors.
|
package/README-hi.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# dsh-origin-rvc-check — उद्गम-निर्धारण रजिस्टर के क्षेत्रीय मूल्य-अंश की जाँच
|
|
2
2
|
|
|
3
|
+
[English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
|
|
4
|
+
|
|
3
5
|
[](https://dsh.market/)
|
|
6
|
+
[](https://dshfind.com/en/plugins/PerryLink/dsh-origin-rvc-check?ref=badge)
|
|
4
7
|
|
|
5
8
|
`dsh-origin-rvc-check` एक उद्गम-निर्धारण रजिस्टर (原产地判定台账) पढ़ता है — समझौते का हेडर और प्रत्येक सामग्री की एक पंक्ति — और उसी रजिस्टर के अपने अंकगणित की जाँच करता है: कि समझौता और उत्पाद घोषित हैं, कि क्षेत्रीय मूल्य-अंश (FOB − गैर-उद्गम सामग्री मूल्य) ÷ FOB × 100 के बराबर है, कि RVC आपकी निर्धारित सीमा तक पहुँचता है, कि प्रत्येक सामग्री अपना उद्गम बताती है, कि उद्गम मानदंड आपके समझौते की शब्दावली से आता है, कि सामग्री क्रमांक दोहराए नहीं गए हैं, और कि विवरण में कोई अप्रतिस्थापित प्लेसहोल्डर शेष नहीं है।
|
|
6
9
|
|
|
@@ -13,14 +16,47 @@ dsh --profile <name> --dump-config | grep 'dsh-origin-rvc-check'
|
|
|
13
16
|
|
|
14
17
|
## आउटपुट कैसा दिखता है
|
|
15
18
|
|
|
16
|
-

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

|
|
19
23
|
|
|
20
24
|
इस प्लगइन का अपने ही `OR-001` टेस्ट फ़िक्स्चर पर वास्तविक आउटपुट — कोई नकली चित्र नहीं। नियम-पैक उद्धरण नहीं गढ़ता, इसलिए हर निष्कर्ष लागू किए गए खंड का नाम और यह भी बताता है कि उसका मूल पाठ इस बार प्राप्त नहीं हुआ।
|
|
21
25
|
|
|
22
26
|
## यह किन सवालों का जवाब देता है
|
|
23
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
|
+
|
|
24
60
|
| आपका सवाल | इसका जवाब |
|
|
25
61
|
|---|---|
|
|
26
62
|
| «区域价值成分» कॉलम में `70.00` लिखा है, पर उस पंक्ति का «净价值» `220` है और हेडर का FOB `400` — क्या यह पकड़ में आता है? | हाँ। `OR-002` «净价值» कॉलम और FOB से कटौती-सूत्र (FOB − गैर-उद्गम सामग्री मूल्य) ÷ FOB × 100 दोबारा जोड़ता है, 0.5 अंक की सहनशीलता के साथ, और घोषित RVC मेल न खाने पर वह पंक्ति दर्ज करता है। यह केवल अंकगणित करता है और कटौती पद्धति मान लेता है: जोड़ाई पद्धति से भरा रजिस्टर भी दर्ज होगा, चाहे उसकी अपनी परिपाटी सही हो — इसलिए `expression` बदलें या नियम बंद करें। RVC, «净价值» या FOB में से कोई संख्या के रूप में न पढ़ा जाए तो यह नियम चुपचाप पास होने के बजाय `skipped` में बताता है। |
|
|
@@ -119,6 +155,10 @@ node ../scripts/sync-shared.mjs dsh-origin-rvc-check
|
|
|
119
155
|
|
|
120
156
|
अंतिम कमांड `../_shared` का साझा किट `src/shared/` में कॉपी करता है; हर साझा बदलाव के बाद इसे दोबारा चलाएँ।
|
|
121
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
|
+
|
|
122
162
|
## License
|
|
123
163
|
|
|
124
164
|
[Apache License 2.0](LICENSE) © 2026 dsh-origin-rvc-check contributors.
|
package/README-pt.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# dsh-origin-rvc-check — Verificação do conteúdo de valor regional de um registo de determinação de origem
|
|
2
2
|
|
|
3
|
+
[English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
|
|
4
|
+
|
|
3
5
|
[](https://dsh.market/)
|
|
6
|
+
[](https://dshfind.com/en/plugins/PerryLink/dsh-origin-rvc-check?ref=badge)
|
|
4
7
|
|
|
5
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.
|
|
6
9
|
|
|
@@ -13,14 +16,47 @@ dsh --profile <name> --dump-config | grep 'dsh-origin-rvc-check'
|
|
|
13
16
|
|
|
14
17
|
## Como é a saída
|
|
15
18
|
|
|
16
|
-

|
|
20
|
+
|
|
21
|
+
*Visão geral do fluxo: documento → regras → achados. Os exemplos abaixo usam a superfície real de comandos.*
|
|
17
22
|
|
|
18
|
-

|
|
19
23
|
|
|
20
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.
|
|
21
25
|
|
|
22
26
|
## O que ele responde
|
|
23
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
|
+
|
|
24
60
|
| Você pergunta | O que ele responde |
|
|
25
61
|
|---|---|
|
|
26
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. |
|
|
@@ -119,6 +155,10 @@ node ../scripts/sync-shared.mjs dsh-origin-rvc-check
|
|
|
119
155
|
|
|
120
156
|
O último comando copia o kit compartilhado de `../_shared` para `src/shared/`; execute-o novamente após cada alteração compartilhada.
|
|
121
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
|
+
|
|
122
162
|
## License
|
|
123
163
|
|
|
124
164
|
[Apache License 2.0](LICENSE) © 2026 dsh-origin-rvc-check contributors.
|
package/README-zh.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# dsh-origin-rvc-check — 原产地区域价值成分核对
|
|
2
2
|
|
|
3
|
+
[English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
|
|
4
|
+
|
|
5
|
+
<!-- topblock:v1 -->
|
|
6
|
+
> **这是什么** 原产地区域价值成分核对。输出一份「哪一行、哪一栏、差什么」的清单。
|
|
7
|
+
> **给谁用** 原产地证申领、关务;不用懂命令行。
|
|
8
|
+
> **你交什么** 这项核对用到的原始材料(表格、清单或文书);不改原件。Excel 可先转成 JSON/YAML,对话里也能代转。
|
|
9
|
+
> **它不做什么** 不判合规、不认定责任、不替代审核人;只列材料内部能逐条指认的差异。
|
|
10
|
+
> **怎么开始** 在 WorkBuddy / 扣子搜「关务合规核对包」(本检查是其中一项;上架以商城为准);或命令行:
|
|
11
|
+
> `dsh plugin --profile <name> add dsh-origin-rvc-check`
|
|
12
|
+
<!-- /topblock:v1 -->
|
|
13
|
+
|
|
3
14
|
[](https://dsh.market/)
|
|
15
|
+
[](https://dshfind.com/en/plugins/PerryLink/dsh-origin-rvc-check?ref=badge)
|
|
4
16
|
|
|
5
17
|
`dsh-origin-rvc-check` 读取一份原产地判定台账——表头写明协定与产品,每种料件一行——核对这份台账自身的算术:协定与产品是否声明、区域价值成分是否等于 (FOB − 非原产材料价值) ÷ FOB × 100、RVC 是否达到你配置的门槛、每条料件是否填写原产国、原产地标准是否出自你所适用协定的口径、料件序号是否唯一、品名栏是否残留未替换的占位符。
|
|
6
18
|
|
|
@@ -13,14 +25,47 @@ dsh --profile <name> --dump-config | grep 'dsh-origin-rvc-check'
|
|
|
13
25
|
|
|
14
26
|
## 实际输出长什么样
|
|
15
27
|
|
|
16
|
-

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

|
|
19
32
|
|
|
20
33
|
本插件对自己 `OR-001` 测试夹具的**真实输出**,不是示意图。规则库不伪造引文,因此每条发现都会同时写明所引条款,以及该条款原文本次未取得。
|
|
21
34
|
|
|
22
35
|
## 它回答什么问题
|
|
23
36
|
|
|
37
|
+
### 示例
|
|
38
|
+
|
|
39
|
+
下表是示例集:第一行是详细走查,其余行是简短案例。
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
#### 详细输出
|
|
43
|
+
|
|
44
|
+
**工具** `origin_rvc_check`
|
|
45
|
+
|
|
46
|
+
**输入**
|
|
47
|
+
|
|
48
|
+
~~~json
|
|
49
|
+
{"product":"某型电子元件","rows":[{"序号":"1","商品编号":"8541400000","品名":"某型电子元件","原产国":"日本","成交价格":"180","币制":"USD","非原产材料价值":"180","是否原产":"否","区域价值成分":"55.00","原产地标准":"RVC"}]}
|
|
50
|
+
~~~
|
|
51
|
+
|
|
52
|
+
**输出**
|
|
53
|
+
|
|
54
|
+
~~~json
|
|
55
|
+
{
|
|
56
|
+
"id": "dsh-origin-rvc-check.OR-001.811c9dc5",
|
|
57
|
+
"ruleId": "OR-001",
|
|
58
|
+
"severity": "warn",
|
|
59
|
+
"locator": {
|
|
60
|
+
"field": "agreement"
|
|
61
|
+
},
|
|
62
|
+
"found": "材料表头缺少 agreement",
|
|
63
|
+
"expected": "表头应提供 agreement、product"
|
|
64
|
+
}
|
|
65
|
+
~~~
|
|
66
|
+
|
|
67
|
+
*来源 `dsh-origin-rvc-check/tests/fixtures/OR-001/OR-001-unsafe.json`*
|
|
68
|
+
|
|
24
69
|
| 你会问 | 它怎么答 |
|
|
25
70
|
|---|---|
|
|
26
71
|
| 「区域价值成分」栏填的是 `70.00`,但该行「净价值」是 `220`、表头 FOB 是 `400`,这种情况查得出来吗? | 查得出来。`OR-002` 拿「净价值」栏与 FOB 按扣减法 (FOB − 非原产材料价值) ÷ FOB × 100 重算,容差 0.5 个百分点,填报值与之不符即逐行报出。它只做算术,而且按扣减法核对:台账若按累加法填写,即使口径本身正确也会被报出差异,此时请改 `expression` 或停用本条。RVC、净价值、FOB 有一项读不成数值时,本条报告「无法执行」,不会静默通过。 |
|
|
@@ -38,31 +83,17 @@ dsh --profile <name> --dump-config | grep 'dsh-origin-rvc-check'
|
|
|
38
83
|
|---|---|---|
|
|
39
84
|
| 各自由贸易协定原产地规则(协定文本,本次未取得) | 现行协定版本本次未核实 | OR-001, OR-002, OR-003, OR-004, OR-005, OR-006, OR-007 |
|
|
40
85
|
|
|
41
|
-
|
|
42
|
-
declared, that regional value content equals (FOB − non-originating value) ÷ FOB × 100, that RVC meets the
|
|
43
|
-
threshold you configure, that every material states its origin, that the origin criterion comes from your
|
|
44
|
-
agreement's vocabulary, that material numbers are unique, and that no placeholder survives. It does **not**
|
|
45
|
-
decide whether goods qualify as originating, whether a preferential rate applies, whether an origin declaration
|
|
46
|
-
is valid, or whether origin circumvention occurred.
|
|
86
|
+
**边界(中文译文,以英文原文为准):** 本插件核对一份**原产地判定台账**的算术——是否声明协定与产品,区域价值成分是否等于(FOB − 非原产材料价值)÷ FOB × 100,RVC 是否达到你配置的门槛,每种材料是否写明其原产地,原产地标准是否取自你所适用协定的取值口径,材料编号是否唯一,以及是否残留占位符。它**不**判定货物是否具备原产资格、是否适用优惠税率、原产地声明是否有效,也不判定是否发生原产地规避。
|
|
47
87
|
|
|
48
|
-
> ### ⚠️
|
|
88
|
+
> ### ⚠️ 原产地规则是条约文本,本规则库不假装引用其中任何一条(以英文原文为准)
|
|
49
89
|
>
|
|
50
|
-
> RVC
|
|
51
|
-
> trade agreement's rules of origin**. RCEP, ASEAN–China, China–Korea and the rest differ in their thresholds
|
|
52
|
-
> (40%, 30% and other tiers) and in their calculation methods. **The verification pass obtained no verbatim text
|
|
53
|
-
> from any agreement**, so every rule's `basis` says exactly that and stays at `warn` or `info`.
|
|
90
|
+
> RVC 以及其他原产地标准——完全获得、税则归类改变——由**各自由贸易协定自己的原产地规则**设定。RCEP、中国—东盟、中国—韩国等协定在阈值上(40%、30% 及其他档次)和计算方法上都各不相同。**核验环节没有从任何协定中取得逐字原文**,因此每条规则的 `basis` 都如实写明这一点,并停留在 `warn` 或 `info`。
|
|
54
91
|
>
|
|
55
|
-
>
|
|
92
|
+
> 在信任一项发现之前,有三点后果值得了解:
|
|
56
93
|
>
|
|
57
|
-
> - **`OR-002`
|
|
58
|
-
>
|
|
59
|
-
>
|
|
60
|
-
> reads FOB and the net value through a header fallback, so a figure stated once for the whole set is found.
|
|
61
|
-
> - **`OR-003`'s threshold ships unset.** Thresholds vary by agreement *and* by tariff line, so the plugin
|
|
62
|
-
> hard-codes none. A finding means "below the threshold you set", **not** "these goods are not originating" —
|
|
63
|
-
> because origin can also be earned through wholly-obtained or tariff-classification-change criteria.
|
|
64
|
-
> **RVC is only one path.** That distinction matters, and the rule's note states it.
|
|
65
|
-
> - **`OR-005`'s criterion vocabulary ships empty**; criterion names and abbreviations differ per agreement.
|
|
94
|
+
> - **`OR-002` 假定的是扣减法**——RVC = (FOB − VNM) ÷ FOB × 100。有些协定允许**累加法**(区域价值 ÷ FOB × 100),对同样的货物会得出不同的数值。按那种方法计算的台账会被报出差异;请修改 `expression` 或停用该规则。该项检查通过表头回退来读取 FOB 和净价值,因此整套数据只声明一次的数值也能被找到。
|
|
95
|
+
> - **`OR-003` 的阈值出厂时未设定。** 阈值因协定*和*税则行而异,因此本插件不硬编码任何阈值。一项发现的意思是「低于你设定的阈值」,**而不是**「这些货物非原产」——因为原产地也可以通过完全获得或税则归类改变标准取得。**RVC 只是其中一条路径。** 这一区分很重要,该规则的说明也写明了它。
|
|
96
|
+
> - **`OR-005` 的标准词表出厂为空**;标准名称和缩写因协定而异。
|
|
66
97
|
|
|
67
98
|
## Compatibility
|
|
68
99
|
|
|
@@ -119,6 +150,10 @@ node ../scripts/sync-shared.mjs dsh-origin-rvc-check
|
|
|
119
150
|
|
|
120
151
|
第 4 项把 `../_shared` 的共享件同步进 `src/shared/`;每次改动共享件后都要重跑。
|
|
121
152
|
|
|
153
|
+
## PerryLink DSH Plugin Family
|
|
154
|
+
|
|
155
|
+
完整清单(62 个核查器 + 通用插件)见 [按材料选核查器](https://perrylink.github.io/zh/checkers/choose/);本仓只是其中一个。
|
|
156
|
+
|
|
122
157
|
## License
|
|
123
158
|
|
|
124
159
|
[Apache License 2.0](LICENSE) © 2026 dsh-origin-rvc-check contributors.
|
package/README.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# dsh-origin-rvc-check — Regional value content check for an origin determination register
|
|
2
2
|
|
|
3
|
+
[English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
|
|
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
|
+
|
|
3
14
|
[](https://dsh.market/)
|
|
15
|
+
[](https://dshfind.com/en/plugins/PerryLink/dsh-origin-rvc-check?ref=badge)
|
|
4
16
|
|
|
5
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.
|
|
6
18
|
|
|
@@ -13,14 +25,45 @@ dsh --profile <name> --dump-config | grep 'dsh-origin-rvc-check'
|
|
|
13
25
|
|
|
14
26
|
## What it looks like
|
|
15
27
|
|
|
16
|
-

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

|
|
19
32
|
|
|
20
|
-
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.
|
|
21
33
|
|
|
22
34
|
## What it answers
|
|
23
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
|
+
|
|
24
67
|
| You ask | What it answers |
|
|
25
68
|
|---|---|
|
|
26
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. |
|
|
@@ -167,6 +210,10 @@ node ../scripts/sync-shared.mjs dsh-origin-rvc-check # refresh src/shared from
|
|
|
167
210
|
The plugin is **data-only**: `src/model.ts` declares the table shape, the shared kit supplies the reader and
|
|
168
211
|
the check engine, and the rule pack declares every check.
|
|
169
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
|
+
|
|
170
217
|
## License
|
|
171
218
|
|
|
172
219
|
[Apache License 2.0](LICENSE) © 2026 dsh-origin-rvc-check contributors.
|
package/lib/index.d.mts
CHANGED
|
@@ -6,7 +6,7 @@ import { Context } from "@deepseek-ai/cordis";
|
|
|
6
6
|
* `cordis.yml` without editing code (the family's "no hard-coded tunables"
|
|
7
7
|
* redline). The rule pack itself is data as well and can be pointed elsewhere.
|
|
8
8
|
*/
|
|
9
|
-
interface Config {
|
|
9
|
+
export interface Config {
|
|
10
10
|
/** Rule-pack path relative to the plugin package root. */
|
|
11
11
|
rulesFile: string;
|
|
12
12
|
/** Rule ids disabled for this deployment. */
|
|
@@ -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.
|
|
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.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "原产地区域价值成分核对(按 RVC 定义式与门槛核对原产地判定自洽,仅提示差异,不作出定性结论)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.mjs",
|
|
@@ -78,16 +78,15 @@
|
|
|
78
78
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@deepseek-ai/cordis": "4.0.5
|
|
81
|
+
"@deepseek-ai/cordis": "4.0.5",
|
|
82
82
|
"@deepseek-ai/dsh-package-manifest": "0.2.1-rc.2",
|
|
83
83
|
"@deepseek-ai/dsh-tools": "0.2.1-rc.2",
|
|
84
|
-
"@deepseek-ai/schemastery": "3.18.5
|
|
84
|
+
"@deepseek-ai/schemastery": "3.18.5",
|
|
85
85
|
"@types/node": "^22.20.1",
|
|
86
86
|
"vitest": "^3.2.7",
|
|
87
|
-
"@deepseek-ai/dsh-working-directory": "0.2.1-rc.2"
|
|
88
|
-
|
|
89
|
-
"dependencies": {
|
|
90
|
-
"tsdown": "^0.22.14",
|
|
87
|
+
"@deepseek-ai/dsh-working-directory": "0.2.1-rc.2",
|
|
88
|
+
"tsdown": "^0.23.1",
|
|
91
89
|
"typescript": "^5.9.3"
|
|
92
|
-
}
|
|
90
|
+
},
|
|
91
|
+
"dependencies": {}
|
|
93
92
|
}
|