@soddong/agentic-domain-artifact-standard 0.11.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/.tbls.yml +54 -0
- package/CHANGELOG.md +94 -0
- package/README.md +386 -0
- package/dist/database.d.ts +8 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +76 -0
- package/dist/database.js.map +1 -0
- package/dist/fixtures.d.ts +11 -0
- package/dist/fixtures.d.ts.map +1 -0
- package/dist/fixtures.js +537 -0
- package/dist/fixtures.js.map +1 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +213 -0
- package/dist/index.js.map +1 -0
- package/dist/repositories.d.ts +46 -0
- package/dist/repositories.d.ts.map +1 -0
- package/dist/repositories.js +730 -0
- package/dist/repositories.js.map +1 -0
- package/dist/seed-apply.d.ts +20 -0
- package/dist/seed-apply.d.ts.map +1 -0
- package/dist/seed-apply.js +198 -0
- package/dist/seed-apply.js.map +1 -0
- package/dist/service.d.ts +40 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +105 -0
- package/dist/service.js.map +1 -0
- package/dist/types.d.ts +499 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/docs/build.md +27 -0
- package/docs/configuration.md +5 -0
- package/docs/delivery.md +26 -0
- package/docs/operations.md +28 -0
- package/docs/publishing.md +43 -0
- package/docs/schema/generated/README.md +38 -0
- package/docs/schema/generated/artifact_standard_blueprint_nodes.md +137 -0
- package/docs/schema/generated/artifact_standard_blueprint_nodes.svg +88 -0
- package/docs/schema/generated/artifact_standard_code_groups.md +70 -0
- package/docs/schema/generated/artifact_standard_code_groups.svg +49 -0
- package/docs/schema/generated/artifact_standard_codes.md +88 -0
- package/docs/schema/generated/artifact_standard_codes.svg +49 -0
- package/docs/schema/generated/artifact_standard_component_bindings.md +118 -0
- package/docs/schema/generated/artifact_standard_component_bindings.svg +73 -0
- package/docs/schema/generated/artifact_standard_components.md +114 -0
- package/docs/schema/generated/artifact_standard_components.svg +73 -0
- package/docs/schema/generated/artifact_standard_diagram_policies.md +99 -0
- package/docs/schema/generated/artifact_standard_diagram_policies.svg +49 -0
- package/docs/schema/generated/artifact_standard_document_blueprints.md +101 -0
- package/docs/schema/generated/artifact_standard_document_blueprints.svg +128 -0
- package/docs/schema/generated/artifact_standard_document_component_relations.md +118 -0
- package/docs/schema/generated/artifact_standard_document_component_relations.svg +87 -0
- package/docs/schema/generated/artifact_standard_document_components.md +148 -0
- package/docs/schema/generated/artifact_standard_document_components.svg +139 -0
- package/docs/schema/generated/artifact_standard_figure_policies.md +99 -0
- package/docs/schema/generated/artifact_standard_figure_policies.svg +49 -0
- package/docs/schema/generated/artifact_standard_generated_output_links.md +144 -0
- package/docs/schema/generated/artifact_standard_generated_output_links.svg +57 -0
- package/docs/schema/generated/artifact_standard_physical_structure_policies.md +124 -0
- package/docs/schema/generated/artifact_standard_physical_structure_policies.svg +78 -0
- package/docs/schema/generated/artifact_standard_schema_migrations.md +52 -0
- package/docs/schema/generated/artifact_standard_schema_migrations.svg +27 -0
- package/docs/schema/generated/artifact_standard_source_mappings.md +120 -0
- package/docs/schema/generated/artifact_standard_source_mappings.svg +49 -0
- package/docs/schema/generated/artifact_standard_standards.md +102 -0
- package/docs/schema/generated/artifact_standard_standards.svg +313 -0
- package/docs/schema/generated/artifact_standard_table_column_schemas.md +147 -0
- package/docs/schema/generated/artifact_standard_table_column_schemas.svg +52 -0
- package/docs/schema/generated/artifact_standard_table_schemas.md +99 -0
- package/docs/schema/generated/artifact_standard_table_schemas.svg +71 -0
- package/docs/schema/generated/artifact_standard_template_slots.md +143 -0
- package/docs/schema/generated/artifact_standard_template_slots.svg +88 -0
- package/docs/schema/generated/artifact_standard_validation_rule_set_rules.md +128 -0
- package/docs/schema/generated/artifact_standard_validation_rule_set_rules.svg +52 -0
- package/docs/schema/generated/artifact_standard_validation_rule_sets.md +91 -0
- package/docs/schema/generated/artifact_standard_validation_rule_sets.svg +71 -0
- package/docs/schema/generated/schema.json +4230 -0
- package/docs/schema/generated/schema.mmd +327 -0
- package/docs/schema/generated/schema.svg +510 -0
- package/docs/usage.md +197 -0
- package/package.json +30 -0
- package/src/database/migrations/0001_artifact_standard_base.sql +1295 -0
package/docs/usage.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Usage
|
|
2
|
+
|
|
3
|
+
이 패키지는 산출물 유형별 `Artifact Standard` 정보, aggregate 기반 document import profile helper, legacy document import profile fixture, SQLite repository/service를 제공한다.
|
|
4
|
+
|
|
5
|
+
`Artifact Standard`는 템플릿, 가이드, 예시, 문서 blueprint, document component, physical structure policy, block/table schema, validation rule을 묶은 산출물 작성 표준이다. `Package`는 npm 배포 단위를 의미할 때만 사용하고, 도메인 개념에는 `Artifact Standard Package` 대신 `Artifact Standard`를 사용한다.
|
|
6
|
+
|
|
7
|
+
현재 API에는 호환성을 위해 `getArtifactStandardPackageInfo()`, `artifactStandardPackageCode` 명명이 남아 있다. 신규 호출은 `getArtifactStandardInfo()`, `artifactStandardCode` 계열을 우선 사용한다.
|
|
8
|
+
|
|
9
|
+
## Profile 용어 구분
|
|
10
|
+
|
|
11
|
+
`ArtifactStandardProfile`은 산출물 표준 자체의 복수 작성 모드 후보 모델이며, 1차 DB 모델에서는 제외되어 있다.
|
|
12
|
+
|
|
13
|
+
반면 다음 profile은 현재 사용한다.
|
|
14
|
+
|
|
15
|
+
| 용어 | 의미 |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `DocumentImportProfile` | `@soddong/agentic-domain-document` importer에 전달하는 외부 contract |
|
|
18
|
+
| validation provider profile | `@soddong/agentic-contract-validation`의 rule bundle/provider profile |
|
|
19
|
+
|
|
20
|
+
따라서 `DocumentImportProfile` helper와 validation provider manifest는 `ArtifactStandardProfile` 도입이 아니라 외부 contract 연계 기능이다.
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import {
|
|
24
|
+
createDocumentImportProfileFromArtifactStandardAggregate,
|
|
25
|
+
getArtifactStandardDocumentProfile,
|
|
26
|
+
getArtifactStandardInfo
|
|
27
|
+
} from "@soddong/agentic-domain-artifact-standard";
|
|
28
|
+
|
|
29
|
+
const info = getArtifactStandardInfo();
|
|
30
|
+
console.log(info.name);
|
|
31
|
+
|
|
32
|
+
const profile = getArtifactStandardDocumentProfile({
|
|
33
|
+
artifactStandardCode: "architecture_specification"
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
console.log(profile.documentTypeCode);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`getArtifactStandardDocumentProfile()`은 호환성을 위해 유지되는 legacy fixture provider다. 신규 산출물 표준은 DB aggregate에서 `DocumentImportProfile`을 도출하는 방식을 우선한다.
|
|
40
|
+
|
|
41
|
+
## SQLite Service
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import {
|
|
45
|
+
ArtifactStandardService,
|
|
46
|
+
openArtifactStandardDatabase
|
|
47
|
+
} from "@soddong/agentic-domain-artifact-standard";
|
|
48
|
+
|
|
49
|
+
const db = openArtifactStandardDatabase();
|
|
50
|
+
const service = new ArtifactStandardService(db);
|
|
51
|
+
|
|
52
|
+
const standard = service.createArtifactStandard({
|
|
53
|
+
artifactStandardCode: "business_process_definition",
|
|
54
|
+
artifactStandardVersion: "1.0.0",
|
|
55
|
+
artifactStandardName: "Business Process Definition"
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Aggregate 조회
|
|
60
|
+
|
|
61
|
+
`getArtifactStandardAggregateByCodeVersion()`은 standard, components, blueprints, template slots, document components, component relations, physical structure policies, table schemas, columns, validation rule sets, source mappings를 한 번에 반환한다.
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
const aggregate = service.getArtifactStandardAggregateByCodeVersion(
|
|
65
|
+
"business_process_definition",
|
|
66
|
+
"1.0.0"
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
console.log(aggregate?.documentComponents);
|
|
70
|
+
console.log(aggregate?.physicalStructurePolicies);
|
|
71
|
+
console.log(aggregate?.tableSchemas[0]?.columns);
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Aggregate에서 document import profile을 생성할 수 있다.
|
|
75
|
+
|
|
76
|
+
```ts
|
|
77
|
+
if (aggregate !== undefined) {
|
|
78
|
+
const profile = createDocumentImportProfileFromArtifactStandardAggregate(aggregate);
|
|
79
|
+
console.log(profile.profileCode);
|
|
80
|
+
console.log(profile.defaultTocLevelLimit);
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
이 helper는 `DocumentBlueprint`, `TemplateSlot`, `TableSchema`, `ValidationRuleSet`을 기반으로 `@soddong/agentic-domain-document`의 `DocumentImportProfile`을 생성한다.
|
|
85
|
+
|
|
86
|
+
## Fixture 사용 예시
|
|
87
|
+
|
|
88
|
+
Business Process Definition과 Information Object Definition fixture는 선행/후행 산출물 context 조립 검증에 사용할 수 있다.
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import {
|
|
92
|
+
createDocumentImportProfileFromArtifactStandardAggregate,
|
|
93
|
+
seedBusinessProcessDefinitionArtifactStandard,
|
|
94
|
+
seedInformationObjectDefinitionArtifactStandard
|
|
95
|
+
} from "@soddong/agentic-domain-artifact-standard";
|
|
96
|
+
|
|
97
|
+
const sourceFixture = seedBusinessProcessDefinitionArtifactStandard(service);
|
|
98
|
+
const targetFixture = seedInformationObjectDefinitionArtifactStandard(service);
|
|
99
|
+
|
|
100
|
+
const sourceProfile = createDocumentImportProfileFromArtifactStandardAggregate(sourceFixture.aggregate, {
|
|
101
|
+
blueprintCode: "main_document"
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const targetProfile = createDocumentImportProfileFromArtifactStandardAggregate(targetFixture.aggregate, {
|
|
105
|
+
blueprintCode: "main_document"
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
console.log(sourceProfile.profileCode); // business_process_definition.main_document
|
|
109
|
+
console.log(targetProfile.profileCode); // information_object_definition.main_document
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Document Component 사용
|
|
113
|
+
|
|
114
|
+
`DocumentComponent`는 실제 산출물 문서의 본문, 부록, 보조자료 같은 논리 구성 단위를 정의한다. `Component`가 개념, 서식, 가이드, 예시 같은 작성 참고 resource라면, `DocumentComponent`는 산출물 자체의 구성 단위다.
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
const main = service.addDocumentComponent({
|
|
118
|
+
artifactStandardId: standard.artifactStandardId,
|
|
119
|
+
documentComponentCode: "main_document",
|
|
120
|
+
documentComponentName: "Business Process Definition Main Document",
|
|
121
|
+
componentRoleCode: "MAIN",
|
|
122
|
+
componentTypeCode: "MAIN_DOCUMENT",
|
|
123
|
+
logicalLevel: 0
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const appendix = service.addDocumentComponent({
|
|
127
|
+
artifactStandardId: standard.artifactStandardId,
|
|
128
|
+
parentDocumentComponentId: main.documentComponentId,
|
|
129
|
+
documentComponentCode: "appendix_l3_process",
|
|
130
|
+
documentComponentName: "L3 Process Appendix",
|
|
131
|
+
componentRoleCode: "APPENDIX",
|
|
132
|
+
componentTypeCode: "L3_PROCESS_APPENDIX",
|
|
133
|
+
logicalLevel: 1,
|
|
134
|
+
isRepeatable: true
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
service.addDocumentComponentRelation({
|
|
138
|
+
artifactStandardId: standard.artifactStandardId,
|
|
139
|
+
sourceDocumentComponentId: main.documentComponentId,
|
|
140
|
+
targetDocumentComponentId: appendix.documentComponentId,
|
|
141
|
+
relationTypeCode: "CONTAINS",
|
|
142
|
+
isRequired: true
|
|
143
|
+
});
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
물리 파일/폴더 구조는 component 계층과 별도로 `PhysicalStructurePolicy`로 정의한다.
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
service.addPhysicalStructurePolicy({
|
|
150
|
+
artifactStandardId: standard.artifactStandardId,
|
|
151
|
+
policyCode: "grouped_by_parent",
|
|
152
|
+
policyName: "Group Appendix Documents By Parent Component",
|
|
153
|
+
strategyCode: "GROUPED_BY_PARENT",
|
|
154
|
+
relationSourceCode: "DB",
|
|
155
|
+
pathPattern: "business-process-definition/{parentComponentCode}/{documentComponentCode}.md",
|
|
156
|
+
isDefault: true
|
|
157
|
+
});
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Methodology 연결 사용 예시
|
|
161
|
+
|
|
162
|
+
`artifact-standard`는 Stage/Activity를 소유하지 않는다. Stage 안에서 어떤 산출물을 만들지, 선행 산출물이 후행 산출물에 어떻게 handoff되는지는 `@soddong/agentic-domain-methodology`가 정의한다.
|
|
163
|
+
|
|
164
|
+
예를 들어 비즈니스 프로세스 정의서가 본문과 부록들로 나뉘면 다음처럼 연결한다.
|
|
165
|
+
|
|
166
|
+
| Methodology 요소 | Artifact Standard 참조 |
|
|
167
|
+
| --- | --- |
|
|
168
|
+
| 본문 작성 Activity output | `business_process_definition@1.0.0` + `main_document` |
|
|
169
|
+
| L3 프로세스 부록 작성 Activity output | `business_process_definition@1.0.0` + `appendix_l3_process` |
|
|
170
|
+
| 시나리오 부록 작성 Activity output | `business_process_definition@1.0.0` + `appendix_scenario` |
|
|
171
|
+
| L4 상세 부록 작성 Activity output | `business_process_definition@1.0.0` + `appendix_l4_detail` |
|
|
172
|
+
| 종합/정제 Activity input | 위 4개 component 산출물 |
|
|
173
|
+
| 후행 정보 객체 정의 Stage handoff | 검토/승인된 비즈니스 프로세스 정의서 산출물 묶음 |
|
|
174
|
+
|
|
175
|
+
작성 과정의 세부 절차는 Step으로 해석할 수 있지만, 현재 MVP에서는 Step 실행 모델까지 강제하지 않는다.
|
|
176
|
+
|
|
177
|
+
## Validation Provider Manifest
|
|
178
|
+
|
|
179
|
+
`artifact_standard_validation_rule_sets`에 저장된 rule set은 `@soddong/agentic-contract-validation`의 `ValidationProviderManifest`로 export할 수 있다.
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
const manifest = service.exportValidationProviderManifest(standard.artifactStandardId);
|
|
183
|
+
console.log(manifest.profiles[0].rules);
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
`validationTypeCode`, `executionModeCode`, `severityCode`는 service 저장 시 `@soddong/agentic-contract-validation` code guard로 검증된다.
|
|
187
|
+
|
|
188
|
+
## Fixture Helper
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
import { seedBusinessProcessDefinitionArtifactStandard } from "@soddong/agentic-domain-artifact-standard";
|
|
192
|
+
|
|
193
|
+
const fixture = seedBusinessProcessDefinitionArtifactStandard(service);
|
|
194
|
+
console.log(fixture.aggregate.standard.artifactStandardCode);
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
fixture helper는 사용성 테스트와 integration test를 위한 축소 샘플이며, 참조 데이터 최종 이행으로 간주하지 않는다.
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@soddong/agentic-domain-artifact-standard",
|
|
3
|
+
"version": "0.11.0",
|
|
4
|
+
"description": "Agentic Platform artifact standard domain package",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md",
|
|
12
|
+
"CHANGELOG.md",
|
|
13
|
+
".tbls.yml",
|
|
14
|
+
"docs",
|
|
15
|
+
"src/database/migrations"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc -p tsconfig.json",
|
|
19
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
20
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"better-sqlite3": "^12.11.1",
|
|
24
|
+
"@soddong/agentic-contract-validation": "^0.2.0",
|
|
25
|
+
"@soddong/agentic-domain-document": "^0.7.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/better-sqlite3": "^7.6.13"
|
|
29
|
+
}
|
|
30
|
+
}
|