@suss/ir-core 0.22.4 → 0.24.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 +8 -0
- package/dist/{chunk-I4WQM6F5.js → chunk-ODHT5T2Q.js} +13 -0
- package/dist/index.cjs +18 -0
- package/dist/index.d.cts +68 -1
- package/dist/index.d.ts +68 -1
- package/dist/index.js +5 -1
- package/dist/schemas.cjs +13 -0
- package/dist/schemas.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @suss/ir-core
|
|
2
2
|
|
|
3
|
+
Part of [suss](https://github.com/nimbuscloud-ai/suss), which reads both sides of every call in a repository and says where the two disagree.
|
|
4
|
+
|
|
3
5
|
Primitives shared across suss's intermediate representations: the pieces every IR references, in one place that each of them can reach without depending on the others.
|
|
4
6
|
|
|
5
7
|
## What this package is
|
|
@@ -104,6 +106,12 @@ Both `@suss/behavioral-ir` (what code does) and `@suss/intent-ir` (what the team
|
|
|
104
106
|
|
|
105
107
|
v0: type shapes, boundary bindings + constructors, source locations, confidence. Stable surface; new boundary semantics are added as variants.
|
|
106
108
|
|
|
109
|
+
## More
|
|
110
|
+
|
|
111
|
+
- [Documentation](https://nimbuscloud-ai.github.io/suss/)
|
|
112
|
+
- [Every package and pack suss ships](https://nimbuscloud-ai.github.io/suss/reference/packages)
|
|
113
|
+
- [Source and issues](https://github.com/nimbuscloud-ai/suss)
|
|
114
|
+
|
|
107
115
|
## Coverage
|
|
108
116
|
|
|
109
117
|

|
|
@@ -70,6 +70,7 @@ var functionCallSemantics = defineBoundarySemantics({
|
|
|
70
70
|
behavior: {
|
|
71
71
|
/** A call returns a value, which is not a status and a body. */
|
|
72
72
|
exchangesHttpResponses: false,
|
|
73
|
+
leavesTheProcess: false,
|
|
73
74
|
reportsUnpairedItself: false,
|
|
74
75
|
/**
|
|
75
76
|
* In-repo units (components, bare handlers) are keyless by design
|
|
@@ -122,6 +123,7 @@ var graphqlOperationSemantics = defineBoundarySemantics({
|
|
|
122
123
|
* GraphQL contract checker reads. Status codes say nothing here.
|
|
123
124
|
*/
|
|
124
125
|
exchangesHttpResponses: false,
|
|
126
|
+
leavesTheProcess: true,
|
|
125
127
|
reportsUnpairedItself: false,
|
|
126
128
|
identityKey: () => null,
|
|
127
129
|
/** Keyless by design; the dedicated pass pairs it by its document. */
|
|
@@ -155,6 +157,9 @@ var graphqlResolverSemantics = defineBoundarySemantics({
|
|
|
155
157
|
behavior: {
|
|
156
158
|
/** A resolver returns a field value, not a status and a body. */
|
|
157
159
|
exchangesHttpResponses: false,
|
|
160
|
+
// A query somebody sent from outside runs it, even though the
|
|
161
|
+
// server calls the function in its own process.
|
|
162
|
+
leavesTheProcess: true,
|
|
158
163
|
reportsUnpairedItself: false,
|
|
159
164
|
/**
|
|
160
165
|
* `"gql:<TypeName>.<fieldName>"`, or null when the type is null or
|
|
@@ -232,6 +237,7 @@ var messageBusSemantics = defineBoundarySemantics({
|
|
|
232
237
|
behavior: {
|
|
233
238
|
/** A message goes onto the channel and nothing comes back. */
|
|
234
239
|
exchangesHttpResponses: false,
|
|
240
|
+
leavesTheProcess: true,
|
|
235
241
|
/**
|
|
236
242
|
* `checkMessageBus` looks at every channel, including the unused
|
|
237
243
|
* ones, so the generic unmatched lists leave them alone.
|
|
@@ -310,6 +316,7 @@ var metricSemantics = defineBoundarySemantics({
|
|
|
310
316
|
semconv: {},
|
|
311
317
|
behavior: {
|
|
312
318
|
exchangesHttpResponses: false,
|
|
319
|
+
leavesTheProcess: true,
|
|
313
320
|
reportsUnpairedItself: false,
|
|
314
321
|
identityKey(semantics) {
|
|
315
322
|
if (semantics.metricType === null) {
|
|
@@ -731,6 +738,7 @@ var restSemantics = defineBoundarySemantics({
|
|
|
731
738
|
behavior: {
|
|
732
739
|
/** A request goes out, a status and a body come back. */
|
|
733
740
|
exchangesHttpResponses: true,
|
|
741
|
+
leavesTheProcess: true,
|
|
734
742
|
reportsUnpairedItself: false,
|
|
735
743
|
/** `"METHOD /normalized/path"`, or null when either half is missing. */
|
|
736
744
|
identityKey(semantics) {
|
|
@@ -885,6 +893,9 @@ var runtimeConfigSemantics = defineBoundarySemantics({
|
|
|
885
893
|
behavior: {
|
|
886
894
|
/** A process reads its config at startup, and nothing replies. */
|
|
887
895
|
exchangesHttpResponses: false,
|
|
896
|
+
// Whoever deploys the process puts the value there, so the value
|
|
897
|
+
// comes from outside the code.
|
|
898
|
+
leavesTheProcess: true,
|
|
888
899
|
reportsUnpairedItself: false,
|
|
889
900
|
identityKey: () => null
|
|
890
901
|
}
|
|
@@ -941,6 +952,7 @@ var storageSemantics = defineBoundarySemantics({
|
|
|
941
952
|
behavior: {
|
|
942
953
|
/** A query returns rows or items, not a status and a body. */
|
|
943
954
|
exchangesHttpResponses: false,
|
|
955
|
+
leavesTheProcess: true,
|
|
944
956
|
reportsUnpairedItself: false,
|
|
945
957
|
identityKey: () => null,
|
|
946
958
|
displayLabel: storageLabel,
|
|
@@ -994,6 +1006,7 @@ var unitInvocationSemantics = defineBoundarySemantics({
|
|
|
994
1006
|
* and that route gets a REST binding instead of this one.
|
|
995
1007
|
*/
|
|
996
1008
|
exchangesHttpResponses: false,
|
|
1009
|
+
leavesTheProcess: true,
|
|
997
1010
|
/**
|
|
998
1011
|
* A unit nothing in the run invokes is the ordinary case, since
|
|
999
1012
|
* most services are reached from a stack suss never read. So an
|
package/dist/index.cjs
CHANGED
|
@@ -76,6 +76,7 @@ __export(index_exports, {
|
|
|
76
76
|
groundedPairingKey: () => groundedPairingKey,
|
|
77
77
|
hasNameHole: () => hasNameHole,
|
|
78
78
|
isGraphqlOperationBinding: () => isGraphqlOperationBinding,
|
|
79
|
+
leavesTheProcess: () => leavesTheProcess,
|
|
79
80
|
messageBusBinding: () => messageBusBinding,
|
|
80
81
|
methodsAgree: () => methodsAgree,
|
|
81
82
|
metricBinding: () => metricBinding,
|
|
@@ -155,6 +156,7 @@ var graphqlOperationSemantics = defineBoundarySemantics({
|
|
|
155
156
|
* GraphQL contract checker reads. Status codes say nothing here.
|
|
156
157
|
*/
|
|
157
158
|
exchangesHttpResponses: false,
|
|
159
|
+
leavesTheProcess: true,
|
|
158
160
|
reportsUnpairedItself: false,
|
|
159
161
|
identityKey: () => null,
|
|
160
162
|
/** Keyless by design; the dedicated pass pairs it by its document. */
|
|
@@ -231,6 +233,7 @@ var functionCallSemantics = defineBoundarySemantics({
|
|
|
231
233
|
behavior: {
|
|
232
234
|
/** A call returns a value, which is not a status and a body. */
|
|
233
235
|
exchangesHttpResponses: false,
|
|
236
|
+
leavesTheProcess: false,
|
|
234
237
|
reportsUnpairedItself: false,
|
|
235
238
|
/**
|
|
236
239
|
* In-repo units (components, bare handlers) are keyless by design
|
|
@@ -284,6 +287,9 @@ var graphqlResolverSemantics = defineBoundarySemantics({
|
|
|
284
287
|
behavior: {
|
|
285
288
|
/** A resolver returns a field value, not a status and a body. */
|
|
286
289
|
exchangesHttpResponses: false,
|
|
290
|
+
// A query somebody sent from outside runs it, even though the
|
|
291
|
+
// server calls the function in its own process.
|
|
292
|
+
leavesTheProcess: true,
|
|
287
293
|
reportsUnpairedItself: false,
|
|
288
294
|
/**
|
|
289
295
|
* `"gql:<TypeName>.<fieldName>"`, or null when the type is null or
|
|
@@ -361,6 +367,7 @@ var messageBusSemantics = defineBoundarySemantics({
|
|
|
361
367
|
behavior: {
|
|
362
368
|
/** A message goes onto the channel and nothing comes back. */
|
|
363
369
|
exchangesHttpResponses: false,
|
|
370
|
+
leavesTheProcess: true,
|
|
364
371
|
/**
|
|
365
372
|
* `checkMessageBus` looks at every channel, including the unused
|
|
366
373
|
* ones, so the generic unmatched lists leave them alone.
|
|
@@ -439,6 +446,7 @@ var metricSemantics = defineBoundarySemantics({
|
|
|
439
446
|
semconv: {},
|
|
440
447
|
behavior: {
|
|
441
448
|
exchangesHttpResponses: false,
|
|
449
|
+
leavesTheProcess: true,
|
|
442
450
|
reportsUnpairedItself: false,
|
|
443
451
|
identityKey(semantics) {
|
|
444
452
|
if (semantics.metricType === null) {
|
|
@@ -860,6 +868,7 @@ var restSemantics = defineBoundarySemantics({
|
|
|
860
868
|
behavior: {
|
|
861
869
|
/** A request goes out, a status and a body come back. */
|
|
862
870
|
exchangesHttpResponses: true,
|
|
871
|
+
leavesTheProcess: true,
|
|
863
872
|
reportsUnpairedItself: false,
|
|
864
873
|
/** `"METHOD /normalized/path"`, or null when either half is missing. */
|
|
865
874
|
identityKey(semantics) {
|
|
@@ -1014,6 +1023,9 @@ var runtimeConfigSemantics = defineBoundarySemantics({
|
|
|
1014
1023
|
behavior: {
|
|
1015
1024
|
/** A process reads its config at startup, and nothing replies. */
|
|
1016
1025
|
exchangesHttpResponses: false,
|
|
1026
|
+
// Whoever deploys the process puts the value there, so the value
|
|
1027
|
+
// comes from outside the code.
|
|
1028
|
+
leavesTheProcess: true,
|
|
1017
1029
|
reportsUnpairedItself: false,
|
|
1018
1030
|
identityKey: () => null
|
|
1019
1031
|
}
|
|
@@ -1070,6 +1082,7 @@ var storageSemantics = defineBoundarySemantics({
|
|
|
1070
1082
|
behavior: {
|
|
1071
1083
|
/** A query returns rows or items, not a status and a body. */
|
|
1072
1084
|
exchangesHttpResponses: false,
|
|
1085
|
+
leavesTheProcess: true,
|
|
1073
1086
|
reportsUnpairedItself: false,
|
|
1074
1087
|
identityKey: () => null,
|
|
1075
1088
|
displayLabel: storageLabel,
|
|
@@ -1123,6 +1136,7 @@ var unitInvocationSemantics = defineBoundarySemantics({
|
|
|
1123
1136
|
* and that route gets a REST binding instead of this one.
|
|
1124
1137
|
*/
|
|
1125
1138
|
exchangesHttpResponses: false,
|
|
1139
|
+
leavesTheProcess: true,
|
|
1126
1140
|
/**
|
|
1127
1141
|
* A unit nothing in the run invokes is the ordinary case, since
|
|
1128
1142
|
* most services are reached from a stack suss never read. So an
|
|
@@ -1433,6 +1447,9 @@ function normalizeRuleBoundary(raw) {
|
|
|
1433
1447
|
function exchangesHttpResponses(binding) {
|
|
1434
1448
|
return behaviorOf(binding.semantics).exchangesHttpResponses;
|
|
1435
1449
|
}
|
|
1450
|
+
function leavesTheProcess(binding) {
|
|
1451
|
+
return behaviorOf(binding.semantics).leavesTheProcess;
|
|
1452
|
+
}
|
|
1436
1453
|
function canPair(binding) {
|
|
1437
1454
|
const behavior = behaviorOf(binding.semantics);
|
|
1438
1455
|
if (behavior.canPair !== void 0) {
|
|
@@ -1980,6 +1997,7 @@ function metricBinding(opts) {
|
|
|
1980
1997
|
groundedPairingKey,
|
|
1981
1998
|
hasNameHole,
|
|
1982
1999
|
isGraphqlOperationBinding,
|
|
2000
|
+
leavesTheProcess,
|
|
1983
2001
|
messageBusBinding,
|
|
1984
2002
|
methodsAgree,
|
|
1985
2003
|
metricBinding,
|
package/dist/index.d.cts
CHANGED
|
@@ -334,6 +334,13 @@ interface BoundaryBehavior<S extends {
|
|
|
334
334
|
* because nobody remembered to exclude it.
|
|
335
335
|
*/
|
|
336
336
|
exchangesHttpResponses: boolean;
|
|
337
|
+
/**
|
|
338
|
+
* Whether crossing this boundary leaves the process. A report about
|
|
339
|
+
* what a change means for somebody outside the code covers the ones
|
|
340
|
+
* that do; a call from one function in a project to another is a
|
|
341
|
+
* boundary as well, and a reader has the source diff for that.
|
|
342
|
+
*/
|
|
343
|
+
leavesTheProcess: boolean;
|
|
337
344
|
/**
|
|
338
345
|
* Whether this protocol's own pass already reports a boundary that
|
|
339
346
|
* paired with nothing, so the generic unmatched list can leave it out.
|
|
@@ -443,6 +450,64 @@ type UnitInvocationSemantics = z.infer<typeof UnitInvocationSemanticsSchema>;
|
|
|
443
450
|
*/
|
|
444
451
|
declare function semconvAttributes(binding: BoundaryBinding): Record<string, string>;
|
|
445
452
|
|
|
453
|
+
/**
|
|
454
|
+
* What a pack says about itself, for everything that has to know a pack
|
|
455
|
+
* exists without reading its patterns.
|
|
456
|
+
*
|
|
457
|
+
* `suss init` suggests a pack when it sees the library in a project's
|
|
458
|
+
* manifest, and the packages page lists every pack with a line about
|
|
459
|
+
* what it reads. Both used to be tables somebody edited by hand, in the
|
|
460
|
+
* CLI and in a document, and both went stale the release after a pack
|
|
461
|
+
* arrived. A pack states this beside its own patterns instead.
|
|
462
|
+
*/
|
|
463
|
+
/** The manifest a dependency is declared in. */
|
|
464
|
+
type Ecosystem = "npm" | "pypi" | "rubygems";
|
|
465
|
+
/**
|
|
466
|
+
* A value a pack cannot work out from the code, which the project has
|
|
467
|
+
* to write down before the pack reads anything: which directory the
|
|
468
|
+
* classes are under, which file the routes are in.
|
|
469
|
+
*/
|
|
470
|
+
interface PackConfiguration {
|
|
471
|
+
/** Where to write it, relative to the project. */
|
|
472
|
+
file: string;
|
|
473
|
+
/** A starting point, with this project's own values to fill in. */
|
|
474
|
+
example: Record<string, unknown>;
|
|
475
|
+
/** Whether the pack refuses to run without it. */
|
|
476
|
+
required: boolean;
|
|
477
|
+
/** What the value is, in a sentence. */
|
|
478
|
+
why: string;
|
|
479
|
+
}
|
|
480
|
+
interface PackDeclaration {
|
|
481
|
+
/**
|
|
482
|
+
* What the pack contributes. A `framework` pack discovers units, a
|
|
483
|
+
* `client` pack binds a call to the route it reaches, and an
|
|
484
|
+
* `effects` pack recognises calls inside units another pack found, so
|
|
485
|
+
* on its own it comes back empty.
|
|
486
|
+
*/
|
|
487
|
+
kind: "framework" | "client" | "effects";
|
|
488
|
+
/** The npm package that ships the pack, which a project installs. */
|
|
489
|
+
package: string;
|
|
490
|
+
/**
|
|
491
|
+
* What a project has to depend on for this pack to read anything.
|
|
492
|
+
* Several entries mean any one of them, the way react-router ships
|
|
493
|
+
* under two names.
|
|
494
|
+
*/
|
|
495
|
+
dependencies: Array<{
|
|
496
|
+
ecosystem: Ecosystem;
|
|
497
|
+
name: string;
|
|
498
|
+
}>;
|
|
499
|
+
/**
|
|
500
|
+
* Set for a library the language itself ships, which no manifest
|
|
501
|
+
* lists: Ruby's Net::HTTP, the browser's fetch, Node's own surface.
|
|
502
|
+
* Every project in that language is a candidate.
|
|
503
|
+
*/
|
|
504
|
+
shippedWith?: "typescript" | "python" | "ruby";
|
|
505
|
+
/** The line the packages page shows, one sentence, what it reads. */
|
|
506
|
+
reads: string;
|
|
507
|
+
/** Set when the pack needs a value from the project to run at all. */
|
|
508
|
+
configuration?: PackConfiguration;
|
|
509
|
+
}
|
|
510
|
+
|
|
446
511
|
/**
|
|
447
512
|
* Keys for a boundary binding, and whether two of them agree. Every
|
|
448
513
|
* function here asks the binding's protocol and returns whatever it
|
|
@@ -517,6 +582,8 @@ declare function displayLabel(binding: BoundaryBinding): string;
|
|
|
517
582
|
*/
|
|
518
583
|
declare function normalizeRuleBoundary(raw: string): string;
|
|
519
584
|
declare function exchangesHttpResponses(binding: BoundaryBinding): boolean;
|
|
585
|
+
/** Whether crossing this boundary leaves the process. */
|
|
586
|
+
declare function leavesTheProcess(binding: BoundaryBinding): boolean;
|
|
520
587
|
/**
|
|
521
588
|
* Whether anything can pair with this binding: it has a pairing key,
|
|
522
589
|
* or its protocol pairs keyless boundaries in a dedicated pass.
|
|
@@ -1008,4 +1075,4 @@ declare function metricBinding(opts: {
|
|
|
1008
1075
|
metricType: string | null;
|
|
1009
1076
|
}): BoundaryBinding;
|
|
1010
1077
|
|
|
1011
|
-
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundaryName, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, DeployableUnit, type Deployment, type DispatchTable, type EffectRelation, EffectRelationSchema, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type HoleRange, type MatchResult, MessageBusSemantics, MessageBusTechnology, type MetricIdentityKey, type MetricSemantics, MetricSemanticsSchema, NOTHING_DEPLOYED, type NamePart, type ParsedChannel, type Reference, type Relation, RelationSchema, Semantics, type SemconvAttribute, type SemconvMapping, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, type UnitIdentityKey, type UnitInvocationSemantics, UnitInvocationSemanticsSchema, applySuppressionsToFindings, bindingIs, bindingTokens, bodyShapesMatch, boundaryKey, boundaryLabel, boundaryNameString, bucketRank, bucketsMeet, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, compareRanks, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fixedTextLength, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, groundBinding, groundedPairingKey, hasNameHole, isGraphqlOperationBinding, messageBusBinding, metricBinding, metricIdentityKey, namePatternFromSub, namePatternKey, nameReference, namesAgree, namesBoundary, namesBoundaryExactly, namesNothing, normalizeRuleBoundary, packageExportBinding, pairingKey, parseBoundaryName, parseChannel, pathAfterOrigin, patternHole, rangedHole, referenceFromName, referenceName, referenceOf, reportsUnpairedItself, resourceNameIn, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, semconvAttributes, servesRequest, setPiece, spansBuckets, spellingTokens, statesAnOrigin, storageBinding, unitIdentityKey, unitInvocationBinding, validateRule, withRewrittenPaths, withinScope };
|
|
1078
|
+
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundaryName, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, DeployableUnit, type Deployment, type DispatchTable, type Ecosystem, type EffectRelation, EffectRelationSchema, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type HoleRange, type MatchResult, MessageBusSemantics, MessageBusTechnology, type MetricIdentityKey, type MetricSemantics, MetricSemanticsSchema, NOTHING_DEPLOYED, type NamePart, type PackConfiguration, type PackDeclaration, type ParsedChannel, type Reference, type Relation, RelationSchema, Semantics, type SemconvAttribute, type SemconvMapping, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, type UnitIdentityKey, type UnitInvocationSemantics, UnitInvocationSemanticsSchema, applySuppressionsToFindings, bindingIs, bindingTokens, bodyShapesMatch, boundaryKey, boundaryLabel, boundaryNameString, bucketRank, bucketsMeet, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, compareRanks, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fixedTextLength, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, groundBinding, groundedPairingKey, hasNameHole, isGraphqlOperationBinding, leavesTheProcess, messageBusBinding, metricBinding, metricIdentityKey, namePatternFromSub, namePatternKey, nameReference, namesAgree, namesBoundary, namesBoundaryExactly, namesNothing, normalizeRuleBoundary, packageExportBinding, pairingKey, parseBoundaryName, parseChannel, pathAfterOrigin, patternHole, rangedHole, referenceFromName, referenceName, referenceOf, reportsUnpairedItself, resourceNameIn, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, semconvAttributes, servesRequest, setPiece, spansBuckets, spellingTokens, statesAnOrigin, storageBinding, unitIdentityKey, unitInvocationBinding, validateRule, withRewrittenPaths, withinScope };
|
package/dist/index.d.ts
CHANGED
|
@@ -334,6 +334,13 @@ interface BoundaryBehavior<S extends {
|
|
|
334
334
|
* because nobody remembered to exclude it.
|
|
335
335
|
*/
|
|
336
336
|
exchangesHttpResponses: boolean;
|
|
337
|
+
/**
|
|
338
|
+
* Whether crossing this boundary leaves the process. A report about
|
|
339
|
+
* what a change means for somebody outside the code covers the ones
|
|
340
|
+
* that do; a call from one function in a project to another is a
|
|
341
|
+
* boundary as well, and a reader has the source diff for that.
|
|
342
|
+
*/
|
|
343
|
+
leavesTheProcess: boolean;
|
|
337
344
|
/**
|
|
338
345
|
* Whether this protocol's own pass already reports a boundary that
|
|
339
346
|
* paired with nothing, so the generic unmatched list can leave it out.
|
|
@@ -443,6 +450,64 @@ type UnitInvocationSemantics = z.infer<typeof UnitInvocationSemanticsSchema>;
|
|
|
443
450
|
*/
|
|
444
451
|
declare function semconvAttributes(binding: BoundaryBinding): Record<string, string>;
|
|
445
452
|
|
|
453
|
+
/**
|
|
454
|
+
* What a pack says about itself, for everything that has to know a pack
|
|
455
|
+
* exists without reading its patterns.
|
|
456
|
+
*
|
|
457
|
+
* `suss init` suggests a pack when it sees the library in a project's
|
|
458
|
+
* manifest, and the packages page lists every pack with a line about
|
|
459
|
+
* what it reads. Both used to be tables somebody edited by hand, in the
|
|
460
|
+
* CLI and in a document, and both went stale the release after a pack
|
|
461
|
+
* arrived. A pack states this beside its own patterns instead.
|
|
462
|
+
*/
|
|
463
|
+
/** The manifest a dependency is declared in. */
|
|
464
|
+
type Ecosystem = "npm" | "pypi" | "rubygems";
|
|
465
|
+
/**
|
|
466
|
+
* A value a pack cannot work out from the code, which the project has
|
|
467
|
+
* to write down before the pack reads anything: which directory the
|
|
468
|
+
* classes are under, which file the routes are in.
|
|
469
|
+
*/
|
|
470
|
+
interface PackConfiguration {
|
|
471
|
+
/** Where to write it, relative to the project. */
|
|
472
|
+
file: string;
|
|
473
|
+
/** A starting point, with this project's own values to fill in. */
|
|
474
|
+
example: Record<string, unknown>;
|
|
475
|
+
/** Whether the pack refuses to run without it. */
|
|
476
|
+
required: boolean;
|
|
477
|
+
/** What the value is, in a sentence. */
|
|
478
|
+
why: string;
|
|
479
|
+
}
|
|
480
|
+
interface PackDeclaration {
|
|
481
|
+
/**
|
|
482
|
+
* What the pack contributes. A `framework` pack discovers units, a
|
|
483
|
+
* `client` pack binds a call to the route it reaches, and an
|
|
484
|
+
* `effects` pack recognises calls inside units another pack found, so
|
|
485
|
+
* on its own it comes back empty.
|
|
486
|
+
*/
|
|
487
|
+
kind: "framework" | "client" | "effects";
|
|
488
|
+
/** The npm package that ships the pack, which a project installs. */
|
|
489
|
+
package: string;
|
|
490
|
+
/**
|
|
491
|
+
* What a project has to depend on for this pack to read anything.
|
|
492
|
+
* Several entries mean any one of them, the way react-router ships
|
|
493
|
+
* under two names.
|
|
494
|
+
*/
|
|
495
|
+
dependencies: Array<{
|
|
496
|
+
ecosystem: Ecosystem;
|
|
497
|
+
name: string;
|
|
498
|
+
}>;
|
|
499
|
+
/**
|
|
500
|
+
* Set for a library the language itself ships, which no manifest
|
|
501
|
+
* lists: Ruby's Net::HTTP, the browser's fetch, Node's own surface.
|
|
502
|
+
* Every project in that language is a candidate.
|
|
503
|
+
*/
|
|
504
|
+
shippedWith?: "typescript" | "python" | "ruby";
|
|
505
|
+
/** The line the packages page shows, one sentence, what it reads. */
|
|
506
|
+
reads: string;
|
|
507
|
+
/** Set when the pack needs a value from the project to run at all. */
|
|
508
|
+
configuration?: PackConfiguration;
|
|
509
|
+
}
|
|
510
|
+
|
|
446
511
|
/**
|
|
447
512
|
* Keys for a boundary binding, and whether two of them agree. Every
|
|
448
513
|
* function here asks the binding's protocol and returns whatever it
|
|
@@ -517,6 +582,8 @@ declare function displayLabel(binding: BoundaryBinding): string;
|
|
|
517
582
|
*/
|
|
518
583
|
declare function normalizeRuleBoundary(raw: string): string;
|
|
519
584
|
declare function exchangesHttpResponses(binding: BoundaryBinding): boolean;
|
|
585
|
+
/** Whether crossing this boundary leaves the process. */
|
|
586
|
+
declare function leavesTheProcess(binding: BoundaryBinding): boolean;
|
|
520
587
|
/**
|
|
521
588
|
* Whether anything can pair with this binding: it has a pairing key,
|
|
522
589
|
* or its protocol pairs keyless boundaries in a dedicated pass.
|
|
@@ -1008,4 +1075,4 @@ declare function metricBinding(opts: {
|
|
|
1008
1075
|
metricType: string | null;
|
|
1009
1076
|
}): BoundaryBinding;
|
|
1010
1077
|
|
|
1011
|
-
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundaryName, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, DeployableUnit, type Deployment, type DispatchTable, type EffectRelation, EffectRelationSchema, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type HoleRange, type MatchResult, MessageBusSemantics, MessageBusTechnology, type MetricIdentityKey, type MetricSemantics, MetricSemanticsSchema, NOTHING_DEPLOYED, type NamePart, type ParsedChannel, type Reference, type Relation, RelationSchema, Semantics, type SemconvAttribute, type SemconvMapping, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, type UnitIdentityKey, type UnitInvocationSemantics, UnitInvocationSemanticsSchema, applySuppressionsToFindings, bindingIs, bindingTokens, bodyShapesMatch, boundaryKey, boundaryLabel, boundaryNameString, bucketRank, bucketsMeet, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, compareRanks, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fixedTextLength, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, groundBinding, groundedPairingKey, hasNameHole, isGraphqlOperationBinding, messageBusBinding, metricBinding, metricIdentityKey, namePatternFromSub, namePatternKey, nameReference, namesAgree, namesBoundary, namesBoundaryExactly, namesNothing, normalizeRuleBoundary, packageExportBinding, pairingKey, parseBoundaryName, parseChannel, pathAfterOrigin, patternHole, rangedHole, referenceFromName, referenceName, referenceOf, reportsUnpairedItself, resourceNameIn, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, semconvAttributes, servesRequest, setPiece, spansBuckets, spellingTokens, statesAnOrigin, storageBinding, unitIdentityKey, unitInvocationBinding, validateRule, withRewrittenPaths, withinScope };
|
|
1078
|
+
export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundaryName, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, DeployableUnit, type Deployment, type DispatchTable, type Ecosystem, type EffectRelation, EffectRelationSchema, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type HoleRange, type MatchResult, MessageBusSemantics, MessageBusTechnology, type MetricIdentityKey, type MetricSemantics, MetricSemanticsSchema, NOTHING_DEPLOYED, type NamePart, type PackConfiguration, type PackDeclaration, type ParsedChannel, type Reference, type Relation, RelationSchema, Semantics, type SemconvAttribute, type SemconvMapping, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, type UnitIdentityKey, type UnitInvocationSemantics, UnitInvocationSemanticsSchema, applySuppressionsToFindings, bindingIs, bindingTokens, bodyShapesMatch, boundaryKey, boundaryLabel, boundaryNameString, bucketRank, bucketsMeet, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, compareRanks, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fixedTextLength, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, groundBinding, groundedPairingKey, hasNameHole, isGraphqlOperationBinding, leavesTheProcess, messageBusBinding, metricBinding, metricIdentityKey, namePatternFromSub, namePatternKey, nameReference, namesAgree, namesBoundary, namesBoundaryExactly, namesNothing, normalizeRuleBoundary, packageExportBinding, pairingKey, parseBoundaryName, parseChannel, pathAfterOrigin, patternHole, rangedHole, referenceFromName, referenceName, referenceOf, reportsUnpairedItself, resourceNameIn, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, semconvAttributes, servesRequest, setPiece, spansBuckets, spellingTokens, statesAnOrigin, storageBinding, unitIdentityKey, unitInvocationBinding, validateRule, withRewrittenPaths, withinScope };
|
package/dist/index.js
CHANGED
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
typeDefinitionKey,
|
|
59
59
|
unitIdentityKey,
|
|
60
60
|
withDefinitionsInlined
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-ODHT5T2Q.js";
|
|
62
62
|
|
|
63
63
|
// src/semconv.ts
|
|
64
64
|
function semconvAttributes(binding) {
|
|
@@ -150,6 +150,9 @@ function normalizeRuleBoundary(raw) {
|
|
|
150
150
|
function exchangesHttpResponses(binding) {
|
|
151
151
|
return behaviorOf(binding.semantics).exchangesHttpResponses;
|
|
152
152
|
}
|
|
153
|
+
function leavesTheProcess(binding) {
|
|
154
|
+
return behaviorOf(binding.semantics).leavesTheProcess;
|
|
155
|
+
}
|
|
153
156
|
function canPair(binding) {
|
|
154
157
|
const behavior = behaviorOf(binding.semantics);
|
|
155
158
|
if (behavior.canPair !== void 0) {
|
|
@@ -696,6 +699,7 @@ export {
|
|
|
696
699
|
groundedPairingKey,
|
|
697
700
|
hasNameHole,
|
|
698
701
|
isGraphqlOperationBinding,
|
|
702
|
+
leavesTheProcess,
|
|
699
703
|
messageBusBinding,
|
|
700
704
|
methodsAgree,
|
|
701
705
|
metricBinding,
|
package/dist/schemas.cjs
CHANGED
|
@@ -111,6 +111,7 @@ var functionCallSemantics = defineBoundarySemantics({
|
|
|
111
111
|
behavior: {
|
|
112
112
|
/** A call returns a value, which is not a status and a body. */
|
|
113
113
|
exchangesHttpResponses: false,
|
|
114
|
+
leavesTheProcess: false,
|
|
114
115
|
reportsUnpairedItself: false,
|
|
115
116
|
/**
|
|
116
117
|
* In-repo units (components, bare handlers) are keyless by design
|
|
@@ -163,6 +164,7 @@ var graphqlOperationSemantics = defineBoundarySemantics({
|
|
|
163
164
|
* GraphQL contract checker reads. Status codes say nothing here.
|
|
164
165
|
*/
|
|
165
166
|
exchangesHttpResponses: false,
|
|
167
|
+
leavesTheProcess: true,
|
|
166
168
|
reportsUnpairedItself: false,
|
|
167
169
|
identityKey: () => null,
|
|
168
170
|
/** Keyless by design; the dedicated pass pairs it by its document. */
|
|
@@ -196,6 +198,9 @@ var graphqlResolverSemantics = defineBoundarySemantics({
|
|
|
196
198
|
behavior: {
|
|
197
199
|
/** A resolver returns a field value, not a status and a body. */
|
|
198
200
|
exchangesHttpResponses: false,
|
|
201
|
+
// A query somebody sent from outside runs it, even though the
|
|
202
|
+
// server calls the function in its own process.
|
|
203
|
+
leavesTheProcess: true,
|
|
199
204
|
reportsUnpairedItself: false,
|
|
200
205
|
/**
|
|
201
206
|
* `"gql:<TypeName>.<fieldName>"`, or null when the type is null or
|
|
@@ -267,6 +272,7 @@ var messageBusSemantics = defineBoundarySemantics({
|
|
|
267
272
|
behavior: {
|
|
268
273
|
/** A message goes onto the channel and nothing comes back. */
|
|
269
274
|
exchangesHttpResponses: false,
|
|
275
|
+
leavesTheProcess: true,
|
|
270
276
|
/**
|
|
271
277
|
* `checkMessageBus` looks at every channel, including the unused
|
|
272
278
|
* ones, so the generic unmatched lists leave them alone.
|
|
@@ -345,6 +351,7 @@ var metricSemantics = defineBoundarySemantics({
|
|
|
345
351
|
semconv: {},
|
|
346
352
|
behavior: {
|
|
347
353
|
exchangesHttpResponses: false,
|
|
354
|
+
leavesTheProcess: true,
|
|
348
355
|
reportsUnpairedItself: false,
|
|
349
356
|
identityKey(semantics) {
|
|
350
357
|
if (semantics.metricType === null) {
|
|
@@ -650,6 +657,7 @@ var restSemantics = defineBoundarySemantics({
|
|
|
650
657
|
behavior: {
|
|
651
658
|
/** A request goes out, a status and a body come back. */
|
|
652
659
|
exchangesHttpResponses: true,
|
|
660
|
+
leavesTheProcess: true,
|
|
653
661
|
reportsUnpairedItself: false,
|
|
654
662
|
/** `"METHOD /normalized/path"`, or null when either half is missing. */
|
|
655
663
|
identityKey(semantics) {
|
|
@@ -801,6 +809,9 @@ var runtimeConfigSemantics = defineBoundarySemantics({
|
|
|
801
809
|
behavior: {
|
|
802
810
|
/** A process reads its config at startup, and nothing replies. */
|
|
803
811
|
exchangesHttpResponses: false,
|
|
812
|
+
// Whoever deploys the process puts the value there, so the value
|
|
813
|
+
// comes from outside the code.
|
|
814
|
+
leavesTheProcess: true,
|
|
804
815
|
reportsUnpairedItself: false,
|
|
805
816
|
identityKey: () => null
|
|
806
817
|
}
|
|
@@ -857,6 +868,7 @@ var storageSemantics = defineBoundarySemantics({
|
|
|
857
868
|
behavior: {
|
|
858
869
|
/** A query returns rows or items, not a status and a body. */
|
|
859
870
|
exchangesHttpResponses: false,
|
|
871
|
+
leavesTheProcess: true,
|
|
860
872
|
reportsUnpairedItself: false,
|
|
861
873
|
identityKey: () => null,
|
|
862
874
|
displayLabel: storageLabel,
|
|
@@ -909,6 +921,7 @@ var unitInvocationSemantics = defineBoundarySemantics({
|
|
|
909
921
|
* and that route gets a REST binding instead of this one.
|
|
910
922
|
*/
|
|
911
923
|
exchangesHttpResponses: false,
|
|
924
|
+
leavesTheProcess: true,
|
|
912
925
|
/**
|
|
913
926
|
* A unit nothing in the run invokes is the ordinary case, since
|
|
914
927
|
* most services are reached from a stack suss never read. So an
|
package/dist/schemas.js
CHANGED
package/package.json
CHANGED