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
SEQUENCEeditModelPERSONDeveloperAuthor 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)↩ return10publishAll
Sequence Sequence — renderDocs scroll to zoom · drag to pan
SEQUENCErenderDocsalt[found.isErr][else]alt[dependencies.isErr][else]alt[modules.isErr][else]alt[config.isErr][else]alt[self.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 FQN1renderDocs(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>11loadModules↩ Err<cli::IoError>12loadDependencies↩ Err<cli::IoError>↩ Ok<cli::Workspace>↩ Err<cli::IoError>13resolveFormat14checkWorkspaceModules(modules: model::WorkspaceModule[], externals: model::WorkspaceModule[])15checkWorkspaceModules(modules: model::WorkspaceModule[], externals: model::WorkspaceModule[])↩ return model::ModuleDiagnostics[]↩ return model::ModuleDiagnostics[]16reportModules17prepareDiagnostics(modules: model::WorkspaceModule[], perModule: model::ModuleDiagnostics[])18prepare(modules: model::WorkspaceModule[], perModule: model::ModuleDiagnostics[])↩ return doc::DiagnosticInput[]↩ return doc::DiagnosticInput[]19graph(modules: model::WorkspaceModule[])20graph(modules: model::WorkspaceModule[])21build(modules: model::WorkspaceModule[])22noExternals23buildWithExternals↩ return model::ModuleEntry[]24graphOf↩ return model::Graph↩ return model::Graph25renderSite↩ Err<cli::IoError>26write↩ Err<cli::IoError>27isHtml28copyLogo↩ 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.prepareDiagnosticsrenderrenderMarkdownformatrunStdiocheckcheckWorkspacecheckWorkspaceModulesgraphfindRootloadrenderTokensopenDocumentprojectflowsfromModelsnapshotgridLayoutrunPipelinelayoutparseprepareDiagnosticscheckcheckWorkspaceModulesgraphbuildflowssnapshotcompletedependencyModulesdiagnosticshovermountoutlinesetSourcechatCompletefimCompletelistModelsopenopenIdeshowInstalldefinitionformatEdithovercheckparseprojectgraph
Generated by pds doc.