/** * Contract elements in the briefings (change: add-contract-graph-projection). * * `certify_service_contract` answers when asked; an agent editing a route handler should see, * unasked, that the handler is declared in an OpenAPI specification and what that declaration * requires. This reads the indexed route inventory and the working tree's specifications (the * same readers the certification uses) and names, for files in scope, the operations their routes * serve: method + path, the specification file and line, `operationId`, required parameters and * required body properties, and deprecation. Matching is by method and normalized path, as in the * certification's parity; a route's handler name is often generic (an inline function), so a file * is the unit, never a guessed function. Read-only; bounded; fail-quiet. */ export interface ContractBrief { /** `GET /v1/orders/{id}`. */ operation: string; operationId?: string; /** `openapi.yaml:42`. */ spec: string; /** The indexed route that serves it. */ route: { file: string; method: string; path: string; }; deprecated?: true; /** Matched on the path without the servers base path (the router may mount under it). */ matchedWithoutBasePath?: true; /** The route file is outside the scope; it names this function in scope. */ routeFileNames?: string; requiredParams: string[]; requiredBody: string[]; } export interface ContractBriefing { contracts: ContractBrief[]; /** Operations matched beyond the cap. */ omitted?: number; note: string; } /** * Whether a call's literal URL targets a host the specification declares. * * A host-less (relative) URL targets this service, so it counts. A URL whose host is not among * the declared `servers` hosts is another vendor on the same path shape and must not be read as * a consumer. With no declared host there is nothing to compare, so the caller discloses that * rather than excluding. * * Exported because the FEDERATED census needs exactly this rule: across repositories a host * mismatch is the normal case, not the edge case (change: add-contract-graph-projection). */ export declare function sameDeclaredHost(url: string, hosts: readonly string[]): boolean; /** A path template made only of parameters (`/{a}/{b}`): too generic to attribute a call site. */ export declare function allParameterPath(normalized: string): boolean; /** * The OpenAPI operations served by routes in `files` (root-relative), and the indexed route files * whose handler is named in `handlers`, or undefined when no such route is indexed or no * specification declares one. A route matches an operation by method and its full path (servers * base included); without the base only when the route path has a literal segment and exactly one * operation in all specifications has that method and path. Wildcard-method routes are left out. */ export declare function contractsForFiles(root: string, files: readonly string[], functions?: readonly string[]): Promise; export interface ChangedContractElement { /** `GET /v1/orders/{id}`. */ operation: string; operationId?: string; /** `openapi.yaml:42`. */ spec: string; deprecated?: true; /** The indexed route that serves it, when one does. */ servedBy?: { file: string; method: string; path: string; }; /** Matched on the path without the servers base path (the router may mount under it). */ matchedWithoutBasePath?: true; /** In-repo call sites that consume it. */ consumedBy?: Array<{ file: string; line: number; }>; /** Consumers beyond the cap. */ consumersOmitted?: number; /** Nothing indexed in this repository serves or consumes it. */ unbound?: true; } export interface ChangedContractBriefing { /** The changed specification files this briefing read. */ specs: string[]; elements: ChangedContractElement[]; /** Elements beyond the cap. */ omitted?: number; /** What could not be assessed, named rather than implied absent. */ notAssessed?: string[]; note: string; } /** * The contract elements a diff's SPECIFICATION files declare, and the code bound to each. * * The sibling briefing (`contractsForFiles`) answers "my diff touched a handler — what contract * does it owe?". This answers the inverse: "my diff touched a specification — who is affected?". * An agent editing `openapi.yaml` otherwise sees nothing at all, because a specification is not * a call-graph node and no handler of its own appears in the diff. * * Deliberately NOT a verdict: it does not grade the change or compare against a base revision. * `certify_service_contract` with a base ref owns that conclusion, and the note says so — two * tools must not return the same answer in different words. * * Read-only, bounded, fail-quiet. Returns undefined when the diff touches no specification. */ export declare function changedContractsForSpecFiles(root: string, changedFiles: readonly string[]): Promise; //# sourceMappingURL=contract-briefing.d.ts.map