import { CodeUnitKindSchema, BehavioralSummarySchema, BoundaryAspectSchema, PredicateSchema, InputSchema, CodeUnitIdentitySchema, ComparisonOpSchema, EffectSchema, DerivationSchema, FindingKindSchema, FindingSchema, FindingSeveritySchema, FindingSideSchema, GapSchema, LiteralSchema, OpaqueReasonSchema, OutputSchema, RunFindingKindSchema, RenderNodeSchema, RunFindingSchema, SummaryDiffSchema, TransitionSchema, ValueRefSchema } from './schemas.cjs'; import { z } from 'zod'; import * as _suss_ir_core from '@suss/ir-core'; import { Relation, BoundaryBinding, DeployableUnit, Deployment, Reference, MessageBusTechnology } from '@suss/ir-core'; export { BoundaryBinding, BoundaryName, ConfidenceInfo, ConfidenceLevel, ConfidenceSource, Corroboration, DeployableUnit, Deployment, DispatchTable, FunctionCallSemantics, GraphqlOperationSemantics, GraphqlResolverSemantics, MessageBusSemantics, MessageBusTechnology, MetricSemantics, NOTHING_DEPLOYED, NamePart, PLATFORM_INJECTED_ENV_VARS, Reference, Relation, RelationSchema, RestSemantics, RuntimeConfigSemantics, Semantics, SourceLocation, StorageSemantics, TypeShape, UnitInvocationSemantics, bindingIs, boundaryKey, boundaryLabel, boundaryNameString, dispatchByType, displayLabel, ecsContainerInstanceName, exchangesHttpResponses, fixedTextLength, formatChannel, functionCallBinding, graphqlOperationBinding, graphqlResolverBinding, groundBinding, hasNameHole, isGraphqlOperationBinding, leavesTheProcess, messageBusBinding, metricBinding, namePatternFromSub, namePatternKey, nameReference, namesAgree, namesNothing, packageExportBinding, parseBoundaryName, parseHandler, patternHole, rangedHole, referenceFromName, referenceName, referenceOf, resourceNameIn, restBinding, runtimeConfigBinding, semconvAttributes, setPiece, storageBinding, unitIdentityKey, unitInvocationBinding, withRewrittenPaths, withinScope } from '@suss/ir-core'; import '@suss/ir-core/schemas'; /** * Pointing each recorded call at the summary it reaches. * * An adapter that followed a call knows where the callee is declared * and writes that on the effect as `declaredAt`. The summary of the * unit declared there is the one the call reaches, so the link is a * join on location, which needs nothing from the language the adapter * read. Once the link is written the offsets have served their purpose * and come off the effect, so every adapter's output spells a reached * call the same way and the CLI reads one field. */ type InvocationEffect = Extract; /** Where a call's callee is declared, as an adapter wrote it on the effect. */ type DeclaredAt = NonNullable; /** A call, made through one of the scanned unit's own parameters, to record on its matching invocation effect. */ interface ParameterCall { readonly callee: string; readonly parameterIndex: number; } /** * A place in a file by character offsets, spelled the one way every * writer of `declaredAt` and every reader of `location.span` agrees on. */ declare function declarationKey(file: string, span: { start: number; end: number; }): string; /** Say on each invocation effect where its callee is declared, so the link step can find the summary there. */ declare function placeCalls(summary: BehavioralSummary, targets: ReadonlyMap | undefined): void; /** * Where a scanned body's calls, and the arguments passed by name into * them, are declared: fed by `place`/`placeArg` as a walk visits each * call, and read back by `targets`/`argTargets` once it finishes, in * the shape `placeCalls` and `placeArgTargets` themselves take. Every * adapter's reachable-closure walk built this same bookkeeping by * hand; centralizing it here keeps the shadow-name rule in one place. */ declare class TargetPlacements { private readonly byCallee; private readonly byCalleeAndPosition; /** The same callee text placed two ways, a shadowed name say, has to say so rather than pick one. */ place(calleeText: string, placed: DeclaredAt | null): void; placeArg(calleeText: string, position: number, placed: DeclaredAt): void; /** Every callee text settled to one declaration, the shape `placeCalls` takes. */ get targets(): ReadonlyMap; /** Every callee text's settled argument positions, the shape `placeArgTargets` takes. */ get argTargets(): ReadonlyMap>; } /** * Say on each invocation effect where an identifier argument that is * itself a project function is declared, keyed by its position among * the call's arguments. `linkArgs` later turns each entry into * `argsSummary`, the same way `placeCalls` feeds `declaredAt` into * `linkCallsToSummaries`. Shared by every adapter that follows an * argument passed by name into a call: matching the effect by callee * text and writing a location is language-independent once the walk * has resolved the argument to a declaration. */ declare function placeArgTargets(summary: BehavioralSummary, argTargets: ReadonlyMap> | undefined): void; /** * Say on each invocation effect which of the scanned unit's own * parameters it calls. A caller elsewhere that passes a function into * that position joins to this call by it. */ declare function placeCalleeParameters(summary: BehavioralSummary, parameterCalls: readonly ParameterCall[] | undefined): void; /** * A call through one of a unit's own parameters is a gap only once the * whole run is scanned and nothing anywhere passes a function into * that position: until then it is the ordinary `callerSupplied` stop, * which nothing records. `key` identifies a scanned unit the same way * across `parameterCallsByKey`, `summariesByKey`, and the position * strings in `passedPositions`, whatever scheme an adapter's own walk * uses to key a unit. */ declare function recordParameterGaps(parameterCallsByKey: ReadonlyMap, summariesByKey: ReadonlyMap, passedPositions: ReadonlySet): void; /** * Point each call at the summary it reaches, and drop `declaredAt`. * * A call the adapter placed says where its callee is declared, and the * summary of the unit declared there is the one it reaches. A callee * declared outside the run has no summary there and gets no link, * whatever else in the run shares its name. Only a call the adapter * could not place at all is matched by name, and then only against the * summaries in its own file, since that is where an unqualified call * usually goes. Two summaries with one name leave the call saying only * what it said before: a reader can see a missing link, and cannot see * a wrong one. */ declare function linkCallsToSummaries(summaries: BehavioralSummary[]): void; /** * What a branch guard turns on, said in boundaries rather than in the * names the source happened to use. * * A route that returns 404 when a table has no such row records that as * a truthiness check on the result of `dynamo.send`, and records * `dynamo.send` as a read of `aws.dynamodb:Invoices` in the same unit. * Joining the two says the 404 turns on a read of that table finding * nothing, which survives a rename of `dynamo` and which a checker can * compare. * * The join spans the unit rather than the transition: the call runs * before the branch, and only the path past it records the effect. */ /** Whether a guard passed because something was there, or was not. */ type Polarity = "something" | "nothing"; /** The value a guard is about, reduced to where it came from. */ interface GuardSubject { /** The call whose result the guard reads, when it reads one. */ dependency: string | null; /** The input the guard reads, when it reads one. */ input: string | null; /** The properties read off it, outermost last. */ path: string[]; } /** A guard, with the boundary its subject came from. */ interface BoundaryGuard { does: Relation; binding: BoundaryBinding; /** The properties the guard read off the call's result. */ path: string[]; /** Null when the guard is not a presence check. */ polarity: Polarity | null; /** * The transition's condition this came from, negation and all, so a * caller can tell which of its conditions are already accounted for. */ condition: Predicate; /** The guard inside it, which is what a sentence would write out. */ predicate: Predicate; } /** One call that crosses a boundary, by the name the source calls it. */ interface BoundaryCall { does: Relation; binding: BoundaryBinding; } /** * The calls this unit makes that cross a boundary. A guard reading one * of those results says which boundary through this. */ declare function boundaryCalls(summary: BehavioralSummary): Map; /** * Every guard on this transition that says which boundary. A guard the * join cannot settle is left out, and whatever wants a line for it * writes the guard itself instead. */ declare function boundaryGuardsOf(transition: Transition, calls: Map): BoundaryGuard[]; /** * Whether the guard passed because its subject was there. Null for a * guard that asks something else, a comparison or a type check. */ declare function polarityOf(condition: Predicate): Polarity | null; /** The value a guard is about, or null when it is about several. */ declare function guardSubject(condition: Predicate): GuardSubject | null; /** * declaredDelivery.ts: give a deployed code unit the boundary a * declaration says delivers to it. * * A queue consumer arrives as two summaries with half of it each. The * code says what the handler does with a message and cannot say which * queue delivers it, because a SAM template decides that. The * template's summary says which queue and knows nothing about the * handler's branches. Both give the same deployable unit, which is what * puts them back together. Anything that reads summaries by boundary * key needs this join before it looks. */ /** Whether two units refer to the same thing to deploy. */ declare function sameUnit(a: DeployableUnit, b: DeployableUnit): boolean; /** * The same summaries, with a unit's boundary filled in from the * declaration that says what reaches it. A summary that can already be * keyed keeps what it has: a consumer built by a factory that states * its subject has said something the template cannot, and it is the * more specific answer. */ declare function withDeclaredDelivery(summaries: readonly BehavioralSummary[]): BehavioralSummary[]; /** * deployedNames.ts: the one place a boundary name with a hole in it * gets filled in. * * `deployedValues` and `deployedRefs` next door know half of it each, * and this puts a `Deployment` in front of them so a protocol can ask * without knowing which half it is. Everything that reads a name for * somebody to see comes through here: the pairing pass, the drafter * that writes an intent document, and the intent checker that reads * one back. * * The rule for which variable a reference asks about is here too. It * used to be written twice, and the two spellings could disagree. */ /** * Ask what each unit's deployment fills its variables in with. * * Built once for a set of summaries and asked per unit, because two * services in one repository can both set `API_BASE` and only the unit * in question says which value applies. */ declare function deploymentOf(summaries: BehavioralSummary[]): (code: BehavioralSummary) => Deployment; /** * The variable a reference asks about, or null when what settles it is * an argument a caller passes. * * One bare name is a variable: that is how a pack spells a * `process.env` read. A path is one only when it goes through the * argument a pack calls the configuration, because what fills that * argument is the runtime rather than any call site in the run. */ declare function variableAsked(summary: BehavioralSummary, reference: Reference): string | null; /** The parameter of this unit a reference starts at, if it takes one. */ declare function parameterNamed(summary: BehavioralSummary, name: string): { position: number; role: string | null; } | null; /** * What the message-bus contract reader records beside a summary's * binding: the queue a consumer drains, the rule or subscription and * bus a subscription came from, how far a rule's EventPattern, an SNS * FilterPolicy, or an S3 notification Filter reduced, and which S3 * events and target an S3 bucket notification points at. */ declare const MessageBusMetadataSchema: z.ZodObject<{ queue: z.ZodOptional; subject: z.ZodOptional; eventBus: z.ZodOptional; detailType: z.ZodOptional; rule: z.ZodOptional; subscription: z.ZodOptional; notification: z.ZodOptional; events: z.ZodOptional>; topic: z.ZodOptional; eventName: z.ZodOptional; patternResolution: z.ZodOptional>; unresolvableReason: z.ZodOptional; enabled: z.ZodOptional; deliveredThrough: z.ZodOptional>; fifoQueue: z.ZodOptional; fifoTopic: z.ZodOptional; physicalName: z.ZodOptional; }, z.core.$strip>; type MessageBusMetadata = z.infer; /** * A metadata bag with the message-bus namespace set. Writes are * strict: a field the schema does not declare throws here, next to its * cause. Reads stay lenient so older artifacts keep reading. */ declare function withMessageBusMetadata(metadata: Record | undefined, value: MessageBusMetadata): Record; /** The summary's message-bus namespace, or undefined when absent or not an object. */ declare function readMessageBusMetadata(summary: BehavioralSummary): MessageBusMetadata | undefined; declare const MountMetadataSchema: z.ZodObject<{ siblings: z.ZodNumber; prefix: z.ZodString; }, z.core.$strip>; type MountMetadata = z.infer; /** * One route declaration served under several mounts emits one boundary * per mount, and each records this so nothing reads the siblings as * separate declarations. */ declare function withMountMetadata(metadata: Record | undefined, value: MountMetadata): Record; declare function readMountMetadata(summary: BehavioralSummary): MountMetadata | undefined; declare const WrapperReferenceSchema: z.ZodObject<{ file: z.ZodString; name: z.ZodString; line: z.ZodOptional; onThrow: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>; declare const WrapperMetadataSchema: z.ZodObject<{ applied: z.ZodOptional; onThrow: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>>>; from: z.ZodOptional; onThrow: z.ZodOptional; scope: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; type WrapperMetadata = z.infer; /** One wrapper as the unit it runs around refers to it. */ type WrapperReference = z.infer; /** * A handler's wire behaviour is not only what its own body does. * Middleware, error handlers and validation hooks produce responses for * it without appearing in it, so a unit records which ones run around * it, and each outcome one of them contributed says which one that was. * * An `applied` entry points at the wrapper's own summary the way * `sourceDocument` points at a schema. What the wrapper does lives on * that summary, in its transitions. */ declare function withWrapperMetadata(metadata: Record | undefined, value: WrapperMetadata): Record; /** * The wrappers namespace on a summary or one of its transitions. * `applied` lives on the summary and `from` on the transition, and both * carriers have a `metadata` bag of the same kind, so one reader covers * both. */ declare function readWrapperMetadata(carrier: BehavioralSummary | Transition): WrapperMetadata | undefined; declare const EnvVarSourceSchema: z.ZodEnum<{ template: "template"; globals: "globals"; platform: "platform"; }>; /** * Where a variable in a runtime's environment comes from: the * resource's own Environment block, a SAM Globals section the whole * document shares, or the platform the runtime runs on. */ type EnvVarSource = z.infer; /** * What the runtime-config contract reader records beside a summary's * binding: every environment variable the deployed process sees, where * each one came from, and which CFN resource an env var's value * resolves to when the template wires it to one. */ declare const RuntimeContractMetadataSchema: z.ZodObject<{ envVars: z.ZodOptional>; envVarSources: z.ZodOptional>>; envVarTargets: z.ZodOptional; logicalId: z.ZodString; }, z.core.$strip>>>; envVarValues: z.ZodOptional>; runtime: z.ZodOptional; entryPoint: z.ZodOptional; image: z.ZodOptional; }, z.core.$strip>; type RuntimeContractMetadata = z.infer; /** * A metadata bag with the runtime-contract namespace set. Writes are * strict: a field the schema does not declare throws here, next to its * cause. Reads stay lenient so older artifacts keep reading. */ declare function withRuntimeContractMetadata(metadata: Record | undefined, value: RuntimeContractMetadata): Record; /** The summary's runtime-contract namespace, or undefined when absent or not an object. */ declare function readRuntimeContractMetadata(summary: BehavioralSummary): RuntimeContractMetadata | undefined; /** * What the ALB flow contract reader records beside a summary's * identity: one row per routing edge `design/proposals/ * flow-reachability.md` describes. `edge` says which relation this * summary states; the other fields contain that relation's own data. One * summary states exactly one edge, the same way one CFN resource states * one thing. * * routesTo a listener rule, or a listener's own forward default * action, naming the target group its match forwards to. * answers a listener rule's or a listener's own non-forward * action: the response a matched (or unmatched, for a * listener default) path gets without forwarding * anywhere. * fronts a target group naming the resource that backs it. * belongsTo a listener naming the load balancer it belongs to, so * a chain of balancers (an NLB fronting an ALB) composes: * a `fronts` edge ends at the fronted balancer's logical * id, and this edge is how a walk continues into that * balancer's own listeners. */ declare const RoutingMetadataSchema: z.ZodObject<{ edge: z.ZodEnum<{ routesTo: "routesTo"; answers: "answers"; fronts: "fronts"; belongsTo: "belongsTo"; }>; router: z.ZodOptional>; unresolvedRouter: z.ZodOptional>; target: z.ZodOptional>; unresolvedTarget: z.ZodOptional>; matchId: z.ZodOptional; priority: z.ZodOptional; conditions: z.ZodOptional; values: z.ZodArray; evaluated: z.ZodBoolean; }, z.core.$strip>>>; matchLanguage: z.ZodOptional; weight: z.ZodOptional; response: z.ZodOptional; statusCode: z.ZodOptional; contentType: z.ZodOptional; body: z.ZodOptional; }, z.core.$strip>>; resource: z.ZodOptional>; unresolvedResource: z.ZodOptional>; }, z.core.$strip>; type RoutingMetadata = z.infer; /** * A metadata bag with the routing namespace set. Writes are strict: a * field the schema does not name throws here, next to its cause. Reads * stay lenient so older artifacts keep reading. */ declare function withRoutingMetadata(metadata: Record | undefined, value: RoutingMetadata): Record; /** The summary's routing namespace, or undefined when absent or not an object. */ declare function readRoutingMetadata(summary: BehavioralSummary): RoutingMetadata | undefined; declare const GraphqlContractProvenanceSchema: z.ZodEnum<{ derived: "derived"; independent: "independent"; }>; /** * "derived": the contract and this summary's transitions come from the * same source (an SDL field driving both), so comparing them against * each other would be tautological. "independent": a separate * statement, such as a server-side framework's own type declarations * against an SDL, worth comparing. */ type GraphqlContractProvenance = z.infer; /** * A resolver field's declared shape, as one source states it: a return * type, its arguments, and the error types it may throw. Two sources * naming the same `Type.field` boundary each have one of these, and * the checker compares them. */ declare const GraphqlDeclaredContractSchema: z.ZodObject<{ returnType: z.ZodType<_suss_ir_core.TypeShape, unknown, z.core.$ZodTypeInternals<_suss_ir_core.TypeShape, unknown>>; args: z.ZodArray>; required: z.ZodBoolean; }, z.core.$strip>>; errorTypes: z.ZodOptional>; provenance: z.ZodDefault>; framework: z.ZodOptional; }, z.core.$strip>; type GraphqlDeclaredContract = z.infer; /** * What a GraphQL contract reader records beside a summary's binding: * which root field a resolver or operation is for, the contract another * source can compare against, the operation document a consumer sent * (or the schema SDL behind a resolver), and how much of it the reader * could resolve. */ declare const GraphqlMetadataSchema: z.ZodObject<{ rootType: z.ZodOptional>; fieldName: z.ZodOptional; declaredContract: z.ZodOptional>; args: z.ZodArray>; required: z.ZodBoolean; }, z.core.$strip>>; errorTypes: z.ZodOptional>; provenance: z.ZodDefault>; framework: z.ZodOptional; }, z.core.$strip>>; schemaSdl: z.ZodOptional; document: z.ZodOptional; unresolvedFragments: z.ZodOptional>; ambiguousFragments: z.ZodOptional>; fragmentRegistry: z.ZodOptional>; unresolvedDocument: z.ZodOptional>; client: z.ZodOptional; uriRef: z.ZodNullable; workspace: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; type GraphqlMetadata = z.infer; /** * A metadata bag with the graphql namespace set. Writes are strict: a * field the schema does not name throws here, next to its cause. Reads * stay lenient so older artifacts keep reading. */ declare function withGraphqlMetadata(metadata: Record | undefined, value: GraphqlMetadata): Record; /** The summary's graphql namespace, or undefined when absent or not an object. */ declare function readGraphqlMetadata(summary: BehavioralSummary): GraphqlMetadata | undefined; /** * The document a summary was read out of. * * One document declares many boundaries and states things every one of * them relies on: a GraphQL schema's type definitions, an OpenAPI * document's `components.schemas`. Those belong to the document, so a * reader puts them on a summary standing for the document and gives * every summary from that document the same label. A checker that needs * them goes from a boundary to its document and reads them once. * * The label is the one the reader records on `location.file`, so * `parseDocumentLabel` reads it the same way here as it does there. */ declare const SourceDocumentMetadataSchema: z.ZodObject<{ label: z.ZodString; }, z.core.$strip>; type SourceDocumentMetadata = z.infer; /** A metadata bag saying which document its summary was read out of. */ declare function withSourceDocumentMetadata(metadata: Record | undefined, value: SourceDocumentMetadata): Record; /** The document namespace, or undefined when absent or not an object. */ declare function readSourceDocumentMetadata(summary: BehavioralSummary): SourceDocumentMetadata | undefined; declare const HttpContractProvenanceSchema: z.ZodEnum<{ derived: "derived"; independent: "independent"; }>; /** * "derived": the contract comes from the same source that drives this * summary's `transitions[]`. An OpenAPI stub's contract and its * transitions both come from the same operation's `responses` block, * so comparing them against each other is tautological. * "independent": a separate statement, such as CFN `MethodResponses` * against an integration-derived transition, or a ts-rest router * declaration against its handler implementation. Worth comparing. * * Defaults to "independent" when a writer doesn't say. A spurious * finding someone can look into beats missing one that mattered. */ type HttpContractProvenance = z.infer; /** * A declared response contract for one HTTP boundary: the status codes * a source promises and, where the source states it, each one's body * shape. Two sources naming the same boundary each have one of these, * and the checker compares them. */ declare const HttpDeclaredContractSchema: z.ZodObject<{ framework: z.ZodOptional; responses: z.ZodArray>>>; }, z.core.$strip>>; responseRanges: z.ZodOptional>>>; }, z.core.$strip>>>; defaultResponse: z.ZodOptional>>>; }, z.core.$strip>>; provenance: z.ZodDefault>; }, z.core.$strip>; type HttpDeclaredContract = z.infer; /** * What an HTTP contract reader records beside a summary's binding: the * declared response contract, the accessors a consumer's response * wrapper uses to reach the body and the status code, a pointer to the * code that implements a declared route, and the status-code range a * range response ("2XX", "4XX", and so on) covers. * * Every field but `statusRange` lives on a summary's own metadata. * `statusRange` lives on the transition it describes instead. A range * belongs to one response, not to the boundary as a whole, and the IR's * `statusCode` field only records a literal value or nothing at all. */ declare const HttpMetadataSchema: z.ZodObject<{ declaredContract: z.ZodOptional; responses: z.ZodArray>>>; }, z.core.$strip>>; responseRanges: z.ZodOptional>>>; }, z.core.$strip>>>; defaultResponse: z.ZodOptional>>>; }, z.core.$strip>>; provenance: z.ZodDefault>; }, z.core.$strip>>; bodyAccessors: z.ZodOptional>; statusAccessors: z.ZodOptional>; successAccessors: z.ZodOptional>; failureDelivery: z.ZodOptional>; implementingHandler: z.ZodOptional; functionLogicalId: z.ZodOptional; }, z.core.$strip>>; statusRange: z.ZodOptional>; }, z.core.$strip>; type HttpMetadata = z.infer; /** * A metadata bag with the http namespace set. Writes are strict: a * field the schema does not name throws here, next to its cause. Reads * stay lenient so older artifacts keep reading. */ declare function withHttpMetadata(metadata: Record | undefined, value: HttpMetadata): Record; /** * The http namespace on a summary or one of its transitions, or * undefined when absent or not an object. Most fields live on a * summary; `statusRange` lives on the transition it describes. Both * have a `metadata` bag of the same kind, so one reader covers both. */ declare function readHttpMetadata(carrier: BehavioralSummary | Transition): HttpMetadata | undefined; declare const RequestSectionSpellingSchema: z.ZodObject<{ path: z.ZodArray; saysWhichField: z.ZodBoolean; }, z.core.$strip>; type RequestSectionSpelling = z.infer; /** * How a REST handler spells each part of the request, as the pack that * recognized the handler says. `readSetOf` gives a read as the * parameter's role and then the property path, and these are the same * words: Express reads a header at `request.headers`, Lambda at * `event.headers`. The intent pass rewrites a read from this spelling * into the one an author writes under `receives`. * * A section left out is one the framework has no path for. A section * with `saysWhichField: false` is one whose reads never say which field * they wanted: Lambda hands the body over as a string the handler * parses, and Hono puts the header name in a call argument, which no * read records. */ declare const RequestSpellingMetadataSchema: z.ZodObject<{ headers: z.ZodOptional; saysWhichField: z.ZodBoolean; }, z.core.$strip>>; query: z.ZodOptional; saysWhichField: z.ZodBoolean; }, z.core.$strip>>; params: z.ZodOptional; saysWhichField: z.ZodBoolean; }, z.core.$strip>>; body: z.ZodOptional; saysWhichField: z.ZodBoolean; }, z.core.$strip>>; }, z.core.$strip>; type RequestSpellingMetadata = z.infer; /** * A metadata bag with the request-spelling namespace set. Writes are * strict: a field the schema does not name throws here, next to its * cause. Reads stay lenient so older artifacts keep reading. */ declare function withRequestSpellingMetadata(metadata: Record | undefined, value: RequestSpellingMetadata): Record; /** The summary's request-spelling namespace, or undefined when absent or not an object. */ declare function readRequestSpellingMetadata(summary: BehavioralSummary): RequestSpellingMetadata | undefined; declare const LibraryEnvReadsSchema: z.ZodObject<{ module: z.ZodString; prefixes: z.ZodOptional>; names: z.ZodOptional>; }, z.core.$strip>; type LibraryEnvReads = z.infer; /** * Env vars a library reads from inside node_modules, declared by the * pack that covers the library and stamped on a marker summary at * extract time. The runtime-config pairing consults these before * calling a declared variable unused, since the reading code is never * walked. */ declare function readLibraryEnvReads(summary: BehavioralSummary): LibraryEnvReads | undefined; /** * The project files a summary's own file imports directly, or * undefined when the extractor recorded none. Paths are relative to * the same root as `location.file`. A checker working from summaries * alone rebuilds the module graph from these, which is how a runtime's * scope becomes its handler entry's import closure. */ declare function readModuleImports(summary: BehavioralSummary): string[] | undefined; declare const StorageContractMetadataSchema: z.ZodObject<{ fieldSet: z.ZodOptional>; identifies: z.ZodOptional; fields: z.ZodArray; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodLiteral<"keyConvention">; pattern: z.ZodString; }, z.core.$strip>]>>; fields: z.ZodOptional; nullable: z.ZodOptional; primary: z.ZodOptional; unique: z.ZodOptional; derived: z.ZodOptional; relationKey: z.ZodOptional>; joinContainer: z.ZodOptional; }, z.core.$strip>>>; indexes: z.ZodOptional; unique: z.ZodBoolean; }, z.core.$strip>>>; physicalTable: z.ZodOptional; }, z.core.$strip>; type StorageContractMetadata = z.infer; /** The fields and indexes a schema declares for one container. */ declare function readStorageContractMetadata(summary: BehavioralSummary): StorageContractMetadata | undefined; /** * What one measurement of a metric is. `"number"` is a single value per * point, which is what a comparison against a threshold needs. * `"histogram"` is buckets, which have no one value, so something has * to reduce it before anything can compare it. * * `"histogram"` is the OpenTelemetry metrics data model's word for the * bucketed point kind. Cloud Monitoring calls the same thing * DISTRIBUTION, and the pack that reads it translates. */ declare const MetricValueShapeSchema: z.ZodEnum<{ number: "number"; histogram: "histogram"; }>; type MetricValueShape = z.infer; /** * What one measurement covers: `"gauge"` is the value at a point, * `"delta"` the change across the interval before it, and * `"cumulative"` the total since the series started. * * `"delta"` and `"cumulative"` are OpenTelemetry's aggregation * temporalities. OpenTelemetry gives an instantaneous measurement no * temporality and calls its point kind a gauge instead, and Cloud * Monitoring's metric kind spells all three outright: GAUGE, DELTA, * CUMULATIVE. */ declare const MetricAccumulationSchema: z.ZodEnum<{ gauge: "gauge"; delta: "delta"; cumulative: "cumulative"; }>; type MetricAccumulation = z.infer; declare const MetricContractMetadataSchema: z.ZodObject<{ values: z.ZodOptional>; accumulates: z.ZodOptional>; }, z.core.$strip>; type MetricContractMetadata = z.infer; /** What the side declaring a metric says its measurements are. */ declare function readMetricContractMetadata(summary: BehavioralSummary): MetricContractMetadata | undefined; declare const MetricReadingMetadataSchema: z.ZodObject<{ comparesTo: z.ZodOptional>; reducesTo: z.ZodOptional>; reduction: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>; type MetricReadingMetadata = z.infer; /** What the side reading a metric needs from it. */ declare function readMetricReadingMetadata(summary: BehavioralSummary): MetricReadingMetadata | undefined; declare const CodeScopeMetadataSchema: z.ZodObject<{ kind: z.ZodEnum<{ unknown: "unknown"; codeUri: "codeUri"; }>; path: z.ZodOptional; entry: z.ZodOptional; }, z.core.$strip>; type CodeScopeMetadata = z.infer; /** Which code a deployable unit runs, or the unknown marker when nothing said. */ declare function readCodeScopeMetadata(summary: BehavioralSummary): CodeScopeMetadata | undefined; declare const ReactMetadataSchema: z.ZodObject<{ kind: z.ZodOptional; deps: z.ZodOptional>>; component: z.ZodOptional; index: z.ZodOptional; }, z.core.$strip>; type ReactMetadata = z.infer; /** What the React pack recorded about a sub-unit, an effect and its deps. */ declare function readReactMetadata(summary: BehavioralSummary): ReactMetadata | undefined; declare const StorybookMetadataSchema: z.ZodObject<{ story: z.ZodOptional; component: z.ZodOptional; args: z.ZodOptional>; provenance: z.ZodOptional; }, z.core.$strip>; type StorybookMetadata = z.infer; /** The story a summary describes, and the component it is written for. */ declare function readStorybookMetadata(summary: BehavioralSummary): StorybookMetadata | undefined; /** * A declared summary describes one deployable unit: the environment a * SAM function runs with, the queue an ECS task drains. Pairing it * against code means working out which code runs in that unit, and * three things can tell you, in descending order of how much they know. * * Best is the summary itself. A pack that discovers a handler under a * template entry knows which unit it will be deployed as. * * Next best are the summaries beside it in the same file. A module is * deployed whole, so a helper next to a discovered handler runs * wherever that handler runs, and most of the code that reads * configuration is in that rest of the module. */ /** The code scope on a declaring summary, or the unknown marker when it * has none. */ declare function readCodeScope(summary: BehavioralSummary): CodeScopeMetadata; /** The units each file's code is deployed as, according to its own * summaries. */ type UnitsByFile = ReadonlyMap; interface UnitScope { /** The unit the declaring side describes, when it gives one. */ unit: DeployableUnit | undefined; /** * The source directory to fall back on when neither side gives a * unit. Absent where nothing stated one, which is what a Terraform * configuration does, and then only the closure places a file. */ codeScope?: string; /** * The files the runtime's handler entry reaches through imports. * When set, membership decides instead of the directory: a shared * helper pairs with every runtime whose closure loads it, and a file * outside every closure pairs with none. */ closure?: ReadonlySet; } /** * Read the deployable unit off every summary that has one and group the * results by file. A module with two handlers is deployed as both, so * the file keeps both units and its helpers run in each. */ declare function unitsByFile(summaries: BehavioralSummary[]): UnitsByFile; /** * The files that two or more of these scopes' directories contain, * among code that gives no unit of its own. Nothing tells the scopes * apart for such a file, so a caller that would otherwise pair it * against every one of them pairs it against none and says why. * * Code that gives a unit is never in here: the units decide, and the * directories are not consulted. */ declare function contestedFiles(code: readonly BehavioralSummary[], scopes: readonly UnitScope[], byFile: UnitsByFile): ReadonlySet; /** Whether this code summary runs inside the scope. */ declare function runsIn(code: BehavioralSummary, scope: UnitScope, byFile: UnitsByFile): boolean; /** * Which code each declared runtime runs. * * A runtime-config provider says what a deployable is given and where * its code is. Working out which summaries that covers is the same * question whether you are checking that a variable is supplied or * asking what a variable is set to, so both passes ask it here. * * Two things can say where the code is, and either will do. A handler * entry that matches a module gives the import closure, which is the * exact answer. A source directory gives a prefix, which is the rough * one. A Terraform configuration states only the handler, since the * zip it deploys is built somewhere the configuration never says. */ /** A runtime and the answer to "which code runs in it". */ interface PlacedRuntime { runtime: BehavioralSummary; binding: BoundaryBinding; scope: UnitScope; } interface Placement { /** The runtimes whose code scope this could work out. */ placed: PlacedRuntime[]; /** * The runtimes that said nothing about where their code is, paired * with the binding a caller needs to report them. */ unplaced: Array<{ runtime: BehavioralSummary; binding: BoundaryBinding; }>; } declare function isRuntimeConfigProvider(summary: BehavioralSummary): boolean; /** * Place every runtime-config provider in the set. A runtime whose entry * matches a file in the module graph gets that entry's import closure, * which decides membership instead of the directory. */ declare function placeRuntimes(summaries: BehavioralSummary[]): Placement; /** * The work both channels do before either can say anything: place every * runtime against the code it runs, and group the units by file. * * Both `deployedValues` and `deployedRefs` need it, and a caller that * wants both, which is anything asking a `Deployment`, would otherwise * walk the module graph twice for one result. */ interface DeploymentScope { placed: PlacedRuntime[]; byFile: UnitsByFile; } declare function deploymentScope(summaries: BehavioralSummary[]): DeploymentScope; /** * deployedRefs.ts: which resource a variable points at, for the code * that runs in the deployment that sets it. * * A queue URL, a topic ARN and a function name all exist only once the * stack is deployed, so code reaches them through an env var and the * template sets that variable to `!Ref SomeResource`. Both sides mean * one resource and neither writes the other's string, so pairing * collapses the chain here first. * * This is the reference half of `deployedValues` next door, which does * the same for a plain string. Scope is worked out the same way, by * asking which runtime the code in question runs in. */ /** * Ask which template resource a variable points at, for a given unit. * * Null when no runtime in the run sets it, when the runtimes that do * are not the ones this unit runs in, or when two of them point the * variable at different resources. Picking one of two answers would be * a guess, and an unpaired boundary says less than a wrong pair. */ declare function deployedRefs(summaries: BehavioralSummary[], scope?: DeploymentScope): (summary: BehavioralSummary, variable: string) => string | null; /** * deployedValues.ts: what the deployment sets a variable to, for the * code that runs in it. * * A name filled in at deploy time is written one way in the source and * another way in the thing that runs it. `{SUBSCRIBER_TABLE}` in the * code and `prod-subscribers-v1` in the template are one table, and * pairing the two means asking the runtime. * * Scope decides the answer. Two services in one repository can both * set `API_BASE` to different hosts, so a lookup asks which runtime * the code in question runs in rather than taking the first match. */ /** A value the deployment sets, and the runtime that sets it. */ interface DeployedValue { value: string; source: BehavioralSummary; } /** * Ask what a variable is set to, for a given unit. * * Empty when no runtime in the run sets it, or when the runtimes that * do are not the ones this unit runs in. */ declare function deployedValues(summaries: BehavioralSummary[], scope?: DeploymentScope): (summary: BehavioralSummary, variable: string) => DeployedValue[]; /** Edges from each summary file to the files it imports. */ type ModuleGraph = ReadonlyMap; declare function buildModuleGraph(summaries: readonly BehavioralSummary[]): ModuleGraph; /** * Every file the entry reaches through the graph, the entry's own file * included. The entry comes from a template's `Handler`, written * without an extension ("src/handlers/confirm"), so it matches a graph * file by comparing with the extension stripped. Null when no file * matches the entry, which means the graph cannot say what the runtime * loads and the caller falls back to the directory. */ declare function entryClosure(entry: string, graph: ModuleGraph): ReadonlySet | null; /** * When two effects say the same thing, and what to do with the repeats. * * A transition lists each effect once, so a schema validator called * thirteen times on one path is one effect with `count: 13`. The count * is the only place that multiplicity is kept, and a reader that needs * it reads the field rather than counting entries. * * Two fields stay out of the key. `groupId` says which call site produced * an effect rather than what the effect is, and `count` is the result of * the fold. Only the top level is filtered, because an argument object is * free to have a field of its own called `count`. */ /** * One spelling for a callee, whatever the source looked like. A callee * is the call expression as it was written, so a chain broken across * lines arrives with its newlines and indentation and the same call * written on one line elsewhere is a different string. Anything that * matches an effect by its callee text goes through this first. */ declare function normalizeCalleeText(text: string): string; /** Two effects with the same key are the same effect. */ declare function effectKey(effect: Effect): string; /** * One entry per effect, in the order they first appeared, with `count` * set on any that turned up more than once. */ declare function foldRepeatedEffects(effects: readonly Effect[]): Effect[]; /** * Reading summaries written before the format said what it meant. * * Version 1 is everything up to 0.3.x, plus any summary with no * `schemaVersion` at all. It writes "the source did not say what this * identity is" as an empty string in a binding's identity fields, and * version 2 writes null there and rejects the empty string. Nobody * rewrites a published artifact, so every parse entry point runs the * normalization here first and an old summary still reads. * * The same boundary catches a summary whose identity never got an id. * Those read back with an id computed from the fields they do have, by * the same formula a full run would have arrived at. */ /** * The summary format version this build writes. Absent means version 1. * * 1: an identity field a source did not name is the empty string. * 2: those fields are null instead, the empty string is invalid, and * `"*"` is the REST method wildcard. * 3: a parameter input's `role` is null where nobody could read it. * Older artifacts all name one, so nothing is rewritten on the way * in and the bump only marks that null as allowed. * 4: one `storage` variant replaces `storage-relational`. * 5: a store and a bus go by the name OpenTelemetry's semantic * conventions give them, so a summary and a span spell the same * boundary the same way. * 6: a metric's measurement words are OpenTelemetry's too: histogram, * and gauge, delta, cumulative for what one covers. */ declare const SUMMARY_SCHEMA_VERSION = 6; /** Mutates and returns its input, which a parse boundary owns. */ declare function normalizeLegacySummary(input: unknown): unknown; /** * What a unit does at each boundary a summary mentions. * * The verbs are `@suss/ir-core`'s `Relation`, the same ones `suss ask` * asks with. This module says which verb each interaction class gets, * so a report, a question and an intent doc that states a boundary * effect all read one answer. */ type Interaction = Extract["interaction"]; declare function relationsOf(interaction: Interaction): Relation[]; /** What a unit does at the boundary its own identity is bound to. */ declare const OWN_BINDING: Record; /** * Which container an access written under a relation reaches comes * from the provider's contract, so a walk over one summary cannot say. */ declare function goesThroughRelation(interaction: Interaction): boolean; /** * The contract between a manifest reader's routing edges and the * reachability pass that walks them. * * A routing edge's match record keeps its conditions as data, written * in the condition language the reader named (`matchLanguage` on the * routing metadata). Which match a router hands a request to is up to * that language: the ordering its priorities declare and the globbing * its patterns use belong to the reader that owns the vocabulary, never * to the generic walk. So a reader that emits edges also exports a * `RouterMatchSelector` for its language, and the walk sends each * router's match records to the selector for their language through a * table keyed by the types here. */ interface FlowRequest { /** Uppercase HTTP method ("GET"). */ method: string; /** Request host ("shop.example.com"), or null when the question does not say. */ host: string | null; /** Absolute request path ("/api/orders/123"). */ path: string; } type RoutingMatchCondition = NonNullable[number]; /** When a forward is weighted across targets, all its edges share one record. */ interface RoutingMatchRecord { matchId: string; /** Absent for a router's default action. */ priority?: number; conditions: RoutingMatchCondition[]; } /** * `possible` lists the matches that could take the request once something * the declarations leave open gets decided at runtime. A match in neither * list refuses the request. */ interface RouterSelection { admitted: string[]; possible: string[]; } /** Implemented by whichever reader owns the router's condition language. */ type RouterMatchSelector = (records: RoutingMatchRecord[], request: FlowRequest) => RouterSelection; declare function nestedDocumentLabel(rootLabel: string, stackPath: string[]): string; declare function rootDocumentLabel(label: string): string; interface DocumentLabelParts { /** The reader that wrote the label, such as `cloudformation`. */ reader: string; location: string; } declare function parseDocumentLabel(label: string): DocumentLabelParts | null; declare function namesDocumentByFileName(label: string): boolean; /** * The formula that turns a summary's own fields into its id. * * The TypeScript adapter (nameSummaries) settles collisions across a * whole run before it stamps an id, and that takes every summary the * run produced. A producer that only ever sees one file at a time, a * contract reader or the legacy-artifact backfill, has no run to settle * against, so it gets the same base formula without the settling. Both * call this rather than keeping a copy, so the two cannot drift apart. */ interface SummaryIdParts { /** What the summary's project calls itself, when anything does. */ workspace: string | undefined; /** The file the summary is in, spelled however the caller spells it. */ file: string; name: string; exportPath: string[] | null; } /** * The id built out of a summary's own fields: the workspace it calls * itself part of, the file it is in, and its export path when it has * one, or its name when it does not. */ /** * Extend only the ids that more than one summary ended up with, and * leave the rest alone. An id nothing collides with stays short, and * stays the same when the code around it moves. The boundary tells * same-named summaries apart first, and the line number settles what * the boundary cannot. The adapter runs this after assigning ids, and * the parse boundary runs it over a backfilled v1 artifact, whose * per-summary backfill can mint one id for two summaries. */ declare function disambiguateSummaryIds(summaries: BehavioralSummary[]): void; /** * How a report should spell a summary that does not cross a boundary. * * A producer that ran through the parse boundary already has an id, and * that is what a reader should see, because the run settled its * collisions. A summary handed straight to a checker never went through * that step, so the same formula runs here over the fields it does * have: the file it is in and its export path. That leaves out the * workspace, which only the producer knows, and it leaves out the * collision settling, which needs the whole run. Both give a reader a * file to open, which a bare name does not. */ declare function summaryIdentifier(summary: BehavioralSummary): string; /** * The id a summary has before settling adds a boundary or a line to * it, which is what a reader matches a typed tail against: the tail * `evaluate` is this function's own name, and not the export a caller * of it was settled with. */ declare function unsettledSummaryId(summary: BehavioralSummary): string; /** * What settling appended to a summary's id, or nothing. The id and the * summary can disagree about the workspace, so the match leaves it out. */ declare function settlingSuffix(summary: BehavioralSummary): string; declare function summaryIdFromParts(parts: SummaryIdParts): string; /** * The key a render edge joins on: the file a component is declared in * and one of its spellings. The producer writes `target` with the * declaration's name, the checker indexes each summary under its name * and its export path, and both sides mint the key here so the two * cannot drift apart. The separator cannot appear in a path, which a * space could. */ declare function renderTargetKey(file: string, name: string): string; /** * Naming the calls a walk stops at. * * An adapter follows a call by resolving its callee to a function with * a body. When that fails the edge is dropped, and a unit whose body is * full of dropped edges produces the same empty summary as a unit that * does nothing. The reasons here say which kind of stop a call site * is, and which kinds are worth leaving a gap for, in words every * adapter shares. How a stop is classified is each language's own * business and stays in its adapter. */ /** * Why the walk stopped. * * `noBody` states a shape and nothing else, an interface method say. * `unsettledValue` is declared as something other than a function, with * something in it that could not be read. `multipleSources` reaches two * functions, so no single body can be followed. `outsideRun` is declared * in a dependency this run never read. `noDeclaration` is a callee * nothing declares. `callerSupplied` is a parameter, so the call runs * what the caller handed in. `multipleReceivers` is a registration whose * receiver comes down to more than one thing, and `unresolvedWrapper` * one whose function the run could not settle on. `definedAtLoadTime` is * a method the project writes while the file loads. */ type UnfollowedReason = "noBody" | "unsettledValue" | "multipleSources" | "outsideRun" | "noDeclaration" | "callerSupplied" | "multipleReceivers" | "unboundParameter" | "unresolvedWrapper" | "definedAtLoadTime"; /** One call the walk met and could not follow. */ interface UnfollowedCall { /** The callee as the source writes it, `this.dao.getEditions` say. */ readonly callee: string; readonly reason: UnfollowedReason; /** How many things the walk reached where it needed one. */ readonly candidates?: number; } declare function worthRecording(reason: UnfollowedReason): boolean; declare function unfollowedCallGap(stop: UnfollowedCall): Gap; /** * wrapperChain.ts: the summary each wrapper on a unit's chain points at. * * A unit records the wrappers registered around it as file-and-name * references, and what each of them does is in its own summary. Every * reader that wants the effects along a request, rather than the * unit's own outcomes alone, follows the chain to those summaries, so * the pairing lives here instead of once per reader. */ /** A run's summaries by the file and name a wrapper reference spells. */ type WrapperIndex = ReadonlyMap; declare function wrapperIndex(summaries: readonly BehavioralSummary[]): WrapperIndex; /** * The summary this reference points at, or undefined when the run has * none. Two functions written out at their registrations in one file go * by the same name, and the line is what tells them apart. */ declare function wrapperFor(index: WrapperIndex, reference: WrapperReference): BehavioralSummary | undefined; /** The chain recorded on a unit, in the order it runs. */ declare function wrapperChain(summary: BehavioralSummary): readonly WrapperReference[]; /** * The summaries of the wrappers around each unit, for a whole run. A * reference the run has no summary for is left out, which is what a * middleware imported from a package the walk never entered looks like. */ declare function wrappersAround(summaries: readonly BehavioralSummary[]): (unit: BehavioralSummary) => BehavioralSummary[]; /** * A three-valued interpreter for the summary IR. * * It evaluates `Predicate` and `ValueRef` trees against a concrete * environment: a request, a props object, any record keyed by input * refs. The rule everything else follows from is that it abstains. * Anything the IR marks opaque, and any value it cannot trace to a * concrete one (a dependency result, an unresolved reference, a method * call), comes out `unknown` rather than guessed at. Predicates compose * under Kleene three-valued logic, so one unknown conjunct makes the * whole conjunction unknown instead of quietly true or false. The * differential fuzzer uses this to judge extracted claims against * executions, and `suss corroborate` uses it as its oracle. */ /** Three-valued truth: definitely true / definitely false / abstain. */ type Tri = "true" | "false" | "unknown"; type EvalValue = { type: "known"; value: unknown; } | { type: "unknown"; }; /** * The concrete environment: values keyed by the summary's input * references, which for a handler are the parameter names (`req`). */ type InterpretEnv = Record; declare function evalValueRef(ref: ValueRef, env: InterpretEnv): EvalValue; declare function triAnd(values: Tri[]): Tri; declare function triOr(values: Tri[]): Tri; declare function evalPredicate(predicate: Predicate, env: InterpretEnv): Tri; /** Conjunction of a transition's conditions under Kleene logic. */ declare function evalConditions(conditions: Predicate[], env: InterpretEnv): Tri; /** * What a unit reads off the value it was handed, compared against what * the senders to it supply. * * This is one rule for every protocol. A React child reads a prop, a * queue consumer reads a field of a message body, an HTTP handler * reads a field of a request. In all three the receiver asks for a * path and the sender supplies a shape, and the question is whether * the shape has anything at that path. The protocol decides which * input the sender's value arrives through, and the wording. * * Both sides are partial readings, so the rule declines to compare * rather than guess. The README lists every such case. */ /** True when the sender's whole value arrives through this input. */ type CarriesPayload = (input: Input) => boolean; /** Why the rule declined to compare. */ type StandDown = "no-reads" | "rest-parameter" | "payload-used-whole" | "sender-opaque" | "different-object" | "platform-envelope" | "unmapped-protocol"; interface ReadSet { /** Each path the receiver asked for, outermost segment first. */ paths: string[][]; /** * Whether the paths start at the value the sender wrote. A * destructure of an already-parsed message does. A handler * parameter does not as far as `readSetOf` can tell, because the * platform's envelope arrives in the same position; a protocol that * knows its envelope settles this itself. */ rootedAtPayload: boolean; } type ReadSetResult = { read: true; reads: ReadSet; } | { read: false; reason: StandDown; }; type ComparisonResult = { compared: true; unsupplied: string[][]; } | { compared: false; reason: StandDown; }; /** * The paths a unit was seen asking for through its inputs, or the * reason that list could be short of what it really reads. * * A read through the payload input gives the path from the payload's * root. A read through any other named parameter gives that * parameter's role as the first segment, which is where a destructure * rename keeps the name the sender used. */ declare function readSetOf(summary: BehavioralSummary, carriesPayload: CarriesPayload): ReadSetResult; /** * Which path off the unit's input a value reference points at, spelled * the way `readSetOf` spells a read, so a guard on a value and a read * of it can be compared. Null for a reference to anything but an input * this rule follows, and for the payload taken whole. */ declare function readPathOf(summary: BehavioralSummary, ref: ValueRef, carriesPayload: CarriesPayload): string[] | null; /** * The paths in the read set that no sender supplies. One sender that * sets a field is enough, because the receiver cannot tell which of * them sent the value it is handling. */ declare function compareSupplied(reads: ReadSet, supplied: readonly unknown[]): ComparisonResult; /** Both halves at once, for a caller that has the receiver to hand. */ declare function checkReceivedInput(args: { receiver: BehavioralSummary; carriesPayload: CarriesPayload; supplied: readonly unknown[]; }): ComparisonResult; declare function formatPath(path: readonly string[]): string; /** * A message arrives through the handler's event parameter. Every pack * that discovers a message handler gives that parameter this role. */ declare const isTheMessageParameter: CarriesPayload; /** * What a queue consumer reads off the message body. A handler that * reads one of the platform's own envelope fields was handed the * envelope, and its paths are not body fields at all, so the rule * reports nothing rather than compare them against what a producer sent. */ declare function messageBodyReadSet(summary: BehavioralSummary, messageBus: MessageBusTechnology): ReadSetResult; /** * Which of a unit's inputs its caller sends the value through, so a * guard on that value and a read of it are spelled the same way. Null * for a protocol that has not said which input that is. */ declare function carriesPayloadFor(binding: BoundaryBinding): CarriesPayload | null; /** * What a unit reads off the value its boundary hands it, for the * protocols that have said which input that value arrives through. * `alsoRead` are units reading the same value beside it, which for a * route is the middleware registered around it. */ declare function boundaryInputReads(summary: BehavioralSummary, binding: BoundaryBinding, alsoRead?: readonly BehavioralSummary[]): ReadSetResult; /** * Which path off that value a reference points at, spelled the way * `boundaryInputReads` spells a read, so a guard on a field and a read * of it compare. Null when the reference is not one this rule follows. */ declare function boundaryInputPathOf(summary: BehavioralSummary, binding: BoundaryBinding, ref: ValueRef): string[] | null; /** * @suss/behavioral-ir: the types, schemas, and helpers for the * behavioral summary format. * * The schemas in `./schemas` are the source of truth. The types here * come from them through `z.infer`, so there is nothing to keep in sync * by hand. The schemas themselves are not public API. What a consumer * gets is the types, plus `parseSummary` and `parseSummaries` for * validating at runtime. If you need to compose at the zod level you * can import the schema module by its internal path, but nothing * promises that path will keep working. */ type CodeUnitKind = z.infer; type ComparisonOp = z.infer; type OpaqueReason = z.infer; type FindingKind = z.infer; /** * Every behavioural finding kind, as runtime values. For consumers * that validate user-supplied kind references (e.g. .sussignore rules) * without reaching into the schema module, which is not public API. */ declare const FINDING_KINDS: readonly FindingKind[]; type FindingSeverity = z.infer; type RunFindingKind = z.infer; type RunFinding = z.infer; /** Every run-level finding kind, as runtime values. See FINDING_KINDS. */ declare const RUN_FINDING_KINDS: readonly RunFindingKind[]; type BoundaryAspect = z.infer; type CodeUnitIdentity = z.infer; type Literal = z.infer; type Derivation = z.infer; type ValueRef = z.infer; type Predicate = z.infer; type Input = z.infer; type Output = z.infer; type Effect = z.infer; type RenderNode = z.infer; type Transition = z.infer; type Gap = z.infer; type BehavioralSummary = z.infer; type SummaryDiff = z.infer; type FindingSide = z.infer; type Finding = z.infer; /** * Refer to a summary the way a finding does. * * The string that comes back gets read as well as printed: the checker * deduplicates findings by it, and a `.sussignore` rule matches against * it. Both sides have to agree on the separator and on which two fields * go into it, so one function owns the format instead of every caller * writing out the template literal. * * It is file-and-name rather than `identity.id` on purpose: a rule * someone already wrote has to keep matching, and an id includes the * workspace, which changes the string for most projects. Code following * a link instead of printing one has `identity.id` and `effect.summary`. */ declare const SummaryRefBrand: unique symbol; /** The `file::name` reference, with `summaryRef` its only constructor. */ type SummaryRef = string & { readonly [SummaryRefBrand]: "summaryRef"; }; declare function summaryRef(summary: BehavioralSummary): SummaryRef; /** * The source text a path engine writes on the condition that says a * branch was reached by an exception. It is the same in every language * so transition IDs stay stable, and `isCatchEntry` is how a check asks * without spelling the string a second time. */ declare const CATCH_ENTRY_TEXT = "catch"; /** Whether this condition says the branch was reached by an exception. */ declare function isCatchEntry(predicate: Predicate): boolean; /** * The role a code unit plays at a boundary. Pairing logic looks this up * via `BOUNDARY_ROLE` so adding a new kind requires only a single edit * (and the lookup becomes a type error if a variant is missed). */ type BoundaryRole = "provider" | "consumer"; declare const BOUNDARY_ROLE: Record; /** * Validate and return a single summary, throwing on failure. Use this at * boundaries where invalid data should halt processing (CLI loading from * disk). Version-1 artifacts are normalized first, so summaries written * by 0.3.x keep parsing. */ declare function parseSummary(input: unknown): BehavioralSummary; declare function safeParseSummary(input: unknown): z.ZodSafeParseResult; /** * Validate and return an array of summaries. Throws if the input is not * an array, or any element fails validation. Use `safeParseSummaries` * for non-throwing behavior. */ declare function parseSummaries(input: unknown): BehavioralSummary[]; declare function safeParseSummaries(input: unknown): z.ZodSafeParseResult; declare function diffSummaries(before: BehavioralSummary, after: BehavioralSummary): SummaryDiff; export { BOUNDARY_ROLE, type BehavioralSummary, type BoundaryAspect, type BoundaryCall, type BoundaryGuard, type BoundaryRole, CATCH_ENTRY_TEXT, type CarriesPayload, type CodeScopeMetadata, type CodeUnitIdentity, type CodeUnitKind, type ComparisonOp, type ComparisonResult, type DeclaredAt, type DeployedValue, type DeploymentScope, type Derivation, type DocumentLabelParts, type Effect, type EnvVarSource, type EvalValue, FINDING_KINDS, type Finding, type FindingKind, type FindingSeverity, type FindingSide, type FlowRequest, type Gap, type GraphqlContractProvenance, type GraphqlDeclaredContract, type GraphqlMetadata, GraphqlMetadataSchema, type GuardSubject, type HttpContractProvenance, type HttpDeclaredContract, type HttpMetadata, HttpMetadataSchema, type Input, type Interaction, type InterpretEnv, type LibraryEnvReads, type Literal, type MessageBusMetadata, MessageBusMetadataSchema, type MetricAccumulation, MetricAccumulationSchema, type MetricContractMetadata, type MetricReadingMetadata, type MetricValueShape, MetricValueShapeSchema, type ModuleGraph, type MountMetadata, OWN_BINDING, type OpaqueReason, type Output, type ParameterCall, type PlacedRuntime, type Placement, type Polarity, type Predicate, RUN_FINDING_KINDS, type ReactMetadata, type ReadSet, type ReadSetResult, type RenderNode, type RequestSectionSpelling, type RequestSpellingMetadata, RequestSpellingMetadataSchema, type RouterMatchSelector, type RouterSelection, type RoutingMatchCondition, type RoutingMatchRecord, type RoutingMetadata, RoutingMetadataSchema, type RunFinding, type RunFindingKind, type RuntimeContractMetadata, RuntimeContractMetadataSchema, SUMMARY_SCHEMA_VERSION, type SourceDocumentMetadata, SourceDocumentMetadataSchema, type StandDown, type StorageContractMetadata, type StorybookMetadata, type SummaryDiff, type SummaryIdParts, type SummaryRef, TargetPlacements, type Transition, type Tri, type UnfollowedCall, type UnfollowedReason, type UnitScope, type UnitsByFile, type ValueRef, type WrapperIndex, type WrapperMetadata, type WrapperReference, boundaryCalls, boundaryGuardsOf, boundaryInputPathOf, boundaryInputReads, buildModuleGraph, carriesPayloadFor, checkReceivedInput, compareSupplied, contestedFiles, declarationKey, deployedRefs, deployedValues, deploymentOf, deploymentScope, diffSummaries, disambiguateSummaryIds, effectKey, entryClosure, evalConditions, evalPredicate, evalValueRef, foldRepeatedEffects, formatPath, goesThroughRelation, guardSubject, isCatchEntry, isRuntimeConfigProvider, isTheMessageParameter, linkCallsToSummaries, messageBodyReadSet, namesDocumentByFileName, nestedDocumentLabel, normalizeCalleeText, normalizeLegacySummary, parameterNamed, parseDocumentLabel, parseSummaries, parseSummary, placeArgTargets, placeCalleeParameters, placeCalls, placeRuntimes, polarityOf, readCodeScope, readCodeScopeMetadata, readGraphqlMetadata, readHttpMetadata, readLibraryEnvReads, readMessageBusMetadata, readMetricContractMetadata, readMetricReadingMetadata, readModuleImports, readMountMetadata, readPathOf, readReactMetadata, readRequestSpellingMetadata, readRoutingMetadata, readRuntimeContractMetadata, readSetOf, readSourceDocumentMetadata, readStorageContractMetadata, readStorybookMetadata, readWrapperMetadata, recordParameterGaps, relationsOf, renderTargetKey, rootDocumentLabel, runsIn, safeParseSummaries, safeParseSummary, sameUnit, settlingSuffix, summaryIdFromParts, summaryIdentifier, summaryRef, triAnd, triOr, unfollowedCallGap, unitsByFile, unsettledSummaryId, variableAsked, withDeclaredDelivery, withGraphqlMetadata, withHttpMetadata, withMessageBusMetadata, withMountMetadata, withRequestSpellingMetadata, withRoutingMetadata, withRuntimeContractMetadata, withSourceDocumentMetadata, withWrapperMetadata, worthRecording, wrapperChain, wrapperFor, wrapperIndex, wrappersAround };