PseudoScript
Module

context

person

Developer #

public
context::Developer

Author of architecture models: edits `.pds` files in an IDE and runs the CLI.

Outbound

Sequence Sequence — editModel scroll to zoom · drag to pan
SEQUENCEeditModelloop[payloads]PERSONDeveloperAuthor of architecturemodels: edits `.pds`SYSTEMEditorIDEs that speak theLanguage ServerSYSTEMPseudoscriptThe PseudoScript CLI —loads a `.pds`CONTAINERCliPseudoscript`crates/pseudoscript`— the binary crateCOMPONENTLspHostPseudoscript::Cli`pds lsp` — boot aTokio runtime andCONTAINERLspPseudoscript`crates/pseudoscript-lsp`.The stdio languageCOMPONENTServerPseudoscript::LspThe tower-lsp`Backend`: owns theCOMPONENTStorePseudoscript::LspThe workspace documentstore: the server's1openDocument(doc: model::WorkspaceModule)2serveLanguage(doc: model::WorkspaceModule)3runLsp()4run()5runStdio()6runStdio()↩ return↩ Ok<void>↩ return Result<void, cli::IoError>7onChange(doc: model::WorkspaceModule)8onChange(doc: model::WorkspaceModule)9change(doc: model::WorkspaceModule)↩ return10publishAll11diagnostics()12workspace13ensureExternals14modules15buildWithExternals↩ return model::Workspace16collectDiagnostics↩ return model::ModuleDiagnostics[]17uriOf(fqn: string)↩ return string18publish
Sequence Sequence — renderDocs scroll to zoom · drag to pan
SEQUENCErenderDocsalt[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]PERSONDeveloperAuthor of architecturemodels: edits `.pds`SYSTEMPseudoscriptThe PseudoScript CLI —loads a `.pds`CONTAINERCliPseudoscript`crates/pseudoscript`— the binary crateCOMPONENTDocCmdPseudoscript::Cli`pds doc` — theheadline commandCOMPONENTLoaderPseudoscript::CliThe CLI loader:resolves the projectCONTAINERProjectPseudoscript`crates/pseudoscript-project`.The disk-facingCOMPONENTLoaderPseudoscript::ProjectResolves and reads aworkspace off disk:CONTAINERModelPseudoscript`crates/pseudoscript-model`.AST to one resolvedCOMPONENTChecksPseudoscript::ModelStatic analysis(LANG.md §2.2, §2.3,CONTAINERDocPseudoscript`crates/pseudoscript-doc`.Turns a resolved grap…COMPONENTHealthPseudoscript::DocPositions the host'sdiagnostics in theCOMPONENTBuilderPseudoscript::ModelProjects the parsed,resolved workspaceCOMPONENTWorkspacePseudoscript::ModelThe resolved set ofmodules keyed by FQNCOMPONENTSiteBuilderPseudoscript::DocOrchestrates the wholesite: build the URLCOMPONENTUrlsPseudoscript::DocMaps every node FQN toits page path andCOMPONENTPagesPseudoscript::DocProjects the resolvedgraph into per-pageCOMPONENTDiagramsPseudoscript::DocThe bridge into`emit`: project a vie…CONTAINEREmitPseudoscript`crates/pseudoscript-emit`.Projects a view into …COMPONENTProjectorPseudoscript::EmitProjects a `View` outof the graph (LANG.mdCOMPONENTEdgesPseudoscript::EmitBuilds the routed-edgeset for a C4 sceneCOMPONENTLayoutPseudoscript::EmitAssigns geometry.Projection stamps eac…COMPONENTTracePseudoscript::EmitWalks a callable'sbody trace intoCOMPONENTSsrPseudoscript::DocThe server-side renderboundary: aCOMPONENTShellPseudoscript::DocOwns the documentshell that wraps eachCOMPONENTEscapePseudoscript::DocAll user text — nodenames, `///` docs,CONTAINERUniversePseudoscript`crates/pseudoscript-universe`.Maps the resolved C4COMPONENTAdapterPseudoscript::UniverseAdapts a resolvedmodel into theCOMPONENTFlattenPseudoscript::UniverseFlattens the softwaregraph into theCOMPONENTFlowTracerPseudoscript::UniverseTraces everyentry-point flow: aCOMPONENTSearchIndexPseudoscript::DocBuilds the staticfull-text search inde…COMPONENTAssetsPseudoscript::DocShips the prebuiltpresentation bundles,COMPONENTMarkdownSitePseudoscript::DocThe static Markdownoutput mode: turns th…1renderDocs(path: string)2runDoc(path: string)3noFormatOverride4run(path: string, cliFormat: string)5findRoot(start: string)6findRoot(start: string)7findRoot(start: string)↩ return Result<string, project::IoError>↩ return Result<string, project::IoError>8ioError↩ Err<cli::IoError>↩ Ok<string>↩ Err<cli::IoError>9load(root: string)10loadManifest↩ Err<cli::IoError>11loadModules12load(root: string)13load(root: string)14findModules↩ Err<project::IoError>15readEach↩ Err<project::IoError>↩ Ok<model::WorkspaceModule[]>↩ return Result<model::WorkspaceModule[], project::IoError>16ioError↩ Err<cli::IoError>↩ Ok<model::WorkspaceModule[]>↩ Err<cli::IoError>17loadDependencies↩ Err<cli::IoError>↩ Ok<cli::Workspace>↩ Err<cli::IoError>18resolveFormat19checkWorkspaceModules(modules: model::WorkspaceModule[], externals: model::WorkspaceModule[])20checkWorkspaceModules(modules: model::WorkspaceModule[], externals: model::WorkspaceModule[])↩ return model::ModuleDiagnostics[]↩ return model::ModuleDiagnostics[]21reportModules22prepareDiagnostics(modules: model::WorkspaceModule[], perModule: model::ModuleDiagnostics[])23prepare(modules: model::WorkspaceModule[], perModule: model::ModuleDiagnostics[])↩ return doc::DiagnosticInput[]↩ return doc::DiagnosticInput[]24graph(modules: model::WorkspaceModule[])25graph(modules: model::WorkspaceModule[])26build(modules: model::WorkspaceModule[])27noExternals28buildWithExternals29resolveEach30resolveEach31index↩ return model::ModuleEntry[]↩ return model::ModuleEntry[]32graphOf33collectModule↩ return model::Graph↩ return model::Graph↩ return model::Graph34renderSite35isHtml36render(graph: model::Graph, config: doc::DocConfig, diagnostics: doc::DiagnosticInput[])37render(graph: model::Graph, config: doc::DocConfig, diagnostics: doc::DiagnosticInput[])38build(graph: model::Graph)↩ return39sortedModules(graph: model::Graph)↩ return string[]40index(graph: model::Graph, config: doc::DocConfig, modules: string[], diagnostics: doc::DiagnosticInput[])41docGroups42sidebar43navLinks44crumbsOf45moduleCards46context(graph: model::Graph)47contextView48figure49project(graph: model::Graph, view: emit::View)50project(graph: model::Graph, view: emit::View)51projectContext52collectKinds53collect(graph: model::Graph, inView: emit::PlacedNode[])54route55sortDedup↩ return emit::RoutedEdge[]56solveC4(scene: emit::Scene)↩ return emit::Scene↩ return emit::Scene↩ Ok<emit::Scene>57projectBoundary58requireKind59kindOf↩ Err<emit::EmitError>60kindMatches↩ Ok<string>↩ Err<emit::EmitError>↩ Err<emit::EmitError>61outerFrameOf62childrenOf63withOuterFrame64externalActors65nestSiblings66collect(graph: model::Graph, inView: emit::PlacedNode[])67route68sortDedup↩ return emit::RoutedEdge[]69solveC4(scene: emit::Scene)↩ return emit::Scene↩ Ok<emit::Scene>↩ return Result<emit::Scene, emit::EmitError>70projectBoundary71requireKind72kindOf↩ Err<emit::EmitError>73kindMatches↩ Ok<string>↩ Err<emit::EmitError>↩ Err<emit::EmitError>74outerFrameOf75childrenOf76withOuterFrame77externalActors78nestSiblings79collect(graph: model::Graph, inView: emit::PlacedNode[])80route81sortDedup↩ return emit::RoutedEdge[]82solveC4(scene: emit::Scene)↩ return emit::Scene↩ Ok<emit::Scene>↩ return Result<emit::Scene, emit::EmitError>83projectData↩ return Result<emit::Scene, emit::EmitError>84projectFeature↩ return Result<emit::Scene, emit::EmitError>85projectSequence86requireKind87kindOf↩ Err<emit::EmitError>88kindMatches↩ Ok<string>↩ Err<emit::EmitError>↩ Err<emit::EmitError>89bodyOf90blackBox(graph: model::Graph, entry: string)91ownerOf92blackBoxActor93inboundCall94returnItem95participantsOf↩ return emit::Scene↩ Ok<emit::Scene>96walk(graph: model::Graph, entry: string, body: model::Step[])97ownerOf98triggerActorOf99entryStack100untriggered101noCaller102traceItems103participantsOf↩ return emit::Scene↩ return emit::Scene104inboundCall105traceItems106prependItem107participantsOf↩ return emit::Scene↩ Ok<emit::Scene>↩ return Result<emit::Scene, emit::EmitError>↩ return Result<emit::Scene, emit::EmitError>↩ return doc::Diagram108embed109svgFigure↩ return doc::Diagram↩ return doc::Diagram↩ return doc::Diagram110stats↩ return doc::PageProps111emitPage112renderPage(props: doc::PageProps)↩ return Result<doc::RenderedPage, doc::RenderError>↩ Err<doc::RenderError>113wrap(path: string, props: doc::PageProps, rendered: doc::RenderedPage)114text(text: string)↩ return string115document↩ return string↩ Ok<doc::SiteFile>↩ Err<doc::RenderError>116emitDocPages↩ Err<doc::RenderError>117emitModulePages↩ Err<doc::RenderError>118universePage(graph: model::Graph, config: doc::DocConfig, modules: string[], diagnostics: doc::DiagnosticInput[])119docGroups120sidebar121navLinks122crumbsOf123fromModel(graph: model::Graph)124fromModel(graph: model::Graph)125placeStructural126wireContainment127tallyTraffic↩ return universe::SoftwareGraph↩ return universe::SoftwareGraph128snapshot(graph: universe::SoftwareGraph)129snapshot(graph: universe::SoftwareGraph)130nodesOf131edgesOf↩ return universe::Snapshot↩ return universe::Snapshot132flows(graph: model::Graph)133flows(graph: model::Graph)134entryPoints135traceAll↩ return universe::FlowDef[]↩ return universe::FlowDef[]136nodeHrefs↩ return doc::PageProps137emitPage138renderPage(props: doc::PageProps)↩ return Result<doc::RenderedPage, doc::RenderError>↩ Err<doc::RenderError>139wrap(path: string, props: doc::PageProps, rendered: doc::RenderedPage)140text(text: string)↩ return string141document↩ return string↩ Ok<doc::SiteFile>↩ Err<doc::RenderError>142healthPage(graph: model::Graph, config: doc::DocConfig, modules: string[], diagnostics: doc::DiagnosticInput[])143docGroups144sidebar145navLinks146crumbsOf147page(graph: model::Graph, diagnostics: doc::DiagnosticInput[])148attributeAll149countOf150countOf↩ return doc::PageBody↩ return doc::PageProps151emitPage152renderPage(props: doc::PageProps)↩ return Result<doc::RenderedPage, doc::RenderError>↩ Err<doc::RenderError>153wrap(path: string, props: doc::PageProps, rendered: doc::RenderedPage)154text(text: string)↩ return string155document↩ return string↩ Ok<doc::SiteFile>↩ Err<doc::RenderError>156build(graph: model::Graph, config: doc::DocConfig)157entries↩ return doc::SiteFile158shared()↩ return doc::SiteFile[]↩ Ok<doc::Site>↩ return Result<doc::Site, doc::RenderError>159renderError↩ Err<cli::IoError>↩ Ok<doc::Site>160renderMarkdown161renderMarkdown(graph: model::Graph, config: doc::DocConfig, diagnostics: doc::DiagnosticInput[])162buildAll(graph: model::Graph, config: doc::DocConfig, diagnostics: doc::DiagnosticInput[])↩ return doc::PageProps[]163render(pages: doc::PageProps[], theme: doc::Theme)↩ return doc::Site↩ return doc::Site↩ return doc::Site↩ Ok<doc::Site>↩ Err<cli::IoError>164write↩ Err<cli::IoError>165isHtml166copyLogo↩ Ok<string>↩ Err<cli::IoError>↩ Ok<void>
system

Editor #

public
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.

Inbound

Outbound

Containers Container diagram scroll to zoom · drag to pan
PERSONDeveloperAuthor of architecture models: edits `.pds`files in an IDE and runs the CLI.SYSTEMPseudoscriptThe 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

Inbound

Outbound

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
FEATUREDocumentAWorkspacefor PseudoscriptGIVENa directory holding a pds.toml and oneor more .pds modulesANDthe modules form a well-formed C4modelWHENthe developer runs `pds doc` againstthe directoryTHENevery module is loaded into oneresolved graphANDC4 and sequence diagrams are projectedas scene geometry the site's clientislands drawANDa static site is written under theconfigured 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
FEATURECheckAModelfor PseudoscriptGIVENa .pds source fileWHENthe developer runs `pds check` on itTHENthe source is parsed with errorrecoveryANDresolution, visibility, Result-flow,and return-coverage checks runANDevery violation is reported as adiagnosticBUTa well-formed model reports nothingand 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
FEATUREFormatAModelfor PseudoscriptGIVENa .pds source file with non-canonicalspacingWHENthe developer runs `pds fmt`THENthe source is parsed andpretty-printed to canonicalPseudoScriptANDcomments and blank-line runs arepreservedBUTunparseable source is rejected withoutrewriting 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
FEATUREEditModelInIdefor PseudoscriptGIVENan editor that speaks the LanguageServer ProtocolAND`pds lsp` running as a child processover stdioWHENthe author changes a documentTHENthe server re-checks the document fromits current textANDdiagnostics are published back to theeditor
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
FEATUREServeLiveDocsfor PseudoscriptGIVENa generated documentation siteWHENthe developer runs `pds doc --serve--watch`THENthe site is hosted over HTTP onlocalhostANDa change to any .pds or pds.tomlrebuilds the siteANDthe browser live-reloads to the newversion
Containers Container diagram scroll to zoom · drag to pan
PseudoscriptCONTAINERCli`crates/pseudoscript` — the binary crate(`pds`). The composition root and only I/O…CONTAINERDoc`crates/pseudoscript-doc`. Turns a resolvedgraph into a Svelte-rendered,…CONTAINERDot`crates/pseudoscript-dot`. Runs thefour-pass layered pipeline over a `Graph` t…CONTAINEREmit`crates/pseudoscript-emit`. Projects a viewinto a `Scene` and renders it to SVG; C4…CONTAINERFormat`crates/pseudoscript-format`. The canonicalformatter: parse, then pretty-print the tre…CONTAINERIdeSession`crates/pseudoscript-ide` — the IDEapplication, Rust compiled to a single wasm…CONTAINERWebIde`web-ide` — the IDE at `ide.pdscript.dev`: aSvelteKit shell on Cloudflare Workers stati…CONTAINERLanding`web-landing` — the marketing site at`pdscript.dev`. A static Svelte build on…CONTAINERLayout`crates/pseudoscript-layout`. Thegeometry/text `Core` and the sequence…CONTAINERLsp`crates/pseudoscript-lsp`. The stdiolanguage server (tower-lsp): workspace…CONTAINERLspCore`crates/pseudoscript-lsp-core`. The singlehome for language intelligence as…CONTAINERModel`crates/pseudoscript-model`. AST to oneresolved graph; static checks (resolution,…CONTAINERProject`crates/pseudoscript-project`. Thedisk-facing loader: resolves the workspace…CONTAINERSyntax`crates/pseudoscript-syntax`. The foundationcrate: source text to tokens and a typed…CONTAINERUniverse`crates/pseudoscript-universe`. Maps theresolved C4 model into the software graph…PERSONDeveloperAuthor of architecture models: edits `.pds`files in an IDE and runs the CLI.SYSTEMEditorIDEs that speak the Language Server Protocol(VS Code, Neovim, …). The editor spawns `pd…SYSTEMLlmProviderThe author's configured OpenAI-compatiblecompletion provider — hosted (OpenAI,…PERSONVisitorA prospective user reading the landing page.prepareDiagnosticsrenderrenderMarkdownformatrunStdiocheckcheckWorkspaceModulesgraphfindRootloadrenderTokensopenDocumentprojectflowsfromModelsnapshotgridLayoutrunPipelinelayoutparseprepareDiagnosticscheckcheckWorkspaceModulesgraphbuildflowssnapshotcompletedependencyModulesdiagnosticshovermountoutlinesetSourcechatCompletefimCompletelistModelsopenopenIdeshowInstalldefinitionformatEdithovercheckparseprojectgraph
Generated by pds doc.