import type { ModelGraph } from "../loader/model-graph.js"; import type { ModelNode } from "../schema/index.js"; /** * The Phase-2 query command family (Proposal 006 B4 / 001 §4.2 §8): * `impact` / `plan` / `scenario` / `evidence` — focused views over the model, * distinct from A5's general-purpose `inspect` slice. All are PURE functions of * the loaded graph; the CLI and MCP layers add I/O (side-channel file) around * them. Each returns `undefined` when the id isn't found (callers turn that * into an "unknown id" error), and a small structured result the renderers in * this file turn into a stdout summary + a full side-channel body. */ export interface Dependent { id: string; kind: ModelNode["kind"]; /** How it depends on the queried node (which reference field links them). */ relation: string; } export interface ImpactResult { nodeId: string; kind: ModelNode["kind"]; dependents: Dependent[]; } /** * Everything that references `nodeId` — the set a change to it may force you to * re-check. Reverse edges only (who points AT this node), deliberately NOT the * general bidirectional slice `inspect` gives: this answers "if I change X, * what's the blast radius", not "what's near X". */ export declare function impactOf(graph: ModelGraph, nodeId: string): ImpactResult | undefined; export interface PlanStep { loopId: string; title: string; status: string; /** effective-constraint scenario ids that apply to this loop (invariants). */ effectiveConstraints: string[]; } export interface PlanResult { flowId: string; title: string; steps: PlanStep[]; guards: { loopId: string; title: string; }[]; junctions: { id: string; risk_class: string; between: string[]; title: string; }[]; subFlows: string[]; } /** The ordered "how this flow runs" plan: traverses sequence, guards, crossing junctions. */ export declare function planOf(graph: ModelGraph, flowId: string): PlanResult | undefined; export interface ScenarioResult { scenario: import("../schema/index.js").Scenario; /** loops/junctions that list this scenario in their `scenarios` array. */ referencedBy: { id: string; kind: "loop" | "junction"; }[]; /** loops this scenario applies to via applies_to (resolved at query time). */ appliesToLoops: string[]; } export declare function scenarioDetail(graph: ModelGraph, scenarioId: string): ScenarioResult | undefined; export interface EvidenceResult { nodeId: string; kind: ModelNode["kind"]; /** Junction evidence entries (kind/anchor/note), if the node is a junction. */ evidence: import("../schema/index.js").Evidence[]; /** Anchor strings, if the node carries its own (loop or flow). */ anchors: string[]; /** scenarios bound to this node (its own `scenarios` + effective constraints for loops). */ scenarios: string[]; } export declare function evidenceOf(graph: ModelGraph, nodeId: string): EvidenceResult | undefined; export interface MatrixRow { scenarioId: string; level: string; /** Test anchors this GWT is bound to (Scenario.verified_by). Empty = unverified. */ verifiedBy: string[]; /** in-flow nodes (junction/loop) that reference this scenario, or "applies_to" for an invariant. */ referencedBy: string[]; verified: boolean; } export interface TestMatrixResult { flowId: string; title: string; rows: MatrixRow[]; /** * `unknownScenario` counts rows whose scenario id resolved to no Scenario * node — always 0 on a T0-passing model (referential integrity catches * dangling scenario refs), surfaced anyway so a broken model isn't silent. */ summary: { total: number; verified: number; unverified: number; unknownScenario: number; }; } /** * The GWT↔test binding matrix for a flow (Proposal 006 B5 / 001 §12 "GWT 独立于 * 测试代码长期存在"): every scenario reachable from the flow — via its crossing * junctions, its traversed/guarding loops, and each loop's effective * constraints — with the tests it's bound to and whether it's verified. Makes * the flow's test-coverage surface legible at a glance (which GWT are grounded * in a real test, which are deliberately unverified). */ export declare function testMatrix(graph: ModelGraph, flowId: string): TestMatrixResult | undefined; //# sourceMappingURL=queries.d.ts.map