@suss/ir-core 0.6.0 → 0.7.1

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
@@ -66,6 +66,7 @@ __export(index_exports, {
66
66
  namePatternFromSub: () => namePatternFromSub,
67
67
  namePatternKey: () => namePatternKey,
68
68
  namesAgree: () => namesAgree,
69
+ namesNothing: () => namesNothing,
69
70
  normalizePath: () => normalizePath,
70
71
  normalizeRuleBoundary: () => normalizeRuleBoundary,
71
72
  packageExportBinding: () => packageExportBinding,
@@ -783,6 +784,9 @@ function namePatternFromSub(value) {
783
784
  }
784
785
  return value.replace(SUB_TOKEN, (_whole, inner) => `{${inner}}`);
785
786
  }
787
+ function namesNothing(name) {
788
+ return /^\{[^}]*\}$/.test(name);
789
+ }
786
790
  function hasNameHole(name) {
787
791
  HOLE.lastIndex = 0;
788
792
  return HOLE.test(name);
@@ -797,6 +801,9 @@ function admits(pattern, name) {
797
801
  return new RegExp(`^${source}$`).test(name);
798
802
  }
799
803
  function namesAgree(a, b) {
804
+ if (namesNothing(a) || namesNothing(b)) {
805
+ return false;
806
+ }
800
807
  if (a === b) {
801
808
  return true;
802
809
  }
@@ -1226,6 +1233,7 @@ function messageBusBinding(opts) {
1226
1233
  namePatternFromSub,
1227
1234
  namePatternKey,
1228
1235
  namesAgree,
1236
+ namesNothing,
1229
1237
  normalizePath,
1230
1238
  normalizeRuleBoundary,
1231
1239
  packageExportBinding,
package/dist/index.d.cts CHANGED
@@ -282,6 +282,14 @@ declare function dispatchByType<T extends {
282
282
  * says where a substitution comes from, which does not change the name.
283
283
  */
284
284
  declare function namePatternFromSub(value: unknown): string | null;
285
+ /**
286
+ * Whether a name says only that somebody else knows it. A wrapper that
287
+ * takes its bucket as an argument states `{location.bucket}` and
288
+ * nothing more, which says which parameter to ask rather than which
289
+ * bucket. A name like that agrees with nothing until something grounds
290
+ * it, since otherwise it would agree with every name there is.
291
+ */
292
+ declare function namesNothing(name: string): boolean;
285
293
  /** Whether a name has anything a source left for deploy time to fill. */
286
294
  declare function hasNameHole(name: string): boolean;
287
295
  /**
@@ -538,4 +546,4 @@ declare function messageBusBinding(opts: {
538
546
  channel: string | null;
539
547
  }): BoundaryBinding;
540
548
 
541
- export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, type DispatchTable, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type MatchResult, MessageBusSemantics, MessageBusTechnology, type ParsedChannel, Semantics, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, applySuppressionsToFindings, bodyShapesMatch, boundaryKey, boundaryLabel, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, hasNameHole, isGraphqlOperationBinding, messageBusBinding, namePatternFromSub, namePatternKey, namesAgree, normalizeRuleBoundary, packageExportBinding, pairingKey, parseChannel, reportsUnpairedItself, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, servesRequest, storageBinding, validateRule };
549
+ export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, type DispatchTable, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type MatchResult, MessageBusSemantics, MessageBusTechnology, type ParsedChannel, Semantics, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, applySuppressionsToFindings, bodyShapesMatch, boundaryKey, boundaryLabel, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, hasNameHole, isGraphqlOperationBinding, messageBusBinding, namePatternFromSub, namePatternKey, namesAgree, namesNothing, normalizeRuleBoundary, packageExportBinding, pairingKey, parseChannel, reportsUnpairedItself, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, servesRequest, storageBinding, validateRule };
package/dist/index.d.ts CHANGED
@@ -282,6 +282,14 @@ declare function dispatchByType<T extends {
282
282
  * says where a substitution comes from, which does not change the name.
283
283
  */
284
284
  declare function namePatternFromSub(value: unknown): string | null;
285
+ /**
286
+ * Whether a name says only that somebody else knows it. A wrapper that
287
+ * takes its bucket as an argument states `{location.bucket}` and
288
+ * nothing more, which says which parameter to ask rather than which
289
+ * bucket. A name like that agrees with nothing until something grounds
290
+ * it, since otherwise it would agree with every name there is.
291
+ */
292
+ declare function namesNothing(name: string): boolean;
285
293
  /** Whether a name has anything a source left for deploy time to fill. */
286
294
  declare function hasNameHole(name: string): boolean;
287
295
  /**
@@ -538,4 +546,4 @@ declare function messageBusBinding(opts: {
538
546
  channel: string | null;
539
547
  }): BoundaryBinding;
540
548
 
541
- export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, type DispatchTable, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type MatchResult, MessageBusSemantics, MessageBusTechnology, type ParsedChannel, Semantics, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, applySuppressionsToFindings, bodyShapesMatch, boundaryKey, boundaryLabel, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, hasNameHole, isGraphqlOperationBinding, messageBusBinding, namePatternFromSub, namePatternKey, namesAgree, normalizeRuleBoundary, packageExportBinding, pairingKey, parseChannel, reportsUnpairedItself, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, servesRequest, storageBinding, validateRule };
549
+ export { type BoundaryBehavior, type BoundaryBinding, BoundaryBindingSchema, type BoundarySemanticsDefinition, type BusIdentityKey, type Channel, type ConfidenceInfo, ConfidenceInfoSchema, type ConfidenceLevel, ConfidenceLevelSchema, type ConfidenceSource, ConfidenceSourceSchema, type Corroboration, CorroborationSchema, type DispatchTable, type FindingSuppression, type FnIdentityKey, type GqlIdentityKey, type MatchResult, MessageBusSemantics, MessageBusTechnology, type ParsedChannel, Semantics, type SourceLocation, SourceLocationSchema, type SuppressableSeverity, type SuppressibleFinding, type SuppressionFile, SuppressionFileSchema, type SuppressionRule, SuppressionRuleSchema, TypeShape, applySuppressionsToFindings, bodyShapesMatch, boundaryKey, boundaryLabel, busIdentityKey, busesAgree, canPair, channelsPair, codeScopePath, countsForThreshold, dispatchByType, displayLabel, exchangesHttpResponses, fileInCodeScope, fnIdentityKey, formatChannel, functionCallBinding, gqlIdentityKey, graphqlOperationBinding, graphqlResolverBinding, hasNameHole, isGraphqlOperationBinding, messageBusBinding, namePatternFromSub, namePatternKey, namesAgree, namesNothing, normalizeRuleBoundary, packageExportBinding, pairingKey, parseChannel, reportsUnpairedItself, restBinding, ruleBoundaryMatchesKey, runtimeConfigBinding, semanticsAgree, servesRequest, storageBinding, validateRule };
package/dist/index.js CHANGED
@@ -119,6 +119,9 @@ function namePatternFromSub(value) {
119
119
  }
120
120
  return value.replace(SUB_TOKEN, (_whole, inner) => `{${inner}}`);
121
121
  }
122
+ function namesNothing(name) {
123
+ return /^\{[^}]*\}$/.test(name);
124
+ }
122
125
  function hasNameHole(name) {
123
126
  HOLE.lastIndex = 0;
124
127
  return HOLE.test(name);
@@ -133,6 +136,9 @@ function admits(pattern, name) {
133
136
  return new RegExp(`^${source}$`).test(name);
134
137
  }
135
138
  function namesAgree(a, b) {
139
+ if (namesNothing(a) || namesNothing(b)) {
140
+ return false;
141
+ }
136
142
  if (a === b) {
137
143
  return true;
138
144
  }
@@ -561,6 +567,7 @@ export {
561
567
  namePatternFromSub,
562
568
  namePatternKey,
563
569
  namesAgree,
570
+ namesNothing,
564
571
  normalizePath,
565
572
  normalizeRuleBoundary,
566
573
  packageExportBinding,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/ir-core",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "description": "Shared IR primitives for suss — type shapes, boundary bindings, source locations, and confidence. Imported by both @suss/behavioral-ir and @suss/intent-ir so neither depends on the other.",
6
6
  "keywords": [