@skillstech/thunderlang 0.1.6

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.
Files changed (72) hide show
  1. package/CHANGELOG.md +375 -0
  2. package/LICENSE +21 -0
  3. package/README.md +165 -0
  4. package/dist/core.cjs +6768 -0
  5. package/dist/index.cjs +9308 -0
  6. package/intent-graph.schema.json +687 -0
  7. package/package.json +84 -0
  8. package/src/ai-core.mjs +67 -0
  9. package/src/ai-events.mjs +56 -0
  10. package/src/ai.mjs +324 -0
  11. package/src/arch.mjs +55 -0
  12. package/src/atlas.mjs +118 -0
  13. package/src/changes.mjs +74 -0
  14. package/src/classification.mjs +36 -0
  15. package/src/cli.mjs +1534 -0
  16. package/src/codegen.mjs +214 -0
  17. package/src/compile.mjs +142 -0
  18. package/src/comprehension.mjs +130 -0
  19. package/src/conflict.mjs +0 -0
  20. package/src/core.d.ts +99 -0
  21. package/src/core.mjs +92 -0
  22. package/src/data-schema.mjs +137 -0
  23. package/src/decision.mjs +38 -0
  24. package/src/distributed.mjs +48 -0
  25. package/src/draft.mjs +101 -0
  26. package/src/drift.mjs +177 -0
  27. package/src/emit.mjs +519 -0
  28. package/src/exporters.mjs +245 -0
  29. package/src/expr.mjs +245 -0
  30. package/src/fable.mjs +110 -0
  31. package/src/focus.mjs +151 -0
  32. package/src/format.mjs +55 -0
  33. package/src/governance.mjs +100 -0
  34. package/src/graph-source.mjs +292 -0
  35. package/src/guard.mjs +105 -0
  36. package/src/guardian.mjs +98 -0
  37. package/src/hash.mjs +89 -0
  38. package/src/importers.mjs +194 -0
  39. package/src/index.d.ts +725 -0
  40. package/src/index.mjs +185 -0
  41. package/src/intellisense.mjs +210 -0
  42. package/src/intent-atlas.mjs +77 -0
  43. package/src/intent-graph.mjs +346 -0
  44. package/src/intent-ir.mjs +144 -0
  45. package/src/intent-schema.mjs +215 -0
  46. package/src/ledger.mjs +109 -0
  47. package/src/lifecycle.mjs +56 -0
  48. package/src/lift.mjs +693 -0
  49. package/src/lsp.mjs +152 -0
  50. package/src/mcp.mjs +158 -0
  51. package/src/migrate.mjs +118 -0
  52. package/src/outcome.mjs +93 -0
  53. package/src/parse.mjs +733 -0
  54. package/src/patch.mjs +364 -0
  55. package/src/privacy.mjs +61 -0
  56. package/src/proof-schema.mjs +129 -0
  57. package/src/report.mjs +84 -0
  58. package/src/runtime.mjs +96 -0
  59. package/src/sarif.mjs +88 -0
  60. package/src/scan-queries.mjs +97 -0
  61. package/src/scan.mjs +87 -0
  62. package/src/security.mjs +73 -0
  63. package/src/select.mjs +80 -0
  64. package/src/semantic-diff.mjs +125 -0
  65. package/src/simulate.mjs +106 -0
  66. package/src/style.mjs +250 -0
  67. package/src/sync.mjs +103 -0
  68. package/src/testing.mjs +59 -0
  69. package/src/twelve-factor.mjs +173 -0
  70. package/src/verify-diff.mjs +105 -0
  71. package/src/xml.mjs +87 -0
  72. package/syntaxes/intent.tmLanguage.json +55 -0
@@ -0,0 +1,687 @@
1
+ {
2
+ "schemaVersion": "intent-graph-v1",
3
+ "nodeTypes": [
4
+ "Mission",
5
+ "Actor",
6
+ "Persona",
7
+ "Evidence",
8
+ "Opportunity",
9
+ "Outcome",
10
+ "Metric",
11
+ "Requirement",
12
+ "Constraint",
13
+ "Invariant",
14
+ "Guarantee",
15
+ "Never",
16
+ "Conflict",
17
+ "Journey",
18
+ "ExperienceContract",
19
+ "ExperienceState",
20
+ "Pattern",
21
+ "DesignArtifact",
22
+ "DesignComponent",
23
+ "StyleIntent",
24
+ "Capability",
25
+ "SystemContract",
26
+ "ImplementationMapping",
27
+ "VerificationRule",
28
+ "VerificationResult",
29
+ "Approval",
30
+ "Release",
31
+ "OutcomeContract",
32
+ "OutcomeResult",
33
+ "LearningArtifact",
34
+ "Unknown",
35
+ "Assumption",
36
+ "Question",
37
+ "Lifecycle",
38
+ "LifecycleState",
39
+ "Temporal",
40
+ "Command",
41
+ "Event",
42
+ "FailureHandler",
43
+ "Decision",
44
+ "Rule"
45
+ ],
46
+ "relationshipTypes": [
47
+ "supported_by",
48
+ "derived_from",
49
+ "addresses",
50
+ "targets",
51
+ "measured_by",
52
+ "requires",
53
+ "constrained_by",
54
+ "implemented_by",
55
+ "represented_by",
56
+ "verified_by",
57
+ "approved_by",
58
+ "released_in",
59
+ "resulted_in",
60
+ "contradicts",
61
+ "supersedes",
62
+ "depends_on",
63
+ "blocks",
64
+ "teaches",
65
+ "generated_from",
66
+ "transitions_to"
67
+ ],
68
+ "classifications": [
69
+ "observed",
70
+ "inferred",
71
+ "proposed",
72
+ "assumed",
73
+ "unknown",
74
+ "decided",
75
+ "verified"
76
+ ],
77
+ "diagnostics": [
78
+ {
79
+ "ruleId": "IL-PM-001",
80
+ "area": "product",
81
+ "severity": "warning",
82
+ "blocks": [
83
+ "release"
84
+ ],
85
+ "summary": "Metric has no measurement window."
86
+ },
87
+ {
88
+ "ruleId": "IL-PM-003",
89
+ "area": "product",
90
+ "severity": "warning",
91
+ "blocks": [],
92
+ "summary": "Outcome has no metric."
93
+ },
94
+ {
95
+ "ruleId": "IL-EV-001",
96
+ "area": "evidence",
97
+ "severity": "info",
98
+ "blocks": [],
99
+ "summary": "Evidence has no classification."
100
+ },
101
+ {
102
+ "ruleId": "IL-EV-002",
103
+ "area": "evidence",
104
+ "severity": "warning",
105
+ "blocks": [],
106
+ "summary": "Evidence has an unknown classification."
107
+ },
108
+ {
109
+ "ruleId": "IL-GRAPH-010",
110
+ "area": "graph",
111
+ "severity": "blocker",
112
+ "blocks": [
113
+ "<declared-phase>"
114
+ ],
115
+ "summary": "Unresolved unknown blocks a phase."
116
+ },
117
+ {
118
+ "ruleId": "IL-GRAPH-011",
119
+ "area": "graph",
120
+ "severity": "blocker",
121
+ "blocks": [
122
+ "<declared-phase>"
123
+ ],
124
+ "summary": "Open question blocks a phase."
125
+ },
126
+ {
127
+ "ruleId": "IL-EXP-001",
128
+ "area": "experience",
129
+ "severity": "info",
130
+ "blocks": [],
131
+ "summary": "Experience declares no states."
132
+ },
133
+ {
134
+ "ruleId": "IL-EXP-004",
135
+ "area": "experience",
136
+ "severity": "blocker",
137
+ "blocks": [
138
+ "experience-approval",
139
+ "release"
140
+ ],
141
+ "summary": "Failure state has no recovery path."
142
+ },
143
+ {
144
+ "ruleId": "IL-CONFLICT-001",
145
+ "area": "conflict",
146
+ "severity": "blocker",
147
+ "blocks": [
148
+ "<declared-phase>"
149
+ ],
150
+ "summary": "Declared conflict is unresolved."
151
+ },
152
+ {
153
+ "ruleId": "IL-CONFLICT-010",
154
+ "area": "conflict",
155
+ "severity": "blocker",
156
+ "blocks": [
157
+ "implementation"
158
+ ],
159
+ "summary": "Scope includes and excludes the same item."
160
+ },
161
+ {
162
+ "ruleId": "IL-CONFLICT-011",
163
+ "area": "conflict",
164
+ "severity": "info",
165
+ "blocks": [],
166
+ "summary": "Redundant constraint from multiple roles."
167
+ },
168
+ {
169
+ "ruleId": "IL-CONFLICT-012",
170
+ "area": "conflict",
171
+ "severity": "blocker",
172
+ "blocks": [
173
+ "implementation"
174
+ ],
175
+ "summary": "Directly contradictory constraints."
176
+ },
177
+ {
178
+ "ruleId": "IL-GOV-001",
179
+ "area": "governance",
180
+ "severity": "error",
181
+ "blocks": [],
182
+ "summary": "Waiver names no diagnostic code."
183
+ },
184
+ {
185
+ "ruleId": "IL-GOV-002",
186
+ "area": "governance",
187
+ "severity": "error",
188
+ "blocks": [],
189
+ "summary": "Waiver has no reason."
190
+ },
191
+ {
192
+ "ruleId": "IL-GOV-003",
193
+ "area": "governance",
194
+ "severity": "error",
195
+ "blocks": [],
196
+ "summary": "Waiver names no approver."
197
+ },
198
+ {
199
+ "ruleId": "IL-GOV-004",
200
+ "area": "governance",
201
+ "severity": "warning",
202
+ "blocks": [],
203
+ "summary": "Waiver matches no current diagnostic (stale)."
204
+ },
205
+ {
206
+ "ruleId": "IL-GOV-005",
207
+ "area": "governance",
208
+ "severity": "error",
209
+ "blocks": [],
210
+ "summary": "Waiver has expired."
211
+ },
212
+ {
213
+ "ruleId": "IL-DATA-001",
214
+ "area": "privacy",
215
+ "severity": "blocker",
216
+ "blocks": [
217
+ "release"
218
+ ],
219
+ "summary": "Sensitive data held with no stated purpose."
220
+ },
221
+ {
222
+ "ruleId": "IL-DATA-002",
223
+ "area": "privacy",
224
+ "severity": "warning",
225
+ "blocks": [],
226
+ "summary": "Sensitive data has no retention rule."
227
+ },
228
+ {
229
+ "ruleId": "IL-DATA-003",
230
+ "area": "privacy",
231
+ "severity": "blocker",
232
+ "blocks": [
233
+ "release"
234
+ ],
235
+ "summary": "Sensitive data declares no lawful basis."
236
+ },
237
+ {
238
+ "ruleId": "IL-DATA-004",
239
+ "area": "privacy",
240
+ "severity": "warning",
241
+ "blocks": [],
242
+ "summary": "Data has an unknown classification."
243
+ },
244
+ {
245
+ "ruleId": "IL-DATA-005",
246
+ "area": "privacy",
247
+ "severity": "warning",
248
+ "blocks": [],
249
+ "summary": "Unrecognized lawful basis."
250
+ },
251
+ {
252
+ "ruleId": "IL-DATA-006",
253
+ "area": "privacy",
254
+ "severity": "warning",
255
+ "blocks": [],
256
+ "summary": "Sensitive data exposed as output with no guard."
257
+ },
258
+ {
259
+ "ruleId": "IL-OC-001",
260
+ "area": "outcome",
261
+ "severity": "blocker",
262
+ "blocks": [
263
+ "release"
264
+ ],
265
+ "summary": "Outcome contract has no target (cannot be evaluated)."
266
+ },
267
+ {
268
+ "ruleId": "IL-OC-002",
269
+ "area": "outcome",
270
+ "severity": "warning",
271
+ "blocks": [],
272
+ "summary": "Outcome contract names no metric."
273
+ },
274
+ {
275
+ "ruleId": "IL-OC-003",
276
+ "area": "outcome",
277
+ "severity": "blocker",
278
+ "blocks": [
279
+ "release"
280
+ ],
281
+ "summary": "Outcome contract has no measurement window."
282
+ },
283
+ {
284
+ "ruleId": "IL-OC-004",
285
+ "area": "outcome",
286
+ "severity": "warning",
287
+ "blocks": [],
288
+ "summary": "Outcome contract target is not better than its baseline."
289
+ },
290
+ {
291
+ "ruleId": "IL-OC-005",
292
+ "area": "outcome",
293
+ "severity": "warning",
294
+ "blocks": [],
295
+ "summary": "Outcome contract has a target but no guardrails (the target is gameable)."
296
+ },
297
+ {
298
+ "ruleId": "IL-OC-006",
299
+ "area": "outcome",
300
+ "severity": "info",
301
+ "blocks": [],
302
+ "summary": "Outcome contract has no attribution (correlation is not causation)."
303
+ },
304
+ {
305
+ "ruleId": "IL-DEC-001",
306
+ "area": "decision",
307
+ "severity": "blocker",
308
+ "blocks": [
309
+ "implementation"
310
+ ],
311
+ "summary": "Decision has no default (undefined when no rule matches)."
312
+ },
313
+ {
314
+ "ruleId": "IL-DEC-002",
315
+ "area": "decision",
316
+ "severity": "blocker",
317
+ "blocks": [
318
+ "implementation"
319
+ ],
320
+ "summary": "Two rules fire on the same condition with different results."
321
+ },
322
+ {
323
+ "ruleId": "IL-DEC-003",
324
+ "area": "decision",
325
+ "severity": "info",
326
+ "blocks": [],
327
+ "summary": "Redundant rule, identical to another (dead)."
328
+ },
329
+ {
330
+ "ruleId": "IL-DEC-004",
331
+ "area": "decision",
332
+ "severity": "warning",
333
+ "blocks": [],
334
+ "summary": "Decision has no rules."
335
+ },
336
+ {
337
+ "ruleId": "IL-DIST-001",
338
+ "area": "distributed",
339
+ "severity": "blocker",
340
+ "blocks": [
341
+ "implementation"
342
+ ],
343
+ "summary": "Retry without an idempotency key (duplicates work)."
344
+ },
345
+ {
346
+ "ruleId": "IL-DIST-002",
347
+ "area": "distributed",
348
+ "severity": "blocker",
349
+ "blocks": [
350
+ "implementation"
351
+ ],
352
+ "summary": "Retried or remote command with no timeout."
353
+ },
354
+ {
355
+ "ruleId": "IL-DIST-003",
356
+ "area": "distributed",
357
+ "severity": "blocker",
358
+ "blocks": [
359
+ "implementation"
360
+ ],
361
+ "summary": "At-least-once delivery without duplicate handling."
362
+ },
363
+ {
364
+ "ruleId": "IL-DIST-004",
365
+ "area": "distributed",
366
+ "severity": "blocker",
367
+ "blocks": [
368
+ "implementation"
369
+ ],
370
+ "summary": "Permanent failure with no compensation."
371
+ },
372
+ {
373
+ "ruleId": "IL-DIST-005",
374
+ "area": "distributed",
375
+ "severity": "error",
376
+ "blocks": [],
377
+ "summary": "Handler references an undeclared event."
378
+ },
379
+ {
380
+ "ruleId": "IL-LIFE-001",
381
+ "area": "lifecycle",
382
+ "severity": "error",
383
+ "blocks": [],
384
+ "summary": "Transition references an undefined state."
385
+ },
386
+ {
387
+ "ruleId": "IL-LIFE-002",
388
+ "area": "lifecycle",
389
+ "severity": "warning",
390
+ "blocks": [],
391
+ "summary": "Unreachable state."
392
+ },
393
+ {
394
+ "ruleId": "IL-LIFE-003",
395
+ "area": "lifecycle",
396
+ "severity": "warning",
397
+ "blocks": [],
398
+ "summary": "Non-terminal dead-end state (no way out)."
399
+ },
400
+ {
401
+ "ruleId": "IL-LIFE-004",
402
+ "area": "lifecycle",
403
+ "severity": "warning",
404
+ "blocks": [],
405
+ "summary": "Lifecycle has no initial state."
406
+ },
407
+ {
408
+ "ruleId": "IL-TEMP-001",
409
+ "area": "temporal",
410
+ "severity": "blocker",
411
+ "blocks": [
412
+ "verification"
413
+ ],
414
+ "summary": "Eventually with no time bound (cannot be verified)."
415
+ },
416
+ {
417
+ "ruleId": "IL-STYLE-001",
418
+ "area": "style",
419
+ "severity": "warning",
420
+ "blocks": [],
421
+ "summary": "Style intent binds a token outside the canonical address space."
422
+ },
423
+ {
424
+ "ruleId": "IL-STYLE-002",
425
+ "area": "style",
426
+ "severity": "warning",
427
+ "blocks": [],
428
+ "summary": "Unrecognized accessibility target."
429
+ },
430
+ {
431
+ "ruleId": "IL-STYLE-003",
432
+ "area": "style",
433
+ "severity": "info",
434
+ "blocks": [],
435
+ "summary": "Style intent declares no accessibility target (a proposed claim)."
436
+ },
437
+ {
438
+ "ruleId": "IL-STYLE-004",
439
+ "area": "style",
440
+ "severity": "warning",
441
+ "blocks": [],
442
+ "summary": "Invalid mode token value."
443
+ },
444
+ {
445
+ "ruleId": "IL-STYLE-005",
446
+ "area": "style",
447
+ "severity": "info",
448
+ "blocks": [],
449
+ "summary": "Style intent applies to an undeclared experience."
450
+ },
451
+ {
452
+ "ruleId": "IL-SEC-001",
453
+ "area": "security",
454
+ "severity": "blocker",
455
+ "blocks": [
456
+ "release"
457
+ ],
458
+ "summary": "Secret-typed field travels over the event bus."
459
+ },
460
+ {
461
+ "ruleId": "IL-SEC-002",
462
+ "area": "security",
463
+ "severity": "blocker",
464
+ "blocks": [
465
+ "release"
466
+ ],
467
+ "summary": "API returns a secret with no auth requirement."
468
+ },
469
+ {
470
+ "ruleId": "IL-TYPE-001",
471
+ "area": "type",
472
+ "severity": "info",
473
+ "blocks": [],
474
+ "summary": "Field uses an unrecognized (likely mistyped) type."
475
+ }
476
+ ],
477
+ "jsonSchema": {
478
+ "$schema": "http://json-schema.org/draft-07/schema#",
479
+ "$id": "https://thunderlang.dev/schema/intent-graph-v1.json",
480
+ "title": "Intent Graph",
481
+ "type": "object",
482
+ "required": [
483
+ "schema",
484
+ "missionId",
485
+ "nodes",
486
+ "relationships"
487
+ ],
488
+ "properties": {
489
+ "schema": {
490
+ "const": "intent-graph-v1"
491
+ },
492
+ "missionId": {
493
+ "type": "string"
494
+ },
495
+ "nodes": {
496
+ "type": "array",
497
+ "items": {
498
+ "$ref": "#/definitions/node"
499
+ }
500
+ },
501
+ "relationships": {
502
+ "type": "array",
503
+ "items": {
504
+ "$ref": "#/definitions/relationship"
505
+ }
506
+ },
507
+ "summary": {
508
+ "type": "object"
509
+ }
510
+ },
511
+ "definitions": {
512
+ "node": {
513
+ "type": "object",
514
+ "required": [
515
+ "id",
516
+ "type"
517
+ ],
518
+ "properties": {
519
+ "id": {
520
+ "type": "string"
521
+ },
522
+ "type": {
523
+ "enum": [
524
+ "Mission",
525
+ "Actor",
526
+ "Persona",
527
+ "Evidence",
528
+ "Opportunity",
529
+ "Outcome",
530
+ "Metric",
531
+ "Requirement",
532
+ "Constraint",
533
+ "Invariant",
534
+ "Guarantee",
535
+ "Never",
536
+ "Conflict",
537
+ "Journey",
538
+ "ExperienceContract",
539
+ "ExperienceState",
540
+ "Pattern",
541
+ "DesignArtifact",
542
+ "DesignComponent",
543
+ "StyleIntent",
544
+ "Capability",
545
+ "SystemContract",
546
+ "ImplementationMapping",
547
+ "VerificationRule",
548
+ "VerificationResult",
549
+ "Approval",
550
+ "Release",
551
+ "OutcomeContract",
552
+ "OutcomeResult",
553
+ "LearningArtifact",
554
+ "Unknown",
555
+ "Assumption",
556
+ "Question",
557
+ "Lifecycle",
558
+ "LifecycleState",
559
+ "Temporal",
560
+ "Command",
561
+ "Event",
562
+ "FailureHandler",
563
+ "Decision",
564
+ "Rule"
565
+ ]
566
+ },
567
+ "title": {
568
+ "type": [
569
+ "string",
570
+ "null"
571
+ ]
572
+ },
573
+ "description": {
574
+ "type": [
575
+ "string",
576
+ "null"
577
+ ]
578
+ },
579
+ "status": {
580
+ "type": [
581
+ "string",
582
+ "null"
583
+ ]
584
+ },
585
+ "owner": {
586
+ "type": [
587
+ "string",
588
+ "null"
589
+ ]
590
+ },
591
+ "classification": {
592
+ "type": [
593
+ "string",
594
+ "null"
595
+ ],
596
+ "enum": [
597
+ "observed",
598
+ "inferred",
599
+ "proposed",
600
+ "assumed",
601
+ "unknown",
602
+ "decided",
603
+ "verified",
604
+ null
605
+ ]
606
+ },
607
+ "confidence": {
608
+ "type": [
609
+ "string",
610
+ "null"
611
+ ],
612
+ "enum": [
613
+ "low",
614
+ "medium",
615
+ "high",
616
+ null
617
+ ]
618
+ },
619
+ "source": {
620
+ "type": [
621
+ "string",
622
+ "null"
623
+ ]
624
+ },
625
+ "tags": {
626
+ "type": "array",
627
+ "items": {
628
+ "type": "string"
629
+ }
630
+ },
631
+ "createdTime": {
632
+ "type": [
633
+ "string",
634
+ "null"
635
+ ]
636
+ },
637
+ "updatedTime": {
638
+ "type": [
639
+ "string",
640
+ "null"
641
+ ]
642
+ }
643
+ }
644
+ },
645
+ "relationship": {
646
+ "type": "object",
647
+ "required": [
648
+ "from",
649
+ "type",
650
+ "to"
651
+ ],
652
+ "properties": {
653
+ "from": {
654
+ "type": "string"
655
+ },
656
+ "type": {
657
+ "enum": [
658
+ "supported_by",
659
+ "derived_from",
660
+ "addresses",
661
+ "targets",
662
+ "measured_by",
663
+ "requires",
664
+ "constrained_by",
665
+ "implemented_by",
666
+ "represented_by",
667
+ "verified_by",
668
+ "approved_by",
669
+ "released_in",
670
+ "resulted_in",
671
+ "contradicts",
672
+ "supersedes",
673
+ "depends_on",
674
+ "blocks",
675
+ "teaches",
676
+ "generated_from",
677
+ "transitions_to"
678
+ ]
679
+ },
680
+ "to": {
681
+ "type": "string"
682
+ }
683
+ }
684
+ }
685
+ }
686
+ }
687
+ }