@liuhange/dsh-construction-data-inventory 3.1.1 → 3.2.1
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/quality-element-config.json +61 -0
- package/cordis.patch.yml +8 -8
- package/lib/error-classifier.js +50 -0
- package/lib/index.js +56 -1
- package/lib/invariant.js +1 -0
- package/lib/inventory-report-generator.js +43 -0
- package/lib/policy-basis-builder.js +3 -0
- package/lib/quality-element-scorer.js +33 -0
- package/lib/types/error-classifier.d.ts +6 -0
- package/lib/types/invariant.d.ts +1 -0
- package/lib/types/inventory-report-generator.d.ts +5 -0
- package/lib/types/policy-basis-builder.d.ts +1 -0
- package/lib/types/quality-element-scorer.d.ts +8 -0
- package/lib/types/types.d.ts +68 -0
- package/package.json +94 -74
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"lastUpdated": "2026-10-01",
|
|
4
|
+
"qualityElements": {
|
|
5
|
+
"description": "建筑数据资产六类质量元素及权重,等权配置",
|
|
6
|
+
"elements": [
|
|
7
|
+
{
|
|
8
|
+
"elementName": "空间参考系",
|
|
9
|
+
"weight": 0.1667,
|
|
10
|
+
"keywords": ["坐标系", "高程基准"],
|
|
11
|
+
"policyBasis": "依据:《测绘成果质量检查与验收》(GB/T 24356-2023)第6.1条"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"elementName": "位置精度",
|
|
15
|
+
"weight": 0.1667,
|
|
16
|
+
"keywords": ["接边", "坐标偏差"],
|
|
17
|
+
"policyBasis": "依据:《测绘成果质量检查与验收》(GB/T 24356-2023)第6.2条"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"elementName": "逻辑一致性",
|
|
21
|
+
"weight": 0.1667,
|
|
22
|
+
"keywords": ["重复", "孤立", "连通", "缺坐标", "构件", "属性", "字段", "楼层", "空间", "关联"],
|
|
23
|
+
"policyBasis": "依据:《测绘成果质量检查与验收》(GB/T 24356-2023)第6.3条"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"elementName": "时间精度",
|
|
27
|
+
"weight": 0.1667,
|
|
28
|
+
"keywords": ["时间", "进度"],
|
|
29
|
+
"policyBasis": "依据:《测绘成果质量检查与验收》(GB/T 24356-2023)第6.4条"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"elementName": "栅格质量",
|
|
33
|
+
"weight": 0.1666,
|
|
34
|
+
"keywords": ["栅格"],
|
|
35
|
+
"policyBasis": "依据:《测绘成果质量检查与验收》(GB/T 24356-2023)第6.5条"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"elementName": "附件质量",
|
|
39
|
+
"weight": 0.1666,
|
|
40
|
+
"keywords": ["附件", "文档"],
|
|
41
|
+
"policyBasis": "依据:《测绘成果质量检查与验收》(GB/T 24356-2023)第6.6条"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"policyBasis": "依据:《测绘成果质量检查与验收》(GB/T 24356-2023)第6章"
|
|
45
|
+
},
|
|
46
|
+
"errorClassThresholds": {
|
|
47
|
+
"description": "A/B/C/D错误分类扣分阈值,A类最严重",
|
|
48
|
+
"classAScoreDeduction": 1.0,
|
|
49
|
+
"classBScoreDeduction": 0.6,
|
|
50
|
+
"classCScoreDeduction": 0.3,
|
|
51
|
+
"classDScoreDeduction": 0.1,
|
|
52
|
+
"policyBasis": "依据:《测绘成果质量检查与验收》(GB/T 24356-2023)第7.2条"
|
|
53
|
+
},
|
|
54
|
+
"qualityGradeThresholds": {
|
|
55
|
+
"description": "质量等级划分阈值,合格分下限",
|
|
56
|
+
"excellentMinScore": 90,
|
|
57
|
+
"goodMinScore": 80,
|
|
58
|
+
"qualifiedMinScore": 70,
|
|
59
|
+
"policyBasis": "依据:《测绘成果质量检查与验收》(GB/T 24356-2023)第8.1条"
|
|
60
|
+
}
|
|
61
|
+
}
|
package/cordis.patch.yml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# Cordis Framework Patch Declaration for @liuhange/dsh-construction-data-inventory
|
|
2
|
-
# This file declares the plugin's runtime patch for the Cordis framework.
|
|
3
|
-
# Used by DSH plugin manager to apply framework-level patches during installation.
|
|
4
|
-
plugin: @liuhange/dsh-construction-data-inventory
|
|
5
|
-
version:
|
|
6
|
-
patch:
|
|
7
|
-
- target: tools
|
|
8
|
-
action: register
|
|
1
|
+
# Cordis Framework Patch Declaration for @liuhange/dsh-construction-data-inventory
|
|
2
|
+
# This file declares the plugin's runtime patch for the Cordis framework.
|
|
3
|
+
# Used by DSH plugin manager to apply framework-level patches during installation.
|
|
4
|
+
plugin: @liuhange/dsh-construction-data-inventory
|
|
5
|
+
version:'"3.2.1"'
|
|
6
|
+
patch:
|
|
7
|
+
- target: tools
|
|
8
|
+
action: register
|
|
9
9
|
description: Register plugin tools into Cordis runtime
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export class ErrorClassifier {
|
|
2
|
+
classify(checkResults, policyBasis) {
|
|
3
|
+
let classACount = 0;
|
|
4
|
+
let classBCount = 0;
|
|
5
|
+
let classCCount = 0;
|
|
6
|
+
let classDCount = 0;
|
|
7
|
+
for (const result of checkResults) {
|
|
8
|
+
switch (result.errorClass) {
|
|
9
|
+
case 'A':
|
|
10
|
+
classACount++;
|
|
11
|
+
break;
|
|
12
|
+
case 'B':
|
|
13
|
+
classBCount++;
|
|
14
|
+
break;
|
|
15
|
+
case 'C':
|
|
16
|
+
classCCount++;
|
|
17
|
+
break;
|
|
18
|
+
case 'D':
|
|
19
|
+
classDCount++;
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
classACount,
|
|
25
|
+
classBCount,
|
|
26
|
+
classCCount,
|
|
27
|
+
classDCount,
|
|
28
|
+
totalCount: classACount + classBCount + classCCount + classDCount,
|
|
29
|
+
policyBasis,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
calculateProportions(stats) {
|
|
33
|
+
const total = stats.totalCount;
|
|
34
|
+
if (total === 0) {
|
|
35
|
+
return {
|
|
36
|
+
classAProportion: 0,
|
|
37
|
+
classBProportion: 0,
|
|
38
|
+
classCProportion: 0,
|
|
39
|
+
classDProportion: 0,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
classAProportion: Math.round((stats.classACount / total) * 10000) / 100,
|
|
44
|
+
classBProportion: Math.round((stats.classBCount / total) * 10000) / 100,
|
|
45
|
+
classCProportion: Math.round((stats.classCCount / total) * 10000) / 100,
|
|
46
|
+
classDProportion: Math.round((stats.classDCount / total) * 10000) / 100,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=error-classifier.js.map
|
package/lib/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export const name = '@liuhange/dsh-construction-data-inventory';
|
|
|
2
2
|
export const inject = ['tools'];
|
|
3
3
|
import { readFileSync, existsSync } from 'node:fs';
|
|
4
4
|
import { resolve } from 'node:path';
|
|
5
|
-
import { PLUGIN_NAME } from './invariant.js';
|
|
5
|
+
import { PLUGIN_NAME, DEFAULT_QUALITY_ELEMENT_CONFIG_PATH } from './invariant.js';
|
|
6
6
|
import { ConstructionConfigLoader } from './construction-config-loader.js';
|
|
7
7
|
import { InputValidator } from './input-validator.js';
|
|
8
8
|
import { IfcModelAdapter } from './ifc-model-adapter.js';
|
|
@@ -15,6 +15,9 @@ import { AssetCodeGenerator } from './asset-code-generator.js';
|
|
|
15
15
|
import { ChangeTraceabilityChecker } from './change-traceability-checker.js';
|
|
16
16
|
import { ReviewOverrideRecorder } from './review-override-recorder.js';
|
|
17
17
|
import { InventoryReportGenerator } from './inventory-report-generator.js';
|
|
18
|
+
import { QualityElementScorer } from './quality-element-scorer.js';
|
|
19
|
+
import { ErrorClassifier } from './error-classifier.js';
|
|
20
|
+
import { PolicyBasisBuilder } from './policy-basis-builder.js';
|
|
18
21
|
function errorResult(error, message) {
|
|
19
22
|
return JSON.stringify({ error, message });
|
|
20
23
|
}
|
|
@@ -42,6 +45,19 @@ function loadChangeRecords(changeDataPath) {
|
|
|
42
45
|
const raw = readFileSync(fullPath, 'utf-8');
|
|
43
46
|
return JSON.parse(raw);
|
|
44
47
|
}
|
|
48
|
+
function loadQualityElementConfig() {
|
|
49
|
+
const filePath = resolve(process.cwd(), DEFAULT_QUALITY_ELEMENT_CONFIG_PATH);
|
|
50
|
+
if (!existsSync(filePath)) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const raw = readFileSync(filePath, 'utf-8');
|
|
55
|
+
return JSON.parse(raw);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
45
61
|
function buildClassificationEncodingList(assets) {
|
|
46
62
|
const list = [];
|
|
47
63
|
for (const asset of assets) {
|
|
@@ -66,6 +82,9 @@ export function apply(ctx) {
|
|
|
66
82
|
const changeTraceabilityChecker = new ChangeTraceabilityChecker();
|
|
67
83
|
const reportGenerator = new InventoryReportGenerator();
|
|
68
84
|
const overrideRecorder = new ReviewOverrideRecorder();
|
|
85
|
+
const qualityScorer = new QualityElementScorer();
|
|
86
|
+
const errorClassifier = new ErrorClassifier();
|
|
87
|
+
const policyBasisBuilder = new PolicyBasisBuilder();
|
|
69
88
|
ctx.tools.register({
|
|
70
89
|
name: 'inspect_ai_dataset',
|
|
71
90
|
description: '对建筑工程项目多源异构数据进行资产化盘点,按GB/T 51269标准生成分类编码与资产台账',
|
|
@@ -181,6 +200,40 @@ export function apply(ctx) {
|
|
|
181
200
|
projectId,
|
|
182
201
|
skippedChangeTraceability,
|
|
183
202
|
});
|
|
203
|
+
let qualityReportOutput = null;
|
|
204
|
+
try {
|
|
205
|
+
const qualityConfig = loadQualityElementConfig();
|
|
206
|
+
if (qualityConfig) {
|
|
207
|
+
const qualityCheckResults = errorList
|
|
208
|
+
.filter((e) => e.errorClass)
|
|
209
|
+
.map((e) => ({
|
|
210
|
+
checkName: e.errorMessage,
|
|
211
|
+
errorClass: e.errorClass,
|
|
212
|
+
objectId: e.assetId,
|
|
213
|
+
description: e.errorMessage,
|
|
214
|
+
policyBasis: policyBasisBuilder.buildQualityElement('7.2'),
|
|
215
|
+
}));
|
|
216
|
+
const { scores, totalScore } = qualityScorer.score(qualityCheckResults, qualityConfig);
|
|
217
|
+
const errorClassStats = errorClassifier.classify(qualityCheckResults, qualityConfig.errorClassThresholds.policyBasis);
|
|
218
|
+
const proportions = errorClassifier.calculateProportions(errorClassStats);
|
|
219
|
+
const qualityBasisList = scores.map((s) => s.policyBasis);
|
|
220
|
+
qualityBasisList.push(errorClassStats.policyBasis);
|
|
221
|
+
report.qualityReport = {
|
|
222
|
+
qualityElementScores: scores,
|
|
223
|
+
totalScore,
|
|
224
|
+
errorClassStatistics: errorClassStats,
|
|
225
|
+
errorClassProportions: proportions,
|
|
226
|
+
policyBasisSummary: policyBasisBuilder.buildSummary(qualityBasisList),
|
|
227
|
+
};
|
|
228
|
+
for (const asset of report.assetList) {
|
|
229
|
+
asset.qualityScore = scores;
|
|
230
|
+
}
|
|
231
|
+
qualityReportOutput = reportGenerator.writeQualityReport(report, outputPathDir);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
catch (e) {
|
|
235
|
+
allWarnings.push(`QUALITY_SCORING_FAILED: ${e.message}`);
|
|
236
|
+
}
|
|
184
237
|
const reportJsonPath = reportGenerator.writeJson(report, outputPathDir);
|
|
185
238
|
const reportMdPath = reportGenerator.writeMarkdown(report, outputPathDir);
|
|
186
239
|
const ledgerPath = reportGenerator.exportLedger(unifiedAssets, outputPathDir);
|
|
@@ -198,6 +251,8 @@ export function apply(ctx) {
|
|
|
198
251
|
reportJsonPath,
|
|
199
252
|
reportMdPath,
|
|
200
253
|
ledgerPath,
|
|
254
|
+
qualityReportPath: qualityReportOutput,
|
|
255
|
+
qualityReport: report.qualityReport ?? null,
|
|
201
256
|
warnings: allWarnings,
|
|
202
257
|
policyBasisSummary: report.policyBasisSummary,
|
|
203
258
|
legalDisclaimer: report.legalDisclaimer,
|
package/lib/invariant.js
CHANGED
|
@@ -2,6 +2,7 @@ export const PLUGIN_NAME = '@liuhange/dsh-construction-data-inventory';
|
|
|
2
2
|
export const DEFAULT_CLASSIFICATION_CONFIG_PATH = 'config/classification-config.json';
|
|
3
3
|
export const DEFAULT_ENCODING_RULE_CONFIG_PATH = 'config/encoding-rule-config.json';
|
|
4
4
|
export const DEFAULT_SOURCE_ADAPTER_CONFIG_PATH = 'config/source-adapter-config.json';
|
|
5
|
+
export const DEFAULT_QUALITY_ELEMENT_CONFIG_PATH = 'config/quality-element-config.json';
|
|
5
6
|
export const DEFAULT_OVERRIDE_LOG_PATH = 'logs/override-records.log';
|
|
6
7
|
export const LEGAL_DISCLAIMER = '本报告由辅助盘点工具生成,不替代GB/T 51269标准的正式合规认证';
|
|
7
8
|
export const POLICY_STANDARD_NAME = '《建筑信息模型分类和编码标准》(GB/T 51269-2017)';
|
|
@@ -67,6 +67,19 @@ export class InventoryReportGenerator {
|
|
|
67
67
|
exportLedger(assetList, outputPathDir) {
|
|
68
68
|
return this.ledgerExporter.exportToPath(assetList, outputPathDir);
|
|
69
69
|
}
|
|
70
|
+
writeQualityReport(report, outputPathDir) {
|
|
71
|
+
if (!report.qualityReport) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
if (!existsSync(outputPathDir)) {
|
|
75
|
+
mkdirSync(outputPathDir, { recursive: true });
|
|
76
|
+
}
|
|
77
|
+
const jsonPath = resolve(outputPathDir, 'quality-check-report.json');
|
|
78
|
+
writeFileSync(jsonPath, JSON.stringify(report.qualityReport, null, 2), 'utf-8');
|
|
79
|
+
const mdPath = resolve(outputPathDir, 'quality-check-report.md');
|
|
80
|
+
writeFileSync(mdPath, this.renderQualityMarkdown(report.qualityReport), 'utf-8');
|
|
81
|
+
return { jsonPath, mdPath };
|
|
82
|
+
}
|
|
70
83
|
renderMarkdown(report) {
|
|
71
84
|
const lines = [];
|
|
72
85
|
lines.push(`# 建筑工程项目数据资产盘点报告`);
|
|
@@ -136,5 +149,35 @@ export class InventoryReportGenerator {
|
|
|
136
149
|
lines.push('');
|
|
137
150
|
return lines.join('\n');
|
|
138
151
|
}
|
|
152
|
+
renderQualityMarkdown(qr) {
|
|
153
|
+
const lines = [];
|
|
154
|
+
lines.push(`# 建筑数据资产质量检查报告`);
|
|
155
|
+
lines.push('');
|
|
156
|
+
lines.push(`> 依据:《测绘成果质量检查与验收》(GB/T 24356-2023)`);
|
|
157
|
+
lines.push('');
|
|
158
|
+
lines.push(`## 质量元素评分`);
|
|
159
|
+
lines.push('| 质量元素 | 权重 | 得分 | 政策依据 |');
|
|
160
|
+
lines.push('|---------|------|------|---------|');
|
|
161
|
+
for (const s of qr.qualityElementScores) {
|
|
162
|
+
lines.push(`| ${s.elementName} | ${s.weight} | ${s.score} | ${s.policyBasis} |`);
|
|
163
|
+
}
|
|
164
|
+
lines.push('');
|
|
165
|
+
lines.push(`- 综合得分: ${qr.totalScore}`);
|
|
166
|
+
lines.push('');
|
|
167
|
+
lines.push(`## 错误分类统计`);
|
|
168
|
+
lines.push(`- A类错误: ${qr.errorClassStatistics.classACount} (${qr.errorClassProportions.classAProportion}%)`);
|
|
169
|
+
lines.push(`- B类错误: ${qr.errorClassStatistics.classBCount} (${qr.errorClassProportions.classBProportion}%)`);
|
|
170
|
+
lines.push(`- C类错误: ${qr.errorClassStatistics.classCCount} (${qr.errorClassProportions.classCProportion}%)`);
|
|
171
|
+
lines.push(`- D类错误: ${qr.errorClassStatistics.classDCount} (${qr.errorClassProportions.classDProportion}%)`);
|
|
172
|
+
lines.push(`- 违规总数: ${qr.errorClassStatistics.totalCount}`);
|
|
173
|
+
lines.push(`- ${qr.errorClassStatistics.policyBasis}`);
|
|
174
|
+
lines.push('');
|
|
175
|
+
lines.push(`## 政策依据汇总`);
|
|
176
|
+
for (const basis of qr.policyBasisSummary) {
|
|
177
|
+
lines.push(`- ${basis}`);
|
|
178
|
+
}
|
|
179
|
+
lines.push('');
|
|
180
|
+
return lines.join('\n');
|
|
181
|
+
}
|
|
139
182
|
}
|
|
140
183
|
//# sourceMappingURL=inventory-report-generator.js.map
|
|
@@ -12,6 +12,9 @@ export class PolicyBasisBuilder {
|
|
|
12
12
|
buildChangeTraceability() {
|
|
13
13
|
return `依据:${POLICY_STANDARD_NAME}变更管理要求`;
|
|
14
14
|
}
|
|
15
|
+
buildQualityElement(clause) {
|
|
16
|
+
return `依据:《测绘成果质量检查与验收》(GB/T 24356-2023)第${clause}条`;
|
|
17
|
+
}
|
|
15
18
|
buildSummary(policyBasisList) {
|
|
16
19
|
const unique = new Set();
|
|
17
20
|
for (const basis of policyBasisList) {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export class QualityElementScorer {
|
|
2
|
+
score(checkResults, config) {
|
|
3
|
+
const scores = [];
|
|
4
|
+
const deductionMap = {
|
|
5
|
+
A: config.errorClassThresholds.classAScoreDeduction,
|
|
6
|
+
B: config.errorClassThresholds.classBScoreDeduction,
|
|
7
|
+
C: config.errorClassThresholds.classCScoreDeduction,
|
|
8
|
+
D: config.errorClassThresholds.classDScoreDeduction,
|
|
9
|
+
};
|
|
10
|
+
for (const element of config.qualityElements.elements) {
|
|
11
|
+
const keywords = element.keywords ?? [];
|
|
12
|
+
let totalDeduction = 0;
|
|
13
|
+
for (const result of checkResults) {
|
|
14
|
+
if (keywords.some((kw) => result.checkName.includes(kw))) {
|
|
15
|
+
totalDeduction += deductionMap[result.errorClass];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const score = Math.max(0, 100 - totalDeduction);
|
|
19
|
+
scores.push({
|
|
20
|
+
elementName: element.elementName,
|
|
21
|
+
weight: element.weight,
|
|
22
|
+
score,
|
|
23
|
+
policyBasis: element.policyBasis,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
let totalScore = 0;
|
|
27
|
+
for (const s of scores) {
|
|
28
|
+
totalScore += s.weight * s.score;
|
|
29
|
+
}
|
|
30
|
+
return { scores, totalScore: Math.round(totalScore * 100) / 100 };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=quality-element-scorer.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { QualityCheckResult, ErrorClassStatistics, ErrorClassProportions } from './types.js';
|
|
2
|
+
export declare class ErrorClassifier {
|
|
3
|
+
classify(checkResults: QualityCheckResult[], policyBasis: string): ErrorClassStatistics;
|
|
4
|
+
calculateProportions(stats: ErrorClassStatistics): ErrorClassProportions;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=error-classifier.d.ts.map
|
package/lib/types/invariant.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare const PLUGIN_NAME = "@liuhange/dsh-construction-data-inventory";
|
|
|
2
2
|
export declare const DEFAULT_CLASSIFICATION_CONFIG_PATH = "config/classification-config.json";
|
|
3
3
|
export declare const DEFAULT_ENCODING_RULE_CONFIG_PATH = "config/encoding-rule-config.json";
|
|
4
4
|
export declare const DEFAULT_SOURCE_ADAPTER_CONFIG_PATH = "config/source-adapter-config.json";
|
|
5
|
+
export declare const DEFAULT_QUALITY_ELEMENT_CONFIG_PATH = "config/quality-element-config.json";
|
|
5
6
|
export declare const DEFAULT_OVERRIDE_LOG_PATH = "logs/override-records.log";
|
|
6
7
|
export declare const LEGAL_DISCLAIMER = "\u672C\u62A5\u544A\u7531\u8F85\u52A9\u76D8\u70B9\u5DE5\u5177\u751F\u6210\uFF0C\u4E0D\u66FF\u4EE3GB/T 51269\u6807\u51C6\u7684\u6B63\u5F0F\u5408\u89C4\u8BA4\u8BC1";
|
|
7
8
|
export declare const POLICY_STANDARD_NAME = "\u300A\u5EFA\u7B51\u4FE1\u606F\u6A21\u578B\u5206\u7C7B\u548C\u7F16\u7801\u6807\u51C6\u300B\uFF08GB/T 51269-2017\uFF09";
|
|
@@ -17,6 +17,11 @@ export declare class InventoryReportGenerator {
|
|
|
17
17
|
writeJson(report: InventoryReport, outputPathDir: string): string;
|
|
18
18
|
writeMarkdown(report: InventoryReport, outputPathDir: string): string;
|
|
19
19
|
exportLedger(assetList: UnifiedAssetItem[], outputPathDir: string): string;
|
|
20
|
+
writeQualityReport(report: InventoryReport, outputPathDir: string): {
|
|
21
|
+
jsonPath: string;
|
|
22
|
+
mdPath: string;
|
|
23
|
+
} | null;
|
|
20
24
|
private renderMarkdown;
|
|
25
|
+
private renderQualityMarkdown;
|
|
21
26
|
}
|
|
22
27
|
//# sourceMappingURL=inventory-report-generator.d.ts.map
|
|
@@ -3,6 +3,7 @@ export declare class PolicyBasisBuilder {
|
|
|
3
3
|
buildClassification(): string;
|
|
4
4
|
buildEncoding(): string;
|
|
5
5
|
buildChangeTraceability(): string;
|
|
6
|
+
buildQualityElement(clause: string): string;
|
|
6
7
|
buildSummary(policyBasisList: string[]): string[];
|
|
7
8
|
}
|
|
8
9
|
//# sourceMappingURL=policy-basis-builder.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { QualityCheckResult, QualityElementScore, QualityElementConfig } from './types.js';
|
|
2
|
+
export declare class QualityElementScorer {
|
|
3
|
+
score(checkResults: QualityCheckResult[], config: QualityElementConfig): {
|
|
4
|
+
scores: QualityElementScore[];
|
|
5
|
+
totalScore: number;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=quality-element-scorer.d.ts.map
|
package/lib/types/types.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface UnifiedAssetItem {
|
|
|
12
12
|
judgmentStatus: JudgmentStatus;
|
|
13
13
|
originalAssetCode?: string;
|
|
14
14
|
policyBasis?: string;
|
|
15
|
+
qualityScore?: QualityElementScore[];
|
|
15
16
|
}
|
|
16
17
|
export interface SourceConfigEntry {
|
|
17
18
|
type: string;
|
|
@@ -109,6 +110,7 @@ export interface ConfigVersionSet {
|
|
|
109
110
|
export interface ValidationError {
|
|
110
111
|
assetId: string;
|
|
111
112
|
errorMessage: string;
|
|
113
|
+
errorClass?: ErrorClass;
|
|
112
114
|
}
|
|
113
115
|
export interface InventoryReport {
|
|
114
116
|
reportId: string;
|
|
@@ -122,6 +124,7 @@ export interface InventoryReport {
|
|
|
122
124
|
policyBasisSummary: string[];
|
|
123
125
|
configVersions: ConfigVersionSet;
|
|
124
126
|
legalDisclaimer: string;
|
|
127
|
+
qualityReport?: QualityReport;
|
|
125
128
|
}
|
|
126
129
|
export interface ConfigLoadResult {
|
|
127
130
|
classificationConfig: ClassificationConfig;
|
|
@@ -154,4 +157,69 @@ export interface ToolError {
|
|
|
154
157
|
error: ErrorCode;
|
|
155
158
|
message: string;
|
|
156
159
|
}
|
|
160
|
+
export type ErrorClass = 'A' | 'B' | 'C' | 'D';
|
|
161
|
+
export interface QualityCheckResult {
|
|
162
|
+
checkName: string;
|
|
163
|
+
errorClass: ErrorClass;
|
|
164
|
+
objectId: string;
|
|
165
|
+
description: string;
|
|
166
|
+
policyBasis: string;
|
|
167
|
+
}
|
|
168
|
+
export interface QualityElementScore {
|
|
169
|
+
elementName: string;
|
|
170
|
+
weight: number;
|
|
171
|
+
score: number;
|
|
172
|
+
policyBasis: string;
|
|
173
|
+
}
|
|
174
|
+
export interface QualityElementConfigItem {
|
|
175
|
+
elementName: string;
|
|
176
|
+
weight: number;
|
|
177
|
+
keywords: string[];
|
|
178
|
+
policyBasis: string;
|
|
179
|
+
}
|
|
180
|
+
export interface QualityElementConfig {
|
|
181
|
+
version: string;
|
|
182
|
+
lastUpdated: string;
|
|
183
|
+
qualityElements: {
|
|
184
|
+
description: string;
|
|
185
|
+
elements: QualityElementConfigItem[];
|
|
186
|
+
policyBasis: string;
|
|
187
|
+
};
|
|
188
|
+
errorClassThresholds: {
|
|
189
|
+
description: string;
|
|
190
|
+
classAScoreDeduction: number;
|
|
191
|
+
classBScoreDeduction: number;
|
|
192
|
+
classCScoreDeduction: number;
|
|
193
|
+
classDScoreDeduction: number;
|
|
194
|
+
policyBasis: string;
|
|
195
|
+
};
|
|
196
|
+
qualityGradeThresholds: {
|
|
197
|
+
description: string;
|
|
198
|
+
excellentMinScore: number;
|
|
199
|
+
goodMinScore: number;
|
|
200
|
+
qualifiedMinScore: number;
|
|
201
|
+
policyBasis: string;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
export interface ErrorClassStatistics {
|
|
205
|
+
classACount: number;
|
|
206
|
+
classBCount: number;
|
|
207
|
+
classCCount: number;
|
|
208
|
+
classDCount: number;
|
|
209
|
+
totalCount: number;
|
|
210
|
+
policyBasis: string;
|
|
211
|
+
}
|
|
212
|
+
export interface ErrorClassProportions {
|
|
213
|
+
classAProportion: number;
|
|
214
|
+
classBProportion: number;
|
|
215
|
+
classCProportion: number;
|
|
216
|
+
classDProportion: number;
|
|
217
|
+
}
|
|
218
|
+
export interface QualityReport {
|
|
219
|
+
qualityElementScores: QualityElementScore[];
|
|
220
|
+
totalScore: number;
|
|
221
|
+
errorClassStatistics: ErrorClassStatistics;
|
|
222
|
+
errorClassProportions: ErrorClassProportions;
|
|
223
|
+
policyBasisSummary: string[];
|
|
224
|
+
}
|
|
157
225
|
//# sourceMappingURL=types.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,75 +1,95 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@liuhange/dsh-construction-data-inventory",
|
|
3
|
-
"description": "Construction
|
|
4
|
-
"version": "3.
|
|
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/construction-data-inventory"
|
|
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
|
-
"./src/*": "./src/*",
|
|
22
|
-
"./package.json": "./package.json"
|
|
23
|
-
},
|
|
24
|
-
"files": [
|
|
25
|
-
"lib/**/*.js",
|
|
26
|
-
"lib/types/**/*.d.ts",
|
|
27
|
-
"config/*.json",
|
|
28
|
-
"cordis.patch.yml"
|
|
29
|
-
],
|
|
30
|
-
"license": "MIT",
|
|
31
|
-
"scripts": {
|
|
32
|
-
"typecheck": "tsc --noEmit",
|
|
33
|
-
"test": "vitest run",
|
|
34
|
-
"build": "tsc"
|
|
35
|
-
},
|
|
36
|
-
"dependencies": {
|
|
37
|
-
"@liuhange/dsh-data-asset-shared": "^3.1.0"
|
|
38
|
-
},
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"@deepseek-ai/cordis": "^4.0.0",
|
|
41
|
-
"@deepseek-ai/dsh-tools": "0.0.1-rc.1"
|
|
42
|
-
},
|
|
43
|
-
"dsh": {
|
|
44
|
-
"bundle": {
|
|
45
|
-
"patch": "./cordis.patch.yml"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
"keywords": [
|
|
49
|
-
"deepseek-harness",
|
|
50
|
-
"dsh-plugin",
|
|
51
|
-
"data-asset",
|
|
52
|
-
"data-asset-inspector",
|
|
53
|
-
"shujintong",
|
|
54
|
-
"数据资产",
|
|
55
|
-
"construction-data-inventory",
|
|
56
|
-
"gbt-51269",
|
|
57
|
-
"ifc-model",
|
|
58
|
-
"classification-mapping",
|
|
59
|
-
"asset-code",
|
|
60
|
-
"change-traceability",
|
|
61
|
-
"建筑工程",
|
|
62
|
-
"数据资产盘点",
|
|
63
|
-
"分类编码",
|
|
64
|
-
"dsh",
|
|
65
|
-
"typescript",
|
|
66
|
-
"nodejs",
|
|
67
|
-
"automation",
|
|
68
|
-
"audit",
|
|
69
|
-
"compliance",
|
|
70
|
-
"data-governance",
|
|
71
|
-
"plugin",
|
|
72
|
-
"open-source"
|
|
73
|
-
|
|
74
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@liuhange/dsh-construction-data-inventory",
|
|
3
|
+
"description": "Construction data asset inventory plugin per GB/T 51269-2017 & GB/T 24356-2023: BIM/IFC classification mapping, asset code generation, change traceability, quality check for construction 央企",
|
|
4
|
+
"version": "3.2.1",
|
|
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/construction-data-inventory"
|
|
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
|
+
"./src/*": "./src/*",
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"lib/**/*.js",
|
|
26
|
+
"lib/types/**/*.d.ts",
|
|
27
|
+
"config/*.json",
|
|
28
|
+
"cordis.patch.yml"
|
|
29
|
+
],
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"scripts": {
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"build": "tsc"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@liuhange/dsh-data-asset-shared": "^3.1.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@deepseek-ai/cordis": "^4.0.0",
|
|
41
|
+
"@deepseek-ai/dsh-tools": "0.0.1-rc.1"
|
|
42
|
+
},
|
|
43
|
+
"dsh": {
|
|
44
|
+
"bundle": {
|
|
45
|
+
"patch": "./cordis.patch.yml"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"deepseek-harness",
|
|
50
|
+
"dsh-plugin",
|
|
51
|
+
"data-asset",
|
|
52
|
+
"data-asset-inspector",
|
|
53
|
+
"shujintong",
|
|
54
|
+
"数据资产",
|
|
55
|
+
"construction-data-inventory",
|
|
56
|
+
"gbt-51269",
|
|
57
|
+
"ifc-model",
|
|
58
|
+
"classification-mapping",
|
|
59
|
+
"asset-code",
|
|
60
|
+
"change-traceability",
|
|
61
|
+
"建筑工程",
|
|
62
|
+
"数据资产盘点",
|
|
63
|
+
"分类编码",
|
|
64
|
+
"dsh",
|
|
65
|
+
"typescript",
|
|
66
|
+
"nodejs",
|
|
67
|
+
"automation",
|
|
68
|
+
"audit",
|
|
69
|
+
"compliance",
|
|
70
|
+
"data-governance",
|
|
71
|
+
"plugin",
|
|
72
|
+
"open-source",
|
|
73
|
+
"GB/T 51269-2017",
|
|
74
|
+
"GB/T 24356-2023",
|
|
75
|
+
"BIM",
|
|
76
|
+
"IFC",
|
|
77
|
+
"建筑信息模型",
|
|
78
|
+
"building-information-modeling",
|
|
79
|
+
"asset-inventory",
|
|
80
|
+
"分类映射",
|
|
81
|
+
"资产编码",
|
|
82
|
+
"asset-coding",
|
|
83
|
+
"变更追溯",
|
|
84
|
+
"工程质量检查",
|
|
85
|
+
"construction-quality",
|
|
86
|
+
"隐蔽验收",
|
|
87
|
+
"工程量清单",
|
|
88
|
+
"签证变更",
|
|
89
|
+
"建筑央企",
|
|
90
|
+
"中铁一局",
|
|
91
|
+
"policy-basis",
|
|
92
|
+
"zero-hardcoding"
|
|
93
|
+
],
|
|
94
|
+
"homepage": "https://github.com/liuhange789/data-asset-inspector#readme"
|
|
75
95
|
}
|