@suss/adapter-python 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/dist/index.cjs CHANGED
@@ -15747,7 +15747,7 @@ function date4(params) {
15747
15747
  // ../../../node_modules/zod/v4/classic/external.js
15748
15748
  config(en_default());
15749
15749
 
15750
- // ../../ir-core/dist/chunk-WRRENYBR.js
15750
+ // ../../ir-core/dist/chunk-XUXN6DIX.js
15751
15751
  function gqlIdentityKey(typeName, fieldName) {
15752
15752
  return `gql:${typeName}.${fieldName}`;
15753
15753
  }
@@ -15757,6 +15757,9 @@ function fnIdentityKey(packageName, exportPath) {
15757
15757
  function busIdentityKey(messageBus, subject) {
15758
15758
  return `bus:${messageBus} ${subject}`;
15759
15759
  }
15760
+ function metricIdentityKey(metricSystem, metricType) {
15761
+ return `metric:${metricSystem} ${metricType}`;
15762
+ }
15760
15763
  function defineBoundarySemantics(definition) {
15761
15764
  return definition;
15762
15765
  }
@@ -15794,6 +15797,9 @@ var FunctionCallSemanticsSchema = external_exports.object({
15794
15797
  var functionCallSemantics = defineBoundarySemantics({
15795
15798
  name: "function-call",
15796
15799
  schema: FunctionCallSemanticsSchema,
15800
+ // A call that never leaves the process does not produce a span, and
15801
+ // the conventions do not name one. All of it is ours.
15802
+ semconv: {},
15797
15803
  behavior: {
15798
15804
  /** A call returns a value, which is not a status and a body. */
15799
15805
  exchangesHttpResponses: false,
@@ -15826,6 +15832,10 @@ var GraphqlOperationSemanticsSchema = external_exports.object({
15826
15832
  var graphqlOperationSemantics = defineBoundarySemantics({
15827
15833
  name: "graphql-operation",
15828
15834
  schema: GraphqlOperationSemanticsSchema,
15835
+ semconv: {
15836
+ operationName: { name: "graphql.operation.name" },
15837
+ operationType: { name: "graphql.operation.type" }
15838
+ },
15829
15839
  behavior: {
15830
15840
  /**
15831
15841
  * An operation gets a data-and-errors document back, which the
@@ -15856,6 +15866,9 @@ var GraphqlResolverSemanticsSchema = external_exports.object({
15856
15866
  var graphqlResolverSemantics = defineBoundarySemantics({
15857
15867
  name: "graphql-resolver",
15858
15868
  schema: GraphqlResolverSemanticsSchema,
15869
+ // The conventions name the operation a client sent, not the
15870
+ // resolver the server ran for one field of it.
15871
+ semconv: {},
15859
15872
  behavior: {
15860
15873
  /** A resolver returns a field value, not a status and a body. */
15861
15874
  exchangesHttpResponses: false,
@@ -15891,8 +15904,11 @@ function channelsPair(a, b) {
15891
15904
  var MessageBusSemanticsSchema = external_exports.object({
15892
15905
  name: external_exports.literal("message-bus"),
15893
15906
  messageBus: external_exports.enum([
15894
- "sqs",
15895
- "sns",
15907
+ // The conventions spell the two AWS buses this way, one with an
15908
+ // underscore and one with a dot, so these are their strings and
15909
+ // not a typo.
15910
+ "aws_sqs",
15911
+ "aws.sns",
15896
15912
  "s3",
15897
15913
  "eventbridge",
15898
15914
  "bullmq",
@@ -15913,6 +15929,10 @@ var MessageBusSemanticsSchema = external_exports.object({
15913
15929
  var messageBusSemantics = defineBoundarySemantics({
15914
15930
  name: "message-bus",
15915
15931
  schema: MessageBusSemanticsSchema,
15932
+ semconv: {
15933
+ messageBus: { name: "messaging.system" },
15934
+ channel: { name: "messaging.destination.name" }
15935
+ },
15916
15936
  behavior: {
15917
15937
  /** A message goes onto the channel and nothing comes back. */
15918
15938
  exchangesHttpResponses: false,
@@ -15970,6 +15990,36 @@ var messageBusSemantics = defineBoundarySemantics({
15970
15990
  }
15971
15991
  }
15972
15992
  });
15993
+ var MetricSemanticsSchema = external_exports.object({
15994
+ name: external_exports.literal("metric"),
15995
+ /** Which system the series lives in: cloud-monitoring, cloudwatch. */
15996
+ metricSystem: external_exports.string(),
15997
+ /**
15998
+ * The type string the system knows the metric by, spelled the way
15999
+ * both sides spell it. Null when the source states one this reader
16000
+ * could not settle, as with a query it could not read: a metric
16001
+ * nobody could name pairs with nothing rather than with whatever
16002
+ * happens to share its source text.
16003
+ */
16004
+ metricType: external_exports.string().nullable()
16005
+ });
16006
+ var metricSemantics = defineBoundarySemantics({
16007
+ name: "metric",
16008
+ schema: MetricSemanticsSchema,
16009
+ // OpenTelemetry knows a metric by its instrument name, and has no
16010
+ // attribute for the system it lives in or the type string it goes by.
16011
+ semconv: {},
16012
+ behavior: {
16013
+ exchangesHttpResponses: false,
16014
+ reportsUnpairedItself: false,
16015
+ identityKey(semantics) {
16016
+ if (semantics.metricType === null) {
16017
+ return null;
16018
+ }
16019
+ return metricIdentityKey(semantics.metricSystem, semantics.metricType);
16020
+ }
16021
+ }
16022
+ });
15973
16023
  var RestSemanticsSchema = external_exports.object({
15974
16024
  name: external_exports.literal("rest"),
15975
16025
  /**
@@ -16025,6 +16075,14 @@ function routePathAdmits(declaredPath, requestPath) {
16025
16075
  var restSemantics = defineBoundarySemantics({
16026
16076
  name: "rest",
16027
16077
  schema: RestSemanticsSchema,
16078
+ semconv: {
16079
+ // A span states the one method a request used, so a route that
16080
+ // responds to every method has nothing to compare.
16081
+ method: { name: "http.request.method", placeholderValues: ["*"] },
16082
+ path: { name: "http.route" }
16083
+ // declaredResponses is a list, and http.response.status_code is
16084
+ // the one status a request got back.
16085
+ },
16028
16086
  behavior: {
16029
16087
  /** A request goes out, a status and a body come back. */
16030
16088
  exchangesHttpResponses: true,
@@ -16113,6 +16171,10 @@ var RuntimeConfigSemanticsSchema = DeployableUnitSchema.extend({
16113
16171
  var runtimeConfigSemantics = defineBoundarySemantics({
16114
16172
  name: "runtime-config",
16115
16173
  schema: RuntimeConfigSemanticsSchema,
16174
+ // service.name and cloud.resource_id name the same deployable, but
16175
+ // instanceName is the deployment template's logical id, which is
16176
+ // neither of those strings.
16177
+ semconv: {},
16116
16178
  behavior: {
16117
16179
  /** A process reads its config at startup, and nothing replies. */
16118
16180
  exchangesHttpResponses: false,
@@ -16123,9 +16185,9 @@ var runtimeConfigSemantics = defineBoundarySemantics({
16123
16185
  var StorageSemanticsSchema = external_exports.object({
16124
16186
  name: external_exports.literal("storage"),
16125
16187
  /**
16126
- * Which store this is: postgres, mysql, sqlite, dynamodb. Two
16127
- * products' containers can share a name, so this keeps them apart,
16128
- * and it is what a finding message calls the store.
16188
+ * Which store this is: postgresql, mysql, aws.dynamodb, or our own
16189
+ * word for one OpenTelemetry never named, such as s3. Two products'
16190
+ * containers can share a name, so this keeps them apart.
16129
16191
  */
16130
16192
  storageSystem: external_exports.string(),
16131
16193
  /**
@@ -16153,6 +16215,14 @@ var StorageSemanticsSchema = external_exports.object({
16153
16215
  var storageSemantics = defineBoundarySemantics({
16154
16216
  name: "storage",
16155
16217
  schema: StorageSemanticsSchema,
16218
+ semconv: {
16219
+ storageSystem: { name: "db.system.name" },
16220
+ // "default" is our word for a source that named no database.
16221
+ scope: { name: "db.namespace", placeholderValues: ["default"] },
16222
+ container: { name: "db.collection.name" }
16223
+ // A secondary index has no attribute of its own, so accessPath
16224
+ // stays our word.
16225
+ },
16156
16226
  behavior: {
16157
16227
  /** A query returns rows or items, not a status and a body. */
16158
16228
  exchangesHttpResponses: false,
@@ -16167,7 +16237,8 @@ var SemanticsSchema = external_exports.discriminatedUnion("name", [
16167
16237
  graphqlOperationSemantics.schema,
16168
16238
  runtimeConfigSemantics.schema,
16169
16239
  storageSemantics.schema,
16170
- messageBusSemantics.schema
16240
+ messageBusSemantics.schema,
16241
+ metricSemantics.schema
16171
16242
  ]);
16172
16243
  var DEFINITIONS = [
16173
16244
  restSemantics,
@@ -16176,7 +16247,8 @@ var DEFINITIONS = [
16176
16247
  graphqlOperationSemantics,
16177
16248
  runtimeConfigSemantics,
16178
16249
  storageSemantics,
16179
- messageBusSemantics
16250
+ messageBusSemantics,
16251
+ metricSemantics
16180
16252
  ];
16181
16253
  var BY_NAME = new Map(
16182
16254
  DEFINITIONS.map((d) => [d.name, d])
@@ -16411,35 +16483,202 @@ var import_datalog2 = require("@suss/datalog");
16411
16483
 
16412
16484
  // ../../resolution/dist/index.js
16413
16485
  var import_datalog = require("@suss/datalog");
16486
+ var VALUE_STEP = (0, import_datalog.constant)("value");
16487
+ var RESULT_STEP = (0, import_datalog.constant)("result");
16414
16488
  var RESOLUTION_RULES = [
16415
- // A value comes to itself; every chain ends at something written out
16416
- // in source, a function or an object.
16489
+ // Aliasing: const x = y, or an identifier referencing a declaration.
16490
+ // A language with a hop of its own, like JavaScript's `.bind`, states
16491
+ // it as a step too, or every question but `comesTo` misses it.
16492
+ (0, import_datalog.rule)("stepsTo", [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("y"), VALUE_STEP], [(0, import_datalog.lit)("binds", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("y"))]),
16493
+ // A name written more than once has the value the last write left
16494
+ // there. The adapter works out which write that is and stays quiet
16495
+ // when control flow decides, so such a name steps nowhere at all.
16496
+ (0, import_datalog.rule)(
16497
+ "stepsTo",
16498
+ [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("y"), VALUE_STEP],
16499
+ [(0, import_datalog.lit)("endsHolding", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("y"))]
16500
+ ),
16501
+ // An import steps to what the module exports under that name.
16502
+ (0, import_datalog.rule)(
16503
+ "stepsTo",
16504
+ [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("value"), VALUE_STEP],
16505
+ [
16506
+ (0, import_datalog.lit)("imports", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n")),
16507
+ (0, import_datalog.lit)("moduleExport", (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("value"))
16508
+ ]
16509
+ ),
16510
+ // A parameter steps to what a call passes it. A function called from
16511
+ // several places leaves its parameter with more than one value, and a
16512
+ // caller that needs those apart asks `paramAt`.
16513
+ (0, import_datalog.rule)(
16514
+ "stepsTo",
16515
+ [(0, import_datalog.variable)("p"), (0, import_datalog.variable)("a"), VALUE_STEP],
16516
+ [(0, import_datalog.lit)("passesArgument", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("p"), (0, import_datalog.variable)("a"))]
16517
+ ),
16518
+ // Reading a property steps to what the object contains under that
16519
+ // name, whichever way the object arrived: `routes.list` off a name,
16520
+ // or `make(body).handle` off a call.
16521
+ (0, import_datalog.rule)(
16522
+ "stepsTo",
16523
+ [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("held"), VALUE_STEP],
16524
+ [
16525
+ (0, import_datalog.lit)("readsProperty", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("o"), (0, import_datalog.variable)("n")),
16526
+ (0, import_datalog.lit)("objectOf", (0, import_datalog.variable)("o"), (0, import_datalog.variable)("obj")),
16527
+ (0, import_datalog.lit)("contains", (0, import_datalog.variable)("obj"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("held"))
16528
+ ]
16529
+ ),
16530
+ // Calling a class makes one of it, so the call steps to the class and
16531
+ // a method read off the result is the one the class declares. The
16532
+ // caveat below is about a factory function, and a class is not one.
16533
+ (0, import_datalog.rule)(
16534
+ "stepsTo",
16535
+ [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("cls"), VALUE_STEP],
16536
+ [
16537
+ (0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c")),
16538
+ (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("c"), (0, import_datalog.variable)("cls")),
16539
+ (0, import_datalog.lit)("objectValue", (0, import_datalog.variable)("cls"))
16540
+ ]
16541
+ ),
16542
+ // Wrapper transparency, derived: calling a factory that returns a
16543
+ // function which calls its parameter k steps to argument k.
16544
+ (0, import_datalog.rule)(
16545
+ "stepsTo",
16546
+ [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("a"), VALUE_STEP],
16547
+ [
16548
+ (0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c")),
16549
+ (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("c"), (0, import_datalog.variable)("f")),
16550
+ (0, import_datalog.lit)("unwraps", (0, import_datalog.variable)("f"), (0, import_datalog.variable)("k")),
16551
+ (0, import_datalog.lit)("callArg", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("k"), (0, import_datalog.variable)("a"))
16552
+ ]
16553
+ ),
16554
+ // Wrapper transparency, declared: a pack says this callee wraps
16555
+ // argument k. The callee has to come from the library the pack said,
16556
+ // so a local object spelled the same way is not mistaken for it.
16557
+ (0, import_datalog.rule)(
16558
+ "stepsTo",
16559
+ [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("a"), VALUE_STEP],
16560
+ [
16561
+ (0, import_datalog.lit)("calleeName", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("n")),
16562
+ (0, import_datalog.lit)("unwrapsByName", (0, import_datalog.variable)("n"), (0, import_datalog.variable)("k")),
16563
+ (0, import_datalog.lit)("wrapperModule", (0, import_datalog.variable)("n"), (0, import_datalog.variable)("m")),
16564
+ (0, import_datalog.lit)("calleeOrigin", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("m")),
16565
+ (0, import_datalog.lit)("callArg", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("k"), (0, import_datalog.variable)("a"))
16566
+ ]
16567
+ ),
16568
+ // The one step that runs a function forwards: a call steps to what
16569
+ // the function it invokes returns.
16570
+ (0, import_datalog.rule)(
16571
+ "stepsTo",
16572
+ [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("ret"), RESULT_STEP],
16573
+ [(0, import_datalog.lit)("invokes", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("f")), (0, import_datalog.lit)("returnsValue", (0, import_datalog.variable)("f"), (0, import_datalog.variable)("ret"))]
16574
+ ),
16575
+ // Where a walk gets to, and whether it ran a call on the way. A value
16576
+ // step keeps whatever the rest of the walk was, and a result step
16577
+ // makes the whole walk one that ran a call.
16578
+ (0, import_datalog.rule)(
16579
+ "reaches",
16580
+ [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z"), (0, import_datalog.variable)("kind")],
16581
+ [(0, import_datalog.lit)("stepsTo", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("z"), (0, import_datalog.variable)("kind"))]
16582
+ ),
16583
+ (0, import_datalog.rule)(
16584
+ "reaches",
16585
+ [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z"), (0, import_datalog.variable)("kind")],
16586
+ [
16587
+ (0, import_datalog.lit)("stepsTo", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("y"), VALUE_STEP),
16588
+ (0, import_datalog.lit)("reaches", (0, import_datalog.variable)("y"), (0, import_datalog.variable)("z"), (0, import_datalog.variable)("kind"))
16589
+ ]
16590
+ ),
16591
+ // Two rules rather than one leaving the rest of the walk's kind free.
16592
+ // A free kind is a second question about the same relation, and a
16593
+ // demand-driven run then derives both to answer either.
16594
+ (0, import_datalog.rule)(
16595
+ "reaches",
16596
+ [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z"), RESULT_STEP],
16597
+ [
16598
+ (0, import_datalog.lit)("stepsTo", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("y"), RESULT_STEP),
16599
+ (0, import_datalog.lit)("reaches", (0, import_datalog.variable)("y"), (0, import_datalog.variable)("z"), VALUE_STEP)
16600
+ ]
16601
+ ),
16602
+ (0, import_datalog.rule)(
16603
+ "reaches",
16604
+ [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z"), RESULT_STEP],
16605
+ [
16606
+ (0, import_datalog.lit)("stepsTo", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("y"), RESULT_STEP),
16607
+ (0, import_datalog.lit)("reaches", (0, import_datalog.variable)("y"), (0, import_datalog.variable)("z"), RESULT_STEP)
16608
+ ]
16609
+ ),
16610
+ // What a value comes down to: the walk that never ran a call, stopped
16611
+ // at a function or an object. Something already written out comes to
16612
+ // itself, and every other walk ends at one of those.
16417
16613
  (0, import_datalog.rule)("comesTo", [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("x")], [(0, import_datalog.lit)("func", (0, import_datalog.variable)("x"))]),
16418
16614
  (0, import_datalog.rule)("comesTo", [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("x")], [(0, import_datalog.lit)("objectValue", (0, import_datalog.variable)("x"))]),
16419
- // Aliasing: const x = y, or an identifier referencing a declaration.
16420
16615
  (0, import_datalog.rule)(
16421
16616
  "comesTo",
16422
16617
  [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")],
16423
- [(0, import_datalog.lit)("binds", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("y")), (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("y"), (0, import_datalog.variable)("z"))]
16618
+ [(0, import_datalog.lit)("reaches", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("z"), VALUE_STEP), (0, import_datalog.lit)("func", (0, import_datalog.variable)("z"))]
16424
16619
  ),
16425
- // A name written more than once has the value the last write left
16426
- // there, and `binds` says nothing about it. The adapter works out
16427
- // which write that is, in its own language's terms, and stays quiet
16428
- // when control flow decides. A name it stays quiet about comes to no
16429
- // value, which is the answer.
16430
16620
  (0, import_datalog.rule)(
16431
16621
  "comesTo",
16432
16622
  [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")],
16433
- [(0, import_datalog.lit)("endsHolding", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("y")), (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("y"), (0, import_datalog.variable)("z"))]
16623
+ [(0, import_datalog.lit)("reaches", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("z"), VALUE_STEP), (0, import_datalog.lit)("objectValue", (0, import_datalog.variable)("z"))]
16434
16624
  ),
16435
- // An import comes to what the module exports under that name.
16625
+ // The same stopping condition, for the walk that ran a call. A call
16626
+ // gets no `comesTo` answer on purpose: coming back with what a
16627
+ // factory returned would fight the unwrapping answer.
16436
16628
  (0, import_datalog.rule)(
16437
- "comesTo",
16629
+ "givesBack",
16630
+ [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")],
16631
+ [(0, import_datalog.lit)("reaches", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("z"), RESULT_STEP), (0, import_datalog.lit)("func", (0, import_datalog.variable)("z"))]
16632
+ ),
16633
+ (0, import_datalog.rule)(
16634
+ "givesBack",
16438
16635
  [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")],
16636
+ [(0, import_datalog.lit)("reaches", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("z"), RESULT_STEP), (0, import_datalog.lit)("objectValue", (0, import_datalog.variable)("z"))]
16637
+ ),
16638
+ // Following a value to the expression it is written as, whatever kind
16639
+ // that is. A GraphQL document is neither a function nor an object, so
16640
+ // `comesTo` never reaches one.
16641
+ (0, import_datalog.rule)("isWrittenAs", [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("x")], [(0, import_datalog.lit)("writtenValue", (0, import_datalog.variable)("x"))]),
16642
+ (0, import_datalog.rule)("isWrittenAs", [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("x")], [(0, import_datalog.lit)("objectValue", (0, import_datalog.variable)("x"))]),
16643
+ (0, import_datalog.rule)(
16644
+ "isWrittenAs",
16645
+ [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")],
16646
+ [(0, import_datalog.lit)("reaches", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("z"), VALUE_STEP), (0, import_datalog.lit)("writtenValue", (0, import_datalog.variable)("z"))]
16647
+ ),
16648
+ (0, import_datalog.rule)(
16649
+ "isWrittenAs",
16650
+ [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")],
16651
+ [(0, import_datalog.lit)("reaches", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("z"), VALUE_STEP), (0, import_datalog.lit)("objectValue", (0, import_datalog.variable)("z"))]
16652
+ ),
16653
+ // What one call site put in a parameter, told apart from what the
16654
+ // other callers passed.
16655
+ (0, import_datalog.rule)(
16656
+ "paramAt",
16657
+ [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("p"), (0, import_datalog.variable)("z")],
16439
16658
  [
16440
- (0, import_datalog.lit)("imports", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n")),
16441
- (0, import_datalog.lit)("moduleExport", (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("value")),
16442
- (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("value"), (0, import_datalog.variable)("z"))
16659
+ (0, import_datalog.lit)("passesArgument", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("p"), (0, import_datalog.variable)("a")),
16660
+ (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("a"), (0, import_datalog.variable)("z"))
16661
+ ]
16662
+ ),
16663
+ // An argument arriving at the parameter it is passed to, by position
16664
+ // or by the name the caller wrote, keeping the call it went through
16665
+ // so `paramAt` can tell two call sites apart.
16666
+ (0, import_datalog.rule)(
16667
+ "passesArgument",
16668
+ [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("p"), (0, import_datalog.variable)("a")],
16669
+ [
16670
+ (0, import_datalog.lit)("paramOf", (0, import_datalog.variable)("f"), (0, import_datalog.variable)("k"), (0, import_datalog.variable)("p")),
16671
+ (0, import_datalog.lit)("callsFunction", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("f")),
16672
+ (0, import_datalog.lit)("callArg", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("k"), (0, import_datalog.variable)("a"))
16673
+ ]
16674
+ ),
16675
+ (0, import_datalog.rule)(
16676
+ "passesArgument",
16677
+ [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("p"), (0, import_datalog.variable)("a")],
16678
+ [
16679
+ (0, import_datalog.lit)("paramNamed", (0, import_datalog.variable)("f"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("p")),
16680
+ (0, import_datalog.lit)("callsFunction", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("f")),
16681
+ (0, import_datalog.lit)("callKeywordArg", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("a"))
16443
16682
  ]
16444
16683
  ),
16445
16684
  // What a module exports: directly, or through re-export chains.
@@ -16464,12 +16703,22 @@ var RESOLUTION_RULES = [
16464
16703
  (0, import_datalog.lit)("moduleExport", (0, import_datalog.variable)("m2"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("value"))
16465
16704
  ]
16466
16705
  ),
16467
- // The object an expression refers to. A name arrives at one by
16468
- // following `comesTo` through aliases and imports. A factory call
16469
- // arrives at one through what the function it calls returns; the
16470
- // call itself is given no `comesTo`, since a factory call usually IS
16471
- // the wrapper and answering with the raw returned function would
16472
- // fight the unwraps answer.
16706
+ // The function a call runs, written from the call's side because a
16707
+ // caller asking what a call gives back has the call in hand.
16708
+ (0, import_datalog.rule)(
16709
+ "invokes",
16710
+ [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("f")],
16711
+ [(0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c")), (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("c"), (0, import_datalog.variable)("f"))]
16712
+ ),
16713
+ // The callee is itself a call: `daoBuilder()()`.
16714
+ (0, import_datalog.rule)(
16715
+ "invokes",
16716
+ [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("f")],
16717
+ [(0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c")), (0, import_datalog.lit)("givesBack", (0, import_datalog.variable)("c"), (0, import_datalog.variable)("f"))]
16718
+ ),
16719
+ // The object an expression refers to: a name through `comesTo`, a
16720
+ // factory call through what it gives back. Naming the step is what
16721
+ // makes `routes.list` and `make(body).handle` one rule.
16473
16722
  (0, import_datalog.rule)(
16474
16723
  "objectOf",
16475
16724
  [(0, import_datalog.variable)("o"), (0, import_datalog.variable)("obj")],
@@ -16477,14 +16726,8 @@ var RESOLUTION_RULES = [
16477
16726
  ),
16478
16727
  (0, import_datalog.rule)(
16479
16728
  "objectOf",
16480
- [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("obj")],
16481
- [
16482
- (0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c")),
16483
- (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("c"), (0, import_datalog.variable)("f")),
16484
- (0, import_datalog.lit)("returnsValue", (0, import_datalog.variable)("f"), (0, import_datalog.variable)("ret")),
16485
- (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("ret"), (0, import_datalog.variable)("obj")),
16486
- (0, import_datalog.lit)("objectValue", (0, import_datalog.variable)("obj"))
16487
- ]
16729
+ [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("obj")],
16730
+ [(0, import_datalog.lit)("givesBack", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("obj")), (0, import_datalog.lit)("objectValue", (0, import_datalog.variable)("obj"))]
16488
16731
  ),
16489
16732
  // Which calls a function, found by the name the call is written as
16490
16733
  // rather than by resolving every callee in the project. A caller knows
@@ -16517,42 +16760,6 @@ var RESOLUTION_RULES = [
16517
16760
  (0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c"))
16518
16761
  ]
16519
16762
  ),
16520
- // A function whose return is itself a call arrives at the same object
16521
- // that call does, so a chain passing through two factories settles.
16522
- (0, import_datalog.rule)(
16523
- "objectOf",
16524
- [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("obj")],
16525
- [
16526
- (0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c")),
16527
- (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("c"), (0, import_datalog.variable)("f")),
16528
- (0, import_datalog.lit)("returnsValue", (0, import_datalog.variable)("f"), (0, import_datalog.variable)("ret")),
16529
- (0, import_datalog.lit)("objectOf", (0, import_datalog.variable)("ret"), (0, import_datalog.variable)("obj"))
16530
- ]
16531
- ),
16532
- // An argument reaches the parameter it is passed to, by position or
16533
- // by the name the caller wrote. A function called from several places
16534
- // leaves its parameter with more than one value, and the caller
16535
- // decides what to do about that.
16536
- (0, import_datalog.rule)(
16537
- "comesTo",
16538
- [(0, import_datalog.variable)("p"), (0, import_datalog.variable)("z")],
16539
- [
16540
- (0, import_datalog.lit)("paramOf", (0, import_datalog.variable)("f"), (0, import_datalog.variable)("k"), (0, import_datalog.variable)("p")),
16541
- (0, import_datalog.lit)("callsFunction", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("f")),
16542
- (0, import_datalog.lit)("callArg", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("k"), (0, import_datalog.variable)("a")),
16543
- (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("a"), (0, import_datalog.variable)("z"))
16544
- ]
16545
- ),
16546
- (0, import_datalog.rule)(
16547
- "comesTo",
16548
- [(0, import_datalog.variable)("p"), (0, import_datalog.variable)("z")],
16549
- [
16550
- (0, import_datalog.lit)("paramNamed", (0, import_datalog.variable)("f"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("p")),
16551
- (0, import_datalog.lit)("callsFunction", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("f")),
16552
- (0, import_datalog.lit)("callKeywordArg", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("a")),
16553
- (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("a"), (0, import_datalog.variable)("z"))
16554
- ]
16555
- ),
16556
16763
  // What an object contains, its base class included, so a method the base
16557
16764
  // declares is found on a subclass that never overrode it. A method both
16558
16765
  // declare gives two, and the caller decides. This is its own relation
@@ -16572,33 +16779,8 @@ var RESOLUTION_RULES = [
16572
16779
  (0, import_datalog.lit)("contains", (0, import_datalog.variable)("baseCls"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("held"))
16573
16780
  ]
16574
16781
  ),
16575
- // Calling a class makes one of it, and reading a method off the
16576
- // result finds the method the class declares. The caveat above is
16577
- // about a factory function, and a class is not one.
16578
- (0, import_datalog.rule)(
16579
- "comesTo",
16580
- [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("cls")],
16581
- [
16582
- (0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c")),
16583
- (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("c"), (0, import_datalog.variable)("cls")),
16584
- (0, import_datalog.lit)("objectValue", (0, import_datalog.variable)("cls"))
16585
- ]
16586
- ),
16587
- // Reading a property comes to what the object holds under that name,
16588
- // whichever way the object arrived: `routes.list` off a name, or
16589
- // `make(body).handle` off a call.
16590
- (0, import_datalog.rule)(
16591
- "comesTo",
16592
- [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")],
16593
- [
16594
- (0, import_datalog.lit)("readsProperty", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("o"), (0, import_datalog.variable)("n")),
16595
- (0, import_datalog.lit)("objectOf", (0, import_datalog.variable)("o"), (0, import_datalog.variable)("obj")),
16596
- (0, import_datalog.lit)("contains", (0, import_datalog.variable)("obj"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("held")),
16597
- (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("held"), (0, import_datalog.variable)("z"))
16598
- ]
16599
- ),
16600
- // Wrapper transparency, derived: calling a factory that returns a
16601
- // function which calls its parameter k comes to argument k.
16782
+ // Which function a factory returns, and which of its parameters that
16783
+ // function calls: together they are what makes it a wrapper.
16602
16784
  (0, import_datalog.rule)(
16603
16785
  "returnsFunc",
16604
16786
  [(0, import_datalog.variable)("f"), (0, import_datalog.variable)("g")],
@@ -16659,56 +16841,20 @@ var RESOLUTION_RULES = [
16659
16841
  (0, import_datalog.lit)("paramOf", (0, import_datalog.variable)("f"), (0, import_datalog.variable)("k"), (0, import_datalog.variable)("p"))
16660
16842
  ]
16661
16843
  ),
16662
- (0, import_datalog.rule)(
16663
- "comesTo",
16664
- [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("h")],
16665
- [
16666
- (0, import_datalog.lit)("call", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("c")),
16667
- (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("c"), (0, import_datalog.variable)("f")),
16668
- (0, import_datalog.lit)("unwraps", (0, import_datalog.variable)("f"), (0, import_datalog.variable)("k")),
16669
- (0, import_datalog.lit)("callArg", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("k"), (0, import_datalog.variable)("a")),
16670
- (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("a"), (0, import_datalog.variable)("h"))
16671
- ]
16672
- ),
16673
- // Wrapper transparency, declared: a pack says this callee wraps
16674
- // argument k, whatever its implementation looks like. The callee has
16675
- // to have been imported from the library the pack named, so a local
16676
- // object spelled the same way is not mistaken for it.
16677
- (0, import_datalog.rule)(
16678
- "comesTo",
16679
- [(0, import_datalog.variable)("r"), (0, import_datalog.variable)("h")],
16680
- [
16681
- (0, import_datalog.lit)("calleeName", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("n")),
16682
- (0, import_datalog.lit)("unwrapsByName", (0, import_datalog.variable)("n"), (0, import_datalog.variable)("k")),
16683
- (0, import_datalog.lit)("wrapperModule", (0, import_datalog.variable)("n"), (0, import_datalog.variable)("m")),
16684
- (0, import_datalog.lit)("calleeOrigin", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("m")),
16685
- (0, import_datalog.lit)("callArg", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("k"), (0, import_datalog.variable)("a")),
16686
- (0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("a"), (0, import_datalog.variable)("h"))
16687
- ]
16688
- ),
16689
16844
  // Where a name comes from, when what it refers to lives outside the
16690
- // source being read. `comesTo` ends at something written out, so it
16691
- // never reaches a library's own function, and a project's alias of a
16692
- // library name has no answer at all. This follows the same aliases
16693
- // and barrels in the other direction and answers with the module and
16694
- // the name that module exports.
16845
+ // source being read. A walk ends at something written out in source,
16846
+ // so it never reaches a library's own function.
16695
16847
  (0, import_datalog.rule)(
16696
16848
  "comesFrom",
16697
16849
  [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n")],
16698
16850
  [(0, import_datalog.lit)("imports", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n"))]
16699
16851
  ),
16700
- (0, import_datalog.rule)(
16701
- "comesFrom",
16702
- [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n")],
16703
- [(0, import_datalog.lit)("binds", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("y")), (0, import_datalog.lit)("comesFrom", (0, import_datalog.variable)("y"), (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n"))]
16704
- ),
16705
16852
  (0, import_datalog.rule)(
16706
16853
  "comesFrom",
16707
16854
  [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n")],
16708
16855
  [
16709
- (0, import_datalog.lit)("imports", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("m2"), (0, import_datalog.variable)("n2")),
16710
- (0, import_datalog.lit)("moduleExport", (0, import_datalog.variable)("m2"), (0, import_datalog.variable)("n2"), (0, import_datalog.variable)("value")),
16711
- (0, import_datalog.lit)("comesFrom", (0, import_datalog.variable)("value"), (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n"))
16856
+ (0, import_datalog.lit)("reaches", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("y"), VALUE_STEP),
16857
+ (0, import_datalog.lit)("imports", (0, import_datalog.variable)("y"), (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n"))
16712
16858
  ]
16713
16859
  ),
16714
16860
  // Calling f ends up calling the name n that module m exports. One hop
@@ -16744,36 +16890,6 @@ var RESOLUTION_RULES = [
16744
16890
  "resolves",
16745
16891
  [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")],
16746
16892
  [(0, import_datalog.lit)("comesTo", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")), (0, import_datalog.lit)("func", (0, import_datalog.variable)("z"))]
16747
- ),
16748
- // Following a name to the expression it is written as. A separate
16749
- // relation rather than a widening of `comesTo`, so a caller asking
16750
- // the older question never sees a new answer: a factory call already
16751
- // has an unwrapping answer, and letting it also answer with itself
16752
- // would make that pair ambiguous.
16753
- //
16754
- // The two seeds are the two ways an expression can be written out. An
16755
- // object literal is one of them, and it is the shape a generated
16756
- // GraphQL document takes.
16757
- (0, import_datalog.rule)("isWrittenAs", [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("x")], [(0, import_datalog.lit)("writtenValue", (0, import_datalog.variable)("x"))]),
16758
- (0, import_datalog.rule)("isWrittenAs", [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("x")], [(0, import_datalog.lit)("objectValue", (0, import_datalog.variable)("x"))]),
16759
- (0, import_datalog.rule)(
16760
- "isWrittenAs",
16761
- [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")],
16762
- [(0, import_datalog.lit)("binds", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("y")), (0, import_datalog.lit)("isWrittenAs", (0, import_datalog.variable)("y"), (0, import_datalog.variable)("z"))]
16763
- ),
16764
- (0, import_datalog.rule)(
16765
- "isWrittenAs",
16766
- [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")],
16767
- [(0, import_datalog.lit)("endsHolding", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("y")), (0, import_datalog.lit)("isWrittenAs", (0, import_datalog.variable)("y"), (0, import_datalog.variable)("z"))]
16768
- ),
16769
- (0, import_datalog.rule)(
16770
- "isWrittenAs",
16771
- [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")],
16772
- [
16773
- (0, import_datalog.lit)("imports", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n")),
16774
- (0, import_datalog.lit)("moduleExport", (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n"), (0, import_datalog.variable)("value")),
16775
- (0, import_datalog.lit)("isWrittenAs", (0, import_datalog.variable)("value"), (0, import_datalog.variable)("z"))
16776
- ]
16777
16893
  )
16778
16894
  ];
16779
16895
  var RESOLUTION_QUESTIONS = [
@@ -16805,6 +16921,13 @@ var RESOLUTION_QUESTIONS = [
16805
16921
  [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("z")],
16806
16922
  [(0, import_datalog.lit)("wanted", (0, import_datalog.variable)("x")), (0, import_datalog.lit)("objectOf", (0, import_datalog.variable)("x"), (0, import_datalog.variable)("z"))]
16807
16923
  ),
16924
+ // Keyed by the parameter, since that is what a caller has in hand
16925
+ // when it wants the call sites told apart.
16926
+ (0, import_datalog.rule)(
16927
+ "wantedParamAt",
16928
+ [(0, import_datalog.variable)("p"), (0, import_datalog.variable)("r"), (0, import_datalog.variable)("z")],
16929
+ [(0, import_datalog.lit)("wanted", (0, import_datalog.variable)("p")), (0, import_datalog.lit)("paramAt", (0, import_datalog.variable)("r"), (0, import_datalog.variable)("p"), (0, import_datalog.variable)("z"))]
16930
+ ),
16808
16931
  (0, import_datalog.rule)(
16809
16932
  "wantedComesFrom",
16810
16933
  [(0, import_datalog.variable)("x"), (0, import_datalog.variable)("m"), (0, import_datalog.variable)("n")],