ctxflow-semconv 0.2.2__py3-none-any.whl
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.
- ctxflow_semconv/__init__.py +53 -0
- ctxflow_semconv/_generated.py +1072 -0
- ctxflow_semconv/conformance/chunk-id.json +51 -0
- ctxflow_semconv/conformance/config.json +116 -0
- ctxflow_semconv/conformance/identity.json +548 -0
- ctxflow_semconv/conformance/source-hash.json +37 -0
- ctxflow_semconv/conformance/text-hash.json +90 -0
- ctxflow_semconv/py.typed +0 -0
- ctxflow_semconv/schema/adapter.schema.json +263 -0
- ctxflow_semconv/schema/content-keys.json +639 -0
- ctxflow_semconv/schema/ctxflow-attributes.schema.json +468 -0
- ctxflow_semconv-0.2.2.dist-info/METADATA +33 -0
- ctxflow_semconv-0.2.2.dist-info/RECORD +15 -0
- ctxflow_semconv-0.2.2.dist-info/WHEEL +4 -0
- ctxflow_semconv-0.2.2.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "urn:ctxflow:semconv:0.2.2:adapter",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"title": "ctxflow observer adapter",
|
|
5
|
+
"description": "Deprecated (ADR-013): the observers that read adapters were retired with the edge worker; kept so that adapters of pre-release builds can be read. How an observer reads one observed system. Declarative only; never credentials or code. Digest of an adapter (the `+<digest>` of `config_version`): first 16 hex chars of the sha256 of the adapter document canonicalized with RFC 8785 (JCS), UTF-8.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"kind"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"kind": {
|
|
12
|
+
"enum": [
|
|
13
|
+
"index",
|
|
14
|
+
"source"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"oneOf": [
|
|
19
|
+
{
|
|
20
|
+
"$ref": "#/$defs/index_adapter"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"$ref": "#/$defs/source_adapter"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"$defs": {
|
|
27
|
+
"identifier": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
|
|
30
|
+
"maxLength": 63
|
|
31
|
+
},
|
|
32
|
+
"relation": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"pattern": "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)?$",
|
|
35
|
+
"maxLength": 127
|
|
36
|
+
},
|
|
37
|
+
"json_path": {
|
|
38
|
+
"description": "Keys inside a JSON column. Only the scalar at the path is read, never the column.",
|
|
39
|
+
"type": "array",
|
|
40
|
+
"minItems": 1,
|
|
41
|
+
"maxItems": 8,
|
|
42
|
+
"items": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"minLength": 1,
|
|
45
|
+
"maxLength": 128
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"regex": {
|
|
49
|
+
"description": "Applied to the value; the first group of the first match is the result. Bounded and matched with a timeout.",
|
|
50
|
+
"type": "string",
|
|
51
|
+
"minLength": 1,
|
|
52
|
+
"maxLength": 200
|
|
53
|
+
},
|
|
54
|
+
"column_mapping": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"required": [
|
|
58
|
+
"column"
|
|
59
|
+
],
|
|
60
|
+
"properties": {
|
|
61
|
+
"column": {
|
|
62
|
+
"$ref": "#/$defs/identifier"
|
|
63
|
+
},
|
|
64
|
+
"path": {
|
|
65
|
+
"$ref": "#/$defs/json_path"
|
|
66
|
+
},
|
|
67
|
+
"regex": {
|
|
68
|
+
"$ref": "#/$defs/regex"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"c1_mapping": {
|
|
73
|
+
"description": "Where one C1 key comes from, exactly one of a column mapping or `const`.",
|
|
74
|
+
"oneOf": [
|
|
75
|
+
{
|
|
76
|
+
"$ref": "#/$defs/column_mapping"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"type": "object",
|
|
80
|
+
"additionalProperties": false,
|
|
81
|
+
"required": [
|
|
82
|
+
"const"
|
|
83
|
+
],
|
|
84
|
+
"properties": {
|
|
85
|
+
"const": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"maxLength": 256
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
"index_adapter": {
|
|
94
|
+
"description": "Postgres/pgvector table of chunks.",
|
|
95
|
+
"type": "object",
|
|
96
|
+
"additionalProperties": false,
|
|
97
|
+
"required": [
|
|
98
|
+
"kind",
|
|
99
|
+
"name",
|
|
100
|
+
"version",
|
|
101
|
+
"connection",
|
|
102
|
+
"level",
|
|
103
|
+
"table",
|
|
104
|
+
"view",
|
|
105
|
+
"id_column",
|
|
106
|
+
"version_from"
|
|
107
|
+
],
|
|
108
|
+
"properties": {
|
|
109
|
+
"kind": {
|
|
110
|
+
"const": "index"
|
|
111
|
+
},
|
|
112
|
+
"name": {
|
|
113
|
+
"description": "Name of the index. Identity of the observed index in events and state.",
|
|
114
|
+
"type": "string",
|
|
115
|
+
"pattern": "^[a-z][a-z0-9_-]{0,62}$"
|
|
116
|
+
},
|
|
117
|
+
"version": {
|
|
118
|
+
"description": "Version of this adapter, free text without spaces or `+`.",
|
|
119
|
+
"type": "string",
|
|
120
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"
|
|
121
|
+
},
|
|
122
|
+
"connection": {
|
|
123
|
+
"description": "Name of a connection. The worker reads its DSN from the environment; the adapter never carries it.",
|
|
124
|
+
"type": "string",
|
|
125
|
+
"pattern": "^[a-z][a-z0-9_]{0,62}$"
|
|
126
|
+
},
|
|
127
|
+
"level": {
|
|
128
|
+
"description": "N1 reads id, version and C1 keys. N2 adds a text hash computed by a view in the customer's database.",
|
|
129
|
+
"enum": [
|
|
130
|
+
"N1",
|
|
131
|
+
"N2"
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"table": {
|
|
135
|
+
"description": "Base table the view is generated from (`observe index --print-view`). The observer never reads it; its role needs no privilege on it.",
|
|
136
|
+
"$ref": "#/$defs/relation"
|
|
137
|
+
},
|
|
138
|
+
"view": {
|
|
139
|
+
"description": "View the observer reads, at every level. The customer reviews and creates it; the observer's role gets SELECT only on it. It exposes `id`, `version` and one column per mapped C1 key (`source_id`, ...) as text, plus `text_hash` at N2. The observer checks the target is a view.",
|
|
140
|
+
"$ref": "#/$defs/relation"
|
|
141
|
+
},
|
|
142
|
+
"id_column": {
|
|
143
|
+
"$ref": "#/$defs/identifier"
|
|
144
|
+
},
|
|
145
|
+
"version_from": {
|
|
146
|
+
"description": "Where the version of a chunk comes from. A chunk that changes must change this value, because N1 does not see text.",
|
|
147
|
+
"$ref": "#/$defs/column_mapping"
|
|
148
|
+
},
|
|
149
|
+
"text_column": {
|
|
150
|
+
"description": "Column that holds the chunk text. No mapping may use it. Required at N2, where the generated view hashes it.",
|
|
151
|
+
"$ref": "#/$defs/identifier"
|
|
152
|
+
},
|
|
153
|
+
"c1": {
|
|
154
|
+
"description": "C1/C2 key to where it comes from. Keys are registered ctxflow attributes.",
|
|
155
|
+
"type": "object",
|
|
156
|
+
"propertyNames": {
|
|
157
|
+
"enum": [
|
|
158
|
+
"ctxflow.source_id",
|
|
159
|
+
"ctxflow.source_version",
|
|
160
|
+
"ctxflow.source_hash",
|
|
161
|
+
"ctxflow.id_mode",
|
|
162
|
+
"ctxflow.chunker_version",
|
|
163
|
+
"ctxflow.embed_model"
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
"additionalProperties": {
|
|
167
|
+
"$ref": "#/$defs/c1_mapping"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"allOf": [
|
|
172
|
+
{
|
|
173
|
+
"if": {
|
|
174
|
+
"properties": {
|
|
175
|
+
"level": {
|
|
176
|
+
"const": "N2"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"required": [
|
|
180
|
+
"level"
|
|
181
|
+
]
|
|
182
|
+
},
|
|
183
|
+
"then": {
|
|
184
|
+
"required": [
|
|
185
|
+
"text_column"
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
"source_adapter": {
|
|
192
|
+
"description": "Directory or S3 bucket of original documents (C6).",
|
|
193
|
+
"type": "object",
|
|
194
|
+
"additionalProperties": false,
|
|
195
|
+
"required": [
|
|
196
|
+
"kind",
|
|
197
|
+
"name",
|
|
198
|
+
"version",
|
|
199
|
+
"connection",
|
|
200
|
+
"backend",
|
|
201
|
+
"level"
|
|
202
|
+
],
|
|
203
|
+
"properties": {
|
|
204
|
+
"kind": {
|
|
205
|
+
"const": "source"
|
|
206
|
+
},
|
|
207
|
+
"name": {
|
|
208
|
+
"description": "Name of the source. Identity of the observed source in events and state.",
|
|
209
|
+
"type": "string",
|
|
210
|
+
"pattern": "^[a-z][a-z0-9_-]{0,62}$"
|
|
211
|
+
},
|
|
212
|
+
"version": {
|
|
213
|
+
"description": "Version of this adapter, free text without spaces or `+`.",
|
|
214
|
+
"type": "string",
|
|
215
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"
|
|
216
|
+
},
|
|
217
|
+
"connection": {
|
|
218
|
+
"description": "Name of a connection. The worker reads the root of the source (a directory, or a bucket name) from the environment (`CTXFLOW_WORKER_OBSERVE_SOURCE_<CONNECTION>`); the adapter never carries it. S3 credentials and endpoint come from the standard AWS environment of the worker.",
|
|
219
|
+
"type": "string",
|
|
220
|
+
"pattern": "^[a-z][a-z0-9_]{0,62}$"
|
|
221
|
+
},
|
|
222
|
+
"backend": {
|
|
223
|
+
"description": "`dir` is a directory the worker can read; `s3` is an S3 (or S3-compatible) bucket.",
|
|
224
|
+
"enum": [
|
|
225
|
+
"dir",
|
|
226
|
+
"s3"
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
"level": {
|
|
230
|
+
"description": "N1 reads native metadata only (S3 ETag, lastModified, size; for a directory mtime and size). N2 adds the sha256 of the original, computed by the worker next to the source; only the hash leaves.",
|
|
231
|
+
"enum": [
|
|
232
|
+
"N1",
|
|
233
|
+
"N2"
|
|
234
|
+
]
|
|
235
|
+
},
|
|
236
|
+
"prefix": {
|
|
237
|
+
"description": "Folder inside the root (key prefix in S3). Documents outside it are not seen. Relative, without `..`.",
|
|
238
|
+
"type": "string",
|
|
239
|
+
"maxLength": 256,
|
|
240
|
+
"pattern": "^[A-Za-z0-9._ -]+(/[A-Za-z0-9._ -]+)*/?$",
|
|
241
|
+
"not": {
|
|
242
|
+
"pattern": "(^|/)\\.\\.(/|$)"
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"include": {
|
|
246
|
+
"description": "Globs of the paths (relative to `prefix`) to observe. `*` also matches `/`. Default every document.",
|
|
247
|
+
"type": "array",
|
|
248
|
+
"minItems": 1,
|
|
249
|
+
"maxItems": 32,
|
|
250
|
+
"items": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"minLength": 1,
|
|
253
|
+
"maxLength": 128
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
"id_without_suffix": {
|
|
257
|
+
"description": "Drop the file extension from the document id (`politicas/vacaciones.md` becomes `politicas/vacaciones`), to match an ingestion that does so.",
|
|
258
|
+
"type": "boolean"
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|