@gregiteen/ssss-cli 0.14.1 → 0.14.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.
@@ -0,0 +1,553 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ssss.dev/schemas/core-registry.schema.json",
4
+ "title": "SSSS Core and Extension Registry Schema",
5
+ "description": "JSON Schema for SSSS core and extension registries (spec §5).",
6
+ "type": "object",
7
+ "required": [
8
+ "registry",
9
+ "document_primitives"
10
+ ],
11
+ "if": {
12
+ "properties": { "registry": { "const": "core" } },
13
+ "required": ["registry"]
14
+ },
15
+ "then": {
16
+ "required": ["spec_version", "description"]
17
+ },
18
+ "additionalProperties": false,
19
+ "properties": {
20
+ "$schema": {
21
+ "type": "string",
22
+ "minLength": 1
23
+ },
24
+ "registry": {
25
+ "type": "string",
26
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
27
+ },
28
+ "extends": {
29
+ "type": "string",
30
+ "enum": ["core", "ssss"]
31
+ },
32
+ "version": {
33
+ "type": "string",
34
+ "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$"
35
+ },
36
+ "requires": {
37
+ "type": "object",
38
+ "propertyNames": {
39
+ "type": "string",
40
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
41
+ },
42
+ "additionalProperties": {
43
+ "type": "string",
44
+ "minLength": 1
45
+ }
46
+ },
47
+ "spec_version": {
48
+ "type": "string",
49
+ "minLength": 1
50
+ },
51
+ "description": {
52
+ "type": "string"
53
+ },
54
+ "conformance": {
55
+ "type": "string"
56
+ },
57
+ "document_primitives": {
58
+ "type": "object",
59
+ "propertyNames": {
60
+ "type": "string",
61
+ "pattern": "^(?:[a-z][a-z0-9_-]{0,63}:)?[a-z][a-z0-9_-]{0,127}$"
62
+ },
63
+ "additionalProperties": {
64
+ "$ref": "#/$defs/primitiveDefinition"
65
+ }
66
+ },
67
+ "contract_primitives": {
68
+ "type": "object",
69
+ "propertyNames": {
70
+ "type": "string",
71
+ "pattern": "^[a-z][a-z0-9_-]{0,63}$"
72
+ },
73
+ "additionalProperties": {
74
+ "$ref": "#/$defs/contractPrimitive"
75
+ }
76
+ },
77
+ "universal_frontmatter": {
78
+ "type": "object",
79
+ "required": ["required"],
80
+ "additionalProperties": false,
81
+ "properties": {
82
+ "required": {
83
+ "type": "array",
84
+ "items": { "type": "string", "minLength": 1 },
85
+ "uniqueItems": true
86
+ },
87
+ "recommended_okf": {
88
+ "type": "array",
89
+ "items": { "type": "string", "minLength": 1 },
90
+ "uniqueItems": true
91
+ },
92
+ "recommended_semantic": {
93
+ "type": "array",
94
+ "items": { "type": "string", "minLength": 1 },
95
+ "uniqueItems": true
96
+ },
97
+ "spec_ref": {
98
+ "type": "string"
99
+ }
100
+ }
101
+ },
102
+ "portability": {
103
+ "type": "object",
104
+ "required": ["classes", "export_profiles"],
105
+ "additionalProperties": false,
106
+ "properties": {
107
+ "description": { "type": "string" },
108
+ "classes": {
109
+ "type": "object",
110
+ "additionalProperties": { "type": "string" }
111
+ },
112
+ "export_profiles": {
113
+ "type": "object",
114
+ "additionalProperties": {
115
+ "type": "object",
116
+ "required": ["includes"],
117
+ "additionalProperties": false,
118
+ "properties": {
119
+ "includes": {
120
+ "type": "array",
121
+ "items": { "type": "string", "minLength": 1 },
122
+ "uniqueItems": true
123
+ },
124
+ "excludes": {
125
+ "type": "array",
126
+ "items": { "type": "string", "minLength": 1 },
127
+ "uniqueItems": true
128
+ },
129
+ "resource_bound": { "type": "string" },
130
+ "note": { "type": "string" }
131
+ }
132
+ }
133
+ },
134
+ "conformance": { "type": "string" },
135
+ "spec_ref": { "type": "string" }
136
+ }
137
+ },
138
+ "bundle": {
139
+ "type": "object",
140
+ "required": [
141
+ "container",
142
+ "structure",
143
+ "manifest_required_fields",
144
+ "provenance_required_fields"
145
+ ],
146
+ "additionalProperties": false,
147
+ "properties": {
148
+ "description": { "type": "string" },
149
+ "container": { "type": "string" },
150
+ "structure": {
151
+ "type": "array",
152
+ "items": { "type": "string", "minLength": 1 },
153
+ "uniqueItems": true
154
+ },
155
+ "file_sort": { "type": "string" },
156
+ "manifest_required_fields": {
157
+ "type": "array",
158
+ "items": { "type": "string", "minLength": 1 },
159
+ "uniqueItems": true
160
+ },
161
+ "manifest_optional_fields": {
162
+ "type": "array",
163
+ "items": { "type": "string", "minLength": 1 },
164
+ "uniqueItems": true
165
+ },
166
+ "provenance_required_fields": {
167
+ "type": "array",
168
+ "items": { "type": "string", "minLength": 1 },
169
+ "uniqueItems": true
170
+ },
171
+ "provenance_optional_fields": {
172
+ "type": "array",
173
+ "items": { "type": "string", "minLength": 1 },
174
+ "uniqueItems": true
175
+ },
176
+ "content_hash": { "type": "string" },
177
+ "parameter_fields": {
178
+ "type": "object",
179
+ "required": ["required"],
180
+ "additionalProperties": false,
181
+ "properties": {
182
+ "required": {
183
+ "type": "array",
184
+ "items": { "type": "string", "minLength": 1 },
185
+ "uniqueItems": true
186
+ },
187
+ "optional": {
188
+ "type": "array",
189
+ "items": { "type": "string", "minLength": 1 },
190
+ "uniqueItems": true
191
+ },
192
+ "source_enum": {
193
+ "type": "array",
194
+ "items": { "type": "string", "minLength": 1 },
195
+ "uniqueItems": true
196
+ },
197
+ "note": { "type": "string" }
198
+ }
199
+ },
200
+ "conformance": { "type": "string" },
201
+ "spec_ref": { "type": "string" }
202
+ }
203
+ },
204
+ "provisioning": {
205
+ "type": "object",
206
+ "required": [
207
+ "verbs",
208
+ "step_required_fields",
209
+ "system_enum",
210
+ "mode_enum"
211
+ ],
212
+ "additionalProperties": false,
213
+ "properties": {
214
+ "description": { "type": "string" },
215
+ "verbs": {
216
+ "type": "object",
217
+ "additionalProperties": { "type": "string" }
218
+ },
219
+ "step_required_fields": {
220
+ "type": "array",
221
+ "items": { "type": "string", "minLength": 1 },
222
+ "uniqueItems": true
223
+ },
224
+ "step_optional_fields": {
225
+ "type": "array",
226
+ "items": { "type": "string", "minLength": 1 },
227
+ "uniqueItems": true
228
+ },
229
+ "system_enum": {
230
+ "type": "array",
231
+ "items": { "type": "string", "minLength": 1 },
232
+ "uniqueItems": true
233
+ },
234
+ "mode_enum": {
235
+ "type": "array",
236
+ "items": { "type": "string", "minLength": 1 },
237
+ "uniqueItems": true
238
+ },
239
+ "edge_relations": {
240
+ "type": "array",
241
+ "items": { "type": "string", "minLength": 1 },
242
+ "uniqueItems": true
243
+ },
244
+ "install_modes": {
245
+ "type": "array",
246
+ "items": { "type": "string", "minLength": 1 },
247
+ "uniqueItems": true
248
+ },
249
+ "id_remap": { "type": "string" },
250
+ "upgrade": { "type": "string" },
251
+ "conformance": { "type": "string" },
252
+ "spec_ref": { "type": "string" }
253
+ }
254
+ },
255
+ "runtime": {
256
+ "type": "object",
257
+ "required": [
258
+ "trigger_types",
259
+ "misfire_policies",
260
+ "concurrency_policies",
261
+ "task_instantiation_fields",
262
+ "run_statuses",
263
+ "idempotency_basis"
264
+ ],
265
+ "additionalProperties": false,
266
+ "properties": {
267
+ "description": { "type": "string" },
268
+ "trigger_types": {
269
+ "type": "array",
270
+ "items": { "type": "string", "minLength": 1 },
271
+ "uniqueItems": true
272
+ },
273
+ "misfire_policies": {
274
+ "type": "array",
275
+ "items": { "type": "string", "minLength": 1 },
276
+ "uniqueItems": true
277
+ },
278
+ "concurrency_policies": {
279
+ "type": "array",
280
+ "items": { "type": "string", "minLength": 1 },
281
+ "uniqueItems": true
282
+ },
283
+ "task_instantiation_fields": {
284
+ "type": "array",
285
+ "items": { "type": "string", "minLength": 1 },
286
+ "uniqueItems": true
287
+ },
288
+ "run_statuses": {
289
+ "type": "array",
290
+ "items": { "type": "string", "minLength": 1 },
291
+ "uniqueItems": true
292
+ },
293
+ "idempotency_basis": { "type": "string" },
294
+ "spec_ref": { "type": "string" }
295
+ }
296
+ },
297
+ "semantic": {
298
+ "type": "object",
299
+ "required": [
300
+ "version",
301
+ "identity_fields",
302
+ "surface_fields",
303
+ "relation_fields",
304
+ "renderable_fields",
305
+ "language_pattern",
306
+ "safe_default"
307
+ ],
308
+ "additionalProperties": false,
309
+ "properties": {
310
+ "version": { "type": "integer", "minimum": 1 },
311
+ "identity_fields": {
312
+ "type": "array",
313
+ "items": { "type": "string", "minLength": 1 },
314
+ "uniqueItems": true
315
+ },
316
+ "surface_fields": {
317
+ "type": "array",
318
+ "items": { "type": "string", "minLength": 1 },
319
+ "uniqueItems": true
320
+ },
321
+ "relation_fields": {
322
+ "type": "array",
323
+ "items": { "type": "string", "minLength": 1 },
324
+ "uniqueItems": true
325
+ },
326
+ "renderable_fields": {
327
+ "type": "array",
328
+ "items": { "type": "string", "minLength": 1 },
329
+ "uniqueItems": true
330
+ },
331
+ "language_pattern": { "type": "string", "minLength": 1 },
332
+ "safe_default": { "type": "string", "minLength": 1 },
333
+ "spec_ref": { "type": "string" }
334
+ }
335
+ },
336
+ "reserved_keys": {
337
+ "type": "array",
338
+ "items": { "type": "string", "minLength": 1 },
339
+ "uniqueItems": true
340
+ },
341
+ "host_field_prefix": { "type": "string", "minLength": 1 },
342
+ "spec_ref_reserved": { "type": "string" }
343
+ },
344
+ "$defs": {
345
+ "primitiveDefinition": {
346
+ "type": "object",
347
+ "required": [
348
+ "family",
349
+ "append_only",
350
+ "portability",
351
+ "required_fields"
352
+ ],
353
+ "additionalProperties": false,
354
+ "properties": {
355
+ "family": {
356
+ "type": "string",
357
+ "minLength": 1
358
+ },
359
+ "canonical_filename": {
360
+ "type": ["string", "null"]
361
+ },
362
+ "canonical_path": {
363
+ "type": ["string", "null"]
364
+ },
365
+ "filename_convention": {
366
+ "type": "string"
367
+ },
368
+ "append_only": {
369
+ "type": "boolean"
370
+ },
371
+ "portability": {
372
+ "type": "string",
373
+ "enum": ["structural", "tenant_private", "resource_bound"]
374
+ },
375
+ "required_fields": {
376
+ "type": "array",
377
+ "items": { "type": "string", "minLength": 1 },
378
+ "uniqueItems": true
379
+ },
380
+ "optional_fields": {
381
+ "type": "array",
382
+ "items": { "type": "string", "minLength": 1 },
383
+ "uniqueItems": true
384
+ },
385
+ "required_when": {
386
+ "type": "object",
387
+ "propertyNames": {
388
+ "type": "string",
389
+ "pattern": "^[A-Za-z_][A-Za-z0-9_-]*==.+$"
390
+ },
391
+ "additionalProperties": {
392
+ "type": "array",
393
+ "items": { "type": "string", "minLength": 1 },
394
+ "uniqueItems": true
395
+ }
396
+ },
397
+ "enums": {
398
+ "type": "object",
399
+ "propertyNames": {
400
+ "type": "string",
401
+ "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$"
402
+ },
403
+ "additionalProperties": {
404
+ "type": "array",
405
+ "items": { "type": "string", "minLength": 1 },
406
+ "uniqueItems": true
407
+ }
408
+ },
409
+ "patterns": {
410
+ "type": "object",
411
+ "propertyNames": {
412
+ "type": "string",
413
+ "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$"
414
+ },
415
+ "additionalProperties": {
416
+ "type": "string",
417
+ "minLength": 1
418
+ }
419
+ },
420
+ "immutable_fields": {
421
+ "type": "array",
422
+ "items": { "type": "string", "minLength": 1 },
423
+ "uniqueItems": true
424
+ },
425
+ "references": {
426
+ "type": "object",
427
+ "propertyNames": {
428
+ "type": "string",
429
+ "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$"
430
+ },
431
+ "additionalProperties": {
432
+ "type": "object",
433
+ "additionalProperties": false,
434
+ "properties": {
435
+ "allowed_types": {
436
+ "type": "array",
437
+ "items": { "type": "string", "minLength": 1 },
438
+ "uniqueItems": true
439
+ },
440
+ "disallowed_types": {
441
+ "type": "array",
442
+ "items": { "type": "string", "minLength": 1 },
443
+ "uniqueItems": true
444
+ },
445
+ "allowed_portability": {
446
+ "type": "array",
447
+ "items": {
448
+ "type": "string",
449
+ "enum": ["structural", "tenant_private", "resource_bound"]
450
+ },
451
+ "uniqueItems": true
452
+ },
453
+ "must_exist": {
454
+ "type": "boolean"
455
+ },
456
+ "hash_field": {
457
+ "type": "string",
458
+ "pattern": "^[A-Za-z_][A-Za-z0-9_-]*$"
459
+ }
460
+ }
461
+ }
462
+ },
463
+ "aliases": {
464
+ "type": "array",
465
+ "items": {
466
+ "type": "string",
467
+ "pattern": "^(?:[a-z][a-z0-9_-]{0,63}:)?[a-z][a-z0-9_-]{0,127}$"
468
+ },
469
+ "uniqueItems": true
470
+ },
471
+ "deprecated": {
472
+ "type": "boolean"
473
+ },
474
+ "deprecation_notice": {
475
+ "type": "string"
476
+ },
477
+ "resource": {
478
+ "type": "object",
479
+ "additionalProperties": false,
480
+ "properties": {
481
+ "kind": { "type": "string" },
482
+ "binds": {
483
+ "type": "array",
484
+ "items": { "type": "string", "minLength": 1 },
485
+ "uniqueItems": true
486
+ },
487
+ "provision_relation": { "type": "string" }
488
+ }
489
+ },
490
+ "notes": {
491
+ "type": "string"
492
+ },
493
+ "description": {
494
+ "type": "string"
495
+ },
496
+ "projection_strategy": {
497
+ "type": "string"
498
+ },
499
+ "scopes": {
500
+ "type": "array",
501
+ "items": {
502
+ "type": "string",
503
+ "enum": ["system", "account", "workspace", "user"]
504
+ },
505
+ "uniqueItems": true
506
+ },
507
+ "capabilities": {
508
+ "type": "object",
509
+ "additionalProperties": {
510
+ "type": "array",
511
+ "items": { "type": "string", "minLength": 1 },
512
+ "uniqueItems": true
513
+ }
514
+ },
515
+ "events": {
516
+ "type": "array"
517
+ },
518
+ "projections": {
519
+ "type": "array"
520
+ },
521
+ "ui": {
522
+ "type": "object"
523
+ },
524
+ "migrations": {
525
+ "type": "array"
526
+ },
527
+ "primitive_version": {
528
+ "type": "integer",
529
+ "minimum": 1
530
+ },
531
+ "primitive_revision": {
532
+ "type": "integer",
533
+ "minimum": 1
534
+ },
535
+ "authored_language": {
536
+ "type": ["string", "null"]
537
+ },
538
+ "spec_ref": {
539
+ "type": "string"
540
+ }
541
+ }
542
+ },
543
+ "contractPrimitive": {
544
+ "type": "object",
545
+ "required": ["purpose", "spec_ref"],
546
+ "additionalProperties": false,
547
+ "properties": {
548
+ "purpose": { "type": "string", "minLength": 1 },
549
+ "spec_ref": { "type": "string", "minLength": 1 }
550
+ }
551
+ }
552
+ }
553
+ }
@@ -84,20 +84,19 @@ permissions:
84
84
  - "write:task"
85
85
  ---
86
86
  Full access to all festival operations.`,
87
- // resource_bound — declares "this business needs a domain"; the SELLER's domain never ships
88
- 'domains/festival.md':
87
+ // resource_bound — declares "this business needs an external domain resource"; the SELLER's bound value never ships
88
+ 'resources/domain.md':
89
89
  `---
90
- type: domain
90
+ type: resource
91
91
  title: Festival Domain Requirement
92
92
  description: Domain resource requirement that the buyer binds during provisioning.
93
93
  timestamp: 2026-07-02T00:00:00Z
94
- domain_name: REQUIREMENT
95
- registrar: REQUIREMENT
96
- status: required
97
- payment_status: unbound
98
- x_portability: resource_bound
94
+ name: Festival Domain
95
+ kind: domain
96
+ status: pending
97
+ binds: festival.example
99
98
  ---
100
- This festival needs a domain. The buyer binds their own at provision (owns_domain).`,
99
+ This festival needs a domain. The buyer binds their own at provision.`,
101
100
  // tenant_private — operator's ticket record; MUST be dropped from a sale bundle
102
101
  'tasks/ticket-4821.md':
103
102
  `---
@@ -138,7 +137,7 @@ try {
138
137
  description: 'A complete music-festival operation as a tradeable SSSS bundle.',
139
138
  version: '1.0.0',
140
139
  exporter: `${PACKAGE.name}@${PACKAGE.version}`,
141
- requiredExtensions: ['festech'],
140
+ requiredExtensions: [],
142
141
  parameters: [
143
142
  { key: 'business_name', label: 'Festival name', type: 'string', scope: 'workspace', source: 'user', required: true },
144
143
  { key: 'domain', label: 'Domain to bind', type: 'string', scope: 'workspace', source: 'user', required: true, description: 'Satisfies the resource_bound domain requirement (owns_domain).' },
@@ -306,6 +306,7 @@ async function checkRecoveryTriggers(root) {
306
306
  const untouched = read(live, 'rules/live.md').includes('in flight');
307
307
  holder.child.kill('SIGKILL');
308
308
  const signal = await holder.exited;
309
+ await new Promise((resolve) => setTimeout(resolve, 50));
309
310
  const afterKill = await fileKernel(live).recover();
310
311
  check('recovery skips an intent whose writer is alive',
311
312
  whileAlive.length === 1 && whileAlive[0].outcome === 'in_flight' && untouched, JSON.stringify(whileAlive));
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Fail-closed documentation parity gate.
4
+ * Verifies all CLI commands and topics are documented.
5
+ */
6
+ import fs from 'node:fs';
7
+ import path from 'node:path';
8
+ import { fileURLToPath } from 'node:url';
9
+
10
+ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
11
+ const SCRIPTS_DIR = path.join(ROOT, 'scripts');
12
+ const OVERVIEW_FILE = path.join(ROOT, 'docs', 'help', 'overview.md');
13
+
14
+ const commands = fs.readdirSync(SCRIPTS_DIR)
15
+ .filter((f) => f.startsWith('cmd-') && f.endsWith('.mjs'))
16
+ .map((f) => f.replace(/^cmd-/, '').replace(/\.mjs$/, ''))
17
+ .sort();
18
+
19
+ if (!fs.existsSync(OVERVIEW_FILE)) {
20
+ console.error('docs/help/overview.md missing!');
21
+ process.exit(1);
22
+ }
23
+
24
+ const overview = fs.readFileSync(OVERVIEW_FILE, 'utf8');
25
+ const missing = [];
26
+
27
+ for (const cmd of commands) {
28
+ if (!overview.includes(`\`${cmd}\``)) {
29
+ missing.push(cmd);
30
+ }
31
+ }
32
+
33
+ if (missing.length > 0) {
34
+ console.error(`Documentation parity failure: commands missing from docs/help/overview.md: ${missing.join(', ')}`);
35
+ process.exit(1);
36
+ }
37
+
38
+ console.log(`ok: documentation parity verified for all ${commands.length} commands.`);