@suss/extractor 0.11.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.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;
@@ -1127,6 +1127,41 @@ interface PatternPack {
1127
1127
  * same reason as in invocationRecognizers.
1128
1128
  */
1129
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;
1130
1165
  }
1131
1166
  /**
1132
1167
  * Per-call-site recognizer hook. See `PatternPack.invocationRecognizers`
@@ -1755,7 +1790,14 @@ type EffectArg = {
1755
1790
  } | {
1756
1791
  kind: "object";
1757
1792
  fields: Record<string, EffectArg>;
1758
- } | {
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
+ | {
1759
1801
  kind: "array";
1760
1802
  items: EffectArg[];
1761
1803
  } | {
@@ -1964,4 +2006,4 @@ declare function terminalToOutput(terminal: RawTerminal): Output;
1964
2006
  declare function effectToIR(effect: RawEffect): Effect;
1965
2007
  declare function paramToInput(param: RawParameter): Input;
1966
2008
 
1967
- 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;
@@ -1127,6 +1127,41 @@ interface PatternPack {
1127
1127
  * same reason as in invocationRecognizers.
1128
1128
  */
1129
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;
1130
1165
  }
1131
1166
  /**
1132
1167
  * Per-call-site recognizer hook. See `PatternPack.invocationRecognizers`
@@ -1755,7 +1790,14 @@ type EffectArg = {
1755
1790
  } | {
1756
1791
  kind: "object";
1757
1792
  fields: Record<string, EffectArg>;
1758
- } | {
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
+ | {
1759
1801
  kind: "array";
1760
1802
  items: EffectArg[];
1761
1803
  } | {
@@ -1964,4 +2006,4 @@ declare function terminalToOutput(terminal: RawTerminal): Output;
1964
2006
  declare function effectToIR(effect: RawEffect): Effect;
1965
2007
  declare function paramToInput(param: RawParameter): Input;
1966
2008
 
1967
- 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@suss/extractor",
3
- "version": "0.11.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.11.0"
48
+ "@suss/behavioral-ir": "0.12.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "tsup": "*",