@suss/extractor 0.10.0 → 0.12.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
@@ -883,6 +883,9 @@ function buildGraphqlMetadataValue(raw) {
883
883
  if (raw.graphqlDeclaredContract !== void 0) {
884
884
  graphql.declaredContract = raw.graphqlDeclaredContract;
885
885
  }
886
+ if (raw.graphqlUnresolvedFragments !== void 0) {
887
+ graphql.unresolvedFragments = raw.graphqlUnresolvedFragments;
888
+ }
886
889
  if (raw.graphqlUnresolvedDocument !== void 0) {
887
890
  graphql.unresolvedDocument = raw.graphqlUnresolvedDocument;
888
891
  }
package/dist/index.d.cts CHANGED
@@ -312,7 +312,7 @@ type DiscoveryMatch = {
312
312
  * bound to a `const` one hop away, gets expanded. Cross-file and
313
313
  * computed iterables are outside v0.
314
314
  *
315
- * Pack-author docs: `docs/internal/proposals/dynamic-registration.md`.
315
+ * Pack-author docs: `design/proposals/dynamic-registration.md`.
316
316
  */
317
317
  type: "registrationLoop";
318
318
  elementShape: {
@@ -340,7 +340,7 @@ type DiscoveryMatch = {
340
340
  * one specific module, which helps when two packages happen to export
341
341
  * a function with the same name.
342
342
  *
343
- * Pack-author docs: `docs/internal/proposals/dynamic-registration.md`.
343
+ * Pack-author docs: `design/proposals/dynamic-registration.md`.
344
344
  */
345
345
  type: "registrationTemplate";
346
346
  helperName: string;
@@ -1067,6 +1067,25 @@ interface PatternPack {
1067
1067
  importModule: string;
1068
1068
  importName: string;
1069
1069
  uriProperty: string;
1070
+ /**
1071
+ * How this constructor's cache option installs a fragment
1072
+ * registry, for the library whose client can supply fragment
1073
+ * definitions at run time. `cacheProperty` is the construction
1074
+ * option the cache is passed in, `cacheConstructor` the cache
1075
+ * class, and `registryProperty` the cache option that installs
1076
+ * the registry. The adapter reads every construction and records
1077
+ * whether a registry is configured, absent, or unreadable; a
1078
+ * construction it cannot read counts as unreadable, never as
1079
+ * absent.
1080
+ */
1081
+ fragmentRegistry?: {
1082
+ cacheProperty: string;
1083
+ cacheConstructor: {
1084
+ importModule: string;
1085
+ importName: string;
1086
+ };
1087
+ registryProperty: string;
1088
+ };
1070
1089
  }>;
1071
1090
  /**
1072
1091
  * Which service a client talks to, keyed by the endpoint the
@@ -1108,6 +1127,41 @@ interface PatternPack {
1108
1127
  * same reason as in invocationRecognizers.
1109
1128
  */
1110
1129
  accessRecognizers?: AccessRecognizer[];
1130
+ /**
1131
+ * What the pack wrote as data rather than as code, for the health
1132
+ * report. Absent for a pack written as a hand-rolled walk, which is
1133
+ * itself the thing the report says.
1134
+ */
1135
+ declarations?: PackDeclarations;
1136
+ }
1137
+ /**
1138
+ * The price a pack paid for what it matches, so the migration onto the
1139
+ * declared surface can be measured rather than asserted.
1140
+ *
1141
+ * Expressiveness is bought link by link: a link answered with data is
1142
+ * inspectable, serializable and runs on any adapter, while a link
1143
+ * answered with a function is code that only its own language runs.
1144
+ * Both are allowed, and the report says which is which.
1145
+ */
1146
+ interface PackDeclarations {
1147
+ declarations: DeclaredMatch[];
1148
+ }
1149
+ /** One thing a pack declared it matches. */
1150
+ interface DeclaredMatch {
1151
+ /** What it matches, in the pack's own words. */
1152
+ name: string;
1153
+ /** Links whose answer is data. */
1154
+ dataLinks: number;
1155
+ /** Links answered with a function, by the question each one asks. */
1156
+ functionLinks: string[];
1157
+ /**
1158
+ * Links whose function reaches the adapter's own syntax tree, by the
1159
+ * question each one asks. Reaching the tree needs a separate import,
1160
+ * so a pack cannot arrive here without saying so.
1161
+ */
1162
+ astLinks: string[];
1163
+ /** A line of code the pack says this matches, or null when it says none. */
1164
+ example: string | null;
1111
1165
  }
1112
1166
  /**
1113
1167
  * Per-call-site recognizer hook. See `PatternPack.invocationRecognizers`
@@ -1736,7 +1790,14 @@ type EffectArg = {
1736
1790
  } | {
1737
1791
  kind: "object";
1738
1792
  fields: Record<string, EffectArg>;
1739
- } | {
1793
+ }
1794
+ /**
1795
+ * The element shapes the adapter could read, which is not always one
1796
+ * per runtime element. An array a callback builds,
1797
+ * `tags.map((tag) => ({ name: tag }))`, arrives with a single item,
1798
+ * because every element it produces has that one shape.
1799
+ */
1800
+ | {
1740
1801
  kind: "array";
1741
1802
  items: EffectArg[];
1742
1803
  } | {
@@ -1897,6 +1958,9 @@ interface RawCodeStructure {
1897
1958
  /** The extractor cannot derive this. An adapter that has the SDL and knows
1898
1959
  * which field the resolver serves fills it in. */
1899
1960
  graphqlDeclaredContract?: GraphqlDeclaredContract;
1961
+ /** Fragment spreads in `graphqlDocument` with no definition in it, so a
1962
+ * partially read document is marked rather than passed off as whole. */
1963
+ graphqlUnresolvedFragments?: string[];
1900
1964
  /** Set when a document reference was recognized but its body could not be
1901
1965
  * read, so an unreadable document is accounted for instead of dropped. */
1902
1966
  graphqlUnresolvedDocument?: {
@@ -1942,4 +2006,4 @@ declare function terminalToOutput(terminal: RawTerminal): Output;
1942
2006
  declare function effectToIR(effect: RawEffect): Effect;
1943
2007
  declare function paramToInput(param: RawParameter): Input;
1944
2008
 
1945
- export { type AccessRecognizer, type BindingExtraction, type BodyContent, type CaseGroup, type ChosenReading, type ConditionHandle, type ConditionInfo, type ConditionSource, type ContractPattern, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type ExitKind, type ExtractorOptions, type FailureDelivery, IdMap, IdSet, type Identified, type InputMappingPattern, type InvocationRecognizer, type LanguageAdapter, type LoweredStatementParts, PathBudgetExceeded, type PatternPack, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawTerminal, type Reading, type ResponsePropertyMapping, type ResponsePropertyMeaning, type SourceRange, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TransparentWrapper, UnmodeledFlow, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, detectGaps, effectToIR, enumerateOrDegrade, enumerateStructuredPaths, firstWrittenReading, httpRouteDiscovery, makeTransitionId, mapReading, paramToInput, sharedGatingConditions, terminalToOutput, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, writtenReading };
2009
+ export { type AccessRecognizer, type BindingExtraction, type BodyContent, type CaseGroup, type ChosenReading, type ConditionHandle, type ConditionInfo, type ConditionSource, type ContractPattern, type DeclaredMatch, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type ExitKind, type ExtractorOptions, type FailureDelivery, IdMap, IdSet, type Identified, type InputMappingPattern, type InvocationRecognizer, type LanguageAdapter, type LoweredStatementParts, type PackDeclarations, PathBudgetExceeded, type PatternPack, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawTerminal, type Reading, type ResponsePropertyMapping, type ResponsePropertyMeaning, type SourceRange, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TransparentWrapper, UnmodeledFlow, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, detectGaps, effectToIR, enumerateOrDegrade, enumerateStructuredPaths, firstWrittenReading, httpRouteDiscovery, makeTransitionId, mapReading, paramToInput, sharedGatingConditions, terminalToOutput, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, writtenReading };
package/dist/index.d.ts CHANGED
@@ -312,7 +312,7 @@ type DiscoveryMatch = {
312
312
  * bound to a `const` one hop away, gets expanded. Cross-file and
313
313
  * computed iterables are outside v0.
314
314
  *
315
- * Pack-author docs: `docs/internal/proposals/dynamic-registration.md`.
315
+ * Pack-author docs: `design/proposals/dynamic-registration.md`.
316
316
  */
317
317
  type: "registrationLoop";
318
318
  elementShape: {
@@ -340,7 +340,7 @@ type DiscoveryMatch = {
340
340
  * one specific module, which helps when two packages happen to export
341
341
  * a function with the same name.
342
342
  *
343
- * Pack-author docs: `docs/internal/proposals/dynamic-registration.md`.
343
+ * Pack-author docs: `design/proposals/dynamic-registration.md`.
344
344
  */
345
345
  type: "registrationTemplate";
346
346
  helperName: string;
@@ -1067,6 +1067,25 @@ interface PatternPack {
1067
1067
  importModule: string;
1068
1068
  importName: string;
1069
1069
  uriProperty: string;
1070
+ /**
1071
+ * How this constructor's cache option installs a fragment
1072
+ * registry, for the library whose client can supply fragment
1073
+ * definitions at run time. `cacheProperty` is the construction
1074
+ * option the cache is passed in, `cacheConstructor` the cache
1075
+ * class, and `registryProperty` the cache option that installs
1076
+ * the registry. The adapter reads every construction and records
1077
+ * whether a registry is configured, absent, or unreadable; a
1078
+ * construction it cannot read counts as unreadable, never as
1079
+ * absent.
1080
+ */
1081
+ fragmentRegistry?: {
1082
+ cacheProperty: string;
1083
+ cacheConstructor: {
1084
+ importModule: string;
1085
+ importName: string;
1086
+ };
1087
+ registryProperty: string;
1088
+ };
1070
1089
  }>;
1071
1090
  /**
1072
1091
  * Which service a client talks to, keyed by the endpoint the
@@ -1108,6 +1127,41 @@ interface PatternPack {
1108
1127
  * same reason as in invocationRecognizers.
1109
1128
  */
1110
1129
  accessRecognizers?: AccessRecognizer[];
1130
+ /**
1131
+ * What the pack wrote as data rather than as code, for the health
1132
+ * report. Absent for a pack written as a hand-rolled walk, which is
1133
+ * itself the thing the report says.
1134
+ */
1135
+ declarations?: PackDeclarations;
1136
+ }
1137
+ /**
1138
+ * The price a pack paid for what it matches, so the migration onto the
1139
+ * declared surface can be measured rather than asserted.
1140
+ *
1141
+ * Expressiveness is bought link by link: a link answered with data is
1142
+ * inspectable, serializable and runs on any adapter, while a link
1143
+ * answered with a function is code that only its own language runs.
1144
+ * Both are allowed, and the report says which is which.
1145
+ */
1146
+ interface PackDeclarations {
1147
+ declarations: DeclaredMatch[];
1148
+ }
1149
+ /** One thing a pack declared it matches. */
1150
+ interface DeclaredMatch {
1151
+ /** What it matches, in the pack's own words. */
1152
+ name: string;
1153
+ /** Links whose answer is data. */
1154
+ dataLinks: number;
1155
+ /** Links answered with a function, by the question each one asks. */
1156
+ functionLinks: string[];
1157
+ /**
1158
+ * Links whose function reaches the adapter's own syntax tree, by the
1159
+ * question each one asks. Reaching the tree needs a separate import,
1160
+ * so a pack cannot arrive here without saying so.
1161
+ */
1162
+ astLinks: string[];
1163
+ /** A line of code the pack says this matches, or null when it says none. */
1164
+ example: string | null;
1111
1165
  }
1112
1166
  /**
1113
1167
  * Per-call-site recognizer hook. See `PatternPack.invocationRecognizers`
@@ -1736,7 +1790,14 @@ type EffectArg = {
1736
1790
  } | {
1737
1791
  kind: "object";
1738
1792
  fields: Record<string, EffectArg>;
1739
- } | {
1793
+ }
1794
+ /**
1795
+ * The element shapes the adapter could read, which is not always one
1796
+ * per runtime element. An array a callback builds,
1797
+ * `tags.map((tag) => ({ name: tag }))`, arrives with a single item,
1798
+ * because every element it produces has that one shape.
1799
+ */
1800
+ | {
1740
1801
  kind: "array";
1741
1802
  items: EffectArg[];
1742
1803
  } | {
@@ -1897,6 +1958,9 @@ interface RawCodeStructure {
1897
1958
  /** The extractor cannot derive this. An adapter that has the SDL and knows
1898
1959
  * which field the resolver serves fills it in. */
1899
1960
  graphqlDeclaredContract?: GraphqlDeclaredContract;
1961
+ /** Fragment spreads in `graphqlDocument` with no definition in it, so a
1962
+ * partially read document is marked rather than passed off as whole. */
1963
+ graphqlUnresolvedFragments?: string[];
1900
1964
  /** Set when a document reference was recognized but its body could not be
1901
1965
  * read, so an unreadable document is accounted for instead of dropped. */
1902
1966
  graphqlUnresolvedDocument?: {
@@ -1942,4 +2006,4 @@ declare function terminalToOutput(terminal: RawTerminal): Output;
1942
2006
  declare function effectToIR(effect: RawEffect): Effect;
1943
2007
  declare function paramToInput(param: RawParameter): Input;
1944
2008
 
1945
- export { type AccessRecognizer, type BindingExtraction, type BodyContent, type CaseGroup, type ChosenReading, type ConditionHandle, type ConditionInfo, type ConditionSource, type ContractPattern, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type ExitKind, type ExtractorOptions, type FailureDelivery, IdMap, IdSet, type Identified, type InputMappingPattern, type InvocationRecognizer, type LanguageAdapter, type LoweredStatementParts, PathBudgetExceeded, type PatternPack, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawTerminal, type Reading, type ResponsePropertyMapping, type ResponsePropertyMeaning, type SourceRange, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TransparentWrapper, UnmodeledFlow, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, detectGaps, effectToIR, enumerateOrDegrade, enumerateStructuredPaths, firstWrittenReading, httpRouteDiscovery, makeTransitionId, mapReading, paramToInput, sharedGatingConditions, terminalToOutput, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, writtenReading };
2009
+ export { type AccessRecognizer, type BindingExtraction, type BodyContent, type CaseGroup, type ChosenReading, type ConditionHandle, type ConditionInfo, type ConditionSource, type ContractPattern, type DeclaredMatch, type DefaultedReading, type DiscoveredCustomUnit, type DiscoveredSubUnit, type DiscoveredSubUnitParent, type DiscoveryMatch, type DiscoveryPattern, type EffectArg, type ExitKind, type ExtractorOptions, type FailureDelivery, IdMap, IdSet, type Identified, type InputMappingPattern, type InvocationRecognizer, type LanguageAdapter, type LoweredStatementParts, type PackDeclarations, PathBudgetExceeded, type PatternPack, type RawBranch, type RawCodeStructure, type RawCondition, type RawDeclaredContract, type RawDependencyCall, type RawEffect, type RawParameter, type RawTerminal, type Reading, type ResponsePropertyMapping, type ResponsePropertyMeaning, type SourceRange, type StatementBlock, type StructuredPathConditionsInput, type StructuredPathConditionsResult, type StructuredStatement, type TerminalExtraction, type TerminalMatch, type TerminalPattern, type TransparentWrapper, UnmodeledFlow, absentReading, ambiguousReading, andThenReading, assembleSummary, assessConfidence, detectGaps, effectToIR, enumerateOrDegrade, enumerateStructuredPaths, firstWrittenReading, httpRouteDiscovery, makeTransitionId, mapReading, paramToInput, sharedGatingConditions, terminalToOutput, unreadableReading, unwrapJsonStringify, valueToReadFurtherFrom, writtenReading };
package/dist/index.js CHANGED
@@ -841,6 +841,9 @@ function buildGraphqlMetadataValue(raw) {
841
841
  if (raw.graphqlDeclaredContract !== void 0) {
842
842
  graphql.declaredContract = raw.graphqlDeclaredContract;
843
843
  }
844
+ if (raw.graphqlUnresolvedFragments !== void 0) {
845
+ graphql.unresolvedFragments = raw.graphqlUnresolvedFragments;
846
+ }
844
847
  if (raw.graphqlUnresolvedDocument !== void 0) {
845
848
  graphql.unresolvedDocument = raw.graphqlUnresolvedDocument;
846
849
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/extractor",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "description": "Framework-agnostic extraction pipeline that turns raw extractions into suss behavioral summaries.",
6
6
  "keywords": [
@@ -45,7 +45,7 @@
45
45
  "typecheck": "tsc --noEmit"
46
46
  },
47
47
  "dependencies": {
48
- "@suss/behavioral-ir": "0.10.0"
48
+ "@suss/behavioral-ir": "0.12.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "tsup": "*",