Overview Modules context person Developer # public context::Developer Author of architecture models: edits `.pds` files in an IDE and runs the CLI.
Sequence Sequence — editModel scroll to zoom · drag to pan + − ⟲ ⤢ SEQUENCE editModel loop [payloads] PERSON Developer Author of architecture models: edits `.pds` SYSTEM Editor IDEs that speak the Language Server SYSTEM Pseudoscript The PseudoScript CLI — loads a `.pds` CONTAINER Cli Pseudoscript `crates/pseudoscript` — the binary crate COMPONENT LspHost Pseudoscript::Cli `pds lsp` — boot a Tokio runtime and CONTAINER Lsp Pseudoscript `crates/pseudoscript-lsp`. The stdio language COMPONENT Server Pseudoscript::Lsp The tower-lsp `Backend`: owns the COMPONENT Store Pseudoscript::Lsp The workspace document store: the server's 1 openDocument(doc: model::WorkspaceModule) 2 serveLanguage(doc: model::WorkspaceModule) 3 runLsp() 4 run() 5 runStdio() 6 runStdio() ↩ return ↩ Ok<void> ↩ return Result<void, cli::IoError> 7 onChange(doc: model::WorkspaceModule) 8 onChange(doc: model::WorkspaceModule) 9 change(doc: model::WorkspaceModule) ↩ return 10 publishAll 11 diagnostics() 12 workspace 13 ensureExternals 14 modules 15 buildWithExternals ↩ return model::Workspace 16 collectDiagnostics ↩ return model::ModuleDiagnostics[] 17 uriOf(fqn: string) ↩ return string 18 publish Sequence Sequence — renderDocs scroll to zoom · drag to pan + − ⟲ ⤢ SEQUENCE renderDocs alt [found.isErr] [else] alt [modules.isErr] [else] alt [files.isErr] [else] alt [loaded.isErr] [else] alt [dependencies.isErr] [else] alt [modules.isErr] [else] alt [config.isErr] [else] loop [entries] alt [kindMatches()] [else] alt [found.isErr] [else] alt [anchor.isErr] [else] alt [kindMatches()] [else] alt [found.isErr] [else] alt [anchor.isErr] [else] alt [kindMatches()] [else] alt [found.isErr] [else] alt [actor.isNone] [else] alt [disclosed.isNone] [else] alt [node.isErr] [else] alt [view.isFeature] [else] alt [view.isData] [else] alt [view.isComponent] [else] alt [view.isContainer] [else] alt [view.isContext] [else] alt [scene.isErr] [else] alt [rendered.isErr] [else] alt [rendered.isErr] [else] alt [rendered.isErr] [else] alt [health.isErr] [else] alt [universe.isErr] [else] alt [modulePages.isErr] [else] alt [docPages.isErr] [else] alt [index.isErr] [else] alt [html.isErr] [else] alt [isHtml()] [else] alt [isHtml()] alt [written.isErr] [else] alt [site.isErr] [else] alt [project.isErr] [else] alt [root.isErr] [else] alt [built.isErr] [else] PERSON Developer Author of architecture models: edits `.pds` SYSTEM Pseudoscript The PseudoScript CLI — loads a `.pds` CONTAINER Cli Pseudoscript `crates/pseudoscript` — the binary crate COMPONENT DocCmd Pseudoscript::Cli `pds doc` — the headline command COMPONENT Loader Pseudoscript::Cli The CLI loader: resolves the project CONTAINER Project Pseudoscript `crates/pseudoscript-project`. The disk-facing COMPONENT Loader Pseudoscript::Project Resolves and reads a workspace off disk: CONTAINER Model Pseudoscript `crates/pseudoscript-model`. AST to one resolved COMPONENT Checks Pseudoscript::Model Static analysis (LANG.md §2.2, §2.3, CONTAINER Doc Pseudoscript `crates/pseudoscript-doc`. Turns a resolved grap… COMPONENT Health Pseudoscript::Doc Positions the host's diagnostics in the COMPONENT Builder Pseudoscript::Model Projects the parsed, resolved workspace COMPONENT Workspace Pseudoscript::Model The resolved set of modules keyed by FQN COMPONENT SiteBuilder Pseudoscript::Doc Orchestrates the whole site: build the URL COMPONENT Urls Pseudoscript::Doc Maps every node FQN to its page path and COMPONENT Pages Pseudoscript::Doc Projects the resolved graph into per-page COMPONENT Diagrams Pseudoscript::Doc The bridge into `emit`: project a vie… CONTAINER Emit Pseudoscript `crates/pseudoscript-emit`. Projects a view into … COMPONENT Projector Pseudoscript::Emit Projects a `View` out of the graph (LANG.md COMPONENT Edges Pseudoscript::Emit Builds the routed-edge set for a C4 scene COMPONENT Layout Pseudoscript::Emit Assigns geometry. Projection stamps eac… COMPONENT Trace Pseudoscript::Emit Walks a callable's body trace into COMPONENT Ssr Pseudoscript::Doc The server-side render boundary: a COMPONENT Shell Pseudoscript::Doc Owns the document shell that wraps each COMPONENT Escape Pseudoscript::Doc All user text — node names, `///` docs, CONTAINER Universe Pseudoscript `crates/pseudoscript-universe`. Maps the resolved C4 COMPONENT Adapter Pseudoscript::Universe Adapts a resolved model into the COMPONENT Flatten Pseudoscript::Universe Flattens the software graph into the COMPONENT FlowTracer Pseudoscript::Universe Traces every entry-point flow: a COMPONENT SearchIndex Pseudoscript::Doc Builds the static full-text search inde… COMPONENT Assets Pseudoscript::Doc Ships the prebuilt presentation bundles, COMPONENT MarkdownSite Pseudoscript::Doc The static Markdown output mode: turns th… 1 renderDocs(path: string) 2 runDoc(path: string) 3 noFormatOverride 4 run(path: string, cliFormat: string) 5 findRoot(start: string) 6 findRoot(start: string) 7 findRoot(start: string) ↩ return Result<string, project::IoError> ↩ return Result<string, project::IoError> 8 ioError ↩ Err<cli::IoError> ↩ Ok<string> ↩ Err<cli::IoError> 9 load(root: string) 10 loadManifest ↩ Err<cli::IoError> 11 loadModules 12 load(root: string) 13 load(root: string) 14 findModules ↩ Err<project::IoError> 15 readEach ↩ Err<project::IoError> ↩ Ok<model::WorkspaceModule[]> ↩ return Result<model::WorkspaceModule[], project::IoError> 16 ioError ↩ Err<cli::IoError> ↩ Ok<model::WorkspaceModule[]> ↩ Err<cli::IoError> 17 loadDependencies ↩ Err<cli::IoError> ↩ Ok<cli::Workspace> ↩ Err<cli::IoError> 18 resolveFormat 19 checkWorkspaceModules(modules: model::WorkspaceModule[], externals: model::WorkspaceModule[]) 20 checkWorkspaceModules(modules: model::WorkspaceModule[], externals: model::WorkspaceModule[]) ↩ return model::ModuleDiagnostics[] ↩ return model::ModuleDiagnostics[] 21 reportModules 22 prepareDiagnostics(modules: model::WorkspaceModule[], perModule: model::ModuleDiagnostics[]) 23 prepare(modules: model::WorkspaceModule[], perModule: model::ModuleDiagnostics[]) ↩ return doc::DiagnosticInput[] ↩ return doc::DiagnosticInput[] 24 graph(modules: model::WorkspaceModule[]) 25 graph(modules: model::WorkspaceModule[]) 26 build(modules: model::WorkspaceModule[]) 27 noExternals 28 buildWithExternals 29 resolveEach 30 resolveEach 31 index ↩ return model::ModuleEntry[] ↩ return model::ModuleEntry[] 32 graphOf 33 collectModule ↩ return model::Graph ↩ return model::Graph ↩ return model::Graph 34 renderSite 35 isHtml 36 render(graph: model::Graph, config: doc::DocConfig, diagnostics: doc::DiagnosticInput[]) 37 render(graph: model::Graph, config: doc::DocConfig, diagnostics: doc::DiagnosticInput[]) 38 build(graph: model::Graph) ↩ return 39 sortedModules(graph: model::Graph) ↩ return string[] 40 index(graph: model::Graph, config: doc::DocConfig, modules: string[], diagnostics: doc::DiagnosticInput[]) 41 docGroups 42 sidebar 43 navLinks 44 crumbsOf 45 moduleCards 46 context(graph: model::Graph) 47 contextView 48 figure 49 project(graph: model::Graph, view: emit::View) 50 project(graph: model::Graph, view: emit::View) 51 projectContext 52 collectKinds 53 collect(graph: model::Graph, inView: emit::PlacedNode[]) 54 route 55 sortDedup ↩ return emit::RoutedEdge[] 56 solveC4(scene: emit::Scene) ↩ return emit::Scene ↩ return emit::Scene ↩ Ok<emit::Scene> 57 projectBoundary 58 requireKind 59 kindOf ↩ Err<emit::EmitError> 60 kindMatches ↩ Ok<string> ↩ Err<emit::EmitError> ↩ Err<emit::EmitError> 61 outerFrameOf 62 childrenOf 63 withOuterFrame 64 externalActors 65 nestSiblings 66 collect(graph: model::Graph, inView: emit::PlacedNode[]) 67 route 68 sortDedup ↩ return emit::RoutedEdge[] 69 solveC4(scene: emit::Scene) ↩ return emit::Scene ↩ Ok<emit::Scene> ↩ return Result<emit::Scene, emit::EmitError> 70 projectBoundary 71 requireKind 72 kindOf ↩ Err<emit::EmitError> 73 kindMatches ↩ Ok<string> ↩ Err<emit::EmitError> ↩ Err<emit::EmitError> 74 outerFrameOf 75 childrenOf 76 withOuterFrame 77 externalActors 78 nestSiblings 79 collect(graph: model::Graph, inView: emit::PlacedNode[]) 80 route 81 sortDedup ↩ return emit::RoutedEdge[] 82 solveC4(scene: emit::Scene) ↩ return emit::Scene ↩ Ok<emit::Scene> ↩ return Result<emit::Scene, emit::EmitError> 83 projectData ↩ return Result<emit::Scene, emit::EmitError> 84 projectFeature ↩ return Result<emit::Scene, emit::EmitError> 85 projectSequence 86 requireKind 87 kindOf ↩ Err<emit::EmitError> 88 kindMatches ↩ Ok<string> ↩ Err<emit::EmitError> ↩ Err<emit::EmitError> 89 bodyOf 90 blackBox(graph: model::Graph, entry: string) 91 ownerOf 92 blackBoxActor 93 inboundCall 94 returnItem 95 participantsOf ↩ return emit::Scene ↩ Ok<emit::Scene> 96 walk(graph: model::Graph, entry: string, body: model::Step[]) 97 ownerOf 98 triggerActorOf 99 entryStack 100 untriggered 101 noCaller 102 traceItems 103 participantsOf ↩ return emit::Scene ↩ return emit::Scene 104 inboundCall 105 traceItems 106 prependItem 107 participantsOf ↩ return emit::Scene ↩ Ok<emit::Scene> ↩ return Result<emit::Scene, emit::EmitError> ↩ return Result<emit::Scene, emit::EmitError> ↩ return doc::Diagram 108 embed 109 svgFigure ↩ return doc::Diagram ↩ return doc::Diagram ↩ return doc::Diagram 110 stats ↩ return doc::PageProps 111 emitPage 112 renderPage(props: doc::PageProps) ↩ return Result<doc::RenderedPage, doc::RenderError> ↩ Err<doc::RenderError> 113 wrap(path: string, props: doc::PageProps, rendered: doc::RenderedPage) 114 text(text: string) ↩ return string 115 document ↩ return string ↩ Ok<doc::SiteFile> ↩ Err<doc::RenderError> 116 emitDocPages ↩ Err<doc::RenderError> 117 emitModulePages ↩ Err<doc::RenderError> 118 universePage(graph: model::Graph, config: doc::DocConfig, modules: string[], diagnostics: doc::DiagnosticInput[]) 119 docGroups 120 sidebar 121 navLinks 122 crumbsOf 123 fromModel(graph: model::Graph) 124 fromModel(graph: model::Graph) 125 placeStructural 126 wireContainment 127 tallyTraffic ↩ return universe::SoftwareGraph ↩ return universe::SoftwareGraph 128 snapshot(graph: universe::SoftwareGraph) 129 snapshot(graph: universe::SoftwareGraph) 130 nodesOf 131 edgesOf ↩ return universe::Snapshot ↩ return universe::Snapshot 132 flows(graph: model::Graph) 133 flows(graph: model::Graph) 134 entryPoints 135 traceAll ↩ return universe::FlowDef[] ↩ return universe::FlowDef[] 136 nodeHrefs ↩ return doc::PageProps 137 emitPage 138 renderPage(props: doc::PageProps) ↩ return Result<doc::RenderedPage, doc::RenderError> ↩ Err<doc::RenderError> 139 wrap(path: string, props: doc::PageProps, rendered: doc::RenderedPage) 140 text(text: string) ↩ return string 141 document ↩ return string ↩ Ok<doc::SiteFile> ↩ Err<doc::RenderError> 142 healthPage(graph: model::Graph, config: doc::DocConfig, modules: string[], diagnostics: doc::DiagnosticInput[]) 143 docGroups 144 sidebar 145 navLinks 146 crumbsOf 147 page(graph: model::Graph, diagnostics: doc::DiagnosticInput[]) 148 attributeAll 149 countOf 150 countOf ↩ return doc::PageBody ↩ return doc::PageProps 151 emitPage 152 renderPage(props: doc::PageProps) ↩ return Result<doc::RenderedPage, doc::RenderError> ↩ Err<doc::RenderError> 153 wrap(path: string, props: doc::PageProps, rendered: doc::RenderedPage) 154 text(text: string) ↩ return string 155 document ↩ return string ↩ Ok<doc::SiteFile> ↩ Err<doc::RenderError> 156 build(graph: model::Graph, config: doc::DocConfig) 157 entries ↩ return doc::SiteFile 158 shared() ↩ return doc::SiteFile[] ↩ Ok<doc::Site> ↩ return Result<doc::Site, doc::RenderError> 159 renderError ↩ Err<cli::IoError> ↩ Ok<doc::Site> 160 renderMarkdown 161 renderMarkdown(graph: model::Graph, config: doc::DocConfig, diagnostics: doc::DiagnosticInput[]) 162 buildAll(graph: model::Graph, config: doc::DocConfig, diagnostics: doc::DiagnosticInput[]) ↩ return doc::PageProps[] 163 render(pages: doc::PageProps[], theme: doc::Theme) ↩ return doc::Site ↩ return doc::Site ↩ return doc::Site ↩ Ok<doc::Site> ↩ Err<cli::IoError> 164 write ↩ Err<cli::IoError> 165 isHtml 166 copyLogo ↩ Ok<string> ↩ Err<cli::IoError> ↩ Ok<void> context::Editor IDEs that speak the Language Server Protocol (VS Code, Neovim, …). The editor
spawns `pds lsp` as a child process and drives it over stdio: it streams
document changes to the server and renders the diagnostics it publishes.
Containers Container diagram scroll to zoom · drag to pan + − ⟲ ⤢ PERSON Developer Author of architecture models: edits `.pds` files in an IDE and runs the CLI. SYSTEM Pseudoscript The PseudoScript CLI — loads a `.pds` workspace into one resolved graph and… renderDocs system Pseudoscript # public context::Pseudoscript The PseudoScript CLI — loads a `.pds` workspace into one resolved graph and
documents it as a static site, or serves the language to editors. Cross-system
callers couple to these published faces; the containers stay behind them.
#headline
Scenarios DocumentAWorkspace
Render a `.pds` workspace to a browsable documentation site — the headline
flow, aggregating load, check, graph, project, and write.
#headline
given a directory holding a pds.toml and one or more .pds modules and the modules form a well-formed C4 model when the developer runs `pds doc` against the directory then every module is loaded into one resolved graph and C4 and sequence diagrams are projected as scene geometry the site's client islands draw and a static site is written under the configured output directory Flow Flow — DocumentAWorkspace scroll to zoom · drag to pan + − ⟲ ⤢ FEATURE DocumentAWorkspace for Pseudoscript GIVEN a directory holding a pds.toml and one or more .pds modules AND the modules form a well-formed C4 model WHEN the developer runs `pds doc` against the directory THEN every module is loaded into one resolved graph AND C4 and sequence diagrams are projected as scene geometry the site's client islands draw AND a static site is written under the configured output directory CheckAModel
Statically validate a model and report what is wrong.
given a .pds source file when the developer runs `pds check` on it then the source is parsed with error recovery and resolution, visibility, Result-flow, and return-coverage checks run and every violation is reported as a diagnostic but a well-formed model reports nothing and exits zero Flow Flow — CheckAModel scroll to zoom · drag to pan + − ⟲ ⤢ FEATURE CheckAModel for Pseudoscript GIVEN a .pds source file WHEN the developer runs `pds check` on it THEN the source is parsed with error recovery AND resolution, visibility, Result-flow, and return-coverage checks run AND every violation is reported as a diagnostic BUT a well-formed model reports nothing and exits zero FormatAModel
Reformat a model to one canonical form.
given a .pds source file with non-canonical spacing when the developer runs `pds fmt` then the source is parsed and pretty-printed to canonical PseudoScript and comments and blank-line runs are preserved but unparseable source is rejected without rewriting the file Flow Flow — FormatAModel scroll to zoom · drag to pan + − ⟲ ⤢ FEATURE FormatAModel for Pseudoscript GIVEN a .pds source file with non-canonical spacing WHEN the developer runs `pds fmt` THEN the source is parsed and pretty-printed to canonical PseudoScript AND comments and blank-line runs are preserved BUT unparseable source is rejected without rewriting the file EditModelInIde
Author a model in an editor with live diagnostics.
given an editor that speaks the Language Server Protocol and `pds lsp` running as a child process over stdio when the author changes a document then the server re-checks the document from its current text and diagnostics are published back to the editor Flow Flow — EditModelInIde scroll to zoom · drag to pan + − ⟲ ⤢ FEATURE EditModelInIde for Pseudoscript GIVEN an editor that speaks the Language Server Protocol AND `pds lsp` running as a child process over stdio WHEN the author changes a document THEN the server re-checks the document from its current text AND diagnostics are published back to the editor ServeLiveDocs
Preview docs that rebuild as the model changes.
given a generated documentation site when the developer runs `pds doc --serve --watch` then the site is hosted over HTTP on localhost and a change to any .pds or pds.toml rebuilds the site and the browser live-reloads to the new version Flow Flow — ServeLiveDocs scroll to zoom · drag to pan + − ⟲ ⤢ FEATURE ServeLiveDocs for Pseudoscript GIVEN a generated documentation site WHEN the developer runs `pds doc --serve --watch` THEN the site is hosted over HTTP on localhost AND a change to any .pds or pds.toml rebuilds the site AND the browser live-reloads to the new version Containers Container diagram scroll to zoom · drag to pan + − ⟲ ⤢ Pseudoscript CONTAINER Cli `crates/pseudoscript` — the binary crate (`pds`). The composition root and only I/O… CONTAINER Doc `crates/pseudoscript-doc`. Turns a resolved graph into a Svelte-rendered,… CONTAINER Dot `crates/pseudoscript-dot`. Runs the four-pass layered pipeline over a `Graph` t… CONTAINER Emit `crates/pseudoscript-emit`. Projects a view into a `Scene` and renders it to SVG; C4… CONTAINER Format `crates/pseudoscript-format`. The canonical formatter: parse, then pretty-print the tre… CONTAINER IdeSession `crates/pseudoscript-ide` — the IDE application, Rust compiled to a single wasm… CONTAINER WebIde `web-ide` — the IDE at `ide.pdscript.dev`: a SvelteKit shell on Cloudflare Workers stati… CONTAINER Landing `web-landing` — the marketing site at `pdscript.dev`. A static Svelte build on… CONTAINER Layout `crates/pseudoscript-layout`. The geometry/text `Core` and the sequence… CONTAINER Lsp `crates/pseudoscript-lsp`. The stdio language server (tower-lsp): workspace… CONTAINER LspCore `crates/pseudoscript-lsp-core`. The single home for language intelligence as… CONTAINER Model `crates/pseudoscript-model`. AST to one resolved graph; static checks (resolution,… CONTAINER Project `crates/pseudoscript-project`. The disk-facing loader: resolves the workspace… CONTAINER Syntax `crates/pseudoscript-syntax`. The foundation crate: source text to tokens and a typed… CONTAINER Universe `crates/pseudoscript-universe`. Maps the resolved C4 model into the software graph… PERSON Developer Author of architecture models: edits `.pds` files in an IDE and runs the CLI. SYSTEM Editor IDEs that speak the Language Server Protocol (VS Code, Neovim, …). The editor spawns `pd… SYSTEM LlmProvider The author's configured OpenAI-compatible completion provider — hosted (OpenAI,… PERSON Visitor A prospective user reading the landing page. prepareDiagnostics render renderMarkdown format runStdio check checkWorkspaceModules graph findRoot load renderTokens openDocument project flows fromModel snapshot gridLayout runPipeline layout parse prepareDiagnostics check checkWorkspaceModules graph build flows snapshot complete dependencyModules diagnostics hover mount outline setSource chatComplete fimComplete listModels open openIde showInstall definition formatEdit hover check parse project graph