You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmd/gowdk/build.go currently coordinates configuration loading, source discovery, parsing, IR assembly, Go binding, compiler validation, contract scanning, security auditing, static generation, AsyncAPI generation, generated-app output, binary/WASM compilation, Docker output, and deployment recipes.
A separate orchestration path in internal/lang.CheckFilesWithOptions performs parsing, assembly, enrichment, validation, accessibility checks, and contract scanning for check and tooling flows.
Problem
Compiler behavior is duplicated across command paths. check, build, dev, LSP, inspect, manifest, sitemap, and audit can gain different validation coverage or ordering as features are added. The CLI also carries application-service responsibilities that are difficult to test independently of flag and process handling.
Proposed direction
Introduce shared workspace/application services, for example:
The CLI should parse flags, invoke these services, stream structured diagnostics/events, and format results. LSP and other tooling should reuse the same snapshot and validation pipeline.
Acceptance criteria
There is one canonical project compilation pipeline from loaded config and source set through validated snapshot.
build, check, dev, LSP, inspect, manifest, sitemap, routes/endpoints, and audit reuse that pipeline or an explicitly documented subset.
Contract scanning, Go binding, accessibility checks, security validation, and feature validation have a single owning stage.
CLI packages no longer directly coordinate individual parser/compiler/generator subsystems.
Compiler services return structured diagnostics and events without writing directly to stdout/stderr.
The compiled snapshot can be cached and reused by multiple outputs in one command.
Unit tests exercise orchestration without invoking the CLI process.
Integration tests prove gowdk check and gowdk build agree on source validity.
Related
#667 should define the phase-typed snapshot and plan consumed by this service. #669 should own transactional publication.
Priority
High
Context
cmd/gowdk/build.gocurrently coordinates configuration loading, source discovery, parsing, IR assembly, Go binding, compiler validation, contract scanning, security auditing, static generation, AsyncAPI generation, generated-app output, binary/WASM compilation, Docker output, and deployment recipes.A separate orchestration path in
internal/lang.CheckFilesWithOptionsperforms parsing, assembly, enrichment, validation, accessibility checks, and contract scanning forcheckand tooling flows.Problem
Compiler behavior is duplicated across command paths.
check,build,dev, LSP, inspect, manifest, sitemap, and audit can gain different validation coverage or ordering as features are added. The CLI also carries application-service responsibilities that are difficult to test independently of flag and process handling.Proposed direction
Introduce shared workspace/application services, for example:
The CLI should parse flags, invoke these services, stream structured diagnostics/events, and format results. LSP and other tooling should reuse the same snapshot and validation pipeline.
Acceptance criteria
build,check,dev, LSP, inspect, manifest, sitemap, routes/endpoints, and audit reuse that pipeline or an explicitly documented subset.gowdk checkandgowdk buildagree on source validity.Related
#667 should define the phase-typed snapshot and plan consumed by this service. #669 should own transactional publication.