@suss/adapter-ruby 0.8.0 → 0.9.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/README.md CHANGED
@@ -130,7 +130,7 @@ storage: [
130
130
  {
131
131
  baseClasses: ["ActiveRecord::Base"],
132
132
  writes: ["update", "destroy", "save", "create", "delete_all"],
133
- storageSystem: "postgres",
133
+ storageSystem: "postgresql",
134
134
  },
135
135
  ]
136
136
  ```
package/dist/index.cjs CHANGED
@@ -15296,7 +15296,7 @@ function date4(params) {
15296
15296
  // ../../../node_modules/zod/v4/classic/external.js
15297
15297
  config(en_default());
15298
15298
 
15299
- // ../../ir-core/dist/chunk-WRRENYBR.js
15299
+ // ../../ir-core/dist/chunk-XUXN6DIX.js
15300
15300
  function gqlIdentityKey(typeName, fieldName) {
15301
15301
  return `gql:${typeName}.${fieldName}`;
15302
15302
  }
@@ -15306,6 +15306,9 @@ function fnIdentityKey(packageName, exportPath) {
15306
15306
  function busIdentityKey(messageBus, subject) {
15307
15307
  return `bus:${messageBus} ${subject}`;
15308
15308
  }
15309
+ function metricIdentityKey(metricSystem, metricType) {
15310
+ return `metric:${metricSystem} ${metricType}`;
15311
+ }
15309
15312
  function defineBoundarySemantics(definition) {
15310
15313
  return definition;
15311
15314
  }
@@ -15343,6 +15346,9 @@ var FunctionCallSemanticsSchema = external_exports.object({
15343
15346
  var functionCallSemantics = defineBoundarySemantics({
15344
15347
  name: "function-call",
15345
15348
  schema: FunctionCallSemanticsSchema,
15349
+ // A call that never leaves the process does not produce a span, and
15350
+ // the conventions do not name one. All of it is ours.
15351
+ semconv: {},
15346
15352
  behavior: {
15347
15353
  /** A call returns a value, which is not a status and a body. */
15348
15354
  exchangesHttpResponses: false,
@@ -15375,6 +15381,10 @@ var GraphqlOperationSemanticsSchema = external_exports.object({
15375
15381
  var graphqlOperationSemantics = defineBoundarySemantics({
15376
15382
  name: "graphql-operation",
15377
15383
  schema: GraphqlOperationSemanticsSchema,
15384
+ semconv: {
15385
+ operationName: { name: "graphql.operation.name" },
15386
+ operationType: { name: "graphql.operation.type" }
15387
+ },
15378
15388
  behavior: {
15379
15389
  /**
15380
15390
  * An operation gets a data-and-errors document back, which the
@@ -15405,6 +15415,9 @@ var GraphqlResolverSemanticsSchema = external_exports.object({
15405
15415
  var graphqlResolverSemantics = defineBoundarySemantics({
15406
15416
  name: "graphql-resolver",
15407
15417
  schema: GraphqlResolverSemanticsSchema,
15418
+ // The conventions name the operation a client sent, not the
15419
+ // resolver the server ran for one field of it.
15420
+ semconv: {},
15408
15421
  behavior: {
15409
15422
  /** A resolver returns a field value, not a status and a body. */
15410
15423
  exchangesHttpResponses: false,
@@ -15440,8 +15453,11 @@ function channelsPair(a, b) {
15440
15453
  var MessageBusSemanticsSchema = external_exports.object({
15441
15454
  name: external_exports.literal("message-bus"),
15442
15455
  messageBus: external_exports.enum([
15443
- "sqs",
15444
- "sns",
15456
+ // The conventions spell the two AWS buses this way, one with an
15457
+ // underscore and one with a dot, so these are their strings and
15458
+ // not a typo.
15459
+ "aws_sqs",
15460
+ "aws.sns",
15445
15461
  "s3",
15446
15462
  "eventbridge",
15447
15463
  "bullmq",
@@ -15462,6 +15478,10 @@ var MessageBusSemanticsSchema = external_exports.object({
15462
15478
  var messageBusSemantics = defineBoundarySemantics({
15463
15479
  name: "message-bus",
15464
15480
  schema: MessageBusSemanticsSchema,
15481
+ semconv: {
15482
+ messageBus: { name: "messaging.system" },
15483
+ channel: { name: "messaging.destination.name" }
15484
+ },
15465
15485
  behavior: {
15466
15486
  /** A message goes onto the channel and nothing comes back. */
15467
15487
  exchangesHttpResponses: false,
@@ -15519,6 +15539,36 @@ var messageBusSemantics = defineBoundarySemantics({
15519
15539
  }
15520
15540
  }
15521
15541
  });
15542
+ var MetricSemanticsSchema = external_exports.object({
15543
+ name: external_exports.literal("metric"),
15544
+ /** Which system the series lives in: cloud-monitoring, cloudwatch. */
15545
+ metricSystem: external_exports.string(),
15546
+ /**
15547
+ * The type string the system knows the metric by, spelled the way
15548
+ * both sides spell it. Null when the source states one this reader
15549
+ * could not settle, as with a query it could not read: a metric
15550
+ * nobody could name pairs with nothing rather than with whatever
15551
+ * happens to share its source text.
15552
+ */
15553
+ metricType: external_exports.string().nullable()
15554
+ });
15555
+ var metricSemantics = defineBoundarySemantics({
15556
+ name: "metric",
15557
+ schema: MetricSemanticsSchema,
15558
+ // OpenTelemetry knows a metric by its instrument name, and has no
15559
+ // attribute for the system it lives in or the type string it goes by.
15560
+ semconv: {},
15561
+ behavior: {
15562
+ exchangesHttpResponses: false,
15563
+ reportsUnpairedItself: false,
15564
+ identityKey(semantics) {
15565
+ if (semantics.metricType === null) {
15566
+ return null;
15567
+ }
15568
+ return metricIdentityKey(semantics.metricSystem, semantics.metricType);
15569
+ }
15570
+ }
15571
+ });
15522
15572
  var RestSemanticsSchema = external_exports.object({
15523
15573
  name: external_exports.literal("rest"),
15524
15574
  /**
@@ -15574,6 +15624,14 @@ function routePathAdmits(declaredPath, requestPath) {
15574
15624
  var restSemantics = defineBoundarySemantics({
15575
15625
  name: "rest",
15576
15626
  schema: RestSemanticsSchema,
15627
+ semconv: {
15628
+ // A span states the one method a request used, so a route that
15629
+ // responds to every method has nothing to compare.
15630
+ method: { name: "http.request.method", placeholderValues: ["*"] },
15631
+ path: { name: "http.route" }
15632
+ // declaredResponses is a list, and http.response.status_code is
15633
+ // the one status a request got back.
15634
+ },
15577
15635
  behavior: {
15578
15636
  /** A request goes out, a status and a body come back. */
15579
15637
  exchangesHttpResponses: true,
@@ -15662,6 +15720,10 @@ var RuntimeConfigSemanticsSchema = DeployableUnitSchema.extend({
15662
15720
  var runtimeConfigSemantics = defineBoundarySemantics({
15663
15721
  name: "runtime-config",
15664
15722
  schema: RuntimeConfigSemanticsSchema,
15723
+ // service.name and cloud.resource_id name the same deployable, but
15724
+ // instanceName is the deployment template's logical id, which is
15725
+ // neither of those strings.
15726
+ semconv: {},
15665
15727
  behavior: {
15666
15728
  /** A process reads its config at startup, and nothing replies. */
15667
15729
  exchangesHttpResponses: false,
@@ -15672,9 +15734,9 @@ var runtimeConfigSemantics = defineBoundarySemantics({
15672
15734
  var StorageSemanticsSchema = external_exports.object({
15673
15735
  name: external_exports.literal("storage"),
15674
15736
  /**
15675
- * Which store this is: postgres, mysql, sqlite, dynamodb. Two
15676
- * products' containers can share a name, so this keeps them apart,
15677
- * and it is what a finding message calls the store.
15737
+ * Which store this is: postgresql, mysql, aws.dynamodb, or our own
15738
+ * word for one OpenTelemetry never named, such as s3. Two products'
15739
+ * containers can share a name, so this keeps them apart.
15678
15740
  */
15679
15741
  storageSystem: external_exports.string(),
15680
15742
  /**
@@ -15702,6 +15764,14 @@ var StorageSemanticsSchema = external_exports.object({
15702
15764
  var storageSemantics = defineBoundarySemantics({
15703
15765
  name: "storage",
15704
15766
  schema: StorageSemanticsSchema,
15767
+ semconv: {
15768
+ storageSystem: { name: "db.system.name" },
15769
+ // "default" is our word for a source that named no database.
15770
+ scope: { name: "db.namespace", placeholderValues: ["default"] },
15771
+ container: { name: "db.collection.name" }
15772
+ // A secondary index has no attribute of its own, so accessPath
15773
+ // stays our word.
15774
+ },
15705
15775
  behavior: {
15706
15776
  /** A query returns rows or items, not a status and a body. */
15707
15777
  exchangesHttpResponses: false,
@@ -15716,7 +15786,8 @@ var SemanticsSchema = external_exports.discriminatedUnion("name", [
15716
15786
  graphqlOperationSemantics.schema,
15717
15787
  runtimeConfigSemantics.schema,
15718
15788
  storageSemantics.schema,
15719
- messageBusSemantics.schema
15789
+ messageBusSemantics.schema,
15790
+ metricSemantics.schema
15720
15791
  ]);
15721
15792
  var DEFINITIONS = [
15722
15793
  restSemantics,
@@ -15725,7 +15796,8 @@ var DEFINITIONS = [
15725
15796
  graphqlOperationSemantics,
15726
15797
  runtimeConfigSemantics,
15727
15798
  storageSemantics,
15728
- messageBusSemantics
15799
+ messageBusSemantics,
15800
+ metricSemantics
15729
15801
  ];
15730
15802
  var BY_NAME = new Map(
15731
15803
  DEFINITIONS.map((d) => [d.name, d])
package/dist/index.d.cts CHANGED
@@ -167,7 +167,7 @@ interface RbStoragePattern {
167
167
  /** Methods that change what is stored. Anything else reads. */
168
168
  writes: string[];
169
169
  /** Which database is behind the connection, which the project settles. */
170
- storageSystem: "postgres" | "mysql" | "sqlite";
170
+ storageSystem: "postgresql" | "mysql" | "sqlite";
171
171
  }
172
172
  type RubyDiscoveryPattern = GraphqlObjectFields;
173
173
  /** A class or module whose ancestry reaches one of `baseClassNames` declares GraphQL fields through DSL calls in its own body. */
package/dist/index.d.ts CHANGED
@@ -167,7 +167,7 @@ interface RbStoragePattern {
167
167
  /** Methods that change what is stored. Anything else reads. */
168
168
  writes: string[];
169
169
  /** Which database is behind the connection, which the project settles. */
170
- storageSystem: "postgres" | "mysql" | "sqlite";
170
+ storageSystem: "postgresql" | "mysql" | "sqlite";
171
171
  }
172
172
  type RubyDiscoveryPattern = GraphqlObjectFields;
173
173
  /** A class or module whose ancestry reaches one of `baseClassNames` declares GraphQL fields through DSL calls in its own body. */
package/dist/index.js CHANGED
@@ -15245,7 +15245,7 @@ function date4(params) {
15245
15245
  // ../../../node_modules/zod/v4/classic/external.js
15246
15246
  config(en_default());
15247
15247
 
15248
- // ../../ir-core/dist/chunk-WRRENYBR.js
15248
+ // ../../ir-core/dist/chunk-XUXN6DIX.js
15249
15249
  function gqlIdentityKey(typeName, fieldName) {
15250
15250
  return `gql:${typeName}.${fieldName}`;
15251
15251
  }
@@ -15255,6 +15255,9 @@ function fnIdentityKey(packageName, exportPath) {
15255
15255
  function busIdentityKey(messageBus, subject) {
15256
15256
  return `bus:${messageBus} ${subject}`;
15257
15257
  }
15258
+ function metricIdentityKey(metricSystem, metricType) {
15259
+ return `metric:${metricSystem} ${metricType}`;
15260
+ }
15258
15261
  function defineBoundarySemantics(definition) {
15259
15262
  return definition;
15260
15263
  }
@@ -15292,6 +15295,9 @@ var FunctionCallSemanticsSchema = external_exports.object({
15292
15295
  var functionCallSemantics = defineBoundarySemantics({
15293
15296
  name: "function-call",
15294
15297
  schema: FunctionCallSemanticsSchema,
15298
+ // A call that never leaves the process does not produce a span, and
15299
+ // the conventions do not name one. All of it is ours.
15300
+ semconv: {},
15295
15301
  behavior: {
15296
15302
  /** A call returns a value, which is not a status and a body. */
15297
15303
  exchangesHttpResponses: false,
@@ -15324,6 +15330,10 @@ var GraphqlOperationSemanticsSchema = external_exports.object({
15324
15330
  var graphqlOperationSemantics = defineBoundarySemantics({
15325
15331
  name: "graphql-operation",
15326
15332
  schema: GraphqlOperationSemanticsSchema,
15333
+ semconv: {
15334
+ operationName: { name: "graphql.operation.name" },
15335
+ operationType: { name: "graphql.operation.type" }
15336
+ },
15327
15337
  behavior: {
15328
15338
  /**
15329
15339
  * An operation gets a data-and-errors document back, which the
@@ -15354,6 +15364,9 @@ var GraphqlResolverSemanticsSchema = external_exports.object({
15354
15364
  var graphqlResolverSemantics = defineBoundarySemantics({
15355
15365
  name: "graphql-resolver",
15356
15366
  schema: GraphqlResolverSemanticsSchema,
15367
+ // The conventions name the operation a client sent, not the
15368
+ // resolver the server ran for one field of it.
15369
+ semconv: {},
15357
15370
  behavior: {
15358
15371
  /** A resolver returns a field value, not a status and a body. */
15359
15372
  exchangesHttpResponses: false,
@@ -15389,8 +15402,11 @@ function channelsPair(a, b) {
15389
15402
  var MessageBusSemanticsSchema = external_exports.object({
15390
15403
  name: external_exports.literal("message-bus"),
15391
15404
  messageBus: external_exports.enum([
15392
- "sqs",
15393
- "sns",
15405
+ // The conventions spell the two AWS buses this way, one with an
15406
+ // underscore and one with a dot, so these are their strings and
15407
+ // not a typo.
15408
+ "aws_sqs",
15409
+ "aws.sns",
15394
15410
  "s3",
15395
15411
  "eventbridge",
15396
15412
  "bullmq",
@@ -15411,6 +15427,10 @@ var MessageBusSemanticsSchema = external_exports.object({
15411
15427
  var messageBusSemantics = defineBoundarySemantics({
15412
15428
  name: "message-bus",
15413
15429
  schema: MessageBusSemanticsSchema,
15430
+ semconv: {
15431
+ messageBus: { name: "messaging.system" },
15432
+ channel: { name: "messaging.destination.name" }
15433
+ },
15414
15434
  behavior: {
15415
15435
  /** A message goes onto the channel and nothing comes back. */
15416
15436
  exchangesHttpResponses: false,
@@ -15468,6 +15488,36 @@ var messageBusSemantics = defineBoundarySemantics({
15468
15488
  }
15469
15489
  }
15470
15490
  });
15491
+ var MetricSemanticsSchema = external_exports.object({
15492
+ name: external_exports.literal("metric"),
15493
+ /** Which system the series lives in: cloud-monitoring, cloudwatch. */
15494
+ metricSystem: external_exports.string(),
15495
+ /**
15496
+ * The type string the system knows the metric by, spelled the way
15497
+ * both sides spell it. Null when the source states one this reader
15498
+ * could not settle, as with a query it could not read: a metric
15499
+ * nobody could name pairs with nothing rather than with whatever
15500
+ * happens to share its source text.
15501
+ */
15502
+ metricType: external_exports.string().nullable()
15503
+ });
15504
+ var metricSemantics = defineBoundarySemantics({
15505
+ name: "metric",
15506
+ schema: MetricSemanticsSchema,
15507
+ // OpenTelemetry knows a metric by its instrument name, and has no
15508
+ // attribute for the system it lives in or the type string it goes by.
15509
+ semconv: {},
15510
+ behavior: {
15511
+ exchangesHttpResponses: false,
15512
+ reportsUnpairedItself: false,
15513
+ identityKey(semantics) {
15514
+ if (semantics.metricType === null) {
15515
+ return null;
15516
+ }
15517
+ return metricIdentityKey(semantics.metricSystem, semantics.metricType);
15518
+ }
15519
+ }
15520
+ });
15471
15521
  var RestSemanticsSchema = external_exports.object({
15472
15522
  name: external_exports.literal("rest"),
15473
15523
  /**
@@ -15523,6 +15573,14 @@ function routePathAdmits(declaredPath, requestPath) {
15523
15573
  var restSemantics = defineBoundarySemantics({
15524
15574
  name: "rest",
15525
15575
  schema: RestSemanticsSchema,
15576
+ semconv: {
15577
+ // A span states the one method a request used, so a route that
15578
+ // responds to every method has nothing to compare.
15579
+ method: { name: "http.request.method", placeholderValues: ["*"] },
15580
+ path: { name: "http.route" }
15581
+ // declaredResponses is a list, and http.response.status_code is
15582
+ // the one status a request got back.
15583
+ },
15526
15584
  behavior: {
15527
15585
  /** A request goes out, a status and a body come back. */
15528
15586
  exchangesHttpResponses: true,
@@ -15611,6 +15669,10 @@ var RuntimeConfigSemanticsSchema = DeployableUnitSchema.extend({
15611
15669
  var runtimeConfigSemantics = defineBoundarySemantics({
15612
15670
  name: "runtime-config",
15613
15671
  schema: RuntimeConfigSemanticsSchema,
15672
+ // service.name and cloud.resource_id name the same deployable, but
15673
+ // instanceName is the deployment template's logical id, which is
15674
+ // neither of those strings.
15675
+ semconv: {},
15614
15676
  behavior: {
15615
15677
  /** A process reads its config at startup, and nothing replies. */
15616
15678
  exchangesHttpResponses: false,
@@ -15621,9 +15683,9 @@ var runtimeConfigSemantics = defineBoundarySemantics({
15621
15683
  var StorageSemanticsSchema = external_exports.object({
15622
15684
  name: external_exports.literal("storage"),
15623
15685
  /**
15624
- * Which store this is: postgres, mysql, sqlite, dynamodb. Two
15625
- * products' containers can share a name, so this keeps them apart,
15626
- * and it is what a finding message calls the store.
15686
+ * Which store this is: postgresql, mysql, aws.dynamodb, or our own
15687
+ * word for one OpenTelemetry never named, such as s3. Two products'
15688
+ * containers can share a name, so this keeps them apart.
15627
15689
  */
15628
15690
  storageSystem: external_exports.string(),
15629
15691
  /**
@@ -15651,6 +15713,14 @@ var StorageSemanticsSchema = external_exports.object({
15651
15713
  var storageSemantics = defineBoundarySemantics({
15652
15714
  name: "storage",
15653
15715
  schema: StorageSemanticsSchema,
15716
+ semconv: {
15717
+ storageSystem: { name: "db.system.name" },
15718
+ // "default" is our word for a source that named no database.
15719
+ scope: { name: "db.namespace", placeholderValues: ["default"] },
15720
+ container: { name: "db.collection.name" }
15721
+ // A secondary index has no attribute of its own, so accessPath
15722
+ // stays our word.
15723
+ },
15654
15724
  behavior: {
15655
15725
  /** A query returns rows or items, not a status and a body. */
15656
15726
  exchangesHttpResponses: false,
@@ -15665,7 +15735,8 @@ var SemanticsSchema = external_exports.discriminatedUnion("name", [
15665
15735
  graphqlOperationSemantics.schema,
15666
15736
  runtimeConfigSemantics.schema,
15667
15737
  storageSemantics.schema,
15668
- messageBusSemantics.schema
15738
+ messageBusSemantics.schema,
15739
+ metricSemantics.schema
15669
15740
  ]);
15670
15741
  var DEFINITIONS = [
15671
15742
  restSemantics,
@@ -15674,7 +15745,8 @@ var DEFINITIONS = [
15674
15745
  graphqlOperationSemantics,
15675
15746
  runtimeConfigSemantics,
15676
15747
  storageSemantics,
15677
- messageBusSemantics
15748
+ messageBusSemantics,
15749
+ metricSemantics
15678
15750
  ];
15679
15751
  var BY_NAME = new Map(
15680
15752
  DEFINITIONS.map((d) => [d.name, d])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/adapter-ruby",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "description": "Ruby language adapter for suss, parsing source with tree-sitter (WASM), resolving constant nesting with a lexical binder, and emitting raw extractions for the suss pipeline.",
6
6
  "keywords": [
@@ -47,9 +47,9 @@
47
47
  "typecheck": "tsc --noEmit"
48
48
  },
49
49
  "dependencies": {
50
- "@suss/behavioral-ir": "0.8.0",
51
- "@suss/datalog": "0.8.0",
52
- "@suss/extractor": "0.8.0",
50
+ "@suss/behavioral-ir": "0.9.0",
51
+ "@suss/datalog": "0.9.0",
52
+ "@suss/extractor": "0.9.0",
53
53
  "web-tree-sitter": "^0.26.11"
54
54
  },
55
55
  "devDependencies": {