dic-workflow-kit 1.1.1 → 1.1.3
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/.codex-plugin/plugin.json +1 -1
- package/CHANGELOG.md +80 -0
- package/INSTRUCTION.md +143 -0
- package/README.md +185 -17
- package/README.zh-CN.md +147 -16
- package/adapters/bdd/README.md +21 -0
- package/adapters/bitfun/README.md +40 -0
- package/agents/code-repairer.md +8 -1
- package/agents/contract-oracle.md +4 -1
- package/agents/final-reviewer.md +14 -1
- package/agents/flow-auditor.md +1 -1
- package/agents/impl-inspector.md +7 -1
- package/agents/profile-builder.md +1 -1
- package/agents/repair-planner.md +10 -1
- package/agents/spec-reader.md +4 -1
- package/agents/validation-runner.md +11 -1
- package/dist/dic-workflow-kit.mjs +14 -6
- package/package.json +3 -2
- package/schemas/final-result.schema.json +19 -1
- package/schemas/ontology-action-record.schema.json +62 -0
- package/schemas/ontology-action.schema.json +110 -0
- package/schemas/ontology-attestation.schema.json +187 -0
- package/schemas/ontology-patch.schema.json +48 -0
- package/schemas/ontology-snapshot.schema.json +252 -0
- package/schemas/project-profile.schema.json +2 -0
- package/skills/knowledge-bdd/SKILL.md +14 -2
- package/skills/knowledge-openspec/SKILL.md +2 -1
- package/skills/knowledge-repair-distill/SKILL.md +2 -1
- package/skills/workflow-core/SKILL.md +62 -1
- package/skills/workflow-intake/SKILL.md +2 -1
- package/skills/workflow-profile/SKILL.md +2 -1
- package/skills/workflow-repair/SKILL.md +2 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://dicworkflowkit.local/schemas/ontology-patch.schema.json",
|
|
4
|
+
"title": "DIC Ontology Patch",
|
|
5
|
+
"description": "Declarative semantic effects produced by one authorized ontology action.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"addObjects": {
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"$ref": "ontology-snapshot.schema.json#/$defs/object"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"addLinks": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"$ref": "ontology-snapshot.schema.json#/$defs/link"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"lifecycleTransitions": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"required": ["objectId", "to"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"objectId": { "type": "string" },
|
|
27
|
+
"to": {
|
|
28
|
+
"enum": [
|
|
29
|
+
"draft",
|
|
30
|
+
"confirmed",
|
|
31
|
+
"active",
|
|
32
|
+
"deprecated",
|
|
33
|
+
"superseded",
|
|
34
|
+
"rejected",
|
|
35
|
+
"open",
|
|
36
|
+
"approved",
|
|
37
|
+
"in_progress",
|
|
38
|
+
"resolved",
|
|
39
|
+
"blocked"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"additionalProperties": false
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"additionalProperties": false
|
|
48
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://dicworkflowkit.local/schemas/ontology-snapshot.schema.json",
|
|
4
|
+
"title": "DIC Ontology Snapshot",
|
|
5
|
+
"description": "Portable, file-backed semantic graph for design-implementation consistency.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"schema",
|
|
9
|
+
"version",
|
|
10
|
+
"snapshotId",
|
|
11
|
+
"projectRoot",
|
|
12
|
+
"objects",
|
|
13
|
+
"links",
|
|
14
|
+
"invariantResults"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"schema": { "const": "dic.ontology-snapshot.v1" },
|
|
18
|
+
"version": { "type": "string" },
|
|
19
|
+
"snapshotId": { "$ref": "#/$defs/stableId" },
|
|
20
|
+
"snapshotRevision": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
23
|
+
},
|
|
24
|
+
"projectRoot": { "type": "string" },
|
|
25
|
+
"objects": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": { "$ref": "#/$defs/object" }
|
|
28
|
+
},
|
|
29
|
+
"links": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"items": { "$ref": "#/$defs/link" }
|
|
32
|
+
},
|
|
33
|
+
"invariantResults": {
|
|
34
|
+
"type": "array",
|
|
35
|
+
"items": { "$ref": "#/$defs/invariantResult" }
|
|
36
|
+
},
|
|
37
|
+
"appliedActionIds": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"pattern": "^act-[a-zA-Z0-9._:-]+$"
|
|
42
|
+
},
|
|
43
|
+
"uniqueItems": true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"$defs": {
|
|
47
|
+
"stableId": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"pattern": "^[a-z][a-z0-9-]*-[a-zA-Z0-9._:-]+$"
|
|
50
|
+
},
|
|
51
|
+
"lifecycle": {
|
|
52
|
+
"enum": [
|
|
53
|
+
"draft",
|
|
54
|
+
"confirmed",
|
|
55
|
+
"active",
|
|
56
|
+
"deprecated",
|
|
57
|
+
"superseded",
|
|
58
|
+
"rejected",
|
|
59
|
+
"open",
|
|
60
|
+
"approved",
|
|
61
|
+
"in_progress",
|
|
62
|
+
"resolved",
|
|
63
|
+
"blocked"
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
"provenance": {
|
|
67
|
+
"type": "object",
|
|
68
|
+
"required": ["source", "sourceRevision", "createdBy"],
|
|
69
|
+
"properties": {
|
|
70
|
+
"source": { "type": "string", "minLength": 1 },
|
|
71
|
+
"sourceLocator": { "type": "string" },
|
|
72
|
+
"sourceRevision": { "type": "string", "minLength": 1 },
|
|
73
|
+
"contentHash": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
76
|
+
},
|
|
77
|
+
"createdBy": { "type": "string", "minLength": 1 },
|
|
78
|
+
"runId": { "type": "string" }
|
|
79
|
+
},
|
|
80
|
+
"additionalProperties": false
|
|
81
|
+
},
|
|
82
|
+
"object": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"required": ["id", "type", "lifecycle", "properties", "provenance"],
|
|
85
|
+
"properties": {
|
|
86
|
+
"id": { "$ref": "#/$defs/stableId" },
|
|
87
|
+
"type": {
|
|
88
|
+
"enum": [
|
|
89
|
+
"Project",
|
|
90
|
+
"DesignSource",
|
|
91
|
+
"Change",
|
|
92
|
+
"Requirement",
|
|
93
|
+
"Scenario",
|
|
94
|
+
"ImplementationUnit",
|
|
95
|
+
"Gap",
|
|
96
|
+
"RepairAction",
|
|
97
|
+
"Validation",
|
|
98
|
+
"Evidence",
|
|
99
|
+
"AgentRun",
|
|
100
|
+
"Decision",
|
|
101
|
+
"Risk"
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"lifecycle": { "$ref": "#/$defs/lifecycle" },
|
|
105
|
+
"interfaces": {
|
|
106
|
+
"type": "array",
|
|
107
|
+
"items": {
|
|
108
|
+
"enum": [
|
|
109
|
+
"SourceBacked",
|
|
110
|
+
"Verifiable",
|
|
111
|
+
"Versioned",
|
|
112
|
+
"GovernedMutation",
|
|
113
|
+
"ContentAddressed"
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
"uniqueItems": true
|
|
117
|
+
},
|
|
118
|
+
"properties": {
|
|
119
|
+
"type": "object",
|
|
120
|
+
"additionalProperties": true
|
|
121
|
+
},
|
|
122
|
+
"provenance": { "$ref": "#/$defs/provenance" }
|
|
123
|
+
},
|
|
124
|
+
"allOf": [
|
|
125
|
+
{
|
|
126
|
+
"if": {
|
|
127
|
+
"properties": { "type": { "const": "Evidence" } },
|
|
128
|
+
"required": ["type"]
|
|
129
|
+
},
|
|
130
|
+
"then": {
|
|
131
|
+
"properties": {
|
|
132
|
+
"interfaces": {
|
|
133
|
+
"contains": { "const": "ContentAddressed" }
|
|
134
|
+
},
|
|
135
|
+
"properties": {
|
|
136
|
+
"required": ["path"],
|
|
137
|
+
"properties": {
|
|
138
|
+
"path": { "type": "string", "minLength": 1 }
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"provenance": {
|
|
142
|
+
"required": ["contentHash"]
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"if": {
|
|
149
|
+
"properties": { "type": { "const": "ImplementationUnit" } },
|
|
150
|
+
"required": ["type"]
|
|
151
|
+
},
|
|
152
|
+
"then": {
|
|
153
|
+
"properties": {
|
|
154
|
+
"interfaces": {
|
|
155
|
+
"contains": { "const": "ContentAddressed" }
|
|
156
|
+
},
|
|
157
|
+
"properties": {
|
|
158
|
+
"required": ["path"],
|
|
159
|
+
"properties": {
|
|
160
|
+
"path": { "type": "string", "minLength": 1 }
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"provenance": {
|
|
164
|
+
"required": ["contentHash"]
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"if": {
|
|
171
|
+
"properties": { "type": { "const": "Validation" } },
|
|
172
|
+
"required": ["type"]
|
|
173
|
+
},
|
|
174
|
+
"then": {
|
|
175
|
+
"properties": {
|
|
176
|
+
"properties": {
|
|
177
|
+
"required": ["status", "executedAt", "inputs"],
|
|
178
|
+
"properties": {
|
|
179
|
+
"status": { "enum": ["PASS", "FAIL", "BLOCKED"] },
|
|
180
|
+
"executedAt": { "type": "string", "format": "date-time" },
|
|
181
|
+
"inputs": {
|
|
182
|
+
"type": "array",
|
|
183
|
+
"items": { "$ref": "#/$defs/validationInput" }
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"additionalProperties": false
|
|
192
|
+
},
|
|
193
|
+
"validationInput": {
|
|
194
|
+
"type": "object",
|
|
195
|
+
"required": ["objectId", "contentHash"],
|
|
196
|
+
"properties": {
|
|
197
|
+
"objectId": { "$ref": "#/$defs/stableId" },
|
|
198
|
+
"contentHash": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"additionalProperties": false
|
|
204
|
+
},
|
|
205
|
+
"link": {
|
|
206
|
+
"type": "object",
|
|
207
|
+
"required": ["id", "type", "from", "to", "lifecycle", "provenance"],
|
|
208
|
+
"properties": {
|
|
209
|
+
"id": { "$ref": "#/$defs/stableId" },
|
|
210
|
+
"type": {
|
|
211
|
+
"enum": [
|
|
212
|
+
"CONTAINS",
|
|
213
|
+
"PROPOSES",
|
|
214
|
+
"DERIVED_FROM",
|
|
215
|
+
"REFINES",
|
|
216
|
+
"IMPLEMENTED_BY",
|
|
217
|
+
"VERIFIED_BY",
|
|
218
|
+
"VIOLATES",
|
|
219
|
+
"RESOLVES",
|
|
220
|
+
"PRODUCES",
|
|
221
|
+
"SUPPORTS",
|
|
222
|
+
"CONTRADICTS",
|
|
223
|
+
"REMAINS_AFTER",
|
|
224
|
+
"SUPERSEDES"
|
|
225
|
+
]
|
|
226
|
+
},
|
|
227
|
+
"from": { "$ref": "#/$defs/stableId" },
|
|
228
|
+
"to": { "$ref": "#/$defs/stableId" },
|
|
229
|
+
"lifecycle": { "$ref": "#/$defs/lifecycle" },
|
|
230
|
+
"provenance": { "$ref": "#/$defs/provenance" }
|
|
231
|
+
},
|
|
232
|
+
"additionalProperties": false
|
|
233
|
+
},
|
|
234
|
+
"invariantResult": {
|
|
235
|
+
"type": "object",
|
|
236
|
+
"required": ["id", "status", "severity", "message", "objectIds"],
|
|
237
|
+
"properties": {
|
|
238
|
+
"id": { "type": "string", "minLength": 1 },
|
|
239
|
+
"status": { "enum": ["PASS", "FAIL", "NOT_APPLICABLE"] },
|
|
240
|
+
"severity": { "enum": ["info", "warning", "blocking"] },
|
|
241
|
+
"message": { "type": "string" },
|
|
242
|
+
"objectIds": {
|
|
243
|
+
"type": "array",
|
|
244
|
+
"items": { "$ref": "#/$defs/stableId" },
|
|
245
|
+
"uniqueItems": true
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"additionalProperties": false
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
"additionalProperties": false
|
|
252
|
+
}
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
"projectRoot": { "type": "string" },
|
|
11
11
|
"projectTypes": { "type": "array", "items": { "type": "string" } },
|
|
12
12
|
"adapters": { "type": "array", "items": { "type": "string" } },
|
|
13
|
+
"bddSources": { "type": "array", "items": { "type": "string" } },
|
|
14
|
+
"availableBddSources": { "type": "array", "items": { "type": "string" } },
|
|
13
15
|
"designEntry": {
|
|
14
16
|
"type": "object",
|
|
15
17
|
"required": ["type", "changeId", "lifecycle", "changeRoot", "documents", "deltaSpecs", "baselineSpecs"],
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: knowledge-bdd
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
description: Interpret or derive Gherkin/BDD Feature, Background, Scenario, Scenario Outline, Examples, and Given-When-Then acceptance contracts when .feature files or confirmed behavioral rules are in scope.
|
|
4
|
+
metadata:
|
|
5
|
+
version: 1.1.3
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Knowledge: BDD
|
|
@@ -20,3 +21,14 @@ For every confirmed rule, consider:
|
|
|
20
21
|
- concurrency or ordering
|
|
21
22
|
|
|
22
23
|
BDD scenarios are acceptance criteria. They are not a license to invent behavior outside source truth.
|
|
24
|
+
|
|
25
|
+
When `.feature` files are mounted in the ontology:
|
|
26
|
+
|
|
27
|
+
- treat `Feature` as the parent Requirement
|
|
28
|
+
- preserve inherited Background clauses
|
|
29
|
+
- preserve Scenario Outline Examples without expanding invented cases
|
|
30
|
+
- use `DERIVED_FROM` and `REFINES` for source and parent traceability
|
|
31
|
+
- add `VERIFIED_BY` only after current executable validation produces evidence
|
|
32
|
+
|
|
33
|
+
Use `ontology-explain --id <scenario-id>` when a scenario's source, parent,
|
|
34
|
+
implementation, validation, or evidence chain is unclear.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: knowledge-openspec
|
|
3
|
-
version: 1.1.1
|
|
4
3
|
description: OpenSpec knowledge pack for proposals, specs, scenarios, tasks, changes, archived capabilities, validation, and design-to-implementation mapping.
|
|
4
|
+
metadata:
|
|
5
|
+
version: 1.1.3
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Knowledge: OpenSpec
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: knowledge-repair-distill
|
|
3
|
-
version: 1.1.1
|
|
4
3
|
description: Generic repair convergence guidance, gap taxonomy, model steering hints, and validation gates for design-implementation consistency work.
|
|
4
|
+
metadata:
|
|
5
|
+
version: 1.1.3
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Knowledge: Repair Distill
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: workflow-core
|
|
3
|
-
version: 1.1.1
|
|
4
3
|
description: Core Design-Implementation Consistency workflow contract, evidence model, handoff rules, and final output expectations.
|
|
4
|
+
metadata:
|
|
5
|
+
version: 1.1.3
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
# Workflow Core
|
|
@@ -15,11 +16,71 @@ Principles:
|
|
|
15
16
|
- Every repair must trace to a source-backed obligation.
|
|
16
17
|
- Subagents are useful only when they produce consumed evidence.
|
|
17
18
|
- Final success requires validation evidence, residual-risk classification, and final artifacts.
|
|
19
|
+
- `reports/ontology-snapshot.json` is the semantic source of truth for objects, links, lifecycle, and provenance.
|
|
20
|
+
- Reports summarize the ontology; prose must not silently create or override semantic facts.
|
|
21
|
+
|
|
22
|
+
Ontology operating model:
|
|
23
|
+
|
|
24
|
+
- `spec-reader` and `contract-oracle` establish source-backed requirements and scenarios.
|
|
25
|
+
- `impl-inspector` records existing code with `ObserveImplementation` or opens gaps.
|
|
26
|
+
- `repair-planner` proposes typed `RepairAction` objects.
|
|
27
|
+
- `code-repairer` executes only approved, path-bounded actions.
|
|
28
|
+
- `validation-runner` attaches `Validation` and `Evidence`.
|
|
29
|
+
- `final-reviewer` computes PASS from invariants instead of agent confidence.
|
|
30
|
+
|
|
31
|
+
Use `schemas/ontology-action.schema.json` for auditable mutations. Every action
|
|
32
|
+
records actor, targets, preconditions, postconditions, allowed paths, and evidence.
|
|
33
|
+
Set `expectedSnapshotRevision` when authoring an action.
|
|
34
|
+
When the bundled CLI is available, run `action-check` before execution and
|
|
35
|
+
`action-record` after the action reaches its recorded state. Never reuse an
|
|
36
|
+
action ID with different content.
|
|
37
|
+
|
|
38
|
+
Every completed action includes `parameters.ontologyPatch`. Use only the object,
|
|
39
|
+
link, and lifecycle effects permitted for that action type. After recording,
|
|
40
|
+
run `ontology-reconcile`; do not mutate the snapshot directly. Reconciliation is
|
|
41
|
+
idempotent and must preserve all structural invariants.
|
|
42
|
+
Reconcile each new record before recording the next action. New ledger entries
|
|
43
|
+
form a sequence-numbered hash chain and bind the Snapshot revision used during
|
|
44
|
+
recording; run `ontology-ledger-check` before final review.
|
|
45
|
+
|
|
46
|
+
Treat validation as successful only when its lifecycle is current and
|
|
47
|
+
`properties.status` is `PASS`. Every Validation records `executedAt` and an
|
|
48
|
+
`inputs` entry containing the object ID and current SHA-256 for every consumed
|
|
49
|
+
DesignSource and ImplementationUnit. Run `ontology-validation-check`; an old
|
|
50
|
+
test result must never approve newer design or implementation bytes.
|
|
51
|
+
Attach each required Evidence object to a real
|
|
52
|
+
project-relative artifact with `provenance.contentHash` and the
|
|
53
|
+
`ContentAddressed` interface. Run `ontology-evidence-check` before attestation.
|
|
54
|
+
|
|
55
|
+
Treat implementation as current only when its `ImplementationUnit` has a current
|
|
56
|
+
lifecycle and a real project-relative file whose SHA-256 matches provenance.
|
|
57
|
+
Use `ObserveImplementation` for existing code and `ApplyRepair` only for code
|
|
58
|
+
created or changed by an approved repair. Run `ontology-implementation-check`
|
|
59
|
+
before attestation.
|
|
60
|
+
|
|
61
|
+
Treat `snapshotRevision` as an integrity boundary. Before final review, run
|
|
62
|
+
`ontology-drift`; tracked source changes block PASS. Use `ontology-plan` to
|
|
63
|
+
convert design, implementation, and Evidence integrity issues into the smallest
|
|
64
|
+
recommended Agent-stage rerun.
|
|
65
|
+
|
|
66
|
+
Final prose is a view, not an authority. Generate `reports/ontology-report.md`
|
|
67
|
+
with `ontology-report`, create `reports/ontology-attestation.json` with
|
|
68
|
+
`ontology-attest`, and run `ontology-attestation-check` immediately before
|
|
69
|
+
publishing the result. The attestation binds the terminal status to the exact
|
|
70
|
+
snapshot revision, action-ledger hash, design-source hashes, Evidence artifact
|
|
71
|
+
hashes, ImplementationUnit hashes, and evaluated invariants.
|
|
72
|
+
It also binds the Validation-to-input causality inventory.
|
|
73
|
+
Persist its `contentHash` outside the evidence directory, then verify it with
|
|
74
|
+
`--expected-hash`.
|
|
18
75
|
|
|
19
76
|
Required durable outputs:
|
|
20
77
|
|
|
21
78
|
```text
|
|
22
79
|
reports/project-profile.json
|
|
80
|
+
reports/ontology-snapshot.json
|
|
81
|
+
reports/ontology-actions.jsonl
|
|
82
|
+
reports/ontology-report.md
|
|
83
|
+
reports/ontology-attestation.json
|
|
23
84
|
reports/final-consistency-report.md
|
|
24
85
|
reports/FINAL_RESULT.json
|
|
25
86
|
result/output.md
|