/** * Graph Metadata Enrichment * * Fills the AI-oriented fields on each architecture/dependencies.json entry: * framework — from `framework:` nx tag or package.json inference * serviceName — from project.json metadata.webpieces.serviceName; the * name clients address this app by at runtime * shortDescription — first paragraph of the project's responsibilities.md * responsibilitiesFile — repo-relative path to the required responsibilities.md * designFile — repo-relative path to the generated DI design.json * * Validation is aggregated: ALL problems across ALL projects are collected and * thrown as one MetadataValidationError so a repo adopting this sees the full * seeding list in a single run. Callers must enrich BEFORE writing any file so * a failed run never clobbers dependencies.json. */ import type { EnhancedGraph } from './graph-sorter'; import { ProjectInfo } from './project-info'; export declare const RESPONSIBILITIES_FILE_NAME = "responsibilities.md"; /** * Thrown when one or more projects fail metadata validation (missing/invalid * responsibilities.md, bad framework tags, ...). Executors catch this to point * AI at the webpieces.responsibilities.md instructions template. */ export declare class MetadataValidationError extends Error { readonly problems: string[]; constructor(problems: string[]); } /** * Read per-project root + tags from nx's project graph. */ export declare function collectProjectInfo(): Promise>; /** * Enrich every graph entry in place with framework, shortDescription, * responsibilitiesFile and designFile. Throws MetadataValidationError listing * every problem when any project fails validation. */ export declare function enrichGraph(graph: EnhancedGraph, infos: Map, workspaceRoot: string): void; /** * Roles that are terminal APPS — nothing may depend on them. A server, a * non-HTTP `app`, or a client is a top-level runnable; being depended upon means * it is really a library and should be retagged `role:lib`/`role:designed-lib`. */ export declare const APP_ROLES: ReadonlyArray; /** * Compatibility lattice — the "up-set" of each atomic env is the env itself * PLUS every ancestor it can legally consume code from (specialization edges * child → parent: react → browser, angular → browser, express → node). A * consumer promising env `c` can be satisfied by any dependency env in `up(c)`. */ export declare const ENV_UP_SETS: Readonly>>; /** * `library-types-match-client` rule. * * A project's `framework` field is its libType — the SET of runtime * environments it is validated to run in (browser | react | angular | node | * express). For a dependency edge Consumer C → Library L, the edge is LEGAL iff * for EVERY env `c` in C's set, up(c) ∩ L's set ≠ ∅ — i.e. every environment * the consumer promises to run in can be satisfied by the dependency. This keeps * an express app from depending on a browser-only lib, and lets a `browser+node` * lib be consumed by both react and express projects. Every violation is * appended to `problems` so `arch:generate` fails with the full list. */ export declare function validateLibraryTypesMatch(graph: EnhancedGraph, problems: string[]): void; /** * `role-dependency` rule. * * A project's `role` is its function (server | designed-lib | lib | client). * Apps are terminal — libraries and clients consume them, never the reverse: * - a `client` is fully terminal: NOTHING may depend on it. * - a `server` may only be depended upon by another `server` — the one * legitimate case is a server-side orchestrator/e2e harness that boots * other servers. A `lib`/`designed-lib`/`client` depending on a `server` * inverts the dependency direction and is a violation. * - a `bundle` is the one role permitted to depend on ANY app: it aggregates * several apps into one distributable (e.g. an nx plugin re-exposing multiple * tooling apps), so a `bundle → app` edge is legitimate, not inverted. */ export declare function validateRoleDependencies(graph: EnhancedGraph, problems: string[]): void;