@liuhange/dsh-data-asset-shared 2.0.3 → 3.1.0
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/config/business-rules.json +371 -0
- package/config/policy-references.json +161 -0
- package/lib/businessRulesLoader.js +1 -1
- package/lib/configLoader.js +20 -0
- package/lib/defaultBusinessRules.js +103 -0
- package/lib/index.js +4 -0
- package/lib/policyReferenceResolver.js +64 -0
- package/lib/registrationNavigationEnhancer.js +107 -0
- package/lib/types/configLoader.d.ts +2 -0
- package/lib/types/defaultBusinessRules.d.ts +3 -1
- package/lib/types/index.d.ts +4 -0
- package/lib/types/policyReferenceResolver.d.ts +13 -0
- package/lib/types/registrationNavigationEnhancer.d.ts +12 -0
- package/lib/types/types.d.ts +88 -0
- package/package.json +48 -41
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0",
|
|
3
|
+
"lastUpdated": "2026-08-21",
|
|
4
|
+
"valueAssessment": {
|
|
5
|
+
"highValue": {
|
|
6
|
+
"keywords": ["供应链", "销售明细", "设备工况", "交易流水"],
|
|
7
|
+
"score": 5,
|
|
8
|
+
"label": "★★★★★",
|
|
9
|
+
"recommendation": "优先交易,建议入表"
|
|
10
|
+
},
|
|
11
|
+
"mediumValue": {
|
|
12
|
+
"keywords": ["用户行为", "产品数据", "行业报告"],
|
|
13
|
+
"score": 3,
|
|
14
|
+
"label": "★★★",
|
|
15
|
+
"recommendation": "脱敏后交易"
|
|
16
|
+
},
|
|
17
|
+
"lowValue": {
|
|
18
|
+
"keywords": ["日志", "备份", "临时"],
|
|
19
|
+
"score": 1,
|
|
20
|
+
"label": "★",
|
|
21
|
+
"recommendation": "评估处理成本"
|
|
22
|
+
},
|
|
23
|
+
"defaultValue": {
|
|
24
|
+
"score": 3,
|
|
25
|
+
"label": "★★★",
|
|
26
|
+
"recommendation": "需进一步评估"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"sensitivePatterns": {
|
|
30
|
+
"idCard": {
|
|
31
|
+
"pattern": "[1-9]\\d{5}(18|19|20)?\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[\\dXx]",
|
|
32
|
+
"level": "FULL"
|
|
33
|
+
},
|
|
34
|
+
"phone": {
|
|
35
|
+
"pattern": "1[3-9]\\d{9}",
|
|
36
|
+
"level": "PARTIAL"
|
|
37
|
+
},
|
|
38
|
+
"bankCard": {
|
|
39
|
+
"pattern": "[1-9]\\d{15,18}",
|
|
40
|
+
"level": "PARTIAL"
|
|
41
|
+
},
|
|
42
|
+
"email": {
|
|
43
|
+
"pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}",
|
|
44
|
+
"level": "PARTIAL"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"maskingLevels": {
|
|
48
|
+
"FULL": {
|
|
49
|
+
"description": "完全匿名化",
|
|
50
|
+
"applyTo": ["idCard"]
|
|
51
|
+
},
|
|
52
|
+
"PARTIAL": {
|
|
53
|
+
"description": "假名化,保留前3后4",
|
|
54
|
+
"applyTo": ["phone", "bankCard"]
|
|
55
|
+
},
|
|
56
|
+
"GENERALIZE": {
|
|
57
|
+
"description": "泛化处理",
|
|
58
|
+
"applyTo": ["email"]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"cleaningRules": {
|
|
62
|
+
"missingValueStrategy": {
|
|
63
|
+
"government": "interpolation",
|
|
64
|
+
"financial": "manual_review",
|
|
65
|
+
"behavior": "mode_fill"
|
|
66
|
+
},
|
|
67
|
+
"qualityThreshold": {
|
|
68
|
+
"A": { "missingRate": 0.05, "errorRate": 0.01, "label": "优秀" },
|
|
69
|
+
"B": { "missingRate": 0.10, "errorRate": 0.03, "label": "良好" },
|
|
70
|
+
"C": { "missingRate": 0.20, "errorRate": 0.05, "label": "合格" },
|
|
71
|
+
"D": { "missingRate": 0.20, "errorRate": 0.05, "label": "不合格", "action": "不建议交易" }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"compliance": {
|
|
75
|
+
"policies": [
|
|
76
|
+
{ "name": "数据产权登记工作指引", "doc": "国数综政策〔2026〕35号", "check": "数据来源可登记" },
|
|
77
|
+
{ "name": "数据流通安全治理", "doc": "发改数据〔2025〕18号", "check": "来源合法性" },
|
|
78
|
+
{ "name": "数据脱敏工具标准", "doc": "YD/T 6225-2024", "check": "脱敏效果达标" }
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"packaging": {
|
|
82
|
+
"complianceStatements": [
|
|
83
|
+
"本数据产品已完成脱敏处理",
|
|
84
|
+
"不包含个人身份信息",
|
|
85
|
+
"数据来源合法",
|
|
86
|
+
"建议交易前完成数据产权登记"
|
|
87
|
+
],
|
|
88
|
+
"pricingRules": [
|
|
89
|
+
{ "valueLevel": "★★★★★", "suggestion": "根据数据质量、稀缺性和应用场景综合定价,建议高价交易" },
|
|
90
|
+
{ "valueLevel": "★★★★", "suggestion": "根据数据质量和应用场景定价,建议中高价交易" },
|
|
91
|
+
{ "valueLevel": "★★★", "suggestion": "根据数据质量和应用场景综合定价" },
|
|
92
|
+
{ "valueLevel": "★★", "suggestion": "建议低价交易或内部使用" },
|
|
93
|
+
{ "valueLevel": "★", "suggestion": "建议评估处理成本后决定是否交易" }
|
|
94
|
+
],
|
|
95
|
+
"defaultDescription": "适用于数据分析、模型训练、行业研究等场景",
|
|
96
|
+
"version": "V1.0"
|
|
97
|
+
},
|
|
98
|
+
"qualityScoring": {
|
|
99
|
+
"weights": {
|
|
100
|
+
"completeness": 0.25,
|
|
101
|
+
"accuracy": 0.25,
|
|
102
|
+
"consistency": 0.25,
|
|
103
|
+
"timeliness": 0.25
|
|
104
|
+
},
|
|
105
|
+
"thresholds": {
|
|
106
|
+
"completeness": 60,
|
|
107
|
+
"accuracy": 60,
|
|
108
|
+
"consistency": 60,
|
|
109
|
+
"timeliness": 60
|
|
110
|
+
},
|
|
111
|
+
"completeness": {
|
|
112
|
+
"missingMarkers": ["null", "undefined", "N/A", "", "NULL", "NaN"]
|
|
113
|
+
},
|
|
114
|
+
"accuracy": {
|
|
115
|
+
"formatRules": [
|
|
116
|
+
{ "fieldName": "phone", "pattern": "1[3-9]\\d{9}", "weight": 0.5 },
|
|
117
|
+
{ "fieldName": "email", "pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}", "weight": 0.5 }
|
|
118
|
+
],
|
|
119
|
+
"domainRules": [
|
|
120
|
+
{ "fieldName": "age", "min": 0, "max": 150, "weight": 0.5 },
|
|
121
|
+
{ "fieldName": "score", "min": 0, "max": 100, "weight": 0.5 }
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
"consistency": {
|
|
125
|
+
"crossFieldRules": [
|
|
126
|
+
{ "name": "endDateAfterStartDate", "fields": ["startDate", "endDate"], "constraint": "after" },
|
|
127
|
+
{ "name": "priceNonNegative", "fields": ["price"], "constraint": "greaterThan", "value": 0 }
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"timeliness": {
|
|
131
|
+
"timestampField": "updatedAt",
|
|
132
|
+
"freshnessThresholdHours": 720
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"lineage": {
|
|
136
|
+
"enabled": false,
|
|
137
|
+
"storagePath": "lineage",
|
|
138
|
+
"hashAlgorithm": "SHA-256"
|
|
139
|
+
},
|
|
140
|
+
"advancedMasking": {
|
|
141
|
+
"defaultAlgorithm": "hash",
|
|
142
|
+
"fieldAlgorithms": {},
|
|
143
|
+
"fpe": {
|
|
144
|
+
"key": "${FPE_KEY}",
|
|
145
|
+
"radix": 10
|
|
146
|
+
},
|
|
147
|
+
"kAnonymity": {
|
|
148
|
+
"kValue": 2,
|
|
149
|
+
"quasiIdentifiers": ["zipCode", "age", "gender"]
|
|
150
|
+
},
|
|
151
|
+
"differentialPrivacy": {
|
|
152
|
+
"epsilon": 1.0,
|
|
153
|
+
"totalBudget": 5.0,
|
|
154
|
+
"sensitivity": 1.0
|
|
155
|
+
},
|
|
156
|
+
"hash": {
|
|
157
|
+
"algorithm": "SHA-256",
|
|
158
|
+
"salt": "${HASH_SALT}"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"visualization": {
|
|
162
|
+
"charts": {
|
|
163
|
+
"bar": { "enabled": true, "title": "脱敏统计" },
|
|
164
|
+
"comparison": { "enabled": true, "title": "清洗前后对比" },
|
|
165
|
+
"pie": { "enabled": true, "title": "数据资产分布" },
|
|
166
|
+
"radar": { "enabled": true, "title": "质量评分" },
|
|
167
|
+
"flowchart": { "enabled": true, "title": "血缘追踪" }
|
|
168
|
+
},
|
|
169
|
+
"layout": {
|
|
170
|
+
"columns": 2,
|
|
171
|
+
"responsive": true
|
|
172
|
+
},
|
|
173
|
+
"colorScheme": {
|
|
174
|
+
"primary": "#4A90D9",
|
|
175
|
+
"secondary": "#F5A623",
|
|
176
|
+
"success": "#7ED321",
|
|
177
|
+
"warning": "#F8E71C",
|
|
178
|
+
"danger": "#D0021B",
|
|
179
|
+
"background": "#F5F5F5",
|
|
180
|
+
"text": "#333333"
|
|
181
|
+
},
|
|
182
|
+
"interactions": {
|
|
183
|
+
"expandCollapse": true,
|
|
184
|
+
"chartSwitch": true,
|
|
185
|
+
"tooltip": true
|
|
186
|
+
},
|
|
187
|
+
"templateVersion": "1.0"
|
|
188
|
+
},
|
|
189
|
+
"sensitivityClassification": {
|
|
190
|
+
"fieldNameRules": [
|
|
191
|
+
{ "name": "idCard", "pattern": "id_?card|身份证|identity", "level": "Secret" },
|
|
192
|
+
{ "name": "phone", "pattern": "phone|手机|mobile|tel", "level": "Confidential" },
|
|
193
|
+
{ "name": "email", "pattern": "email|邮箱|mail", "level": "Confidential" },
|
|
194
|
+
{ "name": "bankCard", "pattern": "bank_?card|银行卡|account", "level": "Secret" },
|
|
195
|
+
{ "name": "address", "pattern": "address|地址|addr", "level": "Internal" },
|
|
196
|
+
{ "name": "name", "pattern": "^name$|姓名|username", "level": "Internal" },
|
|
197
|
+
{ "name": "public", "pattern": "status|type|category|label|tag|level", "level": "Public" }
|
|
198
|
+
],
|
|
199
|
+
"fieldValueRules": [
|
|
200
|
+
{ "name": "idCardValue", "pattern": "[1-9]\\d{5}(18|19|20)?\\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\\d|3[01])\\d{3}[\\dXx]", "level": "Secret" },
|
|
201
|
+
{ "name": "phoneValue", "pattern": "1[3-9]\\d{9}", "level": "Confidential" },
|
|
202
|
+
{ "name": "emailValue", "pattern": "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}", "level": "Confidential" },
|
|
203
|
+
{ "name": "bankCardValue", "pattern": "[1-9]\\d{15,18}", "level": "Secret" }
|
|
204
|
+
],
|
|
205
|
+
"levelMapping": {
|
|
206
|
+
"Public": "none",
|
|
207
|
+
"Internal": "partial",
|
|
208
|
+
"Confidential": "full",
|
|
209
|
+
"Secret": "encrypt"
|
|
210
|
+
},
|
|
211
|
+
"defaultLevel": "Internal"
|
|
212
|
+
},
|
|
213
|
+
"incrementalScheduling": {
|
|
214
|
+
"incrementalMode": false,
|
|
215
|
+
"cronExpression": "0 2 * * *",
|
|
216
|
+
"hashAlgorithm": "SHA-256",
|
|
217
|
+
"watchDirectory": "input",
|
|
218
|
+
"stateFilePath": "state/incremental-state.json",
|
|
219
|
+
"lockTimeout": 3600
|
|
220
|
+
},
|
|
221
|
+
"inventoryScan": {
|
|
222
|
+
"assetTripleCondition": {
|
|
223
|
+
"pastTransactionKeywords": ["交易", "采购", "采集", "生成", "购买", "合同", "协议", "业务", "系统"],
|
|
224
|
+
"ownershipControlKeywords": ["自有", "拥有", "控制", "授权", "委托", "归属", "产权", "经营"],
|
|
225
|
+
"economicBenefitKeywords": ["收益", "价值", "变现", "交易", "赋能", "增值", "利润", "成本", "经济"]
|
|
226
|
+
},
|
|
227
|
+
"ownershipClueRules": {
|
|
228
|
+
"holdingRightFields": ["sourceSystem", "acquisitionMethod", "contractNumber", "owner"],
|
|
229
|
+
"usageRightFields": ["usageScope", "licenseType", "authorizedUsers", "usageDuration"],
|
|
230
|
+
"operationRightFields": ["productType", "saleChannel", "pricingModel", "commercialUse"]
|
|
231
|
+
},
|
|
232
|
+
"scanScaleLimit": 10000,
|
|
233
|
+
"sensitiveKeywords": ["密码", "密钥", "token", "secret", "credential", "privateKey"]
|
|
234
|
+
},
|
|
235
|
+
"qualityScoringExtended": {
|
|
236
|
+
"weights": {
|
|
237
|
+
"normality": 0.15,
|
|
238
|
+
"completeness": 0.20,
|
|
239
|
+
"accuracy": 0.20,
|
|
240
|
+
"consistency": 0.15,
|
|
241
|
+
"timeliness": 0.15,
|
|
242
|
+
"accessibility": 0.15
|
|
243
|
+
},
|
|
244
|
+
"thresholds": {
|
|
245
|
+
"normality": 60,
|
|
246
|
+
"completeness": 60,
|
|
247
|
+
"accuracy": 60,
|
|
248
|
+
"consistency": 60,
|
|
249
|
+
"timeliness": 60,
|
|
250
|
+
"accessibility": 60
|
|
251
|
+
},
|
|
252
|
+
"normality": {
|
|
253
|
+
"fieldNamePattern": "^[a-z][a-zA-Z0-9_]*$",
|
|
254
|
+
"requiredFields": ["id", "name", "createdAt", "updatedAt"]
|
|
255
|
+
},
|
|
256
|
+
"accessibility": {
|
|
257
|
+
"readTimeoutMs": 5000,
|
|
258
|
+
"minAccessibleRate": 0.95
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"valuation": {
|
|
262
|
+
"costBased": {
|
|
263
|
+
"costCategories": ["acquisition", "processing", "storage", "maintenance", "labor", "infrastructure"],
|
|
264
|
+
"depreciationYears": 5,
|
|
265
|
+
"depreciationMethod": "straight-line"
|
|
266
|
+
},
|
|
267
|
+
"incomeBased": {
|
|
268
|
+
"defaultDiscountRate": 0.08,
|
|
269
|
+
"defaultScenarioYears": 3,
|
|
270
|
+
"scenarioTemplates": ["direct_sale", "subscription", "api_call", "data_sharing", "analytics_service"]
|
|
271
|
+
},
|
|
272
|
+
"pricingReference": {
|
|
273
|
+
"valueLevelThresholds": {
|
|
274
|
+
"high": 80,
|
|
275
|
+
"medium": 60,
|
|
276
|
+
"low": 40
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"capitalizationTraceGuard": {
|
|
280
|
+
"enabled": true,
|
|
281
|
+
"policyRef": "财会〔2025〕33号",
|
|
282
|
+
"rule": "不得以评估等方式得出的金额直接作为入账和调账的依据",
|
|
283
|
+
"warningMessage": "评估值仅供参考,不得直接作为入账依据。依据:《关于严格执行企业会计准则切实做好企业2025年年报工作的通知》(财会〔2025〕33号)——不得将以评估等方式得出的金额直接作为入账和调账的依据。"
|
|
284
|
+
},
|
|
285
|
+
"costReliabilityMeasurement": {
|
|
286
|
+
"enabled": true,
|
|
287
|
+
"policyRef": "财会〔2023〕11号",
|
|
288
|
+
"reliabilityLevels": ["high", "medium", "low"],
|
|
289
|
+
"criteria": {
|
|
290
|
+
"high": "有完整凭证链,成本可直接追溯至原始发票/合同",
|
|
291
|
+
"medium": "有部分凭证,成本经合理分摊计算",
|
|
292
|
+
"low": "成本为估算值,缺乏完整凭证"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"complianceCheck": {
|
|
297
|
+
"sourceRules": [
|
|
298
|
+
{ "id": "SRC_001", "condition": "数据来源须有合同或协议", "lawRef": "数据安全法第八条", "compliant": true },
|
|
299
|
+
{ "id": "SRC_002", "condition": "采集方式须明示告知", "lawRef": "个人信息保护法第十四条", "compliant": true },
|
|
300
|
+
{ "id": "SRC_003", "condition": "不得非法获取他人数据", "lawRef": "数据安全法第八条", "compliant": true }
|
|
301
|
+
],
|
|
302
|
+
"processingRules": [
|
|
303
|
+
{ "id": "PRC_001", "condition": "加工不得超出授权范围", "lawRef": "个人信息保护法第十三条", "compliant": true },
|
|
304
|
+
{ "id": "PRC_002", "condition": "个人信息须脱敏处理", "lawRef": "个人信息保护法第五十一条", "compliant": true }
|
|
305
|
+
],
|
|
306
|
+
"usageRules": [
|
|
307
|
+
{ "id": "USE_001", "condition": "使用不得超出约定场景", "lawRef": "数据安全法第八条", "compliant": true },
|
|
308
|
+
{ "id": "USE_002", "condition": "脱敏后可按一般数据流通", "lawRef": "发改数据〔2025〕18号", "compliant": true }
|
|
309
|
+
],
|
|
310
|
+
"personalInfoMinimizeFields": ["idCard", "phone", "bankCard", "email", "address", "name", "birthDate"],
|
|
311
|
+
"pilotPolicyReference": {
|
|
312
|
+
"enabled": true,
|
|
313
|
+
"policyName": "数据资产全过程管理试点方案",
|
|
314
|
+
"policyRef": "财资〔2024〕167号",
|
|
315
|
+
"keyPoints": ["台账编制", "登记", "授权运营", "收益分配", "交易流通"],
|
|
316
|
+
"embedMessage": "依据:《数据资产全过程管理试点方案》(财资〔2024〕167号)——围绕数据资产台账编制、登记、授权运营、收益分配、交易流通等重点环节开展试点。"
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
"registration": {
|
|
320
|
+
"rules": {
|
|
321
|
+
"disallowedScenarios": [
|
|
322
|
+
{ "id": "DIS_001", "label": "危害国家安全", "keywords": ["国家安全", "机密", "涉密"] },
|
|
323
|
+
{ "id": "DIS_002", "label": "来源违反法律法规", "keywords": ["非法", "窃取", "违规采集"] },
|
|
324
|
+
{ "id": "DIS_003", "label": "权属纠纷未解决", "keywords": ["纠纷", "争议", "诉讼"] },
|
|
325
|
+
{ "id": "DIS_004", "label": "隐瞒真实情况", "keywords": ["隐瞒", "虚假", "欺诈"] }
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
"agencies": {
|
|
329
|
+
"mode": "local",
|
|
330
|
+
"httpEndpoints": {
|
|
331
|
+
"beijing": { "url": "https://sjcqdj.nda.gov.cn/api/beijing", "apiKey": "${REG_BJ_API_KEY}" },
|
|
332
|
+
"shanghai": { "url": "https://sjcqdj.nda.gov.cn/api/shanghai", "apiKey": "${REG_SH_API_KEY}" },
|
|
333
|
+
"shenzhen": { "url": "https://sjcqdj.nda.gov.cn/api/shenzhen", "apiKey": "${REG_SZ_API_KEY}" }
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
"nationalSystem": {
|
|
337
|
+
"url": "https://sjcqdj.nda.gov.cn",
|
|
338
|
+
"apiKey": "${NATIONAL_REG_API_KEY}",
|
|
339
|
+
"timeoutMs": 10000
|
|
340
|
+
},
|
|
341
|
+
"tripleAuditStandard": {
|
|
342
|
+
"enabled": true,
|
|
343
|
+
"standards": ["数据描述准确性", "数据来源合规性", "数据产权明确性"],
|
|
344
|
+
"policyRef": "国数综政策〔2026〕35号",
|
|
345
|
+
"promptMessage": "登记审查重点为三重审核标准:①数据描述准确性 ②数据来源合规性 ③数据产权明确性。依据:《数据产权登记工作指引(试行)》(国数综政策〔2026〕35号)。"
|
|
346
|
+
},
|
|
347
|
+
"sevenStepFlow": {
|
|
348
|
+
"enabled": true,
|
|
349
|
+
"steps": [
|
|
350
|
+
{ "step": 1, "name": "申请", "durationDays": null },
|
|
351
|
+
{ "step": 2, "name": "受理", "durationDays": 3 },
|
|
352
|
+
{ "step": 3, "name": "审查", "durationDays": null },
|
|
353
|
+
{ "step": 4, "name": "公示", "durationDays": 5 },
|
|
354
|
+
{ "step": 5, "name": "异议处理", "durationDays": 10 },
|
|
355
|
+
{ "step": 6, "name": "信息存证", "durationDays": null },
|
|
356
|
+
{ "step": 7, "name": "凭证核发", "durationDays": null }
|
|
357
|
+
],
|
|
358
|
+
"policyRef": "国数综政策〔2026〕35号"
|
|
359
|
+
},
|
|
360
|
+
"allowedAgencies": ["beijing", "shanghai", "shenzhen"],
|
|
361
|
+
"maxAgencyCount": 3,
|
|
362
|
+
"onlineDate": "2026-09-11"
|
|
363
|
+
},
|
|
364
|
+
"pluginRoles": {
|
|
365
|
+
"data-asset-inventory-scan": "入表资格初筛工具——专注判断哪些数据具备入表资格",
|
|
366
|
+
"data-asset-quality-score": "质量审计工具——输出物可直接提交给审计机构作为质量依据",
|
|
367
|
+
"data-asset-valuation": "估值底稿自动化生成器——注重成本能够可靠计量的要求",
|
|
368
|
+
"data-asset-compliance-check": "合规预检工具——让企业先自查再找律师出正式意见",
|
|
369
|
+
"data-asset-registration-helper": "材料生成器——材料准备环节最适合工具化"
|
|
370
|
+
}
|
|
371
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
{
|
|
2
|
+
"configVersion": "1.0",
|
|
3
|
+
"policyReferences": [
|
|
4
|
+
{
|
|
5
|
+
"stage": "INVENTORY",
|
|
6
|
+
"stageLabel": "盘点",
|
|
7
|
+
"documents": [
|
|
8
|
+
{
|
|
9
|
+
"name": "中华人民共和国数据安全法",
|
|
10
|
+
"docNumber": "主席令第八十四号",
|
|
11
|
+
"coreRequirement": "数据分类分级保护"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "数据产权登记工作指引(试行)",
|
|
15
|
+
"docNumber": "国数综政策〔2026〕35号",
|
|
16
|
+
"coreRequirement": "数据产权三权分置"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"stage": "CLEANING",
|
|
22
|
+
"stageLabel": "清洗",
|
|
23
|
+
"documents": [
|
|
24
|
+
{
|
|
25
|
+
"name": "企业数据资源相关会计处理暂行规定",
|
|
26
|
+
"docNumber": "财会〔2023〕11号",
|
|
27
|
+
"coreRequirement": "数据资源入表条件"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "数据资产评估指导意见",
|
|
31
|
+
"docNumber": "中评协〔2023〕17号",
|
|
32
|
+
"coreRequirement": "六维质量评价标准"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"stage": "MASKING",
|
|
38
|
+
"stageLabel": "脱敏",
|
|
39
|
+
"documents": [
|
|
40
|
+
{
|
|
41
|
+
"name": "中华人民共和国个人信息保护法",
|
|
42
|
+
"docNumber": "主席令第九十一号",
|
|
43
|
+
"coreRequirement": "匿名化后不再属于个人信息"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "关于完善数据流通安全治理的实施方案",
|
|
47
|
+
"docNumber": "发改数据〔2025〕18号",
|
|
48
|
+
"coreRequirement": "脱敏后可按一般数据流通"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"stage": "PACKAGING",
|
|
54
|
+
"stageLabel": "包装",
|
|
55
|
+
"documents": [
|
|
56
|
+
{
|
|
57
|
+
"name": "数据产权登记工作指引(试行)",
|
|
58
|
+
"docNumber": "国数综政策〔2026〕35号",
|
|
59
|
+
"coreRequirement": "登记凭证可用于入表、融资、入股"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"stage": "PRECHECK",
|
|
65
|
+
"stageLabel": "登记预检",
|
|
66
|
+
"documents": [
|
|
67
|
+
{
|
|
68
|
+
"name": "数据产权登记工作指引(试行)",
|
|
69
|
+
"docNumber": "国数综政策〔2026〕35号",
|
|
70
|
+
"coreRequirement": "不予登记情形"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"stage": "DOC_GENERATION",
|
|
76
|
+
"stageLabel": "材料生成",
|
|
77
|
+
"documents": [
|
|
78
|
+
{
|
|
79
|
+
"name": "数据产权登记工作指引(试行)",
|
|
80
|
+
"docNumber": "国数综政策〔2026〕35号",
|
|
81
|
+
"coreRequirement": "7步登记流程审查重点"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"stage": "AGENCY_MATCHING",
|
|
87
|
+
"stageLabel": "机构匹配",
|
|
88
|
+
"documents": [
|
|
89
|
+
{
|
|
90
|
+
"name": "数据产权登记工作指引(试行)",
|
|
91
|
+
"docNumber": "国数综政策〔2026〕35号",
|
|
92
|
+
"coreRequirement": "登记机构名录"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"stage": "INVENTORY_SCAN",
|
|
98
|
+
"stageLabel": "资产扫描",
|
|
99
|
+
"documents": [
|
|
100
|
+
{
|
|
101
|
+
"name": "企业数据资源相关会计处理暂行规定",
|
|
102
|
+
"docNumber": "财会〔2023〕11号",
|
|
103
|
+
"coreRequirement": "数据资源需满足企业合法拥有或控制、预期会给企业带来经济利益的条件,才能确认为无形资产或存货"
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"stage": "QUALITY_SCORE",
|
|
109
|
+
"stageLabel": "质量评分",
|
|
110
|
+
"documents": [
|
|
111
|
+
{
|
|
112
|
+
"name": "信息技术 数据质量评价指标",
|
|
113
|
+
"docNumber": "GB/T 36344-2018",
|
|
114
|
+
"coreRequirement": "数据质量评价指标框架,含规范性、完整性、准确性、一致性、时效性、可访问性六维"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"stage": "VALUATION",
|
|
120
|
+
"stageLabel": "估值辅助",
|
|
121
|
+
"documents": [
|
|
122
|
+
{
|
|
123
|
+
"name": "关于加强数据资产管理的指导意见",
|
|
124
|
+
"docNumber": "财资〔2023〕141号",
|
|
125
|
+
"coreRequirement": "推进数据资产全过程管理以及合规化、标准化、增值化,支持数据资产赋能增值"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"name": "企业数据资源相关会计处理暂行规定",
|
|
129
|
+
"docNumber": "财会〔2023〕11号",
|
|
130
|
+
"coreRequirement": "外购数据资源的成本包括购买价款、相关税费以及直接归属于使该项无形资产达到预定用途所发生的加工支出"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"name": "关于严格执行企业会计准则切实做好企业2025年年报工作的通知",
|
|
134
|
+
"docNumber": "财会〔2025〕33号",
|
|
135
|
+
"coreRequirement": "不得将以评估等方式得出的金额直接作为入账和调账的依据;强化减值测试和披露"
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"stage": "COMPLIANCE_CHECK",
|
|
141
|
+
"stageLabel": "合规审查",
|
|
142
|
+
"documents": [
|
|
143
|
+
{
|
|
144
|
+
"name": "中华人民共和国数据安全法",
|
|
145
|
+
"docNumber": "主席令第八十四号",
|
|
146
|
+
"coreRequirement": "开展数据处理活动应当遵守法律法规,履行数据安全保护义务,不得危害国家安全和公共利益"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "中华人民共和国个人信息保护法",
|
|
150
|
+
"docNumber": "主席令第九十一号",
|
|
151
|
+
"coreRequirement": "处理个人信息应当遵循合法、正当、必要原则,取得个人同意或符合法定情形"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"name": "数据资产全过程管理试点方案",
|
|
155
|
+
"docNumber": "财资〔2024〕167号",
|
|
156
|
+
"coreRequirement": "围绕数据资产台账编制、登记、授权运营、收益分配、交易流通等重点环节开展试点"
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
]
|
|
161
|
+
}
|
|
@@ -69,7 +69,7 @@ export class BusinessRulesLoader {
|
|
|
69
69
|
if (typeof version !== 'string') {
|
|
70
70
|
return false;
|
|
71
71
|
}
|
|
72
|
-
return version.startsWith('1.');
|
|
72
|
+
return version.startsWith('1.') || version.startsWith('3.');
|
|
73
73
|
}
|
|
74
74
|
hasRequiredNodes(config) {
|
|
75
75
|
return (config.valueAssessment !== undefined &&
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
export function loadJsonConfig(envVar, localPath, sharedPackagePath) {
|
|
4
|
+
const envPath = process.env[envVar];
|
|
5
|
+
if (envPath && existsSync(envPath)) {
|
|
6
|
+
return JSON.parse(readFileSync(envPath, 'utf-8'));
|
|
7
|
+
}
|
|
8
|
+
if (existsSync(localPath)) {
|
|
9
|
+
return JSON.parse(readFileSync(localPath, 'utf-8'));
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
const req = createRequire(import.meta.url);
|
|
13
|
+
const resolved = req.resolve(sharedPackagePath);
|
|
14
|
+
return JSON.parse(readFileSync(resolved, 'utf-8'));
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
throw new Error(`CONFIG_NOT_FOUND: tried ${envVar}, ${localPath}, ${sharedPackagePath}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=configLoader.js.map
|
|
@@ -120,6 +120,107 @@ export const defaultIncrementalSchedulingConfig = {
|
|
|
120
120
|
stateFilePath: 'state/incremental-state.json',
|
|
121
121
|
lockTimeout: 3600,
|
|
122
122
|
};
|
|
123
|
+
export const defaultRegistrationConfig = {
|
|
124
|
+
ruleVersion: '1.0',
|
|
125
|
+
agencies: [
|
|
126
|
+
{
|
|
127
|
+
id: 'beijing',
|
|
128
|
+
name: '北京国际大数据交易所',
|
|
129
|
+
location: '北京',
|
|
130
|
+
specialties: ['医疗', '健康', '生物'],
|
|
131
|
+
contact: '北京国际大数据交易所官网',
|
|
132
|
+
basis: '医疗数据登记案例集中',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: 'shanghai',
|
|
136
|
+
name: '上海数据交易所',
|
|
137
|
+
location: '上海',
|
|
138
|
+
specialties: ['金融', '征信', '支付'],
|
|
139
|
+
contact: '上海数据交易所官网',
|
|
140
|
+
basis: '金融数据交易活跃度最高',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: 'shenzhen',
|
|
144
|
+
name: '深圳数据交易所',
|
|
145
|
+
location: '深圳',
|
|
146
|
+
specialties: ['交通', '物流', '地理'],
|
|
147
|
+
contact: '深圳数据交易所官网',
|
|
148
|
+
basis: '交通数据登记案例较多',
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
dataTypeMapping: {
|
|
152
|
+
'金融': 'shanghai',
|
|
153
|
+
'征信': 'shanghai',
|
|
154
|
+
'支付': 'shanghai',
|
|
155
|
+
'医疗': 'beijing',
|
|
156
|
+
'健康': 'beijing',
|
|
157
|
+
'生物': 'beijing',
|
|
158
|
+
'交通': 'shenzhen',
|
|
159
|
+
'物流': 'shenzhen',
|
|
160
|
+
'地理': 'shenzhen',
|
|
161
|
+
},
|
|
162
|
+
defaultRecommendation: {
|
|
163
|
+
agency: null,
|
|
164
|
+
basis: '根据数据属性匹配',
|
|
165
|
+
message: '建议咨询专业机构',
|
|
166
|
+
},
|
|
167
|
+
registrationFee: 5000,
|
|
168
|
+
registrationSteps: ['申请', '受理', '审查', '公示', '异议', '存证', '凭证'],
|
|
169
|
+
};
|
|
170
|
+
export const defaultPolicyReferences = [
|
|
171
|
+
{
|
|
172
|
+
stage: 'INVENTORY',
|
|
173
|
+
stageLabel: '盘点',
|
|
174
|
+
documents: [
|
|
175
|
+
{ name: '中华人民共和国数据安全法', docNumber: '主席令第八十四号', coreRequirement: '数据分类分级保护' },
|
|
176
|
+
{ name: '数据产权登记工作指引(试行)', docNumber: '国数综政策〔2026〕35号', coreRequirement: '数据产权三权分置' },
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
stage: 'CLEANING',
|
|
181
|
+
stageLabel: '清洗',
|
|
182
|
+
documents: [
|
|
183
|
+
{ name: '企业数据资源相关会计处理暂行规定', docNumber: '财会〔2023〕11号', coreRequirement: '数据资源入表条件' },
|
|
184
|
+
{ name: '数据资产评估指导意见', docNumber: '中评协〔2023〕17号', coreRequirement: '六维质量评价标准' },
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
stage: 'MASKING',
|
|
189
|
+
stageLabel: '脱敏',
|
|
190
|
+
documents: [
|
|
191
|
+
{ name: '中华人民共和国个人信息保护法', docNumber: '主席令第九十一号', coreRequirement: '匿名化后不再属于个人信息' },
|
|
192
|
+
{ name: '关于完善数据流通安全治理的实施方案', docNumber: '发改数据〔2025〕18号', coreRequirement: '脱敏后可按一般数据流通' },
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
stage: 'PACKAGING',
|
|
197
|
+
stageLabel: '包装',
|
|
198
|
+
documents: [
|
|
199
|
+
{ name: '数据产权登记工作指引(试行)', docNumber: '国数综政策〔2026〕35号', coreRequirement: '登记凭证可用于入表、融资、入股' },
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
stage: 'PRECHECK',
|
|
204
|
+
stageLabel: '登记预检',
|
|
205
|
+
documents: [
|
|
206
|
+
{ name: '数据产权登记工作指引(试行)', docNumber: '国数综政策〔2026〕35号', coreRequirement: '不予登记情形' },
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
stage: 'DOC_GENERATION',
|
|
211
|
+
stageLabel: '材料生成',
|
|
212
|
+
documents: [
|
|
213
|
+
{ name: '数据产权登记工作指引(试行)', docNumber: '国数综政策〔2026〕35号', coreRequirement: '7步登记流程审查重点' },
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
stage: 'AGENCY_MATCHING',
|
|
218
|
+
stageLabel: '机构匹配',
|
|
219
|
+
documents: [
|
|
220
|
+
{ name: '数据产权登记工作指引(试行)', docNumber: '国数综政策〔2026〕35号', coreRequirement: '登记机构名录' },
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
];
|
|
123
224
|
export const defaultBusinessRules = {
|
|
124
225
|
version: '1.0',
|
|
125
226
|
lastUpdated: '2026-08-17',
|
|
@@ -217,5 +318,7 @@ export const defaultBusinessRules = {
|
|
|
217
318
|
defaultDescription: '适用于数据分析、模型训练、行业研究等场景',
|
|
218
319
|
version: 'V1.0',
|
|
219
320
|
},
|
|
321
|
+
registration: defaultRegistrationConfig,
|
|
322
|
+
policyReferences: defaultPolicyReferences,
|
|
220
323
|
};
|
|
221
324
|
//# sourceMappingURL=defaultBusinessRules.js.map
|
package/lib/index.js
CHANGED
|
@@ -2,8 +2,12 @@ export * from './types.js';
|
|
|
2
2
|
export { defaultBusinessRules } from './defaultBusinessRules.js';
|
|
3
3
|
export { defaultQualityScoringConfig, defaultLineageConfig, defaultAdvancedMaskingConfig, defaultVisualizationConfig, defaultSensitivityClassificationConfig, defaultIncrementalSchedulingConfig, } from './defaultBusinessRules.js';
|
|
4
4
|
export { BusinessRulesLoader } from './businessRulesLoader.js';
|
|
5
|
+
export { loadJsonConfig } from './configLoader.js';
|
|
5
6
|
export { FileFormatAdapter } from './fileFormatAdapter.js';
|
|
6
7
|
export { ReportGenerator } from './reportGenerator.js';
|
|
7
8
|
export { PathValidator } from './pathValidator.js';
|
|
8
9
|
export { AuditLogger } from './auditLogger.js';
|
|
10
|
+
export { PolicyReferenceResolver } from './policyReferenceResolver.js';
|
|
11
|
+
export { RegistrationNavigationEnhancer } from './registrationNavigationEnhancer.js';
|
|
12
|
+
export { defaultRegistrationConfig, defaultPolicyReferences, } from './defaultBusinessRules.js';
|
|
9
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { defaultPolicyReferences } from './defaultBusinessRules.js';
|
|
4
|
+
export class PolicyReferenceResolver {
|
|
5
|
+
static instance = null;
|
|
6
|
+
cache = new Map();
|
|
7
|
+
references = [];
|
|
8
|
+
configPath;
|
|
9
|
+
constructor(configPath) {
|
|
10
|
+
this.configPath = configPath
|
|
11
|
+
? path.resolve(configPath)
|
|
12
|
+
: path.resolve(process.cwd(), 'config', 'policy-references.json');
|
|
13
|
+
this.load();
|
|
14
|
+
}
|
|
15
|
+
static getInstance(configPath) {
|
|
16
|
+
if (!PolicyReferenceResolver.instance) {
|
|
17
|
+
PolicyReferenceResolver.instance = new PolicyReferenceResolver(configPath);
|
|
18
|
+
}
|
|
19
|
+
return PolicyReferenceResolver.instance;
|
|
20
|
+
}
|
|
21
|
+
load() {
|
|
22
|
+
try {
|
|
23
|
+
if (fs.existsSync(this.configPath)) {
|
|
24
|
+
const raw = fs.readFileSync(this.configPath, 'utf-8');
|
|
25
|
+
const parsed = JSON.parse(raw);
|
|
26
|
+
if (parsed.policyReferences && Array.isArray(parsed.policyReferences)) {
|
|
27
|
+
this.references = parsed.policyReferences;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
console.warn('[PolicyReferenceResolver] 配置加载失败,使用默认值');
|
|
34
|
+
}
|
|
35
|
+
this.references = defaultPolicyReferences;
|
|
36
|
+
}
|
|
37
|
+
resolve(stage) {
|
|
38
|
+
if (this.cache.has(stage)) {
|
|
39
|
+
return this.cache.get(stage);
|
|
40
|
+
}
|
|
41
|
+
const ref = this.references.find(r => r.stage === stage);
|
|
42
|
+
let documents;
|
|
43
|
+
if (ref && ref.documents && ref.documents.length > 0) {
|
|
44
|
+
documents = ref.documents;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
console.warn(`[PolicyReferenceResolver] 环节 ${stage} 未配置政策依据,使用占位项`);
|
|
48
|
+
documents = [
|
|
49
|
+
{
|
|
50
|
+
name: '依据文件待补充',
|
|
51
|
+
docNumber: '待配置',
|
|
52
|
+
coreRequirement: '请补充对应政策依据',
|
|
53
|
+
},
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
this.cache.set(stage, documents);
|
|
57
|
+
return documents;
|
|
58
|
+
}
|
|
59
|
+
clearCache() {
|
|
60
|
+
this.cache.clear();
|
|
61
|
+
PolicyReferenceResolver.instance = null;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=policyReferenceResolver.js.map
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { PolicyReferenceResolver } from './policyReferenceResolver.js';
|
|
4
|
+
import { defaultRegistrationConfig } from './defaultBusinessRules.js';
|
|
5
|
+
const PLUGIN_STAGE_MAP = {
|
|
6
|
+
'data-inventory': 'INVENTORY',
|
|
7
|
+
'data-cleaning': 'CLEANING',
|
|
8
|
+
'data-masking': 'MASKING',
|
|
9
|
+
'data-packaging': 'PACKAGING',
|
|
10
|
+
};
|
|
11
|
+
const NAVIGATION_TEXTS = {
|
|
12
|
+
'data-inventory': '本数据集已完成盘点,建议下一步申请数据产权登记。登记机构推荐:{agency}',
|
|
13
|
+
'data-cleaning': '数据质量已达到登记要求(依据《数据资产评估指导意见》六维质量评价标准)。',
|
|
14
|
+
'data-masking': "脱敏后数据已符合登记审查中的'来源合规性'要求(依据《数据产权登记工作指引》第三章)。",
|
|
15
|
+
'data-packaging': "本产品说明书可直接用于登记申请材料中的'数据描述'部分。",
|
|
16
|
+
};
|
|
17
|
+
export class RegistrationNavigationEnhancer {
|
|
18
|
+
config;
|
|
19
|
+
configPath;
|
|
20
|
+
constructor(configPath) {
|
|
21
|
+
this.configPath = configPath
|
|
22
|
+
? path.resolve(configPath)
|
|
23
|
+
: path.resolve(process.cwd(), 'config', 'registration-agencies.json');
|
|
24
|
+
this.config = this.loadConfig();
|
|
25
|
+
}
|
|
26
|
+
loadConfig() {
|
|
27
|
+
try {
|
|
28
|
+
if (fs.existsSync(this.configPath)) {
|
|
29
|
+
const raw = fs.readFileSync(this.configPath, 'utf-8');
|
|
30
|
+
return JSON.parse(raw);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
console.warn('[RegistrationNavigationEnhancer] 配置加载失败,使用默认值');
|
|
35
|
+
}
|
|
36
|
+
return defaultRegistrationConfig;
|
|
37
|
+
}
|
|
38
|
+
matchAgency(dataType) {
|
|
39
|
+
const agencyId = this.config.dataTypeMapping[dataType];
|
|
40
|
+
if (agencyId) {
|
|
41
|
+
const agency = this.config.agencies.find(a => a.id === agencyId);
|
|
42
|
+
if (agency)
|
|
43
|
+
return agency.name;
|
|
44
|
+
}
|
|
45
|
+
return this.config.defaultRecommendation.message;
|
|
46
|
+
}
|
|
47
|
+
enhance(report, pluginName, dataType) {
|
|
48
|
+
const stage = PLUGIN_STAGE_MAP[pluginName];
|
|
49
|
+
if (!stage)
|
|
50
|
+
return report;
|
|
51
|
+
const resolver = PolicyReferenceResolver.getInstance();
|
|
52
|
+
const policyDocs = resolver.resolve(stage);
|
|
53
|
+
let navText = NAVIGATION_TEXTS[pluginName] || '';
|
|
54
|
+
if (pluginName === 'data-inventory') {
|
|
55
|
+
const agencyName = this.matchAgency(dataType);
|
|
56
|
+
navText = navText.replace('{agency}', agencyName);
|
|
57
|
+
}
|
|
58
|
+
const policyText = policyDocs
|
|
59
|
+
.map(d => `- 《${d.name}》(${d.docNumber}):${d.coreRequirement}`)
|
|
60
|
+
.join('\n');
|
|
61
|
+
const enhancedReport = `${report}
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 登记导航
|
|
66
|
+
|
|
67
|
+
${navText}
|
|
68
|
+
|
|
69
|
+
## 政策依据
|
|
70
|
+
|
|
71
|
+
${policyText}
|
|
72
|
+
`;
|
|
73
|
+
return enhancedReport;
|
|
74
|
+
}
|
|
75
|
+
enhanceAll(orchestrationResult, dataType) {
|
|
76
|
+
return {
|
|
77
|
+
...orchestrationResult,
|
|
78
|
+
maskingReport: this.enhance(orchestrationResult.maskingReport, 'data-masking', dataType),
|
|
79
|
+
cleaningReport: this.enhance(orchestrationResult.cleaningReport, 'data-cleaning', dataType),
|
|
80
|
+
inventoryReport: this.enhance(orchestrationResult.inventoryReport, 'data-inventory', dataType),
|
|
81
|
+
packagingManual: this.enhance(orchestrationResult.packagingManual, 'data-packaging', dataType),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
matchAgencyResult(dataType) {
|
|
85
|
+
const agencyId = this.config.dataTypeMapping[dataType];
|
|
86
|
+
if (agencyId) {
|
|
87
|
+
const agency = this.config.agencies.find(a => a.id === agencyId);
|
|
88
|
+
if (agency) {
|
|
89
|
+
return {
|
|
90
|
+
agency: agency.id,
|
|
91
|
+
agencyName: agency.name,
|
|
92
|
+
basis: agency.basis,
|
|
93
|
+
dataType,
|
|
94
|
+
ruleVersion: this.config.ruleVersion,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
agency: null,
|
|
100
|
+
agencyName: this.config.defaultRecommendation.message,
|
|
101
|
+
basis: this.config.defaultRecommendation.basis,
|
|
102
|
+
dataType,
|
|
103
|
+
ruleVersion: this.config.ruleVersion,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=registrationNavigationEnhancer.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BusinessRulesConfig } from './types.js';
|
|
1
|
+
import type { BusinessRulesConfig, RegistrationConfig, PolicyReference } from './types.js';
|
|
2
2
|
export declare const defaultQualityScoringConfig: {
|
|
3
3
|
weights: {
|
|
4
4
|
completeness: number;
|
|
@@ -136,5 +136,7 @@ export declare const defaultIncrementalSchedulingConfig: {
|
|
|
136
136
|
stateFilePath: string;
|
|
137
137
|
lockTimeout: number;
|
|
138
138
|
};
|
|
139
|
+
export declare const defaultRegistrationConfig: RegistrationConfig;
|
|
140
|
+
export declare const defaultPolicyReferences: PolicyReference[];
|
|
139
141
|
export declare const defaultBusinessRules: BusinessRulesConfig;
|
|
140
142
|
//# sourceMappingURL=defaultBusinessRules.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './types.js';
|
|
|
2
2
|
export { defaultBusinessRules } from './defaultBusinessRules.js';
|
|
3
3
|
export { defaultQualityScoringConfig, defaultLineageConfig, defaultAdvancedMaskingConfig, defaultVisualizationConfig, defaultSensitivityClassificationConfig, defaultIncrementalSchedulingConfig, } from './defaultBusinessRules.js';
|
|
4
4
|
export { BusinessRulesLoader } from './businessRulesLoader.js';
|
|
5
|
+
export { loadJsonConfig } from './configLoader.js';
|
|
5
6
|
export { FileFormatAdapter } from './fileFormatAdapter.js';
|
|
6
7
|
export type { FileReadResult } from './fileFormatAdapter.js';
|
|
7
8
|
export { ReportGenerator } from './reportGenerator.js';
|
|
@@ -9,4 +10,7 @@ export type { MaskingReportParams, CleaningReportParams, InventoryReportParams,
|
|
|
9
10
|
export { PathValidator } from './pathValidator.js';
|
|
10
11
|
export { AuditLogger } from './auditLogger.js';
|
|
11
12
|
export type { AuditLogParams } from './auditLogger.js';
|
|
13
|
+
export { PolicyReferenceResolver } from './policyReferenceResolver.js';
|
|
14
|
+
export { RegistrationNavigationEnhancer } from './registrationNavigationEnhancer.js';
|
|
15
|
+
export { defaultRegistrationConfig, defaultPolicyReferences, } from './defaultBusinessRules.js';
|
|
12
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PolicyStage, PolicyDocument } from './types.js';
|
|
2
|
+
export declare class PolicyReferenceResolver {
|
|
3
|
+
private static instance;
|
|
4
|
+
private cache;
|
|
5
|
+
private references;
|
|
6
|
+
private configPath;
|
|
7
|
+
private constructor();
|
|
8
|
+
static getInstance(configPath?: string): PolicyReferenceResolver;
|
|
9
|
+
private load;
|
|
10
|
+
resolve(stage: PolicyStage): PolicyDocument[];
|
|
11
|
+
clearCache(): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=policyReferenceResolver.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { OrchestrationResult, AgencyMatchResult } from './types.js';
|
|
2
|
+
export declare class RegistrationNavigationEnhancer {
|
|
3
|
+
private config;
|
|
4
|
+
private configPath;
|
|
5
|
+
constructor(configPath?: string);
|
|
6
|
+
private loadConfig;
|
|
7
|
+
private matchAgency;
|
|
8
|
+
enhance(report: string, pluginName: string, dataType: string): string;
|
|
9
|
+
enhanceAll(orchestrationResult: OrchestrationResult, dataType: string): OrchestrationResult;
|
|
10
|
+
matchAgencyResult(dataType: string): AgencyMatchResult;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=registrationNavigationEnhancer.d.ts.map
|
package/lib/types/types.d.ts
CHANGED
|
@@ -82,6 +82,8 @@ export interface BusinessRulesConfig {
|
|
|
82
82
|
visualization?: VisualizationConfig;
|
|
83
83
|
sensitivityClassification?: SensitivityClassificationConfig;
|
|
84
84
|
incrementalScheduling?: IncrementalSchedulingConfig;
|
|
85
|
+
registration?: RegistrationConfig;
|
|
86
|
+
policyReferences?: PolicyReference[];
|
|
85
87
|
}
|
|
86
88
|
export interface SensitiveField {
|
|
87
89
|
type: SensitiveFieldType;
|
|
@@ -275,4 +277,90 @@ export interface IncrementalSchedulingConfig {
|
|
|
275
277
|
stateFilePath: string;
|
|
276
278
|
lockTimeout: number;
|
|
277
279
|
}
|
|
280
|
+
export type PolicyStage = 'INVENTORY' | 'CLEANING' | 'MASKING' | 'PACKAGING' | 'PRECHECK' | 'DOC_GENERATION' | 'AGENCY_MATCHING';
|
|
281
|
+
export interface PolicyDocument {
|
|
282
|
+
name: string;
|
|
283
|
+
docNumber: string;
|
|
284
|
+
coreRequirement: string;
|
|
285
|
+
}
|
|
286
|
+
export interface PolicyReference {
|
|
287
|
+
stage: PolicyStage;
|
|
288
|
+
stageLabel: string;
|
|
289
|
+
documents: PolicyDocument[];
|
|
290
|
+
}
|
|
291
|
+
export interface AgencyConfig {
|
|
292
|
+
id: string;
|
|
293
|
+
name: string;
|
|
294
|
+
location: string;
|
|
295
|
+
specialties: string[];
|
|
296
|
+
contact: string;
|
|
297
|
+
basis: string;
|
|
298
|
+
}
|
|
299
|
+
export interface RegistrationConfig {
|
|
300
|
+
ruleVersion: string;
|
|
301
|
+
agencies: AgencyConfig[];
|
|
302
|
+
dataTypeMapping: Record<string, string>;
|
|
303
|
+
defaultRecommendation: {
|
|
304
|
+
agency: string | null;
|
|
305
|
+
basis: string;
|
|
306
|
+
message: string;
|
|
307
|
+
};
|
|
308
|
+
registrationFee: number;
|
|
309
|
+
registrationSteps: string[];
|
|
310
|
+
}
|
|
311
|
+
export interface NavigationField {
|
|
312
|
+
registrationNavigation: string;
|
|
313
|
+
policyReferences: PolicyDocument[];
|
|
314
|
+
}
|
|
315
|
+
export type CheckName = 'NATIONAL_SECURITY' | 'SOURCE_COMPLIANCE' | 'OWNERSHIP_DISPUTE' | 'MATERIAL_AUTHENTICITY';
|
|
316
|
+
export type CheckResult = 'PASS' | 'FAIL' | 'PENDING' | 'UNDETERMINED';
|
|
317
|
+
export type PrecheckConclusion = 'CAN_REGISTER' | 'CANNOT_REGISTER' | 'PENDING_CONFIRMATION';
|
|
318
|
+
export interface PrecheckCheckItem {
|
|
319
|
+
name: CheckName;
|
|
320
|
+
label: string;
|
|
321
|
+
result: CheckResult;
|
|
322
|
+
detail: string;
|
|
323
|
+
}
|
|
324
|
+
export interface PrecheckReport {
|
|
325
|
+
conclusion: PrecheckConclusion;
|
|
326
|
+
checks: PrecheckCheckItem[];
|
|
327
|
+
failedItems: string[];
|
|
328
|
+
policyReferences: PolicyDocument[];
|
|
329
|
+
timestamp: string;
|
|
330
|
+
}
|
|
331
|
+
export type RegistrationDocName = 'DATA_DESCRIPTION' | 'SOURCE_LEGALITY_STATEMENT' | 'OWNERSHIP_EXPLANATION';
|
|
332
|
+
export type DocStatus = 'GENERATED' | 'FAILED' | 'PENDING_FIELDS';
|
|
333
|
+
export interface RegistrationDoc {
|
|
334
|
+
name: RegistrationDocName;
|
|
335
|
+
label: string;
|
|
336
|
+
content: string;
|
|
337
|
+
status: DocStatus;
|
|
338
|
+
missingFields?: string[];
|
|
339
|
+
}
|
|
340
|
+
export interface RegistrationDocPackage {
|
|
341
|
+
docs: RegistrationDoc[];
|
|
342
|
+
packagePath: string;
|
|
343
|
+
policyReferences: PolicyDocument[];
|
|
344
|
+
timestamp: string;
|
|
345
|
+
}
|
|
346
|
+
export interface AgencyMatchResult {
|
|
347
|
+
agency: string | null;
|
|
348
|
+
agencyName: string;
|
|
349
|
+
basis: string;
|
|
350
|
+
dataType: string;
|
|
351
|
+
ruleVersion: string;
|
|
352
|
+
}
|
|
353
|
+
export type StepStatus = 'COMPLETED' | 'CURRENT' | 'PENDING';
|
|
354
|
+
export interface RegistrationStep {
|
|
355
|
+
name: string;
|
|
356
|
+
status: StepStatus;
|
|
357
|
+
description: string;
|
|
358
|
+
}
|
|
359
|
+
export interface RegistrationProgress {
|
|
360
|
+
steps: RegistrationStep[];
|
|
361
|
+
currentStep: number;
|
|
362
|
+
registrationId: string;
|
|
363
|
+
agency: string;
|
|
364
|
+
timestamp: string;
|
|
365
|
+
}
|
|
278
366
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,45 +1,52 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name":
|
|
3
|
-
"description":
|
|
4
|
-
"version": "
|
|
5
|
-
"publishConfig":
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"repository":
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"type":
|
|
14
|
-
"main":
|
|
15
|
-
"types":
|
|
16
|
-
"exports":
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"files":
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
"name": "@liuhange/dsh-data-asset-shared",
|
|
3
|
+
"description": "Shared infrastructure for data assetization plugins: business rules loader, file format adapter, report generator, path validator, audit logger",
|
|
4
|
+
"version": "3.1.0",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/liuhange789/data-asset-inspector.git",
|
|
11
|
+
"directory": "packages/data-asset/data-asset-shared"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./invariant": {
|
|
22
|
+
"types": "./lib/types/invariant.d.ts",
|
|
23
|
+
"default": "./lib/invariant.js"
|
|
24
|
+
},
|
|
25
|
+
"./src/*": "./src/*",
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"lib/**/*.js",
|
|
30
|
+
"lib/types/**/*.d.ts",
|
|
31
|
+
"config/**/*.json"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
32
34
|
"scripts": {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"test": "vitest run",
|
|
37
|
+
"build": "tsc"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"csv-parse": "^5.5.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@deepseek-ai/cordis": "^4.0.0",
|
|
44
|
+
"@deepseek-ai/dsh-tools": "0.0.1-rc.1",
|
|
45
|
+
"@deepseek-ai/schemastery": "^3.18.0"
|
|
36
46
|
},
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"@deepseek-ai/dsh-tools": "0.0.1-rc.1",
|
|
43
|
-
"@deepseek-ai/schemastery": "^3.18.0"
|
|
44
|
-
}
|
|
47
|
+
"dsh": {
|
|
48
|
+
"bundle": {
|
|
49
|
+
"patch": true
|
|
50
|
+
}
|
|
51
|
+
}
|
|
45
52
|
}
|