import type { EffectiveMethodology, RuleCandidate } from './methodology-resolver.js'; import type { CompiledConstraint } from '../validator/constraint-eval.js'; /** * The part of a kind this module needs. * * `layer` is optional here even though the registry always fills it: a caller * may be asking about a kind that did not resolve, and "unplaced" has to be a * representable answer rather than a cast. */ export interface ScopedKind { layer?: string; } export type ScopeDimension = 'layer' | 'module' | 'standard' | 'artifactKind' | 'viewpoint'; /** The resolved answer to "what is in scope", ready to be asked questions. */ export interface EffectiveScope { mode: 'allAvailable' | 'explicit'; layers: ReadonlySet; modules: ReadonlySet; standards: ReadonlySet; artifactKinds: ReadonlySet; viewpoints: ReadonlySet; } export declare function buildEffectiveScope(methodology: EffectiveMethodology): EffectiveScope; /** A scope that selects everything — the shape callers get before a binding resolves. */ export declare const UNRESTRICTED_SCOPE: EffectiveScope; /** * Is one value in scope for a dimension? * * Under `allAvailable` everything the project resolved is in scope, and the * lists are required to be empty. Under `explicit` only what is listed is in * scope — including when the list is empty, which selects nothing. */ export declare function isInScope(scope: EffectiveScope, dimension: ScopeDimension, value: string | undefined): boolean; /** * Is a kind in scope? * * A kind belongs to exactly one axis position, so it is in scope when its layer * is selected. A kind with no layer is only in scope under `allAvailable`: an * unplaced kind cannot be shown to satisfy an explicit selection. */ export declare function isKindInScope(scope: EffectiveScope, kind: ScopedKind): boolean; /** Filter kinds to those in scope. Used by palettes and creation dialogs alike. */ export declare function filterKindsInScope(kinds: readonly T[], scope: EffectiveScope): T[]; /** * Is a package in scope? * * `includedLayer` and `includedModule` both name packages; a methodology splits * them for readability, not because the resolver treats them differently. */ export declare function isPackageInScope(scope: EffectiveScope, packageName: string): boolean; /** * Is a rule active under this scope? * * A rule is scoped by the package that declares it. Disposition is a separate * question answered by `resolveEffectiveRules`: a rule can be in scope and * disabled, and the audit needs to show both facts rather than one. */ export declare function isRulePackageInScope(scope: EffectiveScope, declaringPackage: string | undefined): boolean; /** * The rules a project's methodology actually activates. * * A rule is active when BOTH its declaring package and its subject kind are in * scope. A rule whose subject the methodology never selected can only report on * content the project did not agree to model — which is how the GPCA prototype * used to accumulate cybersecurity violations for a discipline it had excluded. * * This lives here, shared, because `memo validate` and `memo rules list` are * two views of one answer. They computed it separately, and inevitably * disagreed: `validate` scope-filtered and `rules list` did not, so the same * project reported 20 rules and 38 rules depending on which command you asked. * A number that changes with the question is not an audit. */ export declare function activeRuleCandidates(constraints: readonly CompiledConstraint[], scope: EffectiveScope, filePackages: ReadonlyMap, kindSourceFile: (kindName: string) => string | undefined): RuleCandidate[]; //# sourceMappingURL=effective-scope.d.ts.map