/** * Authority category of a source unit. * * `memo-core` is listed by the design as distinct from `ontology`, but core * currently ships INSIDE the ontology package rather than as its own resolved * artifact. Origin is assigned from roots, so core is reported as `ontology` * until it is separately resolvable — inferring it from the `memo::core::` * package prefix would be exactly the path/name heuristic this module exists to * avoid. The variant stays in the union so that the split needs no DTO change. */ export type SemanticOrigin = 'standard-library' | 'memo-core' | 'ontology' | 'extension' | 'methodology' | 'project'; /** Provenance of one source file. */ export interface SourceProvenance { origin: SemanticOrigin; /** Package name from the manifest, e.g. "@memoarchitect/ontology". */ packageName: string; /** Declared SysML package qualified name, when the file declares one. */ packageQualifiedName?: string; packageVersion?: string; /** Absolute path of the file. */ sourceUri: string; /** Path relative to the root that owns it — stable across checkouts. */ sourceFile: string; /** Content hash, populated only where a caller needs change detection. */ sourceHash?: string; /** False for anything under a resolved dependency root. */ writable: boolean; /** Distance from the project in the resolved dependency graph; project is 0. */ importDepth: number; importedBy?: string[]; /** What brought this root into the graph (methodology id, module name, …). */ selectedBy?: string; } /** A resolved dependency root: one package directory and what it contributes. */ export interface ResolvedRoot { /** Absolute directory of the package. */ dir: string; origin: SemanticOrigin; packageName: string; packageVersion?: string; importDepth: number; selectedBy?: string; } /** * Map a package manifest `type:` to an authority category. * * `profile` is ontology content: it ships definitions that projects specialize, * and is frozen for the session exactly as the ontology is. `device` is what a * project declares about itself, so a device root is only ever the workspace. */ export declare function originForPackageType(type: string | undefined): SemanticOrigin; /** True when a change to this origin requires a runtime restart (section 13.3). */ export declare function isReusableOrigin(origin: SemanticOrigin): boolean; /** Classify a watched source path from the resolved provenance table. */ export declare function classifySourceChange(filePath: string, provenance: ProvenanceTable): 'project' | 'reusable' | 'unknown'; /** * Resolves any file path to its provenance. * * Roots may nest — a project can contain a vendored dependency under * `node_modules/` — so the LONGEST matching root wins. A path under no * dependency root but under the workspace is project content; a path under * neither is reported as unknown rather than guessed at. */ export declare class ProvenanceTable { private readonly roots; private readonly projectRoot; private readonly cache; constructor(projectRoot: string, roots: readonly ResolvedRoot[]); /** All dependency roots, longest path first. */ getRoots(): readonly ResolvedRoot[]; /** * Provenance for one file, or undefined when it belongs to no known root. * * Undefined is deliberate: a caller that cannot establish origin must say * so rather than defaulting to project (which would offer edits on library * content) or to ontology (which would hide a real project file). */ lookup(filePath: string): SourceProvenance | undefined; /** * Provenance for a file that must have one. * * Falls back to project so that a caller in the middle of building a model * is not forced to handle undefined; use `lookup` where the distinction * between "project" and "unknown" carries meaning. */ lookupOrProject(filePath: string): SourceProvenance; private compute; private projectProvenance; } /** Identity of a definition, sufficient to name it unambiguously. */ export interface DefinitionIdentity { qualifiedName: string; shortName: string; stableId?: string; provenance?: SourceProvenance; } /** * Provenance of a model element, keeping declaration and classification apart. * * A project usage typed by an ontology definition is project-owned content that * happens to be classified by library content. Collapsing the two is what made * Architect label project usages as read-only ontology elements. */ export interface SemanticElementProvenance { /** Source that declares this definition or usage. */ declaration: SourceProvenance; /** Definition that types the usage; absent for an untyped declaration. */ classifier?: DefinitionIdentity; /** Full specialization chain, nearest definition first. */ classifierChain?: DefinitionIdentity[]; } //# sourceMappingURL=source-provenance.d.ts.map