-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuri-fixtures.json
More file actions
225 lines (225 loc) · 7.6 KB
/
uri-fixtures.json
File metadata and controls
225 lines (225 loc) · 7.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
{
"version": "1.0",
"specification": "Capsule URI Scheme v1.0",
"description": "Conformance vectors for capsule:// URI parsing. Each fixture contains a URI string and the expected parse result. A conformant URI parser must produce the same structured output for every valid fixture and reject every invalid fixture.",
"valid": [
{
"name": "hash_reference",
"description": "Bare SHA3-256 hash reference (most portable form).",
"uri": "capsule://sha3_8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2cd",
"expected": {
"scheme": "capsule",
"chain": null,
"reference_type": "hash",
"hash_algorithm": "sha3",
"hash_value": "8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2cd",
"sequence": null,
"id": null,
"fragment": null
}
},
{
"name": "hash_with_fragment_section",
"description": "Hash reference with fragment pointing to a section.",
"uri": "capsule://sha3_8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2cd#reasoning",
"expected": {
"scheme": "capsule",
"chain": null,
"reference_type": "hash",
"hash_algorithm": "sha3",
"hash_value": "8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2cd",
"sequence": null,
"id": null,
"fragment": "reasoning"
}
},
{
"name": "hash_with_fragment_nested",
"description": "Hash reference with fragment to a nested field.",
"uri": "capsule://sha3_8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2cd#reasoning/confidence",
"expected": {
"scheme": "capsule",
"chain": null,
"reference_type": "hash",
"hash_algorithm": "sha3",
"hash_value": "8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2cd",
"sequence": null,
"id": null,
"fragment": "reasoning/confidence"
}
},
{
"name": "hash_with_fragment_array_index",
"description": "Hash reference with fragment to an array element.",
"uri": "capsule://sha3_7faf4d8f3139081993a1fc81dd157bb59101a26dbae6475db58f7158c57207c7#execution/tool_calls/0",
"expected": {
"scheme": "capsule",
"chain": null,
"reference_type": "hash",
"hash_algorithm": "sha3",
"hash_value": "7faf4d8f3139081993a1fc81dd157bb59101a26dbae6475db58f7158c57207c7",
"sequence": null,
"id": null,
"fragment": "execution/tool_calls/0"
}
},
{
"name": "chain_sequence",
"description": "Chain name with sequence number.",
"uri": "capsule://deploy-bot/42",
"expected": {
"scheme": "capsule",
"chain": "deploy-bot",
"reference_type": "sequence",
"hash_algorithm": null,
"hash_value": null,
"sequence": 42,
"id": null,
"fragment": null
}
},
{
"name": "chain_hash",
"description": "Chain name with hash reference.",
"uri": "capsule://deploy-bot/sha3_8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2cd",
"expected": {
"scheme": "capsule",
"chain": "deploy-bot",
"reference_type": "hash",
"hash_algorithm": "sha3",
"hash_value": "8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2cd",
"sequence": null,
"id": null,
"fragment": null
}
},
{
"name": "id_reference",
"description": "UUID-based Capsule reference.",
"uri": "capsule://a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"expected": {
"scheme": "capsule",
"chain": null,
"reference_type": "id",
"hash_algorithm": null,
"hash_value": null,
"sequence": null,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"fragment": null
}
},
{
"name": "chain_sequence_zero",
"description": "Chain genesis reference (sequence 0).",
"uri": "capsule://my-chain/0",
"expected": {
"scheme": "capsule",
"chain": "my-chain",
"reference_type": "sequence",
"hash_algorithm": null,
"hash_value": null,
"sequence": 0,
"id": null,
"fragment": null
}
},
{
"name": "chain_with_dots_and_underscores",
"description": "Chain name with allowed special characters.",
"uri": "capsule://org.team_deploy.v2/15",
"expected": {
"scheme": "capsule",
"chain": "org.team_deploy.v2",
"reference_type": "sequence",
"hash_algorithm": null,
"hash_value": null,
"sequence": 15,
"id": null,
"fragment": null
}
},
{
"name": "id_with_fragment",
"description": "UUID reference with fragment.",
"uri": "capsule://a1b2c3d4-e5f6-7890-abcd-ef1234567890#authority",
"expected": {
"scheme": "capsule",
"chain": null,
"reference_type": "id",
"hash_algorithm": null,
"hash_value": null,
"sequence": null,
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"fragment": "authority"
}
}
],
"invalid": [
{
"name": "wrong_scheme",
"description": "Must use capsule:// scheme.",
"uri": "http://sha3_8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2cd",
"reason": "Wrong scheme: expected 'capsule'"
},
{
"name": "hash_too_short",
"description": "SHA3-256 hash must be exactly 64 hex characters.",
"uri": "capsule://sha3_8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2c",
"reason": "Hash too short: 63 hex characters instead of 64"
},
{
"name": "hash_too_long",
"description": "SHA3-256 hash must be exactly 64 hex characters.",
"uri": "capsule://sha3_8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2cdd",
"reason": "Hash too long: 65 hex characters instead of 64"
},
{
"name": "hash_uppercase",
"description": "Hash must be lowercase hex.",
"uri": "capsule://sha3_8C71E187DFBFFCA067265F576D9FB72EE8A223C3DFF801DD7C5DD8FCB915F2CD",
"reason": "Hash contains uppercase characters"
},
{
"name": "hash_non_hex",
"description": "Hash must contain only hex digits.",
"uri": "capsule://sha3_g8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2cd",
"reason": "Hash contains non-hex character 'g'"
},
{
"name": "unknown_hash_algorithm",
"description": "Only sha3_ prefix is defined in CPS v1.0.",
"uri": "capsule://md5_8c71e187dfbffca067265f576d9fb72ee8a2",
"reason": "Unknown hash algorithm prefix 'md5_'"
},
{
"name": "empty_uri",
"description": "Empty string is not a valid URI.",
"uri": "",
"reason": "Empty URI"
},
{
"name": "scheme_only",
"description": "Scheme without authority or reference.",
"uri": "capsule://",
"reason": "Missing reference after scheme"
},
{
"name": "invalid_uuid",
"description": "Malformed UUID.",
"uri": "capsule://not-a-valid-uuid-at-all",
"reason": "Invalid reference: not a hash, sequence, or UUID"
},
{
"name": "fragment_traversal",
"description": "Fragment must not attempt path traversal.",
"uri": "capsule://sha3_8c71e187dfbffca067265f576d9fb72ee8a223c3dff801dd7c5dd8fcb915f2cd#../../etc/passwd",
"reason": "Fragment contains path traversal"
},
{
"name": "negative_sequence",
"description": "Sequence numbers must be non-negative.",
"uri": "capsule://my-chain/-1",
"reason": "Negative sequence number"
}
]
}