@decantr/core 2.0.0 → 3.0.0-next.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/package.json CHANGED
@@ -1,7 +1,20 @@
1
1
  {
2
2
  "name": "@decantr/core",
3
- "version": "2.0.0",
4
- "description": "Decantr core — execution-pack compiler primitives and shared Decantr utilities",
3
+ "version": "3.0.0-next.0",
4
+ "description": "Decantr core — execution-pack, typed graph, and Contract capsule primitives",
5
+ "keywords": [
6
+ "decantr",
7
+ "decantr-ai",
8
+ "ai-coding",
9
+ "frontend-governance",
10
+ "ai-frontend-governance",
11
+ "design-contracts",
12
+ "typed-graph",
13
+ "contract-capsule",
14
+ "execution-packs",
15
+ "ui-generation",
16
+ "scaffolding"
17
+ ],
5
18
  "author": "Decantr AI",
6
19
  "license": "MIT",
7
20
  "bugs": {
@@ -29,7 +42,12 @@
29
42
  "./schema/review-pack.v1.json": "./schema/review-pack.v1.json",
30
43
  "./schema/pack-manifest.v1.json": "./schema/pack-manifest.v1.json",
31
44
  "./schema/execution-pack-bundle.v1.json": "./schema/execution-pack-bundle.v1.json",
32
- "./schema/selected-execution-pack.v1.json": "./schema/selected-execution-pack.v1.json"
45
+ "./schema/selected-execution-pack.v1.json": "./schema/selected-execution-pack.v1.json",
46
+ "./schema/graph.common.v1.json": "./schema/graph.common.v1.json",
47
+ "./schema/graph-snapshot.v1.json": "./schema/graph-snapshot.v1.json",
48
+ "./schema/graph-manifest.v1.json": "./schema/graph-manifest.v1.json",
49
+ "./schema/graph-diff.v1.json": "./schema/graph-diff.v1.json",
50
+ "./schema/contract-capsule.v1.json": "./schema/contract-capsule.v1.json"
33
51
  },
34
52
  "files": [
35
53
  "dist",
@@ -42,8 +60,8 @@
42
60
  "access": "public"
43
61
  },
44
62
  "dependencies": {
45
- "@decantr/essence-spec": "2.0.0",
46
- "@decantr/registry": "2.0.0"
63
+ "@decantr/essence-spec": "3.0.0-next.0",
64
+ "@decantr/registry": "3.0.0-next.0"
47
65
  },
48
66
  "devDependencies": {},
49
67
  "scripts": {
@@ -0,0 +1,208 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://decantr.ai/schemas/contract-capsule.v1.json",
4
+ "title": "Decantr Contract Capsule",
5
+ "type": "object",
6
+ "required": [
7
+ "schema_version",
8
+ "snapshot_id",
9
+ "project_id",
10
+ "created_at",
11
+ "source_hash",
12
+ "cache_key",
13
+ "summary",
14
+ "source_artifact_limit",
15
+ "source_artifacts_truncated",
16
+ "routes",
17
+ "components",
18
+ "tokens",
19
+ "local_rules",
20
+ "style_bridge",
21
+ "source_artifacts",
22
+ "open_findings"
23
+ ],
24
+ "properties": {
25
+ "$schema": {
26
+ "const": "https://decantr.ai/schemas/contract-capsule.v1.json"
27
+ },
28
+ "schema_version": {
29
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/schemaVersion"
30
+ },
31
+ "snapshot_id": {
32
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
33
+ },
34
+ "project_id": {
35
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
36
+ },
37
+ "created_at": {
38
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
39
+ },
40
+ "source_hash": {
41
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
42
+ },
43
+ "contract_hash": {
44
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
45
+ },
46
+ "cache_key": {
47
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
48
+ },
49
+ "contract_cache_key": {
50
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
51
+ },
52
+ "summary": {
53
+ "type": "object",
54
+ "required": [
55
+ "routes",
56
+ "components",
57
+ "tokens",
58
+ "local_rules",
59
+ "style_bridge",
60
+ "source_artifacts",
61
+ "open_findings"
62
+ ],
63
+ "properties": {
64
+ "routes": {
65
+ "type": "integer",
66
+ "minimum": 0
67
+ },
68
+ "components": {
69
+ "type": "integer",
70
+ "minimum": 0
71
+ },
72
+ "tokens": {
73
+ "type": "integer",
74
+ "minimum": 0
75
+ },
76
+ "local_rules": {
77
+ "type": "integer",
78
+ "minimum": 0
79
+ },
80
+ "style_bridge": {
81
+ "type": "integer",
82
+ "minimum": 0
83
+ },
84
+ "source_artifacts": {
85
+ "type": "integer",
86
+ "minimum": 0
87
+ },
88
+ "open_findings": {
89
+ "type": "integer",
90
+ "minimum": 0
91
+ }
92
+ },
93
+ "additionalProperties": false
94
+ },
95
+ "source_artifact_limit": {
96
+ "type": "integer",
97
+ "minimum": 0
98
+ },
99
+ "source_artifacts_truncated": {
100
+ "type": "boolean"
101
+ },
102
+ "routes": {
103
+ "type": "array",
104
+ "items": {
105
+ "type": "object",
106
+ "required": ["id", "path"],
107
+ "properties": {
108
+ "id": {
109
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
110
+ },
111
+ "path": {
112
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
113
+ },
114
+ "page_id": {
115
+ "type": "string"
116
+ },
117
+ "shell_id": {
118
+ "type": "string"
119
+ }
120
+ },
121
+ "additionalProperties": false
122
+ }
123
+ },
124
+ "components": {
125
+ "$ref": "#/$defs/vocabularyItems"
126
+ },
127
+ "tokens": {
128
+ "$ref": "#/$defs/vocabularyItems"
129
+ },
130
+ "local_rules": {
131
+ "$ref": "#/$defs/vocabularyItems"
132
+ },
133
+ "style_bridge": {
134
+ "$ref": "#/$defs/vocabularyItems"
135
+ },
136
+ "source_artifacts": {
137
+ "$ref": "#/$defs/sourceArtifacts"
138
+ },
139
+ "open_findings": {
140
+ "type": "array",
141
+ "items": {
142
+ "type": "object",
143
+ "required": ["id"],
144
+ "properties": {
145
+ "id": {
146
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
147
+ },
148
+ "code": {
149
+ "type": "string"
150
+ },
151
+ "severity": {
152
+ "type": "string"
153
+ },
154
+ "anchored_at": {
155
+ "type": "string"
156
+ },
157
+ "message": {
158
+ "type": "string"
159
+ }
160
+ },
161
+ "additionalProperties": false
162
+ }
163
+ }
164
+ },
165
+ "$defs": {
166
+ "vocabularyItems": {
167
+ "type": "array",
168
+ "items": {
169
+ "type": "object",
170
+ "required": ["id"],
171
+ "properties": {
172
+ "id": {
173
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
174
+ },
175
+ "label": {
176
+ "type": "string"
177
+ },
178
+ "payload": true
179
+ },
180
+ "additionalProperties": false
181
+ }
182
+ },
183
+ "sourceArtifacts": {
184
+ "type": "array",
185
+ "items": {
186
+ "type": "object",
187
+ "required": ["id", "path"],
188
+ "properties": {
189
+ "id": {
190
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
191
+ },
192
+ "path": {
193
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
194
+ },
195
+ "kind": {
196
+ "type": "string"
197
+ },
198
+ "label": {
199
+ "type": "string"
200
+ },
201
+ "payload": true
202
+ },
203
+ "additionalProperties": false
204
+ }
205
+ }
206
+ },
207
+ "additionalProperties": false
208
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://decantr.ai/schemas/graph-diff.v1.json",
4
+ "title": "Decantr Typed Graph Diff",
5
+ "type": "object",
6
+ "required": ["id", "to", "ops"],
7
+ "properties": {
8
+ "$schema": {
9
+ "const": "https://decantr.ai/schemas/graph-diff.v1.json"
10
+ },
11
+ "id": {
12
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
13
+ },
14
+ "from": {
15
+ "type": "string"
16
+ },
17
+ "to": {
18
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
19
+ },
20
+ "ops": {
21
+ "type": "array",
22
+ "items": {
23
+ "type": "object",
24
+ "required": ["op"],
25
+ "properties": {
26
+ "op": {
27
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/graphDiffOpType"
28
+ },
29
+ "id": {
30
+ "type": "string"
31
+ },
32
+ "type": {
33
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/graphNodeType"
34
+ },
35
+ "src": {
36
+ "type": "string"
37
+ },
38
+ "dst": {
39
+ "type": "string"
40
+ },
41
+ "relation": {
42
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/graphRelation"
43
+ },
44
+ "before": true,
45
+ "after": true
46
+ },
47
+ "additionalProperties": false
48
+ }
49
+ }
50
+ },
51
+ "additionalProperties": false
52
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://decantr.ai/schemas/graph-manifest.v1.json",
4
+ "title": "Decantr Typed Graph Manifest",
5
+ "type": "object",
6
+ "required": [
7
+ "schema_version",
8
+ "snapshot_id",
9
+ "project_id",
10
+ "generated_at",
11
+ "sources",
12
+ "outputs",
13
+ "warnings"
14
+ ],
15
+ "properties": {
16
+ "$schema": {
17
+ "const": "https://decantr.ai/schemas/graph-manifest.v1.json"
18
+ },
19
+ "schema_version": {
20
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/schemaVersion"
21
+ },
22
+ "snapshot_id": {
23
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
24
+ },
25
+ "project_id": {
26
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
27
+ },
28
+ "generated_at": {
29
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
30
+ },
31
+ "sources": {
32
+ "type": "array",
33
+ "items": {
34
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/sourceArtifact"
35
+ }
36
+ },
37
+ "outputs": {
38
+ "type": "object",
39
+ "required": ["snapshot"],
40
+ "properties": {
41
+ "sqlite": {
42
+ "type": "string"
43
+ },
44
+ "snapshot": {
45
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
46
+ },
47
+ "history": {
48
+ "type": "string"
49
+ },
50
+ "diff": {
51
+ "type": "string"
52
+ }
53
+ },
54
+ "additionalProperties": false
55
+ },
56
+ "warnings": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "object",
60
+ "required": ["code", "message"],
61
+ "properties": {
62
+ "code": {
63
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
64
+ },
65
+ "message": {
66
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
67
+ }
68
+ },
69
+ "additionalProperties": false
70
+ }
71
+ }
72
+ },
73
+ "additionalProperties": false
74
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://decantr.ai/schemas/graph-snapshot.v1.json",
4
+ "title": "Decantr Typed Graph Snapshot",
5
+ "type": "object",
6
+ "required": [
7
+ "id",
8
+ "schema_version",
9
+ "project_id",
10
+ "created_at",
11
+ "source_hash",
12
+ "nodes",
13
+ "edges",
14
+ "summary"
15
+ ],
16
+ "properties": {
17
+ "$schema": {
18
+ "const": "https://decantr.ai/schemas/graph-snapshot.v1.json"
19
+ },
20
+ "id": {
21
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
22
+ },
23
+ "schema_version": {
24
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/schemaVersion"
25
+ },
26
+ "project_id": {
27
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
28
+ },
29
+ "created_at": {
30
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
31
+ },
32
+ "parent_id": {
33
+ "type": "string"
34
+ },
35
+ "source_hash": {
36
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/nonEmptyString"
37
+ },
38
+ "git": {
39
+ "type": "object",
40
+ "properties": {
41
+ "commit": {
42
+ "type": "string"
43
+ },
44
+ "branch": {
45
+ "type": "string"
46
+ },
47
+ "dirty": {
48
+ "type": "boolean"
49
+ }
50
+ },
51
+ "additionalProperties": false
52
+ },
53
+ "nodes": {
54
+ "type": "array",
55
+ "items": {
56
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/graphNode"
57
+ }
58
+ },
59
+ "edges": {
60
+ "type": "array",
61
+ "items": {
62
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/graphEdge"
63
+ }
64
+ },
65
+ "summary": {
66
+ "$ref": "https://decantr.ai/schemas/graph.common.v1.json#/$defs/graphSummary"
67
+ }
68
+ },
69
+ "additionalProperties": false
70
+ }
@@ -0,0 +1,186 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://decantr.ai/schemas/graph.common.v1.json",
4
+ "title": "Decantr Typed Graph Common Definitions",
5
+ "$defs": {
6
+ "nonEmptyString": {
7
+ "type": "string",
8
+ "minLength": 1
9
+ },
10
+ "schemaVersion": {
11
+ "const": "3.0.0-draft"
12
+ },
13
+ "graphNodeType": {
14
+ "type": "string",
15
+ "enum": [
16
+ "Project",
17
+ "Section",
18
+ "Page",
19
+ "Route",
20
+ "Shell",
21
+ "Region",
22
+ "Pattern",
23
+ "Component",
24
+ "Token",
25
+ "Theme",
26
+ "Decorator",
27
+ "Feature",
28
+ "LocalRule",
29
+ "StyleBridge",
30
+ "SourceArtifact",
31
+ "Finding",
32
+ "Evidence",
33
+ "Repair",
34
+ "Test",
35
+ "AgentRun"
36
+ ]
37
+ },
38
+ "graphRelation": {
39
+ "type": "string",
40
+ "enum": [
41
+ "PROJECT_CONTAINS_SECTION",
42
+ "PROJECT_ENABLES_FEATURE",
43
+ "PROJECT_USES_THEME",
44
+ "SECTION_CONTAINS_PAGE",
45
+ "PAGE_ROUTED_AT_ROUTE",
46
+ "PAGE_USES_SHELL",
47
+ "SHELL_HAS_REGION",
48
+ "PAGE_COMPOSES_PATTERN",
49
+ "PATTERN_NEEDS_COMPONENT",
50
+ "COMPONENT_STYLED_WITH_TOKEN",
51
+ "THEME_DEFINES_TOKEN",
52
+ "THEME_DEFINES_DECORATOR",
53
+ "COMPONENT_DECORATED_WITH_DECORATOR",
54
+ "LOCAL_RULE_APPLIES_TO",
55
+ "STYLE_BRIDGE_MAPS_TO",
56
+ "NODE_DERIVED_FROM_SOURCE",
57
+ "SOURCE_IMPORTS_SOURCE",
58
+ "FINDING_VIOLATES_RULE",
59
+ "FINDING_ANCHORED_AT",
60
+ "EVIDENCE_SUPPORTS_FINDING",
61
+ "EVIDENCE_CAPTURED_FOR",
62
+ "REPAIR_FIXES_FINDING",
63
+ "TEST_COVERS_NODE",
64
+ "AGENT_RUN_CHANGED_NODE"
65
+ ]
66
+ },
67
+ "graphDiffOpType": {
68
+ "type": "string",
69
+ "enum": [
70
+ "node.added",
71
+ "node.removed",
72
+ "node.changed",
73
+ "edge.added",
74
+ "edge.removed",
75
+ "edge.changed",
76
+ "finding.added",
77
+ "finding.resolved",
78
+ "evidence.added"
79
+ ]
80
+ },
81
+ "graphNode": {
82
+ "type": "object",
83
+ "required": ["id", "type", "payload"],
84
+ "properties": {
85
+ "id": {
86
+ "$ref": "#/$defs/nonEmptyString"
87
+ },
88
+ "type": {
89
+ "$ref": "#/$defs/graphNodeType"
90
+ },
91
+ "payload": true,
92
+ "created_at": {
93
+ "type": "string"
94
+ },
95
+ "updated_at": {
96
+ "type": "string"
97
+ }
98
+ },
99
+ "additionalProperties": false
100
+ },
101
+ "graphEdge": {
102
+ "type": "object",
103
+ "required": ["src", "dst", "relation"],
104
+ "properties": {
105
+ "src": {
106
+ "$ref": "#/$defs/nonEmptyString"
107
+ },
108
+ "dst": {
109
+ "$ref": "#/$defs/nonEmptyString"
110
+ },
111
+ "relation": {
112
+ "$ref": "#/$defs/graphRelation"
113
+ },
114
+ "payload": true,
115
+ "idx": {
116
+ "type": "integer",
117
+ "minimum": 0
118
+ }
119
+ },
120
+ "additionalProperties": false
121
+ },
122
+ "sourceArtifact": {
123
+ "type": "object",
124
+ "required": ["id", "kind"],
125
+ "properties": {
126
+ "id": {
127
+ "$ref": "#/$defs/nonEmptyString"
128
+ },
129
+ "kind": {
130
+ "$ref": "#/$defs/nonEmptyString"
131
+ },
132
+ "path": {
133
+ "type": "string"
134
+ },
135
+ "commit": {
136
+ "type": "string"
137
+ },
138
+ "hash": {
139
+ "type": "string"
140
+ },
141
+ "payload": {
142
+ "type": "object",
143
+ "additionalProperties": true
144
+ }
145
+ },
146
+ "additionalProperties": false
147
+ },
148
+ "graphSummary": {
149
+ "type": "object",
150
+ "required": ["nodes", "edges", "findings", "evidence"],
151
+ "properties": {
152
+ "nodes": {
153
+ "type": "integer",
154
+ "minimum": 0
155
+ },
156
+ "edges": {
157
+ "type": "integer",
158
+ "minimum": 0
159
+ },
160
+ "findings": {
161
+ "type": "integer",
162
+ "minimum": 0
163
+ },
164
+ "evidence": {
165
+ "type": "integer",
166
+ "minimum": 0
167
+ }
168
+ },
169
+ "additionalProperties": false
170
+ },
171
+ "repairAction": {
172
+ "type": "object",
173
+ "required": ["id"],
174
+ "properties": {
175
+ "id": {
176
+ "$ref": "#/$defs/nonEmptyString"
177
+ },
178
+ "payload": {
179
+ "type": "object",
180
+ "additionalProperties": true
181
+ }
182
+ },
183
+ "additionalProperties": false
184
+ }
185
+ }
186
+ }